@alfadocs/ui-kit-debug 1.6.0 → 1.7.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 (400) hide show
  1. package/dist/_chunks/{actions-cell-renderer-BD-jruqA.js → actions-cell-renderer-ALEAGO3j.js} +6 -6
  2. package/dist/_chunks/{actions-cell-renderer-BD-jruqA.js.map → actions-cell-renderer-ALEAGO3j.js.map} +1 -1
  3. package/dist/_chunks/{agenda-tray-CYR-znfE.js → agenda-tray-BweO8pDo.js} +3 -3
  4. package/dist/_chunks/{agenda-tray-CYR-znfE.js.map → agenda-tray-BweO8pDo.js.map} +1 -1
  5. package/dist/_chunks/{ai-consent-banner-DLF6FNXv.js → ai-consent-banner-OggpS5hW.js} +2 -2
  6. package/dist/_chunks/{ai-consent-banner-DLF6FNXv.js.map → ai-consent-banner-OggpS5hW.js.map} +1 -1
  7. package/dist/_chunks/{ai-prompt-input-BgAubYKd.js → ai-prompt-input-DnbfEJnr.js} +2 -2
  8. package/dist/_chunks/{ai-prompt-input-BgAubYKd.js.map → ai-prompt-input-DnbfEJnr.js.map} +1 -1
  9. package/dist/_chunks/{alia-sidebar-Bg53-ZOT.js → alia-sidebar-BWcWZivN.js} +7 -7
  10. package/dist/_chunks/{alia-sidebar-Bg53-ZOT.js.map → alia-sidebar-BWcWZivN.js.map} +1 -1
  11. package/dist/_chunks/{anamnesis-card-BylMLHYj.js → anamnesis-card-NTi4LLzI.js} +2 -2
  12. package/dist/_chunks/{anamnesis-card-BylMLHYj.js.map → anamnesis-card-NTi4LLzI.js.map} +1 -1
  13. package/dist/_chunks/{anamnesis-summary-rows-BpYztFUv.js → anamnesis-summary-rows-F-cCmFAn.js} +7 -7
  14. package/dist/_chunks/{anamnesis-summary-rows-BpYztFUv.js.map → anamnesis-summary-rows-F-cCmFAn.js.map} +1 -1
  15. package/dist/_chunks/{appointment-timeline-DT1uFp8z.js → appointment-timeline-CMPvzlGZ.js} +4 -4
  16. package/dist/_chunks/{appointment-timeline-DT1uFp8z.js.map → appointment-timeline-CMPvzlGZ.js.map} +1 -1
  17. package/dist/_chunks/{appointment-tray-DvyVK7um.js → appointment-tray-3c_FLxXJ.js} +3 -3
  18. package/dist/_chunks/{appointment-tray-DvyVK7um.js.map → appointment-tray-3c_FLxXJ.js.map} +1 -1
  19. package/dist/_chunks/{audio-recorder-nVRN4PSK.js → audio-recorder-EWBCNIsd.js} +3 -3
  20. package/dist/_chunks/{audio-recorder-nVRN4PSK.js.map → audio-recorder-EWBCNIsd.js.map} +1 -1
  21. package/dist/_chunks/{bishop-score-BV1JAEMV.js → bishop-score-Cnu0xs-z.js} +2 -2
  22. package/dist/_chunks/{bishop-score-BV1JAEMV.js.map → bishop-score-Cnu0xs-z.js.map} +1 -1
  23. package/dist/_chunks/{bmi-calculator-CdR-RLFj.js → bmi-calculator-CcH6upht.js} +2 -2
  24. package/dist/_chunks/{bmi-calculator-CdR-RLFj.js.map → bmi-calculator-CcH6upht.js.map} +1 -1
  25. package/dist/_chunks/{booking-D84O6H2X.js → booking-CQMJUFG-.js} +5 -5
  26. package/dist/_chunks/{booking-D84O6H2X.js.map → booking-CQMJUFG-.js.map} +1 -1
  27. package/dist/_chunks/{button-group-Be_In68J.js → button-group-CaxRJsNG.js} +2 -2
  28. package/dist/_chunks/{button-group-Be_In68J.js.map → button-group-CaxRJsNG.js.map} +1 -1
  29. package/dist/_chunks/{button-BvNtqHAS.js → button-nJaPh_HC.js} +68 -38
  30. package/dist/_chunks/button-nJaPh_HC.js.map +1 -0
  31. package/dist/_chunks/{care-plan-card-CehAU7F_.js → care-plan-card-DQjVRDxO.js} +2 -2
  32. package/dist/_chunks/{care-plan-card-CehAU7F_.js.map → care-plan-card-DQjVRDxO.js.map} +1 -1
  33. package/dist/_chunks/{care-plan-entry-card-ChWRMfMw.js → care-plan-entry-card-CMpoeNkb.js} +2 -2
  34. package/dist/_chunks/{care-plan-entry-card-ChWRMfMw.js.map → care-plan-entry-card-CMpoeNkb.js.map} +1 -1
  35. package/dist/_chunks/{care-plan-header-_B0TTWT1.js → care-plan-header-CxYoq23f.js} +2 -2
  36. package/dist/_chunks/{care-plan-header-_B0TTWT1.js.map → care-plan-header-CxYoq23f.js.map} +1 -1
  37. package/dist/_chunks/{carousel.agent-pjORsMS8.js → carousel.agent-CLxdHEBP.js} +2 -2
  38. package/dist/_chunks/{carousel.agent-pjORsMS8.js.map → carousel.agent-CLxdHEBP.js.map} +1 -1
  39. package/dist/_chunks/{chart-Y-gso_Uz.js → chart-Bkr1Sh4o.js} +3 -3
  40. package/dist/_chunks/{chart-Y-gso_Uz.js.map → chart-Bkr1Sh4o.js.map} +1 -1
  41. package/dist/_chunks/{chat-input-BqI9GXQh.js → chat-input-BsB5Umpj.js} +2 -2
  42. package/dist/_chunks/{chat-input-BqI9GXQh.js.map → chat-input-BsB5Umpj.js.map} +1 -1
  43. package/dist/_chunks/{chat-message-DHNUbjXA.js → chat-message-DBQu10rs.js} +3 -3
  44. package/dist/_chunks/{chat-message-DHNUbjXA.js.map → chat-message-DBQu10rs.js.map} +1 -1
  45. package/dist/_chunks/{code-block-BONe9fJi.js → code-block-BIkpRLkl.js} +2 -2
  46. package/dist/_chunks/{code-block-BONe9fJi.js.map → code-block-BIkpRLkl.js.map} +1 -1
  47. package/dist/_chunks/{connection-status-NT8hUtYl.js → connection-status-DRZIcMqM.js} +3 -3
  48. package/dist/_chunks/{connection-status-NT8hUtYl.js.map → connection-status-DRZIcMqM.js.map} +1 -1
  49. package/dist/_chunks/{contact-profile-card-BxHiG8e6.js → contact-profile-card-CE9OJKcl.js} +2 -2
  50. package/dist/_chunks/{contact-profile-card-BxHiG8e6.js.map → contact-profile-card-CE9OJKcl.js.map} +1 -1
  51. package/dist/_chunks/{control-room-rail-DDyPDBji.js → control-room-rail-IH1eBjrK.js} +3 -3
  52. package/dist/_chunks/{control-room-rail-DDyPDBji.js.map → control-room-rail-IH1eBjrK.js.map} +1 -1
  53. package/dist/_chunks/{copy-field-B-DoMBH_.js → copy-field-fYKpl6aN.js} +2 -2
  54. package/dist/_chunks/{copy-field-B-DoMBH_.js.map → copy-field-fYKpl6aN.js.map} +1 -1
  55. package/dist/_chunks/{cycle-calculator-DJZYvNhw.js → cycle-calculator-DzgO1vzP.js} +2 -2
  56. package/dist/_chunks/{cycle-calculator-DJZYvNhw.js.map → cycle-calculator-DzgO1vzP.js.map} +1 -1
  57. package/dist/_chunks/{dashboard-grid-bd0QW2a8.js → dashboard-grid-BFtdHqfn.js} +2 -2
  58. package/dist/_chunks/{dashboard-grid-bd0QW2a8.js.map → dashboard-grid-BFtdHqfn.js.map} +1 -1
  59. package/dist/_chunks/{data-table-tabs-C8uDThT3.js → data-table-tabs-C1kRUzat.js} +3 -3
  60. package/dist/_chunks/{data-table-tabs-C8uDThT3.js.map → data-table-tabs-C1kRUzat.js.map} +1 -1
  61. package/dist/_chunks/{description-list-Ck7fKdt5.js → description-list-CjJqR8WK.js} +2 -2
  62. package/dist/_chunks/{description-list-Ck7fKdt5.js.map → description-list-CjJqR8WK.js.map} +1 -1
  63. package/dist/_chunks/{document-preview-Aae2yKvY.js → document-preview-oyx9RhCo.js} +2 -2
  64. package/dist/_chunks/{document-preview-Aae2yKvY.js.map → document-preview-oyx9RhCo.js.map} +1 -1
  65. package/dist/_chunks/{document-scanner-qNZLhH_r.js → document-scanner-C5Vrbu21.js} +2 -2
  66. package/dist/_chunks/{document-scanner-qNZLhH_r.js.map → document-scanner-C5Vrbu21.js.map} +1 -1
  67. package/dist/_chunks/{due-date-calculator-ajaQ4ya5.js → due-date-calculator-wK8Tajzz.js} +2 -2
  68. package/dist/_chunks/{due-date-calculator-ajaQ4ya5.js.map → due-date-calculator-wK8Tajzz.js.map} +1 -1
  69. package/dist/_chunks/{editable-currency-cell-renderer-DyMbSyDK.js → editable-currency-cell-renderer-DYdzKpjL.js} +3 -3
  70. package/dist/_chunks/{editable-currency-cell-renderer-DyMbSyDK.js.map → editable-currency-cell-renderer-DYdzKpjL.js.map} +1 -1
  71. package/dist/_chunks/{editor-overlay-DE-gxj9L.js → editor-overlay-DEc5yYwo.js} +2 -2
  72. package/dist/_chunks/{editor-overlay-DE-gxj9L.js.map → editor-overlay-DEc5yYwo.js.map} +1 -1
  73. package/dist/_chunks/{empty-state-Df0tM6Kn.js → empty-state-X0sVPfVo.js} +2 -2
  74. package/dist/_chunks/{empty-state-Df0tM6Kn.js.map → empty-state-X0sVPfVo.js.map} +1 -1
  75. package/dist/_chunks/{entity-summary-DBOI5di6.js → entity-summary-B_vO5Ur4.js} +3 -3
  76. package/dist/_chunks/{entity-summary-DBOI5di6.js.map → entity-summary-B_vO5Ur4.js.map} +1 -1
  77. package/dist/_chunks/{face-scheme-D7Pub04e.js → face-scheme-BfDi4YkW.js} +5 -5
  78. package/dist/_chunks/{face-scheme-D7Pub04e.js.map → face-scheme-BfDi4YkW.js.map} +1 -1
  79. package/dist/_chunks/{fetal-weight-jon6GIfQ.js → fetal-weight-Dqy0T1fP.js} +2 -2
  80. package/dist/_chunks/{fetal-weight-jon6GIfQ.js.map → fetal-weight-Dqy0T1fP.js.map} +1 -1
  81. package/dist/_chunks/{field-array-BQFX5OYi.js → field-array-BjkXZzSr.js} +3 -3
  82. package/dist/_chunks/{field-array-BQFX5OYi.js.map → field-array-BjkXZzSr.js.map} +1 -1
  83. package/dist/_chunks/{field-value-BbiDRyNh.js → field-value-DG8zaZvo.js} +4 -4
  84. package/dist/_chunks/{field-value-BbiDRyNh.js.map → field-value-DG8zaZvo.js.map} +1 -1
  85. package/dist/_chunks/{file-manager-CML_C6_h.js → file-manager-Cc_upjZX.js} +6 -6
  86. package/dist/_chunks/{file-manager-CML_C6_h.js.map → file-manager-Cc_upjZX.js.map} +1 -1
  87. package/dist/_chunks/{finished-terminal-BWNVh7Y8.js → finished-terminal-Br61Ip4e.js} +2 -2
  88. package/dist/_chunks/{finished-terminal-BWNVh7Y8.js.map → finished-terminal-Br61Ip4e.js.map} +1 -1
  89. package/dist/_chunks/{fiscal-code-input-Nx1N9r72.js → fiscal-code-input-B_nYMSEM.js} +2 -2
  90. package/dist/_chunks/{fiscal-code-input-Nx1N9r72.js.map → fiscal-code-input-B_nYMSEM.js.map} +1 -1
  91. package/dist/_chunks/{freemium-paywall-HG3pFvMp.js → freemium-paywall-DrXzYfv-.js} +2 -2
  92. package/dist/_chunks/{freemium-paywall-HG3pFvMp.js.map → freemium-paywall-DrXzYfv-.js.map} +1 -1
  93. package/dist/_chunks/{gestational-age-calculator-dEpQDWcb.js → gestational-age-calculator-C_uDAeP_.js} +2 -2
  94. package/dist/_chunks/{gestational-age-calculator-dEpQDWcb.js.map → gestational-age-calculator-C_uDAeP_.js.map} +1 -1
  95. package/dist/_chunks/{hcg-doubling-CC6TLtHd.js → hcg-doubling-BaXkJhT-.js} +2 -2
  96. package/dist/_chunks/{hcg-doubling-CC6TLtHd.js.map → hcg-doubling-BaXkJhT-.js.map} +1 -1
  97. package/dist/_chunks/{header-CimZS-J9.js → header-DUXRIPyM.js} +2 -2
  98. package/dist/_chunks/{header-CimZS-J9.js.map → header-DUXRIPyM.js.map} +1 -1
  99. package/dist/_chunks/{header-settings-C0zHLXJE.js → header-settings-CVC_davE.js} +4 -4
  100. package/dist/_chunks/{header-settings-C0zHLXJE.js.map → header-settings-CVC_davE.js.map} +1 -1
  101. package/dist/_chunks/{icon-button-9c9Gp41m.js → icon-button-DA2CAGHZ.js} +2 -2
  102. package/dist/_chunks/{icon-button-9c9Gp41m.js.map → icon-button-DA2CAGHZ.js.map} +1 -1
  103. package/dist/_chunks/{icon-button-group-DrvuWPGJ.js → icon-button-group-D6SVMteH.js} +2 -2
  104. package/dist/_chunks/{icon-button-group-DrvuWPGJ.js.map → icon-button-group-D6SVMteH.js.map} +1 -1
  105. package/dist/_chunks/{icon-picker-DXV3sDp1.js → icon-picker-ChzpCnZ-.js} +3 -3
  106. package/dist/_chunks/{icon-picker-DXV3sDp1.js.map → icon-picker-ChzpCnZ-.js.map} +1 -1
  107. package/dist/_chunks/{image-cropper-DWSnyLwW.js → image-cropper-C84NDTB7.js} +2 -2
  108. package/dist/_chunks/{image-cropper-DWSnyLwW.js.map → image-cropper-C84NDTB7.js.map} +1 -1
  109. package/dist/_chunks/{info-tip-C4mPSJbS.js → info-tip-C119cwQl.js} +2 -2
  110. package/dist/_chunks/{info-tip-C4mPSJbS.js.map → info-tip-C119cwQl.js.map} +1 -1
  111. package/dist/_chunks/{insert-result-98J1QEp7.js → insert-result-LCNTskNJ.js} +2 -2
  112. package/dist/_chunks/{insert-result-98J1QEp7.js.map → insert-result-LCNTskNJ.js.map} +1 -1
  113. package/dist/_chunks/{key-value-pair-DGkGlgCF.js → key-value-pair-BubG4fUa.js} +2 -2
  114. package/dist/_chunks/{key-value-pair-DGkGlgCF.js.map → key-value-pair-BubG4fUa.js.map} +1 -1
  115. package/dist/_chunks/{link-cell-renderer-D3IsW_2R.js → link-cell-renderer-DH4JYpKU.js} +2 -2
  116. package/dist/_chunks/{link-cell-renderer-D3IsW_2R.js.map → link-cell-renderer-DH4JYpKU.js.map} +1 -1
  117. package/dist/_chunks/{locale-picker-sI0HWgZy.js → locale-picker-BvbVjDQ-.js} +3 -3
  118. package/dist/_chunks/{locale-picker-sI0HWgZy.js.map → locale-picker-BvbVjDQ-.js.map} +1 -1
  119. package/dist/_chunks/{map-view-iwSDRW3t.js → map-view-CCAlC9IL.js} +2 -2
  120. package/dist/_chunks/{map-view-iwSDRW3t.js.map → map-view-CCAlC9IL.js.map} +1 -1
  121. package/dist/_chunks/{marketplace-app-shell-b5hN-Q0m.js → marketplace-app-shell-Chfdia7m.js} +4 -4
  122. package/dist/_chunks/{marketplace-app-shell-b5hN-Q0m.js.map → marketplace-app-shell-Chfdia7m.js.map} +1 -1
  123. package/dist/_chunks/{message-card-BCJ-Jgs6.js → message-card-D8GB4FdF.js} +3 -3
  124. package/dist/_chunks/{message-card-BCJ-Jgs6.js.map → message-card-D8GB4FdF.js.map} +1 -1
  125. package/dist/_chunks/{message-tray-DHtm_WaF.js → message-tray-CGIRQjx5.js} +4 -4
  126. package/dist/_chunks/{message-tray-DHtm_WaF.js.map → message-tray-CGIRQjx5.js.map} +1 -1
  127. package/dist/_chunks/{notes-panel-D6HKLLS-.js → notes-panel-DlnENphf.js} +3 -3
  128. package/dist/_chunks/{notes-panel-D6HKLLS-.js.map → notes-panel-DlnENphf.js.map} +1 -1
  129. package/dist/_chunks/{notification-card-CcMQn2RX.js → notification-card-CtrzoTUO.js} +3 -3
  130. package/dist/_chunks/{notification-card-CcMQn2RX.js.map → notification-card-CtrzoTUO.js.map} +1 -1
  131. package/dist/_chunks/{notification-tray-nr7dv-Q8.js → notification-tray-BiRzXHDf.js} +4 -4
  132. package/dist/_chunks/{notification-tray-nr7dv-Q8.js.map → notification-tray-BiRzXHDf.js.map} +1 -1
  133. package/dist/_chunks/{optical-prescription-DtzEqFQm.js → optical-prescription-Dj3Eh5Ok.js} +2 -2
  134. package/dist/_chunks/{optical-prescription-DtzEqFQm.js.map → optical-prescription-Dj3Eh5Ok.js.map} +1 -1
  135. package/dist/_chunks/{patient-details-rENrE_qY.js → patient-details-qnsqYBGQ.js} +5 -5
  136. package/dist/_chunks/{patient-details-rENrE_qY.js.map → patient-details-qnsqYBGQ.js.map} +1 -1
  137. package/dist/_chunks/{patient-search-NQemeJlL.js → patient-search-D5ufYoRc.js} +2 -2
  138. package/dist/_chunks/{patient-search-NQemeJlL.js.map → patient-search-D5ufYoRc.js.map} +1 -1
  139. package/dist/_chunks/{patient-summary-card-DQJgOOrA.js → patient-summary-card-CBfuDvJ5.js} +3 -3
  140. package/dist/_chunks/{patient-summary-card-DQJgOOrA.js.map → patient-summary-card-CBfuDvJ5.js.map} +1 -1
  141. package/dist/_chunks/{patient-table-BubxfOWL.js → patient-table-DwshfVsQ.js} +3 -3
  142. package/dist/_chunks/{patient-table-BubxfOWL.js.map → patient-table-DwshfVsQ.js.map} +1 -1
  143. package/dist/_chunks/{payment-automation-upsell-CnaBPt5e.js → payment-automation-upsell-BBIG7NFL.js} +2 -2
  144. package/dist/_chunks/{payment-automation-upsell-CnaBPt5e.js.map → payment-automation-upsell-BBIG7NFL.js.map} +1 -1
  145. package/dist/_chunks/{payment-request-card-CvhDzDNk.js → payment-request-card-BjjBMdsp.js} +3 -3
  146. package/dist/_chunks/{payment-request-card-CvhDzDNk.js.map → payment-request-card-BjjBMdsp.js.map} +1 -1
  147. package/dist/_chunks/{periodontal-chart-C0nNQKKK.js → periodontal-chart-BatZEFar.js} +2 -2
  148. package/dist/_chunks/{periodontal-chart-C0nNQKKK.js.map → periodontal-chart-BatZEFar.js.map} +1 -1
  149. package/dist/_chunks/{periodontal-chart-card-Bz-ebteE.js → periodontal-chart-card-BBpY_rBc.js} +2 -2
  150. package/dist/_chunks/{periodontal-chart-card-Bz-ebteE.js.map → periodontal-chart-card-BBpY_rBc.js.map} +1 -1
  151. package/dist/_chunks/{popover-Btj6N25H.js → popover-Cqcjx-Ny.js} +2 -2
  152. package/dist/_chunks/{popover-Btj6N25H.js.map → popover-Cqcjx-Ny.js.map} +1 -1
  153. package/dist/_chunks/{practice-results-CKoLD_x5.js → practice-results-BEsAdW-B.js} +719 -633
  154. package/dist/_chunks/practice-results-BEsAdW-B.js.map +1 -0
  155. package/dist/_chunks/{pregnancy-dating-DQVpFs_f.js → pregnancy-dating-BVS_9YU2.js} +2 -2
  156. package/dist/_chunks/{pregnancy-dating-DQVpFs_f.js.map → pregnancy-dating-BVS_9YU2.js.map} +1 -1
  157. package/dist/_chunks/{pregnancy-weight-gain-hm3QJALe.js → pregnancy-weight-gain-CJwbs9W-.js} +2 -2
  158. package/dist/_chunks/{pregnancy-weight-gain-hm3QJALe.js.map → pregnancy-weight-gain-CJwbs9W-.js.map} +1 -1
  159. package/dist/_chunks/{privacy-lock-SQYFRSuH.js → privacy-lock-CkAUo6Dz.js} +3 -3
  160. package/dist/_chunks/{privacy-lock-SQYFRSuH.js.map → privacy-lock-CkAUo6Dz.js.map} +1 -1
  161. package/dist/_chunks/{product-hub-panel-BjnD9pdl.js → product-hub-panel-BScCotGD.js} +3 -3
  162. package/dist/_chunks/{product-hub-panel-BjnD9pdl.js.map → product-hub-panel-BScCotGD.js.map} +1 -1
  163. package/dist/_chunks/{public-header.agent-DseNK2NQ.js → public-header.agent-kth2SdXn.js} +3 -3
  164. package/dist/_chunks/{public-header.agent-DseNK2NQ.js.map → public-header.agent-kth2SdXn.js.map} +1 -1
  165. package/dist/_chunks/{radiograph-panel.agent-CAXFgCyn.js → radiograph-panel.agent-CiHwgISa.js} +4 -4
  166. package/dist/_chunks/{radiograph-panel.agent-CAXFgCyn.js.map → radiograph-panel.agent-CiHwgISa.js.map} +1 -1
  167. package/dist/_chunks/{reviews-panel-Cd3SxJdW.js → reviews-panel-BKHEfqVQ.js} +4 -4
  168. package/dist/_chunks/{reviews-panel-Cd3SxJdW.js.map → reviews-panel-BKHEfqVQ.js.map} +1 -1
  169. package/dist/_chunks/{rich-text-editor-DGtn_4sb.js → rich-text-editor-DARnq_6N.js} +5 -5
  170. package/dist/_chunks/{rich-text-editor-DGtn_4sb.js.map → rich-text-editor-DARnq_6N.js.map} +1 -1
  171. package/dist/_chunks/{session-countdown-q4r5TlCo.js → session-countdown-QMsnRa1x.js} +2 -2
  172. package/dist/_chunks/{session-countdown-q4r5TlCo.js.map → session-countdown-QMsnRa1x.js.map} +1 -1
  173. package/dist/_chunks/{sheet-CD99CdXr.js → sheet-BSznOyJs.js} +2 -2
  174. package/dist/_chunks/{sheet-CD99CdXr.js.map → sheet-BSznOyJs.js.map} +1 -1
  175. package/dist/_chunks/{sign-in-with-alfadocs-button-_JxVRO5d.js → sign-in-with-alfadocs-button-BLe_quy5.js} +2 -2
  176. package/dist/_chunks/{sign-in-with-alfadocs-button-_JxVRO5d.js.map → sign-in-with-alfadocs-button-BLe_quy5.js.map} +1 -1
  177. package/dist/_chunks/{signature-request-C4UBfVRZ.js → signature-request-DXhpphlp.js} +4 -4
  178. package/dist/_chunks/{signature-request-C4UBfVRZ.js.map → signature-request-DXhpphlp.js.map} +1 -1
  179. package/dist/_chunks/{slot-grid-P_e9p5t5.js → slot-grid-BuZOKfcd.js} +4 -4
  180. package/dist/_chunks/{slot-grid-P_e9p5t5.js.map → slot-grid-BuZOKfcd.js.map} +1 -1
  181. package/dist/_chunks/{streaming-text-BuW7I0Zu.js → streaming-text-CvsjIQ7S.js} +2 -2
  182. package/dist/_chunks/{streaming-text-BuW7I0Zu.js.map → streaming-text-CvsjIQ7S.js.map} +1 -1
  183. package/dist/_chunks/{task-tray-BT288xoM.js → task-tray-CYG6rj2s.js} +3 -3
  184. package/dist/_chunks/{task-tray-BT288xoM.js.map → task-tray-CYG6rj2s.js.map} +1 -1
  185. package/dist/_chunks/{tasks-panel-BBkZuejF.js → tasks-panel-Do5SFp-j.js} +5 -5
  186. package/dist/_chunks/{tasks-panel-BBkZuejF.js.map → tasks-panel-Do5SFp-j.js.map} +1 -1
  187. package/dist/_chunks/{theme-toggle-Bi-CmV6M.js → theme-toggle-DuMhQNFS.js} +3 -3
  188. package/dist/_chunks/{theme-toggle-Bi-CmV6M.js.map → theme-toggle-DuMhQNFS.js.map} +1 -1
  189. package/dist/_chunks/{toast.agent-C44mtGrW.js → toast.agent-D1tdg6DS.js} +2 -2
  190. package/dist/_chunks/{toast.agent-C44mtGrW.js.map → toast.agent-D1tdg6DS.js.map} +1 -1
  191. package/dist/_chunks/{token-insert-menu-D8FgXl33.js → token-insert-menu-9Um0JinI.js} +2 -2
  192. package/dist/_chunks/{token-insert-menu-D8FgXl33.js.map → token-insert-menu-9Um0JinI.js.map} +1 -1
  193. package/dist/_chunks/{tool-rail-BF3F2Ihq.js → tool-rail-CHyUmulN.js} +2 -2
  194. package/dist/_chunks/{tool-rail-BF3F2Ihq.js.map → tool-rail-CHyUmulN.js.map} +1 -1
  195. package/dist/_chunks/{tooth-scheme-BPXE1_3N.js → tooth-scheme-WdyVymQ1.js} +3 -3
  196. package/dist/_chunks/{tooth-scheme-BPXE1_3N.js.map → tooth-scheme-WdyVymQ1.js.map} +1 -1
  197. package/dist/_chunks/{unit-converter-iDxlxKmm.js → unit-converter-BPumXMA6.js} +2 -2
  198. package/dist/_chunks/{unit-converter-iDxlxKmm.js.map → unit-converter-BPumXMA6.js.map} +1 -1
  199. package/dist/_chunks/{warning-stack-nczJf52p.js → warning-stack-DQz0Jyir.js} +3 -3
  200. package/dist/_chunks/{warning-stack-nczJf52p.js.map → warning-stack-DQz0Jyir.js.map} +1 -1
  201. package/dist/_chunks/{workflow-map-BVofnDYh.js → workflow-map-DE_ribRM.js} +5 -5
  202. package/dist/_chunks/{workflow-map-BVofnDYh.js.map → workflow-map-DE_ribRM.js.map} +1 -1
  203. package/dist/agent-catalog.json +2 -2
  204. package/dist/components/agenda-tray/index.js +1 -1
  205. package/dist/components/ai-consent-banner/index.js +1 -1
  206. package/dist/components/ai-prompt-input/index.js +1 -1
  207. package/dist/components/anamnesis-card/index.js +1 -1
  208. package/dist/components/appointment-card/index.js +1 -1
  209. package/dist/components/appointment-timeline/index.js +1 -1
  210. package/dist/components/audio-recorder/index.js +1 -1
  211. package/dist/components/bishop-score/index.js +1 -1
  212. package/dist/components/bmi-calculator/index.js +1 -1
  213. package/dist/components/booking/index.js +1 -1
  214. package/dist/components/button/button.d.ts +10 -0
  215. package/dist/components/button/button.d.ts.map +1 -1
  216. package/dist/components/button/index.js +2 -2
  217. package/dist/components/button-group/index.js +1 -1
  218. package/dist/components/care-plan-card/index.js +1 -1
  219. package/dist/components/care-plan-entry-card/index.js +1 -1
  220. package/dist/components/care-plan-header/index.js +1 -1
  221. package/dist/components/carousel/index.js +1 -1
  222. package/dist/components/chart/index.js +1 -1
  223. package/dist/components/chat-input/index.js +1 -1
  224. package/dist/components/chat-message/index.js +1 -1
  225. package/dist/components/connection-status/index.js +1 -1
  226. package/dist/components/contact-profile-card/index.js +1 -1
  227. package/dist/components/control-room-rail/index.js +1 -1
  228. package/dist/components/copy-field/index.js +1 -1
  229. package/dist/components/cycle-calculator/index.js +1 -1
  230. package/dist/components/dashboard-grid/index.js +1 -1
  231. package/dist/components/data-table/index.js +3 -3
  232. package/dist/components/data-table-tabs/index.js +1 -1
  233. package/dist/components/description-list/index.js +1 -1
  234. package/dist/components/document-preview/index.js +1 -1
  235. package/dist/components/document-scanner/index.js +1 -1
  236. package/dist/components/due-date-calculator/index.js +1 -1
  237. package/dist/components/editor-overlay/index.js +1 -1
  238. package/dist/components/empty-state/index.js +1 -1
  239. package/dist/components/entity-summary/index.js +1 -1
  240. package/dist/components/face-scheme/index.js +1 -1
  241. package/dist/components/fetal-weight/index.js +1 -1
  242. package/dist/components/field-array/index.js +1 -1
  243. package/dist/components/file-manager/index.js +1 -1
  244. package/dist/components/finished-terminal/index.js +1 -1
  245. package/dist/components/fiscal-code-input/index.js +1 -1
  246. package/dist/components/freemium-paywall/index.js +1 -1
  247. package/dist/components/gestational-age-calculator/index.js +1 -1
  248. package/dist/components/hcg-doubling/index.js +1 -1
  249. package/dist/components/header/index.js +1 -1
  250. package/dist/components/header-settings/index.js +1 -1
  251. package/dist/components/icon-button/index.js +1 -1
  252. package/dist/components/icon-button-group/index.js +1 -1
  253. package/dist/components/icon-picker/index.js +1 -1
  254. package/dist/components/image-cropper/index.js +1 -1
  255. package/dist/components/info-tip/index.js +1 -1
  256. package/dist/components/key-value-pair/index.js +1 -1
  257. package/dist/components/locale-picker/index.js +1 -1
  258. package/dist/components/map-view/index.js +1 -1
  259. package/dist/components/matrix-rain/matrix-rain.d.ts +1 -1
  260. package/dist/components/message-card/index.js +1 -1
  261. package/dist/components/message-tray/index.js +1 -1
  262. package/dist/components/notes-panel/index.js +1 -1
  263. package/dist/components/notification-card/index.js +1 -1
  264. package/dist/components/notification-tray/index.js +1 -1
  265. package/dist/components/optical-prescription/index.js +1 -1
  266. package/dist/components/patient-details/index.js +1 -1
  267. package/dist/components/patient-search/index.js +1 -1
  268. package/dist/components/patient-summary-card/index.js +1 -1
  269. package/dist/components/patient-table/index.js +1 -1
  270. package/dist/components/payment-card/index.js +1 -1
  271. package/dist/components/periodontal-chart/index.js +1 -1
  272. package/dist/components/periodontal-chart-card/index.js +1 -1
  273. package/dist/components/popover/index.js +1 -1
  274. package/dist/components/practice-results/index.js +1 -1
  275. package/dist/components/practice-results/practice-results.d.ts +47 -7
  276. package/dist/components/practice-results/practice-results.d.ts.map +1 -1
  277. package/dist/components/pregnancy-dating/index.js +1 -1
  278. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  279. package/dist/components/privacy-lock/index.js +1 -1
  280. package/dist/components/product-hub-tray/index.js +1 -1
  281. package/dist/components/public-header/index.js +1 -1
  282. package/dist/components/public-header/public-header.d.ts +1 -1
  283. package/dist/components/radiograph-panel/index.js +1 -1
  284. package/dist/components/reviews-panel/index.js +1 -1
  285. package/dist/components/rich-text-editor/index.js +1 -1
  286. package/dist/components/session-countdown/index.js +1 -1
  287. package/dist/components/sheet/index.js +1 -1
  288. package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
  289. package/dist/components/slot-grid/index.js +1 -1
  290. package/dist/components/streaming-text/index.js +1 -1
  291. package/dist/components/task-tray/index.js +1 -1
  292. package/dist/components/tasks-panel/index.js +1 -1
  293. package/dist/components/theme-toggle/index.js +1 -1
  294. package/dist/components/toast/index.js +1 -1
  295. package/dist/components/token-insert-menu/index.js +1 -1
  296. package/dist/components/tool-rail/index.js +1 -1
  297. package/dist/components/tooth-scheme/index.js +1 -1
  298. package/dist/components/unit-converter/index.js +1 -1
  299. package/dist/components/warning-stack/index.js +1 -1
  300. package/dist/components/workflow/index.js +1 -1
  301. package/dist/i18n/locales/ar.d.ts +1 -0
  302. package/dist/i18n/locales/ar.d.ts.map +1 -1
  303. package/dist/i18n/locales/ar.js +2 -1
  304. package/dist/i18n/locales/ar.js.map +1 -1
  305. package/dist/i18n/locales/de.d.ts +1 -0
  306. package/dist/i18n/locales/de.d.ts.map +1 -1
  307. package/dist/i18n/locales/de.js +2 -1
  308. package/dist/i18n/locales/de.js.map +1 -1
  309. package/dist/i18n/locales/el.d.ts +1 -0
  310. package/dist/i18n/locales/el.d.ts.map +1 -1
  311. package/dist/i18n/locales/el.js +2 -1
  312. package/dist/i18n/locales/el.js.map +1 -1
  313. package/dist/i18n/locales/en.d.ts +1 -0
  314. package/dist/i18n/locales/en.d.ts.map +1 -1
  315. package/dist/i18n/locales/en.js +2 -1
  316. package/dist/i18n/locales/en.js.map +1 -1
  317. package/dist/i18n/locales/es.d.ts +1 -0
  318. package/dist/i18n/locales/es.d.ts.map +1 -1
  319. package/dist/i18n/locales/es.js +2 -1
  320. package/dist/i18n/locales/es.js.map +1 -1
  321. package/dist/i18n/locales/fr.d.ts +1 -0
  322. package/dist/i18n/locales/fr.d.ts.map +1 -1
  323. package/dist/i18n/locales/fr.js +2 -1
  324. package/dist/i18n/locales/fr.js.map +1 -1
  325. package/dist/i18n/locales/hi.d.ts +1 -0
  326. package/dist/i18n/locales/hi.d.ts.map +1 -1
  327. package/dist/i18n/locales/hi.js +2 -1
  328. package/dist/i18n/locales/hi.js.map +1 -1
  329. package/dist/i18n/locales/it.d.ts +1 -0
  330. package/dist/i18n/locales/it.d.ts.map +1 -1
  331. package/dist/i18n/locales/it.js +2 -1
  332. package/dist/i18n/locales/it.js.map +1 -1
  333. package/dist/i18n/locales/ja.d.ts +1 -0
  334. package/dist/i18n/locales/ja.d.ts.map +1 -1
  335. package/dist/i18n/locales/ja.js +2 -1
  336. package/dist/i18n/locales/ja.js.map +1 -1
  337. package/dist/i18n/locales/nl.d.ts +1 -0
  338. package/dist/i18n/locales/nl.d.ts.map +1 -1
  339. package/dist/i18n/locales/nl.js +2 -1
  340. package/dist/i18n/locales/nl.js.map +1 -1
  341. package/dist/i18n/locales/pl.d.ts +1 -0
  342. package/dist/i18n/locales/pl.d.ts.map +1 -1
  343. package/dist/i18n/locales/pl.js +2 -1
  344. package/dist/i18n/locales/pl.js.map +1 -1
  345. package/dist/i18n/locales/pt.d.ts +1 -0
  346. package/dist/i18n/locales/pt.d.ts.map +1 -1
  347. package/dist/i18n/locales/pt.js +2 -1
  348. package/dist/i18n/locales/pt.js.map +1 -1
  349. package/dist/i18n/locales/ro.d.ts +1 -0
  350. package/dist/i18n/locales/ro.d.ts.map +1 -1
  351. package/dist/i18n/locales/ro.js +2 -1
  352. package/dist/i18n/locales/ro.js.map +1 -1
  353. package/dist/i18n/locales/ru.d.ts +1 -0
  354. package/dist/i18n/locales/ru.d.ts.map +1 -1
  355. package/dist/i18n/locales/ru.js +2 -1
  356. package/dist/i18n/locales/ru.js.map +1 -1
  357. package/dist/i18n/locales/sq.d.ts +1 -0
  358. package/dist/i18n/locales/sq.d.ts.map +1 -1
  359. package/dist/i18n/locales/sq.js +2 -1
  360. package/dist/i18n/locales/sq.js.map +1 -1
  361. package/dist/i18n/locales/sv.d.ts +1 -0
  362. package/dist/i18n/locales/sv.d.ts.map +1 -1
  363. package/dist/i18n/locales/sv.js +2 -1
  364. package/dist/i18n/locales/sv.js.map +1 -1
  365. package/dist/i18n/locales/tr.d.ts +1 -0
  366. package/dist/i18n/locales/tr.d.ts.map +1 -1
  367. package/dist/i18n/locales/tr.js +2 -1
  368. package/dist/i18n/locales/tr.js.map +1 -1
  369. package/dist/i18n/locales/zh.d.ts +1 -0
  370. package/dist/i18n/locales/zh.d.ts.map +1 -1
  371. package/dist/i18n/locales/zh.js +2 -1
  372. package/dist/i18n/locales/zh.js.map +1 -1
  373. package/dist/index.js +96 -96
  374. package/dist/locales/ar.json +2 -1
  375. package/dist/locales/de.json +2 -1
  376. package/dist/locales/el.json +2 -1
  377. package/dist/locales/en.json +2 -1
  378. package/dist/locales/es.json +2 -1
  379. package/dist/locales/fr.json +2 -1
  380. package/dist/locales/hi.json +2 -1
  381. package/dist/locales/it.json +2 -1
  382. package/dist/locales/ja.json +2 -1
  383. package/dist/locales/nl.json +2 -1
  384. package/dist/locales/pl.json +2 -1
  385. package/dist/locales/pt.json +2 -1
  386. package/dist/locales/ro.json +2 -1
  387. package/dist/locales/ru.json +2 -1
  388. package/dist/locales/sq.json +2 -1
  389. package/dist/locales/sv.json +2 -1
  390. package/dist/locales/tr.json +2 -1
  391. package/dist/locales/zh.json +2 -1
  392. package/dist/patterns/alia-assistant/index.js +1 -1
  393. package/dist/patterns/anamnesis/index.js +1 -1
  394. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  395. package/dist/patterns/payment-automation-upsell/index.js +1 -1
  396. package/dist/patterns/signature-request/index.js +1 -1
  397. package/dist/tokens.css +1 -1
  398. package/package.json +1 -1
  399. package/dist/_chunks/button-BvNtqHAS.js.map +0 -1
  400. package/dist/_chunks/practice-results-CKoLD_x5.js.map +0 -1
