@alfadocs/ui-kit 1.138.0 → 1.139.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 (232) hide show
  1. package/dist/_chunks/{address-fields-DvSWdeR0.js → address-fields-Bh9JZJHZ.js} +4 -4
  2. package/dist/_chunks/{ai-prompt-input-CVNeusoW.js → ai-prompt-input-B2QFwuJ1.js} +2 -2
  3. package/dist/_chunks/{anamnesis-summary-rows-Dr2V1Rtf.js → anamnesis-summary-rows-BgfBnjp0.js} +4 -4
  4. package/dist/_chunks/{audio-recorder-BOF5YYoC.js → audio-recorder-6dUq8I38.js} +2 -2
  5. package/dist/_chunks/autocomplete-HZNW7_Pa.js +642 -0
  6. package/dist/_chunks/{balance-badge-cell-BSB02Bwo.js → balance-badge-cell-CRrIv2hy.js} +4 -4
  7. package/dist/_chunks/{bill-line-table-By-YL2ms.js → bill-line-table-DCqxhode.js} +3 -3
  8. package/dist/_chunks/{bishop-score-DWGESRP9.js → bishop-score-M7Fi-ykx.js} +2 -2
  9. package/dist/_chunks/{calendar-appointment-editor-dialog-SxSkOTnO.js → calendar-appointment-editor-dialog-GdnaPIOV.js} +7 -7
  10. package/dist/_chunks/{calendar-editor-discard-host-DjUhoFr2.js → calendar-editor-discard-host-BcMEgVEq.js} +2 -2
  11. package/dist/_chunks/{calendar-waiting-list-panel-331vzAdl.js → calendar-waiting-list-panel-CkZBAv_E.js} +3 -3
  12. package/dist/_chunks/{calendar.sheets-aodjllWd.js → calendar.sheets-B0jP2Yt0.js} +112 -111
  13. package/dist/_chunks/{calls-panel-BIfatK90.js → calls-panel-CtxJAzkJ.js} +2 -2
  14. package/dist/_chunks/{city-input-DXipzTfZ.js → city-input-DARVDJhH.js} +2 -2
  15. package/dist/_chunks/{combobox-BBCVQS-S.js → combobox-BYl6mY4c.js} +12 -13
  16. package/dist/_chunks/{communications-panel-SQ-55e3V.js → communications-panel-DBWM9II9.js} +2 -2
  17. package/dist/_chunks/{country-select-C2GdvRtS.js → country-select-BPISkYVU.js} +3 -3
  18. package/dist/_chunks/{data-grid-CxKz8flO.js → data-grid-bQ6iFm10.js} +15 -7
  19. package/dist/_chunks/{data-table-_tgj0C_T.js → data-table-CnLfOwxg.js} +2 -2
  20. package/dist/_chunks/{default-tabs-oDWQzbN7.js → default-tabs-Dm_vk6hd.js} +3 -3
  21. package/dist/_chunks/{document-preview-CirR3C_m.js → document-preview-FTCHXYhk.js} +2 -2
  22. package/dist/_chunks/{face-scheme-D_Y1StPl.js → face-scheme-Bxt7ZnJn.js} +2 -2
  23. package/dist/_chunks/{file-manager-CEi4z2i0.js → file-manager-Bsccb8Jj.js} +2 -2
  24. package/dist/_chunks/{forgot-password-form-YvI9vX-G.js → forgot-password-form-B4ufmBFn.js} +5 -4
  25. package/dist/_chunks/{gestational-age-calculator-CHbpC4vL.js → gestational-age-calculator-DXSPWG8u.js} +2 -2
  26. package/dist/_chunks/{heatmap-_546qI2V.js → heatmap-CFPaEKD_.js} +2 -2
  27. package/dist/_chunks/{invoice-upload-list-CQI9MUl6.js → invoice-upload-list-Dz3CXHPP.js} +3 -3
  28. package/dist/_chunks/{kit-extensions-BNBf4m8O.js → kit-extensions-BB_ksnVl.js} +3 -3
  29. package/dist/_chunks/{link-cell-renderer-Xx5T8u5Q.js → link-cell-renderer-CSA0KKPe.js} +5 -5
  30. package/dist/_chunks/{login-dev-card-Dz3ezx1o.js → login-dev-card-oRh9h7N2.js} +18 -17
  31. package/dist/_chunks/medication-I6QvOq6k.js +21 -0
  32. package/dist/_chunks/medication-line-CHdlh-F7.js +222 -0
  33. package/dist/_chunks/medication-search-DoEDakoM.js +380 -0
  34. package/dist/_chunks/{multi-select-Df3R8lv_.js → multi-select-DeMiHm8T.js} +4 -5
  35. package/dist/_chunks/{muscle-scheme-D_rSyGDj.js → muscle-scheme-BB2eBfww.js} +2 -2
  36. package/dist/_chunks/normalize-diacritics-DhJjQ3Bp.js +7 -0
  37. package/dist/_chunks/{notes-panel-DsEKNtsw.js → notes-panel-CnmQqhwq.js} +2 -2
  38. package/dist/_chunks/{optical-prescription-DaSbsh4p.js → optical-prescription-C4jpDFOE.js} +2 -2
  39. package/dist/_chunks/{option-row-Dc7BrbK8.js → option-row-DpCnuUqo.js} +25 -12
  40. package/dist/_chunks/{patient-account-settings-Cs9y-pVA.js → patient-account-settings-DfEPHmCh.js} +2 -2
  41. package/dist/_chunks/{patient-check-in-resume-4qi_klQV.js → patient-check-in-resume-TWs8CPQr.js} +3 -3
  42. package/dist/_chunks/{patient-details-Dv7EiTCo.js → patient-details-DQTxSWY4.js} +2 -2
  43. package/dist/_chunks/{patient-field-row-DuHWGlLz.js → patient-field-row-CXuWQeQJ.js} +6 -6
  44. package/dist/_chunks/patient-picker-CQNsqYn2.js +163 -0
  45. package/dist/_chunks/{patient-search-DBvLFArV.js → patient-search-aTFd7p9s.js} +2 -2
  46. package/dist/_chunks/{patient-summary-card-D-cDzOim.js → patient-summary-card-j5u7c5Us.js} +2 -2
  47. package/dist/_chunks/{phone-input-BL8Sj6OG.js → phone-input-DRKcJUi4.js} +2 -2
  48. package/dist/_chunks/{portal-details-BGc_FLQk.js → portal-details-VfeOI4PB.js} +2 -2
  49. package/dist/_chunks/{portal-documents-BSI1U5lI.js → portal-documents-hGHlwmbv.js} +2 -2
  50. package/dist/_chunks/{pregnancy-dating-lJbzai73.js → pregnancy-dating-C-3NLI6K.js} +2 -2
  51. package/dist/_chunks/prescription-history-748qDVwZ.js +1544 -0
  52. package/dist/_chunks/print-sheet-CSeqkM3_.js +318 -0
  53. package/dist/_chunks/{province-select-CTM8A9SM.js → province-select-D-iY9bQG.js} +3 -3
  54. package/dist/_chunks/{registration-form-CuLiTA52.js → registration-form-Cs9o6e5q.js} +7 -6
  55. package/dist/_chunks/{reserved.agent-CabZHFJC.js → reserved.agent-L2ElYPuj.js} +7 -7
  56. package/dist/_chunks/{reset-password-form-D_TePSM1.js → reset-password-form-DwtSNhnA.js} +18 -17
  57. package/dist/_chunks/{rich-text-editor-C48omVjq.js → rich-text-editor-DFsH5RAj.js} +2 -2
  58. package/dist/_chunks/save-Dn8uje3f.js +22 -0
  59. package/dist/_chunks/{search-bar-CQ9_V3EJ.js → search-bar-k1mS5yZl.js} +2 -2
  60. package/dist/_chunks/{select-CIXKyUMw.js → select-Bm8s3q-X.js} +16 -17
  61. package/dist/_chunks/{send-registration-link-form-BjkXr0TD.js → send-registration-link-form-C1vw6H1M.js} +6 -5
  62. package/dist/_chunks/{signature-request-vJDSHZld.js → signature-request-D3sLLOM6.js} +2 -2
  63. package/dist/_chunks/sync-tray-BhnkgXKK.js +567 -0
  64. package/dist/_chunks/{tabs-Czkmw5ou.js → tabs-BXr5XeGq.js} +2 -2
  65. package/dist/_chunks/{task-editor-wKbFbGqW.js → task-editor-DDVDPKJf.js} +26 -25
  66. package/dist/_chunks/{tasks-panel-DbtJS4QI.js → tasks-panel-BHXaPNOZ.js} +2 -2
  67. package/dist/_chunks/{toolbar-DjG-cpD_.js → toolbar-Dz_hAUIZ.js} +2 -2
  68. package/dist/_chunks/{unit-converter-CUAUTu2B.js → unit-converter-CBy7S4Tl.js} +2 -2
  69. package/dist/_chunks/{use-appointment-details-read-jGkJalX8.js → use-appointment-details-read-CBSpX4DI.js} +2 -2
  70. package/dist/_chunks/use-error-summary-CecJZo6w.js +32 -0
  71. package/dist/_chunks/use-registration-submit-CVukOAQk.js +84 -0
  72. package/dist/_chunks/{variables-menu-DQl8H4Gh.js → variables-menu-C4NcClKi.js} +2 -2
  73. package/dist/_chunks/{voice-control-panel-Cp4vs1iy.js → voice-control-panel-Dc_NFH2R.js} +2 -2
  74. package/dist/agent-catalog.json +455 -1
  75. package/dist/agent-i18n/en.json +53 -0
  76. package/dist/appointment-editor-panel/index.js +2 -2
  77. package/dist/browser-support.js +1 -1
  78. package/dist/components/_shared/medication.d.ts +28 -0
  79. package/dist/components/_shared/normalize-diacritics.d.ts +5 -0
  80. package/dist/components/_shared/patient-picker.d.ts +7 -0
  81. package/dist/components/address-fields/index.js +1 -1
  82. package/dist/components/ai-prompt-input/index.js +1 -1
  83. package/dist/components/appointment-details-panel/index.js +1 -1
  84. package/dist/components/audio-recorder/index.js +1 -1
  85. package/dist/components/autocomplete/autocomplete.d.ts +50 -0
  86. package/dist/components/autocomplete/index.d.ts +1 -1
  87. package/dist/components/autocomplete/index.js +1 -1
  88. package/dist/components/bill-line-table/index.js +1 -1
  89. package/dist/components/bill-table/index.js +1 -1
  90. package/dist/components/bishop-score/index.js +1 -1
  91. package/dist/components/booking/index.js +1 -1
  92. package/dist/components/calls-panel/index.js +1 -1
  93. package/dist/components/city-input/index.js +1 -1
  94. package/dist/components/combobox/index.js +1 -1
  95. package/dist/components/communications-panel/index.js +1 -1
  96. package/dist/components/country-select/index.js +1 -1
  97. package/dist/components/data-grid/index.js +2 -2
  98. package/dist/components/data-table/index.js +2 -2
  99. package/dist/components/document-preview/index.js +1 -1
  100. package/dist/components/face-scheme/index.js +1 -1
  101. package/dist/components/file-manager/index.js +1 -1
  102. package/dist/components/gestational-age-calculator/index.js +1 -1
  103. package/dist/components/heatmap/index.js +1 -1
  104. package/dist/components/index.d.ts +5 -0
  105. package/dist/components/invoice-upload-list/index.js +1 -1
  106. package/dist/components/medication-line/index.d.ts +6 -0
  107. package/dist/components/medication-line/index.js +7 -0
  108. package/dist/components/medication-line/medication-line.agent.d.ts +14 -0
  109. package/dist/components/medication-line/medication-line.d.ts +40 -0
  110. package/dist/components/medication-search/index.d.ts +6 -0
  111. package/dist/components/medication-search/index.js +10 -0
  112. package/dist/components/medication-search/medication-search.agent.d.ts +15 -0
  113. package/dist/components/medication-search/medication-search.d.ts +49 -0
  114. package/dist/components/multi-select/index.js +1 -1
  115. package/dist/components/muscle-scheme/index.js +1 -1
  116. package/dist/components/notes-panel/index.js +1 -1
  117. package/dist/components/optical-prescription/index.js +1 -1
  118. package/dist/components/patient-details/index.js +1 -1
  119. package/dist/components/patient-search/index.js +1 -1
  120. package/dist/components/patient-summary-card/index.js +1 -1
  121. package/dist/components/patient-table/index.js +1 -1
  122. package/dist/components/phone-input/index.js +1 -1
  123. package/dist/components/pregnancy-dating/index.js +1 -1
  124. package/dist/components/print-sheet/index.d.ts +5 -0
  125. package/dist/components/print-sheet/index.js +6 -0
  126. package/dist/components/print-sheet/print-isolation.d.ts +17 -0
  127. package/dist/components/print-sheet/print-sheet.agent.d.ts +19 -0
  128. package/dist/components/print-sheet/print-sheet.d.ts +54 -0
  129. package/dist/components/province-select/index.js +1 -1
  130. package/dist/components/rich-text-editor/index.js +2 -2
  131. package/dist/components/search-bar/index.js +1 -1
  132. package/dist/components/select/index.js +1 -1
  133. package/dist/components/skeleton-scheme/index.js +1 -1
  134. package/dist/components/sync-tray/index.d.ts +4 -0
  135. package/dist/components/sync-tray/index.js +7 -0
  136. package/dist/components/sync-tray/sync-tray.agent.d.ts +15 -0
  137. package/dist/components/sync-tray/sync-tray.d.ts +77 -0
  138. package/dist/components/tabs/index.js +1 -1
  139. package/dist/components/task-editor/index.js +1 -1
  140. package/dist/components/tasks-panel/index.js +1 -1
  141. package/dist/components/unit-converter/index.js +1 -1
  142. package/dist/components/variables-menu/index.js +1 -1
  143. package/dist/components/voice-control-panel/index.js +1 -1
  144. package/dist/core.css +1 -1
  145. package/dist/find-free-slots-panel/index.js +1 -1
  146. package/dist/host-compat.css +13 -1
  147. package/dist/i18n/locales/ar.d.ts +134 -0
  148. package/dist/i18n/locales/ar.js +134 -0
  149. package/dist/i18n/locales/de.d.ts +134 -0
  150. package/dist/i18n/locales/de.js +134 -0
  151. package/dist/i18n/locales/el.d.ts +134 -0
  152. package/dist/i18n/locales/el.js +134 -0
  153. package/dist/i18n/locales/en.d.ts +134 -0
  154. package/dist/i18n/locales/en.js +134 -0
  155. package/dist/i18n/locales/es.d.ts +134 -0
  156. package/dist/i18n/locales/es.js +134 -0
  157. package/dist/i18n/locales/fr.d.ts +134 -0
  158. package/dist/i18n/locales/fr.js +134 -0
  159. package/dist/i18n/locales/hi.d.ts +134 -0
  160. package/dist/i18n/locales/hi.js +134 -0
  161. package/dist/i18n/locales/it.d.ts +134 -0
  162. package/dist/i18n/locales/it.js +134 -0
  163. package/dist/i18n/locales/ja.d.ts +134 -0
  164. package/dist/i18n/locales/ja.js +134 -0
  165. package/dist/i18n/locales/nl.d.ts +134 -0
  166. package/dist/i18n/locales/nl.js +134 -0
  167. package/dist/i18n/locales/pl.d.ts +134 -0
  168. package/dist/i18n/locales/pl.js +134 -0
  169. package/dist/i18n/locales/pt.d.ts +134 -0
  170. package/dist/i18n/locales/pt.js +134 -0
  171. package/dist/i18n/locales/ro.d.ts +134 -0
  172. package/dist/i18n/locales/ro.js +134 -0
  173. package/dist/i18n/locales/ru.d.ts +134 -0
  174. package/dist/i18n/locales/ru.js +134 -0
  175. package/dist/i18n/locales/sq.d.ts +134 -0
  176. package/dist/i18n/locales/sq.js +134 -0
  177. package/dist/i18n/locales/sv.d.ts +134 -0
  178. package/dist/i18n/locales/sv.js +134 -0
  179. package/dist/i18n/locales/tr.d.ts +134 -0
  180. package/dist/i18n/locales/tr.js +134 -0
  181. package/dist/i18n/locales/zh.d.ts +134 -0
  182. package/dist/i18n/locales/zh.js +134 -0
  183. package/dist/index.js +1002 -974
  184. package/dist/locales/ar.json +134 -0
  185. package/dist/locales/de.json +134 -0
  186. package/dist/locales/el.json +134 -0
  187. package/dist/locales/en.json +134 -0
  188. package/dist/locales/es.json +134 -0
  189. package/dist/locales/fr.json +134 -0
  190. package/dist/locales/hi.json +134 -0
  191. package/dist/locales/it.json +134 -0
  192. package/dist/locales/ja.json +134 -0
  193. package/dist/locales/nl.json +134 -0
  194. package/dist/locales/pl.json +134 -0
  195. package/dist/locales/pt.json +134 -0
  196. package/dist/locales/ro.json +134 -0
  197. package/dist/locales/ru.json +134 -0
  198. package/dist/locales/sq.json +134 -0
  199. package/dist/locales/sv.json +134 -0
  200. package/dist/locales/tr.json +134 -0
  201. package/dist/locales/zh.json +134 -0
  202. package/dist/online-bookings-panel/index.js +1 -1
  203. package/dist/patterns/anamnesis/index.js +1 -1
  204. package/dist/patterns/calendar/index.js +3 -3
  205. package/dist/patterns/forgot-password-form/index.js +1 -1
  206. package/dist/patterns/login-form/index.js +1 -1
  207. package/dist/patterns/patient-account-settings/index.js +1 -1
  208. package/dist/patterns/patient-check-in/index.js +1 -1
  209. package/dist/patterns/patient-portal/index.js +2 -2
  210. package/dist/patterns/prescription/index.d.ts +11 -0
  211. package/dist/patterns/prescription/index.js +13 -0
  212. package/dist/patterns/prescription/prescription-composer-errors.d.ts +6 -0
  213. package/dist/patterns/prescription/prescription-composer-item.d.ts +34 -0
  214. package/dist/patterns/prescription/prescription-composer.d.ts +89 -0
  215. package/dist/patterns/prescription/prescription-history.d.ts +48 -0
  216. package/dist/patterns/prescription/prescription-patient-block.d.ts +13 -0
  217. package/dist/patterns/prescription/prescription-sheet.d.ts +52 -0
  218. package/dist/patterns/prescription/prescription-status-badge.d.ts +5 -0
  219. package/dist/patterns/prescription/prescription-types.d.ts +97 -0
  220. package/dist/patterns/prescription/prescription-validation.d.ts +40 -0
  221. package/dist/patterns/registration-form/index.js +1 -1
  222. package/dist/patterns/reset-password-form/index.js +1 -1
  223. package/dist/patterns/send-registration-link-form/index.js +1 -1
  224. package/dist/patterns/signature-request/index.js +1 -1
  225. package/dist/tokens.css +1 -1
  226. package/dist/waiting-list-panel/index.js +2 -2
  227. package/package.json +21 -1
  228. package/dist/_chunks/autocomplete-D10ydpgi.js +0 -562
  229. package/dist/_chunks/group-options-BvKhQ3xb.js +0 -16
  230. package/dist/_chunks/normalize-diacritics-BNGbFNlJ.js +0 -7
  231. package/dist/_chunks/patient-picker-BZJuOgMw.js +0 -173
  232. package/dist/_chunks/use-registration-submit-CLGHxwoT.js +0 -112
