@alfadocs/ui-kit-debug 1.56.0 → 1.57.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 (357) hide show
  1. package/dist/_chunks/{ai-credits-notice-BoNJtOuE.js → ai-credits-notice-ktklr8fy.js} +2 -2
  2. package/dist/_chunks/{ai-credits-notice-BoNJtOuE.js.map → ai-credits-notice-ktklr8fy.js.map} +1 -1
  3. package/dist/_chunks/ai-permission-notice-DyuEGwAt.js +206 -0
  4. package/dist/_chunks/ai-permission-notice-DyuEGwAt.js.map +1 -0
  5. package/dist/_chunks/alia-sidebar-BBKBJCv6.js +1284 -0
  6. package/dist/_chunks/alia-sidebar-BBKBJCv6.js.map +1 -0
  7. package/dist/_chunks/{anamnesis-summary-rows-CQ-XGr0T.js → anamnesis-summary-rows-CCQ62mMN.js} +4 -4
  8. package/dist/_chunks/{anamnesis-summary-rows-CQ-XGr0T.js.map → anamnesis-summary-rows-CCQ62mMN.js.map} +1 -1
  9. package/dist/_chunks/{appointment-peek-BIZaDeCi.js → appointment-peek-WvNbE4JG.js} +2 -2
  10. package/dist/_chunks/{appointment-peek-BIZaDeCi.js.map → appointment-peek-WvNbE4JG.js.map} +1 -1
  11. package/dist/_chunks/{appointment-timeline-DmqYEIT9.js → appointment-timeline-Z0494xO-.js} +2 -2
  12. package/dist/_chunks/{appointment-timeline-DmqYEIT9.js.map → appointment-timeline-Z0494xO-.js.map} +1 -1
  13. package/dist/_chunks/{balance-badge-cell-DmDcXw0c.js → balance-badge-cell-CII3SDmR.js} +3 -3
  14. package/dist/_chunks/{balance-badge-cell-DmDcXw0c.js.map → balance-badge-cell-CII3SDmR.js.map} +1 -1
  15. package/dist/_chunks/{booking-WyNGKPE2.js → booking-81WnKDsH.js} +3 -3
  16. package/dist/_chunks/{booking-WyNGKPE2.js.map → booking-81WnKDsH.js.map} +1 -1
  17. package/dist/_chunks/{calculator-dialog-pCPWta7h.js → calculator-dialog-CzQv03p0.js} +2 -2
  18. package/dist/_chunks/{calculator-dialog-pCPWta7h.js.map → calculator-dialog-CzQv03p0.js.map} +1 -1
  19. package/dist/_chunks/{calendar-workspace-Du2ryaI-.js → calendar-workspace-D5-k_9zE.js} +13 -13
  20. package/dist/_chunks/{calendar-workspace-Du2ryaI-.js.map → calendar-workspace-D5-k_9zE.js.map} +1 -1
  21. package/dist/_chunks/{care-plan-card-Ddjh5Doc.js → care-plan-card-DxrRLRdW.js} +2 -2
  22. package/dist/_chunks/{care-plan-card-Ddjh5Doc.js.map → care-plan-card-DxrRLRdW.js.map} +1 -1
  23. package/dist/_chunks/{care-plan-header-DUX_SVvF.js → care-plan-header-BMwZIgHJ.js} +2 -2
  24. package/dist/_chunks/{care-plan-header-DUX_SVvF.js.map → care-plan-header-BMwZIgHJ.js.map} +1 -1
  25. package/dist/_chunks/{chart-HsF1KHbx.js → chart-DQ5GxqgT.js} +347 -350
  26. package/dist/_chunks/chart-DQ5GxqgT.js.map +1 -0
  27. package/dist/_chunks/{clinical-note-card-14JIoUR0.js → clinical-note-card-hx939bvw.js} +2 -2
  28. package/dist/_chunks/{clinical-note-card-14JIoUR0.js.map → clinical-note-card-hx939bvw.js.map} +1 -1
  29. package/dist/_chunks/{color-picker-BRQ4Y9SO.js → color-picker-BsggJovx.js} +128 -123
  30. package/dist/_chunks/color-picker-BsggJovx.js.map +1 -0
  31. package/dist/_chunks/{contact-card-CmK05vNb.js → contact-card-fHBMwEsx.js} +2 -2
  32. package/dist/_chunks/{contact-card-CmK05vNb.js.map → contact-card-fHBMwEsx.js.map} +1 -1
  33. package/dist/_chunks/{contact-profile-card-Ci8lBQ6a.js → contact-profile-card-CMyBYgRR.js} +2 -2
  34. package/dist/_chunks/{contact-profile-card-Ci8lBQ6a.js.map → contact-profile-card-CMyBYgRR.js.map} +1 -1
  35. package/dist/_chunks/{cycle-calculator-Dgfqr4Q4.js → cycle-calculator-Cww9DzIa.js} +2 -2
  36. package/dist/_chunks/{cycle-calculator-Dgfqr4Q4.js.map → cycle-calculator-Cww9DzIa.js.map} +1 -1
  37. package/dist/_chunks/{data-table-D8fuhqO1.js → data-table-fAMTeAjM.js} +2 -2
  38. package/dist/_chunks/{data-table-D8fuhqO1.js.map → data-table-fAMTeAjM.js.map} +1 -1
  39. package/dist/_chunks/{data-table-tabs-Xhg5G0gU.js → data-table-tabs-CHYAAeHy.js} +2 -2
  40. package/dist/_chunks/{data-table-tabs-Xhg5G0gU.js.map → data-table-tabs-CHYAAeHy.js.map} +1 -1
  41. package/dist/_chunks/{date-picker-wRAcq2lt.js → date-picker-BSZuKo13.js} +69 -62
  42. package/dist/_chunks/date-picker-BSZuKo13.js.map +1 -0
  43. package/dist/_chunks/{date-range-picker-CtUOI38x.js → date-range-picker-CFk-5O3R.js} +176 -171
  44. package/dist/_chunks/date-range-picker-CFk-5O3R.js.map +1 -0
  45. package/dist/_chunks/{date-time-picker-CLeLKuv9.js → date-time-picker-CjxTkblD.js} +92 -85
  46. package/dist/_chunks/date-time-picker-CjxTkblD.js.map +1 -0
  47. package/dist/_chunks/{dialog-CUzbnKLw.js → dialog-Dn-iQ0Jp.js} +2 -2
  48. package/dist/_chunks/{dialog-CUzbnKLw.js.map → dialog-Dn-iQ0Jp.js.map} +1 -1
  49. package/dist/_chunks/{document-preview-uoTekVR7.js → document-preview-CHGGG0l_.js} +2 -2
  50. package/dist/_chunks/{document-preview-uoTekVR7.js.map → document-preview-CHGGG0l_.js.map} +1 -1
  51. package/dist/_chunks/{due-date-calculator-CSjklbyw.js → due-date-calculator-D_qFUiHp.js} +2 -2
  52. package/dist/_chunks/{due-date-calculator-CSjklbyw.js.map → due-date-calculator-D_qFUiHp.js.map} +1 -1
  53. package/dist/_chunks/{entity-summary-DcB0fIiv.js → entity-summary-CWcCSThK.js} +2 -2
  54. package/dist/_chunks/{entity-summary-DcB0fIiv.js.map → entity-summary-CWcCSThK.js.map} +1 -1
  55. package/dist/_chunks/{file-manager-Cc_uO8r2.js → file-manager-CFsL1KVt.js} +3 -3
  56. package/dist/_chunks/{file-manager-Cc_uO8r2.js.map → file-manager-CFsL1KVt.js.map} +1 -1
  57. package/dist/_chunks/{gestational-age-calculator-DqVeJke2.js → gestational-age-calculator-CZi43xKG.js} +2 -2
  58. package/dist/_chunks/{gestational-age-calculator-DqVeJke2.js.map → gestational-age-calculator-CZi43xKG.js.map} +1 -1
  59. package/dist/_chunks/{hcg-doubling-BIYyI2Yo.js → hcg-doubling-Ccvh7OaU.js} +2 -2
  60. package/dist/_chunks/{hcg-doubling-BIYyI2Yo.js.map → hcg-doubling-Ccvh7OaU.js.map} +1 -1
  61. package/dist/_chunks/{header-settings-ge_3gYEq.js → header-settings-BMcCx2LC.js} +2 -2
  62. package/dist/_chunks/{header-settings-ge_3gYEq.js.map → header-settings-BMcCx2LC.js.map} +1 -1
  63. package/dist/_chunks/{heatmap-Gf9r7Tn1.js → heatmap-BEeOThkW.js} +2 -2
  64. package/dist/_chunks/{heatmap-Gf9r7Tn1.js.map → heatmap-BEeOThkW.js.map} +1 -1
  65. package/dist/_chunks/{help-me-write-templates-fV-Apf72.js → help-me-write-templates-BUoYGo6f.js} +2 -2
  66. package/dist/_chunks/{help-me-write-templates-fV-Apf72.js.map → help-me-write-templates-BUoYGo6f.js.map} +1 -1
  67. package/dist/_chunks/{hover-card-BnTueNS2.js → hover-card-U_ZYoh1n.js} +201 -187
  68. package/dist/_chunks/hover-card-U_ZYoh1n.js.map +1 -0
  69. package/dist/_chunks/{icon-picker-DWrqmI1c.js → icon-picker-C86lQTIA.js} +2 -2
  70. package/dist/_chunks/{icon-picker-DWrqmI1c.js.map → icon-picker-C86lQTIA.js.map} +1 -1
  71. package/dist/_chunks/{info-tip-B0jmIt6M.js → info-tip-CJpNpzZe.js} +2 -2
  72. package/dist/_chunks/{info-tip-B0jmIt6M.js.map → info-tip-CJpNpzZe.js.map} +1 -1
  73. package/dist/_chunks/{kit-extensions-Byfxy6sy.js → kit-extensions-DYVxWcqv.js} +4 -4
  74. package/dist/_chunks/{kit-extensions-Byfxy6sy.js.map → kit-extensions-DYVxWcqv.js.map} +1 -1
  75. package/dist/_chunks/{link-cell-renderer-TeJNvymP.js → link-cell-renderer-CxW_oLa5.js} +2 -2
  76. package/dist/_chunks/{link-cell-renderer-TeJNvymP.js.map → link-cell-renderer-CxW_oLa5.js.map} +1 -1
  77. package/dist/_chunks/link-gRw3NtOt.js +137 -0
  78. package/dist/_chunks/link-gRw3NtOt.js.map +1 -0
  79. package/dist/_chunks/{locale-picker-DfNSdOpy.js → locale-picker-BGfrZyTw.js} +2 -2
  80. package/dist/_chunks/{locale-picker-DfNSdOpy.js.map → locale-picker-BGfrZyTw.js.map} +1 -1
  81. package/dist/_chunks/{marketplace-app-shell-Dcx-JEjg.js → marketplace-app-shell-BZcA9Z06.js} +143 -129
  82. package/dist/_chunks/marketplace-app-shell-BZcA9Z06.js.map +1 -0
  83. package/dist/_chunks/{message-tray-BB95DA82.js → message-tray-QKQutwxj.js} +76 -69
  84. package/dist/_chunks/message-tray-QKQutwxj.js.map +1 -0
  85. package/dist/_chunks/{nav-grid-BqCPH8sm.js → nav-grid-Byx8PxuB.js} +2 -2
  86. package/dist/_chunks/{nav-grid-BqCPH8sm.js.map → nav-grid-Byx8PxuB.js.map} +1 -1
  87. package/dist/_chunks/non-modal-tab-exit-j3CPOuE3.js +89 -0
  88. package/dist/_chunks/non-modal-tab-exit-j3CPOuE3.js.map +1 -0
  89. package/dist/_chunks/{note-attachment-I1NLoeRZ.js → note-attachment-Bt2cddsZ.js} +2 -2
  90. package/dist/_chunks/{note-attachment-I1NLoeRZ.js.map → note-attachment-Bt2cddsZ.js.map} +1 -1
  91. package/dist/_chunks/{note-timeline-CsY8YOE7.js → note-timeline-CX9nAgAR.js} +2 -2
  92. package/dist/_chunks/{note-timeline-CsY8YOE7.js.map → note-timeline-CX9nAgAR.js.map} +1 -1
  93. package/dist/_chunks/{notes-panel-DceRhthG.js → notes-panel-Cm4pttpl.js} +4 -4
  94. package/dist/_chunks/{notes-panel-DceRhthG.js.map → notes-panel-Cm4pttpl.js.map} +1 -1
  95. package/dist/_chunks/{notification-tray-__sJXnsz.js → notification-tray-C5VtbGjd.js} +83 -76
  96. package/dist/_chunks/notification-tray-C5VtbGjd.js.map +1 -0
  97. package/dist/_chunks/{patient-details-DsTtjpuX.js → patient-details-99kEdtc5.js} +2 -2
  98. package/dist/_chunks/{patient-details-DsTtjpuX.js.map → patient-details-99kEdtc5.js.map} +1 -1
  99. package/dist/_chunks/{patient-field-row-BvZ9luz-.js → patient-field-row-DkxY13T6.js} +5 -5
  100. package/dist/_chunks/{patient-field-row-BvZ9luz-.js.map → patient-field-row-DkxY13T6.js.map} +1 -1
  101. package/dist/_chunks/{patient-summary-card-9nQWTQf6.js → patient-summary-card-opdyfeW2.js} +4 -4
  102. package/dist/_chunks/{patient-summary-card-9nQWTQf6.js.map → patient-summary-card-opdyfeW2.js.map} +1 -1
  103. package/dist/_chunks/{payment-request-card-CwDpwXUC.js → payment-request-card-DAniJNLX.js} +2 -2
  104. package/dist/_chunks/{payment-request-card-CwDpwXUC.js.map → payment-request-card-DAniJNLX.js.map} +1 -1
  105. package/dist/_chunks/{pdf-viewer-C3minW5b.js → pdf-viewer-CNQxa4tv.js} +396 -391
  106. package/dist/_chunks/pdf-viewer-CNQxa4tv.js.map +1 -0
  107. package/dist/_chunks/{phone-input-DxkHMYmu.js → phone-input-O9camxkq.js} +156 -151
  108. package/dist/_chunks/phone-input-O9camxkq.js.map +1 -0
  109. package/dist/_chunks/popover-BG75rYjN.js +367 -0
  110. package/dist/_chunks/popover-BG75rYjN.js.map +1 -0
  111. package/dist/_chunks/{practice-results-Dhbo-fc_.js → practice-results-CfRkjzsI.js} +2 -2
  112. package/dist/_chunks/{practice-results-Dhbo-fc_.js.map → practice-results-CfRkjzsI.js.map} +1 -1
  113. package/dist/_chunks/{pregnancy-dating-Bfu0Cq4H.js → pregnancy-dating-BFzv9g1N.js} +2 -2
  114. package/dist/_chunks/{pregnancy-dating-Bfu0Cq4H.js.map → pregnancy-dating-BFzv9g1N.js.map} +1 -1
  115. package/dist/_chunks/{product-hub-panel-BSSiGGG4.js → product-hub-panel-DlVRK7Ue.js} +103 -96
  116. package/dist/_chunks/product-hub-panel-DlVRK7Ue.js.map +1 -0
  117. package/dist/_chunks/{public-footer-CxpG6J1M.js → public-footer-ZWTEG1Rq.js} +2 -2
  118. package/dist/_chunks/{public-footer-CxpG6J1M.js.map → public-footer-ZWTEG1Rq.js.map} +1 -1
  119. package/dist/_chunks/{public-header.agent-pr2hyiND.js → public-header.agent-BctevbuY.js} +2 -2
  120. package/dist/_chunks/{public-header.agent-pr2hyiND.js.map → public-header.agent-BctevbuY.js.map} +1 -1
  121. package/dist/_chunks/{radiograph-panel.agent-DkUokbEa.js → radiograph-panel.agent-DyqbTECc.js} +4 -4
  122. package/dist/_chunks/{radiograph-panel.agent-DkUokbEa.js.map → radiograph-panel.agent-DyqbTECc.js.map} +1 -1
  123. package/dist/_chunks/{registration-form-D7iNqMBF.js → registration-form-BlTzYywa.js} +2 -2
  124. package/dist/_chunks/{registration-form-D7iNqMBF.js.map → registration-form-BlTzYywa.js.map} +1 -1
  125. package/dist/_chunks/{rich-text-editor-CkFfmA3v.js → rich-text-editor-DTnNZ4Ff.js} +489 -484
  126. package/dist/_chunks/rich-text-editor-DTnNZ4Ff.js.map +1 -0
  127. package/dist/_chunks/{sheet-C7SwIxwB.js → sheet-8qsiMoUI.js} +2 -2
  128. package/dist/_chunks/{sheet-C7SwIxwB.js.map → sheet-8qsiMoUI.js.map} +1 -1
  129. package/dist/_chunks/{sign-document-B6HlyCGV.js → sign-document-D4iHS_Ug.js} +2 -2
  130. package/dist/_chunks/{sign-document-B6HlyCGV.js.map → sign-document-D4iHS_Ug.js.map} +1 -1
  131. package/dist/_chunks/{signature-request-DhbpB9N9.js → signature-request-DRuYAG5I.js} +2 -2
  132. package/dist/_chunks/{signature-request-DhbpB9N9.js.map → signature-request-DRuYAG5I.js.map} +1 -1
  133. package/dist/_chunks/{signed-out-frame-B2GTIeqA.js → signed-out-frame-AhMsNW1r.js} +2 -2
  134. package/dist/_chunks/{signed-out-frame-B2GTIeqA.js.map → signed-out-frame-AhMsNW1r.js.map} +1 -1
  135. package/dist/_chunks/{task-editor-ByyRu29Y.js → task-editor-NkcopDna.js} +3 -3
  136. package/dist/_chunks/{task-editor-ByyRu29Y.js.map → task-editor-NkcopDna.js.map} +1 -1
  137. package/dist/_chunks/{use-appointment-details-read-JsDM48tf.js → use-appointment-details-read-CfFQNOF_.js} +5 -5
  138. package/dist/_chunks/{use-appointment-details-read-JsDM48tf.js.map → use-appointment-details-read-CfFQNOF_.js.map} +1 -1
  139. package/dist/_chunks/{voice-control-panel-Bg1eklL0.js → voice-control-panel-BKbgb7FM.js} +2 -2
  140. package/dist/_chunks/{voice-control-panel-Bg1eklL0.js.map → voice-control-panel-BKbgb7FM.js.map} +1 -1
  141. package/dist/_chunks/{widget-picker-DXYBMTfe.js → widget-picker-rBA7MR5P.js} +2 -2
  142. package/dist/_chunks/{widget-picker-DXYBMTfe.js.map → widget-picker-rBA7MR5P.js.map} +1 -1
  143. package/dist/agent-catalog.json +2 -2
  144. package/dist/components/_shared/non-modal-tab-exit.d.ts +15 -4
  145. package/dist/components/_shared/non-modal-tab-exit.d.ts.map +1 -1
  146. package/dist/components/ai-credits-notice/index.js +1 -1
  147. package/dist/components/ai-permission-notice/ai-permission-notice.d.ts +32 -0
  148. package/dist/components/ai-permission-notice/ai-permission-notice.d.ts.map +1 -1
  149. package/dist/components/ai-permission-notice/index.d.ts +1 -1
  150. package/dist/components/ai-permission-notice/index.d.ts.map +1 -1
  151. package/dist/components/ai-permission-notice/index.js +1 -1
  152. package/dist/components/appointment-details-panel/index.js +1 -1
  153. package/dist/components/appointment-peek/index.js +1 -1
  154. package/dist/components/appointment-timeline/index.js +1 -1
  155. package/dist/components/booking/index.js +1 -1
  156. package/dist/components/calculator-dialog/index.js +1 -1
  157. package/dist/components/care-plan-card/index.js +1 -1
  158. package/dist/components/care-plan-header/index.js +1 -1
  159. package/dist/components/chart/chart.d.ts +5 -5
  160. package/dist/components/chart/chart.d.ts.map +1 -1
  161. package/dist/components/chart/index.js +1 -1
  162. package/dist/components/clinical-note-card/index.js +1 -1
  163. package/dist/components/color-picker/color-picker.d.ts.map +1 -1
  164. package/dist/components/color-picker/index.js +1 -1
  165. package/dist/components/contact-card/index.js +1 -1
  166. package/dist/components/contact-profile-card/index.js +1 -1
  167. package/dist/components/cycle-calculator/index.js +1 -1
  168. package/dist/components/data-table/index.js +2 -2
  169. package/dist/components/data-table-tabs/index.js +1 -1
  170. package/dist/components/date-picker/date-picker.d.ts.map +1 -1
  171. package/dist/components/date-picker/index.js +1 -1
  172. package/dist/components/date-range-picker/date-range-picker.d.ts.map +1 -1
  173. package/dist/components/date-range-picker/index.js +1 -1
  174. package/dist/components/date-time-picker/date-time-picker.d.ts.map +1 -1
  175. package/dist/components/date-time-picker/index.js +1 -1
  176. package/dist/components/dialog/index.js +1 -1
  177. package/dist/components/document-preview/index.js +1 -1
  178. package/dist/components/due-date-calculator/index.js +1 -1
  179. package/dist/components/entity-summary/index.js +1 -1
  180. package/dist/components/file-manager/index.js +1 -1
  181. package/dist/components/gestational-age-calculator/index.js +1 -1
  182. package/dist/components/hcg-doubling/index.js +1 -1
  183. package/dist/components/header-settings/index.js +1 -1
  184. package/dist/components/heatmap/index.js +1 -1
  185. package/dist/components/hover-card/hover-card.d.ts.map +1 -1
  186. package/dist/components/hover-card/index.js +1 -1
  187. package/dist/components/icon-picker/index.js +1 -1
  188. package/dist/components/info-tip/index.js +1 -1
  189. package/dist/components/link/index.js +1 -1
  190. package/dist/components/link/link.d.ts +5 -3
  191. package/dist/components/link/link.d.ts.map +1 -1
  192. package/dist/components/locale-picker/index.js +1 -1
  193. package/dist/components/message-tray/index.js +1 -1
  194. package/dist/components/message-tray/message-tray.d.ts.map +1 -1
  195. package/dist/components/nav-grid/index.js +1 -1
  196. package/dist/components/note-timeline/index.js +1 -1
  197. package/dist/components/notes-panel/index.js +1 -1
  198. package/dist/components/notification-tray/index.js +1 -1
  199. package/dist/components/notification-tray/notification-tray.d.ts.map +1 -1
  200. package/dist/components/patient-details/index.js +1 -1
  201. package/dist/components/patient-summary-card/index.js +1 -1
  202. package/dist/components/patient-table/index.js +1 -1
  203. package/dist/components/payment-card/index.js +1 -1
  204. package/dist/components/pdf-viewer/index.js +1 -1
  205. package/dist/components/pdf-viewer/pdf-viewer.d.ts.map +1 -1
  206. package/dist/components/phone-input/index.js +1 -1
  207. package/dist/components/phone-input/phone-input.d.ts.map +1 -1
  208. package/dist/components/popover/index.js +1 -1
  209. package/dist/components/popover/popover.d.ts +1 -1
  210. package/dist/components/popover/popover.d.ts.map +1 -1
  211. package/dist/components/practice-results/index.js +1 -1
  212. package/dist/components/pregnancy-dating/index.js +1 -1
  213. package/dist/components/product-hub-tray/index.js +1 -1
  214. package/dist/components/product-hub-tray/product-hub-tray.d.ts.map +1 -1
  215. package/dist/components/public-footer/index.js +1 -1
  216. package/dist/components/public-header/index.js +1 -1
  217. package/dist/components/radiograph-panel/index.js +1 -1
  218. package/dist/components/rich-text-editor/editor-toolbar.d.ts.map +1 -1
  219. package/dist/components/rich-text-editor/index.js +2 -2
  220. package/dist/components/sheet/index.js +1 -1
  221. package/dist/components/sign-document/index.js +1 -1
  222. package/dist/components/task-editor/index.js +1 -1
  223. package/dist/components/voice-control-panel/index.js +1 -1
  224. package/dist/components/widget-picker/index.js +1 -1
  225. package/dist/i18n/locales/ar.d.ts +14 -0
  226. package/dist/i18n/locales/ar.d.ts.map +1 -1
  227. package/dist/i18n/locales/ar.js +15 -1
  228. package/dist/i18n/locales/ar.js.map +1 -1
  229. package/dist/i18n/locales/de.d.ts +14 -0
  230. package/dist/i18n/locales/de.d.ts.map +1 -1
  231. package/dist/i18n/locales/de.js +15 -1
  232. package/dist/i18n/locales/de.js.map +1 -1
  233. package/dist/i18n/locales/el.d.ts +14 -0
  234. package/dist/i18n/locales/el.d.ts.map +1 -1
  235. package/dist/i18n/locales/el.js +15 -1
  236. package/dist/i18n/locales/el.js.map +1 -1
  237. package/dist/i18n/locales/en.d.ts +14 -0
  238. package/dist/i18n/locales/en.d.ts.map +1 -1
  239. package/dist/i18n/locales/en.js +15 -1
  240. package/dist/i18n/locales/en.js.map +1 -1
  241. package/dist/i18n/locales/es.d.ts +14 -0
  242. package/dist/i18n/locales/es.d.ts.map +1 -1
  243. package/dist/i18n/locales/es.js +15 -1
  244. package/dist/i18n/locales/es.js.map +1 -1
  245. package/dist/i18n/locales/fr.d.ts +14 -0
  246. package/dist/i18n/locales/fr.d.ts.map +1 -1
  247. package/dist/i18n/locales/fr.js +15 -1
  248. package/dist/i18n/locales/fr.js.map +1 -1
  249. package/dist/i18n/locales/hi.d.ts +14 -0
  250. package/dist/i18n/locales/hi.d.ts.map +1 -1
  251. package/dist/i18n/locales/hi.js +15 -1
  252. package/dist/i18n/locales/hi.js.map +1 -1
  253. package/dist/i18n/locales/it.d.ts +14 -0
  254. package/dist/i18n/locales/it.d.ts.map +1 -1
  255. package/dist/i18n/locales/it.js +15 -1
  256. package/dist/i18n/locales/it.js.map +1 -1
  257. package/dist/i18n/locales/ja.d.ts +14 -0
  258. package/dist/i18n/locales/ja.d.ts.map +1 -1
  259. package/dist/i18n/locales/ja.js +15 -1
  260. package/dist/i18n/locales/ja.js.map +1 -1
  261. package/dist/i18n/locales/nl.d.ts +14 -0
  262. package/dist/i18n/locales/nl.d.ts.map +1 -1
  263. package/dist/i18n/locales/nl.js +15 -1
  264. package/dist/i18n/locales/nl.js.map +1 -1
  265. package/dist/i18n/locales/pl.d.ts +14 -0
  266. package/dist/i18n/locales/pl.d.ts.map +1 -1
  267. package/dist/i18n/locales/pl.js +15 -1
  268. package/dist/i18n/locales/pl.js.map +1 -1
  269. package/dist/i18n/locales/pt.d.ts +14 -0
  270. package/dist/i18n/locales/pt.d.ts.map +1 -1
  271. package/dist/i18n/locales/pt.js +15 -1
  272. package/dist/i18n/locales/pt.js.map +1 -1
  273. package/dist/i18n/locales/ro.d.ts +14 -0
  274. package/dist/i18n/locales/ro.d.ts.map +1 -1
  275. package/dist/i18n/locales/ro.js +15 -1
  276. package/dist/i18n/locales/ro.js.map +1 -1
  277. package/dist/i18n/locales/ru.d.ts +14 -0
  278. package/dist/i18n/locales/ru.d.ts.map +1 -1
  279. package/dist/i18n/locales/ru.js +15 -1
  280. package/dist/i18n/locales/ru.js.map +1 -1
  281. package/dist/i18n/locales/sq.d.ts +14 -0
  282. package/dist/i18n/locales/sq.d.ts.map +1 -1
  283. package/dist/i18n/locales/sq.js +15 -1
  284. package/dist/i18n/locales/sq.js.map +1 -1
  285. package/dist/i18n/locales/sv.d.ts +14 -0
  286. package/dist/i18n/locales/sv.d.ts.map +1 -1
  287. package/dist/i18n/locales/sv.js +15 -1
  288. package/dist/i18n/locales/sv.js.map +1 -1
  289. package/dist/i18n/locales/tr.d.ts +14 -0
  290. package/dist/i18n/locales/tr.d.ts.map +1 -1
  291. package/dist/i18n/locales/tr.js +15 -1
  292. package/dist/i18n/locales/tr.js.map +1 -1
  293. package/dist/i18n/locales/zh.d.ts +14 -0
  294. package/dist/i18n/locales/zh.d.ts.map +1 -1
  295. package/dist/i18n/locales/zh.js +15 -1
  296. package/dist/i18n/locales/zh.js.map +1 -1
  297. package/dist/index.js +194 -193
  298. package/dist/locales/ar.json +15 -1
  299. package/dist/locales/de.json +15 -1
  300. package/dist/locales/el.json +15 -1
  301. package/dist/locales/en.json +15 -1
  302. package/dist/locales/es.json +15 -1
  303. package/dist/locales/fr.json +15 -1
  304. package/dist/locales/hi.json +15 -1
  305. package/dist/locales/it.json +15 -1
  306. package/dist/locales/ja.json +15 -1
  307. package/dist/locales/nl.json +15 -1
  308. package/dist/locales/pl.json +15 -1
  309. package/dist/locales/pt.json +15 -1
  310. package/dist/locales/ro.json +15 -1
  311. package/dist/locales/ru.json +15 -1
  312. package/dist/locales/sq.json +15 -1
  313. package/dist/locales/sv.json +15 -1
  314. package/dist/locales/tr.json +15 -1
  315. package/dist/locales/zh.json +15 -1
  316. package/dist/patterns/alia-assistant/alia-asteroid-icon.d.ts +10 -13
  317. package/dist/patterns/alia-assistant/alia-asteroid-icon.d.ts.map +1 -1
  318. package/dist/patterns/alia-assistant/alia-chat-surface.d.ts.map +1 -1
  319. package/dist/patterns/alia-assistant/alia-popout.d.ts +5 -3
  320. package/dist/patterns/alia-assistant/alia-popout.d.ts.map +1 -1
  321. package/dist/patterns/alia-assistant/index.d.ts +2 -0
  322. package/dist/patterns/alia-assistant/index.d.ts.map +1 -1
  323. package/dist/patterns/alia-assistant/index.js +6 -5
  324. package/dist/patterns/anamnesis/index.js +1 -1
  325. package/dist/patterns/calendar/index.js +1 -1
  326. package/dist/patterns/help-me-write-templates/index.js +1 -1
  327. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  328. package/dist/patterns/marketplace-app-shell/marketplace-app-shell.d.ts +7 -2
  329. package/dist/patterns/marketplace-app-shell/marketplace-app-shell.d.ts.map +1 -1
  330. package/dist/patterns/registration-form/index.js +1 -1
  331. package/dist/patterns/signature-request/index.js +1 -1
  332. package/dist/patterns/signed-out-frame/index.js +1 -1
  333. package/dist/tokens.css +1 -1
  334. package/package.json +1 -1
  335. package/dist/_chunks/ai-permission-notice-5vpblPCx.js +0 -171
  336. package/dist/_chunks/ai-permission-notice-5vpblPCx.js.map +0 -1
  337. package/dist/_chunks/alia-sidebar-DOei4Iyu.js +0 -1183
  338. package/dist/_chunks/alia-sidebar-DOei4Iyu.js.map +0 -1
  339. package/dist/_chunks/chart-HsF1KHbx.js.map +0 -1
  340. package/dist/_chunks/color-picker-BRQ4Y9SO.js.map +0 -1
  341. package/dist/_chunks/date-picker-wRAcq2lt.js.map +0 -1
  342. package/dist/_chunks/date-range-picker-CtUOI38x.js.map +0 -1
  343. package/dist/_chunks/date-time-picker-CLeLKuv9.js.map +0 -1
  344. package/dist/_chunks/hover-card-BnTueNS2.js.map +0 -1
  345. package/dist/_chunks/link-2HokYuIi.js +0 -130
  346. package/dist/_chunks/link-2HokYuIi.js.map +0 -1
  347. package/dist/_chunks/marketplace-app-shell-Dcx-JEjg.js.map +0 -1
  348. package/dist/_chunks/message-tray-BB95DA82.js.map +0 -1
  349. package/dist/_chunks/non-modal-tab-exit-D2Bd93Bq.js +0 -65
  350. package/dist/_chunks/non-modal-tab-exit-D2Bd93Bq.js.map +0 -1
  351. package/dist/_chunks/notification-tray-__sJXnsz.js.map +0 -1
  352. package/dist/_chunks/pdf-viewer-C3minW5b.js.map +0 -1
  353. package/dist/_chunks/phone-input-DxkHMYmu.js.map +0 -1
  354. package/dist/_chunks/popover-BI3oV3eY.js +0 -305
  355. package/dist/_chunks/popover-BI3oV3eY.js.map +0 -1
  356. package/dist/_chunks/product-hub-panel-BSSiGGG4.js.map +0 -1
  357. package/dist/_chunks/rich-text-editor-CkFfmA3v.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"due-date-calculator-CSjklbyw.js","sources":["../../src/components/due-date-calculator/due-date-calculator.agent.ts","../../src/components/due-date-calculator/due-date-calculator.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — DueDateCalculator. */\n/* */\n/* Estimates the date of delivery from one of three dating methods (LMP / */\n/* conception / IVF transfer) plus current gestational age + trimester. */\n/* The agent surface is the dating inputs plus the computed EDD / GA; the */\n/* handle is the curated `DueDateCalculatorHandle` (the public `ref` */\n/* stays the root <div>, exactly as `slider.tsx` and `bmi-calculator.tsx` */\n/* keep theirs). */\n/* */\n/* Dates cross the boundary as local-time `yyyy-MM-dd` strings, never */\n/* `Date` objects, so nothing shifts a day under JSON/UTC serialisation. */\n/* */\n/* DEPRECATED surface: this component is superseded by PregnancyDating, */\n/* which unifies dating + gestational age. Prefer the `pregnancy-dating` */\n/* adapter for new work — every action here is marked deprecated. */\n/* */\n/* PHI (§7): never exposes patient identity — the slots return the */\n/* operator's own structural dating inputs and the dates derived from */\n/* them. See `src/docs/26-agent-readiness.mdx`. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { DueDateCalculatorHandle } from './due-date-calculator';\n\nconst DEPRECATED = 'Superseded by the `pregnancy-dating` adapter.';\n\n/** Shared JSON Schema fragment for a local calendar date. */\nconst isoDate = {\n type: 'string',\n pattern: '^\\\\d{4}-\\\\d{2}-\\\\d{2}$',\n} as const;\n\nexport const dueDateCalculatorAgent: AgentAdapter<DueDateCalculatorHandle> = {\n id: 'due-date-calculator',\n // set_value → the six `set_*` actions + the `inputs` state slot.\n capabilities: ['set_value'],\n state: {\n inputs: {\n type: '{ method: string, referenceDate: string | null, cycleLength: number | null, embryoAge: 3 | 5, crlMm: number | null, scanDate: string | null, asOfDate: string }',\n descriptionKey: 'ui.agent.dueDateCalculator.state.inputs',\n description:\n 'The dating inputs as entered — method, its reference date, cycle length (LMP), embryo age (IVF), the optional CRL + scan date, and the evaluation date. Dates are `yyyy-MM-dd`. Read this to see which method a reference date will be interpreted under.',\n read: (handle) => handle.getInputs(),\n },\n result: {\n type: '{ dueDate: string, gestationalStart: string, gestationalAge: { weeks: number, days: number, totalDays: number } | null, trimester: string } | null',\n descriptionKey: 'ui.agent.dueDateCalculator.state.result',\n description:\n 'Computed estimated delivery date, the GA day-0 anchor after any CRL re-dating, the gestational age as of the evaluation date, and the trimester band. Null until a reference date is set.',\n read: (handle) => handle.getResult(),\n },\n },\n actions: {\n set_method: {\n // Drives the same local input state a user picks; nothing is persisted\n // to a record, and the choice is reversible in the same UI.\n safety: 'write',\n argsType: \"{ method: 'lmp' | 'conception' | 'ivf' }\",\n argsSchema: {\n type: 'object',\n properties: {\n method: {\n enum: ['lmp', 'conception', 'ivf'],\n description:\n 'Which anchor to date from — last menstrual period, conception, or IVF transfer.',\n },\n },\n required: ['method'],\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the method was applied.',\n },\n errors: [\n 'Returns false for a method outside the three supported anchors.',\n ],\n descriptionKey: 'ui.agent.dueDateCalculator.actions.setMethod',\n description:\n 'Choose which anchor the pregnancy is dated from. The reference date is kept and re-interpreted under the new method, so set the method first.',\n invoke: (handle, args: { method: 'lmp' | 'conception' | 'ivf' }) =>\n handle.setMethod(args.method),\n },\n set_reference_date: {\n safety: 'write',\n argsType: '{ date: string | null }',\n argsSchema: {\n type: 'object',\n properties: {\n date: {\n oneOf: [\n { ...isoDate, description: 'Local calendar date, `yyyy-MM-dd`.' },\n { type: 'null' },\n ],\n description:\n 'The date the active method anchors on — LMP, conception, or transfer — or null to clear it. Must not be in the future.',\n },\n },\n required: ['date'],\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the date was applied.',\n },\n errors: [\n 'Returns false for an unparseable date or a date in the future — the on-screen DatePicker caps at today.',\n ],\n examples: [\n {\n args: { date: '2026-01-12' },\n note: 'Under the default LMP method, a last period starting 12 January.',\n },\n ],\n descriptionKey: 'ui.agent.dueDateCalculator.actions.setReferenceDate',\n description:\n 'Set the reference date for the active method. This is the only required input — the result stays null without it.',\n invoke: (handle, args: { date: string | null }) =>\n handle.setReferenceDate(args.date),\n },\n set_cycle_length: {\n safety: 'write',\n argsType: '{ days: number | null }',\n argsSchema: {\n type: 'object',\n properties: {\n days: {\n oneOf: [\n { type: 'integer', minimum: 20, maximum: 45 },\n { type: 'null' },\n ],\n description:\n 'Average cycle length in days (20–45), or null to fall back to the 28-day default.',\n },\n },\n required: ['days'],\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the value was applied.',\n },\n errors: [\n 'Returns false outside 20–45 days — the same bounds the on-screen NumberInput enforces.',\n 'Applies but changes nothing unless the method is `lmp`, and is ignored once a CRL re-dating is confirmed.',\n ],\n descriptionKey: 'ui.agent.dueDateCalculator.actions.setCycleLength',\n description:\n 'LMP method only — set the average cycle length, which shifts Naegele dating off the 28-day assumption.',\n invoke: (handle, args: { days: number | null }) =>\n handle.setCycleLength(args.days),\n },\n set_embryo_age: {\n safety: 'write',\n argsType: '{ days: 3 | 5 }',\n argsSchema: {\n type: 'object',\n properties: {\n days: {\n enum: [3, 5],\n description:\n 'Embryo age at transfer in days — 3 (cleavage) or 5 (blastocyst).',\n },\n },\n required: ['days'],\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the value was applied.',\n },\n errors: [\n 'Returns false for any value other than 3 or 5.',\n 'Applies but changes nothing unless the method is `ivf`.',\n ],\n descriptionKey: 'ui.agent.dueDateCalculator.actions.setEmbryoAge',\n description:\n 'IVF method only — set the embryo age at transfer, which offsets the transfer date back to a notional LMP.',\n invoke: (handle, args: { days: 3 | 5 }) => handle.setEmbryoAge(args.days),\n },\n set_crl: {\n safety: 'write',\n argsType: '{ crlMm?: number | null, scanDate?: string | null }',\n argsSchema: {\n type: 'object',\n properties: {\n crlMm: {\n oneOf: [{ type: 'number', exclusiveMinimum: 0 }, { type: 'null' }],\n description:\n 'Crown-rump length in millimetres, or null to clear it.',\n },\n scanDate: {\n oneOf: [{ ...isoDate }, { type: 'null' }],\n description:\n 'Date of the CRL scan (`yyyy-MM-dd`, not in the future), or null to clear it.',\n },\n },\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the measurement was applied.',\n },\n errors: [\n 'Returns false and writes nothing when the length is not positive or the scan date is unparseable or in the future — the payload applies all-or-nothing.',\n 'Re-dating only happens under the `lmp` method, and only when both the length and the scan date are set.',\n ],\n examples: [\n {\n args: { crlMm: 42, scanDate: '2026-02-20' },\n note: 'A first-trimester CRL that may re-date the pregnancy per ACOG CO 700.',\n },\n ],\n descriptionKey: 'ui.agent.dueDateCalculator.actions.setCrl',\n description:\n 'LMP method only — set the first-trimester crown-rump length and its scan date. When the two disagree with the LMP beyond the ACOG threshold, the scan re-dates the pregnancy and overrides cycle length.',\n invoke: (\n handle,\n args: { crlMm?: number | null; scanDate?: string | null },\n ) => handle.setCrl(args),\n },\n set_as_of_date: {\n safety: 'write',\n argsType: '{ date: string }',\n argsSchema: {\n type: 'object',\n properties: {\n date: {\n ...isoDate,\n description:\n 'Date to evaluate gestational age and trimester against, `yyyy-MM-dd`. May be in the future to project forward.',\n },\n },\n required: ['date'],\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the date was applied.',\n },\n errors: ['Returns false for an unparseable date.'],\n examples: [\n {\n args: { date: '2026-09-15' },\n note: 'Project gestational age forward to an upcoming appointment.',\n },\n ],\n descriptionKey: 'ui.agent.dueDateCalculator.actions.setAsOfDate',\n description:\n 'Set the date gestational age, trimester and the antenatal schedule are evaluated against. Defaults to today; the estimated delivery date itself does not depend on it.',\n invoke: (handle, args: { date: string }) => handle.setAsOfDate(args.date),\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'due-date-calculator',\n description: 'Marks the DueDateCalculator wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Also the registry key — without an `id` the instance does not register and the handle-driven actions/state are unreachable.',\n },\n },\n};\n","/* ------------------------------------------------------------------ */\n/* DueDateCalculator — estimate the date of delivery from one of three */\n/* dating methods, with current gestational age + trimester. */\n/* */\n/* - Maths lives in `./gestation` (pure, separately tested). */\n/* - Three methods: LMP (Naegele, cycle-length adjustable), conception, */\n/* and IVF transfer (Day-3 vs Day-5 embryo). */\n/* - The reference date can't be in the future, so the DatePicker caps */\n/* at today. */\n/* ------------------------------------------------------------------ */\n\nimport { forwardRef, useEffect, useMemo, useRef, useState } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { format, isAfter, parseISO } from 'date-fns';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { dueDateCalculatorAgent } from './due-date-calculator.agent';\nimport { RadioGroup, Radio } from '../radio-group';\nimport { FormField } from '../form-field';\nimport { DatePicker } from '../date-picker';\nimport { NumberInput } from '../number-input';\nimport { Card } from '../card';\nimport { Badge } from '../badge';\nimport {\n InsertButton,\n type InsertPayload,\n type InsertVariant,\n type InsertMode,\n} from '../_shared/insert-result';\nimport {\n type DueDateMethod,\n type EmbryoAge,\n type DueDateResult,\n computeDueDate,\n redateByCrl,\n DEFAULT_CYCLE_LENGTH,\n TRIMESTER_BADGE_VARIANT,\n trimesterHighlightToken,\n} from '../_shared/obstetrics';\nimport {\n computeAntenatalSchedule,\n type AntenatalScheduleOptions,\n} from '../_shared/antenatal-schedule';\nimport {\n AntenatalScheduleTimeline,\n buildScheduleInsertFields,\n} from '../_shared/antenatal-schedule-timeline';\n\nconst rootVariants = cva('ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]', {\n variants: {\n width: { full: 'ds:w-full', auto: 'ds:inline-flex' },\n },\n defaultVariants: { width: 'full' },\n});\n\n/** Reference-date i18n key per method. */\nconst DATE_LABEL_KEY: Record<DueDateMethod, string> = {\n lmp: 'dueDateCalculator.lmpDate',\n conception: 'dueDateCalculator.conceptionDate',\n ivf: 'dueDateCalculator.transferDate',\n};\n\n/* ------------------------------------------------------------------ */\n/* Agent boundary */\n/* */\n/* Dates cross the agent boundary as local-time `yyyy-MM-dd` strings, */\n/* never `Date` objects — a Date JSON-serialises to UTC and silently */\n/* shifts the day for anyone east or west of Greenwich. */\n/* ------------------------------------------------------------------ */\n\nconst toIsoDate = (d: Date): string => format(d, 'yyyy-MM-dd');\n\nconst fromIsoDate = (iso: string): Date | null => {\n const d = parseISO(iso);\n return Number.isNaN(d.getTime()) ? null : d;\n};\n\n/** UI input bounds, mirrored by the agent handle so it can't out-type a user. */\nconst CYCLE_LENGTH_RANGE = { min: 20, max: 45 } as const;\n\n/** The dating inputs as entered. */\nexport interface DueDateInputsSnapshot {\n /** Which anchor the pregnancy is dated from. */\n method: DueDateMethod;\n /** The method's reference date (`yyyy-MM-dd`), or null when unset. */\n referenceDate: string | null;\n /** LMP only — average cycle length in days, or null for the 28-day default. */\n cycleLength: number | null;\n /** IVF only — embryo age at transfer, in days. */\n embryoAge: EmbryoAge;\n /** LMP only — crown-rump length in millimetres, or null. */\n crlMm: number | null;\n /** LMP only — date of the CRL scan (`yyyy-MM-dd`), or null. */\n scanDate: string | null;\n /** The date gestational age and trimester are evaluated against. */\n asOfDate: string;\n}\n\n/** `DueDateResult` projected onto the agent boundary — ISO dates, no Dates. */\nexport interface DueDateSnapshot {\n /** Estimated date of delivery, `yyyy-MM-dd`. */\n dueDate: string;\n /** GA day-0 anchor (effective LMP) after any CRL re-dating, `yyyy-MM-dd`. */\n gestationalStart: string;\n /** Gestational age as of the evaluation date; null before conception. */\n gestationalAge: { weeks: number; days: number; totalDays: number } | null;\n /** Trimester band as of the evaluation date. */\n trimester: DueDateResult['trimester'];\n}\n\n/**\n * Curated imperative handle for agent / external automation. Reads the dating\n * inputs and the computed due date, and drives the inputs the way a user\n * would. Never exposes patient identity — only structural dates and numbers.\n * Consumed by `due-date-calculator.agent.ts`; the public `ref` stays the root\n * DOM element.\n */\nexport interface DueDateCalculatorHandle {\n /** The dating inputs as entered. */\n getInputs: () => DueDateInputsSnapshot;\n /** Computed due date, gestational age and trimester, or null until a reference date is set. */\n getResult: () => DueDateSnapshot | null;\n /** Switch the dating method. Keeps the reference date, which is re-interpreted. */\n setMethod: (method: DueDateMethod) => boolean;\n /** Set the method's reference date (`yyyy-MM-dd`, not in the future). */\n setReferenceDate: (isoDate: string | null) => boolean;\n /** LMP only — set the average cycle length in days (20–45). */\n setCycleLength: (days: number | null) => boolean;\n /** IVF only — set the embryo age at transfer (3 or 5 days). */\n setEmbryoAge: (days: EmbryoAge) => boolean;\n /** LMP only — set the CRL measurement and/or its scan date for ACOG re-dating. */\n setCrl: (next: {\n crlMm?: number | null;\n scanDate?: string | null;\n }) => boolean;\n /** Set the date gestational age and trimester are evaluated against. */\n setAsOfDate: (isoDate: string) => boolean;\n}\n\nexport interface DueDateCalculatorProps extends VariantProps<\n typeof rootVariants\n> {\n /** Initial dating method. Defaults to `'lmp'`. */\n defaultMethod?: DueDateMethod;\n /** Fires whenever a due date can be computed (and with `null` when it can't). */\n onResultChange?: (result: DueDateResult | null) => void;\n /** When provided, shows an \"Insert\" button that emits the result for an editor. */\n onInsert?: (payload: InsertPayload) => void;\n /**\n * Which verb the result button performs. Defaults to `'insert'`.\n * Use `'copy'` in an app-shell surface (no editor to insert into) — the\n * button writes the result to the clipboard as a multi-format `ClipboardItem`.\n */\n insertVariant?: InsertVariant;\n /** `copy` variant only — fired after a successful clipboard write. */\n onCopy?: (mode: InsertMode) => void;\n /** `copy` variant only — fired if the clipboard write can't proceed. */\n onError?: (error: unknown) => void;\n /**\n * Brand wordmark printed in the inserted/copied result-card footer.\n * Omitted → no brand line (and no footer hairline); a string → that custom\n * brand; `false` → no brand line. Brand is opt-in.\n */\n insertBrand?: string | false;\n /**\n * Append the antenatal exam schedule (the time-sensitive screening windows)\n * below the result, dated from the computed gestational start.\n */\n showSchedule?: boolean;\n /**\n * Passthrough options for the appended schedule (national `schedule`,\n * `plurality`, `chorionicity`, `rhNegative`, `gdmRisk`, …). `today` is\n * supplied by the component. Ignored unless `showSchedule` is set.\n */\n scheduleOptions?: Omit<AntenatalScheduleOptions, 'today'>;\n /** Opaque instance id, emitted as `data-component-id`. */\n id?: string;\n /** Extra class names on the wrapper. */\n className?: string;\n}\n\n/**\n * @deprecated Superseded by `PregnancyDating`, which unifies the due-date and\n * gestational-age calculators (any anchor → both EDD and current GA) and adds a\n * manual ±days dating adjustment. This component will be removed in a future\n * release; migrate to `PregnancyDating` (`defaultMethod=\"lmp\"`).\n */\nexport const DueDateCalculator = forwardRef<\n HTMLDivElement,\n DueDateCalculatorProps\n>(\n (\n {\n defaultMethod = 'lmp',\n onResultChange,\n onInsert,\n insertVariant = 'insert',\n onCopy,\n onError,\n insertBrand,\n showSchedule = false,\n scheduleOptions,\n id,\n width,\n className,\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation('ui');\n\n const [method, setMethod] = useState<DueDateMethod>(defaultMethod);\n const [refDate, setRefDate] = useState<Date | undefined>(undefined);\n const [cycleLength, setCycleLength] = useState<number | null>(\n DEFAULT_CYCLE_LENGTH,\n );\n const [embryoAge, setEmbryoAge] = useState<EmbryoAge>(5);\n // Optional first-trimester ultrasound (LMP method only) for ACOG CO700 redating.\n const [crlMm, setCrlMm] = useState<number | null>(null);\n const [scanDate, setScanDate] = useState<Date | undefined>(undefined);\n\n // Real today — caps the date inputs (LMP / ultrasound can't be in the future).\n const today = useMemo(() => new Date(), []);\n // The date GA, trimester and schedule status are evaluated against; defaults\n // to today but can be a future appointment date to project forward. (The EDD\n // itself is dating-anchored and does not depend on this.)\n const [asOfDate, setAsOfDate] = useState<Date>(() => new Date());\n\n // ACOG CO700 CRL redating — only when an LMP, a CRL and a scan date are set.\n const redating = useMemo(() => {\n if (method !== 'lmp' || !refDate || crlMm === null || !scanDate) {\n return null;\n }\n return redateByCrl({ lmp: refDate, scanDate, crlMm });\n }, [method, refDate, crlMm, scanDate]);\n\n const result = useMemo<DueDateResult | null>(() => {\n if (!refDate) return null;\n // A confirmed redating moves the effective LMP to the ultrasound's; the\n // CRL already reflects true gestation, so cycle adjustment no longer applies.\n const effectiveDate =\n method === 'lmp' && redating?.redated\n ? redating.gestationalStart\n : refDate;\n const effectiveCycle =\n method === 'lmp' && redating?.redated\n ? DEFAULT_CYCLE_LENGTH\n : (cycleLength ?? DEFAULT_CYCLE_LENGTH);\n return computeDueDate(\n {\n method,\n date: effectiveDate,\n cycleLength: effectiveCycle,\n embryoAge,\n },\n asOfDate,\n );\n }, [method, refDate, cycleLength, embryoAge, redating, asOfDate]);\n\n const dateFormatter = useMemo(\n () => new Intl.DateTimeFormat(i18n.language, { dateStyle: 'long' }),\n [i18n.language],\n );\n\n useEffect(() => {\n onResultChange?.(result);\n }, [result, onResultChange]);\n\n /* ── Agent handle ────────────────────────────────────────────────── */\n const liveRef = useRef({\n method,\n refDate,\n cycleLength,\n embryoAge,\n crlMm,\n scanDate,\n asOfDate,\n result,\n });\n liveRef.current = {\n method,\n refDate,\n cycleLength,\n embryoAge,\n crlMm,\n scanDate,\n asOfDate,\n result,\n };\n\n const agentHandle = useMemo<DueDateCalculatorHandle>(\n () => ({\n getInputs: () => {\n const live = liveRef.current;\n return {\n method: live.method,\n referenceDate: live.refDate ? toIsoDate(live.refDate) : null,\n cycleLength: live.cycleLength,\n embryoAge: live.embryoAge,\n crlMm: live.crlMm,\n scanDate: live.scanDate ? toIsoDate(live.scanDate) : null,\n asOfDate: toIsoDate(live.asOfDate),\n };\n },\n getResult: () => {\n const r = liveRef.current.result;\n if (!r) return null;\n return {\n dueDate: toIsoDate(r.dueDate),\n gestationalStart: toIsoDate(r.gestationalStart),\n gestationalAge: r.gestationalAge ? { ...r.gestationalAge } : null,\n trimester: r.trimester,\n };\n },\n setMethod: (next) => {\n if (next !== 'lmp' && next !== 'conception' && next !== 'ivf') {\n return false;\n }\n setMethod(next);\n return true;\n },\n setReferenceDate: (isoDate) => {\n if (isoDate === null) {\n setRefDate(undefined);\n return true;\n }\n const parsed = fromIsoDate(isoDate);\n // The DatePicker caps at today; the handle honours the same bound.\n if (!parsed || isAfter(parsed, new Date())) return false;\n setRefDate(parsed);\n return true;\n },\n setCycleLength: (days) => {\n if (\n days !== null &&\n !(\n Number.isFinite(days) &&\n days >= CYCLE_LENGTH_RANGE.min &&\n days <= CYCLE_LENGTH_RANGE.max\n )\n ) {\n return false;\n }\n setCycleLength(days);\n return true;\n },\n setEmbryoAge: (days) => {\n if (days !== 3 && days !== 5) return false;\n setEmbryoAge(days);\n return true;\n },\n setCrl: (next) => {\n const now = new Date();\n let parsedScan: Date | undefined;\n // Validate the whole payload before writing any of it, so a bad\n // value can't leave the form half-updated.\n if ('crlMm' in next) {\n const mm = next.crlMm;\n if (\n mm !== null &&\n mm !== undefined &&\n !(Number.isFinite(mm) && mm > 0)\n ) {\n return false;\n }\n }\n if ('scanDate' in next && next.scanDate != null) {\n const d = fromIsoDate(next.scanDate);\n if (!d || isAfter(d, now)) return false;\n parsedScan = d;\n }\n if ('crlMm' in next) setCrlMm(next.crlMm ?? null);\n if ('scanDate' in next) setScanDate(parsedScan);\n return true;\n },\n setAsOfDate: (isoDate) => {\n const parsed = fromIsoDate(isoDate);\n if (!parsed) return false;\n setAsOfDate(parsed);\n return true;\n },\n }),\n [],\n );\n useAgentRegistration(dueDateCalculatorAgent, agentHandle, id);\n\n const schedule = useMemo(() => {\n if (!showSchedule || !result) return null;\n return computeAntenatalSchedule(result.gestationalStart, {\n ...scheduleOptions,\n today: asOfDate,\n });\n }, [showSchedule, result, asOfDate, scheduleOptions]);\n\n return (\n <div\n ref={ref}\n data-component=\"due-date-calculator\"\n data-component-id={id}\n className={rootVariants({ width, className })}\n >\n <RadioGroup\n label={t('dueDateCalculator.method.label')}\n variant=\"horizontal\"\n value={method}\n onValueChange={(next) => setMethod(next as DueDateMethod)}\n >\n <Radio label={t('dueDateCalculator.method.lmp')} value=\"lmp\" />\n <Radio\n label={t('dueDateCalculator.method.conception')}\n value=\"conception\"\n />\n <Radio label={t('dueDateCalculator.method.ivf')} value=\"ivf\" />\n </RadioGroup>\n\n <div className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2\">\n <FormField label={t(DATE_LABEL_KEY[method])}>\n <DatePicker value={refDate} onChange={setRefDate} maxDate={today} />\n </FormField>\n\n {method === 'lmp' && (\n <FormField\n label={t('dueDateCalculator.cycleLength')}\n description={t('dueDateCalculator.cycleLengthHint')}\n >\n <NumberInput\n mode=\"integer\"\n min={CYCLE_LENGTH_RANGE.min}\n max={CYCLE_LENGTH_RANGE.max}\n value={cycleLength}\n onChange={setCycleLength}\n />\n </FormField>\n )}\n\n {method === 'ivf' && (\n <RadioGroup\n label={t('dueDateCalculator.embryoAge')}\n variant=\"horizontal\"\n value={String(embryoAge)}\n onValueChange={(next) => setEmbryoAge(Number(next) as EmbryoAge)}\n >\n <Radio label={t('dueDateCalculator.day3')} value=\"3\" />\n <Radio label={t('dueDateCalculator.day5')} value=\"5\" />\n </RadioGroup>\n )}\n </div>\n\n <FormField\n label={t('dueDateCalculator.asOfDate')}\n description={t('dueDateCalculator.asOfDateHint')}\n >\n <DatePicker value={asOfDate} onChange={(d) => d && setAsOfDate(d)} />\n </FormField>\n\n {method === 'lmp' ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n <div className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2\">\n <FormField\n label={t('dueDateCalculator.crl')}\n description={t('dueDateCalculator.crlHint')}\n >\n <NumberInput\n mode=\"decimal\"\n min={0}\n step={0.1}\n value={crlMm}\n onChange={setCrlMm}\n />\n </FormField>\n <FormField label={t('dueDateCalculator.scanDate')}>\n <DatePicker\n value={scanDate}\n onChange={setScanDate}\n maxDate={today}\n />\n </FormField>\n </div>\n {redating ? (\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]\">\n <Badge variant={redating.redated ? 'warning' : 'success'}>\n {redating.redated\n ? t('dueDateCalculator.redated', {\n days: redating.discrepancyDays,\n })\n : t('dueDateCalculator.datesAgree')}\n </Badge>\n {!redating.crlInRange ? (\n <span className=\"type-meta ds:text-muted-foreground\">\n {t('dueDateCalculator.crlOutOfRange')}\n </span>\n ) : null}\n </div>\n ) : null}\n </div>\n ) : null}\n\n {/* Concise polite announcement when a due date resolves. */}\n <p className=\"ds:sr-only\" role=\"status\" aria-live=\"polite\">\n {result\n ? `${t('dueDateCalculator.result.dueDateLabel')}: ${dateFormatter.format(\n result.dueDate,\n )}. ${t('dueDateCalculator.result.trimesterLabel')}: ${t(\n `dueDateCalculator.trimester.${result.trimester}`,\n )}.`\n : ''}\n </p>\n\n {result ? (\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n <dl className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-3\">\n <div className=\"ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('dueDateCalculator.result.trimesterLabel')}\n </dt>\n <dd>\n <Badge\n variant={TRIMESTER_BADGE_VARIANT[result.trimester]}\n size=\"lg\"\n >\n {t(`dueDateCalculator.trimester.${result.trimester}`)}\n </Badge>\n </dd>\n </div>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('dueDateCalculator.result.gestationLabel')}\n </dt>\n <dd className=\"type-body ds:text-foreground\">\n {result.gestationalAge\n ? t('dueDateCalculator.result.gestation', {\n weeks: result.gestationalAge.weeks,\n days: result.gestationalAge.days,\n })\n : '—'}\n </dd>\n </div>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('dueDateCalculator.result.dueDateLabel')}\n </dt>\n <dd className=\"type-metric ds:text-foreground\">\n {dateFormatter.format(result.dueDate)}\n </dd>\n </div>\n </dl>\n </Card.Body>\n </Card>\n ) : (\n <p className=\"type-body ds:text-muted-foreground\">\n {t('dueDateCalculator.empty')}\n </p>\n )}\n\n {schedule ? <AntenatalScheduleTimeline events={schedule} /> : null}\n\n {/* One result-action group for the whole result — sits after both the\n due-date card and the schedule, and its payload carries the schedule\n rows when shown (no per-card buttons). */}\n {result && (insertVariant === 'copy' || onInsert) ? (\n <InsertButton\n variant={insertVariant}\n onInsert={onInsert}\n onCopy={onCopy}\n onError={onError}\n card={{\n title: t('insert.title.dueDate'),\n icon: 'calendar-heart',\n highlight: dateFormatter.format(result.dueDate),\n // Chip tinted with the trimester's semantic token so the inserted\n // PNG carries the same clinical-stage colour as the on-screen\n // trimester badge — with the contrast-safe orange override for the\n // `--warning` third trimester.\n highlightToken: trimesterHighlightToken(result.trimester),\n brand: insertBrand,\n fields: [\n {\n // The estimated date of delivery → calendar glyph.\n icon: 'calendar',\n label: t('dueDateCalculator.result.dueDateLabel'),\n value: dateFormatter.format(result.dueDate),\n },\n {\n // Gestational age is an elapsed duration → clock glyph.\n icon: 'clock',\n label: t('dueDateCalculator.result.gestationLabel'),\n value: result.gestationalAge\n ? t('dueDateCalculator.result.gestation', {\n weeks: result.gestationalAge.weeks,\n days: result.gestationalAge.days,\n })\n : '—',\n },\n {\n // Trimester is a clinical-stage classification → tag.\n icon: 'tag',\n label: t('dueDateCalculator.result.trimesterLabel'),\n value: t(`dueDateCalculator.trimester.${result.trimester}`),\n },\n // When the schedule is shown, the single Insert button carries\n // the exam windows too (no second button).\n ...(schedule\n ? buildScheduleInsertFields(schedule, t, (d) =>\n dateFormatter.format(d),\n )\n : []),\n ],\n }}\n />\n ) : null}\n </div>\n );\n },\n);\n\nDueDateCalculator.displayName = 'DueDateCalculator';\n"],"names":["DEPRECATED","isoDate","dueDateCalculatorAgent","handle","args","rootVariants","cva","DATE_LABEL_KEY","toIsoDate","d","format","fromIsoDate","iso","parseISO","CYCLE_LENGTH_RANGE","DueDateCalculator","forwardRef","defaultMethod","onResultChange","onInsert","insertVariant","onCopy","onError","insertBrand","showSchedule","scheduleOptions","id","width","className","ref","i18n","useTranslation","method","setMethod","useState","refDate","setRefDate","cycleLength","setCycleLength","DEFAULT_CYCLE_LENGTH","embryoAge","setEmbryoAge","crlMm","setCrlMm","scanDate","setScanDate","today","useMemo","asOfDate","setAsOfDate","redating","redateByCrl","result","effectiveDate","effectiveCycle","computeDueDate","dateFormatter","useEffect","liveRef","useRef","agentHandle","live","r","next","parsed","isAfter","days","now","parsedScan","mm","useAgentRegistration","schedule","computeAntenatalSchedule","jsxs","RadioGroup","jsx","Radio","FormField","DatePicker","NumberInput","Badge","Card","TRIMESTER_BADGE_VARIANT","AntenatalScheduleTimeline","InsertButton","trimesterHighlightToken","buildScheduleInsertFields"],"mappings":";;;;;;;;;;;;;;;;;AAyBA,MAAMA,IAAa,iDAGbC,IAAU;AAAA,EACd,MAAM;AAAA,EACN,SAAS;AACX,GAEaC,KAAgE;AAAA,EAC3E,IAAI;AAAA;AAAA,EAEJ,cAAc,CAAC,WAAW;AAAA,EAC1B,OAAO;AAAA,IACL,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,UAAA;AAAA,IAAU;AAAA,IAErC,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,UAAA;AAAA,IAAU;AAAA,EACrC;AAAA,EAEF,SAAS;AAAA,IACP,YAAY;AAAA;AAAA;AAAA,MAGV,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY;AAAA,UACV,QAAQ;AAAA,YACN,MAAM,CAAC,OAAO,cAAc,KAAK;AAAA,YACjC,aACE;AAAA,UAAA;AAAA,QACJ;AAAA,QAEF,UAAU,CAAC,QAAQ;AAAA,QACnB,sBAAsB;AAAA,MAAA;AAAA,MAExB,YAAY;AAAA,MACZ,YAAYH;AAAA,MACZ,SAAS;AAAA,MACT,eAAe;AAAA,QACb,MAAM;AAAA,QACN,aAAa;AAAA,MAAA;AAAA,MAEf,QAAQ;AAAA,QACN;AAAA,MAAA;AAAA,MAEF,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,QAAQ,CAACG,GAAQC,MACfD,EAAO,UAAUC,EAAK,MAAM;AAAA,IAAA;AAAA,IAEhC,oBAAoB;AAAA,MAClB,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AA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,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEAM,GAAkB,cAAc;"}
