@alfadocs/ui-kit 0.69.0 → 0.71.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 (425) hide show
  1. package/dist/_chunks/address-fields-CPbFJ8e8.js +246 -0
  2. package/dist/_chunks/{agenda-card-BxSFkqgY.js → agenda-card-BQ-IKAru.js} +2 -2
  3. package/dist/_chunks/{agenda-tray-g0kg7HwB.js → agenda-tray-CGXRk58j.js} +2 -2
  4. package/dist/_chunks/{ai-consent-banner-CXlsNX1c.js → ai-consent-banner-Be-h9mRI.js} +3 -3
  5. package/dist/_chunks/{ai-prompt-input-CuhTo9mh.js → ai-prompt-input-V4DdOeqv.js} +2 -2
  6. package/dist/_chunks/{alert-_mUKLmwA.js → alert-CHYZ96tR.js} +150 -96
  7. package/dist/_chunks/{alia-sidebar-B47qRQb5.js → alia-sidebar-DvIUzIX9.js} +107 -106
  8. package/dist/_chunks/{anamnesis-card-DRmE24OQ.js → anamnesis-card-DvYCa16e.js} +2 -2
  9. package/dist/_chunks/anatomy-scheme-CXSk11UJ.js +2445 -0
  10. package/dist/_chunks/annotation-marker-qt5R9WZX.js +120 -0
  11. package/dist/_chunks/{antenatal-schedule-timeline-35ebkcZT.js → antenatal-schedule-timeline-CwXrQRm1.js} +2 -2
  12. package/dist/_chunks/{app-frame-BYx1gcV7.js → app-frame-DIEMIC5V.js} +67 -56
  13. package/dist/_chunks/appointment-card-DVaeJNVB.js +294 -0
  14. package/dist/_chunks/appointment-timeline-PJgnrjFb.js +388 -0
  15. package/dist/_chunks/appointment-tray-B16QPGbm.js +193 -0
  16. package/dist/_chunks/{audio-recorder-DYXXnGug.js → audio-recorder-DNDsOLqO.js} +3 -3
  17. package/dist/_chunks/{autocomplete-DOeGouCL.js → autocomplete-BrONKN8l.js} +168 -146
  18. package/dist/_chunks/{badge-CqGsX32l.js → badge-DCOqV9mI.js} +32 -27
  19. package/dist/_chunks/{bishop-score-PJI3AXzA.js → bishop-score-Cym_TeQY.js} +3 -3
  20. package/dist/_chunks/{bmi-calculator-BZtIJ53x.js → bmi-calculator-zjeY4E7J.js} +2 -2
  21. package/dist/_chunks/{booking-C3VqFReX.js → booking-C7do4vaR.js} +7 -7
  22. package/dist/_chunks/{button-group-Ciq6J4IW.js → button-group-CvEnVzY7.js} +32 -35
  23. package/dist/_chunks/{care-plan-card-CvFGXa2z.js → care-plan-card-DzPDYgtK.js} +5 -5
  24. package/dist/_chunks/{care-plan-entry-card-C3E_gClk.js → care-plan-entry-card-CEnQy7YP.js} +5 -5
  25. package/dist/_chunks/care-plan-header-DcXFXWit.js +198 -0
  26. package/dist/_chunks/{chat-message-3V54YipB.js → chat-message-DzpcJR-q.js} +25 -23
  27. package/dist/_chunks/city-input-Dkgaak7I.js +169 -0
  28. package/dist/_chunks/clinical-note-card-BUvNMNGL.js +436 -0
  29. package/dist/_chunks/clipboard-list-S7s-MXQq.js +25 -0
  30. package/dist/_chunks/{combobox-Clum7gJ1.js → combobox-DnqSF0IH.js} +131 -114
  31. package/dist/_chunks/connection-status-CY1HV8Wg.js +108 -0
  32. package/dist/_chunks/{contact-profile-card-Dramqa9C.js → contact-profile-card-DDPwRFiP.js} +2 -2
  33. package/dist/_chunks/control-room-rail-FAQZrGVL.js +333 -0
  34. package/dist/_chunks/country-select-BwUZQvTa.js +709 -0
  35. package/dist/_chunks/{cycle-calculator-DmRGJNaT.js → cycle-calculator-CCmPwcBl.js} +2 -2
  36. package/dist/_chunks/{dependent-selector-CG_FOHya.js → dependent-selector-DUV4thxX.js} +2 -2
  37. package/dist/_chunks/{document-scanner-CTubA0-N.js → document-scanner-C_AxLooF.js} +3 -3
  38. package/dist/_chunks/{due-date-calculator-BTmsIQqD.js → due-date-calculator-Brdj-euS.js} +3 -3
  39. package/dist/_chunks/editable-currency-cell-renderer-CGELrkIj.js +410 -0
  40. package/dist/_chunks/email-input-DJ7EXklP.js +397 -0
  41. package/dist/_chunks/{entity-card-COhmqHly.js → entity-card-DmrgYSEX.js} +38 -20
  42. package/dist/_chunks/entity-summary-CaM1Y-xE.js +291 -0
  43. package/dist/_chunks/{fetal-weight-CRz7KE2D.js → fetal-weight-DNCkyeVo.js} +2 -2
  44. package/dist/_chunks/field-array-siUZzfYe.js +146 -0
  45. package/dist/_chunks/field-value-3jMM0uDx.js +415 -0
  46. package/dist/_chunks/{file-upload-5ScQd4fE.js → file-upload-DwZcAK8D.js} +2 -1
  47. package/dist/_chunks/{freemium-paywall-DZ2mBS3w.js → freemium-paywall-WYlNO7yT.js} +2 -2
  48. package/dist/_chunks/{gestational-age-calculator-BleUdhbI.js → gestational-age-calculator-DKzEV5Qi.js} +4 -4
  49. package/dist/_chunks/hash-CysBBS_N.js +17 -0
  50. package/dist/_chunks/{hcg-doubling-CnjDXX6U.js → hcg-doubling-C7bmuaU3.js} +2 -2
  51. package/dist/_chunks/iban-input-B0TWzR1R.js +436 -0
  52. package/dist/_chunks/icon-picker-0B7KhrF1.js +272 -0
  53. package/dist/_chunks/image-cropper-D9jqJy19.js +367 -0
  54. package/dist/_chunks/{actions-cell-renderer-DrcaxB0w.js → link-cell-renderer-De_SLjSq.js} +792 -668
  55. package/dist/_chunks/list-checks-BUs75d_o.js +18 -0
  56. package/dist/_chunks/lock-CKOIn0IK.js +15 -0
  57. package/dist/_chunks/{marketplace-app-shell-6T9W4Knl.js → marketplace-app-shell-BGqkywsi.js} +5 -5
  58. package/dist/_chunks/message-card-DsHFFiL1.js +319 -0
  59. package/dist/_chunks/{message-tray-DwrBLJlf.js → message-tray-C0a6CL1_.js} +172 -135
  60. package/dist/_chunks/{multi-select-BdHHDrRN.js → multi-select-WE4S9FIF.js} +75 -63
  61. package/dist/_chunks/nav-grid-9xphY3FM.js +169 -0
  62. package/dist/_chunks/notes-panel-DXiMfuvp.js +320 -0
  63. package/dist/_chunks/notification-card-BMqNzCIt.js +290 -0
  64. package/dist/_chunks/{notification-tray-Btb9oQeZ.js → notification-tray-BmUlCx3g.js} +201 -166
  65. package/dist/_chunks/{operator-hero-CP2Nhupm.js → operator-hero-BO8TqzX2.js} +3 -3
  66. package/dist/_chunks/panel-header-D313n_9-.js +105 -0
  67. package/dist/_chunks/patient-details-DgfTJimE.js +759 -0
  68. package/dist/_chunks/{patient-search-CBC_ySF6.js → patient-search-CSWQKOSP.js} +3 -3
  69. package/dist/_chunks/{patient-shell-DV3XEtIB.js → patient-shell-BMwsIKlW.js} +3 -3
  70. package/dist/_chunks/patient-summary-card-D4NdgYJB.js +452 -0
  71. package/dist/_chunks/patient-table-CERknpd8.js +1110 -0
  72. package/dist/_chunks/{payment-form-DvjwYVIT.js → payment-form-CxqIXqw7.js} +2 -2
  73. package/dist/_chunks/{payment-request-card-DioWKBUq.js → payment-request-card-Blf-MFNY.js} +125 -136
  74. package/dist/_chunks/{pdf-viewer-D6BPfW2D.js → pdf-viewer-QfebdLOd.js} +192 -214
  75. package/dist/_chunks/{periodontal-chart-card-BuDEMbHE.js → periodontal-chart-card-hRRJY1NN.js} +2 -2
  76. package/dist/_chunks/permission-matrix-Bw5oexUt.js +174 -0
  77. package/dist/_chunks/position-grid-CcvqHaKN.js +169 -0
  78. package/dist/_chunks/postal-code-input-UCOYuRY2.js +192 -0
  79. package/dist/_chunks/{practice-results-KrTHqZua.js → practice-results-El5Z-oVp.js} +4 -4
  80. package/dist/_chunks/{pregnancy-dating-DORUAOHB.js → pregnancy-dating-CunHrOpO.js} +4 -4
  81. package/dist/_chunks/{pregnancy-weight-gain-DVz4rr7-.js → pregnancy-weight-gain-BUNpTsH-.js} +2 -2
  82. package/dist/_chunks/{product-hub-panel-e6pW220e.js → product-hub-panel-DtU7KXxm.js} +257 -217
  83. package/dist/_chunks/province-select-D_TZvix3.js +261 -0
  84. package/dist/_chunks/{public-header.agent-DqkqA-ca.js → public-header.agent-TxmC_x1I.js} +2 -2
  85. package/dist/_chunks/radiograph-panel.agent-tWjN2nHX.js +553 -0
  86. package/dist/_chunks/reviews-panel-DxkSrgMl.js +559 -0
  87. package/dist/_chunks/rich-text-editor-C8tyGjfb.js +2621 -0
  88. package/dist/_chunks/{scroll-area-5wNK0Cyz.js → scroll-area-BZOvUhwQ.js} +2 -2
  89. package/dist/_chunks/{select-DMLG44F5.js → select-KsyRr8WH.js} +114 -102
  90. package/dist/_chunks/{sheet-BxsE7eQm.js → sheet-umkfZjF6.js} +53 -42
  91. package/dist/_chunks/{sidebar-DY9jGjgt.js → sidebar-QCp9wHNP.js} +125 -113
  92. package/dist/_chunks/{sign-document-B4DeRhTe.js → sign-document-By6hMOra.js} +2 -2
  93. package/dist/_chunks/{stepper-accordion-Dki6r9ZE.js → stepper-accordion-DC-H-8v4.js} +38 -48
  94. package/dist/_chunks/tab-bar-Bv9nGNdO.js +262 -0
  95. package/dist/_chunks/{tabs-BxcOziCo.js → tabs-CYZVKKDl.js} +2 -2
  96. package/dist/_chunks/task-card-DCdsI0ZT.js +189 -0
  97. package/dist/_chunks/{task-tray-qOEQflu4.js → task-tray-DNVejijD.js} +2 -2
  98. package/dist/_chunks/tasks-panel-C9odmawT.js +757 -0
  99. package/dist/_chunks/token-insert-menu-CFQqTe_n.js +147 -0
  100. package/dist/_chunks/tool-rail-BZx0-yIr.js +524 -0
  101. package/dist/_chunks/tooth-scheme-DJZtzfeY.js +2133 -0
  102. package/dist/_chunks/{transaction-chip-DK84XCBU.js → transaction-chip-CscoQbxF.js} +88 -61
  103. package/dist/_chunks/{transcript-panel-3THQX6nJ.js → transcript-panel-CHGHHHdT.js} +95 -83
  104. package/dist/_chunks/{unit-converter-YEpD9evj.js → unit-converter-CwlZbfdn.js} +2 -2
  105. package/dist/_chunks/use-clamp-overflow-DQE2kwZ9.js +20 -0
  106. package/dist/_chunks/use-overflow-collapse-BIOzKbni.js +32 -0
  107. package/dist/_chunks/use-persistent-state-nZwZAnE9.js +24 -0
  108. package/dist/_chunks/{warning-stack-BsgaEbL8.js → warning-stack--sTrrBDA.js} +86 -101
  109. package/dist/_chunks/{workflow-map-Bdam9pGp.js → workflow-map-M8MBBHQm.js} +107 -119
  110. package/dist/_chunks/zoom-out-CgVtf2Wx.js +29 -0
  111. package/dist/agent/index.js +5 -4
  112. package/dist/agent/types.d.ts +19 -2
  113. package/dist/agent-catalog.json +3325 -322
  114. package/dist/agent-i18n/en.json +314 -14
  115. package/dist/components/_shared/entity-card/entity-card.d.ts +6 -0
  116. package/dist/components/_shared/entity-card/index.d.ts +1 -1
  117. package/dist/components/_shared/field-value.d.ts +21 -0
  118. package/dist/components/_shared/field-visibility-cog.d.ts +20 -0
  119. package/dist/components/_shared/field-visibility.d.ts +36 -0
  120. package/dist/components/_shared/option.d.ts +2 -0
  121. package/dist/components/_shared/patient-fields.d.ts +119 -0
  122. package/dist/components/address-fields/address-fields.agent.d.ts +9 -0
  123. package/dist/components/address-fields/address-fields.d.ts +29 -0
  124. package/dist/components/address-fields/index.d.ts +5 -0
  125. package/dist/components/address-fields/index.js +6 -0
  126. package/dist/components/agenda-card/index.js +1 -1
  127. package/dist/components/agenda-tray/index.js +1 -1
  128. package/dist/components/ai-consent-banner/index.js +1 -1
  129. package/dist/components/ai-prompt-input/index.js +1 -1
  130. package/dist/components/alert/alert.d.ts +5 -0
  131. package/dist/components/alert/index.js +1 -1
  132. package/dist/components/anamnesis-card/index.js +1 -1
  133. package/dist/components/anatomy-scheme/anatomy-face-paths.d.ts +15 -0
  134. package/dist/components/anatomy-scheme/anatomy-muscle-paths.d.ts +20 -0
  135. package/dist/components/anatomy-scheme/anatomy-scheme-data.d.ts +121 -0
  136. package/dist/components/anatomy-scheme/anatomy-scheme.agent.d.ts +6 -0
  137. package/dist/components/anatomy-scheme/anatomy-scheme.d.ts +69 -0
  138. package/dist/components/anatomy-scheme/index.d.ts +6 -0
  139. package/dist/components/anatomy-scheme/index.js +17 -0
  140. package/dist/components/annotation-marker/annotation-marker.d.ts +33 -0
  141. package/dist/components/annotation-marker/index.d.ts +3 -0
  142. package/dist/components/annotation-marker/index.js +7 -0
  143. package/dist/components/app-frame/app-frame.d.ts +2 -2
  144. package/dist/components/app-frame/index.js +1 -1
  145. package/dist/components/appointment-card/appointment-card.d.ts +25 -1
  146. package/dist/components/appointment-card/index.js +6 -5
  147. package/dist/components/appointment-timeline/appointment-timeline.agent.d.ts +4 -0
  148. package/dist/components/appointment-timeline/appointment-timeline.d.ts +66 -0
  149. package/dist/components/appointment-timeline/index.d.ts +4 -0
  150. package/dist/components/appointment-timeline/index.js +6 -0
  151. package/dist/components/audio-recorder/index.js +1 -1
  152. package/dist/components/autocomplete/autocomplete.d.ts +10 -0
  153. package/dist/components/autocomplete/index.js +1 -1
  154. package/dist/components/badge/badge.d.ts +6 -2
  155. package/dist/components/badge/index.js +1 -1
  156. package/dist/components/bishop-score/index.js +1 -1
  157. package/dist/components/bmi-calculator/index.js +1 -1
  158. package/dist/components/booking/index.js +1 -1
  159. package/dist/components/button-group/index.js +1 -1
  160. package/dist/components/care-plan-card/index.js +1 -1
  161. package/dist/components/care-plan-entry-card/index.js +1 -1
  162. package/dist/components/care-plan-header/care-plan-header.agent.d.ts +4 -0
  163. package/dist/components/care-plan-header/care-plan-header.d.ts +111 -0
  164. package/dist/components/care-plan-header/index.d.ts +4 -0
  165. package/dist/components/care-plan-header/index.js +6 -0
  166. package/dist/components/chat-message/index.js +1 -1
  167. package/dist/components/city-input/city-input.agent.d.ts +8 -0
  168. package/dist/components/city-input/city-input.d.ts +57 -0
  169. package/dist/components/city-input/index.d.ts +5 -0
  170. package/dist/components/city-input/index.js +6 -0
  171. package/dist/components/clinical-note-card/clinical-note-card.d.ts +21 -1
  172. package/dist/components/clinical-note-card/index.js +1 -1
  173. package/dist/components/combobox/combobox.d.ts +17 -0
  174. package/dist/components/combobox/index.js +1 -1
  175. package/dist/components/connection-status/connection-status.agent.d.ts +4 -0
  176. package/dist/components/connection-status/connection-status.d.ts +36 -0
  177. package/dist/components/connection-status/index.d.ts +4 -0
  178. package/dist/components/connection-status/index.js +6 -0
  179. package/dist/components/contact-profile-card/index.js +1 -1
  180. package/dist/components/control-room-rail/control-room-context.d.ts +53 -0
  181. package/dist/components/control-room-rail/control-room-rail.agent.d.ts +4 -0
  182. package/dist/components/control-room-rail/control-room-rail.d.ts +35 -0
  183. package/dist/components/control-room-rail/index.d.ts +6 -0
  184. package/dist/components/control-room-rail/index.js +10 -0
  185. package/dist/components/counter/counter.d.ts +1 -1
  186. package/dist/components/country-select/country-select.agent.d.ts +8 -0
  187. package/dist/components/country-select/country-select.d.ts +51 -0
  188. package/dist/components/country-select/index.d.ts +6 -0
  189. package/dist/components/country-select/index.js +9 -0
  190. package/dist/components/country-select/iso-3166.d.ts +15 -0
  191. package/dist/components/cycle-calculator/index.js +1 -1
  192. package/dist/components/data-table/cell-renderers/actions-cell-renderer.d.ts +18 -0
  193. package/dist/components/data-table/cell-renderers/reorder-cell-renderer.d.ts +34 -0
  194. package/dist/components/data-table/index.d.ts +3 -1
  195. package/dist/components/data-table/index.js +35 -32
  196. package/dist/components/dependent-selector/index.js +1 -1
  197. package/dist/components/document-scanner/index.js +1 -1
  198. package/dist/components/due-date-calculator/index.js +2 -2
  199. package/dist/components/email-input/index.js +1 -1
  200. package/dist/components/entity-summary/entity-summary.agent.d.ts +4 -0
  201. package/dist/components/entity-summary/entity-summary.d.ts +92 -0
  202. package/dist/components/entity-summary/index.d.ts +3 -0
  203. package/dist/components/entity-summary/index.js +5 -0
  204. package/dist/components/fetal-weight/index.js +1 -1
  205. package/dist/components/field-array/field-array.agent.d.ts +4 -0
  206. package/dist/components/field-array/field-array.d.ts +45 -0
  207. package/dist/components/field-array/index.d.ts +4 -0
  208. package/dist/components/field-array/index.js +6 -0
  209. package/dist/components/file-upload/index.js +1 -1
  210. package/dist/components/freemium-paywall/freemium-paywall.d.ts +1 -1
  211. package/dist/components/freemium-paywall/index.js +1 -1
  212. package/dist/components/gestational-age-calculator/index.js +1 -1
  213. package/dist/components/hcg-doubling/index.js +1 -1
  214. package/dist/components/iban-input/iban-input.agent.d.ts +4 -0
  215. package/dist/components/iban-input/iban-input.d.ts +51 -0
  216. package/dist/components/iban-input/index.d.ts +5 -0
  217. package/dist/components/iban-input/index.js +13 -0
  218. package/dist/components/iban-input/is-valid-iban.d.ts +31 -0
  219. package/dist/components/icon-picker/icon-picker.agent.d.ts +4 -0
  220. package/dist/components/icon-picker/icon-picker.d.ts +41 -0
  221. package/dist/components/icon-picker/index.d.ts +4 -0
  222. package/dist/components/icon-picker/index.js +6 -0
  223. package/dist/components/image-cropper/crop-geometry.d.ts +30 -0
  224. package/dist/components/image-cropper/image-cropper.agent.d.ts +4 -0
  225. package/dist/components/image-cropper/image-cropper.d.ts +32 -0
  226. package/dist/components/image-cropper/index.d.ts +5 -0
  227. package/dist/components/image-cropper/index.js +11 -0
  228. package/dist/components/index.d.ts +25 -1
  229. package/dist/components/message-card/index.js +1 -1
  230. package/dist/components/message-card/message-card.d.ts +14 -0
  231. package/dist/components/message-tray/index.js +1 -1
  232. package/dist/components/message-tray/message-tray.d.ts +4 -0
  233. package/dist/components/multi-select/index.js +1 -1
  234. package/dist/components/nav-grid/index.d.ts +4 -0
  235. package/dist/components/nav-grid/index.js +7 -0
  236. package/dist/components/nav-grid/nav-grid.agent.d.ts +4 -0
  237. package/dist/components/nav-grid/nav-grid.d.ts +41 -0
  238. package/dist/components/notes-panel/index.d.ts +3 -0
  239. package/dist/components/notes-panel/index.js +5 -0
  240. package/dist/components/notes-panel/notes-panel.agent.d.ts +4 -0
  241. package/dist/components/notes-panel/notes-panel.d.ts +94 -0
  242. package/dist/components/notification-card/index.js +1 -1
  243. package/dist/components/notification-card/notification-card.d.ts +15 -0
  244. package/dist/components/notification-tray/index.js +1 -1
  245. package/dist/components/notification-tray/notification-tray.d.ts +4 -0
  246. package/dist/components/operator-hero/index.js +1 -1
  247. package/dist/components/panel-header/index.d.ts +3 -0
  248. package/dist/components/panel-header/index.js +7 -0
  249. package/dist/components/panel-header/panel-header.d.ts +41 -0
  250. package/dist/components/patient-details/index.d.ts +5 -0
  251. package/dist/components/patient-details/index.js +6 -0
  252. package/dist/components/patient-details/patient-details.agent.d.ts +4 -0
  253. package/dist/components/patient-details/patient-details.d.ts +96 -0
  254. package/dist/components/patient-search/index.js +1 -1
  255. package/dist/components/patient-summary-card/index.js +1 -1
  256. package/dist/components/patient-summary-card/patient-summary-card.d.ts +40 -1
  257. package/dist/components/patient-table/columns.d.ts +69 -40
  258. package/dist/components/patient-table/index.d.ts +2 -6
  259. package/dist/components/patient-table/index.js +8 -9
  260. package/dist/components/patient-table/patient-table.d.ts +38 -4
  261. package/dist/components/patient-table/types.d.ts +52 -2
  262. package/dist/components/patient-table/use-responsive-columns.d.ts +8 -6
  263. package/dist/components/payment-card/index.js +1 -1
  264. package/dist/components/payment-form/index.js +1 -1
  265. package/dist/components/pdf-viewer/index.js +1 -1
  266. package/dist/components/periodontal-chart-card/index.js +1 -1
  267. package/dist/components/permission-matrix/index.d.ts +4 -0
  268. package/dist/components/permission-matrix/index.js +7 -0
  269. package/dist/components/permission-matrix/permission-matrix.agent.d.ts +4 -0
  270. package/dist/components/permission-matrix/permission-matrix.d.ts +47 -0
  271. package/dist/components/position-grid/index.d.ts +4 -0
  272. package/dist/components/position-grid/index.js +7 -0
  273. package/dist/components/position-grid/position-grid.agent.d.ts +4 -0
  274. package/dist/components/position-grid/position-grid.d.ts +39 -0
  275. package/dist/components/postal-code-input/index.d.ts +5 -0
  276. package/dist/components/postal-code-input/index.js +6 -0
  277. package/dist/components/postal-code-input/postal-code-input.agent.d.ts +8 -0
  278. package/dist/components/postal-code-input/postal-code-input.d.ts +27 -0
  279. package/dist/components/practice-results/index.js +1 -1
  280. package/dist/components/pregnancy-dating/index.js +1 -1
  281. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  282. package/dist/components/product-hub-tray/index.js +1 -1
  283. package/dist/components/product-hub-tray/product-hub-tray.d.ts +13 -1
  284. package/dist/components/province-select/index.d.ts +6 -0
  285. package/dist/components/province-select/index.js +7 -0
  286. package/dist/components/province-select/it-provinces.d.ts +8 -0
  287. package/dist/components/province-select/province-select.agent.d.ts +8 -0
  288. package/dist/components/province-select/province-select.d.ts +38 -0
  289. package/dist/components/public-footer/public-footer.d.ts +1 -1
  290. package/dist/components/public-header/index.js +1 -1
  291. package/dist/components/radiograph-panel/index.d.ts +4 -0
  292. package/dist/components/radiograph-panel/index.js +7 -0
  293. package/dist/components/radiograph-panel/radiograph-panel.agent.d.ts +13 -0
  294. package/dist/components/radiograph-panel/radiograph-panel.d.ts +36 -0
  295. package/dist/components/reviews-panel/index.js +1 -1
  296. package/dist/components/rich-text-editor/editor-toolbar.d.ts +17 -0
  297. package/dist/components/rich-text-editor/index.js +1 -1
  298. package/dist/components/scroll-area/index.js +1 -1
  299. package/dist/components/select/index.js +1 -1
  300. package/dist/components/select/select.d.ts +8 -2
  301. package/dist/components/sheet/index.js +1 -1
  302. package/dist/components/sidebar/index.js +2 -2
  303. package/dist/components/sign-document/index.js +1 -1
  304. package/dist/components/skeleton/skeleton.d.ts +1 -1
  305. package/dist/components/stepper-accordion/index.js +1 -1
  306. package/dist/components/tab-bar/index.js +1 -1
  307. package/dist/components/tab-bar/tab-bar.d.ts +18 -1
  308. package/dist/components/tabs/index.js +1 -1
  309. package/dist/components/task-card/index.js +1 -1
  310. package/dist/components/task-card/task-card.d.ts +14 -6
  311. package/dist/components/task-tray/index.js +1 -1
  312. package/dist/components/tasks-panel/index.d.ts +4 -0
  313. package/dist/components/tasks-panel/index.js +6 -0
  314. package/dist/components/tasks-panel/tasks-panel.agent.d.ts +4 -0
  315. package/dist/components/tasks-panel/tasks-panel.d.ts +152 -0
  316. package/dist/components/token-insert-menu/index.d.ts +4 -0
  317. package/dist/components/token-insert-menu/index.js +6 -0
  318. package/dist/components/token-insert-menu/token-insert-menu.agent.d.ts +4 -0
  319. package/dist/components/token-insert-menu/token-insert-menu.d.ts +33 -0
  320. package/dist/components/tool-rail/index.d.ts +4 -0
  321. package/dist/components/tool-rail/index.js +6 -0
  322. package/dist/components/tool-rail/tool-rail.agent.d.ts +4 -0
  323. package/dist/components/tool-rail/tool-rail.d.ts +160 -0
  324. package/dist/components/tooth-scheme/index.d.ts +2 -2
  325. package/dist/components/tooth-scheme/index.js +30 -23
  326. package/dist/components/tooth-scheme/tooth-data.d.ts +112 -1
  327. package/dist/components/tooth-scheme/tooth-scheme.agent.d.ts +2 -2
  328. package/dist/components/tooth-scheme/tooth-scheme.d.ts +84 -11
  329. package/dist/components/transaction-chip/index.js +1 -1
  330. package/dist/components/transaction-chip/transaction-chip.d.ts +2 -2
  331. package/dist/components/transcript-panel/index.js +1 -1
  332. package/dist/components/transcript-panel/transcript-panel.d.ts +2 -2
  333. package/dist/components/unit-converter/index.js +1 -1
  334. package/dist/components/warning-stack/index.js +1 -1
  335. package/dist/components/warning-stack/warning-stack.d.ts +10 -7
  336. package/dist/components/workflow/index.js +1 -1
  337. package/dist/hooks/index.d.ts +1 -0
  338. package/dist/hooks/index.js +24 -22
  339. package/dist/hooks/use-clamp-overflow.d.ts +19 -0
  340. package/dist/hooks/use-edge-resize.d.ts +2 -2
  341. package/dist/hooks/use-overflow-collapse.d.ts +46 -0
  342. package/dist/hooks/use-persistent-state.d.ts +7 -1
  343. package/dist/hooks/use-scroll-overflow.d.ts +36 -0
  344. package/dist/i18n/locales/ar.d.ts +475 -26
  345. package/dist/i18n/locales/ar.js +478 -31
  346. package/dist/i18n/locales/de.d.ts +475 -26
  347. package/dist/i18n/locales/de.js +480 -31
  348. package/dist/i18n/locales/el.d.ts +475 -26
  349. package/dist/i18n/locales/el.js +485 -31
  350. package/dist/i18n/locales/en.d.ts +476 -34
  351. package/dist/i18n/locales/en.js +492 -39
  352. package/dist/i18n/locales/es.d.ts +475 -26
  353. package/dist/i18n/locales/es.js +477 -31
  354. package/dist/i18n/locales/fr.d.ts +475 -26
  355. package/dist/i18n/locales/fr.js +480 -31
  356. package/dist/i18n/locales/hi.d.ts +475 -26
  357. package/dist/i18n/locales/hi.js +476 -31
  358. package/dist/i18n/locales/it.d.ts +475 -26
  359. package/dist/i18n/locales/it.js +480 -31
  360. package/dist/i18n/locales/ja.d.ts +475 -26
  361. package/dist/i18n/locales/ja.js +481 -31
  362. package/dist/i18n/locales/nl.d.ts +475 -26
  363. package/dist/i18n/locales/nl.js +473 -31
  364. package/dist/i18n/locales/pl.d.ts +475 -26
  365. package/dist/i18n/locales/pl.js +481 -31
  366. package/dist/i18n/locales/pt.d.ts +475 -26
  367. package/dist/i18n/locales/pt.js +485 -31
  368. package/dist/i18n/locales/ro.d.ts +475 -26
  369. package/dist/i18n/locales/ro.js +485 -31
  370. package/dist/i18n/locales/ru.d.ts +475 -26
  371. package/dist/i18n/locales/ru.js +478 -31
  372. package/dist/i18n/locales/sq.d.ts +475 -26
  373. package/dist/i18n/locales/sq.js +482 -31
  374. package/dist/i18n/locales/sv.d.ts +475 -26
  375. package/dist/i18n/locales/sv.js +480 -31
  376. package/dist/i18n/locales/tr.d.ts +475 -26
  377. package/dist/i18n/locales/tr.js +478 -31
  378. package/dist/i18n/locales/zh.d.ts +475 -26
  379. package/dist/i18n/locales/zh.js +473 -31
  380. package/dist/index.js +826 -709
  381. package/dist/locales/ar.json +480 -31
  382. package/dist/locales/de.json +480 -31
  383. package/dist/locales/el.json +480 -31
  384. package/dist/locales/en.json +480 -31
  385. package/dist/locales/es.json +480 -31
  386. package/dist/locales/fr.json +480 -31
  387. package/dist/locales/hi.json +480 -31
  388. package/dist/locales/it.json +480 -31
  389. package/dist/locales/ja.json +480 -31
  390. package/dist/locales/nl.json +480 -31
  391. package/dist/locales/pl.json +480 -31
  392. package/dist/locales/pt.json +480 -31
  393. package/dist/locales/ro.json +480 -31
  394. package/dist/locales/ru.json +480 -31
  395. package/dist/locales/sq.json +480 -31
  396. package/dist/locales/sv.json +480 -31
  397. package/dist/locales/tr.json +480 -31
  398. package/dist/locales/zh.json +480 -31
  399. package/dist/patterns/alia-assistant/alia-types.d.ts +9 -0
  400. package/dist/patterns/alia-assistant/index.js +1 -1
  401. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  402. package/dist/patterns/patient-shell/index.js +1 -1
  403. package/dist/tokens.css +9 -1
  404. package/package.json +101 -5
  405. package/dist/_chunks/ai-tools-rail-BA_sqy1A.js +0 -373
  406. package/dist/_chunks/appointment-tray-CZtvtaH-.js +0 -431
  407. package/dist/_chunks/clinical-note-card-DqQYf_D4.js +0 -333
  408. package/dist/_chunks/editable-currency-cell-renderer-kgqp_mIw.js +0 -448
  409. package/dist/_chunks/email-input-B_Y55f5G.js +0 -396
  410. package/dist/_chunks/message-card-Bx4GmLvf.js +0 -277
  411. package/dist/_chunks/notification-card-BiESdm8q.js +0 -255
  412. package/dist/_chunks/patient-summary-card-B836_fDB.js +0 -435
  413. package/dist/_chunks/patient-table-CDuosVru.js +0 -889
  414. package/dist/_chunks/reviews-panel-Dq7LMDcH.js +0 -555
  415. package/dist/_chunks/rich-text-editor-BsV7zUdg.js +0 -2142
  416. package/dist/_chunks/tab-bar-B1ovILzh.js +0 -105
  417. package/dist/_chunks/task-card-BwY9jaV1.js +0 -124
  418. package/dist/_chunks/tooth-scheme-yBr53cvv.js +0 -1330
  419. package/dist/_chunks/use-persistent-state-i23OWy6G.js +0 -24
  420. package/dist/components/ai-tools-rail/ai-tools-rail.agent.d.ts +0 -4
  421. package/dist/components/ai-tools-rail/ai-tools-rail.d.ts +0 -68
  422. package/dist/components/ai-tools-rail/index.d.ts +0 -4
  423. package/dist/components/ai-tools-rail/index.js +0 -6
  424. package/dist/components/patient-table/cell-renderers/contact-cell.d.ts +0 -45
  425. package/dist/components/patient-table/cell-renderers/patient-identity-cell.d.ts +0 -26