@@ -0,0 +1,222 @@
1
+ import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
+ import { forwardRef as I, useContext as L, useRef as v, useCallback as B, useMemo as q, useImperativeHandle as G, createContext as k } from "react";
3
+ import { c as a } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as J } from "react-i18next";
5
+ import { I as Q } from "./icon-button-S8_weU3g.js";
6
+ import { u as U } from "./registry-DvAUVLHh.js";
7
+ import { f as W, m as X, M as Y } from "./medication-I6QvOq6k.js";
8
+ import { T as Z } from "./trash-2-uumy3fy1.js";
9
+ const $ = {
10
+ id: "medication-line",
11
+ // Closed set (§4): `dismiss` is "hide or acknowledge with no commitment";
12
+ // removing a line changes the list, so it is `edit_inline`, as field-array
13
+ // declares for its `remove`.
14
+ capabilities: ["edit_inline"],
15
+ state: {
16
+ value: {
17
+ type: "string",
18
+ descriptionKey: "ui.agent.medicationLine.state.value",
19
+ description: "The catalogue id of the medication on this line. An id only, never a name.",
20
+ read: (e) => e.getMedicationId()
21
+ }
22
+ },
23
+ actions: {
24
+ remove: {
25
+ // §3: `destructive`. Taking a medication off a prescription or therapy
26
+ // list has no undo in this UI (the host owns the list), so it is "hard
27
+ // to reverse via the same UI", the same class field-array and
28
+ // suggestion-chip give removal. It is not `phi`: the line holds a
29
+ // catalogue id, not patient identity.
30
+ safety: "destructive",
31
+ idempotent: !0,
32
+ descriptionKey: "ui.agent.medicationLine.actions.remove",
33
+ description: "Remove this medication from the list. Does nothing on a read-only line.",
34
+ invoke: (e) => {
35
+ e.remove();
36
+ }
37
+ }
38
+ },
39
+ domHooks: {
40
+ root: {
41
+ attr: "data-component",
42
+ value: "medication-line",
43
+ description: "Marks one medication line. The remove button is present only on the removable variant."
44
+ },
45
+ instanceId: {
46
+ attr: "data-component-id",
47
+ sourceProp: "id",
48
+ description: "Sourced from the id prop, when provided."
49
+ },
50
+ item: {
51
+ attr: "data-medication-id",
52
+ description: "The root also emits the catalogue id of the medication. An id only, never a name."
53
+ }
54
+ }
55
+ }, ee = a(
56
+ [
57
+ "ds:flex ds:items-start ds:justify-between",
58
+ "ds:text-foreground ds:break-inside-avoid",
59
+ "ds:m-0 ds:list-none"
60
+ ].join(" "),
61
+ {
62
+ variants: {
63
+ density: {
64
+ default: "ds:gap-[var(--spacing-md)] ds:py-[var(--spacing-sm)]",
65
+ compact: "ds:gap-[var(--spacing-sm)] ds:py-[var(--spacing-xs)]"
66
+ }
67
+ },
68
+ defaultVariants: { density: "default" }
69
+ }
70
+ ), te = a("ds:flex ds:flex-col ds:flex-1 ds:min-w-0", {
71
+ variants: {
72
+ density: {
73
+ default: "ds:gap-[var(--spacing-xs)]",
74
+ compact: "ds:gap-0"
75
+ }
76
+ },
77
+ defaultVariants: { density: "default" }
78
+ }), ie = a(
79
+ "ds:m-0 ds:[overflow-wrap:anywhere] ds:text-foreground",
80
+ {
81
+ variants: {
82
+ density: {
83
+ default: "type-title-item",
84
+ compact: "type-label"
85
+ }
86
+ },
87
+ defaultVariants: { density: "default" }
88
+ }
89
+ ), ae = a(
90
+ "ds:m-0 ds:[overflow-wrap:anywhere] ds:text-muted-foreground",
91
+ {
92
+ variants: {
93
+ density: {
94
+ default: "type-body-sm",
95
+ compact: "type-meta"
96
+ }
97
+ },
98
+ defaultVariants: { density: "default" }
99
+ }
100
+ ), N = a(
101
+ "ds:flex ds:flex-wrap ds:items-baseline ds:gap-x-[var(--spacing-xs)]"
102
+ ), V = a("ds:shrink-0 ds:text-muted-foreground", {
103
+ variants: {
104
+ density: { default: "type-label", compact: "type-meta" }
105
+ },
106
+ defaultVariants: { density: "default" }
107
+ }), M = a(
108
+ "ds:m-0 ds:min-w-0 ds:[overflow-wrap:anywhere] ds:text-foreground",
109
+ {
110
+ variants: {
111
+ density: { default: "type-body", compact: "type-body-sm" }
112
+ },
113
+ defaultVariants: { density: "default" }
114
+ }
115
+ ), ne = a(
116
+ [
117
+ "ds:m-0 ds:p-0 ds:list-none",
118
+ "ds:divide-y ds:divide-[color:var(--border)]"
119
+ ].join(" ")
120
+ ), A = k("default"), C = k(!1);
121
+ function T(e) {
122
+ return e !== void 0 && e.trim() !== "";
123
+ }
124
+ const se = I(
125
+ ({
126
+ medication: e,
127
+ dosage: r,
128
+ notes: d,
129
+ codeLabel: c,
130
+ showDetail: l = !0,
131
+ density: R,
132
+ as: j,
133
+ onRemove: m,
134
+ removeLabel: P,
135
+ disabled: u = !1,
136
+ id: y,
137
+ className: D,
138
+ ...S
139
+ }, _) => {
140
+ const { t: n } = J("ui"), z = L(A), i = R ?? z, E = L(C), F = j ?? (E ? "li" : "div"), h = W(e), H = T(e.code) ? n("medicationSearch.code", {
141
+ label: c ?? n("medicationSearch.codeFallbackLabel"),
142
+ code: e.code.trim()
143
+ }) : void 0, g = X(
144
+ { ...e, strength: void 0, form: void 0 },
145
+ H
146
+ ).join(Y), K = m !== void 0, o = v(m);
147
+ o.current = m;
148
+ const x = v(u);
149
+ x.current = u;
150
+ const b = v(e.id);
151
+ b.current = e.id;
152
+ const p = B(() => {
153
+ var w;
154
+ x.current || (w = o.current) == null || w.call(o);
155
+ }, []), f = q(
156
+ () => ({
157
+ getMedicationId: () => b.current,
158
+ remove: p
159
+ }),
160
+ [p]
161
+ );
162
+ G(_, () => f, [f]), U($, f, y);
163
+ const O = P ?? n("medicationLine.remove", { name: h });
164
+ return /* @__PURE__ */ s(
165
+ F,
166
+ {
167
+ ...S,
168
+ className: ee({ density: i, className: D }),
169
+ "data-component": "medication-line",
170
+ "data-component-id": y,
171
+ "data-medication-id": e.id,
172
+ children: [
173
+ /* @__PURE__ */ s("div", { className: te({ density: i }), children: [
174
+ /* @__PURE__ */ t("p", { dir: "auto", className: ie({ density: i }), children: h }),
175
+ l && g !== "" ? /* @__PURE__ */ t("p", { dir: "auto", className: ae({ density: i }), children: g }) : null,
176
+ /* @__PURE__ */ s("dl", { className: "ds:m-0 ds:flex ds:flex-col", children: [
177
+ /* @__PURE__ */ s("div", { className: N(), children: [
178
+ /* @__PURE__ */ t("dt", { className: V({ density: i }), children: n("medicationLine.dosage") }),
179
+ /* @__PURE__ */ t("dd", { dir: "auto", className: M({ density: i }), children: r })
180
+ ] }),
181
+ T(d) ? /* @__PURE__ */ s("div", { className: N(), children: [
182
+ /* @__PURE__ */ t("dt", { className: V({ density: i }), children: n("medicationLine.notes") }),
183
+ /* @__PURE__ */ t("dd", { dir: "auto", className: M({ density: i }), children: d })
184
+ ] }) : null
185
+ ] })
186
+ ] }),
187
+ K ? /* @__PURE__ */ t(
188
+ Q,
189
+ {
190
+ type: "button",
191
+ intent: "ghost",
192
+ icon: /* @__PURE__ */ t(Z, { "aria-hidden": "true" }),
193
+ "aria-label": O,
194
+ disabled: u,
195
+ onClick: p,
196
+ className: "ds:shrink-0 ds:min-h-[var(--min-target-size)] ds:min-w-[var(--min-target-size)] ds:print:hidden"
197
+ }
198
+ ) : null
199
+ ]
200
+ }
201
+ );
202
+ }
203
+ );
204
+ se.displayName = "MedicationLine";
205
+ const de = I(({ density: e = "default", className: r, children: d, ...c }, l) => /* @__PURE__ */ t(A.Provider, { value: e, children: /* @__PURE__ */ t(C.Provider, { value: !0, children: /* @__PURE__ */ t(
206
+ "ul",
207
+ {
208
+ ref: l,
209
+ role: "list",
210
+ ...c,
211
+ className: ne({ className: r }),
212
+ "data-component": "medication-line-list",
213
+ children: d
214
+ }
215
+ ) }) }));
216
+ de.displayName = "MedicationLineList";
217
+ export {
218
+ se as M,
219
+ de as a,
220
+ $ as m
221
+ };
222
+ //# sourceMappingURL=medication-line-CHdlh-F7.js.map
@@ -0,0 +1,380 @@
1
+ import { jsxs as K, jsx as c } from "react/jsx-runtime";
2
+ import { forwardRef as xe, useState as j, useRef as o, useEffect as ke, useCallback as h, useMemo as Me, useImperativeHandle as qe } from "react";
3
+ import { c as Ce } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as Te } from "react-i18next";
5
+ import { A as Ie } from "./autocomplete-HZNW7_Pa.js";
6
+ import { B as Ne } from "./button-DohK_Ak_.js";
7
+ import { S as Oe } from "./spinner-CoflYlEx.js";
8
+ import { T as Re } from "./tooltip-uEBdD1-5.js";
9
+ import { u as Ee } from "./form-field-context-DtiROUJV.js";
10
+ import { u as Fe } from "./use-controllable-state-BiY4xTzM.js";
11
+ import { u as A } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
12
+ import { u as Ke } from "./registry-DvAUVLHh.js";
13
+ import { f as u, m as je } from "./medication-I6QvOq6k.js";
14
+ const Ae = {
15
+ id: "medication-search",
16
+ // `select_single`, not `pick`: the component keeps the selection (as
17
+ // Autocomplete does), and `pick` is "without persisting selection state".
18
+ capabilities: ["select_single", "filter", "open", "close"],
19
+ state: {
20
+ value: {
21
+ type: "string | null",
22
+ descriptionKey: "ui.agent.medicationSearch.state.value",
23
+ description: "Catalogue id of the selected medication, or null when none is selected.",
24
+ read: (r) => r.getValue()
25
+ },
26
+ query: {
27
+ type: "string",
28
+ descriptionKey: "ui.agent.medicationSearch.state.query",
29
+ description: "The text typed in the search field while no medication is selected, and an empty string once one is selected (the field then shows the medication name, which is not state).",
30
+ read: (r) => r.getValue() === null ? r.getQuery() : ""
31
+ },
32
+ isOpen: {
33
+ type: "boolean",
34
+ descriptionKey: "ui.agent.medicationSearch.state.isOpen",
35
+ description: "True when the list of results is visible.",
36
+ read: (r) => r.getIsOpen()
37
+ }
38
+ },
39
+ actions: {
40
+ apply_filter: {
41
+ // Clears any selection and calls the host catalogue.
42
+ safety: "write",
43
+ openWorld: !0,
44
+ argsType: "{ query: string }",
45
+ argsSchema: {
46
+ type: "object",
47
+ properties: { query: { type: "string" } },
48
+ required: ["query"]
49
+ },
50
+ idempotent: !0,
51
+ descriptionKey: "ui.agent.medicationSearch.actions.applyFilter",
52
+ description: "Type a search into the field, as a user would. This clears any selected medication and calls the host catalogue.",
53
+ invoke: (r, p) => {
54
+ r.setQuery(p.query);
55
+ }
56
+ },
57
+ pick: {
58
+ // The field holds a catalogue id and persists nothing; the pattern
59
+ // that links it to a patient classes its own workflow `phi`. Same
60
+ // class as combobox.set_value and select.set_value.
61
+ safety: "write",
62
+ argsType: "{ id: string }",
63
+ argsSchema: {
64
+ type: "object",
65
+ properties: {
66
+ id: {
67
+ type: "string",
68
+ description: "Catalogue id of a result the host search returned for the current query. Never free text."
69
+ }
70
+ },
71
+ required: ["id"]
72
+ },
73
+ idempotent: !0,
74
+ returns: "boolean",
75
+ returnsSchema: {
76
+ type: "boolean",
77
+ description: "True when a loaded result had that id and was chosen."
78
+ },
79
+ descriptionKey: "ui.agent.medicationSearch.actions.pick",
80
+ description: "Choose one of the currently loaded results by its catalogue id. Fails (false) for an id the search did not return.",
81
+ invoke: (r, p) => r.pick(p.id)
82
+ },
83
+ clear: {
84
+ safety: "destructive",
85
+ idempotent: !0,
86
+ descriptionKey: "ui.agent.medicationSearch.actions.clear",
87
+ description: "Clear the selected medication and the search text.",
88
+ invoke: (r) => {
89
+ r.clear();
90
+ }
91
+ },
92
+ open: {
93
+ safety: "read",
94
+ idempotent: !0,
95
+ descriptionKey: "ui.agent.medicationSearch.actions.open",
96
+ description: "Open the list of results.",
97
+ invoke: (r) => {
98
+ r.open();
99
+ }
100
+ },
101
+ close: {
102
+ safety: "read",
103
+ idempotent: !0,
104
+ descriptionKey: "ui.agent.medicationSearch.actions.close",
105
+ description: "Close the list of results.",
106
+ invoke: (r) => {
107
+ r.close();
108
+ }
109
+ }
110
+ },
111
+ domHooks: {
112
+ root: {
113
+ attr: "data-component",
114
+ value: "medication-search",
115
+ description: "Marks the MedicationSearch root."
116
+ },
117
+ instanceId: {
118
+ attr: "data-component-id",
119
+ sourceProp: "id",
120
+ description: "Sourced from the id prop."
121
+ },
122
+ item: {
123
+ attr: "data-option-id",
124
+ description: "Each result emits its catalogue id as data-option-id. Never the name."
125
+ }
126
+ }
127
+ }, Le = Ce(
128
+ [
129
+ "ds:flex ds:w-full ds:flex-col ds:gap-[var(--spacing-xs)]",
130
+ "ds:[&_input]:text-ellipsis"
131
+ ].join(" ")
132
+ ), Be = xe(function({
133
+ loadOptions: p,
134
+ value: U,
135
+ defaultValue: X,
136
+ onValueChange: Y,
137
+ codeLabel: Z,
138
+ status: f = "ready",
139
+ onRetry: l,
140
+ placeholder: ee,
141
+ disabled: te,
142
+ required: re,
143
+ size: ae,
144
+ tone: ne,
145
+ id: v,
146
+ name: ie,
147
+ debounceMs: oe,
148
+ className: se,
149
+ "aria-label": ce,
150
+ "aria-labelledby": L,
151
+ "aria-describedby": le,
152
+ "aria-invalid": de
153
+ }, ue) {
154
+ const { t: i } = Te("ui"), B = Ee(), [pe, S] = Fe({
155
+ value: U,
156
+ defaultValue: X ?? null,
157
+ onChange: Y
158
+ }), n = pe ?? null, [b, I] = j(
159
+ n ? u(n) : ""
160
+ ), [Q, w] = j(!1), [N, O] = j(!1), V = o(null), m = o(!1), R = o(!1), x = o(null), s = o(null), E = o(n), D = o(n), k = o(b), P = o(p), M = o(/* @__PURE__ */ new Map()), q = o(!1);
161
+ A(() => {
162
+ E.current = n, k.current = b, P.current = p;
163
+ }), ke(() => {
164
+ const e = D.current;
165
+ D.current = n, I((t) => n ? u(n) : e && t === u(e) ? "" : t);
166
+ }, [n]);
167
+ const _ = Z ?? i("medicationSearch.codeFallbackLabel"), z = h(
168
+ (e) => {
169
+ var d, J;
170
+ const t = (d = e.activeIngredient) == null ? void 0 : d.trim(), a = (J = e.code) == null ? void 0 : J.trim(), y = je(
171
+ {
172
+ id: e.id,
173
+ name: e.name,
174
+ form: e.form,
175
+ activeIngredient: t ? i("medicationSearch.activeIngredient", { value: t }) : void 0
176
+ },
177
+ a ? i("medicationSearch.code", { label: _, code: a }) : void 0
178
+ );
179
+ return {
180
+ value: e.id,
181
+ label: u({
182
+ id: e.id,
183
+ name: e.name,
184
+ strength: e.strength
185
+ }),
186
+ // Each data part is isolated (U+2068 ... U+2069), so a Latin drug
187
+ // name in an Arabic line keeps its own order and does not reorder
188
+ // its neighbours.
189
+ description: y.length > 0 ? y.map((we) => `⁨${we}⁩`).join(" · ") : void 0,
190
+ dir: "auto"
191
+ };
192
+ },
193
+ [_, i]
194
+ ), H = o(z);
195
+ A(() => {
196
+ H.current = z;
197
+ });
198
+ const fe = h(
199
+ async (e, t) => {
200
+ const a = await P.current(e, t);
201
+ if (t.signal.aborted) throw new DOMException("Aborted", "AbortError");
202
+ const y = /* @__PURE__ */ new Map();
203
+ for (const d of a) y.set(d.id, d);
204
+ return M.current = y, w(!1), a.map((d) => H.current(d));
205
+ },
206
+ []
207
+ ), me = h(() => {
208
+ M.current = /* @__PURE__ */ new Map(), k.current !== "" && w(!0);
209
+ }, []), he = h(
210
+ (e) => {
211
+ I(e), e === "" && w(!1);
212
+ const t = E.current;
213
+ t && e !== u(t) && (q.current = !0, queueMicrotask(() => {
214
+ q.current && (q.current = !1, S(null));
215
+ }));
216
+ },
217
+ [S]
218
+ ), C = h(
219
+ (e) => {
220
+ q.current = !1, I(u(e)), S(e);
221
+ },
222
+ [S]
223
+ ), ge = h(
224
+ (e) => {
225
+ const t = M.current.get(e.value);
226
+ t && C(t);
227
+ },
228
+ [C]
229
+ ), F = Me(
230
+ () => ({
231
+ getValue: () => {
232
+ var e;
233
+ return ((e = E.current) == null ? void 0 : e.id) ?? null;
234
+ },
235
+ getQuery: () => k.current,
236
+ setQuery: (e) => {
237
+ var t;
238
+ return (t = s.current) == null ? void 0 : t.search(e);
239
+ },
240
+ clear: () => {
241
+ var e;
242
+ return (e = s.current) == null ? void 0 : e.clear();
243
+ },
244
+ focus: () => {
245
+ var e;
246
+ return (e = x.current) == null ? void 0 : e.focus();
247
+ },
248
+ open: () => {
249
+ var e;
250
+ return (e = s.current) == null ? void 0 : e.open();
251
+ },
252
+ close: () => {
253
+ var e;
254
+ return (e = s.current) == null ? void 0 : e.close();
255
+ },
256
+ getIsOpen: () => {
257
+ var e;
258
+ return ((e = s.current) == null ? void 0 : e.getIsOpen()) ?? !1;
259
+ },
260
+ pick: (e) => {
261
+ var a;
262
+ const t = M.current.get(e);
263
+ return t ? (C(t), (a = s.current) == null || a.close(), !0) : !1;
264
+ }
265
+ }),
266
+ [C]
267
+ );
268
+ qe(ue, () => F, [F]), Ke(Ae, F, v);
269
+ const g = f === "loading", T = f === "error" || Q, $ = l !== void 0 && (T || N);
270
+ A(() => {
271
+ var t;
272
+ if (!N) return;
273
+ if (f === "loading") {
274
+ R.current = !0;
275
+ return;
276
+ }
277
+ const e = R.current;
278
+ if (R.current = !1, f === "ready") {
279
+ const a = document.activeElement;
280
+ m.current && (!a || a === document.body || a === V.current) && ((t = x.current) == null || t.focus()), m.current = !1, O(!1);
281
+ return;
282
+ }
283
+ e && (m.current = !1, O(!1));
284
+ }, [N, f]);
285
+ const ye = () => {
286
+ var t, a;
287
+ if (m.current = !0, f === "error") {
288
+ O(!0), l == null || l();
289
+ return;
290
+ }
291
+ w(!1), (t = x.current) == null || t.focus();
292
+ const e = k.current;
293
+ e !== "" && ((a = s.current) == null || a.search(e)), m.current = !1, l == null || l();
294
+ }, W = `${v ?? B.id}-status`, ve = [le, T ? W : void 0].filter(Boolean).join(" ") || void 0, Se = g ? i("medicationSearch.loading") : ee ?? i("medicationSearch.placeholder"), be = ce ?? (L || B.label ? void 0 : i("medicationSearch.label")), G = n ? u(n) : "";
295
+ return /* @__PURE__ */ K(
296
+ "div",
297
+ {
298
+ className: Le({ className: se }),
299
+ "data-component": "medication-search",
300
+ "data-component-id": v,
301
+ "data-has-value": n ? !0 : void 0,
302
+ children: [
303
+ /* @__PURE__ */ c(Re, { label: G, open: n ? void 0 : !1, side: "top", children: /* @__PURE__ */ c("div", { className: "ds:w-full", children: /* @__PURE__ */ c(
304
+ Ie,
305
+ {
306
+ ref: x,
307
+ handleRef: s,
308
+ registerAgent: !1,
309
+ openOnFocus: !(n && b === G),
310
+ showDescriptions: !0,
311
+ inputDir: "auto",
312
+ emptyMessage: i(Q ? "medicationSearch.error" : "medicationSearch.empty"),
313
+ onLoadError: me,
314
+ "aria-labelledby": L,
315
+ id: v,
316
+ name: ie,
317
+ loadOptions: fe,
318
+ debounceMs: oe,
319
+ value: b,
320
+ onChange: he,
321
+ onSelect: ge,
322
+ placeholder: Se,
323
+ disabled: te || g,
324
+ required: re,
325
+ size: ae,
326
+ tone: ne,
327
+ "aria-label": be,
328
+ "aria-invalid": de,
329
+ "aria-describedby": ve
330
+ }
331
+ ) }) }),
332
+ /* @__PURE__ */ c("span", { role: "status", className: "ds:sr-only", children: g ? i("medicationSearch.loading") : "" }),
333
+ g ? /* @__PURE__ */ K(
334
+ "div",
335
+ {
336
+ "aria-hidden": "true",
337
+ className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)] type-body-sm ds:text-muted-foreground",
338
+ children: [
339
+ /* @__PURE__ */ c(Oe, { size: "sm" }),
340
+ /* @__PURE__ */ c("span", { children: i("medicationSearch.loading") })
341
+ ]
342
+ }
343
+ ) : null,
344
+ T || $ ? /* @__PURE__ */ K("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
345
+ T ? /* @__PURE__ */ c(
346
+ "p",
347
+ {
348
+ id: W,
349
+ role: "alert",
350
+ className: "type-body-sm ds:text-destructive",
351
+ children: i("medicationSearch.error")
352
+ }
353
+ ) : null,
354
+ $ ? /* @__PURE__ */ c(
355
+ Ne,
356
+ {
357
+ ref: V,
358
+ type: "button",
359
+ intent: "outline",
360
+ className: "ds:min-h-[var(--min-target-size)]",
361
+ loading: g,
362
+ onClick: ye,
363
+ onBlur: (e) => {
364
+ e.relatedTarget && (m.current = !1);
365
+ },
366
+ children: i("medicationSearch.retry")
367
+ }
368
+ ) : null
369
+ ] }) : null
370
+ ]
371
+ }
372
+ );
373
+ });
374
+ Be.displayName = "MedicationSearch";
375
+ export {
376
+ Be as M,
377
+ Le as a,
378
+ Ae as m
379
+ };
380
+ //# sourceMappingURL=medication-search-DoEDakoM.js.map
@@ -9,9 +9,8 @@ import { T as he } from "./tooltip-uEBdD1-5.js";
9
9
  import { c as dt } from "./compose-refs-C0k0tdqF.js";
