@alfadocs/ui-kit-debug 1.4.8 → 1.4.10

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 (121) hide show
  1. package/dist/_chunks/anamnesis-summary-card-CpQViN5l.js +392 -0
  2. package/dist/_chunks/anamnesis-summary-card-CpQViN5l.js.map +1 -0
  3. package/dist/_chunks/{anamnesis-summary-rows-Co3BA0ro.js → anamnesis-summary-rows-BWjPUp0m.js} +695 -693
  4. package/dist/_chunks/anamnesis-summary-rows-BWjPUp0m.js.map +1 -0
  5. package/dist/_chunks/{booking-BHziT711.js → booking-DuSkvE5x.js} +2 -2
  6. package/dist/_chunks/{booking-BHziT711.js.map → booking-DuSkvE5x.js.map} +1 -1
  7. package/dist/_chunks/{link-cell-renderer-DIKlJhEq.js → link-cell-renderer-C8npOgmM.js} +2 -2
  8. package/dist/_chunks/{link-cell-renderer-DIKlJhEq.js.map → link-cell-renderer-C8npOgmM.js.map} +1 -1
  9. package/dist/_chunks/{multi-select-CC52Qws6.js → multi-select-DqL4o0qV.js} +2 -1
  10. package/dist/_chunks/{multi-select-CC52Qws6.js.map → multi-select-DqL4o0qV.js.map} +1 -1
  11. package/dist/_chunks/{patient-table-DQKcWowi.js → patient-table-zifAcsjV.js} +2 -2
  12. package/dist/_chunks/{patient-table-DQKcWowi.js.map → patient-table-zifAcsjV.js.map} +1 -1
  13. package/dist/agent-catalog.json +1 -1
  14. package/dist/components/anamnesis-summary-card/anamnesis-summary-card.d.ts +12 -0
  15. package/dist/components/anamnesis-summary-card/anamnesis-summary-card.d.ts.map +1 -1
  16. package/dist/components/anamnesis-summary-card/index.js +1 -1
  17. package/dist/components/booking/index.js +1 -1
  18. package/dist/components/data-table/index.js +1 -1
  19. package/dist/components/multi-select/index.js +1 -1
  20. package/dist/components/multi-select/multi-select.d.ts.map +1 -1
  21. package/dist/components/patient-table/index.js +1 -1
  22. package/dist/i18n/locales/ar.d.ts +1 -0
  23. package/dist/i18n/locales/ar.d.ts.map +1 -1
  24. package/dist/i18n/locales/ar.js +1 -0
  25. package/dist/i18n/locales/ar.js.map +1 -1
  26. package/dist/i18n/locales/de.d.ts +1 -0
  27. package/dist/i18n/locales/de.d.ts.map +1 -1
  28. package/dist/i18n/locales/de.js +1 -0
  29. package/dist/i18n/locales/de.js.map +1 -1
  30. package/dist/i18n/locales/el.d.ts +1 -0
  31. package/dist/i18n/locales/el.d.ts.map +1 -1
  32. package/dist/i18n/locales/el.js +1 -0
  33. package/dist/i18n/locales/el.js.map +1 -1
  34. package/dist/i18n/locales/en.d.ts +1 -0
  35. package/dist/i18n/locales/en.d.ts.map +1 -1
  36. package/dist/i18n/locales/en.js +1 -0
  37. package/dist/i18n/locales/en.js.map +1 -1
  38. package/dist/i18n/locales/es.d.ts +1 -0
  39. package/dist/i18n/locales/es.d.ts.map +1 -1
  40. package/dist/i18n/locales/es.js +1 -0
  41. package/dist/i18n/locales/es.js.map +1 -1
  42. package/dist/i18n/locales/fr.d.ts +1 -0
  43. package/dist/i18n/locales/fr.d.ts.map +1 -1
  44. package/dist/i18n/locales/fr.js +1 -0
  45. package/dist/i18n/locales/fr.js.map +1 -1
  46. package/dist/i18n/locales/hi.d.ts +1 -0
  47. package/dist/i18n/locales/hi.d.ts.map +1 -1
  48. package/dist/i18n/locales/hi.js +1 -0
  49. package/dist/i18n/locales/hi.js.map +1 -1
  50. package/dist/i18n/locales/it.d.ts +1 -0
  51. package/dist/i18n/locales/it.d.ts.map +1 -1
  52. package/dist/i18n/locales/it.js +1 -0
  53. package/dist/i18n/locales/it.js.map +1 -1
  54. package/dist/i18n/locales/ja.d.ts +1 -0
  55. package/dist/i18n/locales/ja.d.ts.map +1 -1
  56. package/dist/i18n/locales/ja.js +1 -0
  57. package/dist/i18n/locales/ja.js.map +1 -1
  58. package/dist/i18n/locales/nl.d.ts +1 -0
  59. package/dist/i18n/locales/nl.d.ts.map +1 -1
  60. package/dist/i18n/locales/nl.js +1 -0
  61. package/dist/i18n/locales/nl.js.map +1 -1
  62. package/dist/i18n/locales/pl.d.ts +1 -0
  63. package/dist/i18n/locales/pl.d.ts.map +1 -1
  64. package/dist/i18n/locales/pl.js +1 -0
  65. package/dist/i18n/locales/pl.js.map +1 -1
  66. package/dist/i18n/locales/pt.d.ts +1 -0
  67. package/dist/i18n/locales/pt.d.ts.map +1 -1
  68. package/dist/i18n/locales/pt.js +1 -0
  69. package/dist/i18n/locales/pt.js.map +1 -1
  70. package/dist/i18n/locales/ro.d.ts +1 -0
  71. package/dist/i18n/locales/ro.d.ts.map +1 -1
  72. package/dist/i18n/locales/ro.js +1 -0
  73. package/dist/i18n/locales/ro.js.map +1 -1
  74. package/dist/i18n/locales/ru.d.ts +1 -0
  75. package/dist/i18n/locales/ru.d.ts.map +1 -1
  76. package/dist/i18n/locales/ru.js +1 -0
  77. package/dist/i18n/locales/ru.js.map +1 -1
  78. package/dist/i18n/locales/sq.d.ts +1 -0
  79. package/dist/i18n/locales/sq.d.ts.map +1 -1
  80. package/dist/i18n/locales/sq.js +1 -0
  81. package/dist/i18n/locales/sq.js.map +1 -1
  82. package/dist/i18n/locales/sv.d.ts +1 -0
  83. package/dist/i18n/locales/sv.d.ts.map +1 -1
  84. package/dist/i18n/locales/sv.js +1 -0
  85. package/dist/i18n/locales/sv.js.map +1 -1
  86. package/dist/i18n/locales/tr.d.ts +1 -0
  87. package/dist/i18n/locales/tr.d.ts.map +1 -1
  88. package/dist/i18n/locales/tr.js +1 -0
  89. package/dist/i18n/locales/tr.js.map +1 -1
  90. package/dist/i18n/locales/zh.d.ts +1 -0
  91. package/dist/i18n/locales/zh.d.ts.map +1 -1
  92. package/dist/i18n/locales/zh.js +1 -0
  93. package/dist/i18n/locales/zh.js.map +1 -1
  94. package/dist/index.js +6 -6
  95. package/dist/locales/ar.json +1 -0
  96. package/dist/locales/de.json +1 -0
  97. package/dist/locales/el.json +1 -0
  98. package/dist/locales/en.json +1 -0
  99. package/dist/locales/es.json +1 -0
  100. package/dist/locales/fr.json +1 -0
  101. package/dist/locales/hi.json +1 -0
  102. package/dist/locales/it.json +1 -0
  103. package/dist/locales/ja.json +1 -0
  104. package/dist/locales/nl.json +1 -0
  105. package/dist/locales/pl.json +1 -0
  106. package/dist/locales/pt.json +1 -0
  107. package/dist/locales/ro.json +1 -0
  108. package/dist/locales/ru.json +1 -0
  109. package/dist/locales/sq.json +1 -0
  110. package/dist/locales/sv.json +1 -0
  111. package/dist/locales/tr.json +1 -0
  112. package/dist/locales/zh.json +1 -0
  113. package/dist/patterns/anamnesis/anamnesis-format.d.ts.map +1 -1
  114. package/dist/patterns/anamnesis/anamnesis-i18n.d.ts.map +1 -1
  115. package/dist/patterns/anamnesis/anamnesis-intake.d.ts.map +1 -1
  116. package/dist/patterns/anamnesis/index.js +1 -1
  117. package/dist/tokens.css +1 -1
  118. package/package.json +1 -1
  119. package/dist/_chunks/anamnesis-summary-card-BvaSnAbI.js +0 -302
  120. package/dist/_chunks/anamnesis-summary-card-BvaSnAbI.js.map +0 -1
  121. package/dist/_chunks/anamnesis-summary-rows-Co3BA0ro.js.map +0 -1
@@ -1,35 +1,35 @@
1
1
  import { jsxs as d, jsx as t, Fragment as Ae } from "react/jsx-runtime";
2
2
  import { useRef as we, useState as z, useEffect as on, useCallback as tn, useId as Qe, useMemo as q, Fragment as ti, useContext as ii, createContext as si } from "react";
3
- import { B as J } from "./badge-DCOqV9mI.js";
4
- import { B as ae } from "./button-BvNtqHAS.js";
5
- import { I as de } from "./icon-button-9c9Gp41m.js";
6
- import { C as me } from "./card-DPmk26CL.js";
7
- import { C as da, b as et, a as ua } from "./collapsible-CTjxzGuF.js";
3
+ import { B as X } from "./badge-DCOqV9mI.js";
4
+ import { B as ne } from "./button-BvNtqHAS.js";
5
+ import { I as ce } from "./icon-button-9c9Gp41m.js";
6
+ import { C as ue } from "./card-DPmk26CL.js";
7
+ import { C as ca, b as Za, a as da } from "./collapsible-CTjxzGuF.js";
8
8
  import { E as Ue } from "./empty-state-Df0tM6Kn.js";
9
9
  import { F as V } from "./form-field-M5UpX65Z.js";
10
- import { M as ma } from "./multi-select-CC52Qws6.js";
10
+ import { M as ua } from "./multi-select-DqL4o0qV.js";
11
11
  import { N as yn } from "./number-input-DOe5VYei.js";
12
12
  import { R as ke } from "./radio-TWf9Q-mp.js";
13
13
  import { R as vn } from "./radio-group-CI-6SmSw.js";
14
14
  import { S as Ve } from "./select-BW5ecXlX.js";
15
- import { T as Y } from "./tabs-CBb2AidH.js";
15
+ import { T as Q } from "./tabs-CBb2AidH.js";
16
16
  import { T as sn } from "./text-area-Bt3p7Pt0.js";
17
17
  import { T as ie } from "./text-input-CUvCb6ST.js";
18
18
  import { T as rn } from "./timestamp-BV2lC-wV.js";
19
19
  import { D as oi } from "./date-picker-Bp64zk2p.js";
20
20
  import { A as He } from "./alert-CiJT540z.js";
21
21
  import { D as _ } from "./description-list-Ck7fKdt5.js";
22
- import { c as nt } from "./index-D2ZczOXr.js";
22
+ import { c as et } from "./index-D2ZczOXr.js";
23
23
  import { S as ri } from "./sparkline-BmGcEyZO.js";
24
24
  import { U as li } from "./user-B12p7bVF.js";
25
- import { A as at, a as tt } from "./arrow-up-BYvcvTkB.js";
25
+ import { A as nt, a as at } from "./arrow-up-BYvcvTkB.js";
26
26
  import { M as ci } from "./minus-BQDHq1c1.js";
27
- import { C as pa } from "./chevron-down-DWE7GSq9.js";
27
+ import { C as ma } from "./chevron-down-DWE7GSq9.js";
28
28
  import { S as di } from "./separator-CYU_bGFn.js";
29
29
  import { X as ui } from "./x-B5YnXwCz.js";
30
30
  import { A as mi } from "./annotation-marker-CsUJGZjQ.js";
31
- import { D as ee } from "./dialog-UbKJCi1X.js";
32
- import { D as ce } from "./dropdown-menu-DU-Hrf33.js";
31
+ import { D as Z } from "./dialog-UbKJCi1X.js";
32
+ import { D as le } from "./dropdown-menu-DU-Hrf33.js";
33
33
  import { S as pi } from "./share-2-B49jcW2I.js";
34
34
  import { F as hi } from "./file-text-5yv6r2ls.js";
35
35
  import { P as gi } from "./printer-rkK0T1gi.js";
@@ -46,26 +46,26 @@ import { P as an } from "./plus-DzMQ_c6b.js";
46
46
  import { T as Ci } from "./trash-2-uumy3fy1.js";
47
47
  import { A as Ti, b as Si, c as Ai, a as Ei } from "./accordion-C11v9ouP.js";
48
48
  import { P as Di } from "./progress-CK8otcQ-.js";
49
- import { c as ha } from "./createLucideIcon-DhHxpK9K.js";
49
+ import { c as pa } from "./createLucideIcon-DhHxpK9K.js";
50
50
  import { I as Sn } from "./icon-button-group-DrvuWPGJ.js";
51
51
  import { L as en } from "./list-DgE1xWBM.js";
52
- import { S as ga } from "./switch-OILsBLWo.js";
52
+ import { S as ha } from "./switch-OILsBLWo.js";
53
53
  import { G as Ii } from "./grip-vertical-onSb1JXO.js";
54
- import { L as Ri } from "./lock-ClAFG1gy.js";
55
- import { N as Pa } from "./notebook-pen-CO7HoM-W.js";
54
+ import { L as Li } from "./lock-ClAFG1gy.js";
55
+ import { N as Ra } from "./notebook-pen-CO7HoM-W.js";
56
56
  /**
57
57
  * @license lucide-react v1.22.0 - ISC
58
58
  *
59
59
  * This source code is licensed under the ISC license.
60
60
  * See the LICENSE file in the root directory of this source tree.
61
61
  */
