@alfadocs/ui-kit 1.3.13 → 1.4.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 (185) hide show
  1. package/dist/_chunks/agenda-card.agent-Cb5tuEh3.js +28 -0
  2. package/dist/_chunks/{alia-sidebar-DzNz1gDf.js → alia-sidebar-DSBZMick.js} +3 -3
  3. package/dist/_chunks/{anamnesis-i18n-CfC0qYzy.js → anamnesis-i18n-BA631X4t.js} +2209 -2144
  4. package/dist/_chunks/{antenatal-schedule-timeline-BMMpi2lb.js → antenatal-schedule-timeline-u8TsS2QJ.js} +27 -26
  5. package/dist/_chunks/{appointment-timeline-B630OT_J.js → appointment-timeline-Bqf1sTU5.js} +2 -2
  6. package/dist/_chunks/{ar-THMLfSoN.js → ar-BR1FGFP2.js} +14 -14
  7. package/dist/_chunks/{bmi-calculator-CM0-G2mg.js → bmi-calculator-CpyY13MV.js} +2 -2
  8. package/dist/_chunks/{booking-DjNbd7C1.js → booking-BjsA7j1-.js} +699 -688
  9. package/dist/_chunks/calculator-dialog-12d3Sxaz.js +48 -0
  10. package/dist/_chunks/{care-plan-card-1G_f4I5s.js → care-plan-card-BvQy366X.js} +3 -3
  11. package/dist/_chunks/{care-plan-entry-card-DmBsffHS.js → care-plan-entry-card-apk_5B3O.js} +2 -2
  12. package/dist/_chunks/{chat-container-HlFnoEIl.js → chat-container-CYYego1W.js} +105 -81
  13. package/dist/_chunks/cycle-calculator-B7fyH-h4.js +425 -0
  14. package/dist/_chunks/{date-picker-ZHejTVAJ.js → date-picker-Bp64zk2p.js} +19 -19
  15. package/dist/_chunks/date-picker-variants-pKAJfnWr.js +2089 -0
  16. package/dist/_chunks/{date-range-picker-pEG3Ln3i.js → date-range-picker-CDrZ8Zh0.js} +27 -27
  17. package/dist/_chunks/{date-time-picker-695QvBGj.js → date-time-picker-DafkGDGO.js} +10 -10
  18. package/dist/_chunks/{de-DmZ-8rTN.js → de-3iM4rGqo.js} +7 -7
  19. package/dist/_chunks/{document-preview-D3gg4MXB.js → document-preview-DOrsqiN1.js} +2 -2
  20. package/dist/_chunks/due-date-calculator-CnkbbAej.js +571 -0
  21. package/dist/_chunks/{editor-overlay-DE3esyio.js → editor-overlay-B1tr2i7B.js} +22 -21
  22. package/dist/_chunks/{el-Bela9mxs.js → el-C96rGJvU.js} +2 -2
  23. package/dist/_chunks/{es-BNncHKex.js → es-Cxiqjx8r.js} +12 -12
  24. package/dist/_chunks/fetal-weight-avlj-l-S.js +223 -0
  25. package/dist/_chunks/format-4HNwNGrN.js +1315 -0
  26. package/dist/_chunks/{fr-CH8ADfhN.js → fr-Bhr6SYKj.js} +21 -21
  27. package/dist/_chunks/{freemium-paywall-C_Ue6wxU.js → freemium-paywall-DRDdWuOg.js} +3 -3
  28. package/dist/_chunks/gestational-age-calculator-BljY_DVJ.js +488 -0
  29. package/dist/_chunks/hcg-doubling-Cv_vH61p.js +312 -0
  30. package/dist/_chunks/header-settings-Cn5fPXCE.js +335 -0
  31. package/dist/_chunks/{hi-Bppfxp8l.js → hi-BxXX26d_.js} +12 -12
  32. package/dist/_chunks/isSameWeek-B73MagWB.js +13 -0
  33. package/dist/_chunks/{it-B4ySaRyK.js → it-Xmjomvyj.js} +24 -24
  34. package/dist/_chunks/{ja-CGF6Io9P.js → ja-mfZvt1ZV.js} +16 -16
  35. package/dist/_chunks/{link-cell-renderer-C5XLwVXQ.js → link-cell-renderer-CJ_gk7gl.js} +3 -3
  36. package/dist/_chunks/{locale-picker-BfBUdT1m.js → locale-picker-D9Kv2zrK.js} +153 -132
  37. package/dist/_chunks/map-view-2yZCQW2l.js +445 -0
  38. package/dist/_chunks/{marketplace-app-shell-DwcFMxzp.js → marketplace-app-shell-BLRvg-M0.js} +49 -40
  39. package/dist/_chunks/{nl-DuShqwuV.js → nl-DDs-KEnD.js} +15 -15
  40. package/dist/_chunks/{notes-panel-DPsgB4Mv.js → notes-panel-CiFN3sLW.js} +2 -2
  41. package/dist/_chunks/{number-input-DrozbZAU.js → number-input-DOe5VYei.js} +64 -64
  42. package/dist/_chunks/{optical-prescription-BDHJr8Zz.js → optical-prescription-CRemE8fL.js} +2 -2
  43. package/dist/_chunks/{parse-DvA97ro9.js → parse-JqixfsU0.js} +43 -43
  44. package/dist/_chunks/parseISO-fOGpHKXm.js +120 -0
  45. package/dist/_chunks/{patient-details-DqjjwPmt.js → patient-details-CpunD0qx.js} +3 -3
  46. package/dist/_chunks/{patient-table-BmIDrLIS.js → patient-table-2eWx-Rrk.js} +2 -2
  47. package/dist/_chunks/{payment-form-h-BZ8onk.js → payment-form-Ds1I9KqB.js} +308 -231
  48. package/dist/_chunks/{pdf-viewer-Ddx-T053.js → pdf-viewer-DUIsV9s5.js} +429 -369
  49. package/dist/_chunks/{pl-CKQwX9Fk.js → pl-BYYMnEWP.js} +18 -18
  50. package/dist/_chunks/{practice-results-B-HPc13W.js → practice-results-SjCniMd2.js} +2 -2
  51. package/dist/_chunks/pregnancy-dating-BmpHScZ0.js +770 -0
  52. package/dist/_chunks/pregnancy-weight-gain-B5KSJzdc.js +553 -0
  53. package/dist/_chunks/progress-CK8otcQ-.js +343 -0
  54. package/dist/_chunks/{pt-_njpXyOZ.js → pt-BSPnVrQ7.js} +20 -20
  55. package/dist/_chunks/{radiograph-panel.agent-BQZ64Riy.js → radiograph-panel.agent-CtFtNMzk.js} +3 -3
  56. package/dist/_chunks/{rich-text-editor-CfeXPPWs.js → rich-text-editor-BedTpWzL.js} +2 -2
  57. package/dist/_chunks/{ro-3X6_4FcN.js → ro-BbiylGmG.js} +14 -14
  58. package/dist/_chunks/{ru-bAcgmnS-.js → ru-BX_qsV67.js} +14 -14
  59. package/dist/_chunks/{session-countdown-Bc70VXN1.js → session-countdown-BL-Psg8u.js} +2 -2
  60. package/dist/_chunks/{sign-document-CW_ByDUh.js → sign-document-jF4fZDJ5.js} +2 -2
  61. package/dist/_chunks/slot-grid-DNiUcXy2.js +640 -0
  62. package/dist/_chunks/{sparkline-BTY4B5tv.js → sparkline-BmGcEyZO.js} +209 -164
  63. package/dist/_chunks/{sq-jYFqr4Ga.js → sq-i9UOk4P7.js} +10 -10
  64. package/dist/_chunks/subDays-CAUv47M1.js +8 -0
  65. package/dist/_chunks/{sv-BSGEJ-8B.js → sv-CpTdtmDQ.js} +8 -8
  66. package/dist/_chunks/{tab-bar-Axhk6xzx.js → tab-bar-BYESZINM.js} +83 -77
  67. package/dist/_chunks/task-card.agent-CF2N_uu4.js +29 -0
  68. package/dist/_chunks/{tr-CTpgUtw6.js → tr-DXG2QN1K.js} +17 -17
  69. package/dist/_chunks/{unit-converter-COgkN7YP.js → unit-converter-CHPDuV7W.js} +2 -2
  70. package/dist/_chunks/{warning-stack-BtjmJChC.js → warning-stack-B7t_8jRE.js} +42 -37
  71. package/dist/_chunks/{zh-CN-BgM0Io2O.js → zh-CN-vPkPEK6H.js} +18 -18
  72. package/dist/agent-catalog.json +6426 -3382
  73. package/dist/agent-i18n/en.json +234 -15
  74. package/dist/components/agenda-card/index.js +1 -1
  75. package/dist/components/appointment-timeline/index.js +1 -1
  76. package/dist/components/bmi-calculator/index.js +1 -1
  77. package/dist/components/booking/index.js +1 -1
  78. package/dist/components/calculator-dialog/index.js +1 -1
  79. package/dist/components/care-plan-card/index.js +1 -1
  80. package/dist/components/care-plan-entry-card/index.js +1 -1
  81. package/dist/components/chat-container/chat-container.d.ts +14 -0
  82. package/dist/components/chat-container/index.js +1 -1
  83. package/dist/components/cycle-calculator/cycle-calculator.agent.d.ts +4 -0
  84. package/dist/components/cycle-calculator/cycle-calculator.d.ts +42 -0
  85. package/dist/components/cycle-calculator/index.d.ts +1 -1
  86. package/dist/components/cycle-calculator/index.js +1 -1
  87. package/dist/components/data-table/index.js +1 -1
  88. package/dist/components/date-picker/index.js +1 -1
  89. package/dist/components/date-range-picker/index.js +1 -1
  90. package/dist/components/date-time-picker/index.js +1 -1
  91. package/dist/components/document-preview/index.js +1 -1
  92. package/dist/components/due-date-calculator/due-date-calculator.agent.d.ts +4 -0
  93. package/dist/components/due-date-calculator/due-date-calculator.d.ts +61 -1
  94. package/dist/components/due-date-calculator/index.d.ts +1 -1
  95. package/dist/components/due-date-calculator/index.js +2 -2
  96. package/dist/components/editor-overlay/editor-overlay.d.ts +7 -1
  97. package/dist/components/editor-overlay/index.js +1 -1
  98. package/dist/components/fetal-weight/fetal-weight.agent.d.ts +4 -0
  99. package/dist/components/fetal-weight/fetal-weight.d.ts +26 -0
  100. package/dist/components/fetal-weight/index.d.ts +1 -1
  101. package/dist/components/fetal-weight/index.js +1 -1
  102. package/dist/components/freemium-paywall/index.js +1 -1
  103. package/dist/components/gestational-age-calculator/gestational-age-calculator.agent.d.ts +4 -0
  104. package/dist/components/gestational-age-calculator/gestational-age-calculator.d.ts +44 -2
  105. package/dist/components/gestational-age-calculator/index.d.ts +1 -1
  106. package/dist/components/gestational-age-calculator/index.js +1 -1
  107. package/dist/components/hcg-doubling/hcg-doubling.agent.d.ts +4 -0
  108. package/dist/components/hcg-doubling/hcg-doubling.d.ts +30 -0
  109. package/dist/components/hcg-doubling/index.d.ts +1 -1
  110. package/dist/components/hcg-doubling/index.js +1 -1
  111. package/dist/components/header-settings/header-settings.d.ts +13 -1
  112. package/dist/components/header-settings/index.js +1 -1
  113. package/dist/components/locale-picker/index.js +1 -1
  114. package/dist/components/locale-picker/locale-picker.d.ts +9 -0
  115. package/dist/components/map-view/index.js +1 -1
  116. package/dist/components/map-view/map-view.d.ts +22 -0
  117. package/dist/components/notes-panel/index.js +1 -1
  118. package/dist/components/number-input/index.js +1 -1
  119. package/dist/components/number-input/number-input.d.ts +2 -1
  120. package/dist/components/optical-prescription/index.js +1 -1
  121. package/dist/components/patient-details/index.js +1 -1
  122. package/dist/components/patient-table/index.js +1 -1
  123. package/dist/components/payment-form/index.d.ts +1 -1
  124. package/dist/components/payment-form/index.js +1 -1
  125. package/dist/components/payment-form/payment-form.d.ts +32 -1
  126. package/dist/components/pdf-viewer/index.js +1 -1
  127. package/dist/components/pdf-viewer/pdf-viewer.d.ts +13 -0
  128. package/dist/components/practice-results/index.js +1 -1
  129. package/dist/components/pregnancy-dating/index.d.ts +1 -1
  130. package/dist/components/pregnancy-dating/index.js +1 -1
  131. package/dist/components/pregnancy-dating/pregnancy-dating.agent.d.ts +4 -0
  132. package/dist/components/pregnancy-dating/pregnancy-dating.d.ts +65 -1
  133. package/dist/components/pregnancy-weight-gain/index.d.ts +2 -1
  134. package/dist/components/pregnancy-weight-gain/index.js +6 -5
  135. package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.agent.d.ts +4 -0
  136. package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.d.ts +35 -0
  137. package/dist/components/progress/index.js +1 -1
  138. package/dist/components/progress/progress.d.ts +13 -0
  139. package/dist/components/radiograph-panel/index.js +1 -1
  140. package/dist/components/rich-text-editor/index.js +1 -1
  141. package/dist/components/session-countdown/index.js +1 -1
  142. package/dist/components/sign-document/index.js +1 -1
  143. package/dist/components/slot-grid/index.d.ts +2 -1
  144. package/dist/components/slot-grid/index.js +5 -4
  145. package/dist/components/slot-grid/slot-grid.agent.d.ts +4 -0
  146. package/dist/components/slot-grid/slot-grid.d.ts +34 -0
  147. package/dist/components/sparkline/index.js +1 -1
  148. package/dist/components/sparkline/sparkline.d.ts +10 -0
  149. package/dist/components/tab-bar/index.js +1 -1
  150. package/dist/components/tab-bar/tab-bar.d.ts +13 -0
  151. package/dist/components/task-card/index.js +1 -1
  152. package/dist/components/unit-converter/index.js +1 -1
  153. package/dist/components/warning-stack/index.js +1 -1
  154. package/dist/index.js +630 -627
  155. package/dist/patterns/alia-assistant/index.js +1 -1
  156. package/dist/patterns/anamnesis/anamnesis-derive.d.ts +27 -8
  157. package/dist/patterns/anamnesis/anamnesis-format.d.ts +11 -3
  158. package/dist/patterns/anamnesis/anamnesis-highlight.d.ts +6 -0
  159. package/dist/patterns/anamnesis/anamnesis-questionnaire.d.ts +23 -9
  160. package/dist/patterns/anamnesis/anamnesis-types.d.ts +7 -0
  161. package/dist/patterns/anamnesis/anamnesis.d.ts +16 -7
  162. package/dist/patterns/anamnesis/index.d.ts +3 -2
  163. package/dist/patterns/anamnesis/index.js +7 -6
  164. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  165. package/dist/patterns/marketplace-app-shell/marketplace-app-shell.d.ts +6 -0
  166. package/dist/tokens.css +1 -1
  167. package/package.json +1 -1
  168. package/dist/_chunks/agenda-card.agent-mTCrkKSZ.js +0 -27
  169. package/dist/_chunks/calculator-dialog-DuXMQSdm.js +0 -40
  170. package/dist/_chunks/cycle-calculator-BwqYVPB4.js +0 -252
  171. package/dist/_chunks/date-picker-variants-eL6HjWvw.js +0 -3363
  172. package/dist/_chunks/due-date-calculator-CwfsFd3T.js +0 -256
  173. package/dist/_chunks/fetal-weight-ePlLjJPc.js +0 -122
  174. package/dist/_chunks/gestational-age-calculator-DdgbH69Z.js +0 -311
  175. package/dist/_chunks/hcg-doubling-BBqD2wI2.js +0 -170
  176. package/dist/_chunks/header-settings--pjYOe6g.js +0 -284
  177. package/dist/_chunks/isSameDay-DUEiAT0G.js +0 -39
  178. package/dist/_chunks/isSameWeek-CK4HS9lH.js +0 -14
  179. package/dist/_chunks/map-view-CsaHfoo6.js +0 -378
  180. package/dist/_chunks/pregnancy-dating-DzYTlBkT.js +0 -421
  181. package/dist/_chunks/pregnancy-weight-gain-O6J0sUIi.js +0 -322
  182. package/dist/_chunks/progress-DA413-zn.js +0 -299
  183. package/dist/_chunks/slot-grid-CQSULZjd.js +0 -502
  184. package/dist/_chunks/subDays-BcNi04uf.js +0 -8
  185. package/dist/_chunks/task-card.agent-Bt14CzUd.js +0 -25