10
10
  import { u as ct } from "./use-controllable-state-BiY4xTzM.js";
11
11
  import { u as E } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
12
- import { g as ut } from "./group-options-BvKhQ3xb.js";
12
+ import { g as ut, O as mt, a as pt, c as ft, b as ht, o as gt } from "./option-row-DpCnuUqo.js";
13
13
  import { b as ye } from "./menu-row-BAr8bx1I.js";
14
- import { O as mt, a as pt, o as ft, b as ht, c as gt } from "./option-row-Dc7BrbK8.js";
15
14
  import { b as X, c as bt } from "./input-surface-BMffm2Vd.js";
16
15
  import { u as vt } from "./registry-DvAUVLHh.js";
17
16
  import { X as yt } from "./x-B5YnXwCz.js";
@@ -698,10 +697,10 @@ const It = {
698
697
  }
699
698
  );
700
699
  Se.displayName = "MultiSelect";
701
- const Ut = Se;
700
+ const $t = Se;
702
701
  export {
703
- Ut as M,
702
+ $t as M,
704
703
  xt as a,
705
704
  It as m
706
705
  };
707
- //# sourceMappingURL=multi-select-Df3R8lv_.js.map
706
+ //# sourceMappingURL=multi-select-DeMiHm8T.js.map
@@ -5,7 +5,7 @@ import { c as E1 } from "./index-D2ZczOXr.js";
5
5
  import { useTranslation as a2 } from "react-i18next";