@@ -0,0 +1,2133 @@
1
+ import { jsxs as k, jsx as d, Fragment as In } from "react/jsx-runtime";
2
+ import { forwardRef as kn, useState as Z, useRef as qe, useEffect as Se, useMemo as $e, useCallback as O, useImperativeHandle as Tn } from "react";
3
+ import { createPortal as An } from "react-dom";
4
+ import * as K from "@radix-ui/react-tooltip";
5
+ import { c as te } from "./index-D2ZczOXr.js";
6
+ import { useTranslation as Yt } from "react-i18next";
7
+ import { u as Ln } from "./registry-DvAUVLHh.js";
8
+ import { I as Cn } from "./icon-button-LqoiKcUN.js";
9
+ import { P as et } from "./popover-B2qCDhJC.js";
10
+ import { S as Rn } from "./select-KsyRr8WH.js";
11
+ import { S as tt } from "./switch-OILsBLWo.js";
12
+ import { S as En } from "./settings-ca2Yi9R8.js";
13
+ const J = {
14
+ type: "string",
15
+ description: "FDI tooth id ('11'–'48' permanent, '51'–'85' primary) or a special-element id ('Q1'–'Q4' quadrants, 'S1'–'S6' sextants, 'AS'/'AI' arches, 'general'; primary mirrors with an 'm' prefix)."
16
+ }, je = {
17
+ enum: [
18
+ "caries",
19
+ "filled",
20
+ "crowned",
21
+ "temporaryCrown",
22
+ "bridge",
23
+ "missing",
24
+ "implant",
25
+ "implantExtraction",
26
+ "stub",
27
+ "destroyed",
28
+ "rootCanal"
29
+ ]
30
+ }, Mn = {
31
+ enum: ["mesial", "distal", "occlusal", "buccal", "lingual"]
32
+ }, Dn = {
33
+ type: "object",
34
+ properties: {
35
+ id: { type: "string" },
36
+ url: { type: "string" },
37
+ thumbnailUrl: { type: "string" },
38
+ date: { type: "string", description: "ISO acquisition date (YYYY-MM-DD)." },
39
+ note: { type: "string" },
40
+ kind: { enum: ["periapical", "bitewing", "panoramic", "other"] },
41
+ alt: { type: "string" }
42
+ },
43
+ required: ["id", "url"]
44
+ }, Nn = {
45
+ id: "tooth-scheme",
46
+ // pick — focus/select a tooth (`focus_tooth`, transient, not persisted);
47
+ // set_value / edit_inline — `set_finding` records a finding and marks the
48
+ // affected surfaces (set-surface), `remove_finding` clears one;
49
+ // view_change — the side/plan projection + dentition are view props.
50
+ capabilities: ["pick", "set_value", "edit_inline", "view_change"],
51
+ state: {
52
+ chart: {
53
+ type: "object",
54
+ descriptionKey: "ui.agent.toothScheme.state.chart",
55
+ description: "Current dental chart — findings (and marked surfaces) keyed by FDI id, or by a special-element id (quadrant / sextant / arch / general) for region-spanning findings.",
56
+ read: (t) => t.getChart()
57
+ },
58
+ chartedTeeth: {
59
+ type: "string[]",
60
+ descriptionKey: "ui.agent.toothScheme.state.chartedTeeth",
61
+ description: "Ids carrying at least one finding — FDI tooth ids and/or special-element ids (quadrant / sextant / arch / general).",
62
+ read: (t) => Object.keys(t.getChart())
63
+ },
64
+ radiographs: {
65
+ // A9: the always-on state snapshot carries identifiers + enums only —
66
+ // never PHI free-text (the radiograph `note`), service dates, or the
67
+ // consumer-hosted image URLs. Those are fetched deliberately, per tooth,
68
+ // via the audited `get_radiographs` action.
69
+ type: "Record<string, { id: string; kind?: string }[]>",
70
+ descriptionKey: "ui.agent.toothScheme.state.radiographs",
71
+ description: "Structural references (id + kind) to the radiographs on each tooth, keyed by FDI id. Notes, dates and image URLs are not exposed here — fetch them on demand via get_radiographs.",
72
+ read: (t) => Object.fromEntries(
73
+ t.teethWithRadiographs().map((n) => [
74
+ n,
75
+ t.getRadiographs(n).map((i) => ({ id: i.id, kind: i.kind ?? "periapical" }))
76
+ ])
77
+ )
78
+ },
79
+ teethWithRadiographs: {
80
+ type: "string[]",
81
+ descriptionKey: "ui.agent.toothScheme.state.teethWithRadiographs",
82
+ description: "FDI ids of every tooth carrying at least one radiograph.",
83
+ read: (t) => t.teethWithRadiographs()
84
+ }
85
+ },
86
+ actions: {
87
+ focus_tooth: {
88
+ safety: "read",
89
+ argsType: "{ id: FdiId }",
90
+ argsSchema: {
91
+ type: "object",
92
+ properties: { id: J },
93
+ required: ["id"]
94
+ },
95
+ idempotent: !0,
96
+ descriptionKey: "ui.agent.toothScheme.actions.focusTooth",
97
+ description: "Move focus to a specific tooth by FDI id.",
98
+ invoke: (t, n) => {
99
+ t.focusTooth(n.id);
100
+ }
101
+ },
102
+ get_tooth: {
103
+ safety: "read",
104
+ argsType: "{ id: FdiId }",
105
+ argsSchema: {
106
+ type: "object",
107
+ properties: { id: J },
108
+ required: ["id"]
109
+ },
110
+ returns: "ToothCondition[]",
111
+ returnsSchema: { type: "array", items: je },
112
+ idempotent: !0,
113
+ descriptionKey: "ui.agent.toothScheme.actions.getTooth",
114
+ description: "Read the findings recorded on one tooth (FDI id).",
115
+ invoke: (t, n) => t.getTooth(n.id)
116
+ },
117
+ teeth_with: {
118
+ safety: "read",
119
+ argsType: "{ condition: ToothCondition }",
120
+ argsSchema: {
121
+ type: "object",
122
+ properties: { condition: je },
123
+ required: ["condition"]
124
+ },
125
+ returns: "FdiId[]",
126
+ returnsSchema: { type: "array", items: J },
127
+ idempotent: !0,
128
+ descriptionKey: "ui.agent.toothScheme.actions.teethWith",
129
+ description: "List the ids carrying a given finding — FDI tooth ids and/or special-element ids (e.g. all teeth with caries).",
130
+ invoke: (t, n) => t.teethWith(n.condition)
131
+ },
132
+ get_radiographs: {
133
+ safety: "read",
134
+ argsType: "{ id: FdiId }",
135
+ argsSchema: {
136
+ type: "object",
137
+ properties: { id: J },
138
+ required: ["id"]
139
+ },
140
+ returns: "Radiograph[]",
141
+ returnsSchema: { type: "array", items: Dn },
142
+ idempotent: !0,
143
+ descriptionKey: "ui.agent.toothScheme.actions.getRadiographs",
144
+ description: "Read the radiographs (x-rays) attached to one tooth.",
145
+ invoke: (t, n) => t.getRadiographs(n.id)
146
+ },
147
+ open_radiographs: {
148
+ safety: "read",
149
+ argsType: "{ id: FdiId }",
150
+ argsSchema: {
151
+ type: "object",
152
+ properties: { id: J },
153
+ required: ["id"]
154
+ },
155
+ idempotent: !0,
156
+ descriptionKey: "ui.agent.toothScheme.actions.openRadiographs",
157
+ description: "Focus a tooth and open its radiograph archive (fires the host's onOpenRadiographs).",
158
+ invoke: (t, n) => {
159
+ t.openRadiographs(n.id);
160
+ }
161
+ },
162
+ set_finding: {
163
+ safety: "write",
164
+ argsType: "{ id: FdiId; condition: ToothCondition; surfaces?: Surface[] }",
165
+ argsSchema: {
166
+ type: "object",
167
+ properties: {
168
+ id: J,
169
+ condition: je,
170
+ surfaces: { type: "array", items: Mn }
171
+ },
172
+ required: ["id", "condition"]
173
+ },
174
+ idempotent: !0,
175
+ descriptionKey: "ui.agent.toothScheme.actions.setFinding",
176
+ description: "Record a finding on a tooth or region element (crown, implant, root canal, caries, …). Optionally mark the affected surfaces for a surface finding.",
177
+ invoke: (t, n) => {
178
+ t.setFinding(n.id, n.condition, n.surfaces);
179
+ }
180
+ },
181
+ remove_finding: {
182
+ safety: "write",
183
+ argsType: "{ id: FdiId; condition: ToothCondition }",
184
+ argsSchema: {
185
+ type: "object",
186
+ properties: { id: J, condition: je },
187
+ required: ["id", "condition"]
188
+ },
189
+ idempotent: !0,
190
+ descriptionKey: "ui.agent.toothScheme.actions.removeFinding",
191
+ description: "Remove a single finding from a tooth.",
192
+ invoke: (t, n) => {
193
+ t.removeFinding(n.id, n.condition);
194
+ }
195
+ },
196
+ clear_tooth: {
197
+ safety: "destructive",
198
+ argsType: "{ id: FdiId }",
199
+ argsSchema: {
200
+ type: "object",
201
+ properties: { id: J },
202
+ required: ["id"]
203
+ },
204
+ idempotent: !0,
205
+ descriptionKey: "ui.agent.toothScheme.actions.clearTooth",
206
+ description: "Clear every finding from a tooth.",
207
+ invoke: (t, n) => {
208
+ t.clearTooth(n.id);
209
+ }
210
+ }
211
+ },
212
+ domHooks: {
213
+ root: { attr: "data-component", value: "tooth-scheme" },
214
+ instanceId: {
215
+ attr: "data-component-id",
216
+ sourceProp: "id",
217
+ description: "Sourced from the id prop."
218
+ },
219
+ item: {
220
+ attr: "data-fdi",
221
+ description: "Each rendered tooth `<g>` carries its FDI id as `data-fdi`; selectable special-element slots carry their id there too (plus `data-special` naming the kind). The `data-projection` / `data-view-mode` attributes on the root expose the side/plan/both view."
222
+ }
223
+ }
224
+ }, Ae = [
225
+ // upper
226
+ "18",
227
+ "17",
228
+ "16",
229
+ "15",
230
+ "14",
231
+ "13",
232
+ "12",
233
+ "11",
234
+ "21",
235
+ "22",
236
+ "23",
237
+ "24",
238
+ "25",
239
+ "26",
240
+ "27",
241
+ "28",
242
+ // lower
243
+ "48",
244
+ "47",
245
+ "46",
246
+ "45",
247
+ "44",
248
+ "43",
249
+ "42",
250
+ "41",
251
+ "31",
252
+ "32",
253
+ "33",
254
+ "34",
255
+ "35",
256
+ "36",
257
+ "37",
258
+ "38"
259
+ ], Le = [
260
+ // upper
261
+ "55",
262
+ "54",
263
+ "53",
264
+ "52",
265
+ "51",
266
+ "61",
267
+ "62",
268
+ "63",
269
+ "64",
270
+ "65",
271
+ // lower
272
+ "85",
273
+ "84",
274
+ "83",
275
+ "82",
276
+ "81",
277
+ "71",
278
+ "72",
279
+ "73",
280
+ "74",
281
+ "75"
282
+ ];
283
+ function _n(t) {
284
+ return t <= 2 ? "incisor" : t === 3 ? "canine" : t <= 5 ? "premolar" : "molar";
285
+ }
286
+ function On(t) {
287
+ return t <= 2 ? "incisor" : t === 3 ? "canine" : "molar";
288
+ }
289
+ function qn(t, n) {
290
+ const i = (t - 1) % 4 + 1;
291
+ return `${i === 1 ? "UR" : i === 2 ? "UL" : i === 3 ? "LL" : "LR"}${n}`;
292
+ }
293
+ function jn(t, n) {
294
+ switch (t) {
295
+ case 1:
296
+ return String(1 + (8 - n));
297
+ case 2:
298
+ return String(8 + n);
299
+ case 3:
300
+ return String(17 + (8 - n));
301
+ case 4:
302
+ return String(24 + n);
303
+ default:
304
+ return "";
305
+ }
306
+ }
307
+ function Kn(t, n) {
308
+ const i = "ABCDEFGHIJKLMNOPQRST";
309
+ let o = -1;
310
+ switch (t) {
311
+ case 5:
312
+ o = 0 + (5 - n);
313
+ break;
314
+ case 6:
315
+ o = 5 + (n - 1);
316
+ break;
317
+ case 7:
318
+ o = 10 + (5 - n);
319
+ break;
320
+ case 8:
321
+ o = 15 + (n - 1);
322
+ break;
323
+ default:
324
+ o = -1;
325
+ }
326
+ return o >= 0 ? i[o] : "";
327
+ }
328
+ function Fn(t) {
329
+ const n = Number(t[0]), i = Number(t[1]), o = n >= 5, l = o ? On(i) : _n(i), v = n === 1 || n === 2 || n === 5 || n === 6 ? "upper" : "lower", m = n === 1 || n === 4 || n === 5 || n === 8 ? "right" : "left", S = o ? Kn(n, i) : jn(n, i), w = qn(n, i);
330
+ return {
331
+ fdi: t,
332
+ universal: S,
333
+ palmer: w,
334
+ quadrant: n,
335
+ positionInQuadrant: i,
336
+ anatomy: l,
337
+ arch: v,
338
+ side: m,
339
+ dentition: o ? "primary" : "permanent"
340
+ };
341
+ }
342
+ const Q = [
343
+ ...Ae,
344
+ ...Le
345
+ ].reduce((t, n) => (t[n] = Fn(n), t), {}), Wn = Object.fromEntries(
346
+ Object.entries(Q).map(([t, n]) => [t, n.universal])
347
+ ), Pn = Object.fromEntries(
348
+ Object.entries(Q).map(([t, n]) => [t, n.palmer])
349
+ );
350
+ function st(t) {
351
+ return t.dentition !== "primary" ? t.fdi : `${t.quadrant - 4}${t.positionInQuadrant}`;
352
+ }
353
+ const Hn = 0.72, $r = {
354
+ caries: "--destructive",
355
+ filled: "--info",
356
+ crowned: "--warning",
357
+ temporaryCrown: "--warning",
358
+ bridge: "--primary",
359
+ missing: "--muted-foreground",
360
+ implant: "--accent",
361
+ implantExtraction: "--accent",
362
+ stub: "--muted-foreground",
363
+ destroyed: "--destructive",
364
+ rootCanal: "--primary"
365
+ }, ke = {
366
+ caries: "var(--destructive)",
367
+ filled: "var(--info)",
368
+ crowned: "var(--warning)",
369
+ temporaryCrown: "var(--warning)",
370
+ bridge: "var(--primary)",
371
+ missing: "var(--muted-foreground)",
372
+ implant: "var(--accent)",
373
+ implantExtraction: "var(--accent)",
374
+ stub: "var(--muted-foreground)",
375
+ destroyed: "var(--destructive)",
376
+ rootCanal: "var(--primary)"
377
+ }, it = {
378
+ crowned: { folder: "crown", resolve: "per-fdi" },
379
+ temporaryCrown: { folder: "temporaryCrown", resolve: "per-fdi" },
380
+ bridge: { folder: "replacement", resolve: "per-fdi" },
381
+ destroyed: { folder: "destroyed", resolve: "per-fdi" },
382
+ implant: { folder: "implant", resolve: "general" },
383
+ implantExtraction: { folder: "implantExtraction", resolve: "general" },
384
+ stub: { folder: "stub", resolve: "general" },
385
+ rootCanal: { folder: "rootTreatment", resolve: "rct" }
386
+ };
387
+ function Zt(t, n, i) {
388
+ const o = t.arch === "upper" ? "top" : "bottom", l = `${n}/side/${i.folder}/${o}`;
389
+ if (i.resolve === "general") return `${l}/general.webp`;
390
+ const v = st(t);
391
+ return i.resolve === "rct" ? `${l}/${v}/full.webp` : `${l}/${v}.webp`;
392
+ }
393
+ const Qn = {
394
+ mesial: "mesial",
395
+ distal: "distal",
396
+ occlusal: "occlusal",
397
+ buccal: "vestibular",
398
+ lingual: "oral"
399
+ }, Un = {
400
+ caries: "caries",
401
+ filled: "filling"
402
+ };
403
+ function Yn(t, n, i, o) {
404
+ const l = t.arch === "upper" ? "top" : "bottom";
405
+ return `${n}/plan/${i}/${l}/${st(t)}-${Qn[o]}.webp`;
406
+ }
407
+ function nt(t) {
408
+ return t.anatomy === "molar" || t.anatomy === "premolar" ? ["top", "bottom", "left", "right", "center"] : ["top", "bottom", "left", "right"];
409
+ }
410
+ function jt(t, n) {
411
+ if (n === "center") return "occlusal";
412
+ if (n === "top") return t.arch === "upper" ? "buccal" : "lingual";
413
+ if (n === "bottom") return t.arch === "upper" ? "lingual" : "buccal";
414
+ const i = t.quadrant <= 4 ? t.quadrant : t.quadrant - 4, o = i === 1 || i === 4;
415
+ return n === "left" ? o ? "distal" : "mesial" : o ? "mesial" : "distal";
416
+ }
417
+ const Kt = (t) => Math.round(t * 100) / 100;
418
+ function Zn(t, n, i) {
419
+ const { x: o, y: l, w: v, h: m } = n, S = o + v, w = l + m, a = (p, A) => `${Kt(p)} ${Kt(A)}`;
420
+ if (!i) {
421
+ const p = o + v / 2, A = l + m / 2;
422
+ switch (t) {
423
+ case "top":
424
+ return `M ${a(o, l)} L ${a(S, l)} L ${a(p, A)} Z`;
425
+ case "bottom":
426
+ return `M ${a(o, w)} L ${a(S, w)} L ${a(p, A)} Z`;
427
+ case "left":
428
+ return `M ${a(o, l)} L ${a(p, A)} L ${a(o, w)} Z`;
429
+ case "right":
430
+ return `M ${a(S, l)} L ${a(p, A)} L ${a(S, w)} Z`;
431
+ default:
432
+ return "";
433
+ }
434
+ }
435
+ const M = o + v * 0.3, $ = l + m * 0.3, F = o + v * 0.7, R = l + m * 0.7;
436
+ switch (t) {
437
+ case "center":
438
+ return `M ${a(M, $)} L ${a(F, $)} L ${a(F, R)} L ${a(M, R)} Z`;
439
+ case "top":
440
+ return `M ${a(o, l)} L ${a(S, l)} L ${a(F, $)} L ${a(M, $)} Z`;
441
+ case "bottom":
442
+ return `M ${a(o, w)} L ${a(S, w)} L ${a(F, R)} L ${a(M, R)} Z`;
443
+ case "left":
444
+ return `M ${a(o, l)} L ${a(M, $)} L ${a(M, R)} L ${a(o, w)} Z`;
445
+ case "right":
446
+ return `M ${a(S, l)} L ${a(F, $)} L ${a(F, R)} L ${a(S, w)} Z`;
447
+ default:
448
+ return "";
449
+ }
450
+ }
451
+ const Te = 5, at = 40, L = 4, z = 36, zt = 62;
452
+ function Gt(t, n, i = "default", o = "side") {
453
+ const l = t.arch === "upper" ? "top" : "bottom";
454
+ return `${n}/${o}/${i}/${l}/${st(t)}.webp`;
455
+ }
456
+ function zn(t, n = zt, i = {}) {
457
+ const o = t === "primary" ? Le : t === "mixed" ? [...Ae, ...Le] : Ae, l = [], v = [];
458
+ for (const p of o)
459
+ Q[p].arch === "upper" ? l.push(p) : v.push(p);
460
+ const m = z + Te, S = Math.max(l.length, v.length), w = S > 0 ? S * m - Te : 0;
461
+ function a(p, A) {
462
+ const ie = p.length > 0 ? p.length * m - Te : 0, q = (w - ie) / 2;
463
+ return p.map((ne, Pe) => {
464
+ const He = Q[ne];
465
+ return {
466
+ fdi: ne,
467
+ meta: He,
468
+ x: q + Pe * m,
469
+ y: A
470
+ };
471
+ });
472
+ }
473
+ if (i.arch) {
474
+ const p = i.arch === "upper" ? l : v;
475
+ return { teeth: a(p, 0), width: w, height: n };
476
+ }
477
+ const M = a(l, 0), $ = a(v, n + at), F = w > 0 ? w : S * m, R = n * 2 + at;
478
+ return { teeth: [...M, ...$], width: F, height: R };
479
+ }
480
+ const C = (t) => [...Ae, ...Le].filter(
481
+ (n) => Q[n].quadrant === t
482
+ ), ct = [
483
+ // Upper facial (side) row — Q1, Q2, AS, Gen.
484
+ {
485
+ id: "Q1",
486
+ kind: "quadrant",
487
+ arch: "upper",
488
+ dentition: "permanent",
489
+ labelKey: "quadrant",
490
+ labelIndex: 1,
491
+ code: "Q1",
492
+ teeth: C(1),
493
+ column: 0,
494
+ row: "side"
495
+ },
496
+ {
497
+ id: "Q2",
498
+ kind: "quadrant",
499
+ arch: "upper",
500
+ dentition: "permanent",
501
+ labelKey: "quadrant",
502
+ labelIndex: 2,
503
+ code: "Q2",
504
+ teeth: C(2),
505
+ column: 1,
506
+ row: "side"
507
+ },
508
+ {
509
+ id: "AS",
510
+ kind: "arch",
511
+ arch: "upper",
512
+ dentition: "permanent",
513
+ labelKey: "archUpper",
514
+ code: "AS",
515
+ teeth: [...C(1), ...C(2)],
516
+ column: 2,
517
+ row: "side"
518
+ },
519
+ {
520
+ id: "general",
521
+ kind: "general",
522
+ arch: "upper",
523
+ dentition: "permanent",
524
+ labelKey: "general",
525
+ code: "Gen.",
526
+ teeth: Ae,
527
+ column: 3,
528
+ row: "side"
529
+ },
530
+ // Upper occlusal (plan) row — S1, S2, S3 (WHO sextants).
531
+ {
532
+ id: "S1",
533
+ kind: "sextant",
534
+ arch: "upper",
535
+ dentition: "permanent",
536
+ labelKey: "sextant",
537
+ labelIndex: 1,
538
+ code: "S1",
539
+ teeth: ["18", "17", "16", "15", "14"],
540
+ column: 0,
541
+ row: "plan"
542
+ },
543
+ {
544
+ id: "S2",
545
+ kind: "sextant",
546
+ arch: "upper",
547
+ dentition: "permanent",
548
+ labelKey: "sextant",
549
+ labelIndex: 2,
550
+ code: "S2",
551
+ teeth: ["13", "12", "11", "21", "22", "23"],
552
+ column: 1,
553
+ row: "plan"
554
+ },
555
+ {
556
+ id: "S3",
557
+ kind: "sextant",
558
+ arch: "upper",
559
+ dentition: "permanent",
560
+ labelKey: "sextant",
561
+ labelIndex: 3,
562
+ code: "S3",
563
+ teeth: ["24", "25", "26", "27", "28"],
564
+ column: 2,
565
+ row: "plan"
566
+ },
567
+ // Lower occlusal (plan) row — S4, S5, S6.
568
+ {
569
+ id: "S4",
570
+ kind: "sextant",
571
+ arch: "lower",
572
+ dentition: "permanent",
573
+ labelKey: "sextant",
574
+ labelIndex: 4,
575
+ code: "S4",
576
+ teeth: ["34", "35", "36", "37", "38"],
577
+ column: 0,
578
+ row: "plan"
579
+ },
580
+ {
581
+ id: "S5",
582
+ kind: "sextant",
583
+ arch: "lower",
584
+ dentition: "permanent",
585
+ labelKey: "sextant",
586
+ labelIndex: 5,
587
+ code: "S5",
588
+ teeth: ["43", "42", "41", "31", "32", "33"],
589
+ column: 1,
590
+ row: "plan"
591
+ },
592
+ {
593
+ id: "S6",
594
+ kind: "sextant",
595
+ arch: "lower",
596
+ dentition: "permanent",
597
+ labelKey: "sextant",
598
+ labelIndex: 6,
599
+ code: "S6",
600
+ teeth: ["44", "45", "46", "47", "48"],
601
+ column: 2,
602
+ row: "plan"
603
+ },
604
+ // Lower facial (side) row — Q4, Q3, AI.
605
+ {
606
+ id: "Q4",
607
+ kind: "quadrant",
608
+ arch: "lower",
609
+ dentition: "permanent",
610
+ labelKey: "quadrant",
611
+ labelIndex: 4,
612
+ code: "Q4",
613
+ teeth: C(4),
614
+ column: 0,
615
+ row: "side"
616
+ },
617
+ {
618
+ id: "Q3",
619
+ kind: "quadrant",
620
+ arch: "lower",
621
+ dentition: "permanent",
622
+ labelKey: "quadrant",
623
+ labelIndex: 3,
624
+ code: "Q3",
625
+ teeth: C(3),
626
+ column: 1,
627
+ row: "side"
628
+ },
629
+ {
630
+ id: "AI",
631
+ kind: "arch",
632
+ arch: "lower",
633
+ dentition: "permanent",
634
+ labelKey: "archLower",
635
+ code: "AI",
636
+ teeth: [...C(3), ...C(4)],
637
+ column: 2,
638
+ row: "side"
639
+ }
640
+ ], dt = [
641
+ // Upper facial (side) row.
642
+ {
643
+ id: "mQ1",
644
+ kind: "quadrant",
645
+ arch: "upper",
646
+ dentition: "primary",
647
+ labelKey: "quadrant",
648
+ labelIndex: 1,
649
+ code: "Q1",
650
+ teeth: C(5),
651
+ column: 0,
652
+ row: "side"
653
+ },
654
+ {
655
+ id: "mQ2",
656
+ kind: "quadrant",
657
+ arch: "upper",
658
+ dentition: "primary",
659
+ labelKey: "quadrant",
660
+ labelIndex: 2,
661
+ code: "Q2",
662
+ teeth: C(6),
663
+ column: 1,
664
+ row: "side"
665
+ },
666
+ {
667
+ id: "mAS",
668
+ kind: "arch",
669
+ arch: "upper",
670
+ dentition: "primary",
671
+ labelKey: "archUpper",
672
+ code: "AS",
673
+ teeth: [...C(5), ...C(6)],
674
+ column: 2,
675
+ row: "side"
676
+ },
677
+ {
678
+ id: "mGeneral",
679
+ kind: "general",
680
+ arch: "upper",
681
+ dentition: "primary",
682
+ labelKey: "general",
683
+ code: "Gen.",
684
+ teeth: Le,
685
+ column: 3,
686
+ row: "side"
687
+ },
688
+ // Upper occlusal (plan) row.
689
+ {
690
+ id: "mS1",
691
+ kind: "sextant",
692
+ arch: "upper",
693
+ dentition: "primary",
694
+ labelKey: "sextant",
695
+ labelIndex: 1,
696
+ code: "S1",
697
+ teeth: ["55", "54"],
698
+ column: 0,
699
+ row: "plan"
700
+ },
701
+ {
702
+ id: "mS2",
703
+ kind: "sextant",
704
+ arch: "upper",
705
+ dentition: "primary",
706
+ labelKey: "sextant",
707
+ labelIndex: 2,
708
+ code: "S2",
709
+ teeth: ["53", "52", "51", "61", "62", "63"],
710
+ column: 1,
711
+ row: "plan"
712
+ },
713
+ {
714
+ id: "mS3",
715
+ kind: "sextant",
716
+ arch: "upper",
717
+ dentition: "primary",
718
+ labelKey: "sextant",
719
+ labelIndex: 3,
720
+ code: "S3",
721
+ teeth: ["64", "65"],
722
+ column: 2,
723
+ row: "plan"
724
+ },
725
+ // Lower occlusal (plan) row.
726
+ {
727
+ id: "mS4",
728
+ kind: "sextant",
729
+ arch: "lower",
730
+ dentition: "primary",
731
+ labelKey: "sextant",
732
+ labelIndex: 4,
733
+ code: "S4",
734
+ teeth: ["74", "75"],
735
+ column: 0,
736
+ row: "plan"
737
+ },
738
+ {
739
+ id: "mS5",
740
+ kind: "sextant",
741
+ arch: "lower",
742
+ dentition: "primary",
743
+ labelKey: "sextant",
744
+ labelIndex: 5,
745
+ code: "S5",
746
+ teeth: ["73", "72", "71", "81", "82", "83"],
747
+ column: 1,
748
+ row: "plan"
749
+ },
750
+ {
751
+ id: "mS6",
752
+ kind: "sextant",
753
+ arch: "lower",
754
+ dentition: "primary",
755
+ labelKey: "sextant",
756
+ labelIndex: 6,
757
+ code: "S6",
758
+ teeth: ["84", "85"],
759
+ column: 2,
760
+ row: "plan"
761
+ },
762
+ // Lower facial (side) row.
763
+ {
764
+ id: "mQ4",
765
+ kind: "quadrant",
766
+ arch: "lower",
767
+ dentition: "primary",
768
+ labelKey: "quadrant",
769
+ labelIndex: 4,
770
+ code: "Q4",
771
+ teeth: C(8),
772
+ column: 0,
773
+ row: "side"
774
+ },
775
+ {
776
+ id: "mQ3",
777
+ kind: "quadrant",
778
+ arch: "lower",
779
+ dentition: "primary",
780
+ labelKey: "quadrant",
781
+ labelIndex: 3,
782
+ code: "Q3",
783
+ teeth: C(7),
784
+ column: 1,
785
+ row: "side"
786
+ },
787
+ {
788
+ id: "mAI",
789
+ kind: "arch",
790
+ arch: "lower",
791
+ dentition: "primary",
792
+ labelKey: "archLower",
793
+ code: "AI",
794
+ teeth: [...C(7), ...C(8)],
795
+ column: 2,
796
+ row: "side"
797
+ }
798
+ ], Gn = [
799
+ ...ct,
800
+ ...dt
801
+ ], Vt = Gn.reduce((t, n) => (t[n.id] = n, t), {});
802
+ function Vn(t) {
803
+ return t in Vt;
804
+ }
805
+ function Ke(t, n, i) {
806
+ return (t === "primary" ? dt : ct).filter(
807
+ (l) => l.arch === n && l.row === i && l.kind !== "general"
808
+ ).sort((l, v) => l.column - v.column);
809
+ }
810
+ function Ir(t) {
811
+ return (t === "primary" ? dt : ct).find((i) => i.kind === "general");
812
+ }
813
+ const ee = 36;
814
+ function Bn(t, n) {
815
+ const i = t.kind === "quadrant" || t.kind === "arch" ? t.code : t.kind === "general" ? "general" : null;
816
+ return i ? `${/\/teeth\/?$/.test(n) ? n.replace(/\/teeth\/?$/, "/global") : `${n}/global`}/${i}.webp` : null;
817
+ }
818
+ const Xn = 8, Ft = ee + Te;
819
+ function Fe(t, n) {
820
+ if (t.length === 0) return { specials: [], width: n };
821
+ const i = n + Xn, o = t.map((m) => ({
822
+ element: m,
823
+ x: i + m.column * Ft,
824
+ y: 0
825
+ })), l = Math.max(...t.map((m) => m.column)), v = i + (l + 1) * Ft - Te;
826
+ return { specials: o, width: v };
827
+ }
828
+ function Wt(t, n) {
829
+ switch (n) {
830
+ case "universal":
831
+ return Wn[t] ?? t;
832
+ case "palmer":
833
+ return Pn[t] ?? t;
834
+ case "fdi":
835
+ default:
836
+ return t;
837
+ }
838
+ }
839
+ function kr() {
840
+ return {};
841
+ }
842
+ function Pt(t) {
843
+ const n = {};
844
+ for (const [i, o] of Object.entries(t))
845
+ !o || o.length === 0 || (n[i] = { conditions: o, surfaces: [] });
846
+ return n;
847
+ }
848
+ const Jn = te(
849
+ [
850
+ "ds:tooth-scheme-alfadocs",
851
+ "ds:flex ds:flex-col",
852
+ "ds:gap-[var(--spacing-sm)]",
853
+ "ds:bg-[var(--background)] ds:text-[var(--foreground)]",
854
+ // Block-level flex column so the SVG's w-full can grow to fill the frame.
855
+ // min-w-fit on the SVG floors it at natural size, so narrow frames scroll
856
+ // here rather than shrinking the per-tooth hit target below the 44px floor.
857
+ "ds:max-w-full ds:overflow-x-auto",
858
+ // When the scroll container itself is the tab stop (display mode, see
859
+ // scrollTabIndex) it needs a focus ring. Use an outline (not box-shadow):
860
+ // forced-colors / high-contrast mode zeroes box-shadow, which would leave
861
+ // HCM keyboard users with no visible focus. outline survives, and the
862
+ // CanvasText fallback repaints it in the system palette.
863
+ "ds:outline-none",
864
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
865
+ "ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
866
+ "ds:forced-colors:focus-visible:outline-[CanvasText]"
867
+ ].join(" ")
868
+ ), er = te(["ds:flex ds:flex-col ds:gap-0"].join(" ")), tr = te(
869
+ [
870
+ "ds:block",
871
+ "ds:w-full ds:min-w-fit ds:h-auto",
872
+ "ds:text-[var(--foreground)]"
873
+ ].join(" ")
874
+ ), Ht = te(
875
+ [
876
+ "ds:group ds:cursor-pointer",
877
+ "ds:focus:outline-none",
878
+ "ds:transition-[fill,stroke,opacity] ds:duration-[var(--animation-duration)]",
879
+ "ds:motion-reduce:transition-none"
880
+ ].join(" ")
881
+ ), nr = te(
882
+ [
883
+ "ds:flex ds:flex-wrap ds:items-center",
884
+ "ds:gap-[var(--spacing-sm)]",
885
+ "type-meta ds:text-[var(--muted-foreground)]"
886
+ ].join(" ")
887
+ ), rr = te(
888
+ ["ds:inline-flex ds:items-center", "ds:gap-[var(--spacing-xs)]"].join(" ")
889
+ ), or = te(["ds:sr-only"].join(" ")), ir = te(
890
+ [
891
+ "ds:cursor-pointer ds:outline-none",
892
+ "ds:fill-transparent ds:stroke-transparent",
893
+ "ds:transition-[fill] ds:duration-[var(--animation-duration)]",
894
+ "ds:motion-reduce:transition-none",
895
+ "ds:hover:fill-[color-mix(in_srgb,var(--accent)_18%,transparent)]",
896
+ "ds:focus-visible:fill-[color-mix(in_srgb,var(--accent)_22%,transparent)]",
897
+ "ds:focus-visible:stroke-[var(--ring)]",
898
+ "ds:forced-colors:focus-visible:stroke-[CanvasText]"
899
+ ].join(" ")
900
+ );
901
+ function rt(t) {
902
+ return t.value !== void 0;
903
+ }
904
+ function We() {
905
+ return { conditions: [], surfaces: [] };
906
+ }
907
+ function Qt(t, n) {
908
+ const i = t ?? [];
909
+ return n ? i.includes(n) ? i.filter((o) => o !== n) : [...i, n] : i.length === 0 ? ["caries"] : [];
910
+ }
911
+ function Ut(t, n) {
912
+ switch (t.labelKey) {
913
+ case "quadrant":
914
+ return n("toothScheme.special.quadrant", { n: t.labelIndex });
915
+ case "sextant":
916
+ return n("toothScheme.special.sextant", { n: t.labelIndex });
917
+ case "archUpper":
918
+ return n("toothScheme.special.archUpper");
919
+ case "archLower":
920
+ return n("toothScheme.special.archLower");
921
+ default:
922
+ return n("toothScheme.special.general");
923
+ }
924
+ }
925
+ function ar(t, n, i) {
926
+ var l;
927
+ return i ? ((l = {
928
+ top: { ArrowDown: "center" },
929
+ bottom: { ArrowUp: "center" },
930
+ left: { ArrowRight: "center" },
931
+ right: { ArrowLeft: "center" },
932
+ center: {
933
+ ArrowUp: "top",
934
+ ArrowDown: "bottom",
935
+ ArrowLeft: "left",
936
+ ArrowRight: "right"
937
+ }
938
+ }[t]) == null ? void 0 : l[n]) ?? t : n === "ArrowUp" ? "top" : n === "ArrowDown" ? "bottom" : n === "ArrowLeft" ? "left" : n === "ArrowRight" ? "right" : t;
939
+ }
940
+ const sr = [
941
+ "caries",
942
+ "filled",
943
+ "crowned",
944
+ "temporaryCrown",
945
+ "bridge",
946
+ "rootCanal",
947
+ "implant",
948
+ "implantExtraction",
949
+ "stub",
950
+ "destroyed",
951
+ "missing"
952
+ ];
953
+ function cr({
954
+ condition: t,
955
+ assetBaseUrl: n
956
+ }) {
957
+ const i = Q[16], o = it[t], l = t === "missing", v = t === "caries" || t === "filled", m = 36 * 0.9, S = 62 * 0.9, w = (36 - m) / 2, a = (62 - S) / 2;
958
+ return /* @__PURE__ */ k(
959
+ "svg",
960
+ {
961
+ width: "22",
962
+ height: "38",
963
+ viewBox: "0 0 36 62",
964
+ "aria-hidden": "true",
965
+ className: "ds:block ds:shrink-0",
966
+ children: [
967
+ /* @__PURE__ */ d(
968
+ "image",
969
+ {
970
+ href: Gt(i, n),
971
+ x: w,
972
+ y: a,
973
+ width: m,
974
+ height: S,
975
+ preserveAspectRatio: "xMidYMid meet",
976
+ opacity: l ? 0.25 : 1
977
+ }
978
+ ),
979
+ o ? /* @__PURE__ */ d(
980
+ "image",
981
+ {
982
+ href: Zt(i, n, o),
983
+ x: w,
984
+ y: a,
985
+ width: m,
986
+ height: S,
987
+ preserveAspectRatio: "xMidYMid meet"
988
+ }
989
+ ) : null,
990
+ v ? /* @__PURE__ */ d(
991
+ "rect",
992
+ {
993
+ x: 3,
994
+ y: 2,
995
+ width: 30,
996
+ height: 58,
997
+ fill: "none",
998
+ stroke: ke[t],
999
+ strokeWidth: 2,
1000
+ strokeDasharray: t === "filled" ? "4 2" : void 0,
1001
+ rx: 6
1002
+ }
1003
+ ) : null,
1004
+ l ? /* @__PURE__ */ d(
1005
+ "path",
1006
+ {
1007
+ d: "M7 9 L29 53 M29 9 L7 53",
1008
+ stroke: ke.missing,
1009
+ strokeWidth: 2,
1010
+ fill: "none"
1011
+ }
1012
+ ) : null
1013
+ ]
1014
+ }
1015
+ );
1016
+ }
1017
+ function dr({ assetBaseUrl: t }) {
1018
+ const { t: n } = Yt();
1019
+ return /* @__PURE__ */ k(
1020
+ "section",
1021
+ {
1022
+ "aria-label": n("toothScheme.legendLabel"),
1023
+ "data-testid": "tooth-scheme-legend",
1024
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:rounded-[var(--radius-md)] ds:bg-[var(--card)] ds:border ds:border-[color:var(--card-border)] ds:p-[var(--spacing-sm)] ds:shadow-[var(--shadow-card)] ds:[.theme-accessible_&]:border-2",
1025
+ children: [
1026
+ /* @__PURE__ */ d("span", { className: "type-eyebrow ds:text-[color:var(--muted-foreground)]", children: n("toothScheme.legendLabel") }),
1027
+ /* @__PURE__ */ d("ul", { className: nr(), children: sr.map((i) => /* @__PURE__ */ k(
1028
+ "li",
1029
+ {
1030
+ className: rr(),
1031
+ "data-condition": i,
1032
+ "data-testid": `tooth-scheme-legend-item-${i}`,
1033
+ children: [
1034
+ /* @__PURE__ */ d(cr, { condition: i, assetBaseUrl: t }),
1035
+ /* @__PURE__ */ d("span", { children: n(`toothScheme.condition.${i}`) })
1036
+ ]
1037
+ },
1038
+ i
1039
+ )) })
1040
+ ]
1041
+ }
1042
+ );
1043
+ }
1044
+ function ot({
1045
+ label: t,
1046
+ value: n,
1047
+ options: i,
1048
+ onValueChange: o,
1049
+ container: l
1050
+ }) {
1051
+ return /* @__PURE__ */ k("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
1052
+ /* @__PURE__ */ d(
1053
+ "span",
1054
+ {
1055
+ "aria-hidden": "true",
1056
+ className: "type-label ds:text-[color:var(--muted-foreground)]",
1057
+ children: t
1058
+ }
1059
+ ),
1060
+ /* @__PURE__ */ d(
1061
+ Rn,
1062
+ {
1063
+ size: "md",
1064
+ "aria-label": t,
1065
+ value: n,
1066
+ options: i,
1067
+ onValueChange: o,
1068
+ container: l
1069
+ }
1070
+ )
1071
+ ] });
1072
+ }
1073
+ function lr(t, n) {
1074
+ return t.date === n.date ? 0 : t.date ? n.date && t.date < n.date ? 1 : -1 : 1;
1075
+ }
1076
+ const Ie = kn(
1077
+ ({
1078
+ id: t,
1079
+ dentition: n = "permanent",
1080
+ numbering: i = "fdi",
1081
+ mode: o = "interactive",
1082
+ projection: l = "side",
1083
+ specialElements: v,
1084
+ value: m,
1085
+ defaultValue: S,
1086
+ onChange: w,
1087
+ onSelect: a,
1088
+ conditions: M,
1089
+ radiographs: $,
1090
+ radiographDisplay: F = "badge",
1091
+ onOpenRadiographs: R,
1092
+ activeCondition: p,
1093
+ assetBaseUrl: A = "/toothscheme/teeth",
1094
+ legend: ie = !1,
1095
+ controls: q = !1,
1096
+ controlsContainer: ne,
1097
+ ariaLabel: Pe,
1098
+ className: He,
1099
+ _arch: ae,
1100
+ _numbersPosition: ue = "between",
1101
+ _inner: Ce = !1,
1102
+ _contentWidth: Bt
1103
+ }, Xt) => {
1104
+ var Rt;
1105
+ const { t: u } = Yt(), [Jt, lt] = Z(n), [en, ut] = Z(i), [tn, ht] = Z(l), [nn, pt] = Z(ie), [rn, mt] = Z(
1106
+ v
1107
+ ), [Qe, on] = Z(null), j = q ? Jt : n, he = q ? en : i, ft = q ? nn : ie, pe = q ? tn : l, D = pe === "plan" ? "plan" : "side", Re = pe === "both" && !Ce, gt = pe === "both", G = q ? rn ?? gt : v ?? gt, bt = qe(q);
1108
+ Se(() => {
1109
+ q && !bt.current && (lt(n), ut(i), ht(l), pt(ie), mt(v)), bt.current = q;
1110
+ }, [
1111
+ q,
1112
+ n,
1113
+ i,
1114
+ l,
1115
+ ie,
1116
+ v
1117
+ ]);
1118
+ const [an, vt] = Z(() => m !== void 0 ? m : S !== void 0 ? S : M ? Pt(M) : {}), f = rt({ value: m }) ? m : an;
1119
+ Se(() => {
1120
+ rt({ value: m }) || M !== void 0 && vt(Pt(M));
1121
+ }, [M, m]);
1122
+ const I = D === "plan" ? 44 : zt, N = $e(
1123
+ () => zn(j, I, ae ? { arch: ae } : {}),
1124
+ [j, I, ae]
1125
+ ), me = $e(() => {
1126
+ if (!G) return [];
1127
+ if (ae)
1128
+ return Fe(
1129
+ Ke(j, ae, D),
1130
+ N.width
1131
+ ).specials;
1132
+ const e = Fe(
1133
+ Ke(j, "upper", D),
1134
+ N.width
1135
+ ).specials, r = I + at, s = Fe(
1136
+ Ke(j, "lower", D),
1137
+ N.width
1138
+ ).specials.map((c) => ({ ...c, y: r }));
1139
+ return [...e, ...s];
1140
+ }, [G, ae, j, D, N.width, I]), sn = $e(() => {
1141
+ if (!Re) return;
1142
+ if (!G) return N.width;
1143
+ let e = N.width;
1144
+ for (const r of ["upper", "lower"])
1145
+ for (const s of ["side", "plan"]) {
1146
+ const c = Fe(
1147
+ Ke(j, r, s),
1148
+ N.width
1149
+ ).width;
1150
+ c > e && (e = c);
1151
+ }
1152
+ return e;
1153
+ }, [Re, G, j, N.width]), re = $e(
1154
+ () => [
1155
+ ...N.teeth.map((e) => e.fdi),
1156
+ // Special slots join keyboard nav only when interactive — in display /
1157
+ // radiograph-open mode they are decorative (role="img"), so the
1158
+ // radiograph-open keyboard path never reaches a region id.
1159
+ ...o === "interactive" ? me.map((e) => e.element.id) : []
1160
+ ],
1161
+ [N, me, o]
1162
+ ), Ue = re[0], [fe, V] = Z(Ue);
1163
+ Se(() => {
1164
+ (!fe || !re.includes(fe)) && V(Ue);
1165
+ }, [Ue, fe, re]);
1166
+ const [cn, ge] = Z(""), Ye = qe(null), _ = O(
1167
+ (e) => {
1168
+ rt({ value: m }) || vt(e), w == null || w(e);
1169
+ },
1170
+ [w, m]
1171
+ ), W = O((e) => {
1172
+ const r = Ye.current;
1173
+ if (!r) return;
1174
+ const s = r.querySelector(`g[data-fdi="${e}"]`);
1175
+ s && (s.focus(), V(e));
1176
+ }, []), se = O(
1177
+ (e, r) => {
1178
+ const s = r.map((c) => u(`toothScheme.condition.${c}`)).join(", ");
1179
+ if (Vn(e)) {
1180
+ const c = Ut(Vt[e], u);
1181
+ return r.length > 0 ? u("toothScheme.elementSelected", {
1182
+ name: c,
1183
+ conditions: s
1184
+ }) : u("toothScheme.elementDeselected", { name: c });
1185
+ }
1186
+ return r.length > 0 ? u("toothScheme.selected", { id: e, conditions: s }) : u("toothScheme.deselected", { id: e });
1187
+ },
1188
+ [u]
1189
+ ), U = D === "plan" && o === "interactive" && (p === "caries" || p === "filled"), [E, be] = Z(null);
1190
+ Se(() => {
1191
+ (!U || E && !re.includes(E.fdi)) && be(null);
1192
+ }, [U, E, re]);
1193
+ const yt = O((e, r) => {
1194
+ var c;
1195
+ const s = (c = Ye.current) == null ? void 0 : c.querySelector(
1196
+ `path[data-fdi="${e}"][data-zone="${r}"]`
1197
+ );
1198
+ s == null || s.focus();
1199
+ }, []), Ze = qe(null);
1200
+ Se(() => {
1201
+ E ? yt(E.fdi, E.zone) : Ze.current && W(Ze.current.fdi), Ze.current = E;
1202
+ }, [E, yt, W]);
1203
+ const dn = O(
1204
+ (e, r) => {
1205
+ const s = f[e];
1206
+ return !!(s && s.surfaces.includes(r) && s.conditions.includes(p));
1207
+ },
1208
+ [f, p]
1209
+ ), wt = O(
1210
+ (e, r) => {
1211
+ r && r.conditions.length > 0 ? ge(
1212
+ u("toothScheme.selected", {
1213
+ id: e,
1214
+ conditions: r.conditions.map((s) => u(`toothScheme.condition.${s}`)).join(", ")
1215
+ })
1216
+ ) : ge(u("toothScheme.deselected", { id: e }));
1217
+ },
1218
+ [u]
1219
+ ), ze = O(
1220
+ (e, r) => {
1221
+ if (!U) return;
1222
+ const s = p, c = f[e] ?? We(), g = c.surfaces.includes(r), T = c.conditions.includes(s);
1223
+ let h, x;
1224
+ g && T ? (h = c.surfaces.filter((Y) => Y !== r), x = h.length === 0 ? c.conditions.filter((Y) => Y !== s) : c.conditions) : (h = g ? c.surfaces : [...c.surfaces, r], x = T ? c.conditions : [...c.conditions, s]);
1225
+ const y = { ...f };
1226
+ x.length === 0 && h.length === 0 ? delete y[e] : y[e] = { ...c, conditions: x, surfaces: h }, _(y), wt(e, y[e]), a == null || a(e);
1227
+ },
1228
+ [
1229
+ U,
1230
+ p,
1231
+ f,
1232
+ _,
1233
+ wt,
1234
+ a
1235
+ ]
1236
+ ), Ge = O((e) => {
1237
+ const r = Q[e];
1238
+ r && (V(e), be({ fdi: e, zone: nt(r)[0] }));
1239
+ }, []), ln = O(
1240
+ (e, r, s) => {
1241
+ const c = Q[r];
1242
+ if (c)
1243
+ switch (e.key) {
1244
+ case "ArrowUp":
1245
+ case "ArrowDown":
1246
+ case "ArrowLeft":
1247
+ case "ArrowRight": {
1248
+ e.preventDefault(), e.stopPropagation();
1249
+ const g = nt(c).includes("center"), T = ar(s, e.key, g);
1250
+ T !== s && be({ fdi: r, zone: T });
1251
+ return;
1252
+ }
1253
+ case " ":
1254
+ case "Enter": {
1255
+ e.preventDefault(), e.stopPropagation(), ze(r, jt(c, s));
1256
+ return;
1257
+ }
1258
+ case "Escape": {
1259
+ e.preventDefault(), e.stopPropagation(), be(null);
1260
+ return;
1261
+ }
1262
+ default:
1263
+ return;
1264
+ }
1265
+ },
1266
+ [ze]
1267
+ ), un = qe(null), Ee = o === "display" && typeof R == "function", ve = o === "interactive" || Ee, ye = O(
1268
+ (e) => {
1269
+ V(e), a == null || a(e), R == null || R(e);
1270
+ },
1271
+ [a, R]
1272
+ ), Ve = $e(
1273
+ () => ({
1274
+ focusTooth: (e) => {
1275
+ W(e);
1276
+ },
1277
+ getChart: () => f,
1278
+ getTooth: (e) => {
1279
+ var r;
1280
+ return ((r = f[e]) == null ? void 0 : r.conditions) ?? [];
1281
+ },
1282
+ teethWith: (e) => Object.entries(f).filter(([, r]) => r.conditions.includes(e)).map(([r]) => r),
1283
+ setFinding: (e, r, s) => {
1284
+ const c = f[e] ?? We();
1285
+ if (c.conditions.includes(r) && !s) return;
1286
+ const g = {
1287
+ ...f,
1288
+ [e]: {
1289
+ ...c,
1290
+ conditions: c.conditions.includes(r) ? c.conditions : [...c.conditions, r],
1291
+ surfaces: s ?? c.surfaces
1292
+ }
1293
+ };
1294
+ _(g);
1295
+ },
1296
+ removeFinding: (e, r) => {
1297
+ const s = f[e];
1298
+ if (!s || !s.conditions.includes(r)) return;
1299
+ const c = s.conditions.filter((T) => T !== r), g = { ...f };
1300
+ c.length === 0 ? delete g[e] : g[e] = { ...s, conditions: c }, _(g);
1301
+ },
1302
+ clearTooth: (e) => {
1303
+ if (!f[e]) return;
1304
+ const r = { ...f };
1305
+ delete r[e], _(r);
1306
+ },
1307
+ getRadiographs: (e) => ($ == null ? void 0 : $[e]) ?? [],
1308
+ teethWithRadiographs: () => Object.keys($ ?? {}).filter(
1309
+ (e) => {
1310
+ var r;
1311
+ return (((r = $ == null ? void 0 : $[e]) == null ? void 0 : r.length) ?? 0) > 0;
1312
+ }
1313
+ ),
1314
+ openRadiographs: (e) => {
1315
+ W(e), ye(e);
1316
+ }
1317
+ }),
1318
+ [f, _, W, $, ye]
1319
+ );
1320
+ Tn(Xt, () => Ve, [Ve]), Ln(
1321
+ Nn,
1322
+ Ve,
1323
+ Ce ? void 0 : t
1324
+ );
1325
+ const xt = O(
1326
+ (e, r) => {
1327
+ var T;
1328
+ if (!ve) return;
1329
+ const s = Q[r], c = re, g = c.indexOf(r);
1330
+ switch (e.key) {
1331
+ case "ArrowRight": {
1332
+ e.preventDefault();
1333
+ const h = Math.min(c.length - 1, g + 1);
1334
+ W(c[h]);
1335
+ return;
1336
+ }
1337
+ case "ArrowLeft": {
1338
+ e.preventDefault();
1339
+ const h = Math.max(0, g - 1);
1340
+ W(c[h]);
1341
+ return;
1342
+ }
1343
+ case "ArrowUp":
1344
+ case "ArrowDown": {
1345
+ if (e.preventDefault(), !s) return;
1346
+ const x = {
1347
+ 1: 4,
1348
+ 4: 1,
1349
+ 2: 3,
1350
+ 3: 2,
1351
+ 5: 8,
1352
+ 8: 5,
1353
+ 6: 7,
1354
+ 7: 6
1355
+ }[s.quadrant];
1356
+ if (!x) return;
1357
+ const y = `${x}${s.positionInQuadrant}`;
1358
+ c.includes(y) && W(y);
1359
+ return;
1360
+ }
1361
+ case "Home": {
1362
+ if (e.preventDefault(), !s) return;
1363
+ const h = c.filter(
1364
+ (x) => {
1365
+ var y;
1366
+ return ((y = Q[x]) == null ? void 0 : y.quadrant) === s.quadrant;
1367
+ }
1368
+ );
1369
+ h.length > 0 && W(h[0]);
1370
+ return;
1371
+ }
1372
+ case "End": {
1373
+ if (e.preventDefault(), !s) return;
1374
+ const h = c.filter(
1375
+ (x) => {
1376
+ var y;
1377
+ return ((y = Q[x]) == null ? void 0 : y.quadrant) === s.quadrant;
1378
+ }
1379
+ );
1380
+ h.length > 0 && W(h[h.length - 1]);
1381
+ return;
1382
+ }
1383
+ case " ":
1384
+ case "Enter": {
1385
+ if (e.preventDefault(), Ee) {
1386
+ ye(r);
1387
+ return;
1388
+ }
1389
+ if (U && s) {
1390
+ Ge(r);
1391
+ return;
1392
+ }
1393
+ const h = (T = f[r]) == null ? void 0 : T.conditions, x = Qt(h, p), y = { ...f };
1394
+ x.length === 0 ? delete y[r] : y[r] = {
1395
+ ...f[r] ?? We(),
1396
+ conditions: x
1397
+ }, ge(se(r, x)), _(y), a == null || a(r);
1398
+ return;
1399
+ }
1400
+ default:
1401
+ return;
1402
+ }
1403
+ },
1404
+ [
1405
+ p,
1406
+ se,
1407
+ f,
1408
+ _,
1409
+ Ge,
1410
+ W,
1411
+ ye,
1412
+ a,
1413
+ Ee,
1414
+ U,
1415
+ ve,
1416
+ re
1417
+ ]
1418
+ ), St = O(
1419
+ (e) => {
1420
+ var g;
1421
+ if (o !== "interactive") return;
1422
+ V(e);
1423
+ const r = (g = f[e]) == null ? void 0 : g.conditions, s = Qt(r, p), c = { ...f };
1424
+ s.length === 0 ? delete c[e] : c[e] = {
1425
+ ...f[e] ?? We(),
1426
+ conditions: s
1427
+ }, ge(se(e, s)), _(c), a == null || a(e);
1428
+ },
1429
+ [p, se, f, _, o, a]
1430
+ ), oe = j === "primary" ? "mGeneral" : "general", $t = (((Rt = f[oe]) == null ? void 0 : Rt.conditions.length) ?? 0) > 0, hn = O(
1431
+ (e) => {
1432
+ var s;
1433
+ const r = { ...f };
1434
+ e ? r[oe] = {
1435
+ conditions: [p ?? "caries"],
1436
+ surfaces: []
1437
+ } : delete r[oe], ge(
1438
+ se(oe, ((s = r[oe]) == null ? void 0 : s.conditions) ?? [])
1439
+ ), _(r), a == null || a(oe);
1440
+ },
1441
+ [
1442
+ p,
1443
+ se,
1444
+ f,
1445
+ _,
1446
+ oe,
1447
+ a
1448
+ ]
1449
+ ), It = ue === "above" ? 16 : 2, pn = ue === "below" ? 16 : 2, mn = me.length > 0 ? Math.max(...me.map((e) => e.x)) + ee : 0, kt = Math.max(
1450
+ Bt ?? 0,
1451
+ N.width,
1452
+ mn
1453
+ ) + 4, Tt = N.height + It + pn, Be = Pe ?? u("toothScheme.ariaLabel"), fn = ve ? void 0 : 0, At = Re ? null : /* @__PURE__ */ k(
1454
+ "svg",
1455
+ {
1456
+ ref: Ye,
1457
+ viewBox: `0 ${-It} ${kt} ${Tt}`,
1458
+ width: kt,
1459
+ height: Tt,
1460
+ className: tr(),
1461
+ role: "group",
1462
+ "aria-label": Be,
1463
+ focusable: "false",
1464
+ "data-testid": "tooth-scheme-svg",
1465
+ xmlns: "http://www.w3.org/2000/svg",
1466
+ children: [
1467
+ N.teeth.map((e) => {
1468
+ var qt;
1469
+ const r = f[e.fdi], s = (qt = r == null ? void 0 : r.conditions) == null ? void 0 : qt[0], c = u(`toothScheme.anatomy.${e.meta.anatomy}`), g = s ? `, ${u(`toothScheme.condition.${s}`)}` : "", T = ($ == null ? void 0 : $[e.fdi]) ?? [], h = T.length, x = h > 0, y = x ? [...T].sort(lr)[0] : void 0, Y = F === "thumbnail" && y !== void 0, Ne = x ? `, ${u("toothScheme.radiographBadge", { count: h })}` : "", B = Ce ? `, ${u(D === "plan" ? "toothScheme.view.occlusal" : "toothScheme.view.side")}` : "", Xe = u("toothScheme.toothLabel", {
1470
+ id: Wt(e.fdi, he),
1471
+ anatomy: c,
1472
+ conditionSuffix: g
1473
+ }) + Ne + B, _e = ve ? E ? -1 : e.fdi === fe ? 0 : -1 : void 0, ce = (r == null ? void 0 : r.conditions) ?? [], Et = ce.includes("missing"), vn = ce.map((b) => ({
1474
+ condition: b,
1475
+ spec: it[b]
1476
+ })).filter(
1477
+ (b) => !!b.spec
1478
+ ), Je = ce.find(
1479
+ (b) => b !== "missing" && !it[b]
1480
+ ), Mt = Je ? ke[Je] : void 0, yn = (s ? `${c} · ${u(`toothScheme.condition.${s}`)}` : c) + (x ? ` · ${u("toothScheme.radiographBadge", { count: h })}` : ""), Dt = Wt(e.fdi, he), wn = Gt(
1481
+ e.meta,
1482
+ A,
1483
+ "default",
1484
+ D
1485
+ ), xn = Y && y ? y.thumbnailUrl ?? y.url : wn, Sn = D === "plan" ? ce.flatMap((b) => {
1486
+ const H = Un[b];
1487
+ return H ? ((r == null ? void 0 : r.surfaces) ?? []).map((Oe) => ({
1488
+ key: `${b}-${Oe}`,
1489
+ url: Yn(
1490
+ e.meta,
1491
+ A,
1492
+ H,
1493
+ Oe
1494
+ )
1495
+ })) : [];
1496
+ }) : [], Nt = (e.meta.dentition === "primary" ? Hn : 1) * 0.9, de = z * Nt, le = I * Nt, we = (z - de) / 2, xe = (I - le) / 2, P = U && (E == null ? void 0 : E.fdi) === e.fdi, _t = U ? nt(e.meta) : [], $n = _t.includes("center"), Ot = ue === "above" ? -4 : ue === "below" ? I + 12 : ue === "none" ? null : e.meta.arch === "upper" ? I + 12 : -4;
1497
+ return /* @__PURE__ */ k(K.Root, { children: [
1498
+ /* @__PURE__ */ d(K.Trigger, { asChild: !0, children: /* @__PURE__ */ k(
1499
+ "g",
1500
+ {
1501
+ "data-fdi": e.fdi,
1502
+ "data-anatomy": e.meta.anatomy,
1503
+ "data-arch": e.meta.arch,
1504
+ "data-side": e.meta.side,
1505
+ "data-quadrant": e.meta.quadrant,
1506
+ "data-condition": s ?? "none",
1507
+ "data-testid": `tooth-${e.fdi}`,
1508
+ transform: `translate(${e.x}, ${e.y})`,
1509
+ tabIndex: _e,
1510
+ role: P ? "group" : ve ? "button" : "img",
1511
+ "aria-label": Xe,
1512
+ "aria-pressed": P ? void 0 : o === "interactive" ? s !== void 0 : void 0,
1513
+ className: Ht(),
1514
+ onClick: P ? void 0 : o === "interactive" ? U ? () => Ge(e.fdi) : () => St(e.fdi) : Ee ? () => ye(e.fdi) : void 0,
1515
+ onFocus: () => V(e.fdi),
1516
+ onKeyDown: P ? void 0 : (b) => xt(b, e.fdi),
1517
+ children: [
1518
+ /* @__PURE__ */ d(
1519
+ "rect",
1520
+ {
1521
+ x: -L,
1522
+ y: -L,
1523
+ width: z + L * 2,
1524
+ height: I + L * 2,
1525
+ fill: "transparent"
1526
+ }
1527
+ ),
1528
+ /* @__PURE__ */ d(
1529
+ "image",
1530
+ {
1531
+ href: xn,
1532
+ x: we,
1533
+ y: xe,
1534
+ width: de,
1535
+ height: le,
1536
+ preserveAspectRatio: Y ? "xMidYMid slice" : "xMidYMid meet",
1537
+ opacity: Et && !Y ? 0.25 : 1,
1538
+ "aria-hidden": "true"
1539
+ }
1540
+ ),
1541
+ D === "side" ? vn.map(({ condition: b, spec: H }) => /* @__PURE__ */ d(
1542
+ "image",
1543
+ {
1544
+ href: Zt(
1545
+ e.meta,
1546
+ A,
1547
+ H
1548
+ ),
1549
+ x: we,
1550
+ y: xe,
1551
+ width: de,
1552
+ height: le,
1553
+ preserveAspectRatio: "xMidYMid meet",
1554
+ "aria-hidden": "true",
1555
+ pointerEvents: "none"
1556
+ },
1557
+ b
1558
+ )) : null,
1559
+ D === "plan" ? Sn.map(({ key: b, url: H }) => /* @__PURE__ */ d(
1560
+ "image",
1561
+ {
1562
+ href: H,
1563
+ x: we,
1564
+ y: xe,
1565
+ width: de,
1566
+ height: le,
1567
+ preserveAspectRatio: "xMidYMid meet",
1568
+ "aria-hidden": "true",
1569
+ pointerEvents: "none"
1570
+ },
1571
+ b
1572
+ )) : null,
1573
+ U ? _t.map((b) => {
1574
+ const H = jt(e.meta, b), Oe = dn(e.fdi, H);
1575
+ return /* @__PURE__ */ d(
1576
+ "path",
1577
+ {
1578
+ d: Zn(
1579
+ b,
1580
+ { x: we, y: xe, w: de, h: le },
1581
+ $n
1582
+ ),
1583
+ "data-fdi": e.fdi,
1584
+ "data-zone": b,
1585
+ "data-surface": H,
1586
+ "data-testid": `tooth-${e.fdi}-zone-${b}`,
1587
+ role: P ? "button" : void 0,
1588
+ tabIndex: P ? (E == null ? void 0 : E.zone) === b ? 0 : -1 : void 0,
1589
+ "aria-label": P ? u("toothScheme.toothLabel", {
1590
+ id: Dt,
1591
+ anatomy: u(
1592
+ `toothScheme.surface.${H}`
1593
+ ),
1594
+ conditionSuffix: ""
1595
+ }) : void 0,
1596
+ "aria-pressed": P ? Oe : void 0,
1597
+ strokeWidth: "var(--focus-ring-width)",
1598
+ className: ir(),
1599
+ onClick: (X) => {
1600
+ X.stopPropagation(), P || V(e.fdi), ze(e.fdi, H);
1601
+ },
1602
+ onKeyDown: P ? (X) => ln(X, e.fdi, b) : void 0,
1603
+ onFocus: P ? () => be(
1604
+ (X) => X && X.fdi === e.fdi && X.zone === b ? X : { fdi: e.fdi, zone: b }
1605
+ ) : void 0
1606
+ },
1607
+ b
1608
+ );
1609
+ }) : null,
1610
+ D === "side" && Mt ? /* @__PURE__ */ d(
1611
+ "rect",
1612
+ {
1613
+ x: 3,
1614
+ y: 2,
1615
+ width: z - 6,
1616
+ height: I - 4,
1617
+ fill: "none",
1618
+ stroke: Mt,
1619
+ strokeWidth: "2",
1620
+ strokeDasharray: Je === "filled" ? "4 2" : void 0,
1621
+ rx: "6",
1622
+ pointerEvents: "none"
1623
+ }
1624
+ ) : null,
1625
+ Et ? /* @__PURE__ */ d(
1626
+ "path",
1627
+ {
1628
+ d: `M7 9 L${z - 7} ${I - 9} M${z - 7} 9 L7 ${I - 9}`,
1629
+ stroke: ke.missing,
1630
+ strokeWidth: "2",
1631
+ fill: "none",
1632
+ pointerEvents: "none"
1633
+ }
1634
+ ) : null,
1635
+ Y ? /* @__PURE__ */ d(
1636
+ "rect",
1637
+ {
1638
+ x: we,
1639
+ y: xe,
1640
+ width: de,
1641
+ height: le,
1642
+ fill: "none",
1643
+ stroke: "var(--border)",
1644
+ strokeWidth: "1",
1645
+ rx: "3",
1646
+ pointerEvents: "none"
1647
+ }
1648
+ ) : null,
1649
+ x ? /* @__PURE__ */ k(
1650
+ "g",
1651
+ {
1652
+ "data-testid": `tooth-${e.fdi}-radiograph-badge`,
1653
+ "data-radiograph-count": h,
1654
+ transform: `translate(${z - (h >= 10 ? 19 : 15)}, ${I - 13})`,
1655
+ pointerEvents: "none",
1656
+ "aria-hidden": "true",
1657
+ children: [
1658
+ /* @__PURE__ */ d(
1659
+ "rect",
1660
+ {
1661
+ width: h >= 10 ? 17 : 13,
1662
+ height: 12,
1663
+ rx: "3.5",
1664
+ fill: "var(--card)",
1665
+ stroke: "var(--info-foreground)",
1666
+ strokeWidth: "0.75"
1667
+ }
1668
+ ),
1669
+ /* @__PURE__ */ d(
1670
+ "text",
1671
+ {
1672
+ x: (h >= 10 ? 17 : 13) / 2,
1673
+ y: 9,
1674
+ textAnchor: "middle",
1675
+ fontSize: "9",
1676
+ fontWeight: "600",
1677
+ fill: "var(--info-foreground)",
1678
+ className: "ds:select-none",
1679
+ children: h
1680
+ }
1681
+ )
1682
+ ]
1683
+ }
1684
+ ) : null,
1685
+ /* @__PURE__ */ d(
1686
+ "rect",
1687
+ {
1688
+ x: -L,
1689
+ y: -L,
1690
+ width: z + L * 2,
1691
+ height: I + L * 2,
1692
+ fill: "none",
1693
+ stroke: "var(--ring)",
1694
+ strokeWidth: "var(--focus-ring-width)",
1695
+ className: [
1696
+ "ds:opacity-0",
1697
+ "ds:group-focus-visible:opacity-100",
1698
+ "ds:forced-colors:stroke-[CanvasText]"
1699
+ ].join(" "),
1700
+ "data-testid": `tooth-${e.fdi}-focus-ring`,
1701
+ pointerEvents: "none",
1702
+ rx: "4"
1703
+ }
1704
+ ),
1705
+ Ot !== null ? /* @__PURE__ */ d(
1706
+ "text",
1707
+ {
1708
+ x: z / 2,
1709
+ y: Ot,
1710
+ textAnchor: "middle",
1711
+ fontSize: "10",
1712
+ fill: "var(--muted-foreground)",
1713
+ className: "ds:select-none",
1714
+ "aria-hidden": "true",
1715
+ children: Dt
1716
+ }
1717
+ ) : null
1718
+ ]
1719
+ }
1720
+ ) }),
1721
+ /* @__PURE__ */ d(K.Portal, { children: /* @__PURE__ */ k(
1722
+ K.Content,
1723
+ {
1724
+ side: "top",
1725
+ sideOffset: 6,
1726
+ className: "ds:z-[var(--z-tooltip)] ds:rounded-[var(--radius-sm)] ds:bg-[var(--foreground)] ds:text-[var(--background)] ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)] ds:pt-[calc(var(--spacing-xs)/2)] ds:pb-[calc(var(--spacing-xs)/2)] ds:text-[length:var(--font-size-xs)]",
1727
+ children: [
1728
+ yn,
1729
+ /* @__PURE__ */ d(K.Arrow, { className: "ds:fill-[var(--foreground)]" })
1730
+ ]
1731
+ }
1732
+ ) })
1733
+ ] }, e.fdi);
1734
+ }),
1735
+ me.map(({ element: e, x: r, y: s }) => {
1736
+ var _e;
1737
+ const c = f[e.id], g = (_e = c == null ? void 0 : c.conditions) == null ? void 0 : _e[0], T = g !== void 0, h = Ut(e, u), x = g ? `, ${u(`toothScheme.condition.${g}`)}` : "", y = u("toothScheme.elementLabel", {
1738
+ name: h,
1739
+ conditionSuffix: x
1740
+ }), Y = g ? ke[g] : void 0, Ne = Bn(e, A), B = o === "interactive", Xe = B ? e.id === fe ? 0 : -1 : void 0;
1741
+ return /* @__PURE__ */ k(K.Root, { children: [
1742
+ /* @__PURE__ */ d(K.Trigger, { asChild: !0, children: /* @__PURE__ */ k(
1743
+ "g",
1744
+ {
1745
+ "data-fdi": e.id,
1746
+ "data-special": e.kind,
1747
+ "data-arch": e.arch,
1748
+ "data-condition": g ?? "none",
1749
+ "data-testid": `element-${e.id}`,
1750
+ transform: `translate(${r}, ${s})`,
1751
+ tabIndex: Xe,
1752
+ role: B ? "button" : "img",
1753
+ "aria-label": y,
1754
+ "aria-pressed": B ? T : void 0,
1755
+ className: Ht(),
1756
+ onClick: B ? () => St(e.id) : void 0,
1757
+ onFocus: B ? () => V(e.id) : void 0,
1758
+ onKeyDown: B ? (ce) => xt(ce, e.id) : void 0,
1759
+ children: [
1760
+ /* @__PURE__ */ d(
1761
+ "rect",
1762
+ {
1763
+ x: -L,
1764
+ y: -L,
1765
+ width: ee + L * 2,
1766
+ height: I + L * 2,
1767
+ fill: "transparent"
1768
+ }
1769
+ ),
1770
+ /* @__PURE__ */ d(
1771
+ "rect",
1772
+ {
1773
+ x: 0,
1774
+ y: 0,
1775
+ width: ee,
1776
+ height: I,
1777
+ rx: 6,
1778
+ fill: T ? "var(--accent)" : "var(--card)",
1779
+ fillOpacity: T ? 0.16 : 1,
1780
+ stroke: Y ?? "var(--border)",
1781
+ strokeWidth: T ? 2 : 1
1782
+ }
1783
+ ),
1784
+ Ne ? /* @__PURE__ */ k(In, { children: [
1785
+ /* @__PURE__ */ d(
1786
+ "image",
1787
+ {
1788
+ href: Ne,
1789
+ x: 3,
1790
+ y: 3,
1791
+ width: ee - 6,
1792
+ height: I - 16,
1793
+ preserveAspectRatio: "xMidYMid meet",
1794
+ "aria-hidden": "true",
1795
+ pointerEvents: "none"
1796
+ }
1797
+ ),
1798
+ /* @__PURE__ */ d(
1799
+ "text",
1800
+ {
1801
+ x: ee / 2,
1802
+ y: I - 4,
1803
+ textAnchor: "middle",
1804
+ fontSize: "9",
1805
+ fontWeight: "600",
1806
+ fill: "var(--muted-foreground)",
1807
+ className: "ds:select-none",
1808
+ "aria-hidden": "true",
1809
+ children: e.code
1810
+ }
1811
+ )
1812
+ ] }) : /* @__PURE__ */ d(
1813
+ "text",
1814
+ {
1815
+ x: ee / 2,
1816
+ y: I / 2,
1817
+ textAnchor: "middle",
1818
+ dominantBaseline: "central",
1819
+ fontSize: "11",
1820
+ fontWeight: "600",
1821
+ fill: "var(--foreground)",
1822
+ className: "ds:select-none",
1823
+ "aria-hidden": "true",
1824
+ children: e.code
1825
+ }
1826
+ ),
1827
+ /* @__PURE__ */ d(
1828
+ "rect",
1829
+ {
1830
+ x: -L,
1831
+ y: -L,
1832
+ width: ee + L * 2,
1833
+ height: I + L * 2,
1834
+ fill: "none",
1835
+ stroke: "var(--ring)",
1836
+ strokeWidth: "var(--focus-ring-width)",
1837
+ className: [
1838
+ "ds:opacity-0",
1839
+ "ds:group-focus-visible:opacity-100",
1840
+ "ds:forced-colors:stroke-[CanvasText]"
1841
+ ].join(" "),
1842
+ "data-testid": `element-${e.id}-focus-ring`,
1843
+ pointerEvents: "none",
1844
+ rx: "6"
1845
+ }
1846
+ )
1847
+ ]
1848
+ }
1849
+ ) }),
1850
+ /* @__PURE__ */ d(K.Portal, { children: /* @__PURE__ */ k(
1851
+ K.Content,
1852
+ {
1853
+ side: "top",
1854
+ sideOffset: 6,
1855
+ className: "ds:z-[var(--z-tooltip)] ds:rounded-[var(--radius-sm)] ds:bg-[var(--foreground)] ds:text-[var(--background)] ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)] ds:pt-[calc(var(--spacing-xs)/2)] ds:pb-[calc(var(--spacing-xs)/2)] ds:text-[length:var(--font-size-xs)]",
1856
+ children: [
1857
+ g ? `${h} · ${u(`toothScheme.condition.${g}`)}` : h,
1858
+ /* @__PURE__ */ d(K.Arrow, { className: "ds:fill-[var(--foreground)]" })
1859
+ ]
1860
+ }
1861
+ ) })
1862
+ ] }, e.id);
1863
+ })
1864
+ ]
1865
+ }
1866
+ ), Lt = /* @__PURE__ */ d(
1867
+ "div",
1868
+ {
1869
+ className: or(),
1870
+ "aria-live": "polite",
1871
+ "aria-atomic": "true",
1872
+ "data-testid": "tooth-scheme-live",
1873
+ children: cn
1874
+ }
1875
+ );
1876
+ if (Ce)
1877
+ return /* @__PURE__ */ k(K.Provider, { delayDuration: 200, children: [
1878
+ At,
1879
+ Lt
1880
+ ] });
1881
+ const gn = (e) => u(e === "upper" ? "toothScheme.arch.upper" : "toothScheme.arch.lower"), Me = (e, r) => `${Be} — ${gn(e)}, ${u(r === "plan" ? "toothScheme.view.occlusal" : "toothScheme.view.side")}`, De = {
1882
+ dentition: j,
1883
+ numbering: he,
1884
+ mode: o,
1885
+ value: f,
1886
+ onChange: _,
1887
+ onSelect: a,
1888
+ activeCondition: p,
1889
+ assetBaseUrl: A,
1890
+ radiographs: $,
1891
+ radiographDisplay: F,
1892
+ onOpenRadiographs: R,
1893
+ specialElements: G,
1894
+ _inner: !0,
1895
+ _contentWidth: sn
1896
+ }, bn = /* @__PURE__ */ k("div", { className: er(), "data-testid": "tooth-scheme-both", children: [
1897
+ /* @__PURE__ */ d(
1898
+ Ie,
1899
+ {
1900
+ ...De,
1901
+ projection: "side",
1902
+ _arch: "upper",
1903
+ _numbersPosition: "above",
1904
+ ariaLabel: Me("upper", "side")
1905
+ }
1906
+ ),
1907
+ /* @__PURE__ */ d(
1908
+ Ie,
1909
+ {
1910
+ ...De,
1911
+ projection: "plan",
1912
+ _arch: "upper",
1913
+ _numbersPosition: "none",
1914
+ ariaLabel: Me("upper", "plan")
1915
+ }
1916
+ ),
1917
+ /* @__PURE__ */ d(
1918
+ Ie,
1919
+ {
1920
+ ...De,
1921
+ projection: "plan",
1922
+ _arch: "lower",
1923
+ _numbersPosition: "none",
1924
+ ariaLabel: Me("lower", "plan")
1925
+ }
1926
+ ),
1927
+ /* @__PURE__ */ d(
1928
+ Ie,
1929
+ {
1930
+ ...De,
1931
+ projection: "side",
1932
+ _arch: "lower",
1933
+ _numbersPosition: "below",
1934
+ ariaLabel: Me("lower", "side")
1935
+ }
1936
+ )
1937
+ ] }), Ct = q ? /* @__PURE__ */ d(
1938
+ "div",
1939
+ {
1940
+ className: ne != null ? "ds:flex ds:justify-end" : "ds:flex ds:w-full ds:justify-end",
1941
+ "data-testid": "tooth-scheme-controls",
1942
+ children: /* @__PURE__ */ k(et.Root, { children: [
1943
+ /* @__PURE__ */ d(et.Trigger, { asChild: !0, children: /* @__PURE__ */ d(
1944
+ Cn,
1945
+ {
1946
+ size: "sm",
1947
+ intent: "outline",
1948
+ icon: /* @__PURE__ */ d(En, { "aria-hidden": "true" }),
1949
+ "aria-label": u("toothScheme.options.label"),
1950
+ tooltip: u("toothScheme.options.label")
1951
+ }
1952
+ ) }),
1953
+ /* @__PURE__ */ d(
1954
+ et.Content,
1955
+ {
1956
+ ref: on,
1957
+ align: "end",
1958
+ size: "md",
1959
+ "aria-label": u("toothScheme.options.label"),
1960
+ children: /* @__PURE__ */ k("div", { className: "ds:flex ds:w-[var(--popover-size-sm)] ds:max-w-full ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1961
+ /* @__PURE__ */ k("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:border-b ds:border-[color:var(--border)] ds:pb-[var(--spacing-sm)] ds:[&>*]:w-full ds:[&>*]:justify-between", children: [
1962
+ /* @__PURE__ */ d(
1963
+ tt,
1964
+ {
1965
+ label: u("toothScheme.options.legend"),
1966
+ labelSide: "start",
1967
+ checked: ft,
1968
+ onCheckedChange: pt
1969
+ }
1970
+ ),
1971
+ /* @__PURE__ */ d(
1972
+ tt,
1973
+ {
1974
+ label: u("toothScheme.options.specialElements"),
1975
+ labelSide: "start",
1976
+ checked: G,
1977
+ onCheckedChange: mt
1978
+ }
1979
+ )
1980
+ ] }),
1981
+ /* @__PURE__ */ d(
1982
+ ot,
1983
+ {
1984
+ container: Qe,
1985
+ label: u("toothScheme.options.dentition"),
1986
+ value: j,
1987
+ onValueChange: (e) => lt(e),
1988
+ options: [
1989
+ {
1990
+ value: "permanent",
1991
+ label: u("toothScheme.dentition.permanent")
1992
+ },
1993
+ {
1994
+ value: "primary",
1995
+ label: u("toothScheme.dentition.primary")
1996
+ },
1997
+ {
1998
+ value: "mixed",
1999
+ label: u("toothScheme.dentition.mixed")
2000
+ }
2001
+ ]
2002
+ }
2003
+ ),
2004
+ /* @__PURE__ */ d(
2005
+ ot,
2006
+ {
2007
+ container: Qe,
2008
+ label: u("toothScheme.options.numbering"),
2009
+ value: he,
2010
+ onValueChange: (e) => ut(e),
2011
+ options: [
2012
+ {
2013
+ value: "fdi",
2014
+ label: u("toothScheme.numbering.fdi")
2015
+ },
2016
+ {
2017
+ value: "universal",
2018
+ label: u("toothScheme.numbering.universal")
2019
+ },
2020
+ {
2021
+ value: "palmer",
2022
+ label: u("toothScheme.numbering.palmer")
2023
+ }
2024
+ ]
2025
+ }
2026
+ ),
2027
+ /* @__PURE__ */ d(
2028
+ ot,
2029
+ {
2030
+ container: Qe,
2031
+ label: u("toothScheme.options.view"),
2032
+ value: pe,
2033
+ onValueChange: (e) => ht(e),
2034
+ options: [
2035
+ {
2036
+ value: "side",
2037
+ label: u("toothScheme.view.side")
2038
+ },
2039
+ {
2040
+ value: "plan",
2041
+ label: u("toothScheme.view.occlusal")
2042
+ },
2043
+ {
2044
+ value: "both",
2045
+ label: u("toothScheme.view.both")
2046
+ }
2047
+ ]
2048
+ }
2049
+ )
2050
+ ] })
2051
+ }
2052
+ )
2053
+ ] })
2054
+ }
2055
+ ) : null;
2056
+ return /* @__PURE__ */ d(K.Provider, { delayDuration: 200, children: /* @__PURE__ */ k(
2057
+ "div",
2058
+ {
2059
+ ref: un,
2060
+ role: "region",
2061
+ "aria-label": Be,
2062
+ tabIndex: fn,
2063
+ className: [Jn(), He].filter(Boolean).join(" "),
2064
+ "data-component": "tooth-scheme",
2065
+ "data-component-id": t,
2066
+ "data-testid": "tooth-scheme-root",
2067
+ "data-dentition": j,
2068
+ "data-numbering": he,
2069
+ "data-mode": o,
2070
+ "data-projection": D,
2071
+ "data-view-mode": pe,
2072
+ "data-special-elements": G ? "true" : "false",
2073
+ children: [
2074
+ ne === void 0 ? Ct : ne ? An(Ct, ne) : null,
2075
+ Re ? bn : At,
2076
+ G && (o === "interactive" || $t) ? /* @__PURE__ */ d(
2077
+ "div",
2078
+ {
2079
+ className: "ds:flex ds:w-full ds:items-center ds:pt-[var(--spacing-2xs)]",
2080
+ "data-testid": "tooth-scheme-general",
2081
+ children: /* @__PURE__ */ d(
2082
+ tt,
2083
+ {
2084
+ label: u("toothScheme.special.general"),
2085
+ labelSide: "end",
2086
+ checked: $t,
2087
+ disabled: o !== "interactive",
2088
+ onCheckedChange: hn
2089
+ }
2090
+ )
2091
+ }
2092
+ ) : null,
2093
+ ft ? /* @__PURE__ */ d(dr, { assetBaseUrl: A }) : null,
2094
+ Lt
2095
+ ]
2096
+ }
2097
+ ) });
2098
+ }
2099
+ );
2100
+ Ie.displayName = "ToothScheme";
2101
+ export {
2102
+ ke as C,
2103
+ Q as F,
2104
+ Ae as P,
2105
+ Vt as S,
2106
+ Ie as T,
2107
+ Un as a,
2108
+ it as b,
2109
+ $r as c,
2110
+ Pn as d,
2111
+ Wn as e,
2112
+ Le as f,
2113
+ Gn as g,
2114
+ Qn as h,
2115
+ Pt as i,
2116
+ Zt as j,
2117
+ kr as k,
2118
+ Ir as l,
2119
+ Vn as m,
2120
+ Wt as n,
2121
+ Fe as o,
2122
+ zn as p,
2123
+ Ke as q,
2124
+ Yn as r,
2125
+ Bn as s,
2126
+ Gt as t,
2127
+ Nn as u,
2128
+ Jn as v,
2129
+ jt as w,
2130
+ nt as x,
2131
+ Zn as z
2132
+ };
2133
+ //# sourceMappingURL=tooth-scheme-DJZtzfeY.js.map