@@ -1,4 +1,4 @@
1
- import { A as m, B as r, E as o, F as d } from "./date-picker-variants-eL6HjWvw.js";
1
+ import { g as m, h as r, j as o, k as d } from "./format-4HNwNGrN.js";
2
2
  const u = {
3
3
  lessThanXSeconds: {
4
4
  one: "moins d’une seconde",
@@ -108,7 +108,7 @@ const u = {
108
108
  narrow: ["T1", "T2", "T3", "T4"],
109
109
  abbreviated: ["1er trim.", "2ème trim.", "3ème trim.", "4ème trim."],
110
110
  wide: ["1er trimestre", "2ème trimestre", "3ème trimestre", "4ème trimestre"]
111
- }, w = {
111
+ }, j = {
112
112
  narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
113
113
  abbreviated: [
114
114
  "janv.",
@@ -138,7 +138,7 @@ const u = {
138
138
  "novembre",
139
139
  "décembre"
140
140
  ]
141
- }, y = {
141
+ }, w = {
142
142
  narrow: ["D", "L", "M", "M", "J", "V", "S"],
143
143
  short: ["di", "lu", "ma", "me", "je", "ve", "sa"],
144
144
  abbreviated: ["dim.", "lun.", "mar.", "mer.", "jeu.", "ven.", "sam."],
@@ -151,7 +151,7 @@ const u = {
151
151
  "vendredi",
152
152
  "samedi"
153
153
  ]
154
- }, j = {
154
+ }, y = {
155
155
  narrow: {
156
156
  am: "AM",
157
157
  pm: "PM",
@@ -205,18 +205,18 @@ const u = {
205
205
  argumentCallback: (a) => a - 1
206
206
  }),
207
207
  month: r({
208
- values: w,
208
+ values: j,
209
209
  defaultWidth: "wide"
210
210
  }),
211
211
  day: r({
212
- values: y,
212
+ values: w,
213
213
  defaultWidth: "wide"
214
214
  }),
215
215
  dayPeriod: r({
216
- values: j,
216
+ values: y,
217
217
  defaultWidth: "wide"
218
218
  })
219
- }, J = /^(\d+)(ième|ère|ème|er|e)?/i, T = /\d+/i, k = {
219
+ }, J = /^(\d+)(ième|ère|ème|er|e)?/i, k = /\d+/i, T = {
220
220
  narrow: /^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,
221
221
  abbreviated: /^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,
222
222
  wide: /^(avant Jésus-Christ|après Jésus-Christ)/i
@@ -228,11 +228,11 @@ const u = {
228
228
  wide: /^[1234](er|ème|e)? trimestre/i
229
229
  }, H = {
230
230
  any: [/1/i, /2/i, /3/i, /4/i]
231
- }, F = {
231
+ }, L = {
232
232
  narrow: /^[jfmasond]/i,
233
233
  abbreviated: /^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,
234
234
  wide: /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i
235
- }, L = {
235
+ }, F = {
236
236
  narrow: [
237
237
  /^j/i,
238
238
  /^f/i,
@@ -272,7 +272,7 @@ const u = {
272
272
  }, z = {
273
273
  narrow: /^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,
274
274
  any: /^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i
275
- }, E = {
275
+ }, X = {
276
276
  any: {
277
277
  am: /^a/i,
278
278
  pm: /^p/i,
@@ -283,14 +283,14 @@ const u = {
283
283
  evening: /soir/i,
284
284
  night: /nuit/i
285
285
  }
286
- }, X = {
286
+ }, E = {
287
287
  ordinalNumber: d({
288
288
  matchPattern: J,
289
- parsePattern: T,
289
+ parsePattern: k,
290
290
  valueCallback: (a) => parseInt(a)
291
291
  }),
292
292
  era: o({
293
- matchPatterns: k,
293
+ matchPatterns: T,
294
294
  defaultMatchWidth: "wide",
295
295
  parsePatterns: D,
296
296
  defaultParseWidth: "any"
@@ -303,9 +303,9 @@ const u = {
303
303
  valueCallback: (a) => a + 1
304
304
  }),
305
305
  month: o({
306
- matchPatterns: F,
306
+ matchPatterns: L,
307
307
  defaultMatchWidth: "wide",
308
- parsePatterns: L,
308
+ parsePatterns: F,
309
309
  defaultParseWidth: "any"
310
310
  }),
311
311
  day: o({
@@ -317,22 +317,22 @@ const u = {
317
317
  dayPeriod: o({
318
318
  matchPatterns: z,
319
319
  defaultMatchWidth: "any",
320
- parsePatterns: E,
320
+ parsePatterns: X,
321
321
  defaultParseWidth: "any"
322
322
  })
323
- }, O = {
323
+ }, A = {
324
324
  code: "fr",
325
325
  formatDistance: l,
326
326
  formatLong: f,
327
327
  formatRelative: p,
328
328
  localize: C,
329
- match: X,
329
+ match: E,
330
330
  options: {
331
331
  weekStartsOn: 1,
332
332
  firstWeekContainsDate: 4
333
333
  }
334
334
  };
335
335
  export {
336
- O as fr
336
+ A as fr
337
337
  };
338
- //# sourceMappingURL=fr-CH8ADfhN.js.map
338
+ //# sourceMappingURL=fr-Bhr6SYKj.js.map
@@ -7,8 +7,8 @@ import { useTranslation as X } from "react-i18next";
7
7
  import { u as Y } from "./use-controllable-state-BiY4xTzM.js";
8
8
  import { u as Z } from "./registry-DvAUVLHh.js";
9
9
  import { B as R } from "./button-CPGiR_bH.js";
10
- import { P as $ } from "./progress-DA413-zn.js";
11
- import { f as ee } from "./payment-form-h-BZ8onk.js";
10
+ import { P as $ } from "./progress-CK8otcQ-.js";
11
+ import { f as ee } from "./payment-form-Ds1I9KqB.js";
12
12
  import { T as se } from "./triangle-alert-CBnO6nq_.js";
13
13
  import { C as ae } from "./check-DrFSN__t.js";
14
14
  const re = {
@@ -276,4 +276,4 @@ export {
276
276
  de as F,
277
277
  re as f
278
278
  };
279
- //# sourceMappingURL=freemium-paywall-C_Ue6wxU.js.map
279
+ //# sourceMappingURL=freemium-paywall-DRDdWuOg.js.map
@@ -0,0 +1,488 @@
1
+ import { jsxs as n, jsx as a, Fragment as se } from "react/jsx-runtime";
2
+ import { forwardRef as ne, useState as m, useMemo as g, useEffect as oe, useRef as ie } from "react";
3
+ import { c as de } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as ce } from "react-i18next";
5
+ import { u as ue } from "./registry-DvAUVLHh.js";
6
+ import { R as d } from "./radio-TWf9Q-mp.js";
7
+ import { R as S } from "./radio-group-CI-6SmSw.js";
8
+ import { F as k } from "./form-field-M5UpX65Z.js";
9
+ import { D as _ } from "./date-picker-Bp64zk2p.js";
10
+ import { S as me } from "./select-BW5ecXlX.js";
11
+ import { S as ge } from "./switch-OILsBLWo.js";
12
+ import { C as E } from "./card-DPmk26CL.js";
13
+ import { B as G } from "./badge-DCOqV9mI.js";
14
+ import { I as pe } from "./insert-result-D074GtHX.js";
15
+ import { c as he, g as fe, e as ye, f as ve, A as be, h as Ae, i as De, G as Ce } from "./antenatal-schedule-timeline-u8TsS2QJ.js";
16
+ import { s as we } from "./subDays-CAUv47M1.js";
17
+ import { c as j } from "./date-picker-variants-pKAJfnWr.js";
18
+ import { p as Se } from "./parseISO-fOGpHKXm.js";
19
+ import { f as ke } from "./format-4HNwNGrN.js";
20
+ const x = "Superseded by the `pregnancy-dating` adapter.", F = {
21
+ type: "string",
22
+ pattern: "^\\d{4}-\\d{2}-\\d{2}$"
23
+ }, xe = {
24
+ id: "gestational-age-calculator",
25
+ // set_value → the three `set_*` actions + the `inputs` state slot.
26
+ capabilities: ["set_value"],
27
+ state: {
28
+ inputs: {
29
+ type: "{ method: 'lmp' | 'edd', referenceDate: string | null, asOfDate: string }",
30
+ descriptionKey: "ui.agent.gestationalAgeCalculator.state.inputs",
31
+ description: "The dating inputs as entered — whether the reference date is a last period or a known due date, that date, and the evaluation date. Dates are `yyyy-MM-dd`. Read this to see which method a reference date will be interpreted under.",
32
+ read: (s) => s.getInputs()
33
+ },
34
+ result: {
35
+ type: "{ gestationalAge: { weeks: number, days: number, totalDays: number } | null, trimester: string, dueDate: string } | null",
36
+ descriptionKey: "ui.agent.gestationalAgeCalculator.state.result",
37
+ description: "Computed gestational age in completed weeks + days as of the evaluation date, the trimester band (preconception / first / second / third / postterm), and the estimated delivery date. Null until a reference date is set.",
38
+ read: (s) => s.getResult()
39
+ }
40
+ },
41
+ actions: {
42
+ set_method: {
43
+ // Drives the same local input state a user picks; nothing is persisted
44
+ // to a record, and the choice is reversible in the same UI.
45
+ safety: "write",
46
+ argsType: "{ method: 'lmp' | 'edd' }",
47
+ argsSchema: {
48
+ type: "object",
49
+ properties: {
50
+ method: {
51
+ enum: ["lmp", "edd"],
52
+ description: "Whether the reference date is the last menstrual period or a known estimated delivery date."
53
+ }
54
+ },
55
+ required: ["method"],
56
+ additionalProperties: !1
57
+ },
58
+ idempotent: !0,
59
+ deprecated: x,
60
+ returns: "boolean",
61
+ returnsSchema: {
62
+ type: "boolean",
63
+ description: "True when the method was applied."
64
+ },
65
+ errors: ["Returns false for a method other than `lmp` or `edd`."],
66
+ descriptionKey: "ui.agent.gestationalAgeCalculator.actions.setMethod",
67
+ description: "Choose how the reference date is read. The date is kept and re-interpreted under the new method, so set the method first — an EDD may be in the future, an LMP may not.",
68
+ invoke: (s, o) => s.setMethod(o.method)
69
+ },
70
+ set_reference_date: {
71
+ safety: "write",
72
+ argsType: "{ date: string | null }",
73
+ argsSchema: {
74
+ type: "object",
75
+ properties: {
76
+ date: {
77
+ oneOf: [
78
+ {
79
+ ...F,
80
+ description: "Local calendar date, `yyyy-MM-dd`."
81
+ },
82
+ { type: "null" }
83
+ ],
84
+ description: "The last period (not in the future) or the known due date, depending on the active method — or null to clear it."
85
+ }
86
+ },
87
+ required: ["date"],
88
+ additionalProperties: !1
89
+ },
90
+ idempotent: !0,
91
+ deprecated: x,
92
+ returns: "boolean",
93
+ returnsSchema: {
94
+ type: "boolean",
95
+ description: "True when the date was applied."
96
+ },
97
+ errors: [
98
+ "Returns false for an unparseable date, or for a future date under the `lmp` method — the on-screen DatePicker caps an LMP at today."
99
+ ],
100
+ examples: [
101
+ {
102
+ args: { date: "2026-01-12" },
103
+ note: "Under the default LMP method, a last period starting 12 January."
104
+ }
105
+ ],
106
+ descriptionKey: "ui.agent.gestationalAgeCalculator.actions.setReferenceDate",
107
+ description: "Set the dating anchor. This is the only required input — the result stays null without it.",
108
+ invoke: (s, o) => s.setReferenceDate(o.date)
109
+ },
110
+ set_as_of_date: {
111
+ safety: "write",
112
+ argsType: "{ date: string }",
113
+ argsSchema: {
114
+ type: "object",
115
+ properties: {
116
+ date: {
117
+ ...F,
118
+ description: "Date to evaluate gestational age and trimester against, `yyyy-MM-dd`. May be in the future to project forward."
119
+ }
120
+ },
121
+ required: ["date"],
122
+ additionalProperties: !1
123
+ },
124
+ idempotent: !0,
125
+ deprecated: x,
126
+ returns: "boolean",
127
+ returnsSchema: {
128
+ type: "boolean",
129
+ description: "True when the date was applied."
130
+ },
131
+ errors: ["Returns false for an unparseable date."],
132
+ examples: [
133
+ {
134
+ args: { date: "2026-09-15" },
135
+ note: "Project gestational age forward to an upcoming appointment."
136
+ }
137
+ ],
138
+ descriptionKey: "ui.agent.gestationalAgeCalculator.actions.setAsOfDate",
139
+ description: "Set the date gestational age, trimester and the antenatal schedule are evaluated against. Defaults to today; the estimated delivery date itself does not depend on it.",
140
+ invoke: (s, o) => s.setAsOfDate(o.date)
141
+ }
142
+ },
143
+ domHooks: {
144
+ root: {
145
+ attr: "data-component",
146
+ value: "gestational-age-calculator",
147
+ description: "Marks the GestationalAgeCalculator (current gestational age, trimester and milestones from LMP or due date)."
148
+ },
149
+ instanceId: {
150
+ attr: "data-component-id",
151
+ sourceProp: "id",
152
+ description: "Sourced from the id prop. Also the registry key — without an `id` the instance does not register and the handle-driven actions/state are unreachable."
153
+ }
154
+ }
155
+ }, Ne = de("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
156
+ variants: {
157
+ width: { full: "ds:w-full", auto: "ds:inline-flex" }
158
+ },
159
+ defaultVariants: { width: "full" }
160
+ }), N = (s) => ke(s, "yyyy-MM-dd"), V = (s) => {
161
+ const o = Se(s);
162
+ return Number.isNaN(o.getTime()) ? null : o;
163
+ }, Re = ne(
164
+ ({
165
+ defaultMethod: s = "lmp",
166
+ defaultReferenceDate: o,
167
+ onResultChange: p,
168
+ onInsert: R,
169
+ insertVariant: T = "insert",
170
+ onCopy: B,
171
+ onError: K,
172
+ insertBrand: q,
173
+ showSchedule: b = !1,
174
+ defaultPlurality: z = "singleton",
175
+ defaultChorionicity: H = "unknown",
176
+ defaultRhNegative: J = !1,
177
+ defaultGdmRisk: U,
178
+ scheduleOptions: M,
179
+ id: O,
180
+ width: W,
181
+ className: Y
182
+ }, Q) => {
183
+ const { t, i18n: P } = ce(), [c, I] = m(s), [u, A] = m(
184
+ o
185
+ ), [i, L] = m(() => /* @__PURE__ */ new Date()), X = g(() => /* @__PURE__ */ new Date(), []), [h, Z] = m(z), [D, ee] = m(H), [C, te] = m(J), [f, ae] = m(
186
+ U ?? "none"
187
+ ), r = g(() => {
188
+ if (!u) return null;
189
+ const e = c === "lmp" ? u : we(u, Ce), l = he({ method: "lmp", date: e }, i);
190
+ return {
191
+ result: {
192
+ gestationalAge: l.gestationalAge,
193
+ trimester: l.trimester,
194
+ dueDate: l.dueDate
195
+ },
196
+ milestones: fe(l.gestationalStart),
197
+ gestationalStart: l.gestationalStart
198
+ };
199
+ }, [c, u, i]), y = g(() => !b || !r ? null : ye(r.gestationalStart, {
200
+ ...M,
201
+ today: i,
202
+ plurality: h,
203
+ chorionicity: D,
204
+ rhNegative: C,
205
+ gdmRisk: f === "none" ? void 0 : f
206
+ }), [
207
+ b,
208
+ r,
209
+ i,
210
+ M,
211
+ h,
212
+ D,
213
+ C,
214
+ f
215
+ ]), re = g(
216
+ () => [
217
+ "unknown",
218
+ "dichorionic-diamniotic",
219
+ "monochorionic-diamniotic",
220
+ "monochorionic-monoamniotic"
221
+ ].map((e) => ({
222
+ value: e,
223
+ label: t(`antenatalSchedule.chorionicity.${e}`)
224
+ })),
225
+ [t]
226
+ ), $ = g(
227
+ () => new Intl.DateTimeFormat(P.language, { dateStyle: "medium" }),
228
+ [P.language]
229
+ );
230
+ oe(() => {
231
+ p == null || p((r == null ? void 0 : r.result) ?? null);
232
+ }, [r, p]);
233
+ const v = ie({ method: c, refDate: u, asOfDate: i, data: r });
234
+ v.current = { method: c, refDate: u, asOfDate: i, data: r };
235
+ const le = g(
236
+ () => ({
237
+ getInputs: () => {
238
+ const e = v.current;
239
+ return {
240
+ method: e.method,
241
+ referenceDate: e.refDate ? N(e.refDate) : null,
242
+ asOfDate: N(e.asOfDate)
243
+ };
244
+ },
245
+ getResult: () => {
246
+ var l;
247
+ const e = (l = v.current.data) == null ? void 0 : l.result;
248
+ return e ? {
249
+ gestationalAge: e.gestationalAge ? { ...e.gestationalAge } : null,
250
+ trimester: e.trimester,
251
+ dueDate: N(e.dueDate)
252
+ } : null;
253
+ },
254
+ setMethod: (e) => e !== "lmp" && e !== "edd" ? !1 : (I(e), !0),
255
+ setReferenceDate: (e) => {
256
+ if (e === null)
257
+ return A(void 0), !0;
258
+ const l = V(e);
259
+ return !l || v.current.method === "lmp" && j(l, /* @__PURE__ */ new Date()) ? !1 : (A(l), !0);
260
+ },
261
+ setAsOfDate: (e) => {
262
+ const l = V(e);
263
+ return l ? (L(l), !0) : !1;
264
+ }
265
+ }),
266
+ []
267
+ );
268
+ ue(xe, le, O);
269
+ const w = (e) => e ? t("gestationalAgeCalculator.gestation", {
270
+ weeks: e.weeks,
271
+ days: e.days
272
+ }) : "—";
273
+ return /* @__PURE__ */ n(
274
+ "div",
275
+ {
276
+ ref: Q,
277
+ "data-component": "gestational-age-calculator",
278
+ "data-component-id": O,
279
+ className: Ne({ width: W, className: Y }),
280
+ children: [
281
+ /* @__PURE__ */ n(
282
+ S,
283
+ {
284
+ label: t("gestationalAgeCalculator.method.label"),
285
+ variant: "horizontal",
286
+ value: c,
287
+ onValueChange: (e) => I(e),
288
+ children: [
289
+ /* @__PURE__ */ a(d, { label: t("gestationalAgeCalculator.method.lmp"), value: "lmp" }),
290
+ /* @__PURE__ */ a(d, { label: t("gestationalAgeCalculator.method.edd"), value: "edd" })
291
+ ]
292
+ }
293
+ ),
294
+ /* @__PURE__ */ a(
295
+ k,
296
+ {
297
+ label: t(
298
+ c === "lmp" ? "gestationalAgeCalculator.lmpDate" : "gestationalAgeCalculator.eddDate"
299
+ ),
300
+ children: /* @__PURE__ */ a(
301
+ _,
302
+ {
303
+ value: u,
304
+ onChange: A,
305
+ maxDate: c === "lmp" ? X : void 0
306
+ }
307
+ )
308
+ }
309
+ ),
310
+ /* @__PURE__ */ a(
311
+ k,
312
+ {
313
+ label: t("gestationalAgeCalculator.asOfDate"),
314
+ description: t("gestationalAgeCalculator.asOfDateHint"),
315
+ children: /* @__PURE__ */ a(_, { value: i, onChange: (e) => e && L(e) })
316
+ }
317
+ ),
318
+ b ? /* @__PURE__ */ n(se, { children: [
319
+ /* @__PURE__ */ n(
320
+ S,
321
+ {
322
+ label: t("antenatalSchedule.plurality.label"),
323
+ variant: "horizontal",
324
+ value: h,
325
+ onValueChange: (e) => Z(e),
326
+ children: [
327
+ /* @__PURE__ */ a(
328
+ d,
329
+ {
330
+ label: t("antenatalSchedule.plurality.singleton"),
331
+ value: "singleton"
332
+ }
333
+ ),
334
+ /* @__PURE__ */ a(
335
+ d,
336
+ {
337
+ label: t("antenatalSchedule.plurality.twin"),
338
+ value: "twin"
339
+ }
340
+ ),
341
+ /* @__PURE__ */ a(
342
+ d,
343
+ {
344
+ label: t("antenatalSchedule.plurality.triplet"),
345
+ value: "triplet"
346
+ }
347
+ )
348
+ ]
349
+ }
350
+ ),
351
+ h !== "singleton" ? /* @__PURE__ */ a(k, { label: t("antenatalSchedule.chorionicity.label"), children: /* @__PURE__ */ a(
352
+ me,
353
+ {
354
+ options: re,
355
+ value: D,
356
+ onValueChange: (e) => ee(e)
357
+ }
358
+ ) }) : null,
359
+ /* @__PURE__ */ a(
360
+ ge,
361
+ {
362
+ label: t("antenatalSchedule.rhNegative"),
363
+ checked: C,
364
+ onCheckedChange: te
365
+ }
366
+ ),
367
+ /* @__PURE__ */ n(
368
+ S,
369
+ {
370
+ label: t("antenatalSchedule.gdmRisk.label"),
371
+ variant: "horizontal",
372
+ value: f,
373
+ onValueChange: (e) => ae(e),
374
+ children: [
375
+ /* @__PURE__ */ a(d, { label: t("antenatalSchedule.gdmRisk.none"), value: "none" }),
376
+ /* @__PURE__ */ a(
377
+ d,
378
+ {
379
+ label: t("antenatalSchedule.gdmRisk.medium"),
380
+ value: "medium"
381
+ }
382
+ ),
383
+ /* @__PURE__ */ a(d, { label: t("antenatalSchedule.gdmRisk.high"), value: "high" })
384
+ ]
385
+ }
386
+ )
387
+ ] }) : null,
388
+ /* @__PURE__ */ a("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: r ? `${t("gestationalAgeCalculator.gestationLabel")}: ${w(
389
+ r.result.gestationalAge
390
+ )}. ${t("gestationalAgeCalculator.trimesterLabel")}: ${t(
391
+ `gestationalAgeCalculator.trimester.${r.result.trimester}`
392
+ )}.` : "" }),
393
+ r ? /* @__PURE__ */ a(E, { variant: "elevated", children: /* @__PURE__ */ n(E.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
394
+ /* @__PURE__ */ n("dl", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: [
395
+ /* @__PURE__ */ n("div", { className: "ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]", children: [
396
+ /* @__PURE__ */ a("dt", { className: "type-label ds:text-muted-foreground", children: t("gestationalAgeCalculator.trimesterLabel") }),
397
+ /* @__PURE__ */ a("dd", { children: /* @__PURE__ */ a(
398
+ G,
399
+ {
400
+ variant: ve[r.result.trimester],
401
+ size: "lg",
402
+ children: t(
403
+ `gestationalAgeCalculator.trimester.${r.result.trimester}`
404
+ )
405
+ }
406
+ ) })
407
+ ] }),
408
+ /* @__PURE__ */ n("div", { className: "ds:flex ds:flex-col ds:items-end ds:gap-[var(--spacing-xs)] ds:text-end", children: [
409
+ /* @__PURE__ */ a("dt", { className: "type-label ds:text-muted-foreground", children: t("gestationalAgeCalculator.gestationLabel") }),
410
+ /* @__PURE__ */ a("dd", { className: "type-metric ds:text-foreground", children: w(r.result.gestationalAge) })
411
+ ] })
412
+ ] }),
413
+ /* @__PURE__ */ n("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
414
+ /* @__PURE__ */ a("span", { className: "type-label ds:text-muted-foreground", children: t("gestationalAgeCalculator.milestonesLabel") }),
415
+ /* @__PURE__ */ a("ul", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: r.milestones.map((e) => {
416
+ const l = j(i, e.date);
417
+ return /* @__PURE__ */ n(
418
+ "li",
419
+ {
420
+ className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-md)]",
421
+ children: [
422
+ /* @__PURE__ */ a("span", { className: "type-body ds:text-foreground", children: t(`gestationalAgeCalculator.milestone.${e.key}`) }),
423
+ /* @__PURE__ */ n("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
424
+ /* @__PURE__ */ a("span", { className: "type-body ds:text-muted-foreground", children: $.format(e.date) }),
425
+ l ? /* @__PURE__ */ a(G, { variant: "success", children: t("gestationalAgeCalculator.reached") }) : null
426
+ ] })
427
+ ]
428
+ },
429
+ e.key
430
+ );
431
+ }) })
432
+ ] })
433
+ ] }) }) : /* @__PURE__ */ a("p", { className: "type-body ds:text-muted-foreground", children: t("gestationalAgeCalculator.empty") }),
434
+ y ? /* @__PURE__ */ a(be, { events: y }) : null,
435
+ r && (T === "copy" || R) ? /* @__PURE__ */ a(
436
+ pe,
437
+ {
438
+ onInsert: R,
439
+ variant: T,
440
+ onCopy: B,
441
+ onError: K,
442
+ card: {
443
+ title: t("insert.title.gestationalAge"),
444
+ icon: "baby",
445
+ highlight: t(
446
+ `gestationalAgeCalculator.trimester.${r.result.trimester}`
447
+ ),
448
+ // Chip shares the trimester's semantic token so the inserted PNG
449
+ // chip matches the on-screen trimester badge — with the
450
+ // contrast-safe orange override for the `--warning` third trimester.
451
+ highlightToken: De(r.result.trimester),
452
+ brand: q,
453
+ fields: [
454
+ {
455
+ // Gestational age is an elapsed duration → clock glyph.
456
+ icon: "clock",
457
+ label: t("gestationalAgeCalculator.gestationLabel"),
458
+ value: w(r.result.gestationalAge)
459
+ },
460
+ {
461
+ // Trimester is a clinical-stage classification → tag.
462
+ icon: "tag",
463
+ label: t("gestationalAgeCalculator.trimesterLabel"),
464
+ value: t(
465
+ `gestationalAgeCalculator.trimester.${r.result.trimester}`
466
+ )
467
+ },
468
+ // When the schedule is shown, the single Insert button carries
469
+ // the exam windows too (no second button).
470
+ ...y ? Ae(
471
+ y,
472
+ t,
473
+ (e) => $.format(e)
474
+ ) : []
475
+ ]
476
+ }
477
+ }
478
+ ) : null
479
+ ]
480
+ }
481
+ );
482
+ }
483
+ );
484
+ Re.displayName = "GestationalAgeCalculator";
485
+ export {
486
+ Re as G
487
+ };
488
+ //# sourceMappingURL=gestational-age-calculator-BljY_DVJ.js.map