6
6
  import { u as $2 } from "./registry-DvAUVLHh.js";
7
7
  import { m as c2, A as N2 } from "./annotation-marker-D-M7y4R1.js";
8
- import { T as m1 } from "./tabs-Czkmw5ou.js";
8
+ import { T as m1 } from "./tabs-BXr5XeGq.js";
9
9
  import { B as I2 } from "./button-DohK_Ak_.js";
10
10
  import { C as E2 } from "./check-DrFSN__t.js";
11
11
  const P = {
@@ -3415,4 +3415,4 @@ export {
3415
3415
  I3 as u,
3416
3416
  c3 as v
3417
3417
  };
3418
- //# sourceMappingURL=muscle-scheme-D_rSyGDj.js.map
3418
+ //# sourceMappingURL=muscle-scheme-BB2eBfww.js.map
@@ -0,0 +1,7 @@
1
+ function u(e) {
2
+ return e.normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[\u2018\u2019\u02bc\u2032\u0060\u00b4]/g, "'").toLowerCase();
3
+ }
4
+ export {
5
+ u as n
6
+ };
7
+ //# sourceMappingURL=normalize-diacritics-DhJjQ3Bp.js.map
@@ -6,7 +6,7 @@ import { g as mt } from "./get-error-message-DbFUzuja.js";
6
6
  import { h as Rt } from "./handled-rejection-C-6Dq0As.js";