1
+ {"version":3,"file":"due-date-calculator-D_qFUiHp.js","sources":["../../src/components/due-date-calculator/due-date-calculator.agent.ts","../../src/components/due-date-calculator/due-date-calculator.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — DueDateCalculator. */\n/* */\n/* Estimates the date of delivery from one of three dating methods (LMP / */\n/* conception / IVF transfer) plus current gestational age + trimester. */\n/* The agent surface is the dating inputs plus the computed EDD / GA; the */\n/* handle is the curated `DueDateCalculatorHandle` (the public `ref` */\n/* stays the root <div>, exactly as `slider.tsx` and `bmi-calculator.tsx` */\n/* keep theirs). */\n/* */\n/* Dates cross the boundary as local-time `yyyy-MM-dd` strings, never */\n/* `Date` objects, so nothing shifts a day under JSON/UTC serialisation. */\n/* */\n/* DEPRECATED surface: this component is superseded by PregnancyDating, */\n/* which unifies dating + gestational age. Prefer the `pregnancy-dating` */\n/* adapter for new work — every action here is marked deprecated. */\n/* */\n/* PHI (§7): never exposes patient identity — the slots return the */\n/* operator's own structural dating inputs and the dates derived from */\n/* them. See `src/docs/26-agent-readiness.mdx`. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { DueDateCalculatorHandle } from './due-date-calculator';\n\nconst DEPRECATED = 'Superseded by the `pregnancy-dating` adapter.';\n\n/** Shared JSON Schema fragment for a local calendar date. */\nconst isoDate = {\n type: 'string',\n pattern: '^\\\\d{4}-\\\\d{2}-\\\\d{2}$',\n} as const;\n\nexport const dueDateCalculatorAgent: AgentAdapter<DueDateCalculatorHandle> = {\n id: 'due-date-calculator',\n // set_value → the six `set_*` actions + the `inputs` state slot.\n capabilities: ['set_value'],\n state: {\n inputs: {\n type: '{ method: string, referenceDate: string | null, cycleLength: number | null, embryoAge: 3 | 5, crlMm: number | null, scanDate: string | null, asOfDate: string }',\n descriptionKey: 'ui.agent.dueDateCalculator.state.inputs',\n description:\n 'The dating inputs as entered — method, its reference date, cycle length (LMP), embryo age (IVF), the optional CRL + scan date, and the evaluation date. Dates are `yyyy-MM-dd`. Read this to see which method a reference date will be interpreted under.',\n read: (handle) => handle.getInputs(),\n },\n result: {\n type: '{ dueDate: string, gestationalStart: string, gestationalAge: { weeks: number, days: number, totalDays: number } | null, trimester: string } | null',\n descriptionKey: 'ui.agent.dueDateCalculator.state.result',\n description:\n 'Computed estimated delivery date, the GA day-0 anchor after any CRL re-dating, the gestational age as of the evaluation date, and the trimester band. Null until a reference date is set.',\n read: (handle) => handle.getResult(),\n },\n },\n actions: {\n set_method: {\n // Drives the same local input state a user picks; nothing is persisted\n // to a record, and the choice is reversible in the same UI.\n safety: 'write',\n argsType: \"{ method: 'lmp' | 'conception' | 'ivf' }\",\n argsSchema: {\n type: 'object',\n properties: {\n method: {\n enum: ['lmp', 'conception', 'ivf'],\n description:\n 'Which anchor to date from — last menstrual period, conception, or IVF transfer.',\n },\n },\n required: ['method'],\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the method was applied.',\n },\n errors: [\n 'Returns false for a method outside the three supported anchors.',\n ],\n descriptionKey: 'ui.agent.dueDateCalculator.actions.setMethod',\n description:\n 'Choose which anchor the pregnancy is dated from. The reference date is kept and re-interpreted under the new method, so set the method first.',\n invoke: (handle, args: { method: 'lmp' | 'conception' | 'ivf' }) =>\n handle.setMethod(args.method),\n },\n set_reference_date: {\n safety: 'write',\n argsType: '{ date: string | null }',\n argsSchema: {\n type: 'object',\n properties: {\n date: {\n oneOf: [\n { ...isoDate, description: 'Local calendar date, `yyyy-MM-dd`.' },\n { type: 'null' },\n ],\n description:\n 'The date the active method anchors on — LMP, conception, or transfer — or null to clear it. Must not be in the future.',\n },\n },\n required: ['date'],\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the date was applied.',\n },\n errors: [\n 'Returns false for an unparseable date or a date in the future — the on-screen DatePicker caps at today.',\n ],\n examples: [\n {\n args: { date: '2026-01-12' },\n note: 'Under the default LMP method, a last period starting 12 January.',\n },\n ],\n descriptionKey: 'ui.agent.dueDateCalculator.actions.setReferenceDate',\n description:\n 'Set the reference date for the active method. This is the only required input — the result stays null without it.',\n invoke: (handle, args: { date: string | null }) =>\n handle.setReferenceDate(args.date),\n },\n set_cycle_length: {\n safety: 'write',\n argsType: '{ days: number | null }',\n argsSchema: {\n type: 'object',\n properties: {\n days: {\n oneOf: [\n { type: 'integer', minimum: 20, maximum: 45 },\n { type: 'null' },\n ],\n description:\n 'Average cycle length in days (20–45), or null to fall back to the 28-day default.',\n },\n },\n required: ['days'],\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the value was applied.',\n },\n errors: [\n 'Returns false outside 20–45 days — the same bounds the on-screen NumberInput enforces.',\n 'Applies but changes nothing unless the method is `lmp`, and is ignored once a CRL re-dating is confirmed.',\n ],\n descriptionKey: 'ui.agent.dueDateCalculator.actions.setCycleLength',\n description:\n 'LMP method only — set the average cycle length, which shifts Naegele dating off the 28-day assumption.',\n invoke: (handle, args: { days: number | null }) =>\n handle.setCycleLength(args.days),\n },\n set_embryo_age: {\n safety: 'write',\n argsType: '{ days: 3 | 5 }',\n argsSchema: {\n type: 'object',\n properties: {\n days: {\n enum: [3, 5],\n description:\n 'Embryo age at transfer in days — 3 (cleavage) or 5 (blastocyst).',\n },\n },\n required: ['days'],\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the value was applied.',\n },\n errors: [\n 'Returns false for any value other than 3 or 5.',\n 'Applies but changes nothing unless the method is `ivf`.',\n ],\n descriptionKey: 'ui.agent.dueDateCalculator.actions.setEmbryoAge',\n description:\n 'IVF method only — set the embryo age at transfer, which offsets the transfer date back to a notional LMP.',\n invoke: (handle, args: { days: 3 | 5 }) => handle.setEmbryoAge(args.days),\n },\n set_crl: {\n safety: 'write',\n argsType: '{ crlMm?: number | null, scanDate?: string | null }',\n argsSchema: {\n type: 'object',\n properties: {\n crlMm: {\n oneOf: [{ type: 'number', exclusiveMinimum: 0 }, { type: 'null' }],\n description:\n 'Crown-rump length in millimetres, or null to clear it.',\n },\n scanDate: {\n oneOf: [{ ...isoDate }, { type: 'null' }],\n description:\n 'Date of the CRL scan (`yyyy-MM-dd`, not in the future), or null to clear it.',\n },\n },\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the measurement was applied.',\n },\n errors: [\n 'Returns false and writes nothing when the length is not positive or the scan date is unparseable or in the future — the payload applies all-or-nothing.',\n 'Re-dating only happens under the `lmp` method, and only when both the length and the scan date are set.',\n ],\n examples: [\n {\n args: { crlMm: 42, scanDate: '2026-02-20' },\n note: 'A first-trimester CRL that may re-date the pregnancy per ACOG CO 700.',\n },\n ],\n descriptionKey: 'ui.agent.dueDateCalculator.actions.setCrl',\n description:\n 'LMP method only — set the first-trimester crown-rump length and its scan date. When the two disagree with the LMP beyond the ACOG threshold, the scan re-dates the pregnancy and overrides cycle length.',\n invoke: (\n handle,\n args: { crlMm?: number | null; scanDate?: string | null },\n ) => handle.setCrl(args),\n },\n set_as_of_date: {\n safety: 'write',\n argsType: '{ date: string }',\n argsSchema: {\n type: 'object',\n properties: {\n date: {\n ...isoDate,\n description:\n 'Date to evaluate gestational age and trimester against, `yyyy-MM-dd`. May be in the future to project forward.',\n },\n },\n required: ['date'],\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the date was applied.',\n },\n errors: ['Returns false for an unparseable date.'],\n examples: [\n {\n args: { date: '2026-09-15' },\n note: 'Project gestational age forward to an upcoming appointment.',\n },\n ],\n descriptionKey: 'ui.agent.dueDateCalculator.actions.setAsOfDate',\n description:\n 'Set the date gestational age, trimester and the antenatal schedule are evaluated against. Defaults to today; the estimated delivery date itself does not depend on it.',\n invoke: (handle, args: { date: string }) => handle.setAsOfDate(args.date),\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'due-date-calculator',\n description: 'Marks the DueDateCalculator wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Also the registry key — without an `id` the instance does not register and the handle-driven actions/state are unreachable.',\n },\n },\n};\n","/* ------------------------------------------------------------------ */\n/* DueDateCalculator — estimate the date of delivery from one of three */\n/* dating methods, with current gestational age + trimester. */\n/* */\n/* - Maths lives in `./gestation` (pure, separately tested). */\n/* - Three methods: LMP (Naegele, cycle-length adjustable), conception, */\n/* and IVF transfer (Day-3 vs Day-5 embryo). */\n/* - The reference date can't be in the future, so the DatePicker caps */\n/* at today. */\n/* ------------------------------------------------------------------ */\n\nimport { forwardRef, useEffect, useMemo, useRef, useState } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { format, isAfter, parseISO } from 'date-fns';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { dueDateCalculatorAgent } from './due-date-calculator.agent';\nimport { RadioGroup, Radio } from '../radio-group';\nimport { FormField } from '../form-field';\nimport { DatePicker } from '../date-picker';\nimport { NumberInput } from '../number-input';\nimport { Card } from '../card';\nimport { Badge } from '../badge';\nimport {\n InsertButton,\n type InsertPayload,\n type InsertVariant,\n type InsertMode,\n} from '../_shared/insert-result';\nimport {\n type DueDateMethod,\n type EmbryoAge,\n type DueDateResult,\n computeDueDate,\n redateByCrl,\n DEFAULT_CYCLE_LENGTH,\n TRIMESTER_BADGE_VARIANT,\n trimesterHighlightToken,\n} from '../_shared/obstetrics';\nimport {\n computeAntenatalSchedule,\n type AntenatalScheduleOptions,\n} from '../_shared/antenatal-schedule';\nimport {\n AntenatalScheduleTimeline,\n buildScheduleInsertFields,\n} from '../_shared/antenatal-schedule-timeline';\n\nconst rootVariants = cva('ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]', {\n variants: {\n width: { full: 'ds:w-full', auto: 'ds:inline-flex' },\n },\n defaultVariants: { width: 'full' },\n});\n\n/** Reference-date i18n key per method. */\nconst DATE_LABEL_KEY: Record<DueDateMethod, string> = {\n lmp: 'dueDateCalculator.lmpDate',\n conception: 'dueDateCalculator.conceptionDate',\n ivf: 'dueDateCalculator.transferDate',\n};\n\n/* ------------------------------------------------------------------ */\n/* Agent boundary */\n/* */\n/* Dates cross the agent boundary as local-time `yyyy-MM-dd` strings, */\n/* never `Date` objects — a Date JSON-serialises to UTC and silently */\n/* shifts the day for anyone east or west of Greenwich. */\n/* ------------------------------------------------------------------ */\n\nconst toIsoDate = (d: Date): string => format(d, 'yyyy-MM-dd');\n\nconst fromIsoDate = (iso: string): Date | null => {\n const d = parseISO(iso);\n return Number.isNaN(d.getTime()) ? null : d;\n};\n\n/** UI input bounds, mirrored by the agent handle so it can't out-type a user. */\nconst CYCLE_LENGTH_RANGE = { min: 20, max: 45 } as const;\n\n/** The dating inputs as entered. */\nexport interface DueDateInputsSnapshot {\n /** Which anchor the pregnancy is dated from. */\n method: DueDateMethod;\n /** The method's reference date (`yyyy-MM-dd`), or null when unset. */\n referenceDate: string | null;\n /** LMP only — average cycle length in days, or null for the 28-day default. */\n cycleLength: number | null;\n /** IVF only — embryo age at transfer, in days. */\n embryoAge: EmbryoAge;\n /** LMP only — crown-rump length in millimetres, or null. */\n crlMm: number | null;\n /** LMP only — date of the CRL scan (`yyyy-MM-dd`), or null. */\n scanDate: string | null;\n /** The date gestational age and trimester are evaluated against. */\n asOfDate: string;\n}\n\n/** `DueDateResult` projected onto the agent boundary — ISO dates, no Dates. */\nexport interface DueDateSnapshot {\n /** Estimated date of delivery, `yyyy-MM-dd`. */\n dueDate: string;\n /** GA day-0 anchor (effective LMP) after any CRL re-dating, `yyyy-MM-dd`. */\n gestationalStart: string;\n /** Gestational age as of the evaluation date; null before conception. */\n gestationalAge: { weeks: number; days: number; totalDays: number } | null;\n /** Trimester band as of the evaluation date. */\n trimester: DueDateResult['trimester'];\n}\n\n/**\n * Curated imperative handle for agent / external automation. Reads the dating\n * inputs and the computed due date, and drives the inputs the way a user\n * would. Never exposes patient identity — only structural dates and numbers.\n * Consumed by `due-date-calculator.agent.ts`; the public `ref` stays the root\n * DOM element.\n */\nexport interface DueDateCalculatorHandle {\n /** The dating inputs as entered. */\n getInputs: () => DueDateInputsSnapshot;\n /** Computed due date, gestational age and trimester, or null until a reference date is set. */\n getResult: () => DueDateSnapshot | null;\n /** Switch the dating method. Keeps the reference date, which is re-interpreted. */\n setMethod: (method: DueDateMethod) => boolean;\n /** Set the method's reference date (`yyyy-MM-dd`, not in the future). */\n setReferenceDate: (isoDate: string | null) => boolean;\n /** LMP only — set the average cycle length in days (20–45). */\n setCycleLength: (days: number | null) => boolean;\n /** IVF only — set the embryo age at transfer (3 or 5 days). */\n setEmbryoAge: (days: EmbryoAge) => boolean;\n /** LMP only — set the CRL measurement and/or its scan date for ACOG re-dating. */\n setCrl: (next: {\n crlMm?: number | null;\n scanDate?: string | null;\n }) => boolean;\n /** Set the date gestational age and trimester are evaluated against. */\n setAsOfDate: (isoDate: string) => boolean;\n}\n\nexport interface DueDateCalculatorProps extends VariantProps<\n typeof rootVariants\n> {\n /** Initial dating method. Defaults to `'lmp'`. */\n defaultMethod?: DueDateMethod;\n /** Fires whenever a due date can be computed (and with `null` when it can't). */\n onResultChange?: (result: DueDateResult | null) => void;\n /** When provided, shows an \"Insert\" button that emits the result for an editor. */\n onInsert?: (payload: InsertPayload) => void;\n /**\n * Which verb the result button performs. Defaults to `'insert'`.\n * Use `'copy'` in an app-shell surface (no editor to insert into) — the\n * button writes the result to the clipboard as a multi-format `ClipboardItem`.\n */\n insertVariant?: InsertVariant;\n /** `copy` variant only — fired after a successful clipboard write. */\n onCopy?: (mode: InsertMode) => void;\n /** `copy` variant only — fired if the clipboard write can't proceed. */\n onError?: (error: unknown) => void;\n /**\n * Brand wordmark printed in the inserted/copied result-card footer.\n * Omitted → no brand line (and no footer hairline); a string → that custom\n * brand; `false` → no brand line. Brand is opt-in.\n */\n insertBrand?: string | false;\n /**\n * Append the antenatal exam schedule (the time-sensitive screening windows)\n * below the result, dated from the computed gestational start.\n */\n showSchedule?: boolean;\n /**\n * Passthrough options for the appended schedule (national `schedule`,\n * `plurality`, `chorionicity`, `rhNegative`, `gdmRisk`, …). `today` is\n * supplied by the component. Ignored unless `showSchedule` is set.\n */\n scheduleOptions?: Omit<AntenatalScheduleOptions, 'today'>;\n /** Opaque instance id, emitted as `data-component-id`. */\n id?: string;\n /** Extra class names on the wrapper. */\n className?: string;\n}\n\n/**\n * @deprecated Superseded by `PregnancyDating`, which unifies the due-date and\n * gestational-age calculators (any anchor → both EDD and current GA) and adds a\n * manual ±days dating adjustment. This component will be removed in a future\n * release; migrate to `PregnancyDating` (`defaultMethod=\"lmp\"`).\n */\nexport const DueDateCalculator = forwardRef<\n HTMLDivElement,\n DueDateCalculatorProps\n>(\n (\n {\n defaultMethod = 'lmp',\n onResultChange,\n onInsert,\n insertVariant = 'insert',\n onCopy,\n onError,\n insertBrand,\n showSchedule = false,\n scheduleOptions,\n id,\n width,\n className,\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation('ui');\n\n const [method, setMethod] = useState<DueDateMethod>(defaultMethod);\n const [refDate, setRefDate] = useState<Date | undefined>(undefined);\n const [cycleLength, setCycleLength] = useState<number | null>(\n DEFAULT_CYCLE_LENGTH,\n );\n const [embryoAge, setEmbryoAge] = useState<EmbryoAge>(5);\n // Optional first-trimester ultrasound (LMP method only) for ACOG CO700 redating.\n const [crlMm, setCrlMm] = useState<number | null>(null);\n const [scanDate, setScanDate] = useState<Date | undefined>(undefined);\n\n // Real today — caps the date inputs (LMP / ultrasound can't be in the future).\n const today = useMemo(() => new Date(), []);\n // The date GA, trimester and schedule status are evaluated against; defaults\n // to today but can be a future appointment date to project forward. (The EDD\n // itself is dating-anchored and does not depend on this.)\n const [asOfDate, setAsOfDate] = useState<Date>(() => new Date());\n\n // ACOG CO700 CRL redating — only when an LMP, a CRL and a scan date are set.\n const redating = useMemo(() => {\n if (method !== 'lmp' || !refDate || crlMm === null || !scanDate) {\n return null;\n }\n return redateByCrl({ lmp: refDate, scanDate, crlMm });\n }, [method, refDate, crlMm, scanDate]);\n\n const result = useMemo<DueDateResult | null>(() => {\n if (!refDate) return null;\n // A confirmed redating moves the effective LMP to the ultrasound's; the\n // CRL already reflects true gestation, so cycle adjustment no longer applies.\n const effectiveDate =\n method === 'lmp' && redating?.redated\n ? redating.gestationalStart\n : refDate;\n const effectiveCycle =\n method === 'lmp' && redating?.redated\n ? DEFAULT_CYCLE_LENGTH\n : (cycleLength ?? DEFAULT_CYCLE_LENGTH);\n return computeDueDate(\n {\n method,\n date: effectiveDate,\n cycleLength: effectiveCycle,\n embryoAge,\n },\n asOfDate,\n );\n }, [method, refDate, cycleLength, embryoAge, redating, asOfDate]);\n\n const dateFormatter = useMemo(\n () => new Intl.DateTimeFormat(i18n.language, { dateStyle: 'long' }),\n [i18n.language],\n );\n\n useEffect(() => {\n onResultChange?.(result);\n }, [result, onResultChange]);\n\n /* ── Agent handle ────────────────────────────────────────────────── */\n const liveRef = useRef({\n method,\n refDate,\n cycleLength,\n embryoAge,\n crlMm,\n scanDate,\n asOfDate,\n result,\n });\n liveRef.current = {\n method,\n refDate,\n cycleLength,\n embryoAge,\n crlMm,\n scanDate,\n asOfDate,\n result,\n };\n\n const agentHandle = useMemo<DueDateCalculatorHandle>(\n () => ({\n getInputs: () => {\n const live = liveRef.current;\n return {\n method: live.method,\n referenceDate: live.refDate ? toIsoDate(live.refDate) : null,\n cycleLength: live.cycleLength,\n embryoAge: live.embryoAge,\n crlMm: live.crlMm,\n scanDate: live.scanDate ? toIsoDate(live.scanDate) : null,\n asOfDate: toIsoDate(live.asOfDate),\n };\n },\n getResult: () => {\n const r = liveRef.current.result;\n if (!r) return null;\n return {\n dueDate: toIsoDate(r.dueDate),\n gestationalStart: toIsoDate(r.gestationalStart),\n gestationalAge: r.gestationalAge ? { ...r.gestationalAge } : null,\n trimester: r.trimester,\n };\n },\n setMethod: (next) => {\n if (next !== 'lmp' && next !== 'conception' && next !== 'ivf') {\n return false;\n }\n setMethod(next);\n return true;\n },\n setReferenceDate: (isoDate) => {\n if (isoDate === null) {\n setRefDate(undefined);\n return true;\n }\n const parsed = fromIsoDate(isoDate);\n // The DatePicker caps at today; the handle honours the same bound.\n if (!parsed || isAfter(parsed, new Date())) return false;\n setRefDate(parsed);\n return true;\n },\n setCycleLength: (days) => {\n if (\n days !== null &&\n !(\n Number.isFinite(days) &&\n days >= CYCLE_LENGTH_RANGE.min &&\n days <= CYCLE_LENGTH_RANGE.max\n )\n ) {\n return false;\n }\n setCycleLength(days);\n return true;\n },\n setEmbryoAge: (days) => {\n if (days !== 3 && days !== 5) return false;\n setEmbryoAge(days);\n return true;\n },\n setCrl: (next) => {\n const now = new Date();\n let parsedScan: Date | undefined;\n // Validate the whole payload before writing any of it, so a bad\n // value can't leave the form half-updated.\n if ('crlMm' in next) {\n const mm = next.crlMm;\n if (\n mm !== null &&\n mm !== undefined &&\n !(Number.isFinite(mm) && mm > 0)\n ) {\n return false;\n }\n }\n if ('scanDate' in next && next.scanDate != null) {\n const d = fromIsoDate(next.scanDate);\n if (!d || isAfter(d, now)) return false;\n parsedScan = d;\n }\n if ('crlMm' in next) setCrlMm(next.crlMm ?? null);\n if ('scanDate' in next) setScanDate(parsedScan);\n return true;\n },\n setAsOfDate: (isoDate) => {\n const parsed = fromIsoDate(isoDate);\n if (!parsed) return false;\n setAsOfDate(parsed);\n return true;\n },\n }),\n [],\n );\n useAgentRegistration(dueDateCalculatorAgent, agentHandle, id);\n\n const schedule = useMemo(() => {\n if (!showSchedule || !result) return null;\n return computeAntenatalSchedule(result.gestationalStart, {\n ...scheduleOptions,\n today: asOfDate,\n });\n }, [showSchedule, result, asOfDate, scheduleOptions]);\n\n return (\n <div\n ref={ref}\n data-component=\"due-date-calculator\"\n data-component-id={id}\n className={rootVariants({ width, className })}\n >\n <RadioGroup\n label={t('dueDateCalculator.method.label')}\n variant=\"horizontal\"\n value={method}\n onValueChange={(next) => setMethod(next as DueDateMethod)}\n >\n <Radio label={t('dueDateCalculator.method.lmp')} value=\"lmp\" />\n <Radio\n label={t('dueDateCalculator.method.conception')}\n value=\"conception\"\n />\n <Radio label={t('dueDateCalculator.method.ivf')} value=\"ivf\" />\n </RadioGroup>\n\n <div className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2\">\n <FormField label={t(DATE_LABEL_KEY[method])}>\n <DatePicker value={refDate} onChange={setRefDate} maxDate={today} />\n </FormField>\n\n {method === 'lmp' && (\n <FormField\n label={t('dueDateCalculator.cycleLength')}\n description={t('dueDateCalculator.cycleLengthHint')}\n >\n <NumberInput\n mode=\"integer\"\n min={CYCLE_LENGTH_RANGE.min}\n max={CYCLE_LENGTH_RANGE.max}\n value={cycleLength}\n onChange={setCycleLength}\n />\n </FormField>\n )}\n\n {method === 'ivf' && (\n <RadioGroup\n label={t('dueDateCalculator.embryoAge')}\n variant=\"horizontal\"\n value={String(embryoAge)}\n onValueChange={(next) => setEmbryoAge(Number(next) as EmbryoAge)}\n >\n <Radio label={t('dueDateCalculator.day3')} value=\"3\" />\n <Radio label={t('dueDateCalculator.day5')} value=\"5\" />\n </RadioGroup>\n )}\n </div>\n\n <FormField\n label={t('dueDateCalculator.asOfDate')}\n description={t('dueDateCalculator.asOfDateHint')}\n >\n <DatePicker value={asOfDate} onChange={(d) => d && setAsOfDate(d)} />\n </FormField>\n\n {method === 'lmp' ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n <div className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2\">\n <FormField\n label={t('dueDateCalculator.crl')}\n description={t('dueDateCalculator.crlHint')}\n >\n <NumberInput\n mode=\"decimal\"\n min={0}\n step={0.1}\n value={crlMm}\n onChange={setCrlMm}\n />\n </FormField>\n <FormField label={t('dueDateCalculator.scanDate')}>\n <DatePicker\n value={scanDate}\n onChange={setScanDate}\n maxDate={today}\n />\n </FormField>\n </div>\n {redating ? (\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]\">\n <Badge variant={redating.redated ? 'warning' : 'success'}>\n {redating.redated\n ? t('dueDateCalculator.redated', {\n days: redating.discrepancyDays,\n })\n : t('dueDateCalculator.datesAgree')}\n </Badge>\n {!redating.crlInRange ? (\n <span className=\"type-meta ds:text-muted-foreground\">\n {t('dueDateCalculator.crlOutOfRange')}\n </span>\n ) : null}\n </div>\n ) : null}\n </div>\n ) : null}\n\n {/* Concise polite announcement when a due date resolves. */}\n <p className=\"ds:sr-only\" role=\"status\" aria-live=\"polite\">\n {result\n ? `${t('dueDateCalculator.result.dueDateLabel')}: ${dateFormatter.format(\n result.dueDate,\n )}. ${t('dueDateCalculator.result.trimesterLabel')}: ${t(\n `dueDateCalculator.trimester.${result.trimester}`,\n )}.`\n : ''}\n </p>\n\n {result ? (\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n <dl className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-3\">\n <div className=\"ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('dueDateCalculator.result.trimesterLabel')}\n </dt>\n <dd>\n <Badge\n variant={TRIMESTER_BADGE_VARIANT[result.trimester]}\n size=\"lg\"\n >\n {t(`dueDateCalculator.trimester.${result.trimester}`)}\n </Badge>\n </dd>\n </div>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('dueDateCalculator.result.gestationLabel')}\n </dt>\n <dd className=\"type-body ds:text-foreground\">\n {result.gestationalAge\n ? t('dueDateCalculator.result.gestation', {\n weeks: result.gestationalAge.weeks,\n days: result.gestationalAge.days,\n })\n : '—'}\n </dd>\n </div>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('dueDateCalculator.result.dueDateLabel')}\n </dt>\n <dd className=\"type-metric ds:text-foreground\">\n {dateFormatter.format(result.dueDate)}\n </dd>\n </div>\n </dl>\n </Card.Body>\n </Card>\n ) : (\n <p className=\"type-body ds:text-muted-foreground\">\n {t('dueDateCalculator.empty')}\n </p>\n )}\n\n {schedule ? <AntenatalScheduleTimeline events={schedule} /> : null}\n\n {/* One result-action group for the whole result — sits after both the\n due-date card and the schedule, and its payload carries the schedule\n rows when shown (no per-card buttons). */}\n {result && (insertVariant === 'copy' || onInsert) ? (\n <InsertButton\n variant={insertVariant}\n onInsert={onInsert}\n onCopy={onCopy}\n onError={onError}\n card={{\n title: t('insert.title.dueDate'),\n icon: 'calendar-heart',\n highlight: dateFormatter.format(result.dueDate),\n // Chip tinted with the trimester's semantic token so the inserted\n // PNG carries the same clinical-stage colour as the on-screen\n // trimester badge — with the contrast-safe orange override for the\n // `--warning` third trimester.\n highlightToken: trimesterHighlightToken(result.trimester),\n brand: insertBrand,\n fields: [\n {\n // The estimated date of delivery → calendar glyph.\n icon: 'calendar',\n label: t('dueDateCalculator.result.dueDateLabel'),\n value: dateFormatter.format(result.dueDate),\n },\n {\n // Gestational age is an elapsed duration → clock glyph.\n icon: 'clock',\n label: t('dueDateCalculator.result.gestationLabel'),\n value: result.gestationalAge\n ? t('dueDateCalculator.result.gestation', {\n weeks: result.gestationalAge.weeks,\n days: result.gestationalAge.days,\n })\n : '—',\n },\n {\n // Trimester is a clinical-stage classification → tag.\n icon: 'tag',\n label: t('dueDateCalculator.result.trimesterLabel'),\n value: t(`dueDateCalculator.trimester.${result.trimester}`),\n },\n // When the schedule is shown, the single Insert button carries\n // the exam windows too (no second button).\n ...(schedule\n ? buildScheduleInsertFields(schedule, t, (d) =>\n dateFormatter.format(d),\n )\n : []),\n ],\n }}\n />\n ) : null}\n </div>\n );\n },\n);\n\nDueDateCalculator.displayName = 'DueDateCalculator';\n"],"names":["DEPRECATED","isoDate","dueDateCalculatorAgent","handle","args","rootVariants","cva","DATE_LABEL_KEY","toIsoDate","d","format","fromIsoDate","iso","parseISO","CYCLE_LENGTH_RANGE","DueDateCalculator","forwardRef","defaultMethod","onResultChange","onInsert","insertVariant","onCopy","onError","insertBrand","showSchedule","scheduleOptions","id","width","className","ref","i18n","useTranslation","method","setMethod","useState","refDate","setRefDate","cycleLength","setCycleLength","DEFAULT_CYCLE_LENGTH","embryoAge","setEmbryoAge","crlMm","setCrlMm","scanDate","setScanDate","today","useMemo","asOfDate","setAsOfDate","redating","redateByCrl","result","effectiveDate","effectiveCycle","computeDueDate","dateFormatter","useEffect","liveRef","useRef","agentHandle","live","r","next","parsed","isAfter","days","now","parsedScan","mm","useAgentRegistration","schedule","computeAntenatalSchedule","jsxs","RadioGroup","jsx","Radio","FormField","DatePicker","NumberInput","Badge","Card","TRIMESTER_BADGE_VARIANT","AntenatalScheduleTimeline","InsertButton","trimesterHighlightToken","buildScheduleInsertFields"],"mappings":";;;;;;;;;;;;;;;;;AAyBA,MAAMA,IAAa,iDAGbC,IAAU;AAAA,EACd,MAAM;AAAA,EACN,SAAS;AACX,GAEaC,KAAgE;AAAA,EAC3E,IAAI;AAAA;AAAA,EAEJ,cAAc,CAAC,WAAW;AAAA,EAC1B,OAAO;AAAA,IACL,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,UAAA;AAAA,IAAU;AAAA,IAErC,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,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ACP,QAAQ;AAAA,kBACN;AAAA;AAAA,oBAEE,MAAM;AAAA,oBACN,OAAO,EAAE,uCAAuC;AAAA,oBAChD,OAAOiC,EAAc,OAAOJ,EAAO,OAAO;AAAA,kBAAA;AAAA,kBAE5C;AAAA;AAAA,oBAEE,MAAM;AAAA,oBACN,OAAO,EAAE,yCAAyC;AAAA,oBAClD,OAAOA,EAAO,iBACV,EAAE,sCAAsC;AAAA,sBACtC,OAAOA,EAAO,eAAe;AAAA,sBAC7B,MAAMA,EAAO,eAAe;AAAA,oBAAA,CAC7B,IACD;AAAA,kBAAA;AAAA,kBAEN;AAAA;AAAA,oBAEE,MAAM;AAAA,oBACN,OAAO,EAAE,yCAAyC;AAAA,oBAClD,OAAO,EAAE,+BAA+BA,EAAO,SAAS,EAAE;AAAA,kBAAA;AAAA;AAAA;AAAA,kBAI5D,GAAImB,IACAe;AAAA,oBAA0Bf;AAAA,oBAAU;AAAA,oBAAG,CAAC9D,MACtC+C,EAAc,OAAO/C,CAAC;AAAA,kBAAA,IAExB,CAAA;AAAA,gBAAC;AAAA,cACP;AAAA,YACF;AAAA,UAAA,IAEA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEAM,GAAkB,cAAc;"}
@@ -6,7 +6,7 @@ import { A as H } from "./avatar-WZY3eGE7.js";
6
6
  import { B as $ } from "./button-Bn16lcFM.js";