@@ -7,7 +7,7 @@ import { F as D } from "./form-field-CahJzTxp.js";
7
7
  import { N as q } from "./number-input-Cgu2TtA8.js";
8
8
  import { C } from "./card-DPmk26CL.js";
9
9
  import { B as z } from "./badge-sTusUqZD.js";
10
- import { I as G } from "./insert-result-98J1QEp7.js";
10
+ import { I as G } from "./insert-result-LCNTskNJ.js";
11
11
  const v = (e) => ({
12
12
  oneOf: [{ type: "number", exclusiveMinimum: 0 }, { type: "null" }],
13
13
  description: `${e} in millimetres, or null to clear it.`
@@ -220,4 +220,4 @@ export {
220
220
  Y as F,
221
221
  Q as e
222
222
  };
223
- //# sourceMappingURL=fetal-weight-jon6GIfQ.js.map
223
+ //# sourceMappingURL=fetal-weight-Dqy0T1fP.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetal-weight-jon6GIfQ.js","sources":["../../src/components/fetal-weight/fetal-weight.agent.ts","../../src/components/fetal-weight/efw.ts","../../src/components/fetal-weight/fetal-weight.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — FetalWeight. */\n/* */\n/* Clinical calculator: ultrasound biometry (BPD / HC / AC / FL, mm) → */\n/* estimated fetal weight in grams via Hadlock. The agent surface is the */\n/* four biometry inputs plus the computed EFW; the handle is the curated */\n/* `FetalWeightHandle` (the public `ref` stays the root <div>, exactly as */\n/* `slider.tsx` and `bmi-calculator.tsx` keep theirs). */\n/* */\n/* PHI (§7): never exposes patient identity — the slots return the */\n/* operator's own structural measurements in millimetres and the weight */\n/* derived from them. See `src/docs/26-agent-readiness.mdx`. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { FetalWeightHandle } from './fetal-weight';\n\n/** JSON Schema fragment for one optional biometry measurement, millimetres. */\nconst measurement = (label: string) => ({\n oneOf: [{ type: 'number', exclusiveMinimum: 0 }, { type: 'null' }],\n description: `${label} in millimetres, or null to clear it.`,\n});\n\nexport const fetalWeightAgent: AgentAdapter<FetalWeightHandle> = {\n id: 'fetal-weight',\n // set_value → the `set_biometry` action + the `biometry` state slot.\n capabilities: ['set_value'],\n state: {\n biometry: {\n type: '{ bpdMm: number | null, hcMm: number | null, acMm: number | null, flMm: number | null }',\n descriptionKey: 'ui.agent.fetalWeight.state.biometry',\n description:\n 'The four ultrasound measurements as entered, in millimetres — biparietal diameter, head circumference, abdominal circumference and femur length. Null where unset. Read this to see why a result is still null.',\n read: (handle) => handle.getBiometry(),\n },\n result: {\n type: \"{ grams: number, method: 'hadlock4' | 'hadlock1' } | null\",\n descriptionKey: 'ui.agent.fetalWeight.state.result',\n description:\n 'Estimated fetal weight in grams and which Hadlock regression produced it — `hadlock4` when all four measurements are present, `hadlock1` from AC + FL alone. Null until AC and FL are both set.',\n read: (handle) => handle.getResult(),\n },\n },\n actions: {\n set_biometry: {\n // Drives the same local input state a user types into; nothing is\n // persisted to a record, and every value is reversible in the same UI.\n safety: 'write',\n argsType:\n '{ bpdMm?: number | null, hcMm?: number | null, acMm?: number | null, flMm?: number | null }',\n argsSchema: {\n type: 'object',\n properties: {\n bpdMm: measurement('Biparietal diameter'),\n hcMm: measurement('Head circumference'),\n acMm: measurement('Abdominal circumference'),\n flMm: measurement('Femur length'),\n },\n additionalProperties: false,\n },\n idempotent: true,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the measurements were applied.',\n },\n errors: [\n 'Returns false and writes nothing when any supplied measurement is not a positive number — the payload applies all-or-nothing.',\n ],\n examples: [\n {\n args: { bpdMm: 85, hcMm: 310, acMm: 300, flMm: 62 },\n note: 'Full biometry around 32 weeks → the Hadlock 4-parameter estimate.',\n },\n {\n args: { acMm: 300, flMm: 62 },\n note: 'AC + FL only — the minimum for an estimate, via Hadlock 1.',\n },\n ],\n descriptionKey: 'ui.agent.fetalWeight.actions.setBiometry',\n description:\n 'Set any subset of the ultrasound biometry in millimetres. Omitted measurements are left unchanged; an explicit null clears one. AC and FL are the minimum for an estimate.',\n invoke: (\n handle,\n args: {\n bpdMm?: number | null;\n hcMm?: number | null;\n acMm?: number | null;\n flMm?: number | null;\n },\n ) => handle.setBiometry(args),\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'fetal-weight',\n description:\n 'Marks the FetalWeight calculator (estimated fetal weight from ultrasound biometry).',\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 action/state are unreachable.',\n },\n },\n};\n","/* ------------------------------------------------------------------ */\n/* Estimated fetal weight (EFW) from ultrasound biometry — Hadlock. */\n/* */\n/* Pure, framework-free, unit-testable. Hadlock (1985) regressions on */\n/* log10(weight in grams) from biometry in CENTIMETRES (inputs are taken */\n/* in mm and converted). The 4-parameter formula (BPD+HC+AC+FL) is the */\n/* default; the AC+FL formula is the fallback for partial biometry. */\n/* */\n/* Hadlock FP, Harrist RB, Sharman RS, Deter RL, Park SK. \"Estimation of */\n/* fetal weight with the use of head, body, and femur measurements.\" */\n/* Am J Obstet Gynecol 1985;151:333-7. */\n/* ------------------------------------------------------------------ */\n\nexport interface FetalBiometryInput {\n /** Biparietal diameter, mm. */\n bpdMm?: number | null;\n /** Head circumference, mm. */\n hcMm?: number | null;\n /** Abdominal circumference, mm. */\n acMm?: number | null;\n /** Femur length, mm. */\n flMm?: number | null;\n}\n\n/** Which Hadlock regression produced the estimate. */\nexport type EfwMethod = 'hadlock4' | 'hadlock1';\n\nexport interface EfwResult {\n /** Estimated fetal weight, grams (rounded to the nearest gram). */\n grams: number;\n /** The Hadlock regression used, given the available measurements. */\n method: EfwMethod;\n}\n\n/** A measurement is usable when it is a positive, finite number. */\nfunction cm(mm: number | null | undefined): number | null {\n return typeof mm === 'number' && Number.isFinite(mm) && mm > 0\n ? mm / 10\n : null;\n}\n\n/**\n * Estimate fetal weight from biometry. Uses the Hadlock 4-parameter formula\n * when BPD, HC, AC and FL are all present, else the AC+FL formula. Returns\n * `null` when AC and FL (the minimum) aren't both available.\n */\nexport function estimateFetalWeight(\n input: FetalBiometryInput,\n): EfwResult | null {\n const bpd = cm(input.bpdMm);\n const hc = cm(input.hcMm);\n const ac = cm(input.acMm);\n const fl = cm(input.flMm);\n\n // AC + FL are the minimum for any Hadlock estimate.\n if (ac === null || fl === null) return null;\n\n let log10: number;\n let method: EfwMethod;\n\n if (bpd !== null && hc !== null) {\n // Hadlock 4 (BPD, HC, AC, FL).\n log10 =\n 1.3596 -\n 0.00386 * ac * fl +\n 0.0064 * hc +\n 0.00061 * bpd * ac +\n 0.0424 * ac +\n 0.174 * fl;\n method = 'hadlock4';\n } else {\n // Hadlock 1 (AC, FL).\n log10 = 1.304 + 0.05281 * ac + 0.1938 * fl - 0.004 * ac * fl;\n method = 'hadlock1';\n }\n\n return { grams: Math.round(10 ** log10), method };\n}\n","/* ------------------------------------------------------------------ */\n/* FetalWeight — estimated fetal weight from ultrasound biometry. */\n/* */\n/* Inputs BPD / HC / AC / FL (mm); outputs EFW in grams via Hadlock */\n/* (maths in `./fetal-weight`, pure + tested). */\n/* ------------------------------------------------------------------ */\n\nimport { forwardRef, useEffect, useMemo, useRef, useState } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { fetalWeightAgent } from './fetal-weight.agent';\nimport { FormField } from '../form-field';\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 { type EfwResult, estimateFetalWeight } from './efw';\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/** A biometry figure is usable when it is a positive finite number, or cleared. */\nconst isMeasurement = (n: number | null | undefined): boolean =>\n n === null || n === undefined || (Number.isFinite(n) && n > 0);\n\n/** Canonical biometry snapshot — millimetres, or null where unset. */\nexport interface FetalBiometrySnapshot {\n bpdMm: number | null;\n hcMm: number | null;\n acMm: number | null;\n flMm: number | null;\n}\n\n/**\n * Curated imperative handle for agent / external automation. Reads the four\n * biometry measurements and the Hadlock estimate, and writes the measurements\n * the way a user would type them. Never exposes patient identity — only\n * structural millimetres and the derived weight. Consumed by\n * `fetal-weight.agent.ts`; the public `ref` stays the root DOM element.\n */\nexport interface FetalWeightHandle {\n /** Current biometry in millimetres, or null where unset. */\n getBiometry: () => FetalBiometrySnapshot;\n /** Estimated fetal weight + the regression used, or null below the minimum biometry. */\n getResult: () => EfwResult | null;\n /**\n * Set any subset of the biometry in millimetres. Omitted keys are left\n * unchanged; an explicit `null` clears that measurement. Applies all-or-\n * nothing — returns false and writes nothing if any value is not positive.\n */\n setBiometry: (next: Partial<FetalBiometrySnapshot>) => boolean;\n}\n\nexport interface FetalWeightProps extends VariantProps<typeof rootVariants> {\n /** Fires whenever an estimate can be computed (and `null` when it can't). */\n onResultChange?: (result: EfwResult | null) => void;\n /** When provided, shows the result-action buttons that emit / copy the result. */\n onInsert?: (payload: InsertPayload) => void;\n /** Which verb the result button performs. Defaults to `'insert'`. */\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 /** Brand wordmark printed in the inserted/copied result-card footer. */\n insertBrand?: string | false;\n /** Opaque instance id, emitted as `data-component-id`. */\n id?: string;\n /** Extra class names on the wrapper. */\n className?: string;\n}\n\nexport const FetalWeight = forwardRef<HTMLDivElement, FetalWeightProps>(\n (\n {\n onResultChange,\n onInsert,\n insertVariant = 'insert',\n onCopy,\n onError,\n insertBrand,\n id,\n width,\n className,\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n\n const [bpdMm, setBpdMm] = useState<number | null>(null);\n const [hcMm, setHcMm] = useState<number | null>(null);\n const [acMm, setAcMm] = useState<number | null>(null);\n const [flMm, setFlMm] = useState<number | null>(null);\n\n const result = useMemo(\n () => estimateFetalWeight({ bpdMm, hcMm, acMm, flMm }),\n [bpdMm, hcMm, acMm, flMm],\n );\n\n useEffect(() => {\n onResultChange?.(result);\n }, [result, onResultChange]);\n\n /* ── Agent handle ────────────────────────────────────────────────── */\n const liveRef = useRef({ bpdMm, hcMm, acMm, flMm, result });\n liveRef.current = { bpdMm, hcMm, acMm, flMm, result };\n\n const agentHandle = useMemo<FetalWeightHandle>(\n () => ({\n getBiometry: () => {\n const { bpdMm: bpd, hcMm: hc, acMm: ac, flMm: fl } = liveRef.current;\n return { bpdMm: bpd, hcMm: hc, acMm: ac, flMm: fl };\n },\n getResult: () => liveRef.current.result,\n setBiometry: (next) => {\n const entries = [\n ['bpdMm', setBpdMm],\n ['hcMm', setHcMm],\n ['acMm', setAcMm],\n ['flMm', setFlMm],\n ] as const;\n // Validate the whole payload before writing any of it, so a bad\n // value can't leave the form half-updated.\n for (const [key] of entries) {\n if (key in next && !isMeasurement(next[key])) return false;\n }\n for (const [key, set] of entries) {\n if (key in next) set(next[key] ?? null);\n }\n return true;\n },\n }),\n [],\n );\n useAgentRegistration(fetalWeightAgent, agentHandle, id);\n\n const grams = useMemo(\n () => new Intl.NumberFormat(i18n.language, { maximumFractionDigits: 0 }),\n [i18n.language],\n );\n\n const unit = t('fetalWeight.units.mm');\n const efwText = (r: EfwResult): string =>\n t('fetalWeight.efwValue', { grams: grams.format(r.grams) });\n\n const fields: {\n label: string;\n value: number | null;\n onChange: (v: number | null) => void;\n }[] = [\n { label: t('fetalWeight.bpd'), value: bpdMm, onChange: setBpdMm },\n { label: t('fetalWeight.hc'), value: hcMm, onChange: setHcMm },\n { label: t('fetalWeight.ac'), value: acMm, onChange: setAcMm },\n { label: t('fetalWeight.fl'), value: flMm, onChange: setFlMm },\n ];\n\n return (\n <div\n ref={ref}\n data-component=\"fetal-weight\"\n data-component-id={id}\n className={rootVariants({ width, className })}\n >\n <div className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2\">\n {fields.map((f) => (\n <FormField key={f.label} label={`${f.label} (${unit})`}>\n <NumberInput\n mode=\"decimal\"\n min={0}\n step={0.1}\n value={f.value}\n onChange={f.onChange}\n />\n </FormField>\n ))}\n </div>\n\n <p className=\"ds:sr-only\" role=\"status\" aria-live=\"polite\">\n {result ? `${t('fetalWeight.efwLabel')}: ${efwText(result)}.` : ''}\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-2\">\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('fetalWeight.efwLabel')}\n </dt>\n <dd className=\"type-metric ds:text-foreground\">\n {efwText(result)}\n </dd>\n </div>\n <div className=\"ds:flex ds:flex-col ds:items-end ds:gap-[var(--spacing-xs)] ds:text-end\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('fetalWeight.methodLabel')}\n </dt>\n <dd>\n <Badge variant=\"info\">\n {t(`fetalWeight.method.${result.method}`)}\n </Badge>\n </dd>\n </div>\n </dl>\n <p className=\"type-body-sm ds:text-muted-foreground\">\n {t('fetalWeight.disclaimer')}\n </p>\n {insertVariant === 'copy' || onInsert ? (\n <InsertButton\n onInsert={onInsert}\n variant={insertVariant}\n onCopy={onCopy}\n onError={onError}\n card={{\n title: t('insert.title.fetalWeight'),\n icon: 'scale',\n highlight: efwText(result),\n highlightToken: '--info',\n brand: insertBrand,\n fields: [\n {\n icon: 'scale',\n label: t('fetalWeight.efwLabel'),\n value: efwText(result),\n },\n {\n icon: 'activity',\n label: t('fetalWeight.methodLabel'),\n value: t(`fetalWeight.method.${result.method}`),\n },\n ],\n }}\n />\n ) : null}\n </Card.Body>\n </Card>\n ) : (\n <p className=\"type-body ds:text-muted-foreground\">\n {t('fetalWeight.empty')}\n </p>\n )}\n </div>\n );\n },\n);\n\nFetalWeight.displayName = 'FetalWeight';\n"],"names":["measurement","label","fetalWeightAgent","handle","args","cm","mm","estimateFetalWeight","input","bpd","hc","ac","fl","log10","method","rootVariants","cva","isMeasurement","n","FetalWeight","forwardRef","onResultChange","onInsert","insertVariant","onCopy","onError","insertBrand","id","width","className","ref","i18n","useTranslation","bpdMm","setBpdMm","useState","hcMm","setHcMm","acMm","setAcMm","flMm","setFlMm","result","useMemo","useEffect","liveRef","useRef","agentHandle","next","entries","key","set","useAgentRegistration","grams","unit","efwText","r","fields","jsxs","jsx","f","FormField","NumberInput","Card","Badge","InsertButton"],"mappings":";;;;;;;;;;AAkBA,MAAMA,IAAc,CAACC,OAAmB;AAAA,EACtC,OAAO,CAAC,EAAE,MAAM,UAAU,kBAAkB,KAAK,EAAE,MAAM,QAAQ;AAAA,EACjE,aAAa,GAAGA,CAAK;AACvB,IAEaC,IAAoD;AAAA,EAC/D,IAAI;AAAA;AAAA,EAEJ,cAAc,CAAC,WAAW;AAAA,EAC1B,OAAO;AAAA,IACL,UAAU;AAAA,MACR,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,YAAA;AAAA,IAAY;AAA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AAA,oBAEvB;AAAA,sBACE,MAAM;AAAA,sBACN,OAAO,EAAE,yBAAyB;AAAA,sBAClC,OAAO,EAAE,sBAAsBA,EAAO,MAAM,EAAE;AAAA,oBAAA;AAAA,kBAChD;AAAA,gBACF;AAAA,cACF;AAAA,YAAA,IAEA;AAAA,UAAA,EAAA,CACN,EAAA,CACF,IAEA,gBAAAiB,EAAC,KAAA,EAAE,WAAU,sCACV,UAAA,EAAE,mBAAmB,EAAA,CACxB;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEAxC,EAAY,cAAc;"}
1
+ {"version":3,"file":"fetal-weight-Dqy0T1fP.js","sources":["../../src/components/fetal-weight/fetal-weight.agent.ts","../../src/components/fetal-weight/efw.ts","../../src/components/fetal-weight/fetal-weight.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — FetalWeight. */\n/* */\n/* Clinical calculator: ultrasound biometry (BPD / HC / AC / FL, mm) → */\n/* estimated fetal weight in grams via Hadlock. The agent surface is the */\n/* four biometry inputs plus the computed EFW; the handle is the curated */\n/* `FetalWeightHandle` (the public `ref` stays the root <div>, exactly as */\n/* `slider.tsx` and `bmi-calculator.tsx` keep theirs). */\n/* */\n/* PHI (§7): never exposes patient identity — the slots return the */\n/* operator's own structural measurements in millimetres and the weight */\n/* derived from them. See `src/docs/26-agent-readiness.mdx`. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { FetalWeightHandle } from './fetal-weight';\n\n/** JSON Schema fragment for one optional biometry measurement, millimetres. */\nconst measurement = (label: string) => ({\n oneOf: [{ type: 'number', exclusiveMinimum: 0 }, { type: 'null' }],\n description: `${label} in millimetres, or null to clear it.`,\n});\n\nexport const fetalWeightAgent: AgentAdapter<FetalWeightHandle> = {\n id: 'fetal-weight',\n // set_value → the `set_biometry` action + the `biometry` state slot.\n capabilities: ['set_value'],\n state: {\n biometry: {\n type: '{ bpdMm: number | null, hcMm: number | null, acMm: number | null, flMm: number | null }',\n descriptionKey: 'ui.agent.fetalWeight.state.biometry',\n description:\n 'The four ultrasound measurements as entered, in millimetres — biparietal diameter, head circumference, abdominal circumference and femur length. Null where unset. Read this to see why a result is still null.',\n read: (handle) => handle.getBiometry(),\n },\n result: {\n type: \"{ grams: number, method: 'hadlock4' | 'hadlock1' } | null\",\n descriptionKey: 'ui.agent.fetalWeight.state.result',\n description:\n 'Estimated fetal weight in grams and which Hadlock regression produced it — `hadlock4` when all four measurements are present, `hadlock1` from AC + FL alone. Null until AC and FL are both set.',\n read: (handle) => handle.getResult(),\n },\n },\n actions: {\n set_biometry: {\n // Drives the same local input state a user types into; nothing is\n // persisted to a record, and every value is reversible in the same UI.\n safety: 'write',\n argsType:\n '{ bpdMm?: number | null, hcMm?: number | null, acMm?: number | null, flMm?: number | null }',\n argsSchema: {\n type: 'object',\n properties: {\n bpdMm: measurement('Biparietal diameter'),\n hcMm: measurement('Head circumference'),\n acMm: measurement('Abdominal circumference'),\n flMm: measurement('Femur length'),\n },\n additionalProperties: false,\n },\n idempotent: true,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the measurements were applied.',\n },\n errors: [\n 'Returns false and writes nothing when any supplied measurement is not a positive number — the payload applies all-or-nothing.',\n ],\n examples: [\n {\n args: { bpdMm: 85, hcMm: 310, acMm: 300, flMm: 62 },\n note: 'Full biometry around 32 weeks → the Hadlock 4-parameter estimate.',\n },\n {\n args: { acMm: 300, flMm: 62 },\n note: 'AC + FL only — the minimum for an estimate, via Hadlock 1.',\n },\n ],\n descriptionKey: 'ui.agent.fetalWeight.actions.setBiometry',\n description:\n 'Set any subset of the ultrasound biometry in millimetres. Omitted measurements are left unchanged; an explicit null clears one. AC and FL are the minimum for an estimate.',\n invoke: (\n handle,\n args: {\n bpdMm?: number | null;\n hcMm?: number | null;\n acMm?: number | null;\n flMm?: number | null;\n },\n ) => handle.setBiometry(args),\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'fetal-weight',\n description:\n 'Marks the FetalWeight calculator (estimated fetal weight from ultrasound biometry).',\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 action/state are unreachable.',\n },\n },\n};\n","/* ------------------------------------------------------------------ */\n/* Estimated fetal weight (EFW) from ultrasound biometry — Hadlock. */\n/* */\n/* Pure, framework-free, unit-testable. Hadlock (1985) regressions on */\n/* log10(weight in grams) from biometry in CENTIMETRES (inputs are taken */\n/* in mm and converted). The 4-parameter formula (BPD+HC+AC+FL) is the */\n/* default; the AC+FL formula is the fallback for partial biometry. */\n/* */\n/* Hadlock FP, Harrist RB, Sharman RS, Deter RL, Park SK. \"Estimation of */\n/* fetal weight with the use of head, body, and femur measurements.\" */\n/* Am J Obstet Gynecol 1985;151:333-7. */\n/* ------------------------------------------------------------------ */\n\nexport interface FetalBiometryInput {\n /** Biparietal diameter, mm. */\n bpdMm?: number | null;\n /** Head circumference, mm. */\n hcMm?: number | null;\n /** Abdominal circumference, mm. */\n acMm?: number | null;\n /** Femur length, mm. */\n flMm?: number | null;\n}\n\n/** Which Hadlock regression produced the estimate. */\nexport type EfwMethod = 'hadlock4' | 'hadlock1';\n\nexport interface EfwResult {\n /** Estimated fetal weight, grams (rounded to the nearest gram). */\n grams: number;\n /** The Hadlock regression used, given the available measurements. */\n method: EfwMethod;\n}\n\n/** A measurement is usable when it is a positive, finite number. */\nfunction cm(mm: number | null | undefined): number | null {\n return typeof mm === 'number' && Number.isFinite(mm) && mm > 0\n ? mm / 10\n : null;\n}\n\n/**\n * Estimate fetal weight from biometry. Uses the Hadlock 4-parameter formula\n * when BPD, HC, AC and FL are all present, else the AC+FL formula. Returns\n * `null` when AC and FL (the minimum) aren't both available.\n */\nexport function estimateFetalWeight(\n input: FetalBiometryInput,\n): EfwResult | null {\n const bpd = cm(input.bpdMm);\n const hc = cm(input.hcMm);\n const ac = cm(input.acMm);\n const fl = cm(input.flMm);\n\n // AC + FL are the minimum for any Hadlock estimate.\n if (ac === null || fl === null) return null;\n\n let log10: number;\n let method: EfwMethod;\n\n if (bpd !== null && hc !== null) {\n // Hadlock 4 (BPD, HC, AC, FL).\n log10 =\n 1.3596 -\n 0.00386 * ac * fl +\n 0.0064 * hc +\n 0.00061 * bpd * ac +\n 0.0424 * ac +\n 0.174 * fl;\n method = 'hadlock4';\n } else {\n // Hadlock 1 (AC, FL).\n log10 = 1.304 + 0.05281 * ac + 0.1938 * fl - 0.004 * ac * fl;\n method = 'hadlock1';\n }\n\n return { grams: Math.round(10 ** log10), method };\n}\n","/* ------------------------------------------------------------------ */\n/* FetalWeight — estimated fetal weight from ultrasound biometry. */\n/* */\n/* Inputs BPD / HC / AC / FL (mm); outputs EFW in grams via Hadlock */\n/* (maths in `./fetal-weight`, pure + tested). */\n/* ------------------------------------------------------------------ */\n\nimport { forwardRef, useEffect, useMemo, useRef, useState } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { fetalWeightAgent } from './fetal-weight.agent';\nimport { FormField } from '../form-field';\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 { type EfwResult, estimateFetalWeight } from './efw';\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/** A biometry figure is usable when it is a positive finite number, or cleared. */\nconst isMeasurement = (n: number | null | undefined): boolean =>\n n === null || n === undefined || (Number.isFinite(n) && n > 0);\n\n/** Canonical biometry snapshot — millimetres, or null where unset. */\nexport interface FetalBiometrySnapshot {\n bpdMm: number | null;\n hcMm: number | null;\n acMm: number | null;\n flMm: number | null;\n}\n\n/**\n * Curated imperative handle for agent / external automation. Reads the four\n * biometry measurements and the Hadlock estimate, and writes the measurements\n * the way a user would type them. Never exposes patient identity — only\n * structural millimetres and the derived weight. Consumed by\n * `fetal-weight.agent.ts`; the public `ref` stays the root DOM element.\n */\nexport interface FetalWeightHandle {\n /** Current biometry in millimetres, or null where unset. */\n getBiometry: () => FetalBiometrySnapshot;\n /** Estimated fetal weight + the regression used, or null below the minimum biometry. */\n getResult: () => EfwResult | null;\n /**\n * Set any subset of the biometry in millimetres. Omitted keys are left\n * unchanged; an explicit `null` clears that measurement. Applies all-or-\n * nothing — returns false and writes nothing if any value is not positive.\n */\n setBiometry: (next: Partial<FetalBiometrySnapshot>) => boolean;\n}\n\nexport interface FetalWeightProps extends VariantProps<typeof rootVariants> {\n /** Fires whenever an estimate can be computed (and `null` when it can't). */\n onResultChange?: (result: EfwResult | null) => void;\n /** When provided, shows the result-action buttons that emit / copy the result. */\n onInsert?: (payload: InsertPayload) => void;\n /** Which verb the result button performs. Defaults to `'insert'`. */\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 /** Brand wordmark printed in the inserted/copied result-card footer. */\n insertBrand?: string | false;\n /** Opaque instance id, emitted as `data-component-id`. */\n id?: string;\n /** Extra class names on the wrapper. */\n className?: string;\n}\n\nexport const FetalWeight = forwardRef<HTMLDivElement, FetalWeightProps>(\n (\n {\n onResultChange,\n onInsert,\n insertVariant = 'insert',\n onCopy,\n onError,\n insertBrand,\n id,\n width,\n className,\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n\n const [bpdMm, setBpdMm] = useState<number | null>(null);\n const [hcMm, setHcMm] = useState<number | null>(null);\n const [acMm, setAcMm] = useState<number | null>(null);\n const [flMm, setFlMm] = useState<number | null>(null);\n\n const result = useMemo(\n () => estimateFetalWeight({ bpdMm, hcMm, acMm, flMm }),\n [bpdMm, hcMm, acMm, flMm],\n );\n\n useEffect(() => {\n onResultChange?.(result);\n }, [result, onResultChange]);\n\n /* ── Agent handle ────────────────────────────────────────────────── */\n const liveRef = useRef({ bpdMm, hcMm, acMm, flMm, result });\n liveRef.current = { bpdMm, hcMm, acMm, flMm, result };\n\n const agentHandle = useMemo<FetalWeightHandle>(\n () => ({\n getBiometry: () => {\n const { bpdMm: bpd, hcMm: hc, acMm: ac, flMm: fl } = liveRef.current;\n return { bpdMm: bpd, hcMm: hc, acMm: ac, flMm: fl };\n },\n getResult: () => liveRef.current.result,\n setBiometry: (next) => {\n const entries = [\n ['bpdMm', setBpdMm],\n ['hcMm', setHcMm],\n ['acMm', setAcMm],\n ['flMm', setFlMm],\n ] as const;\n // Validate the whole payload before writing any of it, so a bad\n // value can't leave the form half-updated.\n for (const [key] of entries) {\n if (key in next && !isMeasurement(next[key])) return false;\n }\n for (const [key, set] of entries) {\n if (key in next) set(next[key] ?? null);\n }\n return true;\n },\n }),\n [],\n );\n useAgentRegistration(fetalWeightAgent, agentHandle, id);\n\n const grams = useMemo(\n () => new Intl.NumberFormat(i18n.language, { maximumFractionDigits: 0 }),\n [i18n.language],\n );\n\n const unit = t('fetalWeight.units.mm');\n const efwText = (r: EfwResult): string =>\n t('fetalWeight.efwValue', { grams: grams.format(r.grams) });\n\n const fields: {\n label: string;\n value: number | null;\n onChange: (v: number | null) => void;\n }[] = [\n { label: t('fetalWeight.bpd'), value: bpdMm, onChange: setBpdMm },\n { label: t('fetalWeight.hc'), value: hcMm, onChange: setHcMm },\n { label: t('fetalWeight.ac'), value: acMm, onChange: setAcMm },\n { label: t('fetalWeight.fl'), value: flMm, onChange: setFlMm },\n ];\n\n return (\n <div\n ref={ref}\n data-component=\"fetal-weight\"\n data-component-id={id}\n className={rootVariants({ width, className })}\n >\n <div className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2\">\n {fields.map((f) => (\n <FormField key={f.label} label={`${f.label} (${unit})`}>\n <NumberInput\n mode=\"decimal\"\n min={0}\n step={0.1}\n value={f.value}\n onChange={f.onChange}\n />\n </FormField>\n ))}\n </div>\n\n <p className=\"ds:sr-only\" role=\"status\" aria-live=\"polite\">\n {result ? `${t('fetalWeight.efwLabel')}: ${efwText(result)}.` : ''}\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-2\">\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('fetalWeight.efwLabel')}\n </dt>\n <dd className=\"type-metric ds:text-foreground\">\n {efwText(result)}\n </dd>\n </div>\n <div className=\"ds:flex ds:flex-col ds:items-end ds:gap-[var(--spacing-xs)] ds:text-end\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('fetalWeight.methodLabel')}\n </dt>\n <dd>\n <Badge variant=\"info\">\n {t(`fetalWeight.method.${result.method}`)}\n </Badge>\n </dd>\n </div>\n </dl>\n <p className=\"type-body-sm ds:text-muted-foreground\">\n {t('fetalWeight.disclaimer')}\n </p>\n {insertVariant === 'copy' || onInsert ? (\n <InsertButton\n onInsert={onInsert}\n variant={insertVariant}\n onCopy={onCopy}\n onError={onError}\n card={{\n title: t('insert.title.fetalWeight'),\n icon: 'scale',\n highlight: efwText(result),\n highlightToken: '--info',\n brand: insertBrand,\n fields: [\n {\n icon: 'scale',\n label: t('fetalWeight.efwLabel'),\n value: efwText(result),\n },\n {\n icon: 'activity',\n label: t('fetalWeight.methodLabel'),\n value: t(`fetalWeight.method.${result.method}`),\n },\n ],\n }}\n />\n ) : null}\n </Card.Body>\n </Card>\n ) : (\n <p className=\"type-body ds:text-muted-foreground\">\n {t('fetalWeight.empty')}\n </p>\n )}\n </div>\n );\n },\n);\n\nFetalWeight.displayName = 'FetalWeight';\n"],"names":["measurement","label","fetalWeightAgent","handle","args","cm","mm","estimateFetalWeight","input","bpd","hc","ac","fl","log10","method","rootVariants","cva","isMeasurement","n","FetalWeight","forwardRef","onResultChange","onInsert","insertVariant","onCopy","onError","insertBrand","id","width","className","ref","i18n","useTranslation","bpdMm","setBpdMm","useState","hcMm","setHcMm","acMm","setAcMm","flMm","setFlMm","result","useMemo","useEffect","liveRef","useRef","agentHandle","next","entries","key","set","useAgentRegistration","grams","unit","efwText","r","fields","jsxs","jsx","f","FormField","NumberInput","Card","Badge","InsertButton"],"mappings":";;;;;;;;;;AAkBA,MAAMA,IAAc,CAACC,OAAmB;AAAA,EACtC,OAAO,CAAC,EAAE,MAAM,UAAU,kBAAkB,KAAK,EAAE,MAAM,QAAQ;AAAA,EACjE,aAAa,GAAGA,CAAK;AACvB,IAEaC,IAAoD;AAAA,EAC/D,IAAI;AAAA;AAAA,EAEJ,cAAc,CAAC,WAAW;AAAA,EAC1B,OAAO;AAAA,IACL,UAAU;AAAA,MACR,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,YAAA;AAAA,IAAY;AAAA,IAEvC,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,cAAc;AAAA;AAAA;AAAA,MAGZ,QAAQ;AAAA,MACR,UACE;AAAA,MACF,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY;AAAA,UACV,OAAOH,EAAY,qBAAqB;AAAA,UACxC,MAAMA,EAAY,oBAAoB;AAAA,UACtC,MAAMA,EAAY,yBAAyB;AAAA,UAC3C,MAAMA,EAAY,cAAc;AAAA,QAAA;AAAA,QAElC,sBAAsB;AAAA,MAAA;AAAA,MAExB,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,eAA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EAAC,MAAA,EAAG,WAAU,uCACX,UAAA,EAAE,yBAAyB,GAC9B;AAAA,gBACA,gBAAAA,EAAC,MAAA,EACC,UAAA,gBAAAA,EAACK,GAAA,EAAM,SAAQ,QACZ,UAAA,EAAE,sBAAsBtB,EAAO,MAAM,EAAE,EAAA,CAC1C,EAAA,CACF;AAAA,cAAA,EAAA,CACF;AAAA,YAAA,GACF;AAAA,8BACC,KAAA,EAAE,WAAU,yCACV,UAAA,EAAE,wBAAwB,GAC7B;AAAA,YACCnB,MAAkB,UAAUD,IAC3B,gBAAAqC;AAAA,cAACM;AAAA,cAAA;AAAA,gBACC,UAAA3C;AAAA,gBACA,SAASC;AAAA,gBACT,QAAAC;AAAA,gBACA,SAAAC;AAAA,gBACA,MAAM;AAAA,kBACJ,OAAO,EAAE,0BAA0B;AAAA,kBACnC,MAAM;AAAA,kBACN,WAAW8B,EAAQb,CAAM;AAAA,kBACzB,gBAAgB;AAAA,kBAChB,OAAOhB;AAAA,kBACP,QAAQ;AAAA,oBACN;AAAA,sBACE,MAAM;AAAA,sBACN,OAAO,EAAE,sBAAsB;AAAA,sBAC/B,OAAO6B,EAAQb,CAAM;AAAA,oBAAA;AAAA,oBAEvB;AAAA,sBACE,MAAM;AAAA,sBACN,OAAO,EAAE,yBAAyB;AAAA,sBAClC,OAAO,EAAE,sBAAsBA,EAAO,MAAM,EAAE;AAAA,oBAAA;AAAA,kBAChD;AAAA,gBACF;AAAA,cACF;AAAA,YAAA,IAEA;AAAA,UAAA,EAAA,CACN,EAAA,CACF,IAEA,gBAAAiB,EAAC,KAAA,EAAE,WAAU,sCACV,UAAA,EAAE,mBAAmB,EAAA,CACxB;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEAxC,EAAY,cAAc;"}
@@ -2,8 +2,8 @@ import { jsxs as u, jsx as t } from "react/jsx-runtime";
2
2
  import { useEffect as N, useRef as k, useMemo as C } from "react";
3
3
  import { c } from "./index-D2ZczOXr.js";
4
4
  import { useTranslation as F } from "react-i18next";
5
- import { B as I } from "./button-BvNtqHAS.js";
6
- import { I as M } from "./icon-button-9c9Gp41m.js";
5
+ import { B as I } from "./button-nJaPh_HC.js";
6
+ import { I as M } from "./icon-button-DA2CAGHZ.js";
7
7
  import { u as R } from "./registry-DvAUVLHh.js";
8
8
  import { X as j } from "./x-B5YnXwCz.js";
9
9
  import { P as B } from "./plus-DzMQ_c6b.js";
@@ -143,4 +143,4 @@ export {
143
143
  S as F,
144
144
  K as f
145
145
  };
146
- //# sourceMappingURL=field-array-BQFX5OYi.js.map
146
+ //# sourceMappingURL=field-array-BjkXZzSr.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"field-array-BQFX5OYi.js","sources":["../../src/components/field-array/field-array.agent.ts","../../src/components/field-array/field-array.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — FieldArray. */\n/* */\n/* See `src/docs/26-agent-readiness.mdx` for the contract. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { FieldArrayHandle } from './field-array';\n\nexport const fieldArrayAgent: AgentAdapter<FieldArrayHandle> = {\n id: 'field-array',\n capabilities: ['edit_inline'],\n state: {\n count: {\n type: 'number',\n descriptionKey: 'ui.agent.fieldArray.state.count',\n description: 'Number of rows currently rendered.',\n read: (handle) => handle.getCount(),\n },\n },\n actions: {\n add: {\n safety: 'write',\n descriptionKey: 'ui.agent.fieldArray.actions.add',\n description: 'Append a new row.',\n invoke: (handle) => {\n handle.add();\n },\n },\n remove: {\n safety: 'destructive',\n argsType: '{ index: number }',\n argsSchema: {\n type: 'object',\n properties: { index: { type: 'number' } },\n required: ['index'],\n },\n descriptionKey: 'ui.agent.fieldArray.actions.remove',\n description: 'Remove the row at the given index.',\n invoke: (handle, args: { index: number }) => {\n handle.remove(args.index);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'field-array',\n description: 'Marks the FieldArray fieldset.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n useEffect,\n useMemo,\n useRef,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Plus, X } from 'lucide-react';\nimport { Button } from '../button/button';\nimport { IconButton } from '../button/icon-button';\nimport { useAgentRegistration } from '../../agent';\nimport { fieldArrayAgent } from './field-array.agent';\n\n/**\n * Agent-readiness curated handle for FieldArray. Non-generic on purpose — the\n * adapter is typed `AgentAdapter<FieldArrayHandle>` and never sees `T`, so the\n * handle exposes only the structural surface (row count + add/remove).\n */\nexport interface FieldArrayHandle {\n getCount: () => number;\n add: () => void;\n remove: (index: number) => void;\n}\n\nexport interface FieldArrayProps<T> {\n /** The current rows. The consumer owns this array. */\n items: T[];\n /** Renders one row's fields. Called once per item. */\n renderItem: (item: T, index: number) => ReactNode;\n /** Append a new (consumer-shaped) row. */\n onAdd: () => void;\n /** Remove the row at `index`. */\n onRemove: (index: number) => void;\n /** Visible text on the add control. Consumer supplies localised text. */\n addLabel: string;\n /**\n * Per-row accessible name for the remove control, e.g.\n * `(i) => \\`Remove rule ${i + 1}\\``. Defaults to the kit's localised\n * `Remove` string so the control always has an accessible name.\n */\n removeItemLabel?: (index: number) => string;\n /** Group accessible name, rendered as a visible `<legend>` when provided. */\n legend?: string;\n /** Minimum rows — remove is disabled once `items.length <= min`. */\n min?: number;\n /** Maximum rows — add is disabled once `items.length >= max`. */\n max?: number;\n /** Stable id, used to address this instance from the agent runtime. */\n id?: string;\n className?: string;\n /** Accessible name used when no `legend` is supplied. */\n 'aria-label'?: string;\n}\n\nconst fieldArrayVariants = cva(\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:min-w-0 ds:border-0 ds:p-0 ds:m-0',\n);\n\nconst rowsVariants = cva('ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]');\n\nconst rowVariants = cva('ds:flex ds:items-start ds:gap-[var(--spacing-sm)]');\n\nexport function FieldArray<T>({\n items,\n renderItem,\n onAdd,\n onRemove,\n addLabel,\n removeItemLabel,\n legend,\n min = 0,\n max,\n id,\n className,\n 'aria-label': ariaLabel,\n}: FieldArrayProps<T>): ReactElement {\n const { t } = useTranslation();\n\n // DEV-time guard: a group with no legend AND no aria-label has no accessible\n // name. Mirrors the IbanInput / Button accessible-name guards. No-op in prod.\n useEffect(() => {\n const isDev =\n typeof import.meta !== 'undefined' &&\n typeof import.meta.env !== 'undefined' &&\n import.meta.env.DEV === true;\n if (isDev && !legend && !ariaLabel) {\n console.warn(\n '[FieldArray] No `legend` and no `aria-label` — the row group has no accessible name. Pass one of them.',\n );\n }\n }, [legend, ariaLabel]);\n\n const atMin = items.length <= min;\n const atMax = typeof max === 'number' && items.length >= max;\n\n // Stable handle that always reads the latest count — mirrors CheckboxGroup's\n // ref-backed handle so the registration identity stays stable across renders.\n const itemsRef = useRef(items);\n itemsRef.current = items;\n const agentHandle = useMemo<FieldArrayHandle>(\n () => ({\n getCount: () => itemsRef.current.length,\n add: () => onAdd(),\n remove: (index) => onRemove(index),\n }),\n [onAdd, onRemove],\n );\n useAgentRegistration(fieldArrayAgent, agentHandle, id);\n\n const resolveRemoveLabel = (index: number): string =>\n removeItemLabel\n ? removeItemLabel(index)\n : t('fieldArray.removeItem', 'Remove');\n\n return (\n <fieldset\n id={id}\n className={fieldArrayVariants({ className })}\n aria-label={legend ? undefined : ariaLabel}\n data-component=\"field-array\"\n data-component-id={id}\n >\n {legend ? (\n <legend className=\"type-label ds:text-foreground ds:p-0\">\n {legend}\n </legend>\n ) : null}\n\n <div className={rowsVariants()}>\n {items.map((item, index) => (\n // No stable per-item id exists on a generic T, so rows are keyed by\n // index — the consumer owns row identity through its state shape.\n <div\n key={index}\n className={rowVariants()}\n data-slot=\"field-array-row\"\n >\n <div className=\"ds:flex-1 ds:min-w-0\">\n {renderItem(item, index)}\n </div>\n <IconButton\n icon={<X />}\n size=\"sm\"\n intent=\"ghost\"\n aria-label={resolveRemoveLabel(index)}\n disabled={atMin}\n onClick={() => onRemove(index)}\n />\n </div>\n ))}\n </div>\n\n <Button\n type=\"button\"\n intent=\"outline\"\n startIcon={<Plus />}\n disabled={atMax}\n onClick={onAdd}\n className=\"ds:self-start\"\n >\n {addLabel}\n </Button>\n </fieldset>\n );\n}\n\nFieldArray.displayName = 'FieldArray';\n"],"names":["fieldArrayAgent","handle","args","fieldArrayVariants","cva","rowsVariants","rowVariants","FieldArray","items","renderItem","onAdd","onRemove","addLabel","removeItemLabel","legend","min","max","id","className","ariaLabel","t","useTranslation","useEffect","atMin","atMax","itemsRef","useRef","agentHandle","useMemo","index","useAgentRegistration","resolveRemoveLabel","jsxs","jsx","item","IconButton","X","Button","Plus"],"mappings":";;;;;;;;;AASO,MAAMA,IAAkD;AAAA,EAC7D,IAAI;AAAA,EACJ,cAAc,CAAC,aAAa;AAAA,EAC5B,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,EACpC;AAAA,EAEF,SAAS;AAAA,IACP,KAAK;AAAA,MACH,QAAQ;AAAA,MACR,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,QAAQ,CAACA,MAAW;AAClB,QAAAA,EAAO,IAAA;AAAA,MACT;AAAA,IAAA;AAAA,IAEF,QAAQ;AAAA,MACN,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY,EAAE,OAAO,EAAE,MAAM,WAAS;AAAA,QACtC,UAAU,CAAC,OAAO;AAAA,MAAA;AAAA,MAEpB,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,QAAQ,CAACA,GAAQC,MAA4B;AAC3C,QAAAD,EAAO,OAAOC,EAAK,KAAK;AAAA,MAC1B;AAAA,IAAA;AAAA,EACF;AAAA,EAEF,UA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,WAAAe,GAAW;AAAA,MAC3C,cAAYJ,IAAS,SAAYK;AAAA,MACjC,kBAAe;AAAA,MACf,qBAAmBF;AAAA,MAElB,UAAA;AAAA,QAAAH,sBACE,UAAA,EAAO,WAAU,wCACf,aACH,IACE;AAAA,QAEJ,gBAAAmB,EAAC,SAAI,WAAW5B,EAAA,GACb,UAAAG,EAAM,IAAI,CAAC0B,GAAML;AAAA;AAAA;AAAA,UAGhB,gBAAAG;AAAA,YAAC;AAAA,YAAA;AAAA,cAEC,WAAW1B,EAAA;AAAA,cACX,aAAU;AAAA,cAEV,UAAA;AAAA,gBAAA,gBAAA2B,EAAC,SAAI,WAAU,wBACZ,UAAAxB,EAAWyB,GAAML,CAAK,GACzB;AAAA,gBACA,gBAAAI;AAAA,kBAACE;AAAA,kBAAA;AAAA,oBACC,wBAAOC,GAAA,EAAE;AAAA,oBACT,MAAK;AAAA,oBACL,QAAO;AAAA,oBACP,cAAYL,EAAmBF,CAAK;AAAA,oBACpC,UAAUN;AAAA,oBACV,SAAS,MAAMZ,EAASkB,CAAK;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAC/B;AAAA,YAAA;AAAA,YAdKA;AAAA,UAAA;AAAA,SAgBR,GACH;AAAA,QAEA,gBAAAI;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,QAAO;AAAA,YACP,6BAAYC,GAAA,EAAK;AAAA,YACjB,UAAUd;AAAA,YACV,SAASd;AAAA,YACT,WAAU;AAAA,YAET,UAAAE;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAGN;AAEAL,EAAW,cAAc;"}
1
+ {"version":3,"file":"field-array-BjkXZzSr.js","sources":["../../src/components/field-array/field-array.agent.ts","../../src/components/field-array/field-array.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — FieldArray. */\n/* */\n/* See `src/docs/26-agent-readiness.mdx` for the contract. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { FieldArrayHandle } from './field-array';\n\nexport const fieldArrayAgent: AgentAdapter<FieldArrayHandle> = {\n id: 'field-array',\n capabilities: ['edit_inline'],\n state: {\n count: {\n type: 'number',\n descriptionKey: 'ui.agent.fieldArray.state.count',\n description: 'Number of rows currently rendered.',\n read: (handle) => handle.getCount(),\n },\n },\n actions: {\n add: {\n safety: 'write',\n descriptionKey: 'ui.agent.fieldArray.actions.add',\n description: 'Append a new row.',\n invoke: (handle) => {\n handle.add();\n },\n },\n remove: {\n safety: 'destructive',\n argsType: '{ index: number }',\n argsSchema: {\n type: 'object',\n properties: { index: { type: 'number' } },\n required: ['index'],\n },\n descriptionKey: 'ui.agent.fieldArray.actions.remove',\n description: 'Remove the row at the given index.',\n invoke: (handle, args: { index: number }) => {\n handle.remove(args.index);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'field-array',\n description: 'Marks the FieldArray fieldset.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n useEffect,\n useMemo,\n useRef,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Plus, X } from 'lucide-react';\nimport { Button } from '../button/button';\nimport { IconButton } from '../button/icon-button';\nimport { useAgentRegistration } from '../../agent';\nimport { fieldArrayAgent } from './field-array.agent';\n\n/**\n * Agent-readiness curated handle for FieldArray. Non-generic on purpose — the\n * adapter is typed `AgentAdapter<FieldArrayHandle>` and never sees `T`, so the\n * handle exposes only the structural surface (row count + add/remove).\n */\nexport interface FieldArrayHandle {\n getCount: () => number;\n add: () => void;\n remove: (index: number) => void;\n}\n\nexport interface FieldArrayProps<T> {\n /** The current rows. The consumer owns this array. */\n items: T[];\n /** Renders one row's fields. Called once per item. */\n renderItem: (item: T, index: number) => ReactNode;\n /** Append a new (consumer-shaped) row. */\n onAdd: () => void;\n /** Remove the row at `index`. */\n onRemove: (index: number) => void;\n /** Visible text on the add control. Consumer supplies localised text. */\n addLabel: string;\n /**\n * Per-row accessible name for the remove control, e.g.\n * `(i) => \\`Remove rule ${i + 1}\\``. Defaults to the kit's localised\n * `Remove` string so the control always has an accessible name.\n */\n removeItemLabel?: (index: number) => string;\n /** Group accessible name, rendered as a visible `<legend>` when provided. */\n legend?: string;\n /** Minimum rows — remove is disabled once `items.length <= min`. */\n min?: number;\n /** Maximum rows — add is disabled once `items.length >= max`. */\n max?: number;\n /** Stable id, used to address this instance from the agent runtime. */\n id?: string;\n className?: string;\n /** Accessible name used when no `legend` is supplied. */\n 'aria-label'?: string;\n}\n\nconst fieldArrayVariants = cva(\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:min-w-0 ds:border-0 ds:p-0 ds:m-0',\n);\n\nconst rowsVariants = cva('ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]');\n\nconst rowVariants = cva('ds:flex ds:items-start ds:gap-[var(--spacing-sm)]');\n\nexport function FieldArray<T>({\n items,\n renderItem,\n onAdd,\n onRemove,\n addLabel,\n removeItemLabel,\n legend,\n min = 0,\n max,\n id,\n className,\n 'aria-label': ariaLabel,\n}: FieldArrayProps<T>): ReactElement {\n const { t } = useTranslation();\n\n // DEV-time guard: a group with no legend AND no aria-label has no accessible\n // name. Mirrors the IbanInput / Button accessible-name guards. No-op in prod.\n useEffect(() => {\n const isDev =\n typeof import.meta !== 'undefined' &&\n typeof import.meta.env !== 'undefined' &&\n import.meta.env.DEV === true;\n if (isDev && !legend && !ariaLabel) {\n console.warn(\n '[FieldArray] No `legend` and no `aria-label` — the row group has no accessible name. Pass one of them.',\n );\n }\n }, [legend, ariaLabel]);\n\n const atMin = items.length <= min;\n const atMax = typeof max === 'number' && items.length >= max;\n\n // Stable handle that always reads the latest count — mirrors CheckboxGroup's\n // ref-backed handle so the registration identity stays stable across renders.\n const itemsRef = useRef(items);\n itemsRef.current = items;\n const agentHandle = useMemo<FieldArrayHandle>(\n () => ({\n getCount: () => itemsRef.current.length,\n add: () => onAdd(),\n remove: (index) => onRemove(index),\n }),\n [onAdd, onRemove],\n );\n useAgentRegistration(fieldArrayAgent, agentHandle, id);\n\n const resolveRemoveLabel = (index: number): string =>\n removeItemLabel\n ? removeItemLabel(index)\n : t('fieldArray.removeItem', 'Remove');\n\n return (\n <fieldset\n id={id}\n className={fieldArrayVariants({ className })}\n aria-label={legend ? undefined : ariaLabel}\n data-component=\"field-array\"\n data-component-id={id}\n >\n {legend ? (\n <legend className=\"type-label ds:text-foreground ds:p-0\">\n {legend}\n </legend>\n ) : null}\n\n <div className={rowsVariants()}>\n {items.map((item, index) => (\n // No stable per-item id exists on a generic T, so rows are keyed by\n // index — the consumer owns row identity through its state shape.\n <div\n key={index}\n className={rowVariants()}\n data-slot=\"field-array-row\"\n >\n <div className=\"ds:flex-1 ds:min-w-0\">\n {renderItem(item, index)}\n </div>\n <IconButton\n icon={<X />}\n size=\"sm\"\n intent=\"ghost\"\n aria-label={resolveRemoveLabel(index)}\n disabled={atMin}\n onClick={() => onRemove(index)}\n />\n </div>\n ))}\n </div>\n\n <Button\n type=\"button\"\n intent=\"outline\"\n startIcon={<Plus />}\n disabled={atMax}\n onClick={onAdd}\n className=\"ds:self-start\"\n >\n {addLabel}\n </Button>\n </fieldset>\n );\n}\n\nFieldArray.displayName = 'FieldArray';\n"],"names":["fieldArrayAgent","handle","args","fieldArrayVariants","cva","rowsVariants","rowVariants","FieldArray","items","renderItem","onAdd","onRemove","addLabel","removeItemLabel","legend","min","max","id","className","ariaLabel","t","useTranslation","useEffect","atMin","atMax","itemsRef","useRef","agentHandle","useMemo","index","useAgentRegistration","resolveRemoveLabel","jsxs","jsx","item","IconButton","X","Button","Plus"],"mappings":";;;;;;;;;AASO,MAAMA,IAAkD;AAAA,EAC7D,IAAI;AAAA,EACJ,cAAc,CAAC,aAAa;AAAA,EAC5B,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,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AAA,oBACV,SAAS,MAAMZ,EAASkB,CAAK;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAC/B;AAAA,YAAA;AAAA,YAdKA;AAAA,UAAA;AAAA,SAgBR,GACH;AAAA,QAEA,gBAAAI;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,QAAO;AAAA,YACP,6BAAYC,GAAA,EAAK;AAAA,YACjB,UAAUd;AAAA,YACV,SAASd;AAAA,YACT,WAAU;AAAA,YAET,UAAAE;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAGN;AAEAL,EAAW,cAAc;"}
@@ -2,10 +2,10 @@ import { useMemo as O, useCallback as D, useState as E, cloneElement as X } from
2
2
  import { u as J } from "./use-controllable-state-BiY4xTzM.js";
3
3
  import { jsxs as I, jsx as r, Fragment as Q } from "react/jsx-runtime";
4
4
  import { useTranslation as P } from "react-i18next";
5
- import { B as W } from "./button-BvNtqHAS.js";
6
- import { I as j } from "./icon-button-9c9Gp41m.js";
5
+ import { B as W } from "./button-nJaPh_HC.js";
6
+ import { I as j } from "./icon-button-DA2CAGHZ.js";
7
7
  import { C as $ } from "./checkbox-BuZ1u__2.js";
8
- import { P as T } from "./popover-Btj6N25H.js";
8
+ import { P as T } from "./popover-Cqcjx-Ny.js";
9
9
  import { S as Y } from "./separator-CYU_bGFn.js";
10
10
  import { S as Z } from "./settings-d25ju_6L.js";
11
11
  import { G as ee } from "./grip-vertical-onSb1JXO.js";
@@ -401,4 +401,4 @@ export {
401
401
  ze as r,
402
402
  Pe as u
403
403
  };
404
- //# sourceMappingURL=field-value-BbiDRyNh.js.map
404
+ //# sourceMappingURL=field-value-DG8zaZvo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"field-value-BbiDRyNh.js","sources":["../../node_modules/lucide-react/dist/esm/icons/hourglass.mjs","../../node_modules/lucide-react/dist/esm/icons/mars.mjs","../../node_modules/lucide-react/dist/esm/icons/venus.mjs","../../src/components/_shared/patient-fields.ts","../../src/components/_shared/field-visibility.ts","../../src/components/_shared/field-visibility-cog.tsx","../../src/components/_shared/field-value.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: \"M5 22h14\", key: \"ehvnwv\" }],\n [\"path\", { d: \"M5 2h14\", key: \"pdyrp9\" }],\n [\n \"path\",\n {\n d: \"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22\",\n key: \"1d314k\"\n }\n ],\n [\n \"path\",\n { d: \"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2\", key: \"1vvvr6\" }\n ]\n];\nconst Hourglass = createLucideIcon(\"hourglass\", __iconNode);\n\nexport { __iconNode, Hourglass as default };\n//# sourceMappingURL=hourglass.mjs.map\n","/**\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 3h5v5\", key: \"1806ms\" }],\n [\"path\", { d: \"m21 3-6.75 6.75\", key: \"pv0uzu\" }],\n [\"circle\", { cx: \"10\", cy: \"14\", r: \"6\", key: \"1qwbdc\" }]\n];\nconst Mars = createLucideIcon(\"mars\", __iconNode);\n\nexport { __iconNode, Mars as default };\n//# sourceMappingURL=mars.mjs.map\n","/**\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: \"M12 15v7\", key: \"t2xh3l\" }],\n [\"path\", { d: \"M9 19h6\", key: \"456am0\" }],\n [\"circle\", { cx: \"12\", cy: \"9\", r: \"6\", key: \"1nw4tq\" }]\n];\nconst Venus = createLucideIcon(\"venus\", __iconNode);\n\nexport { __iconNode, Venus as default };\n//# sourceMappingURL=venus.mjs.map\n","import type { ReactElement, ReactNode } from 'react';\n\n/* -------------------------------------------------------------------- */\n/* Shared patient-field model */\n/* */\n/* The single field VOCABULARY every patient surface speaks — consumed */\n/* by both `PatientDetails` (full, inline-editable) and */\n/* `PatientSummaryCard` (compact). Either can surface a \"Customize */\n/* fields\" cog (show/hide + drag-and-drop reorder). The kit owns the */\n/* SHAPE; the CONSUMER owns the registry (which DoctorPatient field maps */\n/* to which id/label/PHI flag). */\n/* */\n/* Visibility + order are PER-CONTEXT, not global: the kit never persists */\n/* them — each PLACEMENT is wired to its own `visibleFieldOrder` / */\n/* `onVisibleFieldsChange`, so the SAME vocabulary can display */\n/* differently in different parts of the app (a care-plan card vs the */\n/* patient folder). The consumer chooses the persistence scope — global */\n/* per-user, or per-surface (PRS §Security; design doc D1/D2). */\n/* -------------------------------------------------------------------- */\n\n/**\n * Canonical field TYPE. When set (and no explicit `value` is supplied), the\n * kit renders the field's canonical chip from the shared `<FieldValue>`\n * registry instead of plain text — so the SAME field type looks the same on\n * every surface. Each chip is a high-contrast neutral pill with a glyph:\n *\n * - `sex` → Venus / Mars / User glyph + localised label\n * - `age` → hourglass glyph + localised, pluralised age\n * - `dob` → calendar glyph + locale-formatted date\n * - `fiscalCode` → hash glyph + monospace code (already mono — no `mono` flag\n * needed; copy + PHI lock stay the row-level affordance via\n * `copyable` / `sensitive`)\n * - `discount` → `TransactionChip` `state=\"discount\"` (the canonical monetary\n * discount chip — magnitude + `currency`, sign owned by the chip)\n * - `email` → a `mailto:` `Link` (the address is both display + target)\n * - `phone` → a `tel:` `Link` (formatted display, target normalised to\n * `+` and digits)\n *\n * The raw datum is read from `editValue` (the same scalar that seeds the\n * editor): a number for `age` / `discount`, an ISO string or `Date` for `dob`,\n * a code string for `sex`, the code string for `fiscalCode`. For the contact\n * link kinds the DISPLAY string is read from `value` (or `editValue`) and the\n * href is derived from it — so a plain-string `value` still becomes a link.\n * For every OTHER kind an explicit `value` ALWAYS wins, so a consumer can still\n * override per placement.\n */\nexport type PatientFieldKind =\n | 'sex'\n | 'age'\n | 'dob'\n | 'fiscalCode'\n | 'discount'\n | 'email'\n | 'phone';\n\n/** Editor control rendered when a field enters inline-edit mode. */\nexport type PatientFieldEditType =\n | 'text'\n | 'textarea'\n | 'select'\n | 'boolean'\n | 'date'\n | 'number'\n // Typed text variants — each renders the kit's dedicated input (validation,\n // formatting, masking) instead of a bare TextInput. Their edited value still\n // serialises to a plain string through the shared save callback.\n | 'email'\n | 'phone'\n | 'fiscalCode'\n // Address / location variants — each renders the dedicated kit picker.\n // `province`/`country`/`city` emit a plain string (UPPER sigla / alpha-2\n // lower / city name); `postalCode` validates the IT CAP format on blur.\n | 'province'\n | 'country'\n | 'postalCode'\n | 'city';\n\n/** A choice for an `editType: 'select'` field. */\nexport interface PatientFieldOption {\n value: string;\n label: string;\n}\n\n/**\n * Raw value seeded into an editor. The kit never inspects this beyond\n * handing it to the matching control and back through a save callback.\n */\nexport type PatientFieldEditValue =\n | string\n | number\n | boolean\n | Date\n | null\n | undefined;\n\n/** One label→value patient field. */\nexport interface PatientField {\n /**\n * Stable field key — drives visibility, ordering, the `data-field-id`\n * hook, and agent addressing. MUST NOT be the value (no PHI in keys).\n */\n id: string;\n /** Display label (already localised by the consumer, or a kit label). */\n label: string;\n /**\n * Display node — formatted by the consumer (Badge / Tag / Link / text).\n * Optional: omit it and set `kind` to let the kit render the field's\n * canonical chip from `editValue`. When present, `value` ALWAYS wins.\n */\n value?: ReactNode;\n /**\n * Canonical field type — when set and `value` is omitted, the kit renders\n * the matching canonical chip from the shared registry. Presentation only;\n * NEVER emitted into any `data-*` attribute (same rule as `sensitive`).\n */\n kind?: PatientFieldKind;\n /** Leading icon (a single lucide element). */\n icon?: ReactElement | null;\n /** Render the copy-to-clipboard affordance (fiscal code, ids). */\n copyable?: boolean;\n /** Text written to the clipboard when `copyable`. */\n copyText?: string;\n /** Render the value monospaced (codes, ids). */\n mono?: boolean;\n /**\n * High-sensitivity PHI marker — renders a lock glyph next to the label.\n * Presentation only; NEVER emitted into any `data-*` attribute.\n */\n sensitive?: boolean;\n /** Whether this field can be inline-edited (consumer gates by permission). */\n editable?: boolean;\n /** Control used in edit mode. Defaults to `'text'`. */\n editType?: PatientFieldEditType;\n /** Options for `editType: 'select'`. */\n options?: PatientFieldOption[];\n /** Value seeded into the editor when editing begins. */\n editValue?: PatientFieldEditValue;\n /** Currency code for `editType: 'number'` (renders a currency input). */\n currency?: string;\n}\n\n/** A labelled, collapsible group of fields. */\nexport interface PatientFieldSection {\n /** Stable section key. */\n id: string;\n /** Section heading. */\n heading: string;\n fields: PatientField[];\n /** Wrap the section in a Collapsible (default `true`). Honoured by PatientDetails. */\n collapsible?: boolean;\n /** Initial open state when `collapsible` (default `true`). */\n defaultOpen?: boolean;\n}\n\n/** The flat declaration-order list of every field id — the \"show everything\" default. */\nexport function patientFieldCatalogue(\n sections: PatientFieldSection[],\n): string[] {\n return sections.flatMap((s) => s.fields.map((f) => f.id));\n}\n\n/** A section paired with its currently-visible fields, in the chosen order. */\nexport interface ResolvedPatientSection {\n section: PatientFieldSection;\n fields: PatientField[];\n}\n\n/**\n * Project `sections` to the visible fields per section, ordered by\n * `visibleFieldOrder`. This is the single piece of visibility logic shared\n * by every patient surface, so the card and the details panel always agree\n * on what is shown and in what order.\n *\n * `visibleFieldOrder` omitted (`undefined`) ⇒ every field visible in\n * declaration order (\"show everything by default\", design doc D3). An explicit\n * empty array `[]` ⇒ NO fields visible — a surface that starts collapsed and\n * reveals fields via the customize-fields cog. Unknown ids are ignored.\n * Sections stay in declaration order; only intra-section field order follows\n * `visibleFieldOrder`.\n */\nexport function resolveVisibleFields(\n sections: PatientFieldSection[],\n visibleFieldOrder?: string[],\n): ResolvedPatientSection[] {\n const order = visibleFieldOrder ?? patientFieldCatalogue(sections);\n const orderIndex = new Map(order.map((id, index) => [id, index]));\n return sections.map((section) => ({\n section,\n fields: section.fields\n .filter((field) => orderIndex.has(field.id))\n .sort(\n (a, b) =>\n (orderIndex.get(a.id) as number) - (orderIndex.get(b.id) as number),\n ),\n }));\n}\n","import { useCallback, useMemo } from 'react';\nimport { useControllableState } from '../../hooks/use-controllable-state';\nimport {\n patientFieldCatalogue,\n type PatientField,\n type PatientFieldSection,\n} from './patient-fields';\n\n/* -------------------------------------------------------------------- */\n/* usePatientFieldVisibility */\n/* */\n/* The single visibility + ordering engine behind the patient field */\n/* picker, shared by every surface that lets a user curate which patient */\n/* fields show and in what order (PatientDetails, PatientSummaryCard). */\n/* */\n/* CONTEXT-SCOPED, not global: the order is a per-INSTANCE prop the kit */\n/* never persists. Each placement (a care-plan card, the patient-folder */\n/* summary, the Control Room details panel) is wired to its OWN */\n/* `value` / `onChange`, so the SAME field vocabulary can be displayed */\n/* differently in different parts of the app. The consumer owns the */\n/* persistence scope — global per-user, or per-context. */\n/* */\n/* Every mutation filters to known field ids, so persisted / agent input */\n/* can never smuggle an unknown key into the visible set. */\n/* -------------------------------------------------------------------- */\n\nexport interface UsePatientFieldVisibilityOptions {\n /** Controlled ordered list of visible field ids. */\n value?: string[];\n /** Uncontrolled initial order. Omit both ⇒ every field, declaration order. */\n defaultValue?: string[];\n /** Fired on any show / hide / reorder, with the next ordered visible set. */\n onChange?: (orderedIds: string[]) => void;\n}\n\nexport interface PatientFieldVisibility {\n /** Current ordered list of visible field ids (filtered to known fields). */\n visible: string[];\n /** Flat declaration-order catalogue of every field id (\"show everything\"). */\n catalogueIds: string[];\n /** field id → its field + owning section id. */\n fieldById: Map<string, { field: PatientField; sectionId: string }>;\n /** Replace the visible set / order (filtered to known fields). */\n setOrder: (orderedIds: string[]) => void;\n /** Show or hide a single field. */\n toggleField: (fieldId: string) => void;\n /** Show or hide every field in a section. */\n toggleSection: (sectionId: string, show: boolean) => void;\n /**\n * Move a field to land at another field's slot, WITHIN its section's\n * visible subsequence. Cross-section moves are ignored — sections stay in\n * declaration order. Drives both pointer drops and keyboard (Alt+Arrow).\n */\n moveFieldOnto: (fromId: string, toId: string) => void;\n /** Reset to `defaultValue` (or the full catalogue when none was given). */\n reset: () => void;\n}\n\nexport function usePatientFieldVisibility(\n sections: PatientFieldSection[],\n { value, defaultValue, onChange }: UsePatientFieldVisibilityOptions = {},\n): PatientFieldVisibility {\n const catalogueIds = useMemo(\n () => patientFieldCatalogue(sections),\n [sections],\n );\n\n const [orderState, setOrderState] = useControllableState<string[]>({\n value,\n defaultValue: defaultValue ?? catalogueIds,\n onChange,\n });\n // `useControllableState` may yield `undefined` before the first write.\n const visible = orderState ?? defaultValue ?? catalogueIds;\n\n const fieldById = useMemo(() => {\n const map = new Map<string, { field: PatientField; sectionId: string }>();\n for (const section of sections) {\n for (const field of section.fields) {\n map.set(field.id, { field, sectionId: section.id });\n }\n }\n return map;\n }, [sections]);\n\n const setOrder = useCallback(\n (next: string[]) => {\n // Drop unknown ids so persisted / agent input can't smuggle keys.\n setOrderState(next.filter((fid) => fieldById.has(fid)));\n },\n [setOrderState, fieldById],\n );\n\n const toggleField = useCallback(\n (fieldId: string) => {\n setOrder(\n visible.includes(fieldId)\n ? visible.filter((fid) => fid !== fieldId)\n : [...visible, fieldId],\n );\n },\n [visible, setOrder],\n );\n\n const toggleSection = useCallback(\n (sectionId: string, show: boolean) => {\n const sectionIds =\n sections.find((s) => s.id === sectionId)?.fields.map((f) => f.id) ?? [];\n const sectionSet = new Set(sectionIds);\n if (show) {\n const missing = sectionIds.filter((fid) => !visible.includes(fid));\n setOrder([...visible, ...missing]);\n } else {\n setOrder(visible.filter((fid) => !sectionSet.has(fid)));\n }\n },\n [sections, visible, setOrder],\n );\n\n const moveFieldOnto = useCallback(\n (fromId: string, toId: string) => {\n if (fromId === toId) return;\n const fromSection = fieldById.get(fromId)?.sectionId;\n const toSection = fieldById.get(toId)?.sectionId;\n if (!fromSection || fromSection !== toSection) return;\n const sectionIds = new Set(\n sections.find((s) => s.id === fromSection)?.fields.map((f) => f.id) ??\n [],\n );\n const siblings = visible.filter((fid) => sectionIds.has(fid));\n const fromIdx = siblings.indexOf(fromId);\n const toIdx = siblings.indexOf(toId);\n if (fromIdx < 0 || toIdx < 0) return;\n const [moved] = siblings.splice(fromIdx, 1);\n siblings.splice(toIdx, 0, moved);\n // Splice the reordered siblings back into their positions in `visible`.\n let k = 0;\n const next = visible.map((fid) =>\n sectionIds.has(fid) ? siblings[k++] : fid,\n );\n setOrder(next);\n },\n [fieldById, sections, visible, setOrder],\n );\n\n const reset = useCallback(() => {\n setOrder(defaultValue ?? catalogueIds);\n }, [defaultValue, catalogueIds, setOrder]);\n\n return {\n visible,\n catalogueIds,\n fieldById,\n setOrder,\n toggleField,\n toggleSection,\n moveFieldOnto,\n reset,\n };\n}\n","import {\n useCallback,\n useMemo,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { GripVertical, Settings } from 'lucide-react';\nimport { Button, IconButton } from '../button';\nimport { Checkbox } from '../checkbox/checkbox';\nimport { Popover } from '../popover/popover';\nimport { Separator } from '../separator/separator';\nimport type { PatientFieldSection } from './patient-fields';\n\n/* -------------------------------------------------------------------- */\n/* FieldVisibilityCog — the patient field picker */\n/* */\n/* The shared \"Customize fields\" cog: a Popover of per-field checkboxes */\n/* (grouped by section, with a section-level toggle-all where the section */\n/* is named), a drag handle per visible field for pointer reordering, and */\n/* the canonical Sidebar keyboard reorder gesture (Alt+Arrow / Alt+Home / */\n/* Alt+End) with an sr-only live announcement. Pure UI — the visibility */\n/* state + reducers live in `usePatientFieldVisibility`, so PatientDetails */\n/* and PatientSummaryCard share ONE picker driving each surface's own */\n/* per-context order. */\n/* */\n/* Native-HTML5 DnD (no library), mirroring data-table's ColumnToggle; */\n/* the grip adds the keyboard channel that pattern lacks. Sections with an */\n/* empty heading render their fields flat with no toggle-all (the card's */\n/* legacy single-section mode) so no empty-named checkbox is emitted. */\n/* -------------------------------------------------------------------- */\n\nexport interface FieldVisibilityCogProps {\n /** The sectioned field catalogue. */\n sections: PatientFieldSection[];\n /** Current ordered visible field ids. */\n visible: string[];\n /** Show / hide a single field. */\n onToggleField: (fieldId: string) => void;\n /** Show / hide every field in a section. */\n onToggleSection: (sectionId: string, show: boolean) => void;\n /** Move a field onto another field's slot within its section. */\n onMoveFieldOnto: (fromId: string, toId: string) => void;\n /** Reset to the default field set / order. */\n onReset: () => void;\n /** Override the cog trigger's accessible name. */\n label?: string;\n}\n\nexport function FieldVisibilityCog({\n sections,\n visible,\n onToggleField,\n onToggleSection,\n onMoveFieldOnto,\n onReset,\n label,\n}: FieldVisibilityCogProps): ReactNode {\n const { t } = useTranslation();\n const visibleSet = useMemo(() => new Set(visible), [visible]);\n\n // Drag-and-drop reorder (pointer). The keyboard channel runs through each\n // grip handle's Alt+Arrow keys; both routes share `onMoveFieldOnto`.\n const [draggingId, setDraggingId] = useState<string | null>(null);\n const [dragOverId, setDragOverId] = useState<string | null>(null);\n const [announcement, setAnnouncement] = useState('');\n\n // Field id → section id and → label: the cross-section drop guard and the\n // move announcement both need the DRAGGED field's section/label, which isn't\n // in the drop row's render scope.\n const { sectionOfField, labelOfField } = useMemo(() => {\n const sectionMap = new Map<string, string>();\n const labelMap = new Map<string, string>();\n for (const section of sections) {\n for (const field of section.fields) {\n sectionMap.set(field.id, section.id);\n labelMap.set(field.id, field.label);\n }\n }\n return { sectionOfField: sectionMap, labelOfField: labelMap };\n }, [sections]);\n\n const draggingSectionId = draggingId\n ? sectionOfField.get(draggingId)\n : undefined;\n\n const clearDrag = useCallback(() => {\n setDraggingId(null);\n setDragOverId(null);\n }, []);\n\n // Announce the moved field's new 1-based position to assistive tech.\n const announceMoved = useCallback(\n (fieldId: string, newIndex: number, count: number) => {\n setAnnouncement(\n t('fieldPicker.moved', {\n field: labelOfField.get(fieldId) ?? '',\n position: newIndex + 1,\n count,\n defaultValue: 'Moved {{field}} to position {{position}} of {{count}}',\n }),\n );\n },\n [t, labelOfField],\n );\n\n return (\n <Popover.Root>\n <Popover.Trigger asChild>\n <IconButton\n size=\"sm\"\n intent=\"outline\"\n icon={<Settings aria-hidden=\"true\" />}\n aria-label={\n label ??\n t('fieldPicker.trigger', { defaultValue: 'Customize fields' })\n }\n className=\"ds:shrink-0\"\n />\n </Popover.Trigger>\n <Popover.Content align=\"end\" size=\"sm\">\n <Popover.Heading>\n {t('fieldPicker.title', { defaultValue: 'Customize fields' })}\n </Popover.Heading>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:mt-[var(--spacing-xs)]\">\n {sections.map((section) => {\n const fieldIds = section.fields.map((f) => f.id);\n const shownCount = fieldIds.filter((fid) =>\n visibleSet.has(fid),\n ).length;\n // Visible siblings in display order — the subsequence reordering\n // operates on. The keyboard arrows' no-op bounds key off the\n // field's index HERE, not the full declaration array.\n const orderedVisible = visible.filter((fid) =>\n fieldIds.includes(fid),\n );\n const sectionState: boolean | 'indeterminate' =\n shownCount === 0\n ? false\n : shownCount === fieldIds.length\n ? true\n : 'indeterminate';\n // A named section gets a toggle-all checkbox + indented field list;\n // an unnamed one (the card's single legacy section) renders flat.\n const named = !!section.heading;\n return (\n <div\n key={section.id}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]\"\n >\n {named ? (\n <Checkbox\n size=\"sm\"\n label={section.heading}\n checked={sectionState}\n onCheckedChange={(checked) =>\n onToggleSection(section.id, checked === true)\n }\n />\n ) : null}\n <ul\n className={[\n 'ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-2xs)]',\n named ? 'ds:ps-[var(--spacing-md)]' : 'ds:ps-0',\n ].join(' ')}\n >\n {section.fields.map((field) => {\n const shown = visibleSet.has(field.id);\n const visIndex = orderedVisible.indexOf(field.id);\n const count = orderedVisible.length;\n const isDragging = draggingId === field.id;\n const isDragOver =\n dragOverId === field.id &&\n draggingId !== null &&\n draggingId !== field.id &&\n draggingSectionId === section.id;\n\n // Native-HTML5 DnD wiring, applied only to visible rows —\n // a hidden field is neither a drag source nor a drop slot.\n const dragProps: HTMLAttributes<HTMLLIElement> = shown\n ? {\n draggable: true,\n onDragStart: (e) => {\n setDraggingId(field.id);\n e.dataTransfer.effectAllowed = 'move';\n e.dataTransfer.setData('text/plain', field.id);\n },\n onDragOver: (e) => {\n // Same-section drops only; sections stay fixed.\n if (\n draggingId === null ||\n draggingSectionId !== section.id\n )\n return;\n e.preventDefault();\n e.dataTransfer.dropEffect = 'move';\n setDragOverId(field.id);\n },\n onDragLeave: () =>\n setDragOverId((prev) =>\n prev === field.id ? null : prev,\n ),\n onDrop: (e) => {\n e.preventDefault();\n const fromId = e.dataTransfer.getData('text/plain');\n if (\n fromId &&\n fromId !== field.id &&\n sectionOfField.get(fromId) === section.id\n ) {\n onMoveFieldOnto(fromId, field.id);\n announceMoved(fromId, visIndex, count);\n }\n clearDrag();\n },\n onDragEnd: clearDrag,\n }\n : {};\n\n return (\n <li\n key={field.id}\n {...dragProps}\n className={[\n 'ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-2xs)] ds:rounded-[var(--radius-sm)] ds:px-[var(--spacing-2xs)] ds:py-[var(--spacing-2xs)] ds:transition-colors ds:motion-reduce:transition-none',\n isDragging ? 'ds:opacity-50' : '',\n isDragOver\n ? 'ds:bg-[color:color-mix(in_srgb,var(--primary)_8%,transparent)]'\n : '',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n <Checkbox\n size=\"sm\"\n label={field.label}\n checked={shown}\n onCheckedChange={() => onToggleField(field.id)}\n />\n {shown ? (\n <IconButton\n size=\"sm\"\n intent=\"ghost\"\n icon={<GripVertical aria-hidden=\"true\" />}\n aria-label={t('fieldPicker.reorder', {\n field: field.label,\n defaultValue:\n 'Reorder {{field}}. Press Alt + Up or Alt + Down to move.',\n })}\n aria-keyshortcuts=\"Alt+ArrowUp Alt+ArrowDown Alt+Home Alt+End\"\n className=\"ds:shrink-0 ds:cursor-grab ds:active:cursor-grabbing\"\n onKeyDown={(e) => {\n // Reorder gestures mirror the canonical Sidebar\n // handle: Alt+Arrow (+ Alt+Home / Alt+End). Bare\n // arrows fall through to the browser default.\n if (!e.altKey) return;\n if (e.key === 'ArrowUp') {\n if (visIndex <= 0) return;\n e.preventDefault();\n onMoveFieldOnto(\n field.id,\n orderedVisible[visIndex - 1],\n );\n announceMoved(field.id, visIndex - 1, count);\n } else if (e.key === 'ArrowDown') {\n if (visIndex >= count - 1) return;\n e.preventDefault();\n onMoveFieldOnto(\n field.id,\n orderedVisible[visIndex + 1],\n );\n announceMoved(field.id, visIndex + 1, count);\n } else if (e.key === 'Home') {\n if (visIndex <= 0) return;\n e.preventDefault();\n onMoveFieldOnto(field.id, orderedVisible[0]);\n announceMoved(field.id, 0, count);\n } else if (e.key === 'End') {\n if (visIndex >= count - 1) return;\n e.preventDefault();\n onMoveFieldOnto(\n field.id,\n orderedVisible[count - 1],\n );\n announceMoved(field.id, count - 1, count);\n }\n }}\n />\n ) : null}\n </li>\n );\n })}\n </ul>\n </div>\n );\n })}\n <Separator orientation=\"horizontal\" />\n <Button type=\"button\" size=\"sm\" intent=\"ghost\" onClick={onReset}>\n {t('fieldPicker.reset', { defaultValue: 'Reset to defaults' })}\n </Button>\n </div>\n {/* Reorder announcements for assistive tech (drag drop + arrow keys). */}\n <span role=\"status\" className=\"ds:sr-only\">\n {announcement}\n </span>\n </Popover.Content>\n </Popover.Root>\n );\n}\n","import { cloneElement, type ReactElement, type ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { CalendarDays, Hash, Hourglass, Mars, User, Venus } from 'lucide-react';\nimport { Badge } from '../badge/badge';\nimport { Link } from '../link/link';\nimport { TransactionChip } from '../transaction-chip/transaction-chip';\nimport type { PatientField } from './patient-fields';\n\n/* -------------------------------------------------------------------- */\n/* FieldValue — the canonical field-chip registry */\n/* */\n/* Renders ONE patient field's value slot. When the consumer supplies an */\n/* explicit `value` (legacy rows, per-placement overrides) it wins */\n/* verbatim. Otherwise `kind` selects the canonical chip and the raw */\n/* datum is read from `editValue`, so a known field type looks the same */\n/* on every surface (PatientSummaryCard + PatientDetails share this). */\n/* */\n/* The per-type chips (`SexChip` / `AgeChip` / `NeutralChip`) are exported */\n/* so the PatientSummaryCard identity line renders the SAME chips under */\n/* the name. */\n/* */\n/* Pure composition over already-marked kit primitives (Badge / */\n/* TransactionChip) — it mounts no surface of its own, so it carries no */\n/* `data-component` (allowlisted in check-data-component-coverage.mjs). */\n/* -------------------------------------------------------------------- */\n\n// The neutral Badge's own text colour (`--muted-foreground`) is too low\n// contrast for primary demographic data — grey text on the grey pill reads at\n// ~5.8:1. The chip label + glyph are pinned to `--foreground` (~11:1) so the\n// data stays legible on every theme.\nconst STRONG = 'ds:text-[color:var(--foreground)]';\n\n/** Default English labels — real translations live under `patientField.*`. */\nconst SEX_LABEL_DEFAULT: Record<string, string> = {\n m: 'Male',\n f: 'Female',\n x: 'Other',\n};\n\n/** A neutral pill with high-contrast text + an optional leading glyph. */\nexport function NeutralChip({\n icon,\n mono,\n children,\n}: {\n icon?: ReactElement;\n mono?: boolean;\n children: ReactNode;\n}): ReactNode {\n return (\n <Badge\n variant=\"neutral\"\n className={mono ? 'ds:font-mono' : undefined}\n // Clone the glyph (don't wrap it) so it stays Badge's DIRECT <svg> child —\n // Badge's `[&>svg]:size-*` rule only sizes a direct child, so wrapping it\n // left the glyph at lucide's default 24px. The clone also carries `STRONG`.\n leading={\n icon\n ? cloneElement(icon as ReactElement<{ className?: string }>, {\n className: STRONG,\n })\n : undefined\n }\n >\n <span className={STRONG}>{children}</span>\n </Badge>\n );\n}\n\n/** Sex chip — Venus / Mars / User glyph + localised label. Female / male carry a\n * tonal pink / blue FILL; unspecified stays the neutral pill. */\nexport function SexChip({ code }: { code: string }): ReactNode {\n const { t } = useTranslation();\n const c = code.toLowerCase();\n const label = t(`patientField.sex.${c}`, {\n defaultValue: SEX_LABEL_DEFAULT[c] ?? code,\n });\n // The fill carries the colour; Badge sizes + tones the glyph from the variant.\n // `accentSoft` is the kit's tonal magenta (≈ pink); `info` the tonal indigo\n // (≈ blue, the closest the closed palette has to blue). Other → neutral.\n if (c === 'f') {\n return (\n <Badge variant=\"accentSoft\" leading={<Venus />}>\n {label}\n </Badge>\n );\n }\n if (c === 'm') {\n return (\n <Badge variant=\"info\" leading={<Mars />}>\n {label}\n </Badge>\n );\n }\n return <NeutralChip icon={<User />}>{label}</NeutralChip>;\n}\n\n/** Age chip — hourglass glyph + localised, pluralised age. */\nexport function AgeChip({ years }: { years: number }): ReactNode {\n const { t } = useTranslation();\n return (\n <NeutralChip icon={<Hourglass />}>\n {t('patientField.age', {\n count: years,\n defaultValue: '{{count}} years old',\n })}\n </NeutralChip>\n );\n}\n\nexport function FieldValue({ field }: { field: PatientField }): ReactNode {\n const { i18n } = useTranslation();\n\n // Contact kinds render as a mailto:/tel: Link — the display string is read\n // from `value` (or `editValue`), the href is derived from it. Checked BEFORE\n // the explicit-value short-circuit so a plain-string `value` still links.\n if (field.kind === 'email' || field.kind === 'phone') {\n const display =\n typeof field.value === 'string'\n ? field.value\n : (field.copyText ??\n (typeof field.editValue === 'string' ? field.editValue : ''));\n if (display) {\n // mailto: trims surrounding whitespace; tel: keeps only `+` and digits\n // (dialler-safe), leaving the formatted text as the visible label.\n const href =\n field.kind === 'email'\n ? `mailto:${display.trim()}`\n : `tel:${display.replace(/[^+\\d]/g, '')}`;\n return <Link href={href}>{display}</Link>;\n }\n // No string to link — fall through to any explicit node value below.\n }\n\n // An explicit value always wins — legacy rows + per-placement overrides.\n if (field.value != null) {\n return <>{field.value}</>;\n }\n if (!field.kind) {\n return null;\n }\n\n switch (field.kind) {\n case 'sex':\n return <SexChip code={String(field.editValue ?? '')} />;\n case 'age': {\n const years =\n typeof field.editValue === 'number'\n ? field.editValue\n : Number(field.editValue);\n if (!Number.isFinite(years)) {\n return null;\n }\n return <AgeChip years={years} />;\n }\n case 'dob': {\n const raw = field.editValue;\n const date = raw instanceof Date ? raw : new Date(String(raw ?? ''));\n const formatted = Number.isNaN(date.getTime())\n ? String(raw ?? '')\n : new Intl.DateTimeFormat(i18n.language, {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n }).format(date);\n if (!formatted) {\n return null;\n }\n return <NeutralChip icon={<CalendarDays />}>{formatted}</NeutralChip>;\n }\n case 'fiscalCode': {\n // Copy + PHI lock stay the consumer's row-level affordance (PatientDetails\n // renders them from `copyable` / `sensitive`); the chip is the mono pill.\n const code =\n field.copyText ??\n (typeof field.editValue === 'string' ? field.editValue : '');\n if (!code) {\n return null;\n }\n return (\n <NeutralChip icon={<Hash />} mono>\n {code}\n </NeutralChip>\n );\n }\n case 'discount': {\n // The canonical monetary discount chip — magnitude + currency, the sign\n // (\"−\") and glyph owned by TransactionChip. The row label gives context,\n // so the chip itself shows only the amount (no duplicate state label).\n const amount =\n typeof field.editValue === 'number'\n ? field.editValue\n : Number(field.editValue);\n if (!Number.isFinite(amount)) {\n return null;\n }\n return (\n <TransactionChip\n state=\"discount\"\n amount={Math.abs(amount)}\n currency={field.currency}\n size=\"sm\"\n />\n );\n }\n default:\n return null;\n }\n}\n"],"names":["__iconNode","Hourglass","createLucideIcon","Mars","Venus","patientFieldCatalogue","sections","s","f","resolveVisibleFields","visibleFieldOrder","order","orderIndex","id","index","section","field","a","b","usePatientFieldVisibility","value","defaultValue","onChange","catalogueIds","useMemo","orderState","setOrderState","useControllableState","visible","fieldById","map","setOrder","useCallback","next","fid","toggleField","fieldId","toggleSection","sectionId","show","sectionIds","_a","sectionSet","missing","moveFieldOnto","fromId","toId","fromSection","toSection","_b","_c","siblings","fromIdx","toIdx","moved","k","reset","FieldVisibilityCog","onToggleField","onToggleSection","onMoveFieldOnto","onReset","label","t","useTranslation","visibleSet","draggingId","setDraggingId","useState","dragOverId","setDragOverId","announcement","setAnnouncement","sectionOfField","labelOfField","sectionMap","labelMap","draggingSectionId","clearDrag","announceMoved","newIndex","count","jsxs","Popover","jsx","IconButton","Settings","fieldIds","shownCount","orderedVisible","sectionState","named","Checkbox","checked","shown","visIndex","isDragging","isDragOver","e","prev","GripVertical","Separator","Button","STRONG","SEX_LABEL_DEFAULT","NeutralChip","icon","mono","children","Badge","cloneElement","SexChip","code","c","User","AgeChip","years","FieldValue","i18n","display","href","Link","Fragment","raw","date","formatted","CalendarDays","Hash","amount","TransactionChip"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAAA,EACzC,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAAA,EACxC;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AAAA,EACE;AAAA,IACE;AAAA,IACA,EAAE,GAAG,0EAA0E,KAAK,SAAQ;AAAA,EAChG;AACA,GACMC,KAAYC,EAAiB,aAAaF,EAAU;ACxB1D;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,aAAa,KAAK,SAAQ,CAAE;AAAA,EAC1C,CAAC,QAAQ,EAAE,GAAG,mBAAmB,KAAK,SAAQ,CAAE;AAAA,EAChD,CAAC,UAAU,EAAE,IAAI,MAAM,IAAI,MAAM,GAAG,KAAK,KAAK,SAAQ,CAAE;AAC1D,GACMG,KAAOD,EAAiB,QAAQF,EAAU;ACdhD;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAAA,EACzC,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAAA,EACxC,CAAC,UAAU,EAAE,IAAI,MAAM,IAAI,KAAK,GAAG,KAAK,KAAK,SAAQ,CAAE;AACzD,GACMI,KA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IACA;AACE,aAAO;AAAA,EAAA;AAEb;","x_google_ignoreList":[0,1,2]}
1
+ {"version":3,"file":"field-value-DG8zaZvo.js","sources":["../../node_modules/lucide-react/dist/esm/icons/hourglass.mjs","../../node_modules/lucide-react/dist/esm/icons/mars.mjs","../../node_modules/lucide-react/dist/esm/icons/venus.mjs","../../src/components/_shared/patient-fields.ts","../../src/components/_shared/field-visibility.ts","../../src/components/_shared/field-visibility-cog.tsx","../../src/components/_shared/field-value.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: \"M5 22h14\", key: \"ehvnwv\" }],\n [\"path\", { d: \"M5 2h14\", key: \"pdyrp9\" }],\n [\n \"path\",\n {\n d: \"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22\",\n key: \"1d314k\"\n }\n ],\n [\n \"path\",\n { d: \"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2\", key: \"1vvvr6\" }\n ]\n];\nconst Hourglass = createLucideIcon(\"hourglass\", __iconNode);\n\nexport { __iconNode, Hourglass as default };\n//# sourceMappingURL=hourglass.mjs.map\n","/**\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 3h5v5\", key: \"1806ms\" }],\n [\"path\", { d: \"m21 3-6.75 6.75\", key: \"pv0uzu\" }],\n [\"circle\", { cx: \"10\", cy: \"14\", r: \"6\", key: \"1qwbdc\" }]\n];\nconst Mars = createLucideIcon(\"mars\", __iconNode);\n\nexport { __iconNode, Mars as default };\n//# sourceMappingURL=mars.mjs.map\n","/**\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: \"M12 15v7\", key: \"t2xh3l\" }],\n [\"path\", { d: \"M9 19h6\", key: \"456am0\" }],\n [\"circle\", { cx: \"12\", cy: \"9\", r: \"6\", key: \"1nw4tq\" }]\n];\nconst Venus = createLucideIcon(\"venus\", __iconNode);\n\nexport { __iconNode, Venus as default };\n//# sourceMappingURL=venus.mjs.map\n","import type { ReactElement, ReactNode } from 'react';\n\n/* -------------------------------------------------------------------- */\n/* Shared patient-field model */\n/* */\n/* The single field VOCABULARY every patient surface speaks — consumed */\n/* by both `PatientDetails` (full, inline-editable) and */\n/* `PatientSummaryCard` (compact). Either can surface a \"Customize */\n/* fields\" cog (show/hide + drag-and-drop reorder). The kit owns the */\n/* SHAPE; the CONSUMER owns the registry (which DoctorPatient field maps */\n/* to which id/label/PHI flag). */\n/* */\n/* Visibility + order are PER-CONTEXT, not global: the kit never persists */\n/* them — each PLACEMENT is wired to its own `visibleFieldOrder` / */\n/* `onVisibleFieldsChange`, so the SAME vocabulary can display */\n/* differently in different parts of the app (a care-plan card vs the */\n/* patient folder). The consumer chooses the persistence scope — global */\n/* per-user, or per-surface (PRS §Security; design doc D1/D2). */\n/* -------------------------------------------------------------------- */\n\n/**\n * Canonical field TYPE. When set (and no explicit `value` is supplied), the\n * kit renders the field's canonical chip from the shared `<FieldValue>`\n * registry instead of plain text — so the SAME field type looks the same on\n * every surface. Each chip is a high-contrast neutral pill with a glyph:\n *\n * - `sex` → Venus / Mars / User glyph + localised label\n * - `age` → hourglass glyph + localised, pluralised age\n * - `dob` → calendar glyph + locale-formatted date\n * - `fiscalCode` → hash glyph + monospace code (already mono — no `mono` flag\n * needed; copy + PHI lock stay the row-level affordance via\n * `copyable` / `sensitive`)\n * - `discount` → `TransactionChip` `state=\"discount\"` (the canonical monetary\n * discount chip — magnitude + `currency`, sign owned by the chip)\n * - `email` → a `mailto:` `Link` (the address is both display + target)\n * - `phone` → a `tel:` `Link` (formatted display, target normalised to\n * `+` and digits)\n *\n * The raw datum is read from `editValue` (the same scalar that seeds the\n * editor): a number for `age` / `discount`, an ISO string or `Date` for `dob`,\n * a code string for `sex`, the code string for `fiscalCode`. For the contact\n * link kinds the DISPLAY string is read from `value` (or `editValue`) and the\n * href is derived from it — so a plain-string `value` still becomes a link.\n * For every OTHER kind an explicit `value` ALWAYS wins, so a consumer can still\n * override per placement.\n */\nexport type PatientFieldKind =\n | 'sex'\n | 'age'\n | 'dob'\n | 'fiscalCode'\n | 'discount'\n | 'email'\n | 'phone';\n\n/** Editor control rendered when a field enters inline-edit mode. */\nexport type PatientFieldEditType =\n | 'text'\n | 'textarea'\n | 'select'\n | 'boolean'\n | 'date'\n | 'number'\n // Typed text variants — each renders the kit's dedicated input (validation,\n // formatting, masking) instead of a bare TextInput. Their edited value still\n // serialises to a plain string through the shared save callback.\n | 'email'\n | 'phone'\n | 'fiscalCode'\n // Address / location variants — each renders the dedicated kit picker.\n // `province`/`country`/`city` emit a plain string (UPPER sigla / alpha-2\n // lower / city name); `postalCode` validates the IT CAP format on blur.\n | 'province'\n | 'country'\n | 'postalCode'\n | 'city';\n\n/** A choice for an `editType: 'select'` field. */\nexport interface PatientFieldOption {\n value: string;\n label: string;\n}\n\n/**\n * Raw value seeded into an editor. The kit never inspects this beyond\n * handing it to the matching control and back through a save callback.\n */\nexport type PatientFieldEditValue =\n | string\n | number\n | boolean\n | Date\n | null\n | undefined;\n\n/** One label→value patient field. */\nexport interface PatientField {\n /**\n * Stable field key — drives visibility, ordering, the `data-field-id`\n * hook, and agent addressing. MUST NOT be the value (no PHI in keys).\n */\n id: string;\n /** Display label (already localised by the consumer, or a kit label). */\n label: string;\n /**\n * Display node — formatted by the consumer (Badge / Tag / Link / text).\n * Optional: omit it and set `kind` to let the kit render the field's\n * canonical chip from `editValue`. When present, `value` ALWAYS wins.\n */\n value?: ReactNode;\n /**\n * Canonical field type — when set and `value` is omitted, the kit renders\n * the matching canonical chip from the shared registry. Presentation only;\n * NEVER emitted into any `data-*` attribute (same rule as `sensitive`).\n */\n kind?: PatientFieldKind;\n /** Leading icon (a single lucide element). */\n icon?: ReactElement | null;\n /** Render the copy-to-clipboard affordance (fiscal code, ids). */\n copyable?: boolean;\n /** Text written to the clipboard when `copyable`. */\n copyText?: string;\n /** Render the value monospaced (codes, ids). */\n mono?: boolean;\n /**\n * High-sensitivity PHI marker — renders a lock glyph next to the label.\n * Presentation only; NEVER emitted into any `data-*` attribute.\n */\n sensitive?: boolean;\n /** Whether this field can be inline-edited (consumer gates by permission). */\n editable?: boolean;\n /** Control used in edit mode. Defaults to `'text'`. */\n editType?: PatientFieldEditType;\n /** Options for `editType: 'select'`. */\n options?: PatientFieldOption[];\n /** Value seeded into the editor when editing begins. */\n editValue?: PatientFieldEditValue;\n /** Currency code for `editType: 'number'` (renders a currency input). */\n currency?: string;\n}\n\n/** A labelled, collapsible group of fields. */\nexport interface PatientFieldSection {\n /** Stable section key. */\n id: string;\n /** Section heading. */\n heading: string;\n fields: PatientField[];\n /** Wrap the section in a Collapsible (default `true`). Honoured by PatientDetails. */\n collapsible?: boolean;\n /** Initial open state when `collapsible` (default `true`). */\n defaultOpen?: boolean;\n}\n\n/** The flat declaration-order list of every field id — the \"show everything\" default. */\nexport function patientFieldCatalogue(\n sections: PatientFieldSection[],\n): string[] {\n return sections.flatMap((s) => s.fields.map((f) => f.id));\n}\n\n/** A section paired with its currently-visible fields, in the chosen order. */\nexport interface ResolvedPatientSection {\n section: PatientFieldSection;\n fields: PatientField[];\n}\n\n/**\n * Project `sections` to the visible fields per section, ordered by\n * `visibleFieldOrder`. This is the single piece of visibility logic shared\n * by every patient surface, so the card and the details panel always agree\n * on what is shown and in what order.\n *\n * `visibleFieldOrder` omitted (`undefined`) ⇒ every field visible in\n * declaration order (\"show everything by default\", design doc D3). An explicit\n * empty array `[]` ⇒ NO fields visible — a surface that starts collapsed and\n * reveals fields via the customize-fields cog. Unknown ids are ignored.\n * Sections stay in declaration order; only intra-section field order follows\n * `visibleFieldOrder`.\n */\nexport function resolveVisibleFields(\n sections: PatientFieldSection[],\n visibleFieldOrder?: string[],\n): ResolvedPatientSection[] {\n const order = visibleFieldOrder ?? patientFieldCatalogue(sections);\n const orderIndex = new Map(order.map((id, index) => [id, index]));\n return sections.map((section) => ({\n section,\n fields: section.fields\n .filter((field) => orderIndex.has(field.id))\n .sort(\n (a, b) =>\n (orderIndex.get(a.id) as number) - (orderIndex.get(b.id) as number),\n ),\n }));\n}\n","import { useCallback, useMemo } from 'react';\nimport { useControllableState } from '../../hooks/use-controllable-state';\nimport {\n patientFieldCatalogue,\n type PatientField,\n type PatientFieldSection,\n} from './patient-fields';\n\n/* -------------------------------------------------------------------- */\n/* usePatientFieldVisibility */\n/* */\n/* The single visibility + ordering engine behind the patient field */\n/* picker, shared by every surface that lets a user curate which patient */\n/* fields show and in what order (PatientDetails, PatientSummaryCard). */\n/* */\n/* CONTEXT-SCOPED, not global: the order is a per-INSTANCE prop the kit */\n/* never persists. Each placement (a care-plan card, the patient-folder */\n/* summary, the Control Room details panel) is wired to its OWN */\n/* `value` / `onChange`, so the SAME field vocabulary can be displayed */\n/* differently in different parts of the app. The consumer owns the */\n/* persistence scope — global per-user, or per-context. */\n/* */\n/* Every mutation filters to known field ids, so persisted / agent input */\n/* can never smuggle an unknown key into the visible set. */\n/* -------------------------------------------------------------------- */\n\nexport interface UsePatientFieldVisibilityOptions {\n /** Controlled ordered list of visible field ids. */\n value?: string[];\n /** Uncontrolled initial order. Omit both ⇒ every field, declaration order. */\n defaultValue?: string[];\n /** Fired on any show / hide / reorder, with the next ordered visible set. */\n onChange?: (orderedIds: string[]) => void;\n}\n\nexport interface PatientFieldVisibility {\n /** Current ordered list of visible field ids (filtered to known fields). */\n visible: string[];\n /** Flat declaration-order catalogue of every field id (\"show everything\"). */\n catalogueIds: string[];\n /** field id → its field + owning section id. */\n fieldById: Map<string, { field: PatientField; sectionId: string }>;\n /** Replace the visible set / order (filtered to known fields). */\n setOrder: (orderedIds: string[]) => void;\n /** Show or hide a single field. */\n toggleField: (fieldId: string) => void;\n /** Show or hide every field in a section. */\n toggleSection: (sectionId: string, show: boolean) => void;\n /**\n * Move a field to land at another field's slot, WITHIN its section's\n * visible subsequence. Cross-section moves are ignored — sections stay in\n * declaration order. Drives both pointer drops and keyboard (Alt+Arrow).\n */\n moveFieldOnto: (fromId: string, toId: string) => void;\n /** Reset to `defaultValue` (or the full catalogue when none was given). */\n reset: () => void;\n}\n\nexport function usePatientFieldVisibility(\n sections: PatientFieldSection[],\n { value, defaultValue, onChange }: UsePatientFieldVisibilityOptions = {},\n): PatientFieldVisibility {\n const catalogueIds = useMemo(\n () => patientFieldCatalogue(sections),\n [sections],\n );\n\n const [orderState, setOrderState] = useControllableState<string[]>({\n value,\n defaultValue: defaultValue ?? catalogueIds,\n onChange,\n });\n // `useControllableState` may yield `undefined` before the first write.\n const visible = orderState ?? defaultValue ?? catalogueIds;\n\n const fieldById = useMemo(() => {\n const map = new Map<string, { field: PatientField; sectionId: string }>();\n for (const section of sections) {\n for (const field of section.fields) {\n map.set(field.id, { field, sectionId: section.id });\n }\n }\n return map;\n }, [sections]);\n\n const setOrder = useCallback(\n (next: string[]) => {\n // Drop unknown ids so persisted / agent input can't smuggle keys.\n setOrderState(next.filter((fid) => fieldById.has(fid)));\n },\n [setOrderState, fieldById],\n );\n\n const toggleField = useCallback(\n (fieldId: string) => {\n setOrder(\n visible.includes(fieldId)\n ? visible.filter((fid) => fid !== fieldId)\n : [...visible, fieldId],\n );\n },\n [visible, setOrder],\n );\n\n const toggleSection = useCallback(\n (sectionId: string, show: boolean) => {\n const sectionIds =\n sections.find((s) => s.id === sectionId)?.fields.map((f) => f.id) ?? [];\n const sectionSet = new Set(sectionIds);\n if (show) {\n const missing = sectionIds.filter((fid) => !visible.includes(fid));\n setOrder([...visible, ...missing]);\n } else {\n setOrder(visible.filter((fid) => !sectionSet.has(fid)));\n }\n },\n [sections, visible, setOrder],\n );\n\n const moveFieldOnto = useCallback(\n (fromId: string, toId: string) => {\n if (fromId === toId) return;\n const fromSection = fieldById.get(fromId)?.sectionId;\n const toSection = fieldById.get(toId)?.sectionId;\n if (!fromSection || fromSection !== toSection) return;\n const sectionIds = new Set(\n sections.find((s) => s.id === fromSection)?.fields.map((f) => f.id) ??\n [],\n );\n const siblings = visible.filter((fid) => sectionIds.has(fid));\n const fromIdx = siblings.indexOf(fromId);\n const toIdx = siblings.indexOf(toId);\n if (fromIdx < 0 || toIdx < 0) return;\n const [moved] = siblings.splice(fromIdx, 1);\n siblings.splice(toIdx, 0, moved);\n // Splice the reordered siblings back into their positions in `visible`.\n let k = 0;\n const next = visible.map((fid) =>\n sectionIds.has(fid) ? siblings[k++] : fid,\n );\n setOrder(next);\n },\n [fieldById, sections, visible, setOrder],\n );\n\n const reset = useCallback(() => {\n setOrder(defaultValue ?? catalogueIds);\n }, [defaultValue, catalogueIds, setOrder]);\n\n return {\n visible,\n catalogueIds,\n fieldById,\n setOrder,\n toggleField,\n toggleSection,\n moveFieldOnto,\n reset,\n };\n}\n","import {\n useCallback,\n useMemo,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { GripVertical, Settings } from 'lucide-react';\nimport { Button, IconButton } from '../button';\nimport { Checkbox } from '../checkbox/checkbox';\nimport { Popover } from '../popover/popover';\nimport { Separator } from '../separator/separator';\nimport type { PatientFieldSection } from './patient-fields';\n\n/* -------------------------------------------------------------------- */\n/* FieldVisibilityCog — the patient field picker */\n/* */\n/* The shared \"Customize fields\" cog: a Popover of per-field checkboxes */\n/* (grouped by section, with a section-level toggle-all where the section */\n/* is named), a drag handle per visible field for pointer reordering, and */\n/* the canonical Sidebar keyboard reorder gesture (Alt+Arrow / Alt+Home / */\n/* Alt+End) with an sr-only live announcement. Pure UI — the visibility */\n/* state + reducers live in `usePatientFieldVisibility`, so PatientDetails */\n/* and PatientSummaryCard share ONE picker driving each surface's own */\n/* per-context order. */\n/* */\n/* Native-HTML5 DnD (no library), mirroring data-table's ColumnToggle; */\n/* the grip adds the keyboard channel that pattern lacks. Sections with an */\n/* empty heading render their fields flat with no toggle-all (the card's */\n/* legacy single-section mode) so no empty-named checkbox is emitted. */\n/* -------------------------------------------------------------------- */\n\nexport interface FieldVisibilityCogProps {\n /** The sectioned field catalogue. */\n sections: PatientFieldSection[];\n /** Current ordered visible field ids. */\n visible: string[];\n /** Show / hide a single field. */\n onToggleField: (fieldId: string) => void;\n /** Show / hide every field in a section. */\n onToggleSection: (sectionId: string, show: boolean) => void;\n /** Move a field onto another field's slot within its section. */\n onMoveFieldOnto: (fromId: string, toId: string) => void;\n /** Reset to the default field set / order. */\n onReset: () => void;\n /** Override the cog trigger's accessible name. */\n label?: string;\n}\n\nexport function FieldVisibilityCog({\n sections,\n visible,\n onToggleField,\n onToggleSection,\n onMoveFieldOnto,\n onReset,\n label,\n}: FieldVisibilityCogProps): ReactNode {\n const { t } = useTranslation();\n const visibleSet = useMemo(() => new Set(visible), [visible]);\n\n // Drag-and-drop reorder (pointer). The keyboard channel runs through each\n // grip handle's Alt+Arrow keys; both routes share `onMoveFieldOnto`.\n const [draggingId, setDraggingId] = useState<string | null>(null);\n const [dragOverId, setDragOverId] = useState<string | null>(null);\n const [announcement, setAnnouncement] = useState('');\n\n // Field id → section id and → label: the cross-section drop guard and the\n // move announcement both need the DRAGGED field's section/label, which isn't\n // in the drop row's render scope.\n const { sectionOfField, labelOfField } = useMemo(() => {\n const sectionMap = new Map<string, string>();\n const labelMap = new Map<string, string>();\n for (const section of sections) {\n for (const field of section.fields) {\n sectionMap.set(field.id, section.id);\n labelMap.set(field.id, field.label);\n }\n }\n return { sectionOfField: sectionMap, labelOfField: labelMap };\n }, [sections]);\n\n const draggingSectionId = draggingId\n ? sectionOfField.get(draggingId)\n : undefined;\n\n const clearDrag = useCallback(() => {\n setDraggingId(null);\n setDragOverId(null);\n }, []);\n\n // Announce the moved field's new 1-based position to assistive tech.\n const announceMoved = useCallback(\n (fieldId: string, newIndex: number, count: number) => {\n setAnnouncement(\n t('fieldPicker.moved', {\n field: labelOfField.get(fieldId) ?? '',\n position: newIndex + 1,\n count,\n defaultValue: 'Moved {{field}} to position {{position}} of {{count}}',\n }),\n );\n },\n [t, labelOfField],\n );\n\n return (\n <Popover.Root>\n <Popover.Trigger asChild>\n <IconButton\n size=\"sm\"\n intent=\"outline\"\n icon={<Settings aria-hidden=\"true\" />}\n aria-label={\n label ??\n t('fieldPicker.trigger', { defaultValue: 'Customize fields' })\n }\n className=\"ds:shrink-0\"\n />\n </Popover.Trigger>\n <Popover.Content align=\"end\" size=\"sm\">\n <Popover.Heading>\n {t('fieldPicker.title', { defaultValue: 'Customize fields' })}\n </Popover.Heading>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:mt-[var(--spacing-xs)]\">\n {sections.map((section) => {\n const fieldIds = section.fields.map((f) => f.id);\n const shownCount = fieldIds.filter((fid) =>\n visibleSet.has(fid),\n ).length;\n // Visible siblings in display order — the subsequence reordering\n // operates on. The keyboard arrows' no-op bounds key off the\n // field's index HERE, not the full declaration array.\n const orderedVisible = visible.filter((fid) =>\n fieldIds.includes(fid),\n );\n const sectionState: boolean | 'indeterminate' =\n shownCount === 0\n ? false\n : shownCount === fieldIds.length\n ? true\n : 'indeterminate';\n // A named section gets a toggle-all checkbox + indented field list;\n // an unnamed one (the card's single legacy section) renders flat.\n const named = !!section.heading;\n return (\n <div\n key={section.id}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]\"\n >\n {named ? (\n <Checkbox\n size=\"sm\"\n label={section.heading}\n checked={sectionState}\n onCheckedChange={(checked) =>\n onToggleSection(section.id, checked === true)\n }\n />\n ) : null}\n <ul\n className={[\n 'ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-2xs)]',\n named ? 'ds:ps-[var(--spacing-md)]' : 'ds:ps-0',\n ].join(' ')}\n >\n {section.fields.map((field) => {\n const shown = visibleSet.has(field.id);\n const visIndex = orderedVisible.indexOf(field.id);\n const count = orderedVisible.length;\n const isDragging = draggingId === field.id;\n const isDragOver =\n dragOverId === field.id &&\n draggingId !== null &&\n draggingId !== field.id &&\n draggingSectionId === section.id;\n\n // Native-HTML5 DnD wiring, applied only to visible rows —\n // a hidden field is neither a drag source nor a drop slot.\n const dragProps: HTMLAttributes<HTMLLIElement> = shown\n ? {\n draggable: true,\n onDragStart: (e) => {\n setDraggingId(field.id);\n e.dataTransfer.effectAllowed = 'move';\n e.dataTransfer.setData('text/plain', field.id);\n },\n onDragOver: (e) => {\n // Same-section drops only; sections stay fixed.\n if (\n draggingId === null ||\n draggingSectionId !== section.id\n )\n return;\n e.preventDefault();\n e.dataTransfer.dropEffect = 'move';\n setDragOverId(field.id);\n },\n onDragLeave: () =>\n setDragOverId((prev) =>\n prev === field.id ? null : prev,\n ),\n onDrop: (e) => {\n e.preventDefault();\n const fromId = e.dataTransfer.getData('text/plain');\n if (\n fromId &&\n fromId !== field.id &&\n sectionOfField.get(fromId) === section.id\n ) {\n onMoveFieldOnto(fromId, field.id);\n announceMoved(fromId, visIndex, count);\n }\n clearDrag();\n },\n onDragEnd: clearDrag,\n }\n : {};\n\n return (\n <li\n key={field.id}\n {...dragProps}\n className={[\n 'ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-2xs)] ds:rounded-[var(--radius-sm)] ds:px-[var(--spacing-2xs)] ds:py-[var(--spacing-2xs)] ds:transition-colors ds:motion-reduce:transition-none',\n isDragging ? 'ds:opacity-50' : '',\n isDragOver\n ? 'ds:bg-[color:color-mix(in_srgb,var(--primary)_8%,transparent)]'\n : '',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n <Checkbox\n size=\"sm\"\n label={field.label}\n checked={shown}\n onCheckedChange={() => onToggleField(field.id)}\n />\n {shown ? (\n <IconButton\n size=\"sm\"\n intent=\"ghost\"\n icon={<GripVertical aria-hidden=\"true\" />}\n aria-label={t('fieldPicker.reorder', {\n field: field.label,\n defaultValue:\n 'Reorder {{field}}. Press Alt + Up or Alt + Down to move.',\n })}\n aria-keyshortcuts=\"Alt+ArrowUp Alt+ArrowDown Alt+Home Alt+End\"\n className=\"ds:shrink-0 ds:cursor-grab ds:active:cursor-grabbing\"\n onKeyDown={(e) => {\n // Reorder gestures mirror the canonical Sidebar\n // handle: Alt+Arrow (+ Alt+Home / Alt+End). Bare\n // arrows fall through to the browser default.\n if (!e.altKey) return;\n if (e.key === 'ArrowUp') {\n if (visIndex <= 0) return;\n e.preventDefault();\n onMoveFieldOnto(\n field.id,\n orderedVisible[visIndex - 1],\n );\n announceMoved(field.id, visIndex - 1, count);\n } else if (e.key === 'ArrowDown') {\n if (visIndex >= count - 1) return;\n e.preventDefault();\n onMoveFieldOnto(\n field.id,\n orderedVisible[visIndex + 1],\n );\n announceMoved(field.id, visIndex + 1, count);\n } else if (e.key === 'Home') {\n if (visIndex <= 0) return;\n e.preventDefault();\n onMoveFieldOnto(field.id, orderedVisible[0]);\n announceMoved(field.id, 0, count);\n } else if (e.key === 'End') {\n if (visIndex >= count - 1) return;\n e.preventDefault();\n onMoveFieldOnto(\n field.id,\n orderedVisible[count - 1],\n );\n announceMoved(field.id, count - 1, count);\n }\n }}\n />\n ) : null}\n </li>\n );\n })}\n </ul>\n </div>\n );\n })}\n <Separator orientation=\"horizontal\" />\n <Button type=\"button\" size=\"sm\" intent=\"ghost\" onClick={onReset}>\n {t('fieldPicker.reset', { defaultValue: 'Reset to defaults' })}\n </Button>\n </div>\n {/* Reorder announcements for assistive tech (drag drop + arrow keys). */}\n <span role=\"status\" className=\"ds:sr-only\">\n {announcement}\n </span>\n </Popover.Content>\n </Popover.Root>\n );\n}\n","import { cloneElement, type ReactElement, type ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { CalendarDays, Hash, Hourglass, Mars, User, Venus } from 'lucide-react';\nimport { Badge } from '../badge/badge';\nimport { Link } from '../link/link';\nimport { TransactionChip } from '../transaction-chip/transaction-chip';\nimport type { PatientField } from './patient-fields';\n\n/* -------------------------------------------------------------------- */\n/* FieldValue — the canonical field-chip registry */\n/* */\n/* Renders ONE patient field's value slot. When the consumer supplies an */\n/* explicit `value` (legacy rows, per-placement overrides) it wins */\n/* verbatim. Otherwise `kind` selects the canonical chip and the raw */\n/* datum is read from `editValue`, so a known field type looks the same */\n/* on every surface (PatientSummaryCard + PatientDetails share this). */\n/* */\n/* The per-type chips (`SexChip` / `AgeChip` / `NeutralChip`) are exported */\n/* so the PatientSummaryCard identity line renders the SAME chips under */\n/* the name. */\n/* */\n/* Pure composition over already-marked kit primitives (Badge / */\n/* TransactionChip) — it mounts no surface of its own, so it carries no */\n/* `data-component` (allowlisted in check-data-component-coverage.mjs). */\n/* -------------------------------------------------------------------- */\n\n// The neutral Badge's own text colour (`--muted-foreground`) is too low\n// contrast for primary demographic data — grey text on the grey pill reads at\n// ~5.8:1. The chip label + glyph are pinned to `--foreground` (~11:1) so the\n// data stays legible on every theme.\nconst STRONG = 'ds:text-[color:var(--foreground)]';\n\n/** Default English labels — real translations live under `patientField.*`. */\nconst SEX_LABEL_DEFAULT: Record<string, string> = {\n m: 'Male',\n f: 'Female',\n x: 'Other',\n};\n\n/** A neutral pill with high-contrast text + an optional leading glyph. */\nexport function NeutralChip({\n icon,\n mono,\n children,\n}: {\n icon?: ReactElement;\n mono?: boolean;\n children: ReactNode;\n}): ReactNode {\n return (\n <Badge\n variant=\"neutral\"\n className={mono ? 'ds:font-mono' : undefined}\n // Clone the glyph (don't wrap it) so it stays Badge's DIRECT <svg> child —\n // Badge's `[&>svg]:size-*` rule only sizes a direct child, so wrapping it\n // left the glyph at lucide's default 24px. The clone also carries `STRONG`.\n leading={\n icon\n ? cloneElement(icon as ReactElement<{ className?: string }>, {\n className: STRONG,\n })\n : undefined\n }\n >\n <span className={STRONG}>{children}</span>\n </Badge>\n );\n}\n\n/** Sex chip — Venus / Mars / User glyph + localised label. Female / male carry a\n * tonal pink / blue FILL; unspecified stays the neutral pill. */\nexport function SexChip({ code }: { code: string }): ReactNode {\n const { t } = useTranslation();\n const c = code.toLowerCase();\n const label = t(`patientField.sex.${c}`, {\n defaultValue: SEX_LABEL_DEFAULT[c] ?? code,\n });\n // The fill carries the colour; Badge sizes + tones the glyph from the variant.\n // `accentSoft` is the kit's tonal magenta (≈ pink); `info` the tonal indigo\n // (≈ blue, the closest the closed palette has to blue). Other → neutral.\n if (c === 'f') {\n return (\n <Badge variant=\"accentSoft\" leading={<Venus />}>\n {label}\n </Badge>\n );\n }\n if (c === 'm') {\n return (\n <Badge variant=\"info\" leading={<Mars />}>\n {label}\n </Badge>\n );\n }\n return <NeutralChip icon={<User />}>{label}</NeutralChip>;\n}\n\n/** Age chip — hourglass glyph + localised, pluralised age. */\nexport function AgeChip({ years }: { years: number }): ReactNode {\n const { t } = useTranslation();\n return (\n <NeutralChip icon={<Hourglass />}>\n {t('patientField.age', {\n count: years,\n defaultValue: '{{count}} years old',\n })}\n </NeutralChip>\n );\n}\n\nexport function FieldValue({ field }: { field: PatientField }): ReactNode {\n const { i18n } = useTranslation();\n\n // Contact kinds render as a mailto:/tel: Link — the display string is read\n // from `value` (or `editValue`), the href is derived from it. Checked BEFORE\n // the explicit-value short-circuit so a plain-string `value` still links.\n if (field.kind === 'email' || field.kind === 'phone') {\n const display =\n typeof field.value === 'string'\n ? field.value\n : (field.copyText ??\n (typeof field.editValue === 'string' ? field.editValue : ''));\n if (display) {\n // mailto: trims surrounding whitespace; tel: keeps only `+` and digits\n // (dialler-safe), leaving the formatted text as the visible label.\n const href =\n field.kind === 'email'\n ? `mailto:${display.trim()}`\n : `tel:${display.replace(/[^+\\d]/g, '')}`;\n return <Link href={href}>{display}</Link>;\n }\n // No string to link — fall through to any explicit node value below.\n }\n\n // An explicit value always wins — legacy rows + per-placement overrides.\n if (field.value != null) {\n return <>{field.value}</>;\n }\n if (!field.kind) {\n return null;\n }\n\n switch (field.kind) {\n case 'sex':\n return <SexChip code={String(field.editValue ?? '')} />;\n case 'age': {\n const years =\n typeof field.editValue === 'number'\n ? field.editValue\n : Number(field.editValue);\n if (!Number.isFinite(years)) {\n return null;\n }\n return <AgeChip years={years} />;\n }\n case 'dob': {\n const raw = field.editValue;\n const date = raw instanceof Date ? raw : new Date(String(raw ?? ''));\n const formatted = Number.isNaN(date.getTime())\n ? String(raw ?? '')\n : new Intl.DateTimeFormat(i18n.language, {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n }).format(date);\n if (!formatted) {\n return null;\n }\n return <NeutralChip icon={<CalendarDays />}>{formatted}</NeutralChip>;\n }\n case 'fiscalCode': {\n // Copy + PHI lock stay the consumer's row-level affordance (PatientDetails\n // renders them from `copyable` / `sensitive`); the chip is the mono pill.\n const code =\n field.copyText ??\n (typeof field.editValue === 'string' ? field.editValue : '');\n if (!code) {\n return null;\n }\n return (\n <NeutralChip icon={<Hash />} mono>\n {code}\n </NeutralChip>\n );\n }\n case 'discount': {\n // The canonical monetary discount chip — magnitude + currency, the sign\n // (\"−\") and glyph owned by TransactionChip. The row label gives context,\n // so the chip itself shows only the amount (no duplicate state label).\n const amount =\n typeof field.editValue === 'number'\n ? field.editValue\n : Number(field.editValue);\n if (!Number.isFinite(amount)) {\n return null;\n }\n return (\n <TransactionChip\n state=\"discount\"\n amount={Math.abs(amount)}\n currency={field.currency}\n size=\"sm\"\n />\n );\n }\n default:\n return null;\n }\n}\n"],"names":["__iconNode","Hourglass","createLucideIcon","Mars","Venus","patientFieldCatalogue","sections","s","f","resolveVisibleFields","visibleFieldOrder","order","orderIndex","id","index","section","field","a","b","usePatientFieldVisibility","value","defaultValue","onChange","catalogueIds","useMemo","orderState","setOrderState","useControllableState","visible","fieldById","map","setOrder","useCallback","next","fid","toggleField","fieldId","toggleSection","sectionId","show","sectionIds","_a","sectionSet","missing","moveFieldOnto","fromId","toId","fromSection","toSection","_b","_c","siblings","fromIdx","toIdx","moved","k","reset","FieldVisibilityCog","onToggleField","onToggleSection","onMoveFieldOnto","onReset","label","t","useTranslation","visibleSet","draggingId","setDraggingId","useState","dragOverId","setDragOverId","announcement","setAnnouncement","sectionOfField","labelOfField","sectionMap","labelMap","draggingSectionId","clearDrag","announceMoved","newIndex","count","jsxs","Popover","jsx","IconButton","Settings","fieldIds","shownCount","orderedVisible","sectionState","named","Checkbox","checked","shown","visIndex","isDragging","isDragOver","e","prev","GripVertical","Separator","Button","STRONG","SEX_LABEL_DEFAULT","NeutralChip","icon","mono","children","Badge","cloneElement","SexChip","code","c","User","AgeChip","years","FieldValue","i18n","display","href","Link","Fragment","raw","date","formatted","CalendarDays","Hash","amount","TransactionChip"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAAA,EACzC,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAAA,EACxC;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AAAA,EACE;AAAA,IACE;AAAA,IACA,EAAE,GAAG,0EAA0E,KAAK,SAAQ;AAAA,EAChG;AACA,GACMC,KAAYC,EAAiB,aAAaF,EAAU;ACxB1D;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,aAAa,KAAK,SAAQ,CAAE;AAAA,EAC1C,CAAC,QAAQ,EAAE,GAAG,mBAAmB,KAAK,SAAQ,CAAE;AAAA,EAChD,CAAC,UAAU,EAAE,IAAI,MAAM,IAAI,MAAM,GAAG,KAAK,KAAK,SAAQ,CAAE;AAC1D,GACMG,KAAOD,EAAiB,QAAQF,EAAU;ACdhD;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,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AAK,OAAO,SAASgH,CAAM,IAIzB,gBAAA5C;AAAA,QAAC6C;AAAA,QAAA;AAAA,UACC,OAAM;AAAA,UACN,QAAQ,KAAK,IAAID,CAAM;AAAA,UACvB,UAAUhH,EAAM;AAAA,UAChB,MAAK;AAAA,QAAA;AAAA,MAAA,IAPA;AAAA,IAUX;AAAA,IACA;AACE,aAAO;AAAA,EAAA;AAEb;","x_google_ignoreList":[0,1,2]}
@@ -3,11 +3,11 @@ import { useMemo as O, useState as te, useRef as ee, useEffect as ne, useId as P
3
3
  import { c as Ve } from "./index-D2ZczOXr.js";
4
4
  import { useTranslation as J } from "react-i18next";
5
5
  import { B as kt, b as He, c as ge } from "./breadcrumb-agut0PwN.js";
6
- import { E as Mt } from "./empty-state-Df0tM6Kn.js";
6
+ import { E as Mt } from "./empty-state-X0sVPfVo.js";
7
7
  import { S as he } from "./skeleton-CZbwyJAA.js";
8
8
  import { u as Ct } from "./use-controllable-state-BiY4xTzM.js";
9
9
  import { u as wt } from "./registry-DvAUVLHh.js";
10
- import { B as X } from "./button-BvNtqHAS.js";
10
+ import { B as X } from "./button-nJaPh_HC.js";
11
11
  import { D as m } from "./dialog-UbKJCi1X.js";
12
12
  import { a as St, F as xt } from "./file-upload-CwxdqkMK.js";
13
13
  import { T as We } from "./text-input-CUvCb6ST.js";
@@ -16,15 +16,15 @@ import { F as Nt, a as Tt } from "./file-Cwe9VC1A.js";
16
16
  import { F as Ft } from "./file-text-5yv6r2ls.js";
17
17
  import { F as At } from "./file-spreadsheet-DmwyfV4O.js";
18
18
  import { C as Dt } from "./chevron-right-I9AeSxH2.js";
19
- import { A as Rt, d as It, D as Te } from "./actions-cell-renderer-BD-jruqA.js";
19
+ import { A as Rt, d as It, D as Te } from "./actions-cell-renderer-ALEAGO3j.js";
20
20
  import { B as $e } from "./badge-sTusUqZD.js";
21
21
  import { D as Ge } from "./download-CfYKJO_j.js";
22
22
  import { P as zt } from "./pen-line-D0De5zdl.js";
23
23
  import { S as Ue } from "./share-2-B49jcW2I.js";
24
24
  import { P as Ye } from "./pencil-B1sKKyuT.js";
25
25
  import { T as Ze } from "./trash-2-uumy3fy1.js";
26
- import { I as Q } from "./icon-button-9c9Gp41m.js";
27
- import { I as _t } from "./icon-button-group-DrvuWPGJ.js";
26
+ import { I as Q } from "./icon-button-DA2CAGHZ.js";
27
+ import { I as _t } from "./icon-button-group-D6SVMteH.js";
28
28
  import { U as Xe } from "./upload-BfT2hzMg.js";
29
29
  import { P as Lt } from "./plus-DzMQ_c6b.js";
30
30
  /**
@@ -1756,4 +1756,4 @@ export {
1756
1756
  yn as F,
1757
1757
  Gt as f
1758
1758
  };
1759
- //# sourceMappingURL=file-manager-CML_C6_h.js.map
1759
+ //# sourceMappingURL=file-manager-Cc_upjZX.js.map