7
7
  import { u as zn } from "./registry-DvAUVLHh.js";
8
8
  import { C as Hn } from "./clinical-note-card-D--IwbZa.js";
9
- import { R as Mn } from "./rich-text-editor-C48omVjq.js";
9
+ import { R as Mn } from "./rich-text-editor-DFsH5RAj.js";
10
10
  import { T as Wn } from "./text-area-COMVJ1yE.js";
11
11
  import { A as j } from "./alert-C4WKViaS.js";
12
12
  import { B as te } from "./button-DohK_Ak_.js";
@@ -1110,4 +1110,4 @@ const Lr = qn(
1110
1110
  export {
1111
1111
  Lr as N
1112
1112
  };
1113
- //# sourceMappingURL=notes-panel-DsEKNtsw.js.map
1113
+ //# sourceMappingURL=notes-panel-CnmQqhwq.js.map
@@ -4,7 +4,7 @@ import { c as Ke } from "./index-D2ZczOXr.js";
4
4
  import { useTranslation as Ge } from "react-i18next";
5
5
  import { u as Ue } from "./registry-DvAUVLHh.js";
6
6
  import { N as ae } from "./number-input-DUSvP7Dq.js";
7
- import { S as ye } from "./select-CIXKyUMw.js";
7
+ import { S as ye } from "./select-Bm8s3q-X.js";
8
8
  import { T as Je } from "./text-area-COMVJ1yE.js";
9
9
  import { D as v } from "./description-list-BxzDN9o2.js";
10
10
  import { a as Qe } from "./format-number-DdzqwMs1.js";
@@ -1273,4 +1273,4 @@ export {
1273
1273
  gt as y,
1274
1274
  _e as z
1275
1275
  };
1276
- //# sourceMappingURL=optical-prescription-DaSbsh4p.js.map
1276
+ //# sourceMappingURL=optical-prescription-C4jpDFOE.js.map