62
- const Li = [
62
+ const Ri = [
63
63
  ["rect", { width: "20", height: "5", x: "2", y: "3", rx: "1", key: "1wp1u1" }],
64
64
  ["path", { d: "M4 8v11a2 2 0 0 0 2 2h2", key: "tvwodi" }],
65
65
  ["path", { d: "M20 8v11a2 2 0 0 1-2 2h-2", key: "1gkqxj" }],
66
66
  ["path", { d: "m9 15 3-3 3 3", key: "1pd0qc" }],
67
67
  ["path", { d: "M12 12v9", key: "192myk" }]
68
- ], An = ha("archive-restore", Li);
68
+ ], An = pa("archive-restore", Ri);
69
69
  /**
70
70
  * @license lucide-react v1.22.0 - ISC
71
71
  *
@@ -76,7 +76,7 @@ const Fi = [
76
76
  ["rect", { width: "20", height: "5", x: "2", y: "3", rx: "1", key: "1wp1u1" }],
77
77
  ["path", { d: "M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8", key: "1s80jp" }],
78
78
  ["path", { d: "M10 12h4", key: "a56b0p" }]
79
- ], En = ha("archive", Fi);
79
+ ], En = pa("archive", Fi);
80
80
  /**
81
81
  * @license lucide-react v1.22.0 - ISC
82
82
  *
@@ -92,7 +92,7 @@ const Pi = [
92
92
  }
93
93
  ],
94
94
  ["path", { d: "M6 12h16", key: "s4cdu5" }]
95
- ], _i = ha("send-horizontal", Pi), $i = [
95
+ ], _i = pa("send-horizontal", Pi), $i = [
96
96
  {
97
97
  key: "weight",
98
98
  goal: !0,
@@ -268,13 +268,13 @@ const Pi = [
268
268
  betterDirection: "up",
269
269
  precision: 0
270
270
  }
271
- ], it = [
271
+ ], tt = [
272
272
  ...$i,
273
273
  ...Mi,
274
274
  ...zi
275
275
  ];
276
- Object.fromEntries(it.map((e) => [e.key, e]));
277
- const Rn = [
276
+ Object.fromEntries(tt.map((e) => [e.key, e]));
277
+ const Ln = [
278
278
  { code: "E66" },
279
279
  { code: "E66.0", parentCode: "E66" },
280
280
  { code: "E66.9", parentCode: "E66" },
@@ -288,12 +288,12 @@ const Rn = [
288
288
  { code: "D50" },
289
289
  { code: "E55" }
290
290
  ];
291
- Object.fromEntries(Rn.map((e) => [e.code, e]));
291
+ Object.fromEntries(Ln.map((e) => [e.code, e]));
292
292
  const Oi = (e) => `anamnesis.pathology.${e.replace(/\./g, "_")}`;
293
- Rn.filter(
294
- (e) => !Rn.some((n) => n.parentCode === e.code)
293
+ Ln.filter(
294
+ (e) => !Ln.some((n) => n.parentCode === e.code)
295
295
  ).map((e) => e.code);
296
- const st = [
296
+ const it = [
297
297
  {
298
298
  key: "reason",
299
299
  fields: [{ key: "reasonForVisit", required: !0, type: "textarea" }]
@@ -421,7 +421,7 @@ const st = [
421
421
  ]
422
422
  }
423
423
  ];
424
- st.flatMap(
424
+ it.flatMap(
425
425
  (e) => e.fields.map((n) => n.key)
426
426
  );
427
427
  const qi = /* @__PURE__ */ new Set([
@@ -443,9 +443,9 @@ function Ui(e) {
443
443
  return Bi.has(e);
444
444
  }
445
445
  const We = {
446
- parameters: it,
447
- intakeSections: st,
448
- pathologies: Rn
446
+ parameters: tt,
447
+ intakeSections: it,
448
+ pathologies: Ln
449
449
  };
450
450
  function dn(e) {
451
451
  return {
@@ -459,14 +459,14 @@ function Ye(e) {
459
459
  (n, a) => (n.item.order ?? n.index) - (a.item.order ?? a.index) || n.index - a.index
460
460
  ).map((n) => n.item);
461
461
  }
462
- function Ln(e) {
462
+ function Rn(e) {
463
463
  return e.enabled !== !1;
464
464
  }
465
- function ot(e) {
465
+ function st(e) {
466
466
  const n = Vi(e.key);
467
467
  return e.locked === n ? e : { ...e, locked: n };
468
468
  }
469
- function rt(e) {
469
+ function ot(e) {
470
470
  const n = [];
471
471
  for (const a of e)
472
472
  n.includes(a.group) || n.push(a.group);
@@ -475,41 +475,41 @@ function rt(e) {
475
475
  );
476
476
  }
477
477
  function Ne(e, n) {
478
- const i = dn(e).parameters.map(ot).filter((o) => Ln(o) || o.locked), s = n ? i.filter((o) => o.group === n) : i;
479
- return rt(s);
478
+ const i = dn(e).parameters.map(st).filter((o) => Rn(o) || o.locked), s = n ? i.filter((o) => o.group === n) : i;
479
+ return ot(s);
480
480
  }
481
481
  function _e(e, n) {
482
- const a = dn(e).parameters.map(ot), i = n ? a.filter((s) => s.group === n) : a;
483
- return rt(i);
482
+ const a = dn(e).parameters.map(st), i = n ? a.filter((s) => s.group === n) : a;
483
+ return ot(i);
484
484
  }
485
485
  function Ki(e) {
486
486
  return { ...e, fields: Ye(e.fields) };
487
487
  }
488
- function fa(e) {
489
- return Ye(dn(e).intakeSections).filter(Ln).map((n) => ({
488
+ function ga(e) {
489
+ return Ye(dn(e).intakeSections).filter(Rn).map((n) => ({
490
490
  ...n,
491
- fields: Ye(n.fields.filter(Ln))
491
+ fields: Ye(n.fields.filter(Rn))
492
492
  })).filter((n) => n.fields.length > 0);
493
493
  }
494
494
  function Ge(e) {
495
495
  return Ye(dn(e).intakeSections).map(Ki);
496
496
  }
497
- function lt(e) {
498
- return Ye(dn(e).pathologies.filter(Ln));
497
+ function rt(e) {
498
+ return Ye(dn(e).pathologies.filter(Rn));
499
499
  }
500
- function oa(e) {
500
+ function sa(e) {
501
501
  return Ye(dn(e).pathologies);
502
502
  }
503
503
  function zn(e) {
504
504
  return Object.fromEntries(
505
- oa(e).map((n) => [n.code, n])
505
+ sa(e).map((n) => [n.code, n])
506
506
  );
507
507
  }
508
508
  function Hi(e) {
509
- const n = lt(e);
509
+ const n = rt(e);
510
510
  return n.filter((a) => !n.some((i) => i.parentCode === a.code)).map((a) => a.code);
511
511
  }
512
- const va = {
512
+ const fa = {
513
513
  weight: "weightKg",
514
514
  height: "heightCm",
515
515
  waist: "waistCm",
@@ -521,7 +521,7 @@ const va = {
521
521
  month: "short",
522
522
  day: "numeric",
523
523
  timeZone: "UTC"
524
- }, ct = {
524
+ }, lt = {
525
525
  year: "numeric",
526
526
  month: "short",
527
527
  day: "numeric",
@@ -531,11 +531,11 @@ const va = {
531
531
  function ln(e) {
532
532
  return e != null && Gi.test(e);
533
533
  }
534
- function _a(e) {
534
+ function Fa(e) {
535
535
  return ji.test(e) ? e.slice(0, 10) : e;
536
536
  }
537
537
  function On(e) {
538
- return ln(e) ? ct : Mn;
538
+ return ln(e) ? lt : Mn;
539
539
  }
540
540
  function Wi(e, n) {
541
541
  return wi(e ?? null, n ?? null);
@@ -545,7 +545,7 @@ function cn(e) {
545
545
  }
546
546
  function Qi(e, n) {
547
547
  if (!cn(e) || !cn(n)) return null;
548
- const a = new Date(_a(e)), i = new Date(_a(n));
548
+ const a = new Date(Fa(e)), i = new Date(Fa(n));
549
549
  let s = i.getUTCFullYear() - a.getUTCFullYear();
550
550
  const o = i.getUTCMonth() - a.getUTCMonth();
551
551
  return (o < 0 || o === 0 && i.getUTCDate() < a.getUTCDate()) && (s -= 1), s < 0 ? null : s;
@@ -554,22 +554,22 @@ const Yi = /* @__PURE__ */ new Set([
554
554
  "energy",
555
555
  "protein"
556
556
  ]);
557
- function dt(e) {
558
- return e.key === "bmi" ? "computed" : e.key in va ? "anthropometric" : Yi.has(e.key) ? "dietary" : "lab";
557
+ function ct(e) {
558
+ return e.key === "bmi" ? "computed" : e.key in fa ? "anthropometric" : Yi.has(e.key) ? "dietary" : "lab";
559
559
  }
560
560
  function pn(e) {
561
561
  return e != null && Number.isFinite(e) ? e : null;
562
562
  }
563
563
  function $e(e, n) {
564
564
  var a;
565
- switch (dt(n)) {
565
+ switch (ct(n)) {
566
566
  case "computed":
567
567
  return Wi(
568
568
  pn(e.anthropometrics.weightKg),
569
569
  pn(e.anthropometrics.heightCm)
570
570
  );
571
571
  case "anthropometric":
572
- return pn(e.anthropometrics[va[n.key]]);
572
+ return pn(e.anthropometrics[fa[n.key]]);
573
573
  case "dietary": {
574
574
  const i = (a = e.dietaryIntake) == null ? void 0 : a.find((s) => s.parameterKey === n.key);
575
575
  return i ? pn(i.value) : null;
@@ -587,29 +587,29 @@ function Xi(e, n) {
587
587
  }
588
588
  return null;
589
589
  }
590
- function $a(e, n, a) {
590
+ function Pa(e, n, a) {
591
591
  return e.some((i) => i.parameterKey === n) ? e.map(
592
592
  (i) => i.parameterKey === n ? { ...i, value: a } : i
593
593
  ) : [...e, { parameterKey: n, value: a }];
594
594
  }
595
- function za(e, n, a) {
596
- const i = dt(n);
595
+ function _a(e, n, a) {
596
+ const i = ct(n);
597
597
  return i === "computed" || n.computed ? e : i === "anthropometric" ? {
598
598
  ...e,
599
599
  anthropometrics: {
600
600
  ...e.anthropometrics,
601
- [va[n.key]]: a
601
+ [fa[n.key]]: a
602
602
  }
603
603
  } : i === "dietary" ? {
604
604
  ...e,
605
- dietaryIntake: $a(
605
+ dietaryIntake: Pa(
606
606
  e.dietaryIntake ?? [],
607
607
  n.key,
608
608
  a
609
609
  )
610
- } : { ...e, labs: $a(e.labs, n.key, a) };
610
+ } : { ...e, labs: Pa(e.labs, n.key, a) };
611
611
  }
612
- function ut(e, n, a) {
612
+ function dt(e, n, a) {
613
613
  const i = a != null && Number.isFinite(a) ? a : null;
614
614
  if (i == null) {
615
615
  const r = e.targets.filter(
@@ -627,7 +627,7 @@ function ut(e, n, a) {
627
627
  function xn(e, n) {
628
628
  return e == null || !Number.isFinite(e) || !n ? null : n.min != null && e < n.min ? "low" : n.max != null && e > n.max ? "high" : null;
629
629
  }
630
- function Ma(e, n) {
630
+ function $a(e, n) {
631
631
  return n ? n.min != null && e < n.min ? n.min - e : n.max != null && e > n.max ? e - n.max : 0 : 0;
632
632
  }
633
633
  function kn(e, n, a) {
@@ -643,14 +643,14 @@ function kn(e, n, a) {
643
643
  o = i > 0 ? "good" : "bad";
644
644
  break;
645
645
  case "toRange": {
646
- const r = Ma(n, a.referenceRange), l = Ma(e, a.referenceRange);
646
+ const r = $a(n, a.referenceRange), l = $a(e, a.referenceRange);
647
647
  l < r ? o = "good" : l > r ? o = "bad" : o = "neutral";
648
648
  break;
649
649
  }
650
650
  }
651
651
  return { abs: i, direction: s, valence: o };
652
652
  }
653
- function ya(e, n) {
653
+ function va(e, n) {
654
654
  const a = new Map(
655
655
  e.targets.map((i) => [i.parameterKey, i.target])
656
656
  );
@@ -676,12 +676,12 @@ const Ji = [
676
676
  "nutritionalProposal",
677
677
  "clinicalNotes"
678
678
  ];
679
- function mt(e, n) {
679
+ function ut(e, n) {
680
680
  const a = 10 ** n;
681
681
  return Math.round(e * a) / a;
682
682
  }
683
683
  function Zi(e, n) {
684
- return e == null ? null : mt(e, n);
684
+ return e == null ? null : ut(e, n);
685
685
  }
686
686
  function Dn(e, n = (a, i) => a === i) {
687
687
  return e.every((a) => n(a, e[0]));
@@ -703,12 +703,12 @@ function ns(e, n) {
703
703
  });
704
704
  }
705
705
  const i = [];
706
- for (const r of Oa(e, (l) => l.pathologyCodes)) {
706
+ for (const r of za(e, (l) => l.pathologyCodes)) {
707
707
  const l = e.map((c) => c.pathologyCodes.includes(r));
708
708
  Dn(l) || i.push({ code: r, present: l });
709
709
  }
710
710
  const s = [];
711
- for (const r of Oa(
711
+ for (const r of za(
712
712
  e,
713
713
  (l) => l.therapy.map((c) => c.id)
714
714
  )) {
@@ -727,7 +727,7 @@ function ns(e, n) {
727
727
  }
728
728
  return { visits: [...e], numeric: a, pathologies: i, medications: s, texts: o };
729
729
  }
730
- function Oa(e, n) {
730
+ function za(e, n) {
731
731
  const a = [];
732
732
  for (const i of e)
733
733
  for (const s of n(i)) a.includes(s) || a.push(s);
@@ -736,15 +736,15 @@ function Oa(e, n) {
736
736
  function qn(e) {
737
737
  return e.visits[e.visits.length - 1];
738
738
  }
739
- const De = "—", qa = /* @__PURE__ */ new Map();
739
+ const De = "—", Ma = /* @__PURE__ */ new Map();
740
740
  function as(e, n) {
741
741
  const a = `${e ?? ""}|${n}`;
742
- let i = qa.get(a);
742
+ let i = Ma.get(a);
743
743
  return i || (i = new Intl.NumberFormat(e, {
744
744
  minimumFractionDigits: n,
745
745
  maximumFractionDigits: n,
746
746
  useGrouping: !1
747
- }), qa.set(a, i)), i;
747
+ }), Ma.set(a, i)), i;
748
748
  }
749
749
  function Ee(e, n = 1, a) {
750
750
  return e == null || !Number.isFinite(e) ? De : as(a, n).format(e);
@@ -755,13 +755,13 @@ function ts(e, n) {
755
755
  ) : De;
756
756
  }
757
757
  function is(e, n) {
758
- return cn(e) ? new Intl.DateTimeFormat(n, ct).format(
758
+ return cn(e) ? new Intl.DateTimeFormat(n, lt).format(
759
759
  new Date(e)
760
760
  ) : De;
761
761
  }
762
762
  function ss(e, n = 1, a) {
763
763
  if (!Number.isFinite(e)) return De;
764
- const i = mt(e, n);
764
+ const i = ut(e, n);
765
765
  return i === 0 ? "0" : `${i > 0 ? "+" : "−"}${Ee(Math.abs(i), n, a)}`;
766
766
  }
767
767
  function un(e, n) {
@@ -772,11 +772,11 @@ function Ie(e) {
772
772
  const n = e.lng;
773
773
  return typeof n == "string" ? n : void 0;
774
774
  }
775
- function le(e, n) {
775
+ function re(e, n) {
776
776
  const a = Ie(n);
777
777
  return ln(e) ? is(e, a) : ts(e, a);
778
778
  }
779
- function pt(e) {
779
+ function mt(e) {
780
780
  const [n, a, i] = e.slice(0, 10).split("-").map(Number);
781
781
  if (!(!n || !a || !i))
782
782
  return new Date(n, a - 1, i);
@@ -788,13 +788,16 @@ function rs(e) {
788
788
  const n = (a) => String(a).padStart(2, "0");
789
789
  return `${e.getFullYear()}-${n(e.getMonth() + 1)}-${n(e.getDate())}`;
790
790
  }
791
- function ht(e, n, a, i = !1) {
791
+ function pt(e, n, a, i = !1) {
792
792
  const s = a("anamnesis.compare.visitOption", {
793
793
  index: n + 1,
794
794
  visitType: a(`anamnesis.visitType.${e.visitType}`),
795
- date: le(e.dateIso, a)
796
- });
797
- return i ? a("anamnesis.window.optionHasNote", { label: s }) : s;
795
+ date: re(e.dateIso, a)
796
+ }), o = e.sourceLabel ? a("anamnesis.compare.visitOptionSource", {
797
+ label: s,
798
+ source: e.sourceLabel
799
+ }) : s;
800
+ return i ? a("anamnesis.window.optionHasNote", { label: o }) : o;
798
801
  }
799
802
  function ls(e, n, a) {
800
803
  const i = Qi(e, n);
@@ -822,18 +825,18 @@ function cs(e, n) {
822
825
  const a = ge(e, n);
823
826
  return e.unit ? `${a} (${e.unit})` : a;
824
827
  }
825
- function gt(e, n) {
828
+ function ht(e, n) {
826
829
  const a = wn(e.helpText);
827
830
  return a || n(`anamnesis.field.${e.key}.help`, { defaultValue: "" }) || void 0;
828
831
  }
829
832
  function fe(e, n) {
830
833
  return wn(e.label) ?? n(`anamnesis.section.${e.key}`, { defaultValue: e.key });
831
834
  }
832
- function ba(e, n, a) {
835
+ function ya(e, n, a) {
833
836
  return wn(a == null ? void 0 : a.label) ?? n(Oi(e), { defaultValue: e });
834
837
  }
835
838
  function Se(e, n, a) {
836
- const i = ba(e, n, a);
839
+ const i = ya(e, n, a);
837
840
  return i === e ? e : `${e} — ${i}`;
838
841
  }
839
842
  function Xe(e) {
@@ -956,7 +959,7 @@ function hs(e, n, a, i) {
956
959
  }
957
960
  return { groups: r, answered: l, total: s.length };
958
961
  }
959
- function ft(e, n, a, i) {
962
+ function gt(e, n, a, i) {
960
963
  const s = [];
961
964
  for (const o of e)
962
965
  for (const r of o.fields) {
@@ -978,7 +981,7 @@ function fs(e, n) {
978
981
  return i ? (i.focus(), !0) : !1;
979
982
  }
980
983
  const vs = 4;
981
- function vt() {
984
+ function ft() {
982
985
  const e = we(null), [n, a] = z(null);
983
986
  on(() => {
984
987
  if (n == null) return;
@@ -999,7 +1002,7 @@ function vt() {
999
1002
  const i = tn((s) => a(s), []);
1000
1003
  return { containerRef: e, requestJump: i };
1001
1004
  }
1002
- function yt({
1005
+ function vt({
1003
1006
  missing: e,
1004
1007
  t: n,
1005
1008
  onJump: a,
@@ -1019,7 +1022,7 @@ function yt({
1019
1022
  /* @__PURE__ */ t(He.Title, { as: "p", children: n("anamnesis.digest.missing.title", { count: e.length }) }),
1020
1023
  /* @__PURE__ */ t(He.Description, { children: n("anamnesis.digest.missing.list", { list: l }) }),
1021
1024
  /* @__PURE__ */ t(He.Action, { children: /* @__PURE__ */ t(
1022
- ae,
1025
+ ne,
1023
1026
  {
1024
1027
  intent: "tonal",
1025
1028
  size: "sm",
@@ -1075,7 +1078,7 @@ function bs({ digest: e, t: n }) {
1075
1078
  }
1076
1079
  );
1077
1080
  }
1078
- const xs = nt(
1081
+ const xs = et(
1079
1082
  "type-meta ds:inline-flex ds:items-center ds:gap-[var(--spacing-2xs)] ds:tabular-nums",
1080
1083
  {
1081
1084
  variants: {
@@ -1092,7 +1095,7 @@ const xs = nt(
1092
1095
  );
1093
1096
  function Un({ delta: e, def: n, t: a }) {
1094
1097
  if (!e) return null;
1095
- const i = e.direction === "up" ? at : e.direction === "down" ? tt : ci, s = `${ss(e.abs, n.precision ?? 1, Ie(a))}${n.unit ? ` ${n.unit}` : ""}`, o = e.valence === "good" ? a("anamnesis.delta.improved") : e.valence === "bad" ? a("anamnesis.delta.worsened") : a("anamnesis.delta.unchanged");
1098
+ const i = e.direction === "up" ? nt : e.direction === "down" ? at : ci, s = `${ss(e.abs, n.precision ?? 1, Ie(a))}${n.unit ? ` ${n.unit}` : ""}`, o = e.valence === "good" ? a("anamnesis.delta.improved") : e.valence === "bad" ? a("anamnesis.delta.worsened") : a("anamnesis.delta.unchanged");
1096
1099
  return /* @__PURE__ */ d(
1097
1100
  "span",
1098
1101
  {
@@ -1109,10 +1112,10 @@ function Un({ delta: e, def: n, t: a }) {
1109
1112
  }
1110
1113
  );
1111
1114
  }
1112
- function bt({ t: e }) {
1113
- return /* @__PURE__ */ t(J, { variant: "info", size: "sm", leading: /* @__PURE__ */ t(li, { "aria-hidden": "true" }), children: e("anamnesis.origin.fromPatient") });
1115
+ function yt({ t: e }) {
1116
+ return /* @__PURE__ */ t(X, { variant: "info", size: "sm", leading: /* @__PURE__ */ t(li, { "aria-hidden": "true" }), children: e("anamnesis.origin.fromPatient") });
1114
1117
  }
1115
- function xa({
1118
+ function ba({
1116
1119
  flag: e,
1117
1120
  t: n,
1118
1121
  compact: a = !1
@@ -1120,12 +1123,12 @@ function xa({
1120
1123
  if (!e) return null;
1121
1124
  const i = n(e === "high" ? "anamnesis.range.aboveRange" : "anamnesis.range.belowRange");
1122
1125
  return /* @__PURE__ */ t(
1123
- J,
1126
+ X,
1124
1127
  {
1125
1128
  variant: "warning",
1126
1129
  size: "sm",
1127
1130
  withDot: !0,
1128
- leading: /* @__PURE__ */ t(e === "high" ? at : tt, { "aria-hidden": "true" }),
1131
+ leading: /* @__PURE__ */ t(e === "high" ? nt : at, { "aria-hidden": "true" }),
1129
1132
  "aria-label": i,
1130
1133
  children: a ? null : i
1131
1134
  }
@@ -1136,7 +1139,7 @@ const ks = {
1136
1139
  bad: "var(--error)",
1137
1140
  neutral: "var(--muted-foreground)"
1138
1141
  };
1139
- function xt({
1142
+ function bt({
1140
1143
  series: e,
1141
1144
  def: n,
1142
1145
  t: a,
@@ -1161,8 +1164,8 @@ function xt({
1161
1164
  }
1162
1165
  );
1163
1166
  }
1164
- const kt = " ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]";
1165
- function wt({
1167
+ const xt = " ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]";
1168
+ function kt({
1166
1169
  intake: e,
1167
1170
  sections: n,
1168
1171
  sex: a,
@@ -1184,7 +1187,7 @@ function wt({
1184
1187
  /* @__PURE__ */ t(_.Term, { children: ge(l, i) }),
1185
1188
  /* @__PURE__ */ t(_.Detail, { children: /* @__PURE__ */ d("span", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
1186
1189
  /* @__PURE__ */ t("span", { children: Bn(c.value, l, i) }),
1187
- c.origin === "patient" ? /* @__PURE__ */ t(bt, { t: i }) : null
1190
+ c.origin === "patient" ? /* @__PURE__ */ t(yt, { t: i }) : null
1188
1191
  ] }) })
1189
1192
  ] }, l.key) : null;
1190
1193
  }) })
@@ -1211,7 +1214,7 @@ function ws({
1211
1214
  /* @__PURE__ */ t("h2", { className: "type-title-section ds:m-0 ds:text-[color:var(--foreground)]", children: r("anamnesis.section.patientIntake") }),
1212
1215
  e ? /* @__PURE__ */ d(Ae, { children: [
1213
1216
  s.length > 0 ? /* @__PURE__ */ t(
1214
- yt,
1217
+ vt,
1215
1218
  {
1216
1219
  missing: s,
1217
1220
  t: r,
@@ -1220,22 +1223,22 @@ function ws({
1220
1223
  }
1221
1224
  ) : null,
1222
1225
  /* @__PURE__ */ t(bs, { digest: i, t: r }),
1223
- /* @__PURE__ */ d(da, { variant: "default", children: [
1226
+ /* @__PURE__ */ d(ca, { variant: "default", children: [
1224
1227
  /* @__PURE__ */ t("h2", { className: "type-title-section ds:m-0 ds:text-[color:var(--foreground)]", children: /* @__PURE__ */ d(
1225
- et,
1228
+ Za,
1226
1229
  {
1227
1230
  "data-testid": "anamnesis-summary-full",
1228
- className: "type-label ds:flex ds:w-full ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)] ds:text-start" + kt,
1231
+ className: "type-label ds:flex ds:w-full ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)] ds:text-start" + xt,
1229
1232
  children: [
1230
1233
  /* @__PURE__ */ d("span", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
1231
1234
  r("anamnesis.summary.fullQuestionnaire"),
1232
- /* @__PURE__ */ t(J, { variant: "neutral", size: "sm", children: r("anamnesis.intake.sectionProgress", {
1235
+ /* @__PURE__ */ t(X, { variant: "neutral", size: "sm", children: r("anamnesis.intake.sectionProgress", {
1233
1236
  answered: i.answered,
1234
1237
  total: i.total
1235
1238
  }) })
1236
1239
  ] }),
1237
1240
  /* @__PURE__ */ t(
1238
- pa,
1241
+ ma,
1239
1242
  {
1240
1243
  "aria-hidden": "true",
1241
1244
  className: "ds:size-5 ds:shrink-0 ds:text-[color:var(--muted-foreground)] ds:transition-transform ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none ds:[[data-state=open]_&]:rotate-180"
@@ -1245,11 +1248,11 @@ function ws({
1245
1248
  }
1246
1249
  ) }),
1247
1250
  /* @__PURE__ */ t(
1248
- ua,
1251
+ da,
1249
1252
  {
1250
1253
  "aria-label": r("anamnesis.summary.fullQuestionnaire"),
1251
1254
  children: /* @__PURE__ */ t("div", { className: "ds:pt-[var(--spacing-md)]", children: /* @__PURE__ */ t(
1252
- wt,
1255
+ kt,
1253
1256
  {
1254
1257
  intake: e,
1255
1258
  sections: n,
@@ -1272,7 +1275,7 @@ const Ns = [
1272
1275
  "pathologies",
1273
1276
  "therapy",
1274
1277
  "proposal"
1275
- ], Nt = [
1278
+ ], wt = [
1276
1279
  "oncological",
1277
1280
  "labs",
1278
1281
  "fmd",
@@ -1299,7 +1302,7 @@ function Ss(e) {
1299
1302
  const n = e.annualProgramme;
1300
1303
  return n && (n.proposed || n.accepted) ? 1 : 0;
1301
1304
  }
1302
- function Va(e, n = []) {
1305
+ function Oa(e, n = []) {
1303
1306
  const a = e ? Ts(e, n) : [], i = (e == null ? void 0 : e.visitType) === "first", s = {
1304
1307
  oncological: e ? Cs(e) : 0,
1305
1308
  labs: a.length,
@@ -1313,7 +1316,7 @@ function Va(e, n = []) {
1313
1316
  }, r = {};
1314
1317
  for (const l of Ns)
1315
1318
  r[l] = { open: !0, fill: null, flagged: 0 };
1316
- for (const l of Nt)
1319
+ for (const l of wt)
1317
1320
  r[l] = { open: i, fill: s[l], flagged: o[l] };
1318
1321
  return r;
1319
1322
  }
@@ -1328,7 +1331,7 @@ function Kn(e) {
1328
1331
  return a ? [{ field: n, text: a }] : [];
1329
1332
  });
1330
1333
  }
1331
- function Ct(e) {
1334
+ function Nt(e) {
1332
1335
  return Kn(e).length > 0;
1333
1336
  }
1334
1337
  function Es({
@@ -1348,14 +1351,14 @@ function Is({
1348
1351
  onOpenNote: i
1349
1352
  }) {
1350
1353
  if (Kn(e).length === 0) return null;
1351
- const o = n(`anamnesis.visitType.${e.visitType}`), r = le(e.dateIso, n), l = n(
1354
+ const o = n(`anamnesis.visitType.${e.visitType}`), r = re(e.dateIso, n), l = n(
1352
1355
  i ? "anamnesis.visitNote.openInPanel" : "anamnesis.visitNote.trigger",
1353
1356
  { visitType: o, date: r }
1354
1357
  );
1355
1358
  return i ? /* @__PURE__ */ t(
1356
- de,
1359
+ ce,
1357
1360
  {
1358
- icon: /* @__PURE__ */ t(Pa, { "aria-hidden": "true" }),
1361
+ icon: /* @__PURE__ */ t(Ra, { "aria-hidden": "true" }),
1359
1362
  intent: "ghost",
1360
1363
  size: "sm",
1361
1364
  "aria-label": l,
@@ -1364,9 +1367,9 @@ function Is({
1364
1367
  }
1365
1368
  ) : /* @__PURE__ */ d(ye, { defaultOpen: a, children: [
1366
1369
  /* @__PURE__ */ t(ye.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1367
- de,
1370
+ ce,
1368
1371
  {
1369
- icon: /* @__PURE__ */ t(Pa, { "aria-hidden": "true" }),
1372
+ icon: /* @__PURE__ */ t(Ra, { "aria-hidden": "true" }),
1370
1373
  intent: "ghost",
1371
1374
  size: "sm",
1372
1375
  "aria-label": l,
@@ -1415,8 +1418,8 @@ function Is({
1415
1418
  )
1416
1419
  ] });
1417
1420
  }
1418
- const ka = "ds:min-w-[11rem]", bn = "ds:min-w-[8rem]", wa = "ds:w-[40%] ds:min-w-[14rem]", Rs = "type-label ds:sticky ds:start-0 ds:top-0 ds:z-[3] ds:bg-[color:var(--card)] ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-sm)] ds:text-start ds:shadow-[var(--shadow-chrome-end)]", Tt = "ds:sticky ds:top-0 ds:z-[2] ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-sm)] ds:text-start ds:shadow-[var(--shadow-chrome-down)]", Ls = "type-label ds:sticky ds:end-0 ds:top-0 ds:z-[3] ds:bg-[color:var(--card)] ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-sm)] ds:text-start ds:shadow-[var(--shadow-chrome-start)]", Fs = "ds:sticky ds:end-0 ds:z-[1] ds:bg-[color:var(--card)] ds:shadow-[var(--shadow-chrome-start)]", je = "ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-xs)] ds:align-top";
1419
- function St({
1421
+ const xa = "ds:min-w-[11rem]", bn = "ds:min-w-[8rem]", ka = "ds:w-[40%] ds:min-w-[14rem]", Ls = "type-label ds:sticky ds:start-0 ds:top-0 ds:z-[3] ds:bg-[color:var(--card)] ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-sm)] ds:text-start ds:shadow-[var(--shadow-chrome-end)]", Ct = "ds:sticky ds:top-0 ds:z-[2] ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-sm)] ds:text-start ds:shadow-[var(--shadow-chrome-down)]", Rs = "type-label ds:sticky ds:end-0 ds:top-0 ds:z-[3] ds:bg-[color:var(--card)] ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-sm)] ds:text-start ds:shadow-[var(--shadow-chrome-start)]", Fs = "ds:sticky ds:end-0 ds:z-[1] ds:bg-[color:var(--card)] ds:shadow-[var(--shadow-chrome-start)]", je = "ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-xs)] ds:align-top";
1422
+ function Tt({
1420
1423
  column: e,
1421
1424
  t: n,
1422
1425
  emphasised: a = !1,
@@ -1432,7 +1435,7 @@ function St({
1432
1435
  scope: "col",
1433
1436
  className: [
1434
1437
  bn,
1435
- Tt,
1438
+ Ct,
1436
1439
  a ? "ds:bg-[color:var(--muted)]" : "ds:bg-[color:var(--card)]"
1437
1440
  ].join(" "),
1438
1441
  children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
@@ -1466,20 +1469,20 @@ function St({
1466
1469
  ) : null,
1467
1470
  /* @__PURE__ */ d("span", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-2xs)]", children: [
1468
1471
  /* @__PURE__ */ t(
1469
- J,
1472
+ X,
1470
1473
  {
1471
1474
  variant: l.visitType === "first" ? "brand" : "neutral",
1472
1475
  size: "sm",
1473
1476
  children: n(`anamnesis.visitType.${l.visitType}`)
1474
1477
  }
1475
1478
  ),
1476
- i ? /* @__PURE__ */ t(J, { variant: "accentSoft", size: "sm", children: n("anamnesis.grid.editable") }) : null
1479
+ i ? /* @__PURE__ */ t(X, { variant: "accentSoft", size: "sm", children: n("anamnesis.grid.editable") }) : null
1477
1480
  ] })
1478
1481
  ] })
1479
1482
  }
1480
1483
  );
1481
1484
  }
1482
- function At({
1485
+ function St({
1483
1486
  captionId: e,
1484
1487
  caption: n,
1485
1488
  identityLabel: a,
@@ -1511,7 +1514,7 @@ function At({
1511
1514
  "th",
1512
1515
  {
1513
1516
  scope: "col",
1514
- className: `${ka} ${Rs}`,
1517
+ className: `${xa} ${Ls}`,
1515
1518
  children: a
1516
1519
  }
1517
1520
  ),
@@ -1522,9 +1525,9 @@ function At({
1522
1525
  scope: "col",
1523
1526
  "data-testid": s,
1524
1527
  className: [
1525
- wa,
1528
+ ka,
1526
1529
  "type-label ds:bg-[color:var(--card)]",
1527
- Tt
1530
+ Ct
1528
1531
  ].join(" "),
1529
1532
  children: i
1530
1533
  }
@@ -1535,7 +1538,7 @@ function At({
1535
1538
  {
1536
1539
  scope: "col",
1537
1540
  "data-testid": l,
1538
- className: `${bn} ${Ls}`,
1541
+ className: `${bn} ${Rs}`,
1539
1542
  children: r
1540
1543
  }
1541
1544
  ) : null
@@ -1563,19 +1566,19 @@ function At({
1563
1566
  }
1564
1567
  );
1565
1568
  }
1566
- const Ba = 160, Ps = {
1569
+ const qa = 160, Ps = {
1567
1570
  added: "success",
1568
1571
  removed: "error",
1569
1572
  changed: "info",
1570
1573
  notMeasured: "neutral"
1571
1574
  };
1572
- function Na(e) {
1575
+ function wa(e) {
1573
1576
  const n = e[0], a = e[e.length - 1];
1574
1577
  return !n && a ? "added" : n && !a ? "removed" : "changed";
1575
1578
  }
1576
1579
  function _s(e) {
1577
1580
  const n = e.trim();
1578
- return n ? n.length > Ba ? `${n.slice(0, Ba).trimEnd()}…` : n : De;
1581
+ return n ? n.length > qa ? `${n.slice(0, qa).trimEnd()}…` : n : De;
1579
1582
  }
1580
1583
  function $s(e, n, a) {
1581
1584
  var s;
@@ -1607,7 +1610,7 @@ function zs(e, { t: n, seriesByKey: a }) {
1607
1610
  function Ms(e, { t: n, pathologies: a }) {
1608
1611
  const i = n("anamnesis.compare.present");
1609
1612
  return e.pathologies.map((s) => {
1610
- const o = Na(s.present);
1613
+ const o = wa(s.present);
1611
1614
  return {
1612
1615
  id: `pathology:${s.code}`,
1613
1616
  categoryId: "pathology",
@@ -1624,7 +1627,7 @@ function Os(e, { t: n }) {
1624
1627
  var l;
1625
1628
  const s = i.entries.filter(
1626
1629
  (c) => c != null
1627
- ), o = new Set(s.map((c) => c.name)).size > 1, r = Na(i.entries.map((c) => c != null));
1630
+ ), o = new Set(s.map((c) => c.name)).size > 1, r = wa(i.entries.map((c) => c != null));
1628
1631
  return {
1629
1632
  id: `therapy:${i.id}`,
1630
1633
  categoryId: "therapy",
@@ -1643,7 +1646,7 @@ function qs(e, { t: n }) {
1643
1646
  return e.texts.flatMap((a) => {
1644
1647
  const i = a.values.map(_s);
1645
1648
  if (i.every((o) => o === i[0])) return [];
1646
- const s = Na(i.map((o) => o !== De));
1649
+ const s = wa(i.map((o) => o !== De));
1647
1650
  return [
1648
1651
  {
1649
1652
  id: `note:${a.field}`,
@@ -1668,7 +1671,7 @@ function Bs(e, n) {
1668
1671
  return Vs.flatMap((a) => a.rows(e, n));
1669
1672
  }
1670
1673
  function Us({ row: e, t: n }) {
1671
- return e.def && e.delta ? /* @__PURE__ */ t(Un, { delta: e.delta, def: e.def, t: n }) : /* @__PURE__ */ t(J, { variant: Ps[e.change], size: "sm", children: e.changeLabel });
1674
+ return e.def && e.delta ? /* @__PURE__ */ t(Un, { delta: e.delta, def: e.def, t: n }) : /* @__PURE__ */ t(X, { variant: Ps[e.change], size: "sm", children: e.changeLabel });
1672
1675
  }
1673
1676
  function Ks({
1674
1677
  visits: e,
@@ -1685,9 +1688,9 @@ function Ks({
1685
1688
  framed: g = !0
1686
1689
  }) {
1687
1690
  const p = Qe(), [k, v] = z(""), f = q(
1688
- () => e.map((T, L) => ({
1691
+ () => e.map((T, R) => ({
1689
1692
  value: T.id,
1690
- label: ht(T, L, u)
1693
+ label: pt(T, R, u)
1691
1694
  })),
1692
1695
  [e, u]
1693
1696
  ), C = q(
@@ -1695,15 +1698,15 @@ function Ks({
1695
1698
  [s, u, r, o]
1696
1699
  ), w = q(() => {
1697
1700
  var m, N;
1698
- const T = (m = n[0]) == null ? void 0 : m.visit.dateIso, L = (N = n[n.length - 1]) == null ? void 0 : N.visit.dateIso, S = u("anamnesis.compare.selected", {
1701
+ const T = (m = n[0]) == null ? void 0 : m.visit.dateIso, R = (N = n[n.length - 1]) == null ? void 0 : N.visit.dateIso, S = u("anamnesis.compare.selected", {
1699
1702
  total: n.length,
1700
- from: T ? le(T, u) : "",
1701
- to: L ? le(L, u) : ""
1703
+ from: T ? re(T, u) : "",
1704
+ to: R ? re(R, u) : ""
1702
1705
  });
1703
1706
  return n.length === 2 ? `${S} · ${u("anamnesis.compare.minimum")}` : S;
1704
1707
  }, [n, u]), A = q(
1705
1708
  () => n.map((T) => /* @__PURE__ */ t(
1706
- St,
1709
+ Tt,
1707
1710
  {
1708
1711
  column: T,
1709
1712
  t: u,
@@ -1713,11 +1716,11 @@ function Ks({
1713
1716
  T.key
1714
1717
  )),
1715
1718
  [n, u]
1716
- ), R = q(() => {
1719
+ ), L = q(() => {
1717
1720
  const T = [];
1718
- let L = null;
1721
+ let R = null;
1719
1722
  for (const S of C)
1720
- S.categoryId !== L && (L = S.categoryId, T.push({
1723
+ S.categoryId !== R && (R = S.categoryId, T.push({
1721
1724
  key: `group-${S.categoryId}`,
1722
1725
  banner: u(`anamnesis.compare.category.${S.categoryId}`)
1723
1726
  })), T.push({
@@ -1726,7 +1729,7 @@ function Ks({
1726
1729
  "th",
1727
1730
  {
1728
1731
  scope: "row",
1729
- className: `${ka} ds:sticky ds:start-0 ds:z-[1] ds:bg-[color:var(--card)] ds:text-start ds:shadow-[var(--shadow-chrome-end)] ${je}`,
1732
+ className: `${xa} ds:sticky ds:start-0 ds:z-[1] ds:bg-[color:var(--card)] ds:text-start ds:shadow-[var(--shadow-chrome-end)] ${je}`,
1730
1733
  children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
1731
1734
  /* @__PURE__ */ t("span", { className: "type-label ds:break-words ds:text-[color:var(--foreground)]", children: S.item }),
1732
1735
  S.meta ? /* @__PURE__ */ t("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: S.meta }) : null
@@ -1744,8 +1747,8 @@ function Ks({
1744
1747
  ((x = n[N]) == null ? void 0 : x.key) ?? N
1745
1748
  );
1746
1749
  }),
1747
- trend: /* @__PURE__ */ t("td", { className: `${wa} ${je}`, children: S.series && S.def ? /* @__PURE__ */ t(
1748
- xt,
1750
+ trend: /* @__PURE__ */ t("td", { className: `${ka} ${je}`, children: S.series && S.def ? /* @__PURE__ */ t(
1751
+ bt,
1749
1752
  {
1750
1753
  series: S.series,
1751
1754
  def: S.def,
@@ -1769,7 +1772,7 @@ function Ks({
1769
1772
  /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-md)]", children: [
1770
1773
  /* @__PURE__ */ t("h3", { className: "type-title-section ds:m-0 ds:text-[color:var(--foreground)]", children: u("anamnesis.compare.panelTitle") }),
1771
1774
  h ? /* @__PURE__ */ t(
1772
- ae,
1775
+ ne,
1773
1776
  {
1774
1777
  intent: "outline",
1775
1778
  "data-testid": "anamnesis-compare-close",
@@ -1791,7 +1794,7 @@ function Ks({
1791
1794
  label: u("anamnesis.compare.visitsLabel"),
1792
1795
  description: w,
1793
1796
  children: /* @__PURE__ */ t(
1794
- ma,
1797
+ ua,
1795
1798
  {
1796
1799
  options: f,
1797
1800
  value: [...a],
@@ -1827,8 +1830,8 @@ function Ks({
1827
1830
  "data-testid": "anamnesis-compare-summary",
1828
1831
  children: s ? /* @__PURE__ */ d(Ae, { children: [
1829
1832
  /* @__PURE__ */ t("h4", { className: "type-title-item ds:m-0 ds:text-[color:var(--foreground)]", children: u("anamnesis.compare.summaryTitle", {
1830
- from: le(s.visits[0].dateIso, u),
1831
- to: le(
1833
+ from: re(s.visits[0].dateIso, u),
1834
+ to: re(
1832
1835
  s.visits[s.visits.length - 1].dateIso,
1833
1836
  u
1834
1837
  )
@@ -1842,7 +1845,7 @@ function Ks({
1842
1845
  description: u("anamnesis.compare.noChangesDescription")
1843
1846
  }
1844
1847
  ) : /* @__PURE__ */ t(
1845
- At,
1848
+ St,
1846
1849
  {
1847
1850
  captionId: p,
1848
1851
  caption: u("anamnesis.compare.tableLabel"),
@@ -1851,7 +1854,7 @@ function Ks({
1851
1854
  trailingLabel: u("anamnesis.compare.column.change"),
1852
1855
  trailingTestId: "anamnesis-compare-change-column",
1853
1856
  visitHeaders: A,
1854
- rows: R,
1857
+ rows: L,
1855
1858
  testId: "anamnesis-compare-table",
1856
1859
  framed: g
1857
1860
  }
@@ -1861,13 +1864,13 @@ function Ks({
1861
1864
  )
1862
1865
  ] });
1863
1866
  }
1864
- const Et = {
1867
+ const At = {
1865
1868
  therapy: "cross",
1866
1869
  diet: "circle",
1867
1870
  fmd: "diamond",
1868
1871
  surgery: "triangle",
1869
1872
  lifestyle: "square"
1870
- }, Dt = "neutral";
1873
+ }, Et = "neutral";
1871
1874
  function Hs(e, n) {
1872
1875
  const a = n.length - 1;
1873
1876
  if (a < 1 || !cn(e.dateIso)) return null;
@@ -1890,13 +1893,13 @@ function Gs(e, n) {
1890
1893
  return i == null ? [] : [{ event: a, position: i }];
1891
1894
  }).sort((a, i) => a.position - i.position);
1892
1895
  }
1893
- function ra(e, n) {
1896
+ function oa(e, n) {
1894
1897
  return n("anamnesis.event.chip", {
1895
1898
  label: n(`anamnesis.event.label.${e.labelKey}`),
1896
- date: le(e.dateIso, n)
1899
+ date: re(e.dateIso, n)
1897
1900
  });
1898
1901
  }
1899
- function It(e, n) {
1902
+ function Dt(e, n) {
1900
1903
  const a = n(`anamnesis.event.category.${e.category}`);
1901
1904
  return e.sourceKey ? n("anamnesis.event.external", {
1902
1905
  category: a,
@@ -1907,9 +1910,9 @@ function js(e, n, a) {
1907
1910
  return e.filter((i) => n.has(i.event.id)).map(({ event: i, position: s }) => ({
1908
1911
  id: i.id,
1909
1912
  position: s,
1910
- label: ra(i, a),
1911
- shape: Et[i.category],
1912
- tone: Dt
1913
+ label: oa(i, a),
1914
+ shape: At[i.category],
1915
+ tone: Et
1913
1916
  }));
1914
1917
  }
1915
1918
  function Ws({
@@ -1941,7 +1944,7 @@ function Ws({
1941
1944
  const c = n.has(l.id);
1942
1945
  return /* @__PURE__ */ d(ti, { children: [
1943
1946
  /* @__PURE__ */ t(
1944
- ae,
1947
+ ne,
1945
1948
  {
1946
1949
  size: "sm",
1947
1950
  intent: c ? "primary" : "outline",
@@ -1951,20 +1954,20 @@ function Ws({
1951
1954
  startIcon: /* @__PURE__ */ t(
1952
1955
  mi,
1953
1956
  {
1954
- shape: Et[l.category],
1955
- tone: Dt,
1957
+ shape: At[l.category],
1958
+ tone: Et,
1956
1959
  size: "sm"
1957
1960
  }
1958
1961
  ),
1959
1962
  onClick: () => a(l.id),
1960
- children: ra(l, i)
1963
+ children: oa(l, i)
1961
1964
  }
1962
1965
  ),
1963
- /* @__PURE__ */ t("span", { id: `${o}-${l.id}`, className: "ds:sr-only", children: It(l, i) })
1966
+ /* @__PURE__ */ t("span", { id: `${o}-${l.id}`, className: "ds:sr-only", children: Dt(l, i) })
1964
1967
  ] }, l.id);
1965
1968
  }),
1966
1969
  /* @__PURE__ */ t("p", { className: "ds:sr-only", "aria-live": "polite", children: r.length === 0 ? i("anamnesis.event.noneShown") : i("anamnesis.event.shown", {
1967
- list: r.map(({ event: l }) => ra(l, i)).join(i("anamnesis.event.separator"))
1970
+ list: r.map(({ event: l }) => oa(l, i)).join(i("anamnesis.event.separator"))
1968
1971
  }) })
1969
1972
  ]
1970
1973
  }
@@ -1991,7 +1994,7 @@ function Fn(e, n, a = {}) {
1991
1994
  lastIso: ((r = s[s.length - 1]) == null ? void 0 : r.visit.dateIso) ?? null
1992
1995
  };
1993
1996
  }
1994
- function Rt(e) {
1997
+ function It(e) {
1995
1998
  return Fn(
1996
1999
  e,
1997
2000
  e.map((n) => n.id)
@@ -2035,28 +2038,28 @@ function Zs({
2035
2038
  annotations: g,
2036
2039
  onSelectAnnotation: p
2037
2040
  }) {
2038
- const k = Qe(), v = Ie(a), f = ya(e, n), C = e.visits, w = C.length - 1, A = u ?? Rt(C), R = [];
2041
+ const k = Qe(), v = Ie(a), f = va(e, n), C = e.visits, w = C.length - 1, A = u ?? It(C), L = [];
2039
2042
  let T = null;
2040
- const L = (m) => (o == null ? void 0 : o.visitIds.has(m)) ?? !1;
2043
+ const R = (m) => (o == null ? void 0 : o.visitIds.has(m)) ?? !1;
2041
2044
  if (f.forEach((m) => {
2042
- m.def.group !== T && (T = m.def.group, R.push({
2045
+ m.def.group !== T && (T = m.def.group, L.push({
2043
2046
  key: `group-${m.def.group}`,
2044
2047
  banner: a(`anamnesis.group.${m.def.group}`)
2045
2048
  }));
2046
2049
  const N = Js(m.def.referenceRange, a, v), x = A.map((P, $) => {
2047
- const { visit: F, index: E } = P, H = m.cells[E] ?? Ys, j = E === w, M = h == null || h.has(m.def.key), U = i && j && M && !m.def.computed, W = !Xs(A, $), Z = o != null && o.changedCells.has(`${F.id}:${m.def.key}`), se = L(F.id);
2050
+ const { visit: F, index: E } = P, H = m.cells[E] ?? Ys, j = E === w, M = h == null || h.has(m.def.key), U = i && j && M && !m.def.computed, Y = !Xs(A, $), ae = o != null && o.changedCells.has(`${F.id}:${m.def.key}`), me = R(F.id);
2048
2051
  return /* @__PURE__ */ t(
2049
2052
  "td",
2050
2053
  {
2051
- "data-changed": Z || void 0,
2054
+ "data-changed": ae || void 0,
2052
2055
  className: [
2053
2056
  bn,
2054
2057
  je,
2055
2058
  "ds:tabular-nums",
2056
- se ? "ds:bg-[color:var(--muted)]/40" : "",
2059
+ me ? "ds:bg-[color:var(--muted)]/40" : "",
2057
2060
  // Changed cells carry a fill tint AND a non-colour inline-start
2058
2061
  // border bar so the change reads without relying on hue.
2059
- Z ? "ds:bg-[color:var(--info)]/10 ds:border-s-2 ds:border-[color:var(--info)]" : ""
2062
+ ae ? "ds:bg-[color:var(--info)]/10 ds:border-s-2 ds:border-[color:var(--info)]" : ""
2060
2063
  ].filter(Boolean).join(" "),
2061
2064
  children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
2062
2065
  U ? /* @__PURE__ */ t(
@@ -2068,20 +2071,20 @@ function Zs({
2068
2071
  "aria-label": a("anamnesis.grid.editCell", {
2069
2072
  parameter: ze(m.def, a)
2070
2073
  }),
2071
- onChange: (X) => s == null ? void 0 : s(F, m.def, X)
2074
+ onChange: (J) => s == null ? void 0 : s(F, m.def, J)
2072
2075
  }
2073
2076
  ) : /* @__PURE__ */ t("span", { className: "type-body-sm ds:font-[var(--font-weight-medium)] ds:text-[color:var(--foreground)]", children: Ee(H.value, m.def.precision, v) }),
2074
2077
  /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-2xs)]", children: [
2075
- H.outOfRange ? /* @__PURE__ */ t(xa, { flag: H.outOfRange, t: a, compact: !0 }) : null,
2076
- W ? null : /* @__PURE__ */ t(Un, { delta: H.delta, def: m.def, t: a }),
2077
- Z ? /* @__PURE__ */ t("span", { className: "ds:sr-only", children: a("anamnesis.compare.changedCell") }) : null
2078
+ H.outOfRange ? /* @__PURE__ */ t(ba, { flag: H.outOfRange, t: a, compact: !0 }) : null,
2079
+ Y ? null : /* @__PURE__ */ t(Un, { delta: H.delta, def: m.def, t: a }),
2080
+ ae ? /* @__PURE__ */ t("span", { className: "ds:sr-only", children: a("anamnesis.compare.changedCell") }) : null
2078
2081
  ] })
2079
2082
  ] })
2080
2083
  },
2081
2084
  P.key
2082
2085
  );
2083
2086
  });
2084
- R.push({
2087
+ L.push({
2085
2088
  key: m.def.key,
2086
2089
  // Sticky parameter column (inline-start). The shell splices the trend
2087
2090
  // in after the first value cell — the order is not decided here.
@@ -2089,7 +2092,7 @@ function Zs({
2089
2092
  "th",
2090
2093
  {
2091
2094
  scope: "row",
2092
- className: `${ka} ds:sticky ds:start-0 ds:z-[1] ds:bg-[color:var(--card)] ds:text-start ds:shadow-[var(--shadow-chrome-end)] ${je}`,
2095
+ className: `${xa} ds:sticky ds:start-0 ds:z-[1] ds:bg-[color:var(--card)] ds:text-start ds:shadow-[var(--shadow-chrome-end)] ${je}`,
2093
2096
  children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
2094
2097
  /* @__PURE__ */ t("span", { className: "type-label ds:text-[color:var(--foreground)]", children: ze(m.def, a) }),
2095
2098
  /* @__PURE__ */ d("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: [
@@ -2107,8 +2110,8 @@ function Zs({
2107
2110
  }
2108
2111
  ),
2109
2112
  cells: x,
2110
- trend: /* @__PURE__ */ t("td", { className: `${wa} ${je}`, children: /* @__PURE__ */ t(
2111
- xt,
2113
+ trend: /* @__PURE__ */ t("td", { className: `${ka} ${je}`, children: /* @__PURE__ */ t(
2114
+ bt,
2112
2115
  {
2113
2116
  series: m.series,
2114
2117
  def: m.def,
@@ -2136,11 +2139,11 @@ function Zs({
2136
2139
  }
2137
2140
  );
2138
2141
  const S = A.map((m) => /* @__PURE__ */ t(
2139
- St,
2142
+ Tt,
2140
2143
  {
2141
2144
  column: m,
2142
2145
  t: a,
2143
- emphasised: L(m.visit.id),
2146
+ emphasised: R(m.visit.id),
2144
2147
  editable: i && m.index === w,
2145
2148
  defaultOpenNoteVisitId: l,
2146
2149
  onOpenNote: c
@@ -2148,7 +2151,7 @@ function Zs({
2148
2151
  m.key
2149
2152
  ));
2150
2153
  return /* @__PURE__ */ t(
2151
- At,
2154
+ St,
2152
2155
  {
2153
2156
  captionId: k,
2154
2157
  caption: a("anamnesis.grid.caption"),
@@ -2156,12 +2159,12 @@ function Zs({
2156
2159
  trendLabel: a("anamnesis.grid.trend"),
2157
2160
  trendTestId: "anamnesis-grid-trend",
2158
2161
  visitHeaders: S,
2159
- rows: R,
2162
+ rows: L,
2160
2163
  framed: r
2161
2164
  }
2162
2165
  );
2163
2166
  }
2164
- function Ca({
2167
+ function Na({
2165
2168
  record: e,
2166
2169
  t: n,
2167
2170
  editable: a = !1,
@@ -2178,11 +2181,11 @@ function Ca({
2178
2181
  const { visits: p } = e, k = p.length >= 2, v = Qe(), f = Qe(), C = q(() => _e(o), [o]), w = q(
2179
2182
  () => new Set(Ne(o).map((O) => O.key)),
2180
2183
  [o]
2181
- ), A = q(() => zn(o), [o]), [R, T] = z(r), [L, S] = z(""), m = we(null), N = we(null), x = we(!1);
2184
+ ), A = q(() => zn(o), [o]), [L, T] = z(r), [R, S] = z(""), m = we(null), N = we(null), x = we(!1);
2182
2185
  on(() => {
2183
2186
  var O;
2184
- x.current && R && ((O = m.current) == null || O.scrollIntoView({ block: "start" })), x.current = !0;
2185
- }, [R]);
2187
+ x.current && L && ((O = m.current) == null || O.scrollIntoView({ block: "start" })), x.current = !0;
2188
+ }, [L]);
2186
2189
  const P = () => {
2187
2190
  var O;
2188
2191
  T(!1), (O = N.current) == null || O.focus();
@@ -2190,71 +2193,71 @@ function Ca({
2190
2193
  () => c ? [...c] : fn(p)
2191
2194
  ), E = q(() => {
2192
2195
  const O = $.filter(
2193
- (G) => p.some((Q) => Q.id === G)
2196
+ (G) => p.some((W) => W.id === G)
2194
2197
  );
2195
2198
  return O.length >= 2 ? O : fn(p);
2196
2199
  }, [$, p]), H = q(
2197
2200
  () => Fn(p, E).columns,
2198
2201
  [p, E]
2199
- ), j = q(() => R ? ns(
2202
+ ), j = q(() => L ? ns(
2200
2203
  H.map((O) => O.visit),
2201
2204
  C
2202
- ) : null, [R, H, C]), M = q(() => {
2205
+ ) : null, [L, H, C]), M = q(() => {
2203
2206
  const O = /* @__PURE__ */ new Map();
2204
- for (const G of ya(e, C))
2207
+ for (const G of va(e, C))
2205
2208
  O.set(G.def.key, G.series);
2206
2209
  return O;
2207
- }, [e, C]), [U, W] = z(
2210
+ }, [e, C]), [U, Y] = z(
2208
2211
  () => l ? [...l] : fn(p)
2209
- ), Z = Qs(p), se = q(() => {
2210
- const O = U.filter((G) => p.some((Q) => Q.id === G));
2212
+ ), ae = Qs(p), me = q(() => {
2213
+ const O = U.filter((G) => p.some((W) => W.id === G));
2211
2214
  return O.length > 0 ? O : fn(p);
2212
- }, [U, p]), X = q(
2213
- () => Fn(p, se, {
2215
+ }, [U, p]), J = q(
2216
+ () => Fn(p, me, {
2214
2217
  // A compared visit is always a column, so compare always marks its
2215
2218
  // columns in the grid — comparing a visit the picker left out brings
2216
2219
  // it back on screen rather than marking nothing.
2217
- alsoShowIds: R ? E : []
2220
+ alsoShowIds: L ? E : []
2218
2221
  }),
2219
- [p, se, R, E]
2220
- ), Re = q(
2221
- () => X.columns.map((O) => O.visit.id),
2222
- [X]
2222
+ [p, me, L, E]
2223
+ ), Le = q(
2224
+ () => J.columns.map((O) => O.visit.id),
2225
+ [J]
2223
2226
  );
2224
2227
  on(() => {
2225
- h == null || h(Re);
2226
- }, [Re, h]);
2228
+ h == null || h(Le);
2229
+ }, [Le, h]);
2227
2230
  const D = q(
2228
2231
  () => p.map((O, G) => ({
2229
2232
  value: O.id,
2230
- label: ht(O, G, n, Ct(O))
2233
+ label: pt(O, G, n, Nt(O))
2231
2234
  })),
2232
2235
  [p, n]
2233
2236
  ), B = q(() => {
2234
- const O = X.firstIso ? le(X.firstIso, n) : "", G = X.lastIso ? le(X.lastIso, n) : "", be = [X.hiddenCount > 0 ? n("anamnesis.window.showing", {
2235
- shown: X.shownCount,
2236
- total: X.totalCount,
2237
+ const O = J.firstIso ? re(J.firstIso, n) : "", G = J.lastIso ? re(J.lastIso, n) : "", be = [J.hiddenCount > 0 ? n("anamnesis.window.showing", {
2238
+ shown: J.shownCount,
2239
+ total: J.totalCount,
2237
2240
  from: O,
2238
2241
  to: G
2239
2242
  }) : n("anamnesis.window.showingAll", {
2240
- total: X.totalCount,
2243
+ total: J.totalCount,
2241
2244
  from: O,
2242
2245
  to: G
2243
- })], Je = X.shownCount - se.length;
2244
- return Je > 0 && be.push(n("anamnesis.window.addedByCompare", { added: Je })), se.length === 1 && be.push(n("anamnesis.window.minimum")), be.join(" · ");
2245
- }, [X, se, n]), ne = q(
2246
+ })], Je = J.shownCount - me.length;
2247
+ return Je > 0 && be.push(n("anamnesis.window.addedByCompare", { added: Je })), me.length === 1 && be.push(n("anamnesis.window.minimum")), be.join(" · ");
2248
+ }, [J, me, n]), ee = q(
2246
2249
  () => Gs(e.events, p),
2247
2250
  [e.events, p]
2248
- ), [pe, ue] = z(
2251
+ ), [pe, de] = z(
2249
2252
  () => u ? [...u] : []
2250
- ), Le = q(() => {
2251
- const O = new Set(ne.map((G) => G.event.id));
2253
+ ), Re = q(() => {
2254
+ const O = new Set(ee.map((G) => G.event.id));
2252
2255
  return new Set(pe.filter((G) => O.has(G)));
2253
- }, [pe, ne]), Fe = q(
2254
- () => js(ne, Le, n),
2255
- [ne, Le, n]
2256
- ), Pe = (O) => ue(
2257
- (G) => G.includes(O) ? G.filter((Q) => Q !== O) : [...G, O]
2256
+ }, [pe, ee]), Fe = q(
2257
+ () => js(ee, Re, n),
2258
+ [ee, Re, n]
2259
+ ), Pe = (O) => de(
2260
+ (G) => G.includes(O) ? G.filter((W) => W !== O) : [...G, O]
2258
2261
  ), Nn = q(
2259
2262
  () => g ? (O) => g({ kind: "event", eventId: O }) : void 0,
2260
2263
  [g]
@@ -2262,9 +2265,9 @@ function Ca({
2262
2265
  if (!j) return null;
2263
2266
  const O = /* @__PURE__ */ new Set();
2264
2267
  for (const G of j.numeric)
2265
- G.values.forEach((Q, be) => {
2268
+ G.values.forEach((W, be) => {
2266
2269
  const Je = be === 0 ? G.values[1] : G.values[be - 1];
2267
- Q !== Je && O.add(`${j.visits[be].id}:${G.def.key}`);
2270
+ W !== Je && O.add(`${j.visits[be].id}:${G.def.key}`);
2268
2271
  });
2269
2272
  return {
2270
2273
  visitIds: new Set(j.visits.map((G) => G.id)),
@@ -2280,13 +2283,13 @@ function Ca({
2280
2283
  description: n("anamnesis.empty.noVisits.description")
2281
2284
  }
2282
2285
  ) }) : /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
2283
- Z || k ? /* @__PURE__ */ d(
2286
+ ae || k ? /* @__PURE__ */ d(
2284
2287
  "div",
2285
2288
  {
2286
2289
  "data-testid": "anamnesis-evolution-toolbar",
2287
2290
  className: "ds:flex ds:flex-wrap ds:items-start ds:gap-[var(--spacing-md)]",
2288
2291
  children: [
2289
- Z ? /* @__PURE__ */ d(
2292
+ ae ? /* @__PURE__ */ d(
2290
2293
  "div",
2291
2294
  {
2292
2295
  "data-testid": "anamnesis-window-picker",
@@ -2298,14 +2301,14 @@ function Ca({
2298
2301
  label: n("anamnesis.window.label"),
2299
2302
  description: B,
2300
2303
  children: /* @__PURE__ */ t(
2301
- ma,
2304
+ ua,
2302
2305
  {
2303
2306
  options: D,
2304
- value: se,
2307
+ value: me,
2305
2308
  allowSelectAll: !0,
2306
2309
  onChange: (O) => {
2307
2310
  if (O.length > 0) {
2308
- S(""), W(O);
2311
+ S(""), Y(O);
2309
2312
  return;
2310
2313
  }
2311
2314
  S(n("anamnesis.window.minimum"));
@@ -2320,7 +2323,7 @@ function Ca({
2320
2323
  role: "status",
2321
2324
  "data-testid": "anamnesis-window-floor",
2322
2325
  className: "ds:sr-only",
2323
- children: L
2326
+ children: R
2324
2327
  }
2325
2328
  )
2326
2329
  ]
@@ -2336,17 +2339,17 @@ function Ca({
2336
2339
  /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
2337
2340
  /* @__PURE__ */ t("span", { "aria-hidden": "true", className: "type-label ds:invisible", children: " " }),
2338
2341
  /* @__PURE__ */ t(
2339
- ae,
2342
+ ne,
2340
2343
  {
2341
2344
  ref: N,
2342
2345
  id: f,
2343
- intent: R ? "primary" : "outline",
2346
+ intent: L ? "primary" : "outline",
2344
2347
  "data-testid": "anamnesis-compare-toggle",
2345
- "aria-pressed": R,
2346
- "aria-expanded": R,
2348
+ "aria-pressed": L,
2349
+ "aria-expanded": L,
2347
2350
  "aria-controls": v,
2348
2351
  onClick: () => T((O) => !O),
2349
- children: n(R ? "anamnesis.compare.stop" : "anamnesis.compare.start")
2352
+ children: n(L ? "anamnesis.compare.stop" : "anamnesis.compare.start")
2350
2353
  }
2351
2354
  )
2352
2355
  ] })
@@ -2357,8 +2360,8 @@ function Ca({
2357
2360
  /* @__PURE__ */ t(
2358
2361
  Ws,
2359
2362
  {
2360
- marks: ne,
2361
- activeIds: Le,
2363
+ marks: ee,
2364
+ activeIds: Re,
2362
2365
  onToggle: Pe,
2363
2366
  t: n
2364
2367
  }
@@ -2373,15 +2376,15 @@ function Ca({
2373
2376
  onCellChange: i,
2374
2377
  compare: mn,
2375
2378
  framed: s,
2376
- visitColumns: X.columns,
2379
+ visitColumns: J.columns,
2377
2380
  capturableKeys: w,
2378
2381
  annotations: Fe,
2379
2382
  onSelectAnnotation: Nn,
2380
2383
  onOpenNote: g
2381
2384
  }
2382
2385
  ),
2383
- k ? /* @__PURE__ */ t(da, { open: R, onOpenChange: T, children: /* @__PURE__ */ t(
2384
- ua,
2386
+ k ? /* @__PURE__ */ t(ca, { open: L, onOpenChange: T, children: /* @__PURE__ */ t(
2387
+ da,
2385
2388
  {
2386
2389
  ref: m,
2387
2390
  id: v,
@@ -2610,18 +2613,18 @@ function Lt(e) {
2610
2613
  return "lab.values";
2611
2614
  }
2612
2615
  }
2613
- function Ft(e) {
2616
+ function Rt(e) {
2614
2617
  return { kind: "section", cells: [e] };
2615
2618
  }
2616
- function re(e) {
2619
+ function oe(e) {
2617
2620
  const n = e == null ? void 0 : e.trim();
2618
2621
  return n || null;
2619
2622
  }
2620
- function Pt(e, n) {
2623
+ function Ft(e, n) {
2621
2624
  const a = e.referenceRange;
2622
2625
  return a ? a.min != null && a.max != null ? `${a.min}–${a.max}` : a.max != null ? n("anamnesis.range.atMost", { value: a.max }) : a.min != null ? n("anamnesis.range.atLeast", { value: a.min }) : null : null;
2623
2626
  }
2624
- function _t(e, n) {
2627
+ function Pt(e, n) {
2625
2628
  return e === "high" ? n("anamnesis.range.aboveRange") : e === "low" ? n("anamnesis.range.belowRange") : null;
2626
2629
  }
2627
2630
  function to(e) {
@@ -2642,45 +2645,45 @@ function Pn(e, n, a, i, s) {
2642
2645
  a ?? ""
2643
2646
  ].filter(Boolean).join("-");
2644
2647
  }
2645
- function Ta(e, n) {
2648
+ function Ca(e, n) {
2646
2649
  return n(`anamnesis.export.audience.${e}`);
2647
2650
  }
2648
2651
  function io(e, n) {
2649
2652
  return n(`anamnesis.export.tab.${e}`);
2650
2653
  }
2651
- function $t(e, n) {
2654
+ function _t(e, n) {
2652
2655
  return n(`anamnesis.export.docTab.${e}`, {
2653
2656
  defaultValue: io(e, n)
2654
2657
  });
2655
2658
  }
2656
- function Sa(e, n, a, i) {
2659
+ function Ta(e, n, a, i) {
2657
2660
  const s = [], r = te(n, "patient.identity") ? `${e.patient.firstName} ${e.patient.lastName}`.trim() : null;
2658
2661
  return r && (s.push({ label: a("anamnesis.header.name"), value: r }), s.push({
2659
2662
  label: a("anamnesis.header.dob"),
2660
- value: le(e.patient.dateOfBirthIso, a)
2663
+ value: re(e.patient.dateOfBirthIso, a)
2661
2664
  }), s.push({
2662
2665
  label: a("anamnesis.header.age"),
2663
2666
  value: Vn(e, a)
2664
2667
  })), s.push({
2665
2668
  label: a("anamnesis.export.generated"),
2666
- value: le(i.slice(0, 10), a)
2669
+ value: re(i.slice(0, 10), a)
2667
2670
  }), s.push({
2668
2671
  label: a("anamnesis.export.audienceLabel"),
2669
- value: Ta(n.audience, a)
2672
+ value: Ca(n.audience, a)
2670
2673
  }), { meta: s, patientName: r };
2671
2674
  }
2672
2675
  function _n(e, n, a) {
2673
- const i = $t(e, a);
2676
+ const i = _t(e, a);
2674
2677
  return n ? a("anamnesis.export.docTitle", { tab: i, patient: n }) : i;
2675
2678
  }
2676
- function Aa(e, n, a) {
2679
+ function Sa(e, n, a) {
2677
2680
  return {
2678
2681
  tab: e,
2679
2682
  audience: n,
2680
2683
  fileStem: `anamnesis-${e}-${n}`,
2681
- title: $t(e, a),
2684
+ title: _t(e, a),
2682
2685
  patientName: null,
2683
- audienceLabel: Ta(n, a),
2686
+ audienceLabel: Ca(n, a),
2684
2687
  meta: [],
2685
2688
  tables: [],
2686
2689
  footnotes: [a("anamnesis.export.withheld")],
@@ -2692,7 +2695,7 @@ function $n(e, n, a, i = []) {
2692
2695
  const s = [...n.withheld].sort(), o = [...i];
2693
2696
  return s.length > 0 && o.push(a("anamnesis.export.withheld")), {
2694
2697
  ...e,
2695
- audienceLabel: Ta(n.audience, a),
2698
+ audienceLabel: Ca(n.audience, a),
2696
2699
  footnotes: o,
2697
2700
  withheld: s,
2698
2701
  locale: Ie(a)
@@ -2702,20 +2705,20 @@ function so(e) {
2702
2705
  var k;
2703
2706
  const { record: n, audience: a, t: i, config: s } = e, o = e.generatedAtIso ?? (/* @__PURE__ */ new Date()).toISOString(), r = { audience: a, withheld: /* @__PURE__ */ new Set() };
2704
2707
  if (!te(r, Hn))
2705
- return Aa("summary", a, i);
2706
- const { meta: l, patientName: c } = Sa(n, r, i, o), u = [], h = [], g = n.intake;
2708
+ return Sa("summary", a, i);
2709
+ const { meta: l, patientName: c } = Ta(n, r, i, o), u = [], h = [], g = n.intake;
2707
2710
  if (te(r, "intake.answers") && g) {
2708
2711
  const v = [];
2709
2712
  for (const f of Ge(s)) {
2710
2713
  const C = f.fields.filter((w) => un(w, n.patient.sex)).filter((w) => g.answers[w.key]);
2711
2714
  if (C.length !== 0) {
2712
- v.push(Ft(fe(f, i)));
2715
+ v.push(Rt(fe(f, i)));
2713
2716
  for (const w of C) {
2714
2717
  const A = g.answers[w.key];
2715
2718
  A && v.push({
2716
2719
  cells: [
2717
2720
  ge(w, i),
2718
- re(Bn(A.value, w, i)),
2721
+ oe(Bn(A.value, w, i)),
2719
2722
  i(`anamnesis.export.source.${A.origin}`)
2720
2723
  ]
2721
2724
  });
@@ -2767,7 +2770,7 @@ function Wn(e, n, a, i, s, o, r) {
2767
2770
  g,
2768
2771
  h.unit ?? null
2769
2772
  ];
2770
- r && (p.push(Pt(h, o)), p.push(_t(xn(g, h.referenceRange), o))), l.push({ cells: p, precision: h.precision });
2773
+ r && (p.push(Ft(h, o)), p.push(Pt(xn(g, h.referenceRange), o))), l.push({ cells: p, precision: h.precision });
2771
2774
  }
2772
2775
  if (!c) return null;
2773
2776
  const u = [
@@ -2795,8 +2798,8 @@ function Qn(e, n, a, i) {
2795
2798
  function oo(e) {
2796
2799
  const { record: n, audience: a, t: i, config: s } = e, o = e.generatedAtIso ?? (/* @__PURE__ */ new Date()).toISOString(), r = { audience: a, withheld: /* @__PURE__ */ new Set() };
2797
2800
  if (!te(r, Hn))
2798
- return Aa("compile", a, i);
2799
- const { meta: l, patientName: c } = Sa(n, r, i, o), u = qn(n), h = [], g = [];
2801
+ return Sa("compile", a, i);
2802
+ const { meta: l, patientName: c } = Ta(n, r, i, o), u = qn(n), h = [], g = [];
2800
2803
  if (!u)
2801
2804
  return g.push(i("anamnesis.export.none")), $n(
2802
2805
  {
@@ -2820,7 +2823,7 @@ function oo(e) {
2820
2823
  );
2821
2824
  te(r, "visit.date") && l.push({
2822
2825
  label: i("anamnesis.header.visitDate"),
2823
- value: le(u.dateIso, i)
2826
+ value: re(u.dateIso, i)
2824
2827
  });
2825
2828
  const p = [];
2826
2829
  te(r, "visit.type") && p.push({
@@ -2831,12 +2834,12 @@ function oo(e) {
2831
2834
  }), te(r, "visit.date") && p.push({
2832
2835
  cells: [
2833
2836
  i("anamnesis.header.visitDate"),
2834
- le(u.dateIso, i)
2837
+ re(u.dateIso, i)
2835
2838
  ]
2836
2839
  }), te(r, "visit.practitioner") && u.practitioner && p.push({
2837
2840
  cells: [
2838
2841
  i("anamnesis.field.practitioner.label"),
2839
- re(u.practitioner)
2842
+ oe(u.practitioner)
2840
2843
  ]
2841
2844
  }), p.length > 0 && h.push(
2842
2845
  Qn("visit", i("anamnesis.section.visitMeta"), p, i)
@@ -2873,7 +2876,7 @@ function oo(e) {
2873
2876
  }
2874
2877
  ],
2875
2878
  rows: u.pathologyCodes.map((A) => ({
2876
- cells: [A, ba(A, i, w[A])]
2879
+ cells: [A, ya(A, i, w[A])]
2877
2880
  })),
2878
2881
  emptyText: i("anamnesis.export.none")
2879
2882
  });
@@ -2881,26 +2884,26 @@ function oo(e) {
2881
2884
  if (te(r, "oncological.history")) {
2882
2885
  const w = u.oncological, A = [];
2883
2886
  if (w) {
2884
- if (re(w.tumourType) && A.push({
2887
+ if (oe(w.tumourType) && A.push({
2885
2888
  cells: [
2886
2889
  i("anamnesis.field.tumourType.label"),
2887
- re(w.tumourType)
2890
+ oe(w.tumourType)
2888
2891
  ]
2889
- }), re(w.stage) && A.push({
2890
- cells: [i("anamnesis.field.stage.label"), re(w.stage)]
2892
+ }), oe(w.stage) && A.push({
2893
+ cells: [i("anamnesis.field.stage.label"), oe(w.stage)]
2891
2894
  }), w.metastases) {
2892
- const R = i(`anamnesis.common.${w.metastases.present}`), T = re(w.metastases.site);
2895
+ const L = i(`anamnesis.common.${w.metastases.present}`), T = oe(w.metastases.site);
2893
2896
  A.push({
2894
2897
  cells: [
2895
2898
  i("anamnesis.field.metastases.label"),
2896
- T ? `${R} — ${T}` : R
2899
+ T ? `${L} — ${T}` : L
2897
2900
  ]
2898
2901
  });
2899
2902
  }
2900
- re(w.treatmentStatus) && A.push({
2903
+ oe(w.treatmentStatus) && A.push({
2901
2904
  cells: [
2902
2905
  i("anamnesis.field.treatmentStatus.label"),
2903
- re(w.treatmentStatus)
2906
+ oe(w.treatmentStatus)
2904
2907
  ]
2905
2908
  });
2906
2909
  }
@@ -2923,8 +2926,8 @@ function oo(e) {
2923
2926
  ],
2924
2927
  rows: u.therapy.map((w) => ({
2925
2928
  cells: [
2926
- re(w.name),
2927
- re(w.dose),
2929
+ oe(w.name),
2930
+ oe(w.dose),
2928
2931
  i(`anamnesis.medKind.${w.kind}`)
2929
2932
  ]
2930
2933
  })),
@@ -2951,30 +2954,30 @@ function oo(e) {
2951
2954
  rows: u.fmdCycles.map((w) => ({
2952
2955
  cells: [
2953
2956
  i("anamnesis.compile.cycleNumber", { number: w.cycleNumber }),
2954
- le(w.startDateIso, i),
2957
+ re(w.startDateIso, i),
2955
2958
  w.completed ? i("anamnesis.compile.cycleCompleted") : i("anamnesis.compile.cycleInProgress"),
2956
- re(w.notes)
2959
+ oe(w.notes)
2957
2960
  ]
2958
2961
  })),
2959
2962
  emptyText: i("anamnesis.compile.noFmd")
2960
2963
  }), te(r, "annual.programme")) {
2961
2964
  const w = u.annualProgramme, A = [];
2962
2965
  if (w) {
2963
- const R = (T) => i(T ? "anamnesis.common.yes" : "anamnesis.common.no");
2966
+ const L = (T) => i(T ? "anamnesis.common.yes" : "anamnesis.common.no");
2964
2967
  A.push({
2965
2968
  cells: [
2966
2969
  i("anamnesis.field.annualProposed.label"),
2967
- R(w.proposed)
2970
+ L(w.proposed)
2968
2971
  ]
2969
2972
  }), A.push({
2970
2973
  cells: [
2971
2974
  i("anamnesis.field.annualAccepted.label"),
2972
- R(w.accepted)
2975
+ L(w.accepted)
2973
2976
  ]
2974
- }), re(w.declineReason) && A.push({
2977
+ }), oe(w.declineReason) && A.push({
2975
2978
  cells: [
2976
2979
  i("anamnesis.field.annualDeclineReason.label"),
2977
- re(w.declineReason)
2980
+ oe(w.declineReason)
2978
2981
  ]
2979
2982
  });
2980
2983
  }
@@ -2983,15 +2986,15 @@ function oo(e) {
2983
2986
  );
2984
2987
  }
2985
2988
  const C = [];
2986
- return te(r, "notes.nutritionalProposal") && re(u.nutritionalProposal) && C.push({
2989
+ return te(r, "notes.nutritionalProposal") && oe(u.nutritionalProposal) && C.push({
2987
2990
  cells: [
2988
2991
  i("anamnesis.field.nutritionalProposal.label"),
2989
- re(u.nutritionalProposal)
2992
+ oe(u.nutritionalProposal)
2990
2993
  ]
2991
- }), te(r, "notes.clinicalNotes") && re(u.clinicalNotes) && C.push({
2994
+ }), te(r, "notes.clinicalNotes") && oe(u.clinicalNotes) && C.push({
2992
2995
  cells: [
2993
2996
  i("anamnesis.field.clinicalNotes.label"),
2994
- re(u.clinicalNotes)
2997
+ oe(u.clinicalNotes)
2995
2998
  ]
2996
2999
  }), C.length > 0 && h.push({
2997
3000
  id: "notes",
@@ -3028,8 +3031,8 @@ function ro(e, n, a) {
3028
3031
  var r;
3029
3032
  const o = ((r = e.cells[s.index]) == null ? void 0 : r.outOfRange) ?? null;
3030
3033
  return o ? a("anamnesis.export.flagged", {
3031
- date: le(s.visit.dateIso, a),
3032
- flag: _t(o, a)
3034
+ date: re(s.visit.dateIso, a),
3035
+ flag: Pt(o, a)
3033
3036
  }) : null;
3034
3037
  }).filter((s) => s != null);
3035
3038
  return i.length === 0 ? null : i.join(a("anamnesis.export.listSeparator"));
@@ -3044,8 +3047,8 @@ function co(e) {
3044
3047
  var C;
3045
3048
  const { record: n, audience: a, t: i, config: s } = e, o = e.generatedAtIso ?? (/* @__PURE__ */ new Date()).toISOString(), r = e.scope ?? "selected", l = { audience: a, withheld: /* @__PURE__ */ new Set() };
3046
3049
  if (!te(l, Hn))
3047
- return Aa("evolution", a, i);
3048
- const { meta: c, patientName: u } = Sa(n, l, i, o), h = [], g = [], p = e.selectedVisitIds ? [...e.selectedVisitIds] : null, k = p && p.length > 0 ? p : fn(n.visits), v = r === "all" ? Rt(n.visits) : Fn(n.visits, k).columns;
3050
+ return Sa("evolution", a, i);
3051
+ const { meta: c, patientName: u } = Ta(n, l, i, o), h = [], g = [], p = e.selectedVisitIds ? [...e.selectedVisitIds] : null, k = p && p.length > 0 ? p : fn(n.visits), v = r === "all" ? It(n.visits) : Fn(n.visits, k).columns;
3049
3052
  if (c.push({
3050
3053
  label: i("anamnesis.export.visitsLabel"),
3051
3054
  value: r === "all" ? i("anamnesis.export.visitsAll", { total: n.visits.length }) : i("anamnesis.export.visitsSelected", {
@@ -3053,7 +3056,7 @@ function co(e) {
3053
3056
  total: n.visits.length
3054
3057
  })
3055
3058
  }), te(l, "visit.date") && v.length > 0) {
3056
- const w = _e(s), A = ya(n, w), R = le(v[0].visit.dateIso, i), T = le(v[v.length - 1].visit.dateIso, i), L = [
3059
+ const w = _e(s), A = va(n, w), L = re(v[0].visit.dateIso, i), T = re(v[v.length - 1].visit.dateIso, i), R = [
3057
3060
  { key: "parameter", header: i("anamnesis.grid.parameter") },
3058
3061
  { key: "unit", header: i("anamnesis.export.column.unit") },
3059
3062
  {
@@ -3062,7 +3065,7 @@ function co(e) {
3062
3065
  },
3063
3066
  ...v.map((N) => ({
3064
3067
  key: `visit-${N.visit.id}`,
3065
- header: le(N.visit.dateIso, i),
3068
+ header: re(N.visit.dateIso, i),
3066
3069
  numeric: !0
3067
3070
  })),
3068
3071
  {
@@ -3073,7 +3076,7 @@ function co(e) {
3073
3076
  {
3074
3077
  key: "change",
3075
3078
  header: i("anamnesis.export.column.change", {
3076
- from: R,
3079
+ from: L,
3077
3080
  to: T
3078
3081
  }),
3079
3082
  numeric: !0
@@ -3082,12 +3085,12 @@ function co(e) {
3082
3085
  ], S = [];
3083
3086
  let m = null;
3084
3087
  for (const N of A)
3085
- te(l, Lt(N.def)) && (N.def.group !== m && (m = N.def.group, S.push(Ft(i(`anamnesis.group.${N.def.group}`)))), S.push({
3088
+ te(l, Lt(N.def)) && (N.def.group !== m && (m = N.def.group, S.push(Rt(i(`anamnesis.group.${N.def.group}`)))), S.push({
3086
3089
  precision: N.def.precision,
3087
3090
  cells: [
3088
3091
  ze(N.def, i),
3089
3092
  N.def.unit ?? null,
3090
- Pt(N.def, i),
3093
+ Ft(N.def, i),
3091
3094
  ...v.map((x) => {
3092
3095
  var P;
3093
3096
  return ((P = N.cells[x.index]) == null ? void 0 : P.value) ?? null;
@@ -3100,7 +3103,7 @@ function co(e) {
3100
3103
  h.push({
3101
3104
  id: "matrix",
3102
3105
  title: i("anamnesis.section.evolution"),
3103
- columns: L,
3106
+ columns: R,
3104
3107
  rows: S,
3105
3108
  emptyText: i("anamnesis.export.none")
3106
3109
  });
@@ -3142,13 +3145,13 @@ function mo(e, n) {
3142
3145
  defaultValue: e
3143
3146
  });
3144
3147
  }
3145
- function Ua(e, n) {
3148
+ function Va(e, n) {
3146
3149
  return {
3147
3150
  included: e.tables.map((a) => a.title),
3148
3151
  excluded: e.withheld.map((a) => mo(a, n)).sort((a, i) => a.localeCompare(i, e.locale))
3149
3152
  };
3150
3153
  }
3151
- const po = "text/csv;charset=utf-8", ho = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", Ka = `\r
3154
+ const po = "text/csv;charset=utf-8", ho = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", Ba = `\r
3152
3155
  `, go = /^[=+\-@\t\r]/;
3153
3156
  function fo(e) {
3154
3157
  var n;
@@ -3161,8 +3164,8 @@ function fo(e) {
3161
3164
  return ".";
3162
3165
  }
3163
3166
  }
3164
- function Ea(e) {
3165
- return fo(e) === "," ? { delimiter: ";", decimal: ",", eol: Ka, bom: !0 } : { delimiter: ",", decimal: ".", eol: Ka, bom: !0 };
3167
+ function Aa(e) {
3168
+ return fo(e) === "," ? { delimiter: ";", decimal: ",", eol: Ba, bom: !0 } : { delimiter: ",", decimal: ".", eol: Ba, bom: !0 };
3166
3169
  }
3167
3170
  function vo(e, n, a) {
3168
3171
  if (!Number.isFinite(e)) return "";
@@ -3174,13 +3177,13 @@ function Oe(e, n) {
3174
3177
  return a.includes(n.delimiter) || a.includes('"') || a.includes(`
3175
3178
  `) || a.includes("\r") || a !== a.trim() ? `"${a.replace(/"/g, '""')}"` : a;
3176
3179
  }
3177
- function Ha(e, n, a) {
3180
+ function Ua(e, n, a) {
3178
3181
  return e == null ? "" : typeof e == "number" ? vo(e, a, n) : Oe(e, n);
3179
3182
  }
3180
- function zt(e, n) {
3183
+ function $t(e, n) {
3181
3184
  return e.precision ?? (n == null ? void 0 : n.precision);
3182
3185
  }
3183
- function yo(e, n = Ea(e.locale)) {
3186
+ function yo(e, n = Aa(e.locale)) {
3184
3187
  const a = [], i = (s) => a.push(s.join(n.delimiter));
3185
3188
  i([Oe(e.title, n)]);
3186
3189
  for (const s of e.meta)
@@ -3195,15 +3198,15 @@ function yo(e, n = Ea(e.locale)) {
3195
3198
  }
3196
3199
  for (const o of s.rows) {
3197
3200
  if (o.kind === "section") {
3198
- i([Ha(o.cells[0] ?? null, n)]);
3201
+ i([Ua(o.cells[0] ?? null, n)]);
3199
3202
  continue;
3200
3203
  }
3201
3204
  i(
3202
3205
  s.columns.map(
3203
- (r, l) => Ha(
3206
+ (r, l) => Ua(
3204
3207
  o.cells[l] ?? null,
3205
3208
  n,
3206
- zt(o, r)
3209
+ $t(o, r)
3207
3210
  )
3208
3211
  )
3209
3212
  );
@@ -3215,7 +3218,7 @@ function yo(e, n = Ea(e.locale)) {
3215
3218
  }
3216
3219
  return a.join(n.eol) + n.eol;
3217
3220
  }
3218
- function bo(e, n = Ea(e.locale)) {
3221
+ function bo(e, n = Aa(e.locale)) {
3219
3222
  const a = yo(e, n);
3220
3223
  return new Blob([n.bom ? `\uFEFF${a}` : a], { type: po });
3221
3224
  }
@@ -3223,7 +3226,7 @@ async function xo() {
3223
3226
  const e = await import("./exceljs.min-D2MHbJsF.js").then((a) => a.e), n = e;
3224
3227
  return typeof n.Workbook == "function" ? e : n.default ?? e;
3225
3228
  }
3226
- function Ga(e, n) {
3229
+ function Ka(e, n) {
3227
3230
  const a = e.replace(/[\\/?*[\]:]/g, " ").trim().slice(0, 31);
3228
3231
  let i = a || "Sheet", s = 2;
3229
3232
  for (; n.has(i.toLowerCase()); ) {
@@ -3247,7 +3250,7 @@ function Co(e, n) {
3247
3250
  async function To(e) {
3248
3251
  const n = await xo(), a = new n.Workbook();
3249
3252
  a.created = /* @__PURE__ */ new Date();
3250
- const i = /* @__PURE__ */ new Set(), s = a.addWorksheet(Ga(e.title, i)), o = s.addRow([e.title]);
3253
+ const i = /* @__PURE__ */ new Set(), s = a.addWorksheet(Ka(e.title, i)), o = s.addRow([e.title]);
3251
3254
  o.font = { bold: !0 };
3252
3255
  for (const l of e.meta) s.addRow([l.label, l.value]);
3253
3256
  if (e.footnotes.length > 0) {
@@ -3256,7 +3259,7 @@ async function To(e) {
3256
3259
  }
3257
3260
  s.getColumn(1).width = 28, s.getColumn(2).width = 48;
3258
3261
  for (const l of e.tables) {
3259
- const c = a.addWorksheet(Ga(l.title, i)), u = c.addRow(
3262
+ const c = a.addWorksheet(Ka(l.title, i)), u = c.addRow(
3260
3263
  l.columns.map((h) => h.header)
3261
3264
  );
3262
3265
  u.font = { bold: !0 }, c.views = [{ state: "frozen", ySplit: 1 }], l.rows.length === 0 && l.emptyText && c.addRow([l.emptyText]);
@@ -3270,7 +3273,7 @@ async function To(e) {
3270
3273
  l.columns.forEach((k, v) => {
3271
3274
  const f = p.getCell(v + 1);
3272
3275
  if (typeof g[v] != "number") return;
3273
- const C = ko(zt(h, k));
3276
+ const C = ko($t(h, k));
3274
3277
  C && (f.numFmt = C), f.alignment = { horizontal: "right" };
3275
3278
  });
3276
3279
  }
@@ -3284,20 +3287,20 @@ async function To(e) {
3284
3287
  const r = await a.xlsx.writeBuffer();
3285
3288
  return new Blob([r], { type: ho });
3286
3289
  }
3287
- function Da(e, n) {
3290
+ function Ea(e, n) {
3288
3291
  return `${e.fileStem}.${n}`;
3289
3292
  }
3290
- function Ia(e, n) {
3293
+ function Da(e, n) {
3291
3294
  if (typeof window > "u" || typeof document > "u" || typeof URL > "u" || typeof URL.createObjectURL != "function")
3292
3295
  return !1;
3293
3296
  const a = URL.createObjectURL(e), i = document.createElement("a");
3294
3297
  return i.href = a, i.download = n, document.body.appendChild(i), i.click(), i.remove(), window.setTimeout(() => URL.revokeObjectURL(a), 0), !0;
3295
3298
  }
3296
- function So(e, n = Ea(e.locale)) {
3297
- return Ia(bo(e, n), Da(e, "csv"));
3299
+ function So(e, n = Aa(e.locale)) {
3300
+ return Da(bo(e, n), Ea(e, "csv"));
3298
3301
  }
3299
3302
  async function Ao(e) {
3300
- return Ia(await To(e), Da(e, "xlsx"));
3303
+ return Da(await To(e), Ea(e, "xlsx"));
3301
3304
  }
3302
3305
  const Ke = {
3303
3306
  headerFill: [237, 237, 240],
@@ -3413,7 +3416,7 @@ function qe(e) {
3413
3416
  n.includes(a) && (n = n.split(a).join(i));
3414
3417
  return n;
3415
3418
  }
3416
- const oe = 14, Io = 6, Ro = 15, Lo = 9, Fo = 11, ja = 8.5, Wa = 8, Me = 5;
3419
+ const se = 14, Io = 6, Lo = 15, Ro = 9, Fo = 11, Ha = 8.5, Ga = 8, Me = 5;
3417
3420
  function Po(e) {
3418
3421
  return e.tables.some(
3419
3422
  (n) => n.columns.length > Io
@@ -3430,21 +3433,21 @@ function _o(e, n, a) {
3430
3433
  return n == null ? String(e) : e.toFixed(n);
3431
3434
  }
3432
3435
  }
3433
- function Mt(e, n, a) {
3436
+ function zt(e, n, a) {
3434
3437
  return e == null ? "" : qe(
3435
3438
  typeof e == "number" ? _o(e, n, a) : e
3436
3439
  );
3437
3440
  }
3438
3441
  function $o(e, n, a) {
3439
3442
  return n.columns.map(
3440
- (i, s) => Mt(
3443
+ (i, s) => zt(
3441
3444
  e.cells[s] ?? null,
3442
3445
  e.precision ?? i.precision,
3443
3446
  a
3444
3447
  )
3445
3448
  );
3446
3449
  }
3447
- async function Ot(e, n = {}) {
3450
+ async function Mt(e, n = {}) {
3448
3451
  var v;
3449
3452
  const [{ jsPDF: a }, { default: i }] = await Promise.all([
3450
3453
  import("./jspdf.es.min-DaapWjR1.js").then((f) => f.j),
@@ -3453,36 +3456,36 @@ async function Ot(e, n = {}) {
3453
3456
  orientation: Po(e) ? "landscape" : "portrait",
3454
3457
  unit: "mm",
3455
3458
  format: "a4"
3456
- }), l = r.internal.pageSize.getWidth(), c = r.internal.pageSize.getHeight(), u = l - oe * 2, h = (f, C, w) => {
3459
+ }), l = r.internal.pageSize.getWidth(), c = r.internal.pageSize.getHeight(), u = l - se * 2, h = (f, C, w) => {
3457
3460
  r.setFont("helvetica", f), r.setFontSize(C), r.setTextColor(w[0], w[1], w[2]);
3458
3461
  };
3459
- let g = oe;
3460
- h("bold", Ro, s.headerText);
3462
+ let g = se;
3463
+ h("bold", Lo, s.headerText);
3461
3464
  for (const f of r.splitTextToSize(
3462
3465
  qe(e.title),
3463
3466
  u
3464
3467
  ))
3465
- r.text(f, oe, g), g += Me + 1;
3466
- g += 1, h("normal", Lo, s.mutedText);
3468
+ r.text(f, se, g), g += Me + 1;
3469
+ g += 1, h("normal", Ro, s.mutedText);
3467
3470
  for (const f of e.meta)
3468
- r.text(qe(`${f.label}: ${f.value}`), oe, g), g += Me - 0.6;
3471
+ r.text(qe(`${f.label}: ${f.value}`), se, g), g += Me - 0.6;
3469
3472
  for (const f of e.tables) {
3470
- if (g += Me, g > c - oe * 2 && (r.addPage(), g = oe), h("bold", Fo, s.headerText), r.text(qe(f.title), oe, g), g += 2, f.rows.length === 0 && f.emptyText) {
3471
- g += Me, h("normal", ja, s.mutedText), r.text(qe(f.emptyText), oe, g), g += 1;
3473
+ if (g += Me, g > c - se * 2 && (r.addPage(), g = se), h("bold", Fo, s.headerText), r.text(qe(f.title), se, g), g += 2, f.rows.length === 0 && f.emptyText) {
3474
+ g += Me, h("normal", Ha, s.mutedText), r.text(qe(f.emptyText), se, g), g += 1;
3472
3475
  continue;
3473
3476
  }
3474
- const C = /* @__PURE__ */ new Set(), w = f.rows.map((T, L) => T.kind === "section" ? (C.add(L), [
3475
- Mt(T.cells[0] ?? null, void 0, o),
3477
+ const C = /* @__PURE__ */ new Set(), w = f.rows.map((T, R) => T.kind === "section" ? (C.add(R), [
3478
+ zt(T.cells[0] ?? null, void 0, o),
3476
3479
  ...f.columns.slice(1).map(() => "")
3477
- ]) : $o(T, f, o)), A = {}, R = {
3480
+ ]) : $o(T, f, o)), A = {}, L = {
3478
3481
  head: [f.columns.map((T) => qe(T.header))],
3479
3482
  body: w,
3480
3483
  startY: g + 2,
3481
- margin: { left: oe, right: oe, bottom: oe + Me },
3484
+ margin: { left: se, right: se, bottom: se + Me },
3482
3485
  theme: "grid",
3483
3486
  styles: {
3484
3487
  font: "helvetica",
3485
- fontSize: ja,
3488
+ fontSize: Ha,
3486
3489
  cellPadding: 1.6,
3487
3490
  textColor: s.bodyText,
3488
3491
  lineColor: s.headerFill,
@@ -3496,8 +3499,8 @@ async function Ot(e, n = {}) {
3496
3499
  },
3497
3500
  alternateRowStyles: { fillColor: s.zebraFill },
3498
3501
  columnStyles: Object.fromEntries(
3499
- f.columns.map((T, L) => [
3500
- L,
3502
+ f.columns.map((T, R) => [
3503
+ R,
3501
3504
  T.numeric ? { halign: "right" } : {}
3502
3505
  ])
3503
3506
  ),
@@ -3508,39 +3511,39 @@ async function Ot(e, n = {}) {
3508
3511
  A.table = T.table;
3509
3512
  }
3510
3513
  };
3511
- i(r, R), g = ((v = A.table) == null ? void 0 : v.finalY) ?? g + Me;
3514
+ i(r, L), g = ((v = A.table) == null ? void 0 : v.finalY) ?? g + Me;
3512
3515
  }
3513
3516
  if (e.footnotes.length > 0) {
3514
- g += Me + 1, g > c - oe * 2 && (r.addPage(), g = oe), h("normal", Wa, s.mutedText);
3517
+ g += Me + 1, g > c - se * 2 && (r.addPage(), g = se), h("normal", Ga, s.mutedText);
3515
3518
  for (const f of e.footnotes)
3516
3519
  for (const C of r.splitTextToSize(qe(f), u))
3517
- r.text(C, oe, g), g += Me - 1;
3520
+ r.text(C, se, g), g += Me - 1;
3518
3521
  }
3519
3522
  const p = qe(
3520
3523
  [e.patientName, e.audienceLabel].filter(Boolean).join(" · ")
3521
3524
  ), k = r.getNumberOfPages();
3522
3525
  for (let f = 1; f <= k; f += 1)
3523
- r.setPage(f), h("normal", Wa, s.mutedText), p && r.text(p, oe, c - oe + 4), r.text(
3526
+ r.setPage(f), h("normal", Ga, s.mutedText), p && r.text(p, se, c - se + 4), r.text(
3524
3527
  `${f} / ${k}`,
3525
- l - oe,
3526
- c - oe + 4,
3528
+ l - se,
3529
+ c - se + 4,
3527
3530
  { align: "right" }
3528
3531
  );
3529
3532
  return n.autoPrint && r.autoPrint(), r.output("blob");
3530
3533
  }
3531
3534
  async function zo(e, n = {}) {
3532
- return Ia(
3533
- await Ot(e, n),
3534
- Da(e, "pdf")
3535
+ return Da(
3536
+ await Mt(e, n),
3537
+ Ea(e, "pdf")
3535
3538
  );
3536
3539
  }
3537
3540
  async function Mo(e, n, a = {}) {
3538
3541
  if (!n || typeof URL > "u" || typeof URL.createObjectURL != "function")
3539
3542
  return null;
3540
- const i = await Ot(e, { ...a, autoPrint: !0 }), s = URL.createObjectURL(i);
3543
+ const i = await Mt(e, { ...a, autoPrint: !0 }), s = URL.createObjectURL(i);
3541
3544
  return n.setAttribute("src", s), s;
3542
3545
  }
3543
- const la = ["clinician", "patient"];
3546
+ const ra = ["clinician", "patient"];
3544
3547
  function Oo({
3545
3548
  tab: e,
3546
3549
  record: n,
@@ -3551,7 +3554,7 @@ function Oo({
3551
3554
  defaultShareOpen: r = !1,
3552
3555
  defaultAudience: l = "clinician"
3553
3556
  }) {
3554
- const [c, u] = z(l), [h, g] = z(!1), [p, k] = z(o), [v, f] = z(r), [C, w] = z(l), [A, R] = z({ text: "", seq: 0 }), T = we(null), L = we(null), S = we(null), m = we(!1), N = Qe();
3557
+ const [c, u] = z(l), [h, g] = z(!1), [p, k] = z(o), [v, f] = z(r), [C, w] = z(l), [A, L] = z({ text: "", seq: 0 }), T = we(null), R = we(null), S = we(null), m = we(!1), N = Qe();
3555
3558
  on(
3556
3559
  () => () => {
3557
3560
  S.current && URL.revokeObjectURL(S.current);
@@ -3569,7 +3572,7 @@ function Oo({
3569
3572
  }),
3570
3573
  [e, n, a, i, s, h]
3571
3574
  ), P = a(`anamnesis.export.tab.${e}`), $ = a("anamnesis.export.control.audienceBadge"), F = q(
3572
- () => p ? Ua(x("patient"), a).excluded : [],
3575
+ () => p ? Va(x("patient"), a).excluded : [],
3573
3576
  [p, x, a]
3574
3577
  ), E = {
3575
3578
  clinician: F.length > 0 ? a("anamnesis.export.control.holds", {
@@ -3579,23 +3582,23 @@ function Oo({
3579
3582
  list: F.join(a("anamnesis.export.listSeparator"))
3580
3583
  }) : a("anamnesis.export.control.excludesNone")
3581
3584
  }, H = q(
3582
- () => v ? Ua(x(C), a) : { included: [], excluded: [] },
3585
+ () => v ? Va(x(C), a) : { included: [], excluded: [] },
3583
3586
  [v, x, C, a]
3584
- ), j = (B) => R((ne) => ({ text: B, seq: ne.seq + 1 })), M = (B, ne) => {
3587
+ ), j = (B) => L((ee) => ({ text: B, seq: ee.seq + 1 })), M = (B, ee) => {
3585
3588
  if (m.current) return;
3586
3589
  m.current = !0;
3587
3590
  const pe = x(c);
3588
- Promise.resolve(ne(pe)).then(
3589
- (ue) => j(
3590
- ue ? a("anamnesis.export.control.ready", {
3591
+ Promise.resolve(ee(pe)).then(
3592
+ (de) => j(
3593
+ de ? a("anamnesis.export.control.ready", {
3591
3594
  file: `${pe.fileStem}.${B}`
3592
3595
  }) : a("anamnesis.export.control.failed")
3593
3596
  )
3594
3597
  ).catch(() => j(a("anamnesis.export.control.failed"))).finally(() => {
3595
3598
  m.current = !1;
3596
3599
  });
3597
- }, U = () => Eo(T.current), W = () => M("pdf", (B) => zo(B, { palette: U() })), Z = () => M("xlsx", Ao), se = () => M("csv", So), X = () => {
3598
- m.current || (m.current = !0, Mo(x(c), L.current, { palette: U() }).then((B) => {
3600
+ }, U = () => Eo(T.current), Y = () => M("pdf", (B) => zo(B, { palette: U() })), ae = () => M("xlsx", Ao), me = () => M("csv", So), J = () => {
3601
+ m.current || (m.current = !0, Mo(x(c), R.current, { palette: U() }).then((B) => {
3599
3602
  if (!B) {
3600
3603
  j(a("anamnesis.export.control.failed"));
3601
3604
  return;
@@ -3604,7 +3607,7 @@ function Oo({
3604
3607
  }).catch(() => j(a("anamnesis.export.control.failed"))).finally(() => {
3605
3608
  m.current = !1;
3606
3609
  }));
3607
- }, Re = () => {
3610
+ }, Le = () => {
3608
3611
  w(c), f(!0);
3609
3612
  }, D = () => {
3610
3613
  u(C), f(!1), j(
@@ -3623,7 +3626,7 @@ function Oo({
3623
3626
  className: "ds:flex ds:flex-wrap ds:items-center ds:justify-end ds:gap-[var(--spacing-xs)]",
3624
3627
  children: [
3625
3628
  c !== "clinician" ? /* @__PURE__ */ t(
3626
- J,
3629
+ X,
3627
3630
  {
3628
3631
  variant: "warning",
3629
3632
  size: "sm",
@@ -3632,19 +3635,19 @@ function Oo({
3632
3635
  }
3633
3636
  ) : null,
3634
3637
  /* @__PURE__ */ d(
3635
- ce.Root,
3638
+ le.Root,
3636
3639
  {
3637
3640
  open: p,
3638
3641
  onOpenChange: k,
3639
3642
  modal: !o,
3640
3643
  children: [
3641
- /* @__PURE__ */ t(ce.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
3642
- ae,
3644
+ /* @__PURE__ */ t(le.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
3645
+ ne,
3643
3646
  {
3644
3647
  type: "button",
3645
3648
  intent: "outline",
3646
3649
  size: "sm",
3647
- endIcon: /* @__PURE__ */ t(pa, { "aria-hidden": "true" }),
3650
+ endIcon: /* @__PURE__ */ t(ma, { "aria-hidden": "true" }),
3648
3651
  "aria-label": c === "clinician" ? a("anamnesis.export.control.triggerLabel", { tab: P }) : a("anamnesis.export.control.triggerLabelAudience", {
3649
3652
  tab: P,
3650
3653
  audience: $
@@ -3653,29 +3656,29 @@ function Oo({
3653
3656
  children: a("anamnesis.export.control.trigger")
3654
3657
  }
3655
3658
  ) }),
3656
- /* @__PURE__ */ d(ce.Content, { align: "end", children: [
3657
- /* @__PURE__ */ t(ce.Label, { children: a("anamnesis.export.control.menuLabel", { tab: P }) }),
3658
- /* @__PURE__ */ t(ce.Separator, {}),
3659
- /* @__PURE__ */ t(ce.Label, { children: a("anamnesis.export.audienceLabel") }),
3659
+ /* @__PURE__ */ d(le.Content, { align: "end", children: [
3660
+ /* @__PURE__ */ t(le.Label, { children: a("anamnesis.export.control.menuLabel", { tab: P }) }),
3661
+ /* @__PURE__ */ t(le.Separator, {}),
3662
+ /* @__PURE__ */ t(le.Label, { children: a("anamnesis.export.audienceLabel") }),
3660
3663
  /* @__PURE__ */ t(
3661
- ce.RadioGroup,
3664
+ le.RadioGroup,
3662
3665
  {
3663
3666
  value: c,
3664
3667
  onValueChange: (B) => u(B),
3665
- children: la.map((B) => /* @__PURE__ */ t(
3666
- ce.RadioItem,
3668
+ children: ra.map((B) => /* @__PURE__ */ t(
3669
+ le.RadioItem,
3667
3670
  {
3668
3671
  value: B,
3669
3672
  "aria-describedby": `${N}-${B}`,
3670
- onSelect: (ne) => ne.preventDefault(),
3673
+ onSelect: (ee) => ee.preventDefault(),
3671
3674
  children: a(`anamnesis.export.audience.${B}`)
3672
3675
  },
3673
3676
  B
3674
3677
  ))
3675
3678
  }
3676
3679
  ),
3677
- /* @__PURE__ */ t(ce.Label, { "data-testid": "anamnesis-export-disclosure", children: E[c === "patient" ? "patient" : "clinician"] }),
3678
- la.map((B) => /* @__PURE__ */ t(
3680
+ /* @__PURE__ */ t(le.Label, { "data-testid": "anamnesis-export-disclosure", children: E[c === "patient" ? "patient" : "clinician"] }),
3681
+ ra.map((B) => /* @__PURE__ */ t(
3679
3682
  "span",
3680
3683
  {
3681
3684
  id: `${N}-${B}`,
@@ -3689,7 +3692,7 @@ function Oo({
3689
3692
  whose OFF state has to be visible — an unticked checkbox row
3690
3693
  renders as an empty slot. */
3691
3694
  /* @__PURE__ */ t(
3692
- ce.SwitchItem,
3695
+ le.SwitchItem,
3693
3696
  {
3694
3697
  checked: h,
3695
3698
  onCheckedChange: g,
@@ -3697,45 +3700,45 @@ function Oo({
3697
3700
  }
3698
3701
  )
3699
3702
  ) : null,
3700
- /* @__PURE__ */ t(ce.Separator, {}),
3703
+ /* @__PURE__ */ t(le.Separator, {}),
3701
3704
  /* @__PURE__ */ t(
3702
- ce.Item,
3705
+ le.Item,
3703
3706
  {
3704
3707
  startIcon: /* @__PURE__ */ t(pi, { "aria-hidden": "true" }),
3705
- onSelect: Re,
3708
+ onSelect: Le,
3706
3709
  children: a("anamnesis.export.control.share")
3707
3710
  }
3708
3711
  ),
3709
3712
  /* @__PURE__ */ t(
3710
- ce.Item,
3713
+ le.Item,
3711
3714
  {
3712
3715
  startIcon: /* @__PURE__ */ t(hi, { "aria-hidden": "true" }),
3713
- onSelect: W,
3716
+ onSelect: Y,
3714
3717
  children: a("anamnesis.export.control.pdf")
3715
3718
  }
3716
3719
  ),
3717
3720
  /* @__PURE__ */ t(
3718
- ce.Item,
3721
+ le.Item,
3719
3722
  {
3720
3723
  startIcon: /* @__PURE__ */ t(gi, { "aria-hidden": "true" }),
3721
- onSelect: X,
3724
+ onSelect: J,
3722
3725
  children: a("anamnesis.export.control.print")
3723
3726
  }
3724
3727
  ),
3725
- /* @__PURE__ */ t(ce.Separator, {}),
3728
+ /* @__PURE__ */ t(le.Separator, {}),
3726
3729
  /* @__PURE__ */ t(
3727
- ce.Item,
3730
+ le.Item,
3728
3731
  {
3729
3732
  startIcon: /* @__PURE__ */ t(fi, { "aria-hidden": "true" }),
3730
- onSelect: Z,
3733
+ onSelect: ae,
3731
3734
  children: a("anamnesis.export.control.xlsx")
3732
3735
  }
3733
3736
  ),
3734
3737
  /* @__PURE__ */ t(
3735
- ce.Item,
3738
+ le.Item,
3736
3739
  {
3737
3740
  startIcon: /* @__PURE__ */ t(vi, { "aria-hidden": "true" }),
3738
- onSelect: se,
3741
+ onSelect: me,
3739
3742
  children: a("anamnesis.export.control.csv")
3740
3743
  }
3741
3744
  )
@@ -3759,7 +3762,7 @@ function Oo({
3759
3762
  /* @__PURE__ */ t(
3760
3763
  "iframe",
3761
3764
  {
3762
- ref: L,
3765
+ ref: R,
3763
3766
  title: a("anamnesis.export.control.printFrame"),
3764
3767
  "aria-hidden": "true",
3765
3768
  tabIndex: -1,
@@ -3790,15 +3793,15 @@ function qo({
3790
3793
  tabName: r,
3791
3794
  t: l
3792
3795
  }) {
3793
- return /* @__PURE__ */ t(ee.Root, { open: e, onOpenChange: n, children: /* @__PURE__ */ d(ee.Content, { size: "md", "data-testid": "anamnesis-share-dialog", children: [
3794
- /* @__PURE__ */ d(ee.Header, { children: [
3796
+ return /* @__PURE__ */ t(Z.Root, { open: e, onOpenChange: n, children: /* @__PURE__ */ d(Z.Content, { size: "md", "data-testid": "anamnesis-share-dialog", children: [
3797
+ /* @__PURE__ */ d(Z.Header, { children: [
3795
3798
  /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
3796
- /* @__PURE__ */ t(ee.Title, { children: l("anamnesis.export.share.title", { tab: r }) }),
3797
- /* @__PURE__ */ t(J, { variant: "warning", size: "sm", children: l("anamnesis.export.share.mockBadge") })
3799
+ /* @__PURE__ */ t(Z.Title, { children: l("anamnesis.export.share.title", { tab: r }) }),
3800
+ /* @__PURE__ */ t(X, { variant: "warning", size: "sm", children: l("anamnesis.export.share.mockBadge") })
3798
3801
  ] }),
3799
- /* @__PURE__ */ t(ee.Description, { children: l("anamnesis.export.share.subtitle") })
3802
+ /* @__PURE__ */ t(Z.Description, { children: l("anamnesis.export.share.subtitle") })
3800
3803
  ] }),
3801
- /* @__PURE__ */ d(ee.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
3804
+ /* @__PURE__ */ d(Z.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
3802
3805
  /* @__PURE__ */ d(He, { variant: "warning", "data-testid": "anamnesis-share-notice", children: [
3803
3806
  /* @__PURE__ */ t(He.Title, { children: l("anamnesis.export.share.noticeTitle") }),
3804
3807
  /* @__PURE__ */ t(He.Description, { children: l("anamnesis.export.share.notice") })
@@ -3809,7 +3812,7 @@ function qo({
3809
3812
  label: l("anamnesis.export.share.audienceLabel"),
3810
3813
  value: a,
3811
3814
  onValueChange: (c) => i(c),
3812
- children: la.map((c) => /* @__PURE__ */ t(
3815
+ children: ra.map((c) => /* @__PURE__ */ t(
3813
3816
  ke,
3814
3817
  {
3815
3818
  value: c,
@@ -3820,7 +3823,7 @@ function qo({
3820
3823
  }
3821
3824
  ),
3822
3825
  /* @__PURE__ */ t(
3823
- Qa,
3826
+ ja,
3824
3827
  {
3825
3828
  title: l("anamnesis.export.share.includes"),
3826
3829
  items: s.included,
@@ -3829,7 +3832,7 @@ function qo({
3829
3832
  }
3830
3833
  ),
3831
3834
  /* @__PURE__ */ t(
3832
- Qa,
3835
+ ja,
3833
3836
  {
3834
3837
  title: l("anamnesis.export.share.excludes"),
3835
3838
  items: s.excluded,
@@ -3838,10 +3841,10 @@ function qo({
3838
3841
  }
3839
3842
  )
3840
3843
  ] }),
3841
- /* @__PURE__ */ d(ee.Footer, { divider: !0, children: [
3842
- /* @__PURE__ */ t(ee.Close, { asChild: !0, children: /* @__PURE__ */ t(ae, { type: "button", intent: "ghost", size: "sm", children: l("anamnesis.export.share.cancel") }) }),
3844
+ /* @__PURE__ */ d(Z.Footer, { divider: !0, children: [
3845
+ /* @__PURE__ */ t(Z.Close, { asChild: !0, children: /* @__PURE__ */ t(ne, { type: "button", intent: "ghost", size: "sm", children: l("anamnesis.export.share.cancel") }) }),
3843
3846
  /* @__PURE__ */ t(
3844
- ae,
3847
+ ne,
3845
3848
  {
3846
3849
  type: "button",
3847
3850
  intent: "primary",
@@ -3854,7 +3857,7 @@ function qo({
3854
3857
  ] })
3855
3858
  ] }) });
3856
3859
  }
3857
- function Qa({
3860
+ function ja({
3858
3861
  title: e,
3859
3862
  items: n,
3860
3863
  emptyText: a,
@@ -3872,7 +3875,7 @@ function Qa({
3872
3875
  }
3873
3876
  );
3874
3877
  }
3875
- function Ra(e, n) {
3878
+ function Ot(e, n) {
3876
3879
  if (!e.highlight || !n) return !1;
3877
3880
  switch (e.highlight) {
3878
3881
  case "always":
@@ -3905,7 +3908,7 @@ function qt({
3905
3908
  readOnly: o = !1,
3906
3909
  t: r
3907
3910
  }) {
3908
- const l = cs(e, r), c = gt(e, r), u = i && s === "patient", h = Ra(e, n);
3911
+ const l = cs(e, r), c = ht(e, r), u = i && s === "patient", h = Ot(e, n);
3909
3912
  let g = null;
3910
3913
  switch (e.type) {
3911
3914
  case "text": {
@@ -4148,7 +4151,7 @@ function qt({
4148
4151
  children: [
4149
4152
  u || h ? /* @__PURE__ */ d("div", { className: "ds:flex ds:items-center ds:justify-end ds:gap-[var(--spacing-xs)]", children: [
4150
4153
  h ? /* @__PURE__ */ t("span", { "data-testid": `anamnesis-field-${e.key}-highlight`, children: /* @__PURE__ */ t(
4151
- J,
4154
+ X,
4152
4155
  {
4153
4156
  variant: "accentSoft",
4154
4157
  size: "sm",
@@ -4156,7 +4159,7 @@ function qt({
4156
4159
  children: r("anamnesis.field.highlighted")
4157
4160
  }
4158
4161
  ) }) : null,
4159
- u ? /* @__PURE__ */ t(bt, { t: r }) : null
4162
+ u ? /* @__PURE__ */ t(yt, { t: r }) : null
4160
4163
  ] }) : null,
4161
4164
  g
4162
4165
  ]
@@ -4208,7 +4211,7 @@ const Ko = {
4208
4211
  function Go(e) {
4209
4212
  return Ko[e] ?? Ho;
4210
4213
  }
4211
- function Ya(e, n, a) {
4214
+ function Wa(e, n, a) {
4212
4215
  return e.kind === "absolute" ? n : Math.abs(a) * n;
4213
4216
  }
4214
4217
  function jo(e, n, a) {
@@ -4216,7 +4219,7 @@ function jo(e, n, a) {
4216
4219
  const i = Go(a), s = e - n;
4217
4220
  if (i.sided === "atLeast" && s >= 0 || i.sided === "atMost" && s <= 0) return "onTarget";
4218
4221
  const o = Math.abs(s);
4219
- return o <= Ya(i, i.onTarget, n) ? "onTarget" : o <= Ya(i, i.approaching, n) ? "approaching" : "offTarget";
4222
+ return o <= Wa(i, i.onTarget, n) ? "onTarget" : o <= Wa(i, i.approaching, n) ? "approaching" : "offTarget";
4220
4223
  }
4221
4224
  const Wo = {
4222
4225
  weight: { min: 20, max: 400, step: 0.1 },
@@ -4253,7 +4256,7 @@ function Bt({
4253
4256
  };
4254
4257
  return /* @__PURE__ */ d(ye, { open: r, onOpenChange: f, children: [
4255
4258
  /* @__PURE__ */ t(ye.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
4256
- de,
4259
+ ce,
4257
4260
  {
4258
4261
  icon: /* @__PURE__ */ t(gn, { "aria-hidden": "true" }),
4259
4262
  intent: "ghost",
@@ -4296,7 +4299,7 @@ function Bt({
4296
4299
  p && g ? /* @__PURE__ */ t("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: s("anamnesis.targets.unsaved") }) : null,
4297
4300
  /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:justify-end ds:gap-[var(--spacing-sm)]", children: [
4298
4301
  /* @__PURE__ */ t(
4299
- ae,
4302
+ ne,
4300
4303
  {
4301
4304
  intent: "ghost",
4302
4305
  size: "sm",
@@ -4307,7 +4310,7 @@ function Bt({
4307
4310
  }
4308
4311
  ),
4309
4312
  /* @__PURE__ */ t(
4310
- ae,
4313
+ ne,
4311
4314
  {
4312
4315
  intent: "primary",
4313
4316
  size: "sm",
@@ -4358,7 +4361,7 @@ function er({
4358
4361
  // `mt-auto` pins it to the tile's foot, so a row of tiles stretched to
4359
4362
  // the tallest one lines its chips up instead of leaving a hole.
4360
4363
  /* @__PURE__ */ d("div", { className: "ds:mt-auto ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
4361
- s ? /* @__PURE__ */ t(J, { variant: Zo[s], size: "sm", withDot: !0, children: o }) : null,
4364
+ s ? /* @__PURE__ */ t(X, { variant: Zo[s], size: "sm", withDot: !0, children: o }) : null,
4362
4365
  r
4363
4366
  ] })
4364
4367
  ) : null
@@ -4473,7 +4476,7 @@ function Xn({
4473
4476
  }
4474
4477
  ) }),
4475
4478
  /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
4476
- k ? /* @__PURE__ */ t(xa, { flag: k, t: o }) : null,
4479
+ k ? /* @__PURE__ */ t(ba, { flag: k, t: o }) : null,
4477
4480
  /* @__PURE__ */ t(Un, { delta: p, def: u, t: o }),
4478
4481
  C || v != null ? /* @__PURE__ */ d("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-2xs)]", children: [
4479
4482
  /* @__PURE__ */ t("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: v == null ? o("anamnesis.targets.unset") : o("anamnesis.grid.target", {
@@ -4513,7 +4516,7 @@ function ve({
4513
4516
  children: c
4514
4517
  }) {
4515
4518
  return /* @__PURE__ */ d(
4516
- da,
4519
+ ca,
4517
4520
  {
4518
4521
  variant: "default",
4519
4522
  defaultOpen: r === void 0 ? a : void 0,
@@ -4522,24 +4525,24 @@ function ve({
4522
4525
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
4523
4526
  children: [
4524
4527
  /* @__PURE__ */ t("h2", { className: "type-title-section ds:m-0 ds:text-[color:var(--foreground)]", children: /* @__PURE__ */ d(
4525
- et,
4528
+ Za,
4526
4529
  {
4527
- className: "ds:flex ds:w-full ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)] ds:text-start" + kt,
4530
+ className: "ds:flex ds:w-full ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)] ds:text-start" + xt,
4528
4531
  children: [
4529
4532
  /* @__PURE__ */ d("span", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
4530
4533
  n(e),
4531
4534
  i == null ? null : /* @__PURE__ */ t(
4532
- J,
4535
+ X,
4533
4536
  {
4534
4537
  variant: s === "outstanding" && i > 0 ? "warning" : "neutral",
4535
4538
  size: "sm",
4536
4539
  children: s === "outstanding" ? i > 0 ? n("anamnesis.compile.blockOutstanding", { count: i }) : n("anamnesis.compile.blockSettled") : i > 0 ? n("anamnesis.compile.blockFilled", { count: i }) : n("anamnesis.compile.blockEmpty")
4537
4540
  }
4538
4541
  ),
4539
- o > 0 ? /* @__PURE__ */ t(J, { variant: "warning", size: "sm", children: n("anamnesis.compile.blockFlagged", { count: o }) }) : null
4542
+ o > 0 ? /* @__PURE__ */ t(X, { variant: "warning", size: "sm", children: n("anamnesis.compile.blockFlagged", { count: o }) }) : null
4540
4543
  ] }),
4541
4544
  /* @__PURE__ */ t(
4542
- pa,
4545
+ ma,
4543
4546
  {
4544
4547
  "aria-hidden": "true",
4545
4548
  className: "ds:size-5 ds:shrink-0 ds:text-[color:var(--muted-foreground)] ds:transition-transform ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none ds:[[data-state=open]_&]:rotate-180"
@@ -4549,7 +4552,7 @@ function ve({
4549
4552
  }
4550
4553
  ) }),
4551
4554
  /* @__PURE__ */ t(
4552
- ua,
4555
+ da,
4553
4556
  {
4554
4557
  "aria-label": n(e),
4555
4558
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
@@ -4578,7 +4581,7 @@ function tr({
4578
4581
  defaultShareOpen: v = !1,
4579
4582
  defaultExportAudience: f = "clinician"
4580
4583
  }) {
4581
- var Fa;
4584
+ var La;
4582
4585
  const [C, w] = z(
4583
4586
  () => structuredClone(e)
4584
4587
  ), A = we(!1);
@@ -4589,7 +4592,7 @@ function tr({
4589
4592
  }
4590
4593
  u == null || u(C);
4591
4594
  }, [C]);
4592
- const R = we(0), { patient: T, visits: L } = C, S = L[L.length - 1], m = L.length > 1 ? L[L.length - 2] : void 0, N = q(
4595
+ const L = we(0), { patient: T, visits: R } = C, S = R[R.length - 1], m = R.length > 1 ? R[R.length - 2] : void 0, N = q(
4593
4596
  () => new Map(C.targets.map((y) => [y.parameterKey, y.target])),
4594
4597
  [C.targets]
4595
4598
  ), x = q(
@@ -4602,43 +4605,43 @@ function tr({
4602
4605
  () => new Set(F.map((y) => y.key)),
4603
4606
  [F]
4604
4607
  ), H = q(
4605
- () => Va(S, $),
4608
+ () => Oa(S, $),
4606
4609
  [S, $]
4607
4610
  ), [j, M] = z(() => {
4608
- const y = Va(S, $), b = {};
4609
- for (const I of Nt) b[I] = y[I].open;
4611
+ const y = Oa(S, $), b = {};
4612
+ for (const I of wt) b[I] = y[I].open;
4610
4613
  return b;
4611
4614
  }), U = tn(
4612
4615
  (y) => (b) => M((I) => ({ ...I, [y]: b })),
4613
4616
  []
4614
- ), W = q(
4617
+ ), Y = q(
4615
4618
  () => Ge(i),
4616
4619
  [i]
4617
- ), Z = q(() => fa(i), [i]), se = q(() => zn(i), [i]), [X, Re] = z(p), [D, B] = z(!0), [ne, pe] = z([]), ue = tn((y) => {
4620
+ ), ae = q(() => ga(i), [i]), me = q(() => zn(i), [i]), [J, Le] = z(p), [D, B] = z(!0), [ee, pe] = z([]), de = tn((y) => {
4618
4621
  pe(
4619
4622
  (b) => b.length === y.length && b.every((I, K) => I === y[K]) ? b : [...y]
4620
4623
  );
4621
- }, []), { containerRef: Le, requestJump: Fe } = vt(), Pe = tn(
4624
+ }, []), { containerRef: Re, requestJump: Fe } = ft(), Pe = tn(
4622
4625
  (y) => {
4623
4626
  var b, I;
4624
4627
  return (I = (b = C.intake) == null ? void 0 : b.answers[y]) == null ? void 0 : I.value;
4625
4628
  },
4626
4629
  [C.intake]
4627
4630
  ), Nn = q(
4628
- () => hs(W, Pe, T.sex, n),
4629
- [W, Pe, T.sex, n]
4631
+ () => hs(Y, Pe, T.sex, n),
4632
+ [Y, Pe, T.sex, n]
4630
4633
  ), mn = q(
4631
- () => ft(Z, Pe, T.sex, n),
4632
- [Z, Pe, T.sex, n]
4634
+ () => gt(ae, Pe, T.sex, n),
4635
+ [ae, Pe, T.sex, n]
4633
4636
  ), [O] = z(() => new Set(mn.map((y) => y.key))), G = (y) => {
4634
4637
  if (c) {
4635
4638
  c(y);
4636
4639
  return;
4637
4640
  }
4638
- Re("compile"), B(!0), Fe(y.key);
4641
+ Le("compile"), B(!0), Fe(y.key);
4639
4642
  };
4640
4643
  if (!S)
4641
- return /* @__PURE__ */ t(Xa, { embedded: a, children: /* @__PURE__ */ t(me, { variant: "elevated", children: /* @__PURE__ */ t(me.Body, { children: /* @__PURE__ */ t(
4644
+ return /* @__PURE__ */ t(Qa, { embedded: a, children: /* @__PURE__ */ t(ue, { variant: "elevated", children: /* @__PURE__ */ t(ue.Body, { children: /* @__PURE__ */ t(
4642
4645
  Ue,
4643
4646
  {
4644
4647
  variant: "first-use",
@@ -4647,35 +4650,35 @@ function tr({
4647
4650
  description: n("anamnesis.empty.noRecord.description")
4648
4651
  }
4649
4652
  ) }) }) });
4650
- const Q = (y) => {
4653
+ const W = (y) => {
4651
4654
  w((b) => {
4652
4655
  if (b.visits.length === 0) return b;
4653
4656
  const I = b.visits.slice();
4654
4657
  return I[I.length - 1] = y(I[I.length - 1]), { ...b, visits: I };
4655
4658
  });
4656
- }, be = (y, b) => Q((I) => za(I, y, b)), Je = (y, b, I) => w((K) => ({
4659
+ }, be = (y, b) => W((I) => _a(I, y, b)), Je = (y, b, I) => w((K) => ({
4657
4660
  ...K,
4658
4661
  visits: K.visits.map(
4659
- (Ze) => Ze.id === y.id ? za(Ze, b, I) : Ze
4662
+ (Ze) => Ze.id === y.id ? _a(Ze, b, I) : Ze
4660
4663
  )
4661
4664
  })), Gn = (y, b) => {
4662
- w((I) => ut(I, y.key, b)), s == null || s(y.key, b);
4663
- }, Qt = (y) => Q((b) => ({ ...b, pathologyCodes: y })), La = (y, b) => Q((I) => ({
4665
+ w((I) => dt(I, y.key, b)), s == null || s(y.key, b);
4666
+ }, Qt = (y) => W((b) => ({ ...b, pathologyCodes: y })), Ia = (y, b) => W((I) => ({
4664
4667
  ...I,
4665
4668
  therapy: I.therapy.map((K) => K.id === y ? { ...K, ...b } : K)
4666
- })), Yt = (y) => Q((b) => ({
4669
+ })), Yt = (y) => W((b) => ({
4667
4670
  ...b,
4668
4671
  therapy: b.therapy.filter((I) => I.id !== y)
4669
4672
  })), Xt = () => {
4670
- R.current += 1;
4671
- const y = `new-${R.current}`;
4672
- Q((b) => ({
4673
+ L.current += 1;
4674
+ const y = `new-${L.current}`;
4675
+ W((b) => ({
4673
4676
  ...b,
4674
4677
  therapy: [...b.therapy, { id: y, name: "", dose: "", kind: "medication" }]
4675
4678
  }));
4676
4679
  }, Jt = () => {
4677
- R.current += 1;
4678
- const y = `new-visit-${R.current}`;
4680
+ L.current += 1;
4681
+ const y = `new-visit-${L.current}`;
4679
4682
  w((b) => {
4680
4683
  const I = b.visits[b.visits.length - 1];
4681
4684
  if (!I) return b;
@@ -4714,11 +4717,11 @@ function tr({
4714
4717
  });
4715
4718
  }, ei = Hi(i).map(
4716
4719
  (y) => {
4717
- const b = se[y], I = b == null ? void 0 : b.parentCode;
4720
+ const b = me[y], I = b == null ? void 0 : b.parentCode;
4718
4721
  return {
4719
4722
  value: y,
4720
4723
  label: Se(y, n, b),
4721
- group: I ? ba(I, n, se[I]) : n("anamnesis.pathology.groupGeneral")
4724
+ group: I ? ya(I, n, me[I]) : n("anamnesis.pathology.groupGeneral")
4722
4725
  };
4723
4726
  }
4724
4727
  ), Cn = S.oncological ?? {}, Tn = S.annualProgramme ?? {
@@ -4735,7 +4738,7 @@ function tr({
4735
4738
  /* @__PURE__ */ d("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: [
4736
4739
  Vn(C, n),
4737
4740
  " · ",
4738
- n("anamnesis.compile.visitCount", { visits: L.length })
4741
+ n("anamnesis.compile.visitCount", { visits: R.length })
4739
4742
  ] })
4740
4743
  ] }),
4741
4744
  r ? /* @__PURE__ */ t(
@@ -4750,44 +4753,44 @@ function tr({
4750
4753
  o ? null : /* @__PURE__ */ t(
4751
4754
  Ut,
4752
4755
  {
4753
- visits: L,
4756
+ visits: R,
4754
4757
  defs: F,
4755
4758
  targets: N,
4756
4759
  t: n,
4757
4760
  onTargetChange: Gn
4758
4761
  }
4759
4762
  ),
4760
- /* @__PURE__ */ t(me, { variant: "elevated", children: /* @__PURE__ */ t(me.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", children: /* @__PURE__ */ d(
4761
- Y,
4763
+ /* @__PURE__ */ t(ue, { variant: "elevated", children: /* @__PURE__ */ t(ue.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", children: /* @__PURE__ */ d(
4764
+ Q,
4762
4765
  {
4763
- value: X,
4764
- onValueChange: (y) => Re(y),
4766
+ value: J,
4767
+ onValueChange: (y) => Le(y),
4765
4768
  children: [
4766
4769
  /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
4767
- /* @__PURE__ */ d(Y.List, { "aria-label": n("anamnesis.compile.viewsLabel"), children: [
4768
- /* @__PURE__ */ t(Y.Trigger, { value: "summary", children: n("anamnesis.compile.tabSummary") }),
4769
- /* @__PURE__ */ t(Y.Trigger, { value: "compile", children: n("anamnesis.compile.tabCompile") }),
4770
- /* @__PURE__ */ t(Y.Trigger, { value: "evolution", children: n("anamnesis.compile.tabEvolution") })
4770
+ /* @__PURE__ */ d(Q.List, { "aria-label": n("anamnesis.compile.viewsLabel"), children: [
4771
+ /* @__PURE__ */ t(Q.Trigger, { value: "summary", children: n("anamnesis.compile.tabSummary") }),
4772
+ /* @__PURE__ */ t(Q.Trigger, { value: "compile", children: n("anamnesis.compile.tabCompile") }),
4773
+ /* @__PURE__ */ t(Q.Trigger, { value: "evolution", children: n("anamnesis.compile.tabEvolution") })
4771
4774
  ] }),
4772
4775
  /* @__PURE__ */ t(
4773
4776
  Oo,
4774
4777
  {
4775
- tab: X,
4778
+ tab: J,
4776
4779
  record: C,
4777
4780
  t: n,
4778
4781
  config: i,
4779
- shownVisitIds: ne,
4782
+ shownVisitIds: ee,
4780
4783
  defaultOpen: k,
4781
4784
  defaultShareOpen: v,
4782
4785
  defaultAudience: f
4783
4786
  }
4784
4787
  )
4785
4788
  ] }),
4786
- /* @__PURE__ */ t(Y.Content, { value: "summary", children: /* @__PURE__ */ t("div", { className: "ds:pt-[var(--spacing-md)]", children: /* @__PURE__ */ t(
4789
+ /* @__PURE__ */ t(Q.Content, { value: "summary", children: /* @__PURE__ */ t("div", { className: "ds:pt-[var(--spacing-md)]", children: /* @__PURE__ */ t(
4787
4790
  ws,
4788
4791
  {
4789
4792
  intake: C.intake,
4790
- sections: W,
4793
+ sections: Y,
4791
4794
  sex: T.sex,
4792
4795
  digest: Nn,
4793
4796
  missing: mn,
@@ -4795,7 +4798,7 @@ function tr({
4795
4798
  t: n
4796
4799
  }
4797
4800
  ) }) }),
4798
- /* @__PURE__ */ t(Y.Content, { value: "compile", children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)] ds:pt-[var(--spacing-md)]", children: [
4801
+ /* @__PURE__ */ t(Q.Content, { value: "compile", children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)] ds:pt-[var(--spacing-md)]", children: [
4799
4802
  /* @__PURE__ */ d(ve, { titleKey: "anamnesis.section.visitMeta", t: n, children: [
4800
4803
  /* @__PURE__ */ d("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: [
4801
4804
  /* @__PURE__ */ t(V, { label: n("anamnesis.field.visitType.label"), children: /* @__PURE__ */ t(
@@ -4812,7 +4815,7 @@ function tr({
4812
4815
  }
4813
4816
  ],
4814
4817
  value: S.visitType,
4815
- onValueChange: (y) => Q((b) => ({
4818
+ onValueChange: (y) => W((b) => ({
4816
4819
  ...b,
4817
4820
  visitType: y || "followUp"
4818
4821
  }))
@@ -4823,7 +4826,7 @@ function tr({
4823
4826
  {
4824
4827
  options: h,
4825
4828
  value: S.practitioner ?? "",
4826
- onValueChange: (y) => Q((b) => ({
4829
+ onValueChange: (y) => W((b) => ({
4827
4830
  ...b,
4828
4831
  practitioner: y || void 0
4829
4832
  }))
@@ -4832,7 +4835,7 @@ function tr({
4832
4835
  ie,
4833
4836
  {
4834
4837
  value: S.practitioner ?? "",
4835
- onChange: (y) => Q((b) => ({
4838
+ onChange: (y) => W((b) => ({
4836
4839
  ...b,
4837
4840
  practitioner: y.target.value
4838
4841
  }))
@@ -4841,8 +4844,8 @@ function tr({
4841
4844
  /* @__PURE__ */ t(V, { label: n("anamnesis.header.visitDate"), children: /* @__PURE__ */ t(
4842
4845
  oi,
4843
4846
  {
4844
- value: pt(S.dateIso),
4845
- onChange: (y) => y && Q((b) => ({
4847
+ value: mt(S.dateIso),
4848
+ onChange: (y) => y && W((b) => ({
4846
4849
  ...b,
4847
4850
  dateIso: rs(y) + os(b.dateIso)
4848
4851
  }))
@@ -4850,7 +4853,7 @@ function tr({
4850
4853
  ) })
4851
4854
  ] }),
4852
4855
  /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
4853
- ae,
4856
+ ne,
4854
4857
  {
4855
4858
  intent: "outline",
4856
4859
  size: "sm",
@@ -4875,9 +4878,9 @@ function tr({
4875
4878
  /* @__PURE__ */ t(
4876
4879
  "div",
4877
4880
  {
4878
- ref: Le,
4881
+ ref: Re,
4879
4882
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]",
4880
- children: Z.map((y) => {
4883
+ children: ae.map((y) => {
4881
4884
  const b = y.fields.filter((I) => un(I, T.sex)).filter((I) => O.has(I.key));
4882
4885
  return b.length === 0 ? null : /* @__PURE__ */ d(
4883
4886
  "div",
@@ -4946,7 +4949,7 @@ function tr({
4946
4949
  label: n("anamnesis.compile.pathologiesLabel"),
4947
4950
  description: n("anamnesis.compile.pathologiesHelp"),
4948
4951
  children: /* @__PURE__ */ t(
4949
- ma,
4952
+ ua,
4950
4953
  {
4951
4954
  options: ei,
4952
4955
  value: S.pathologyCodes,
@@ -4972,7 +4975,7 @@ function tr({
4972
4975
  ie,
4973
4976
  {
4974
4977
  value: Cn.tumourType ?? "",
4975
- onChange: (y) => Q((b) => ({
4978
+ onChange: (y) => W((b) => ({
4976
4979
  ...b,
4977
4980
  oncological: {
4978
4981
  ...b.oncological,
@@ -4985,7 +4988,7 @@ function tr({
4985
4988
  ie,
4986
4989
  {
4987
4990
  value: Cn.stage ?? "",
4988
- onChange: (y) => Q((b) => ({
4991
+ onChange: (y) => W((b) => ({
4989
4992
  ...b,
4990
4993
  oncological: {
4991
4994
  ...b.oncological,
@@ -4999,8 +5002,8 @@ function tr({
4999
5002
  {
5000
5003
  label: n("anamnesis.field.metastases.label"),
5001
5004
  variant: "horizontal",
5002
- value: ((Fa = Cn.metastases) == null ? void 0 : Fa.present) ?? "unknown",
5003
- onValueChange: (y) => Q((b) => {
5005
+ value: ((La = Cn.metastases) == null ? void 0 : La.present) ?? "unknown",
5006
+ onValueChange: (y) => W((b) => {
5004
5007
  var I, K;
5005
5008
  return {
5006
5009
  ...b,
@@ -5034,7 +5037,7 @@ function tr({
5034
5037
  ie,
5035
5038
  {
5036
5039
  value: Cn.treatmentStatus ?? "",
5037
- onChange: (y) => Q((b) => ({
5040
+ onChange: (y) => W((b) => ({
5038
5041
  ...b,
5039
5042
  oncological: {
5040
5043
  ...b.oncological,
@@ -5062,7 +5065,7 @@ function tr({
5062
5065
  ie,
5063
5066
  {
5064
5067
  value: y.name,
5065
- onChange: (b) => La(y.id, {
5068
+ onChange: (b) => Ia(y.id, {
5066
5069
  name: b.target.value
5067
5070
  })
5068
5071
  }
@@ -5073,13 +5076,13 @@ function tr({
5073
5076
  ie,
5074
5077
  {
5075
5078
  value: y.dose ?? "",
5076
- onChange: (b) => La(y.id, {
5079
+ onChange: (b) => Ia(y.id, {
5077
5080
  dose: b.target.value
5078
5081
  })
5079
5082
  }
5080
5083
  ) }),
5081
5084
  /* @__PURE__ */ t(
5082
- J,
5085
+ X,
5083
5086
  {
5084
5087
  variant: y.kind === "medication" ? "info" : "neutral",
5085
5088
  size: "md",
@@ -5087,7 +5090,7 @@ function tr({
5087
5090
  }
5088
5091
  ),
5089
5092
  /* @__PURE__ */ t(
5090
- de,
5093
+ ce,
5091
5094
  {
5092
5095
  icon: /* @__PURE__ */ t(Ci, { "aria-hidden": "true" }),
5093
5096
  intent: "ghost",
@@ -5102,7 +5105,7 @@ function tr({
5102
5105
  y.id
5103
5106
  )),
5104
5107
  /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
5105
- ae,
5108
+ ne,
5106
5109
  {
5107
5110
  intent: "outline",
5108
5111
  size: "sm",
@@ -5161,7 +5164,7 @@ function tr({
5161
5164
  }
5162
5165
  ) }),
5163
5166
  /* @__PURE__ */ t(
5164
- J,
5167
+ X,
5165
5168
  {
5166
5169
  variant: y.completed ? "success" : "warning",
5167
5170
  size: "sm",
@@ -5186,7 +5189,7 @@ function tr({
5186
5189
  value: S.nutritionalProposal ?? "",
5187
5190
  autoResize: !0,
5188
5191
  minRows: 2,
5189
- onChange: (y) => Q((b) => ({
5192
+ onChange: (y) => W((b) => ({
5190
5193
  ...b,
5191
5194
  nutritionalProposal: y.target.value
5192
5195
  }))
@@ -5200,7 +5203,7 @@ function tr({
5200
5203
  value: S.clinicalNotes ?? "",
5201
5204
  autoResize: !0,
5202
5205
  minRows: 2,
5203
- onChange: (y) => Q((b) => ({
5206
+ onChange: (y) => W((b) => ({
5204
5207
  ...b,
5205
5208
  clinicalNotes: y.target.value
5206
5209
  }))
@@ -5222,7 +5225,7 @@ function tr({
5222
5225
  label: n("anamnesis.field.annualProposed.label"),
5223
5226
  variant: "horizontal",
5224
5227
  value: Tn.proposed ? "yes" : "no",
5225
- onValueChange: (y) => Q((b) => {
5228
+ onValueChange: (y) => W((b) => {
5226
5229
  var I, K;
5227
5230
  return {
5228
5231
  ...b,
@@ -5245,7 +5248,7 @@ function tr({
5245
5248
  label: n("anamnesis.field.annualAccepted.label"),
5246
5249
  variant: "horizontal",
5247
5250
  value: Tn.accepted ? "yes" : "no",
5248
- onValueChange: (y) => Q((b) => {
5251
+ onValueChange: (y) => W((b) => {
5249
5252
  var I, K;
5250
5253
  return {
5251
5254
  ...b,
@@ -5272,7 +5275,7 @@ function tr({
5272
5275
  value: Tn.declineReason ?? "",
5273
5276
  autoResize: !0,
5274
5277
  minRows: 2,
5275
- onChange: (y) => Q((b) => {
5278
+ onChange: (y) => W((b) => {
5276
5279
  var I, K;
5277
5280
  return {
5278
5281
  ...b,
@@ -5291,8 +5294,8 @@ function tr({
5291
5294
  }
5292
5295
  )
5293
5296
  ] }) }),
5294
- /* @__PURE__ */ t(Y.Content, { value: "evolution", children: /* @__PURE__ */ t("div", { className: "ds:pt-[var(--spacing-md)]", children: /* @__PURE__ */ t(ve, { titleKey: "anamnesis.section.evolution", t: n, children: /* @__PURE__ */ t(
5295
- Ca,
5297
+ /* @__PURE__ */ t(Q.Content, { value: "evolution", children: /* @__PURE__ */ t("div", { className: "ds:pt-[var(--spacing-md)]", children: /* @__PURE__ */ t(ve, { titleKey: "anamnesis.section.evolution", t: n, children: /* @__PURE__ */ t(
5298
+ Na,
5296
5299
  {
5297
5300
  record: C,
5298
5301
  t: n,
@@ -5300,7 +5303,7 @@ function tr({
5300
5303
  config: i,
5301
5304
  framed: !1,
5302
5305
  onCellChange: Je,
5303
- onVisitSelectionChange: ue,
5306
+ onVisitSelectionChange: de,
5304
5307
  onOpenNote: l
5305
5308
  }
5306
5309
  ) }) }) })
@@ -5308,15 +5311,15 @@ function tr({
5308
5311
  }
5309
5312
  ) }) })
5310
5313
  ] });
5311
- return /* @__PURE__ */ t(Xa, { embedded: a, children: ni });
5314
+ return /* @__PURE__ */ t(Qa, { embedded: a, children: ni });
5312
5315
  }
5313
- function Xa({
5316
+ function Qa({
5314
5317
  embedded: e,
5315
5318
  children: n
5316
5319
  }) {
5317
5320
  return e ? /* @__PURE__ */ t("div", { className: "ds:flex ds:w-full ds:flex-col ds:gap-[var(--spacing-lg)]", children: n }) : /* @__PURE__ */ t("div", { className: "ds:min-h-[100dvh] ds:w-full ds:bg-[color:var(--app-shell-background)] ds:py-[var(--spacing-lg)]", children: /* @__PURE__ */ t("div", { className: "ds:mx-auto ds:flex ds:w-full ds:max-w-[76rem] ds:flex-col ds:gap-[var(--spacing-lg)] ds:px-[var(--spacing-md)]", children: n }) });
5318
5321
  }
5319
- function Jn(e) {
5322
+ function Ya(e) {
5320
5323
  var i;
5321
5324
  const n = {}, a = ((i = e.intake) == null ? void 0 : i.answers) ?? {};
5322
5325
  for (const [s, o] of Object.entries(a))
@@ -5333,38 +5336,33 @@ function Kt({
5333
5336
  jumpToField: r,
5334
5337
  readOnly: l = !1
5335
5338
  }) {
5336
- const { patient: c } = e, u = qn(e), [h, g] = z(() => Jn(e)), [p, k] = z(
5339
+ const { patient: c } = e, u = qn(e), [h, g] = z(() => Ya(e)), [p, k] = z(
5337
5340
  () => {
5338
5341
  var M;
5339
5342
  return ((M = e.intake) == null ? void 0 : M.submittedAtIso) != null;
5340
5343
  }
5341
5344
  ), v = (M, U) => {
5342
- g((W) => ({ ...W, [M]: U }));
5345
+ g((Y) => ({ ...Y, [M]: U }));
5343
5346
  }, f = q(
5344
- () => fa(i).map((M) => ({
5347
+ () => ga(i).map((M) => ({
5345
5348
  ...M,
5346
5349
  fields: M.fields.filter((U) => un(U, c.sex))
5347
5350
  })).filter((M) => M.fields.length > 0),
5348
5351
  [i, c.sex]
5349
- ), C = (M) => {
5350
- var Z;
5351
- const U = /* @__PURE__ */ new Set(), W = s ?? ((Z = f[0]) == null ? void 0 : Z.key);
5352
- W && U.add(W);
5353
- for (const se of f)
5354
- se.fields.some(
5355
- (X) => Ra(X, M[X.key])
5356
- ) && U.add(se.key);
5357
- return [...U];
5352
+ ), C = () => {
5353
+ var U;
5354
+ const M = s ?? ((U = f[0]) == null ? void 0 : U.key);
5355
+ return M ? [M] : [];
5358
5356
  }, [w, A] = z(
5359
- () => C(Jn(e))
5360
- ), R = (M) => A((U) => U.includes(M) ? U : [...U, M]), [T, L] = z(e.intake);
5357
+ () => C()
5358
+ ), L = (M) => A((U) => U.includes(M) ? U : [...U, M]), [T, R] = z(e.intake);
5361
5359
  if (e.intake !== T) {
5362
- L(e.intake);
5363
- const M = Jn(e);
5364
- g(M), A(C(M));
5360
+ R(e.intake);
5361
+ const M = Ya(e);
5362
+ g(M), A(C());
5365
5363
  }
5366
- const { containerRef: S, requestJump: m } = vt(), N = q(
5367
- () => ft(
5364
+ const { containerRef: S, requestJump: m } = ft(), N = q(
5365
+ () => gt(
5368
5366
  f,
5369
5367
  (M) => h[M],
5370
5368
  c.sex,
@@ -5372,20 +5370,20 @@ function Kt({
5372
5370
  ),
5373
5371
  [f, h, c.sex, n]
5374
5372
  ), x = (M) => {
5375
- R(M.sectionKey), m(M.key);
5373
+ L(M.sectionKey), m(M.key);
5376
5374
  };
5377
5375
  on(() => {
5378
5376
  if (!r) return;
5379
5377
  const M = f.find(
5380
- (U) => U.fields.some((W) => W.key === r)
5378
+ (U) => U.fields.some((Y) => Y.key === r)
5381
5379
  );
5382
- M && (R(M.key), m(r));
5380
+ M && (L(M.key), m(r));
5383
5381
  }, [r]);
5384
5382
  const { answeredCount: P, totalCount: $ } = q(() => {
5385
5383
  let M = 0, U = 0;
5386
- for (const W of f)
5387
- for (const Z of W.fields)
5388
- U += 1, Xe(h[Z.key]) && (M += 1);
5384
+ for (const Y of f)
5385
+ for (const ae of Y.fields)
5386
+ U += 1, Xe(h[ae.key]) && (M += 1);
5389
5387
  return { answeredCount: M, totalCount: U };
5390
5388
  }, [f, h]), F = $ === 0 ? 0 : Math.round(P / $ * 100), E = n("anamnesis.intake.answered", {
5391
5389
  answered: P,
@@ -5445,7 +5443,7 @@ function Kt({
5445
5443
  )
5446
5444
  ] }),
5447
5445
  H ? /* @__PURE__ */ t(
5448
- yt,
5446
+ vt,
5449
5447
  {
5450
5448
  missing: N,
5451
5449
  t: n,
@@ -5453,7 +5451,7 @@ function Kt({
5453
5451
  announce: "off"
5454
5452
  }
5455
5453
  ) : null,
5456
- /* @__PURE__ */ t(me, { variant: "elevated", children: /* @__PURE__ */ t(me.Body, { ref: S, children: /* @__PURE__ */ d(
5454
+ /* @__PURE__ */ t(ue, { variant: "elevated", children: /* @__PURE__ */ t(ue.Body, { ref: S, children: /* @__PURE__ */ d(
5457
5455
  "section",
5458
5456
  {
5459
5457
  "aria-label": n("anamnesis.intake.sectionsLabel"),
@@ -5477,7 +5475,7 @@ function Kt({
5477
5475
  onValueChange: A,
5478
5476
  children: f.map((M) => {
5479
5477
  const U = M.fields.filter(
5480
- (W) => Xe(h[W.key])
5478
+ (Y) => Xe(h[Y.key])
5481
5479
  ).length;
5482
5480
  return /* @__PURE__ */ d(Si, { value: M.key, children: [
5483
5481
  /* @__PURE__ */ t(Ai, { children: /* @__PURE__ */ d("span", { className: "ds:flex ds:w-full ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
@@ -5487,16 +5485,16 @@ function Kt({
5487
5485
  total: M.fields.length
5488
5486
  }) })
5489
5487
  ] }) }),
5490
- /* @__PURE__ */ t(Ei, { children: /* @__PURE__ */ t("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", children: M.fields.map((W) => /* @__PURE__ */ t(
5488
+ /* @__PURE__ */ t(Ei, { children: /* @__PURE__ */ t("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", children: M.fields.map((Y) => /* @__PURE__ */ t(
5491
5489
  qt,
5492
5490
  {
5493
5491
  readOnly: l,
5494
- def: W,
5495
- answer: h[W.key],
5496
- onChange: (Z) => v(W.key, Z),
5492
+ def: Y,
5493
+ answer: h[Y.key],
5494
+ onChange: (ae) => v(Y.key, ae),
5497
5495
  t: n
5498
5496
  },
5499
- W.key
5497
+ Y.key
5500
5498
  )) }) })
5501
5499
  ] }, M.key);
5502
5500
  })
@@ -5515,7 +5513,7 @@ function Kt({
5515
5513
  }
5516
5514
  ),
5517
5515
  /* @__PURE__ */ t("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: /* @__PURE__ */ t(
5518
- ae,
5516
+ ne,
5519
5517
  {
5520
5518
  intent: "primary",
5521
5519
  startIcon: /* @__PURE__ */ t(_i, { "aria-hidden": "true" }),
@@ -5540,7 +5538,7 @@ function xe({
5540
5538
  a
5541
5539
  ] });
5542
5540
  }
5543
- function Zn({
5541
+ function Jn({
5544
5542
  defs: e,
5545
5543
  visit: n,
5546
5544
  previous: a,
@@ -5557,7 +5555,7 @@ function Zn({
5557
5555
  ] }),
5558
5556
  /* @__PURE__ */ t(_.Detail, { children: /* @__PURE__ */ d("span", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)] ds:tabular-nums", children: [
5559
5557
  /* @__PURE__ */ t("span", { className: "ds:text-[color:var(--foreground)]", children: Ee(l, r.precision, o) }),
5560
- h ? /* @__PURE__ */ t(xa, { flag: h, t: s }) : null,
5558
+ h ? /* @__PURE__ */ t(ba, { flag: h, t: s }) : null,
5561
5559
  /* @__PURE__ */ t(Un, { delta: u, def: r, t: s }),
5562
5560
  g != null ? /* @__PURE__ */ t("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: s("anamnesis.grid.target", {
5563
5561
  value: Ee(g, r.precision, o),
@@ -5578,7 +5576,7 @@ function ir({
5578
5576
  e.targets.map((A) => [A.parameterKey, A.target])
5579
5577
  ), h = _e(i, "anthropometric"), g = _e(i, "dietary"), p = _e(i, "lab"), k = Ge(i), v = zn(i);
5580
5578
  if (!l)
5581
- return /* @__PURE__ */ t(Ja, { embedded: a, children: /* @__PURE__ */ t(me, { variant: "elevated", children: /* @__PURE__ */ t(me.Body, { children: /* @__PURE__ */ t(
5579
+ return /* @__PURE__ */ t(Xa, { embedded: a, children: /* @__PURE__ */ t(ue, { variant: "elevated", children: /* @__PURE__ */ t(ue.Body, { children: /* @__PURE__ */ t(
5582
5580
  Ue,
5583
5581
  {
5584
5582
  variant: "first-use",
@@ -5596,7 +5594,7 @@ function ir({
5596
5594
  ] }),
5597
5595
  /* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: n("anamnesis.readOnly.subtitle") })
5598
5596
  ] }),
5599
- /* @__PURE__ */ t(me, { variant: "elevated", children: /* @__PURE__ */ d(me.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", children: [
5597
+ /* @__PURE__ */ t(ue, { variant: "elevated", children: /* @__PURE__ */ d(ue.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", children: [
5600
5598
  /* @__PURE__ */ t(xe, { titleKey: "anamnesis.readOnly.summary", t: n, children: /* @__PURE__ */ d(
5601
5599
  _,
5602
5600
  {
@@ -5636,7 +5634,7 @@ function ir({
5636
5634
  }
5637
5635
  ) }),
5638
5636
  /* @__PURE__ */ t(xe, { titleKey: "anamnesis.section.anthropometrics", t: n, children: /* @__PURE__ */ t(
5639
- Zn,
5637
+ Jn,
5640
5638
  {
5641
5639
  defs: h,
5642
5640
  visit: l,
@@ -5646,7 +5644,7 @@ function ir({
5646
5644
  }
5647
5645
  ) }),
5648
5646
  g.length > 0 ? /* @__PURE__ */ t(xe, { titleKey: "anamnesis.section.dietary", t: n, children: /* @__PURE__ */ t(
5649
- Zn,
5647
+ Jn,
5650
5648
  {
5651
5649
  defs: g,
5652
5650
  visit: l,
@@ -5655,7 +5653,7 @@ function ir({
5655
5653
  t: n
5656
5654
  }
5657
5655
  ) }) : null,
5658
- /* @__PURE__ */ t(xe, { titleKey: "anamnesis.section.pathologies", t: n, children: l.pathologyCodes.length > 0 ? /* @__PURE__ */ t("div", { className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-xs)]", children: l.pathologyCodes.map((A) => /* @__PURE__ */ t(J, { variant: "neutral", size: "md", children: Se(A, n, v[A]) }, A)) }) : /* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: n("anamnesis.readOnly.none") }) }),
5656
+ /* @__PURE__ */ t(xe, { titleKey: "anamnesis.section.pathologies", t: n, children: l.pathologyCodes.length > 0 ? /* @__PURE__ */ t("div", { className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-xs)]", children: l.pathologyCodes.map((A) => /* @__PURE__ */ t(X, { variant: "neutral", size: "md", children: Se(A, n, v[A]) }, A)) }) : /* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: n("anamnesis.readOnly.none") }) }),
5659
5657
  f ? /* @__PURE__ */ t(xe, { titleKey: "anamnesis.section.oncological", t: n, children: /* @__PURE__ */ d(
5660
5658
  _,
5661
5659
  {
@@ -5686,7 +5684,7 @@ function ir({
5686
5684
  /* @__PURE__ */ t("span", { className: "type-label ds:text-[color:var(--foreground)]", children: A.name }),
5687
5685
  A.dose ? /* @__PURE__ */ t("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: A.dose }) : null,
5688
5686
  /* @__PURE__ */ t(
5689
- J,
5687
+ X,
5690
5688
  {
5691
5689
  variant: A.kind === "medication" ? "info" : "neutral",
5692
5690
  size: "sm",
@@ -5698,7 +5696,7 @@ function ir({
5698
5696
  A.id
5699
5697
  )) }) : /* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: n("anamnesis.readOnly.none") }) }),
5700
5698
  /* @__PURE__ */ t(xe, { titleKey: "anamnesis.section.labs", t: n, children: /* @__PURE__ */ t(
5701
- Zn,
5699
+ Jn,
5702
5700
  {
5703
5701
  defs: p,
5704
5702
  visit: l,
@@ -5719,7 +5717,7 @@ function ir({
5719
5717
  ] }) : null,
5720
5718
  C ? /* @__PURE__ */ t(xe, { titleKey: "anamnesis.section.annual", t: n, children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-xs)]", children: [
5721
5719
  /* @__PURE__ */ d(
5722
- J,
5720
+ X,
5723
5721
  {
5724
5722
  variant: C.proposed ? "success" : "neutral",
5725
5723
  size: "md",
@@ -5733,7 +5731,7 @@ function ir({
5733
5731
  }
5734
5732
  ),
5735
5733
  /* @__PURE__ */ d(
5736
- J,
5734
+ X,
5737
5735
  {
5738
5736
  variant: C.accepted ? "success" : "neutral",
5739
5737
  size: "md",
@@ -5748,7 +5746,7 @@ function ir({
5748
5746
  )
5749
5747
  ] }) }) : null,
5750
5748
  e.intake && Object.keys(e.intake.answers).length > 0 ? /* @__PURE__ */ t(xe, { titleKey: "anamnesis.section.patientIntake", t: n, children: /* @__PURE__ */ t(
5751
- wt,
5749
+ kt,
5752
5750
  {
5753
5751
  intake: e.intake,
5754
5752
  sections: k,
@@ -5757,7 +5755,7 @@ function ir({
5757
5755
  }
5758
5756
  ) }) : null,
5759
5757
  /* @__PURE__ */ t(xe, { titleKey: "anamnesis.section.evolution", t: n, children: /* @__PURE__ */ t(
5760
- Ca,
5758
+ Na,
5761
5759
  {
5762
5760
  record: e,
5763
5761
  t: n,
@@ -5768,9 +5766,9 @@ function ir({
5768
5766
  ) })
5769
5767
  ] }) })
5770
5768
  ] });
5771
- return /* @__PURE__ */ t(Ja, { embedded: a, children: w });
5769
+ return /* @__PURE__ */ t(Xa, { embedded: a, children: w });
5772
5770
  }
5773
- function Ja({
5771
+ function Xa({
5774
5772
  embedded: e,
5775
5773
  children: n
5776
5774
  }) {
@@ -5785,7 +5783,7 @@ function hn({
5785
5783
  primaryAction: s,
5786
5784
  secondaryAction: o
5787
5785
  }) {
5788
- return /* @__PURE__ */ t(me, { variant: "elevated", "data-testid": n, children: /* @__PURE__ */ t(me.Body, { children: /* @__PURE__ */ t(
5786
+ return /* @__PURE__ */ t(ue, { variant: "elevated", "data-testid": n, children: /* @__PURE__ */ t(ue.Body, { children: /* @__PURE__ */ t(
5789
5787
  Ue,
5790
5788
  {
5791
5789
  variant: e,
@@ -5820,10 +5818,10 @@ function Ht({
5820
5818
  var F;
5821
5819
  return f ?? ((F = c[0]) == null ? void 0 : F.value) ?? "questionnaire";
5822
5820
  }
5823
- ), A = k ?? C, R = (F) => {
5821
+ ), A = k ?? C, L = (F) => {
5824
5822
  k === void 0 && w(F), v == null || v(F);
5825
- }, [T, L] = z(e), [S, m] = z(e);
5826
- e !== S && (m(e), L(e));
5823
+ }, [T, R] = z(e), [S, m] = z(e);
5824
+ e !== S && (m(e), R(e));
5827
5825
  const N = q(
5828
5826
  () => new Map(T.targets.map((F) => [F.parameterKey, F.target])),
5829
5827
  [T.targets]
@@ -5831,7 +5829,7 @@ function Ht({
5831
5829
  () => _e(a),
5832
5830
  [a]
5833
5831
  ), $ = (F, E) => {
5834
- L((H) => ut(H, F.key, E)), r == null || r(F.key, E);
5832
+ R((H) => dt(H, F.key, E)), r == null || r(F.key, E);
5835
5833
  };
5836
5834
  return (
5837
5835
  // The goals strip and the tabs are two objects, not one run-on block: an
@@ -5848,17 +5846,17 @@ function Ht({
5848
5846
  onTargetChange: $
5849
5847
  }
5850
5848
  ),
5851
- /* @__PURE__ */ d(Y, { value: A, onValueChange: R, children: [
5849
+ /* @__PURE__ */ d(Q, { value: A, onValueChange: L, children: [
5852
5850
  /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
5853
- /* @__PURE__ */ d(Y.List, { "aria-label": n("anamnesis.compile.viewsLabel"), children: [
5854
- c.map((F) => /* @__PURE__ */ t(Y.Trigger, { value: F.value, children: F.label }, F.value)),
5855
- /* @__PURE__ */ t(Y.Trigger, { value: "questionnaire", children: n("anamnesis.compile.tabCompile") }),
5856
- /* @__PURE__ */ t(Y.Trigger, { value: "trend", children: n("anamnesis.compile.tabEvolution") })
5851
+ /* @__PURE__ */ d(Q.List, { "aria-label": n("anamnesis.compile.viewsLabel"), children: [
5852
+ c.map((F) => /* @__PURE__ */ t(Q.Trigger, { value: F.value, children: F.label }, F.value)),
5853
+ /* @__PURE__ */ t(Q.Trigger, { value: "questionnaire", children: n("anamnesis.compile.tabCompile") }),
5854
+ /* @__PURE__ */ t(Q.Trigger, { value: "trend", children: n("anamnesis.compile.tabEvolution") })
5857
5855
  ] }),
5858
5856
  o ? /* @__PURE__ */ t("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: o }) : null
5859
5857
  ] }),
5860
5858
  c.map((F) => /* @__PURE__ */ t(
5861
- Y.Content,
5859
+ Q.Content,
5862
5860
  {
5863
5861
  value: F.value,
5864
5862
  forceMount: !0,
@@ -5868,7 +5866,7 @@ function Ht({
5868
5866
  F.value
5869
5867
  )),
5870
5868
  /* @__PURE__ */ t(
5871
- Y.Content,
5869
+ Q.Content,
5872
5870
  {
5873
5871
  value: "questionnaire",
5874
5872
  forceMount: !0,
@@ -5891,7 +5889,7 @@ function Ht({
5891
5889
  }
5892
5890
  ),
5893
5891
  /* @__PURE__ */ t(
5894
- Y.Content,
5892
+ Q.Content,
5895
5893
  {
5896
5894
  value: "trend",
5897
5895
  forceMount: p ? !0 : void 0,
@@ -5920,8 +5918,8 @@ function Ht({
5920
5918
  typed into the grid — one place to answer a question. The
5921
5919
  same elevated card as the questionnaire's sections, so the
5922
5920
  grid is not the one surface sitting bare on the page. */
5923
- /* @__PURE__ */ t(me, { variant: "elevated", children: /* @__PURE__ */ t(me.Body, { children: /* @__PURE__ */ t(
5924
- Ca,
5921
+ /* @__PURE__ */ t(ue, { variant: "elevated", children: /* @__PURE__ */ t(ue.Body, { children: /* @__PURE__ */ t(
5922
+ Na,
5925
5923
  {
5926
5924
  record: T,
5927
5925
  t: n,
@@ -5957,9 +5955,9 @@ function El({
5957
5955
  questionnaireTab: C,
5958
5956
  onQuestionnaireTabChange: w,
5959
5957
  questionnaireSlot: A,
5960
- questionnaireHeaderSlot: R,
5958
+ questionnaireHeaderSlot: L,
5961
5959
  emptyState: T,
5962
- defaultQuestionnaireTab: L,
5960
+ defaultQuestionnaireTab: R,
5963
5961
  practitioners: S,
5964
5962
  newVisitDateIso: m,
5965
5963
  defaultView: N,
@@ -5992,10 +5990,10 @@ function El({
5992
5990
  leadingTabs: f,
5993
5991
  tab: C,
5994
5992
  onTabChange: w,
5995
- defaultTab: L,
5993
+ defaultTab: R,
5996
5994
  readOnly: p,
5997
5995
  questionnaireSlot: A,
5998
- questionnaireHeaderSlot: R,
5996
+ questionnaireHeaderSlot: L,
5999
5997
  emptyState: T
6000
5998
  }
6001
5999
  ) : e === "compile" ? /* @__PURE__ */ t(
@@ -6049,7 +6047,7 @@ function El({
6049
6047
  }
6050
6048
  );
6051
6049
  }
6052
- const or = nt("", {
6050
+ const or = et("", {
6053
6051
  variants: {
6054
6052
  dragging: {
6055
6053
  true: "ds:opacity-60",
@@ -6062,7 +6060,7 @@ const or = nt("", {
6062
6060
  },
6063
6061
  defaultVariants: { dragging: !1, dropTarget: !1 }
6064
6062
  }), Gt = si(null);
6065
- function ea({
6063
+ function Zn({
6066
6064
  count: e,
6067
6065
  onReorder: n,
6068
6066
  t: a,
@@ -6079,7 +6077,7 @@ function ea({
6079
6077
  /* @__PURE__ */ t("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: r })
6080
6078
  ] });
6081
6079
  }
6082
- function na({
6080
+ function ea({
6083
6081
  index: e,
6084
6082
  label: n,
6085
6083
  children: a
@@ -6122,7 +6120,7 @@ function na({
6122
6120
  dropTarget: s && !u
6123
6121
  })
6124
6122
  }, g = /* @__PURE__ */ t(
6125
- de,
6123
+ ce,
6126
6124
  {
6127
6125
  size: "sm",
6128
6126
  intent: "ghost",
@@ -6149,7 +6147,7 @@ function Dl() {
6149
6147
  }))
6150
6148
  };
6151
6149
  }
6152
- function aa(e, n) {
6150
+ function na(e, n) {
6153
6151
  const a = e.normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[^a-zA-Z0-9]+/g, " ").trim().split(/\s+/).filter(Boolean), i = a.length === 0 ? "entry" : a.map(
6154
6152
  (r, l) => l === 0 ? r.toLowerCase() : r[0].toUpperCase() + r.slice(1).toLowerCase()
6155
6153
  ).join("");
@@ -6158,7 +6156,7 @@ function aa(e, n) {
6158
6156
  s = `${i}${o}`, o += 1;
6159
6157
  return s;
6160
6158
  }
6161
- function ta(e, n, a) {
6159
+ function aa(e, n, a) {
6162
6160
  if (n === a || n < 0 || n >= e.length || a < 0 || a >= e.length) return null;
6163
6161
  const i = [...e], [s] = i.splice(n, 1);
6164
6162
  return i.splice(a, 0, s), i;
@@ -6183,7 +6181,7 @@ function jt(e, n) {
6183
6181
  const a = e.type === "number" ? e.decimal ? "numberDecimal" : "numberInteger" : e.type === "choice" && e.detail ? "choiceWithText" : e.type;
6184
6182
  return n(`anamnesis.configEditor.type.${a}`);
6185
6183
  }
6186
- const cr = ["down", "up", "toRange"], ca = ["anthropometric", "dietary", "lab"];
6184
+ const cr = ["down", "up", "toRange"], la = ["anthropometric", "dietary", "lab"];
6187
6185
  function Il({
6188
6186
  config: e,
6189
6187
  onConfigChange: n,
@@ -6201,14 +6199,14 @@ function Il({
6201
6199
  )
6202
6200
  } : P
6203
6201
  ), g = (m) => n({ ...e, pathologies: e.pathologies.map(m) }), p = (m, N, x) => {
6204
- const P = _e(e, m), $ = ta(P, N, x);
6202
+ const P = _e(e, m), $ = aa(P, N, x);
6205
6203
  if (!$) return;
6206
6204
  const F = new Map($.map((E, H) => [E.key, H]));
6207
6205
  c(
6208
6206
  (E) => F.has(E.key) ? { ...E, order: F.get(E.key) } : E
6209
6207
  );
6210
6208
  }, k = (m, N) => {
6211
- const x = ta(Ge(e), m, N);
6209
+ const x = aa(Ge(e), m, N);
6212
6210
  if (!x) return;
6213
6211
  const P = new Map(
6214
6212
  x.map(($, F) => [$.key, F])
@@ -6217,7 +6215,7 @@ function Il({
6217
6215
  ($) => P.has($.key) ? { ...$, order: P.get($.key) } : $
6218
6216
  );
6219
6217
  }, v = (m, N, x) => {
6220
- const P = ta(m.fields, N, x);
6218
+ const P = aa(m.fields, N, x);
6221
6219
  if (!P) return;
6222
6220
  const $ = new Map(
6223
6221
  P.map((F, E) => [F.key, E])
@@ -6241,13 +6239,13 @@ function Il({
6241
6239
  })) : g(
6242
6240
  (x) => x.code === m.entry.code ? { ...x, enabled: N } : x
6243
6241
  );
6244
- }, C = Ne(e).length, w = _e(e).length, A = fa(e).reduce(
6242
+ }, C = Ne(e).length, w = _e(e).length, A = ga(e).reduce(
6245
6243
  (m, N) => m + N.fields.length,
6246
6244
  0
6247
- ), R = Ge(e).reduce(
6245
+ ), L = Ge(e).reduce(
6248
6246
  (m, N) => m + N.fields.length,
6249
6247
  0
6250
- ), T = lt(e).length, L = oa(e).length, S = Ne(e).filter(
6248
+ ), T = rt(e).length, R = sa(e).length, S = Ne(e).filter(
6251
6249
  (m) => m.goal === !0
6252
6250
  ).length;
6253
6251
  return /* @__PURE__ */ d(
@@ -6261,23 +6259,23 @@ function Il({
6261
6259
  /* @__PURE__ */ t("h2", { className: "type-title-section ds:m-0 ds:text-[color:var(--foreground)]", children: a("anamnesis.configEditor.title") }),
6262
6260
  /* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: a("anamnesis.configEditor.intro") })
6263
6261
  ] }),
6264
- /* @__PURE__ */ t(me, { variant: "elevated", children: /* @__PURE__ */ t(me.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: /* @__PURE__ */ d(Y, { defaultValue: "questionnaire", children: [
6265
- /* @__PURE__ */ d(Y.List, { "aria-label": a("anamnesis.configEditor.tabsLabel"), children: [
6266
- /* @__PURE__ */ t(Y.Trigger, { value: "questionnaire", children: a("anamnesis.configEditor.tabQuestionnaire") }),
6267
- /* @__PURE__ */ t(Y.Trigger, { value: "parameters", children: a("anamnesis.configEditor.tabParameters") }),
6268
- /* @__PURE__ */ t(Y.Trigger, { value: "pathologies", children: a("anamnesis.configEditor.tabPathologies") }),
6269
- /* @__PURE__ */ t(Y.Trigger, { value: "targets", children: a("anamnesis.configEditor.tabTargets") })
6262
+ /* @__PURE__ */ t(ue, { variant: "elevated", children: /* @__PURE__ */ t(ue.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: /* @__PURE__ */ d(Q, { defaultValue: "questionnaire", children: [
6263
+ /* @__PURE__ */ d(Q.List, { "aria-label": a("anamnesis.configEditor.tabsLabel"), children: [
6264
+ /* @__PURE__ */ t(Q.Trigger, { value: "questionnaire", children: a("anamnesis.configEditor.tabQuestionnaire") }),
6265
+ /* @__PURE__ */ t(Q.Trigger, { value: "parameters", children: a("anamnesis.configEditor.tabParameters") }),
6266
+ /* @__PURE__ */ t(Q.Trigger, { value: "pathologies", children: a("anamnesis.configEditor.tabPathologies") }),
6267
+ /* @__PURE__ */ t(Q.Trigger, { value: "targets", children: a("anamnesis.configEditor.tabTargets") })
6270
6268
  ] }),
6271
- /* @__PURE__ */ t(Y.Content, { value: "questionnaire", children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)] ds:pt-[var(--spacing-md)]", children: [
6269
+ /* @__PURE__ */ t(Q.Content, { value: "questionnaire", children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)] ds:pt-[var(--spacing-md)]", children: [
6272
6270
  /* @__PURE__ */ t("p", { className: "type-meta ds:m-0 ds:text-[color:var(--muted-foreground)]", children: `${a("anamnesis.configEditor.panelLive", {
6273
6271
  count: A
6274
6272
  })} · ${a("anamnesis.configEditor.panelNotCaptured", {
6275
6273
  // Not "archived": this also counts live questions inside
6276
6274
  // an archived section, which capture drops as a whole.
6277
- count: R - A
6275
+ count: L - A
6278
6276
  })}` }),
6279
6277
  /* @__PURE__ */ t(
6280
- ea,
6278
+ Zn,
6281
6279
  {
6282
6280
  count: Ge(e).length,
6283
6281
  onReorder: k,
@@ -6288,7 +6286,7 @@ function Il({
6288
6286
  ($) => $.enabled !== !1
6289
6287
  ).length;
6290
6288
  return /* @__PURE__ */ t(
6291
- na,
6289
+ ea,
6292
6290
  {
6293
6291
  index: N,
6294
6292
  label: fe(m, a),
@@ -6307,7 +6305,7 @@ function Il({
6307
6305
  children: [
6308
6306
  /* @__PURE__ */ d("h3", { className: "type-title-item ds:m-0 ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:text-[color:var(--foreground)]", children: [
6309
6307
  fe(m, a),
6310
- x ? /* @__PURE__ */ t(J, { size: "sm", variant: "neutral", children: a("anamnesis.configEditor.archived") }) : null
6308
+ x ? /* @__PURE__ */ t(X, { size: "sm", variant: "neutral", children: a("anamnesis.configEditor.archived") }) : null
6311
6309
  ] }),
6312
6310
  /* @__PURE__ */ d(
6313
6311
  Sn,
@@ -6321,7 +6319,7 @@ function Il({
6321
6319
  children: [
6322
6320
  F,
6323
6321
  /* @__PURE__ */ t(
6324
- de,
6322
+ ce,
6325
6323
  {
6326
6324
  size: "sm",
6327
6325
  intent: "ghost",
@@ -6339,7 +6337,7 @@ function Il({
6339
6337
  }
6340
6338
  ),
6341
6339
  x ? /* @__PURE__ */ t(
6342
- de,
6340
+ ce,
6343
6341
  {
6344
6342
  size: "sm",
6345
6343
  intent: "ghost",
@@ -6354,7 +6352,7 @@ function Il({
6354
6352
  )
6355
6353
  }
6356
6354
  ) : /* @__PURE__ */ t(
6357
- de,
6355
+ ce,
6358
6356
  {
6359
6357
  size: "sm",
6360
6358
  intent: "ghost",
@@ -6379,13 +6377,13 @@ function Il({
6379
6377
  "anamnesis.configEditor.sectionEmptyCapture"
6380
6378
  ) }) : null,
6381
6379
  m.fields.length > 0 ? /* @__PURE__ */ t(
6382
- ea,
6380
+ Zn,
6383
6381
  {
6384
6382
  count: m.fields.length,
6385
6383
  onReorder: (E, H) => v(m, E, H),
6386
6384
  t: a,
6387
6385
  children: /* @__PURE__ */ t(en, { divider: "divided", children: m.fields.map((E, H) => /* @__PURE__ */ t(
6388
- na,
6386
+ ea,
6389
6387
  {
6390
6388
  index: H,
6391
6389
  label: ge(E, a),
@@ -6396,7 +6394,7 @@ function Il({
6396
6394
  title: /* @__PURE__ */ d("span", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
6397
6395
  ge(E, a),
6398
6396
  E.required === !0 ? /* @__PURE__ */ t(
6399
- J,
6397
+ X,
6400
6398
  {
6401
6399
  size: "sm",
6402
6400
  variant: "info",
@@ -6406,7 +6404,7 @@ function Il({
6406
6404
  }
6407
6405
  ) : null,
6408
6406
  E.enabled === !1 ? /* @__PURE__ */ t(
6409
- J,
6407
+ X,
6410
6408
  {
6411
6409
  size: "sm",
6412
6410
  variant: "neutral",
@@ -6418,7 +6416,7 @@ function Il({
6418
6416
  ] }),
6419
6417
  description: [
6420
6418
  jt(E, a),
6421
- gt(E, a)
6419
+ ht(E, a)
6422
6420
  ].filter(Boolean).join(" · "),
6423
6421
  trailing: /* @__PURE__ */ d(
6424
6422
  Sn,
@@ -6435,7 +6433,7 @@ function Il({
6435
6433
  children: [
6436
6434
  M,
6437
6435
  /* @__PURE__ */ t(
6438
- de,
6436
+ ce,
6439
6437
  {
6440
6438
  size: "sm",
6441
6439
  intent: "ghost",
@@ -6457,7 +6455,7 @@ function Il({
6457
6455
  }
6458
6456
  ),
6459
6457
  E.enabled === !1 ? /* @__PURE__ */ t(
6460
- de,
6458
+ ce,
6461
6459
  {
6462
6460
  size: "sm",
6463
6461
  intent: "ghost",
@@ -6481,7 +6479,7 @@ function Il({
6481
6479
  )
6482
6480
  }
6483
6481
  ) : /* @__PURE__ */ t(
6484
- de,
6482
+ ce,
6485
6483
  {
6486
6484
  size: "sm",
6487
6485
  intent: "ghost",
@@ -6516,7 +6514,7 @@ function Il({
6516
6514
  }
6517
6515
  ) : null,
6518
6516
  /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
6519
- ae,
6517
+ ne,
6520
6518
  {
6521
6519
  intent: "ghost",
6522
6520
  size: "sm",
@@ -6537,7 +6535,7 @@ function Il({
6537
6535
  }
6538
6536
  ),
6539
6537
  /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
6540
- ae,
6538
+ ne,
6541
6539
  {
6542
6540
  intent: "outline",
6543
6541
  size: "sm",
@@ -6547,13 +6545,13 @@ function Il({
6547
6545
  }
6548
6546
  ) })
6549
6547
  ] }) }),
6550
- /* @__PURE__ */ t(Y.Content, { value: "parameters", children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)] ds:pt-[var(--spacing-md)]", children: [
6548
+ /* @__PURE__ */ t(Q.Content, { value: "parameters", children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)] ds:pt-[var(--spacing-md)]", children: [
6551
6549
  /* @__PURE__ */ t("p", { className: "type-meta ds:m-0 ds:text-[color:var(--muted-foreground)]", children: `${a("anamnesis.configEditor.panelLive", {
6552
6550
  count: C
6553
6551
  })} · ${a("anamnesis.configEditor.panelArchived", {
6554
6552
  count: w - C
6555
6553
  })}` }),
6556
- ca.map((m) => {
6554
+ la.map((m) => {
6557
6555
  const N = _e(
6558
6556
  e,
6559
6557
  m
@@ -6565,7 +6563,7 @@ function Il({
6565
6563
  children: [
6566
6564
  /* @__PURE__ */ t("h3", { className: "type-title-item ds:m-0 ds:text-[color:var(--foreground)]", children: a(`anamnesis.group.${m}`) }),
6567
6565
  /* @__PURE__ */ t(
6568
- ea,
6566
+ Zn,
6569
6567
  {
6570
6568
  count: N.length,
6571
6569
  onReorder: (x, P) => p(m, x, P),
@@ -6579,7 +6577,7 @@ function Il({
6579
6577
  x.locked ? a("anamnesis.configEditor.lockedHint") : null
6580
6578
  ].filter(Boolean).join(" · ");
6581
6579
  return /* @__PURE__ */ t(
6582
- na,
6580
+ ea,
6583
6581
  {
6584
6582
  index: P,
6585
6583
  label: Te(x, a),
@@ -6590,15 +6588,15 @@ function Il({
6590
6588
  title: /* @__PURE__ */ d("span", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
6591
6589
  Te(x, a),
6592
6590
  x.locked ? /* @__PURE__ */ t(
6593
- J,
6591
+ X,
6594
6592
  {
6595
6593
  size: "sm",
6596
6594
  variant: "neutral",
6597
- leading: /* @__PURE__ */ t(Ri, { "aria-hidden": "true" }),
6595
+ leading: /* @__PURE__ */ t(Li, { "aria-hidden": "true" }),
6598
6596
  children: a("anamnesis.configEditor.locked")
6599
6597
  }
6600
6598
  ) : null,
6601
- x.enabled === !1 ? /* @__PURE__ */ t(J, { size: "sm", variant: "neutral", children: a(
6599
+ x.enabled === !1 ? /* @__PURE__ */ t(X, { size: "sm", variant: "neutral", children: a(
6602
6600
  "anamnesis.configEditor.archived"
6603
6601
  ) }) : null
6604
6602
  ] }),
@@ -6618,7 +6616,7 @@ function Il({
6618
6616
  children: [
6619
6617
  E,
6620
6618
  /* @__PURE__ */ t(
6621
- de,
6619
+ ce,
6622
6620
  {
6623
6621
  size: "sm",
6624
6622
  intent: "ghost",
@@ -6639,7 +6637,7 @@ function Il({
6639
6637
  }
6640
6638
  ),
6641
6639
  x.locked ? null : x.enabled === !1 ? /* @__PURE__ */ t(
6642
- de,
6640
+ ce,
6643
6641
  {
6644
6642
  size: "sm",
6645
6643
  intent: "ghost",
@@ -6662,7 +6660,7 @@ function Il({
6662
6660
  )
6663
6661
  }
6664
6662
  ) : /* @__PURE__ */ t(
6665
- de,
6663
+ ce,
6666
6664
  {
6667
6665
  size: "sm",
6668
6666
  intent: "ghost",
@@ -6702,7 +6700,7 @@ function Il({
6702
6700
  );
6703
6701
  }),
6704
6702
  /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
6705
- ae,
6703
+ ne,
6706
6704
  {
6707
6705
  intent: "outline",
6708
6706
  size: "sm",
@@ -6712,13 +6710,13 @@ function Il({
6712
6710
  }
6713
6711
  ) })
6714
6712
  ] }) }),
6715
- /* @__PURE__ */ t(Y.Content, { value: "pathologies", children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:pt-[var(--spacing-md)]", children: [
6713
+ /* @__PURE__ */ t(Q.Content, { value: "pathologies", children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:pt-[var(--spacing-md)]", children: [
6716
6714
  /* @__PURE__ */ t("p", { className: "type-meta ds:m-0 ds:text-[color:var(--muted-foreground)]", children: `${a("anamnesis.configEditor.panelLive", {
6717
6715
  count: T
6718
6716
  })} · ${a("anamnesis.configEditor.panelArchived", {
6719
- count: L - T
6717
+ count: R - T
6720
6718
  })}` }),
6721
- /* @__PURE__ */ t(en, { divider: "divided", children: oa(e).map((m) => {
6719
+ /* @__PURE__ */ t(en, { divider: "divided", children: sa(e).map((m) => {
6722
6720
  const N = e.pathologies.some(
6723
6721
  (P) => P.parentCode === m.code && P.enabled !== !1
6724
6722
  ), x = [
@@ -6732,7 +6730,7 @@ function Il({
6732
6730
  {
6733
6731
  title: /* @__PURE__ */ d("span", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
6734
6732
  Se(m.code, a, m),
6735
- m.enabled === !1 ? /* @__PURE__ */ t(J, { size: "sm", variant: "neutral", children: a("anamnesis.configEditor.archived") }) : null
6733
+ m.enabled === !1 ? /* @__PURE__ */ t(X, { size: "sm", variant: "neutral", children: a("anamnesis.configEditor.archived") }) : null
6736
6734
  ] }),
6737
6735
  description: x || void 0,
6738
6736
  trailing: /* @__PURE__ */ d(
@@ -6743,7 +6741,7 @@ function Il({
6743
6741
  }),
6744
6742
  children: [
6745
6743
  /* @__PURE__ */ t(
6746
- de,
6744
+ ce,
6747
6745
  {
6748
6746
  size: "sm",
6749
6747
  intent: "ghost",
@@ -6759,7 +6757,7 @@ function Il({
6759
6757
  }
6760
6758
  ),
6761
6759
  m.enabled === !1 ? /* @__PURE__ */ t(
6762
- de,
6760
+ ce,
6763
6761
  {
6764
6762
  size: "sm",
6765
6763
  intent: "ghost",
@@ -6780,7 +6778,7 @@ function Il({
6780
6778
  )
6781
6779
  }
6782
6780
  ) : /* @__PURE__ */ t(
6783
- de,
6781
+ ce,
6784
6782
  {
6785
6783
  size: "sm",
6786
6784
  intent: "ghost",
@@ -6809,7 +6807,7 @@ function Il({
6809
6807
  );
6810
6808
  }) }),
6811
6809
  /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
6812
- ae,
6810
+ ne,
6813
6811
  {
6814
6812
  intent: "outline",
6815
6813
  size: "sm",
@@ -6819,12 +6817,12 @@ function Il({
6819
6817
  }
6820
6818
  ) })
6821
6819
  ] }) }),
6822
- /* @__PURE__ */ t(Y.Content, { value: "targets", children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)] ds:pt-[var(--spacing-md)]", children: [
6820
+ /* @__PURE__ */ t(Q.Content, { value: "targets", children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)] ds:pt-[var(--spacing-md)]", children: [
6823
6821
  /* @__PURE__ */ t("p", { className: "type-meta ds:m-0 ds:text-[color:var(--muted-foreground)]", children: a("anamnesis.configEditor.panelTracked", {
6824
6822
  count: S
6825
6823
  }) }),
6826
6824
  /* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: a("anamnesis.configEditor.targetsIntro") }),
6827
- ca.map((m) => {
6825
+ la.map((m) => {
6828
6826
  const N = Ne(e, m);
6829
6827
  return N.length === 0 ? null : /* @__PURE__ */ d(
6830
6828
  "section",
@@ -6833,7 +6831,7 @@ function Il({
6833
6831
  children: [
6834
6832
  /* @__PURE__ */ t("h3", { className: "type-title-item ds:m-0 ds:text-[color:var(--foreground)]", children: a(`anamnesis.group.${m}`) }),
6835
6833
  /* @__PURE__ */ t("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: N.map((x) => /* @__PURE__ */ t(
6836
- ga,
6834
+ ha,
6837
6835
  {
6838
6836
  label: Te(x, a),
6839
6837
  checked: x.goal === !0,
@@ -6886,7 +6884,7 @@ function ur({
6886
6884
  t: s
6887
6885
  }) {
6888
6886
  return /* @__PURE__ */ t(
6889
- ee,
6887
+ Z,
6890
6888
  {
6891
6889
  open: e !== null,
6892
6890
  onOpenChange: (o) => {
@@ -6922,10 +6920,10 @@ function pr({
6922
6920
  e.kind === "field" && e.entry.required === !0
6923
6921
  ), k = e.kind === "field" ? e.entry : null, v = k !== null && (k.type === "choice" || k.type === "multiChoice"), f = v && !lr.has(k.key), [C, w] = z(
6924
6922
  f ? (k.options ?? []).join(", ") : ""
6925
- ), A = C.split(",").map((L) => L.trim()).filter(Boolean), R = !f || A.length > 0, T = () => {
6926
- const L = l.trim(), S = (m) => {
6923
+ ), A = C.split(",").map((R) => R.trim()).filter(Boolean), L = !f || A.length > 0, T = () => {
6924
+ const R = l.trim(), S = (m) => {
6927
6925
  const N = { ...m };
6928
- return L ? N.label = L : delete N.label, N;
6926
+ return R ? N.label = R : delete N.label, N;
6929
6927
  };
6930
6928
  if (e.kind === "parameter")
6931
6929
  i({
@@ -6965,10 +6963,10 @@ function pr({
6965
6963
  });
6966
6964
  n();
6967
6965
  };
6968
- return /* @__PURE__ */ d(ee.Content, { size: "sm", children: [
6969
- /* @__PURE__ */ d(ee.Header, { children: [
6970
- /* @__PURE__ */ t(ee.Title, { children: s("anamnesis.configEditor.editTitle", { name: r }) }),
6971
- /* @__PURE__ */ t(ee.Description, { children: e.kind === "pathology" ? s("anamnesis.configEditor.codeLine", {
6966
+ return /* @__PURE__ */ d(Z.Content, { size: "sm", children: [
6967
+ /* @__PURE__ */ d(Z.Header, { children: [
6968
+ /* @__PURE__ */ t(Z.Title, { children: s("anamnesis.configEditor.editTitle", { name: r }) }),
6969
+ /* @__PURE__ */ t(Z.Description, { children: e.kind === "pathology" ? s("anamnesis.configEditor.codeLine", {
6972
6970
  code: o.code
6973
6971
  }) : e.kind === "field" ? `${s("anamnesis.configEditor.keyLine", {
6974
6972
  key: e.entry.key
@@ -6978,7 +6976,7 @@ function pr({
6978
6976
  key: o.key
6979
6977
  }) })
6980
6978
  ] }),
6981
- /* @__PURE__ */ d(ee.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
6979
+ /* @__PURE__ */ d(Z.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
6982
6980
  /* @__PURE__ */ t(
6983
6981
  V,
6984
6982
  {
@@ -6988,7 +6986,7 @@ function pr({
6988
6986
  ie,
6989
6987
  {
6990
6988
  value: l,
6991
- onChange: (L) => c(L.target.value),
6989
+ onChange: (R) => c(R.target.value),
6992
6990
  placeholder: r
6993
6991
  }
6994
6992
  )
@@ -6998,16 +6996,16 @@ function pr({
6998
6996
  sn,
6999
6997
  {
7000
6998
  value: u,
7001
- onChange: (L) => h(L.target.value),
6999
+ onChange: (R) => h(R.target.value),
7002
7000
  minRows: 2
7003
7001
  }
7004
7002
  ) }) : null,
7005
7003
  e.kind === "field" ? /* @__PURE__ */ t(
7006
- ga,
7004
+ ha,
7007
7005
  {
7008
7006
  label: s("anamnesis.configEditor.requiredField"),
7009
7007
  checked: g,
7010
- onCheckedChange: (L) => p(L === !0)
7008
+ onCheckedChange: (R) => p(R === !0)
7011
7009
  }
7012
7010
  ) : null,
7013
7011
  f ? /* @__PURE__ */ t(
@@ -7020,21 +7018,21 @@ function pr({
7020
7018
  ie,
7021
7019
  {
7022
7020
  value: C,
7023
- onChange: (L) => w(L.target.value)
7021
+ onChange: (R) => w(R.target.value)
7024
7022
  }
7025
7023
  )
7026
7024
  }
7027
7025
  ) : v ? /* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: s("anamnesis.configEditor.optionsCurrent", {
7028
7026
  list: (k.options ?? []).map(
7029
- (L) => s(`anamnesis.field.${k.key}.option.${L}`, {
7030
- defaultValue: L
7027
+ (R) => s(`anamnesis.field.${k.key}.option.${R}`, {
7028
+ defaultValue: R
7031
7029
  })
7032
7030
  ).join(", ")
7033
7031
  }) }) : null
7034
7032
  ] }),
7035
- /* @__PURE__ */ d(ee.Footer, { children: [
7036
- /* @__PURE__ */ t(ae, { intent: "ghost", onClick: n, children: s("anamnesis.configEditor.cancel") }),
7037
- /* @__PURE__ */ t(ae, { intent: "primary", onClick: T, disabled: !R, children: s("anamnesis.configEditor.save") })
7033
+ /* @__PURE__ */ d(Z.Footer, { children: [
7034
+ /* @__PURE__ */ t(ne, { intent: "ghost", onClick: n, children: s("anamnesis.configEditor.cancel") }),
7035
+ /* @__PURE__ */ t(ne, { intent: "primary", onClick: T, disabled: !L, children: s("anamnesis.configEditor.save") })
7038
7036
  ] })
7039
7037
  ] });
7040
7038
  }
@@ -7044,7 +7042,7 @@ function hr(e, n) {
7044
7042
  label: void 0
7045
7043
  });
7046
7044
  }
7047
- function ia(e) {
7045
+ function ta(e) {
7048
7046
  return e === "choice" || e === "choiceWithText" || e === "multiChoice";
7049
7047
  }
7050
7048
  function gr({
@@ -7055,7 +7053,7 @@ function gr({
7055
7053
  t: s
7056
7054
  }) {
7057
7055
  return /* @__PURE__ */ t(
7058
- ee,
7056
+ Z,
7059
7057
  {
7060
7058
  open: e !== null,
7061
7059
  onOpenChange: (o) => {
@@ -7082,7 +7080,7 @@ function fr({
7082
7080
  onConfigChange: i,
7083
7081
  t: s
7084
7082
  }) {
7085
- const [o, r] = z(""), [l, c] = z(""), [u, h] = z(""), [g, p] = z(""), [k, v] = z(""), [f, C] = z(""), [w, A] = z("0"), [R, T] = z(""), [L, S] = z(""), [m, N] = z(""), [x, P] = z(""), [$, F] = z(!1), [E, H] = z(""), j = ca.map((D) => ({
7083
+ const [o, r] = z(""), [l, c] = z(""), [u, h] = z(""), [g, p] = z(""), [k, v] = z(""), [f, C] = z(""), [w, A] = z("0"), [L, T] = z(""), [R, S] = z(""), [m, N] = z(""), [x, P] = z(""), [$, F] = z(!1), [E, H] = z(""), j = la.map((D) => ({
7086
7084
  value: D,
7087
7085
  label: s(`anamnesis.group.${D}`)
7088
7086
  })), M = cr.map((D) => ({
@@ -7091,69 +7089,69 @@ function fr({
7091
7089
  })), U = rr.map((D) => ({
7092
7090
  value: D,
7093
7091
  label: s(`anamnesis.configEditor.type.${D}`)
7094
- })), W = a.pathologies.filter((D) => !D.parentCode && D.enabled !== !1).map((D) => ({
7092
+ })), Y = a.pathologies.filter((D) => !D.parentCode && D.enabled !== !1).map((D) => ({
7095
7093
  value: D.code,
7096
7094
  label: Se(D.code, s, D)
7097
- })), Z = L.split(",").map((D) => D.trim()).filter(Boolean), se = e.kind === "parameter" ? o.trim() !== "" && l !== "" && u !== "" : e.kind === "field" ? o.trim() !== "" && R !== "" && (!ia(R) || Z.length > 0) : e.kind === "section" ? o.trim() !== "" : o.trim() !== "" && x.trim() !== "" && // A duplicate code would collide with the existing entry
7095
+ })), ae = R.split(",").map((D) => D.trim()).filter(Boolean), me = e.kind === "parameter" ? o.trim() !== "" && l !== "" && u !== "" : e.kind === "field" ? o.trim() !== "" && L !== "" && (!ta(L) || ae.length > 0) : e.kind === "section" ? o.trim() !== "" : o.trim() !== "" && x.trim() !== "" && // A duplicate code would collide with the existing entry
7098
7096
  // everywhere codes are matched (lookup, archive, edit) —
7099
7097
  // uniqueness is the add gate, matching keyFromLabel's guarantee
7100
7098
  // on the other vocabularies.
7101
7099
  !a.pathologies.some(
7102
7100
  (D) => D.code.toLowerCase() === x.trim().toLowerCase()
7103
- ), X = () => {
7101
+ ), J = () => {
7104
7102
  const D = o.trim();
7105
7103
  if (e.kind === "parameter") {
7106
- const B = new Set(a.parameters.map((Fe) => Fe.key)), ne = (Fe) => {
7104
+ const B = new Set(a.parameters.map((Fe) => Fe.key)), ee = (Fe) => {
7107
7105
  if (Fe.trim() === "") return;
7108
7106
  const Pe = Number(Fe);
7109
7107
  return Number.isFinite(Pe) ? Pe : void 0;
7110
- }, pe = ne(k), ue = ne(f), Le = {
7111
- key: aa(D, B),
7108
+ }, pe = ee(k), de = ee(f), Re = {
7109
+ key: na(D, B),
7112
7110
  label: D,
7113
7111
  group: l,
7114
7112
  betterDirection: u,
7115
7113
  precision: Number(w),
7116
7114
  ...g.trim() ? { unit: g.trim() } : {},
7117
- ...pe != null || ue != null ? {
7115
+ ...pe != null || de != null ? {
7118
7116
  referenceRange: {
7119
7117
  ...pe != null ? { min: pe } : {},
7120
- ...ue != null ? { max: ue } : {}
7118
+ ...de != null ? { max: de } : {}
7121
7119
  }
7122
7120
  } : {}
7123
7121
  };
7124
- i({ ...a, parameters: [...a.parameters, Le] });
7122
+ i({ ...a, parameters: [...a.parameters, Re] });
7125
7123
  } else if (e.kind === "field") {
7126
7124
  const B = new Set(
7127
7125
  a.intakeSections.flatMap(
7128
- (ue) => ue.fields.map((Le) => Le.key)
7126
+ (de) => de.fields.map((Re) => Re.key)
7129
7127
  )
7130
- ), ne = R === "numberInteger" || R === "numberDecimal" ? "number" : R === "choiceWithText" ? "choice" : R, pe = {
7131
- key: aa(D, B),
7128
+ ), ee = L === "numberInteger" || L === "numberDecimal" ? "number" : L === "choiceWithText" ? "choice" : L, pe = {
7129
+ key: na(D, B),
7132
7130
  label: D,
7133
- type: ne,
7134
- ...R === "numberDecimal" ? { decimal: !0 } : {},
7135
- ...R === "choiceWithText" ? { detail: !0 } : {},
7136
- ...ia(R) ? { options: Z } : {},
7131
+ type: ee,
7132
+ ...L === "numberDecimal" ? { decimal: !0 } : {},
7133
+ ...L === "choiceWithText" ? { detail: !0 } : {},
7134
+ ...ta(L) ? { options: ae } : {},
7137
7135
  ...m.trim() ? { helpText: m.trim() } : {},
7138
7136
  ...$ ? { required: !0 } : {}
7139
7137
  };
7140
7138
  i({
7141
7139
  ...a,
7142
7140
  intakeSections: a.intakeSections.map(
7143
- (ue) => ue.key === e.sectionKey ? { ...ue, fields: [...ue.fields, pe] } : ue
7141
+ (de) => de.key === e.sectionKey ? { ...de, fields: [...de.fields, pe] } : de
7144
7142
  )
7145
7143
  });
7146
7144
  } else if (e.kind === "section") {
7147
7145
  const B = new Set(
7148
7146
  a.intakeSections.map((pe) => pe.key)
7149
- ), ne = {
7150
- key: aa(D, B),
7147
+ ), ee = {
7148
+ key: na(D, B),
7151
7149
  label: D,
7152
7150
  fields: []
7153
7151
  };
7154
7152
  i({
7155
7153
  ...a,
7156
- intakeSections: [...a.intakeSections, ne]
7154
+ intakeSections: [...a.intakeSections, ee]
7157
7155
  });
7158
7156
  } else {
7159
7157
  const B = {
@@ -7167,15 +7165,15 @@ function fr({
7167
7165
  });
7168
7166
  }
7169
7167
  n();
7170
- }, Re = e.kind === "parameter" ? s("anamnesis.configEditor.addParameterTitle") : e.kind === "field" ? s("anamnesis.configEditor.addQuestionTitle", {
7168
+ }, Le = e.kind === "parameter" ? s("anamnesis.configEditor.addParameterTitle") : e.kind === "field" ? s("anamnesis.configEditor.addQuestionTitle", {
7171
7169
  section: vr(a, e.sectionKey, s)
7172
7170
  }) : e.kind === "section" ? s("anamnesis.configEditor.addSectionTitle") : s("anamnesis.configEditor.addCodeTitle");
7173
- return /* @__PURE__ */ d(ee.Content, { size: "sm", children: [
7174
- /* @__PURE__ */ d(ee.Header, { children: [
7175
- /* @__PURE__ */ t(ee.Title, { children: Re }),
7176
- /* @__PURE__ */ t(ee.Description, { children: s("anamnesis.configEditor.addNote") })
7171
+ return /* @__PURE__ */ d(Z.Content, { size: "sm", children: [
7172
+ /* @__PURE__ */ d(Z.Header, { children: [
7173
+ /* @__PURE__ */ t(Z.Title, { children: Le }),
7174
+ /* @__PURE__ */ t(Z.Description, { children: s("anamnesis.configEditor.addNote") })
7177
7175
  ] }),
7178
- /* @__PURE__ */ d(ee.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
7176
+ /* @__PURE__ */ d(Z.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
7179
7177
  e.kind === "pathology" ? /* @__PURE__ */ t(V, { label: s("anamnesis.configEditor.codeField"), required: !0, children: /* @__PURE__ */ t(
7180
7178
  ie,
7181
7179
  {
@@ -7285,13 +7283,13 @@ function fr({
7285
7283
  Ve,
7286
7284
  {
7287
7285
  options: U,
7288
- value: R,
7286
+ value: L,
7289
7287
  onValueChange: (D) => T(D),
7290
7288
  placeholder: s("anamnesis.configEditor.selectPlaceholder"),
7291
7289
  "aria-label": s("anamnesis.configEditor.typeField")
7292
7290
  }
7293
7291
  ) }),
7294
- ia(R) ? /* @__PURE__ */ t(
7292
+ ta(L) ? /* @__PURE__ */ t(
7295
7293
  V,
7296
7294
  {
7297
7295
  label: s("anamnesis.configEditor.optionsField"),
@@ -7300,7 +7298,7 @@ function fr({
7300
7298
  children: /* @__PURE__ */ t(
7301
7299
  ie,
7302
7300
  {
7303
- value: L,
7301
+ value: R,
7304
7302
  onChange: (D) => S(D.target.value)
7305
7303
  }
7306
7304
  )
@@ -7315,7 +7313,7 @@ function fr({
7315
7313
  }
7316
7314
  ) }),
7317
7315
  /* @__PURE__ */ t(
7318
- ga,
7316
+ ha,
7319
7317
  {
7320
7318
  label: s("anamnesis.configEditor.requiredField"),
7321
7319
  checked: $,
@@ -7332,7 +7330,7 @@ function fr({
7332
7330
  children: /* @__PURE__ */ t(
7333
7331
  Ve,
7334
7332
  {
7335
- options: W,
7333
+ options: Y,
7336
7334
  value: E,
7337
7335
  onValueChange: (D) => H(D),
7338
7336
  placeholder: s("anamnesis.configEditor.selectPlaceholder"),
@@ -7344,9 +7342,9 @@ function fr({
7344
7342
  ) : null,
7345
7343
  e.kind === "section" ? /* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: s("anamnesis.configEditor.sectionNeedsQuestion") }) : null
7346
7344
  ] }),
7347
- /* @__PURE__ */ d(ee.Footer, { children: [
7348
- /* @__PURE__ */ t(ae, { intent: "ghost", onClick: n, children: s("anamnesis.configEditor.cancel") }),
7349
- /* @__PURE__ */ t(ae, { intent: "primary", onClick: X, disabled: !se, children: s("anamnesis.configEditor.add") })
7345
+ /* @__PURE__ */ d(Z.Footer, { children: [
7346
+ /* @__PURE__ */ t(ne, { intent: "ghost", onClick: n, children: s("anamnesis.configEditor.cancel") }),
7347
+ /* @__PURE__ */ t(ne, { intent: "primary", onClick: J, disabled: !me, children: s("anamnesis.configEditor.add") })
7350
7348
  ] })
7351
7349
  ] });
7352
7350
  }
@@ -7356,12 +7354,12 @@ function vr(e, n, a) {
7356
7354
  );
7357
7355
  return i ? fe(i, a) : n;
7358
7356
  }
7359
- function Za(e) {
7357
+ function Ja(e) {
7360
7358
  return e.kind === "visit" ? `anamnesis-visit-${e.visitId}` : `anamnesis-event-${e.eventId}`;
7361
7359
  }
7362
- function Rl(e, n) {
7363
- const a = e.visits.filter(Ct).map((s) => ({
7364
- id: Za({ kind: "visit", visitId: s.id }),
7360
+ function Ll(e, n) {
7361
+ const a = e.visits.filter(Nt).map((s) => ({
7362
+ id: Ja({ kind: "visit", visitId: s.id }),
7365
7363
  dateIso: s.dateIso,
7366
7364
  author: s.practitioner ? { name: s.practitioner } : void 0,
7367
7365
  clinical: !0,
@@ -7380,7 +7378,7 @@ function Rl(e, n) {
7380
7378
 
7381
7379
  `)
7382
7380
  })), i = (e.events ?? []).map((s) => ({
7383
- id: Za({ kind: "event", eventId: s.id }),
7381
+ id: Ja({ kind: "event", eventId: s.id }),
7384
7382
  dateIso: s.dateIso,
7385
7383
  // No author and not clinical — see the header. The card renders the date
7386
7384
  // itself, so the body carries the label without repeating it.
@@ -7390,7 +7388,7 @@ function Rl(e, n) {
7390
7388
  // a gym membership as one.
7391
7389
  "aria-label": n("anamnesis.rail.eventLabel"),
7392
7390
  contentFormat: "markdown",
7393
- content: `**${n(`anamnesis.event.label.${s.labelKey}`)}** — ${It(
7391
+ content: `**${n(`anamnesis.event.label.${s.labelKey}`)}** — ${Dt(
7394
7392
  s,
7395
7393
  n
7396
7394
  )}`
@@ -7399,7 +7397,7 @@ function Rl(e, n) {
7399
7397
  (s, o) => o.dateIso.localeCompare(s.dateIso)
7400
7398
  );
7401
7399
  }
7402
- const sa = "patterns", yr = {
7400
+ const ia = "patterns", yr = {
7403
7401
  anamnesis: {
7404
7402
  mainLabel: "Anamnesis record — {{mode}}",
7405
7403
  mode: { intake: "Intake", compile: "Compile", readOnly: "Read-only" },
@@ -7626,6 +7624,7 @@ const sa = "patterns", yr = {
7626
7624
  compare: {
7627
7625
  visitsLabel: "Visits compared",
7628
7626
  visitOption: "{{index}}. {{visitType}} · {{date}}",
7627
+ visitOptionSource: "{{label}} · {{source}}",
7629
7628
  // `total`, not `count` — a plural-suffixed key would need six forms in
7630
7629
  // Arabic to say a number the sentence already carries.
7631
7630
  selected: "{{total}} visits compared · {{from}} – {{to}}",
@@ -8265,6 +8264,7 @@ const sa = "patterns", yr = {
8265
8264
  compare: {
8266
8265
  visitsLabel: "Visite confrontate",
8267
8266
  visitOption: "{{index}}. {{visitType}} · {{date}}",
8267
+ visitOptionSource: "{{label}} · {{source}}",
8268
8268
  selected: "{{total}} visite confrontate · {{from}} – {{to}}",
8269
8269
  minimum: "Restano confrontate almeno due visite",
8270
8270
  start: "Confronta",
@@ -8705,6 +8705,7 @@ const sa = "patterns", yr = {
8705
8705
  compare: {
8706
8706
  visitsLabel: "الزيارات المقارَنة",
8707
8707
  visitOption: "{{index}}. {{visitType}} · {{date}}",
8708
+ visitOptionSource: "{{label}} · {{source}}",
8708
8709
  selected: "مقارنة {{total}} زيارة · {{from}} – {{to}}",
8709
8710
  minimum: "تبقى زيارتان على الأقل قيد المقارنة",
8710
8711
  start: "قارن",
@@ -8991,6 +8992,7 @@ const sa = "patterns", yr = {
8991
8992
  compare: {
8992
8993
  visitsLabel: "比較する受診",
8993
8994
  visitOption: "{{index}}. {{visitType}} · {{date}}",
8995
+ visitOptionSource: "{{label}} · {{source}}",
8994
8996
  selected: "{{total}}回の受診を比較 · {{from}} – {{to}}",
8995
8997
  minimum: "受診は2件以上比較されます",
8996
8998
  start: "比較",
@@ -9243,14 +9245,14 @@ const sa = "patterns", yr = {
9243
9245
  ar: xr,
9244
9246
  ja: kr
9245
9247
  };
9246
- function Ll(e) {
9248
+ function Rl(e) {
9247
9249
  for (const [n, a] of Object.entries(wr))
9248
- e.hasResourceBundle(n, sa) ? e.addResourceBundle(n, sa, a, !0, !1) : e.addResourceBundle(n, sa, a);
9250
+ e.hasResourceBundle(n, ia) ? e.addResourceBundle(n, ia, a, !0, !1) : e.addResourceBundle(n, ia, a);
9249
9251
  }
9250
9252
  function Nr(e) {
9251
9253
  var a;
9252
9254
  if (!e) return;
9253
- const n = ln(e) ? new Date(e).getTime() : (a = pt(e)) == null ? void 0 : a.getTime();
9255
+ const n = ln(e) ? new Date(e).getTime() : (a = mt(e)) == null ? void 0 : a.getTime();
9254
9256
  return n == null || Number.isNaN(n) ? void 0 : n;
9255
9257
  }
9256
9258
  function Wt(e) {
@@ -9276,7 +9278,7 @@ function Sr(e, n, a) {
9276
9278
  id: e.key,
9277
9279
  label: ge(e, a),
9278
9280
  value: Bn(n.answer, e, a),
9279
- highlighted: Ra(e, n.answer)
9281
+ highlighted: Ot(e, n.answer)
9280
9282
  };
9281
9283
  e.unit && (i.unit = e.unit);
9282
9284
  const s = Wt(n.source);
@@ -9307,29 +9309,29 @@ function Fl(e, n, a, i) {
9307
9309
  export {
9308
9310
  El as A,
9309
9311
  qi as L,
9310
- sa as P,
9312
+ ia as P,
9311
9313
  We as S,
9312
9314
  Bi as T,
9313
9315
  Il as a,
9314
9316
  _e as b,
9315
- oa as c,
9317
+ sa as c,
9316
9318
  Ge as d,
9317
- Za as e,
9318
- Rl as f,
9319
+ Ja as e,
9320
+ Ll as f,
9319
9321
  Hi as g,
9320
9322
  Ne as h,
9321
- lt as i,
9322
- fa as j,
9323
+ rt as i,
9324
+ ga as j,
9323
9325
  Bn as k,
9324
9326
  ge as l,
9325
- Ra as m,
9327
+ Ot as m,
9326
9328
  Vi as n,
9327
9329
  Ui as o,
9328
- aa as p,
9330
+ na as p,
9329
9331
  dn as q,
9330
- Ll as r,
9332
+ Rl as r,
9331
9333
  Dl as s,
9332
9334
  Vt as t,
9333
9335
  Fl as u
9334
9336
  };
9335
- //# sourceMappingURL=anamnesis-summary-rows-Co3BA0ro.js.map
9337
+ //# sourceMappingURL=anamnesis-summary-rows-BWjPUp0m.js.map