7
7
  import { I as O } from "./icon-button-COX76Jdj.js";
8
8
  import { C } from "./card-DMO2nkt4.js";
9
- import { L as F } from "./link-2HokYuIi.js";
9
+ import { L as F } from "./link-gRw3NtOt.js";
10
10
  import { P as G } from "./panel-header-D_mTdhUp.js";
11
11
  import { T as W } from "./timestamp-DPLDWdxA.js";
12
12
  import { u as X } from "./registry-DvAUVLHh.js";
@@ -274,4 +274,4 @@ function ae({ section: t }) {
274
274
  export {
275
275
  be as E
276
276
  };
277
- //# sourceMappingURL=entity-summary-DcB0fIiv.js.map
277
+ //# sourceMappingURL=entity-summary-CWcCSThK.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"entity-summary-DcB0fIiv.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","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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;AAA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,EAAQ,SAAS,cAKjB,gBAAAf;AAAA,IAACiB;AAAA,IAAA;AAAA,MACC,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,MAAMF,EAAQ;AAAA,MACd,WAAU;AAAA,MAEV,UAAA;AAAA,QAAA,gBAAAd,EAACgB,EAAM,OAAN,EAAY,IAAG,MAAM,YAAQ,SAAQ;AAAA,QACtC,gBAAAhB,EAAC,MAAA,EAAG,WAAWtC,GACZ,YAAQ,MAAM,IAAI,CAACuD,GAAMJ,MACxB,gBAAAb,EAAC,MAAA,EAAgB,UAAAiB,EAAA,GAARJ,CAAa,CACvB,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,IAUJ,gBAAAb,EAACW,KAAK,SAAQ,YAAW,mBAAiB3B,GACxC,UAAA,gBAAAe,EAAC,OAAA,EAAI,WAAU,2EACb,UAAA;AAAA,IAAA,gBAAAA,EAAC,OAAA,EAAI,WAAU,sDACZ,UAAA;AAAA,MAAAe,EAAQ,yBACN,QAAA,EAAK,eAAY,QAAO,WAAWrD,IACjC,UAAAqD,EAAQ,KAAA,CACX,IACE;AAAA,MACJ,gBAAAd;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,IAAIhB;AAAA,UACJ,WAAU;AAAA,UAET,UAAA8B,EAAQ;AAAA,QAAA;AAAA,MAAA;AAAA,IACX,GACF;AAAA,sBACC,MAAA,EAAG,WAAW,GAAGpD,CAAa,sCAC5B,UAAAoD,EAAQ,MAAM,IAAI,CAACG,GAAMJ,MACxB,gBAAAb,EAAC,QAAgB,UAAAiB,EAAA,GAARJ,CAAa,CACvB,EAAA,CACH;AAAA,EAAA,EAAA,CACF,EAAA,CACF;AAEJ;","x_google_ignoreList":[0]}
@@ -8,7 +8,7 @@ import { S as he } from "./skeleton-B1KTdJ4N.js";
8
8
  import { u as Ct } from "./use-controllable-state-BiY4xTzM.js";
9
9
  import { u as wt } from "./registry-DvAUVLHh.js";
10
10
  import { B as Z } from "./button-Bn16lcFM.js";
11
- import { D as m } from "./dialog-CUzbnKLw.js";
11
+ import { D as m } from "./dialog-Dn-iQ0Jp.js";
12
12
  import { a as St, F as xt } from "./file-upload-CxjCs7TX.js";
13
13
  import { S as We } from "./state-backed-text-input-DECQy5aA.js";
14
14
  import { F as Ge } from "./folder-BghC8_S2.js";
@@ -18,7 +18,7 @@ import { F as Ft } from "./file-text-5yv6r2ls.js";
18
18
  import { F as Tt } from "./file-spreadsheet-DmwyfV4O.js";
19
19
  import { F as At } from "./file-BuG1VMAy.js";
20
20
  import { C as Dt } from "./chevron-right-I9AeSxH2.js";
21
- import { D as Fe } from "./data-table-D8fuhqO1.js";
21
+ import { D as Fe } from "./data-table-fAMTeAjM.js";
22
22
  import { A as Rt, a as It } from "./actions-cell-renderer-Dj1ZkvJj.js";
23
23
  import { B as $e } from "./badge-hnBt8o7n.js";
24
24
  import { D as Ue } from "./download-CfYKJO_j.js";
@@ -1744,4 +1744,4 @@ export {
1744
1744
  hn as F,
1745
1745
  Gt as f
1746
1746
  };
1747
- //# sourceMappingURL=file-manager-Cc_uO8r2.js.map
1747
+ //# sourceMappingURL=file-manager-CFsL1KVt.js.map