@alfadocs/ui-kit 1.9.4 → 1.10.1

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.
@@ -1,28 +1,28 @@
1
- import { jsx as g, jsxs as O } from "react/jsx-runtime";
2
- import { createElement as x, useRef as k, useEffect as te, useCallback as z, forwardRef as pe, useState as ne, useImperativeHandle as be, useMemo as Y } from "react";
3
- import { useTranslation as $ } from "react-i18next";
4
- import { a as p, T as b, A as ge, d as ie, D as y, e as Ce } from "./actions-cell-renderer-WUTyAes8.js";
5
- import { S as ve } from "./select-BW5ecXlX.js";
6
- import { u as Ne } from "./registry-DvAUVLHh.js";
7
- import { I as Te, L as we, b as L, a as _, c as U, N as H, d as F, S as R, T as ae, D as K, g as Fe, f as Re, U as Ie, e as Pe } from "./link-cell-renderer-Cp2MSlJl.js";
8
- import { T as ye } from "./transaction-chip-DJCstquX.js";
9
- import { B as le } from "./badge-sTusUqZD.js";
10
- import { c as We } from "./index-D2ZczOXr.js";
1
+ import { jsx as v, jsxs as k } from "react/jsx-runtime";
2
+ import { createElement as E, useRef as G, useEffect as te, useCallback as j, forwardRef as he, useState as ne, useImperativeHandle as pe, useMemo as Q } from "react";
3
+ import { useTranslation as K } from "react-i18next";
4
+ import { a as g, T as C, A as be, d as ie, D as S, e as ge } from "./actions-cell-renderer-xfSYiTXQ.js";
5
+ import { S as Ce } from "./select-BW5ecXlX.js";
6
+ import { u as ve } from "./registry-DvAUVLHh.js";
7
+ import { I as Te, L as we, b as _, a as z, c as H, N as $, d as R, S as I, T as ae, D as q, g as Ne, f as Fe, U as Re, e as Ie } from "./link-cell-renderer-Cp2MSlJl.js";
8
+ import { T as Pe } from "./transaction-chip-DJCstquX.js";
9
+ import { B as re } from "./badge-sTusUqZD.js";
10
+ import { c as ye } from "./index-D2ZczOXr.js";
11
11
  import { T as Se } from "./timestamp-BV2lC-wV.js";
12
- import { C as Ae } from "./calendar-clock-hbObjfGY.js";
13
- import { E as Be } from "./eye-BjhN2nYf.js";
12
+ import { C as We } from "./calendar-clock-hbObjfGY.js";
13
+ import { E as Ae } from "./eye-BjhN2nYf.js";
14
14
  import { P as De } from "./pencil-B1sKKyuT.js";
15
- import { M as Ve } from "./mail-BqXVF2zH.js";
15
+ import { M as Be } from "./mail-BqXVF2zH.js";
16
16
  import { M as xe } from "./message-square-Bye4ATvx.js";
17
- import { U as Ee } from "./users-BjS_Gg1E.js";
17
+ import { U as Ve } from "./users-BjS_Gg1E.js";
18
18
  import { T as Oe } from "./trash-2-uumy3fy1.js";
19
- function J(e) {
20
- const { value: n, positiveState: d, showLabel: s = !0 } = e, r = typeof n == "number" && Number.isFinite(n) ? n : null;
21
- if (r === null) return null;
22
- const l = r > 0 ? d : "settled";
23
- return /* @__PURE__ */ g(ye, { state: l, amount: r / 100, showLabel: s });
19
+ function Z(e) {
20
+ const { value: n, positiveState: s, showLabel: o = !0 } = e, l = typeof n == "number" && Number.isFinite(n) ? n : null;
21
+ if (l === null) return null;
22
+ const r = l > 0 ? s : "settled";
23
+ return /* @__PURE__ */ v(Pe, { state: r, amount: l / 100, showLabel: o });
24
24
  }
25
- const ke = {
25
+ const Ee = {
26
26
  accepted: "success",
27
27
  estimate: "info",
28
28
  none: "neutral"
@@ -30,13 +30,13 @@ const ke = {
30
30
  function Me(e) {
31
31
  return e === "accepted" || e === "estimate" || e === "none";
32
32
  }
33
- function Ge(e) {
34
- const { t: n } = $("ui"), { data: d, value: s, size: r = "sm" } = e, l = (d == null ? void 0 : d.carePlanStatus) ?? s;
35
- if (!Me(l)) return null;
36
- const u = ke[l];
37
- return /* @__PURE__ */ g(le, { variant: u, withDot: !0, size: r, children: n(`patientTable.carePlanStatus.${l}`) });
33
+ function ke(e) {
34
+ const { t: n } = K("ui"), { data: s, value: o, size: l = "sm" } = e, r = (s == null ? void 0 : s.carePlanStatus) ?? o;
35
+ if (!Me(r)) return null;
36
+ const c = Ee[r];
37
+ return /* @__PURE__ */ v(re, { variant: c, withDot: !0, size: l, children: n(`patientTable.carePlanStatus.${r}`) });
38
38
  }
39
- const Z = We(
39
+ const ee = ye(
40
40
  "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] ds:whitespace-nowrap",
41
41
  {
42
42
  variants: {
@@ -51,199 +51,199 @@ const Z = We(
51
51
  },
52
52
  defaultVariants: { tone: "default" }
53
53
  }
54
- ), Le = 1440 * 60 * 1e3, _e = 7;
54
+ ), Ge = 1440 * 60 * 1e3, Le = 7;
55
55
  function Ue(e) {
56
56
  if (e == null || e === "") return null;
57
57
  const n = e instanceof Date ? e.getTime() : typeof e == "number" ? e : new Date(String(e)).getTime();
58
58
  return Number.isNaN(n) ? null : n;
59
59
  }
60
- function He(e, n) {
60
+ function _e(e, n) {
61
61
  if (n <= 0) return "default";
62
- const d = e - Date.now();
63
- return d < 0 ? "default" : d <= n * Le ? "soon" : "default";
62
+ const s = e - Date.now();
63
+ return s < 0 ? "default" : s <= n * Ge ? "soon" : "default";
64
64
  }
65
65
  function ze(e) {
66
- const { t: n } = $("ui"), { data: d, value: s, soonWithinDays: r = _e } = e, l = Ue((d == null ? void 0 : d.nextAppointment) ?? s);
67
- if (l === null)
68
- return /* @__PURE__ */ g("span", { className: Z({ tone: "empty" }), children: n("patientTable.nextAppointment.none") });
69
- const u = He(l, r);
70
- return /* @__PURE__ */ O("span", { className: Z({ tone: u }), children: [
71
- u === "soon" ? /* @__PURE__ */ g(Ae, { "aria-hidden": "true", className: "ds:size-3.5 ds:shrink-0" }) : null,
72
- /* @__PURE__ */ g(Se, { value: l, format: "relative", shape: "bare" })
66
+ const { t: n } = K("ui"), { data: s, value: o, soonWithinDays: l = Le } = e, r = Ue((s == null ? void 0 : s.nextAppointment) ?? o);
67
+ if (r === null)
68
+ return /* @__PURE__ */ v("span", { className: ee({ tone: "empty" }), children: n("patientTable.nextAppointment.none") });
69
+ const c = _e(r, l);
70
+ return /* @__PURE__ */ k("span", { className: ee({ tone: c }), children: [
71
+ c === "soon" ? /* @__PURE__ */ v(We, { "aria-hidden": "true", className: "ds:size-3.5 ds:shrink-0" }) : null,
72
+ /* @__PURE__ */ v(Se, { value: r, format: "relative", shape: "bare" })
73
73
  ] });
74
74
  }
75
- function q(e) {
75
+ function le(e) {
76
76
  return e.responsiveTier;
77
77
  }
78
- const $e = 6;
79
- function je(e, n) {
80
- const d = (r) => (l) => {
81
- n == null || n(r, l);
82
- }, s = (r, l) => ({
83
- icon: r.icon,
84
- label: r.label,
85
- variant: r.variant,
86
- onClick: d(r),
87
- ...l
78
+ const He = 6;
79
+ function $e(e, n) {
80
+ const s = (l) => (r) => {
81
+ n == null || n(l, r);
82
+ }, o = (l, r) => ({
83
+ icon: l.icon,
84
+ label: l.label,
85
+ variant: l.variant,
86
+ onClick: s(l),
87
+ ...r
88
88
  });
89
89
  return [
90
- s(
90
+ o(
91
91
  {
92
92
  id: "show",
93
93
  label: e("patientTable.actions.show"),
94
- icon: x(Be, { "aria-hidden": "true" })
94
+ icon: E(Ae, { "aria-hidden": "true" })
95
95
  },
96
96
  {}
97
97
  ),
98
- s(
98
+ o(
99
99
  {
100
100
  id: "edit",
101
101
  label: e("patientTable.actions.edit"),
102
- icon: x(De, { "aria-hidden": "true" })
102
+ icon: E(De, { "aria-hidden": "true" })
103
103
  },
104
104
  {}
105
105
  ),
106
- s(
106
+ o(
107
107
  {
108
108
  id: "sendEmailReminder",
109
109
  label: e("patientTable.actions.sendEmailReminder"),
110
- icon: x(Ve, { "aria-hidden": "true" })
110
+ icon: E(Be, { "aria-hidden": "true" })
111
111
  },
112
112
  // Hidden when the patient has email contact disabled (spec).
113
- { hidden: (r) => !r.emailEnabled }
113
+ { hidden: (l) => !l.emailEnabled }
114
114
  ),
115
- s(
115
+ o(
116
116
  {
117
117
  id: "sendSmsReminder",
118
118
  label: e("patientTable.actions.sendSmsReminder"),
119
- icon: x(xe, { "aria-hidden": "true" })
119
+ icon: E(xe, { "aria-hidden": "true" })
120
120
  },
121
121
  // Hidden when no phone number is SMS-enabled (spec).
122
122
  {
123
- hidden: (r) => !(r.phoneNumbers ?? []).some((l) => l.smsEnabled)
123
+ hidden: (l) => !(l.phoneNumbers ?? []).some((r) => r.smsEnabled)
124
124
  }
125
125
  ),
126
- s(
126
+ o(
127
127
  {
128
128
  id: "reassign",
129
129
  label: e("patientTable.actions.reassign"),
130
- icon: x(Ee, { "aria-hidden": "true" })
130
+ icon: E(Ve, { "aria-hidden": "true" })
131
131
  },
132
132
  {}
133
133
  ),
134
- s(
134
+ o(
135
135
  {
136
136
  id: "delete",
137
137
  label: e("patientTable.actions.delete"),
138
- icon: x(Oe, { "aria-hidden": "true" }),
138
+ icon: E(Oe, { "aria-hidden": "true" }),
139
139
  variant: "destructive"
140
140
  },
141
141
  // Disabled (with a reason) for archived patients — the row model's
142
142
  // closest "cannot delete" signal. Surfaced as the inline tooltip.
143
143
  {
144
- disabled: (r) => !!r.isArchived,
144
+ disabled: (l) => !!l.isArchived,
145
145
  disabledReason: e("patientTable.actions.deleteLocked")
146
146
  }
147
147
  )
148
148
  ];
149
149
  }
150
- const Ke = () => !1, B = "✓", W = "—";
151
- function Ye(e) {
150
+ const je = () => !1, A = "✓", W = "—";
151
+ function Ke(e) {
152
152
  if (!e) return null;
153
- const n = new Date(e), d = n.getTime();
154
- if (Number.isNaN(d)) return null;
155
- const s = /* @__PURE__ */ new Date();
156
- let r = s.getFullYear() - n.getFullYear();
157
- const l = s.getMonth() - n.getMonth();
158
- return (l < 0 || l === 0 && s.getDate() < n.getDate()) && (r -= 1), r >= 0 ? r : null;
153
+ const n = new Date(e), s = n.getTime();
154
+ if (Number.isNaN(s)) return null;
155
+ const o = /* @__PURE__ */ new Date();
156
+ let l = o.getFullYear() - n.getFullYear();
157
+ const r = o.getMonth() - n.getMonth();
158
+ return (r < 0 || r === 0 && o.getDate() < n.getDate()) && (l -= 1), l >= 0 ? l : null;
159
159
  }
160
- function qe(e) {
160
+ function Ye(e) {
161
161
  return e.map((n) => {
162
- var r;
163
- const s = {
162
+ var l;
163
+ const o = {
164
164
  colId: `custom:${n.fieldName}`,
165
165
  headerName: n.label,
166
166
  hide: !0
167
167
  // No tier — custom fields are opt-in via ColumnToggle only.
168
168
  };
169
169
  return n.type === "checkbox" ? {
170
- ...s,
171
- valueGetter: (l) => {
172
- var u, f;
173
- return ((f = (u = l.data) == null ? void 0 : u.customFields) == null ? void 0 : f[n.fieldName]) === !0;
170
+ ...o,
171
+ valueGetter: (r) => {
172
+ var c, h;
173
+ return ((h = (c = r.data) == null ? void 0 : c.customFields) == null ? void 0 : h[n.fieldName]) === !0;
174
174
  },
175
- valueFormatter: (l) => l.value === !0 ? B : W,
176
- filter: R,
177
- floatingFilterComponent: F,
175
+ valueFormatter: (r) => r.value === !0 ? A : W,
176
+ filter: I,
177
+ floatingFilterComponent: R,
178
178
  filterParams: {
179
179
  options: [
180
- { value: !0, label: B },
180
+ { value: !0, label: A },
181
181
  { value: !1, label: W }
182
182
  ]
183
183
  },
184
184
  minWidth: 110,
185
185
  width: 130
186
186
  } : n.type === "dropdown" ? {
187
- ...s,
187
+ ...o,
188
188
  // TagListCellRenderer expects an array; wrap the single value.
189
- valueGetter: (l) => {
190
- var f, c;
191
- const u = (c = (f = l.data) == null ? void 0 : f.customFields) == null ? void 0 : c[n.fieldName];
192
- return typeof u == "string" && u ? [u] : [];
189
+ valueGetter: (r) => {
190
+ var h, d;
191
+ const c = (d = (h = r.data) == null ? void 0 : h.customFields) == null ? void 0 : d[n.fieldName];
192
+ return typeof c == "string" && c ? [c] : [];
193
193
  },
194
194
  cellRenderer: ae,
195
- filterValueGetter: (l) => {
196
- var f, c;
197
- const u = (c = (f = l.data) == null ? void 0 : f.customFields) == null ? void 0 : c[n.fieldName];
198
- return typeof u == "string" ? u : "";
195
+ filterValueGetter: (r) => {
196
+ var h, d;
197
+ const c = (d = (h = r.data) == null ? void 0 : h.customFields) == null ? void 0 : d[n.fieldName];
198
+ return typeof c == "string" ? c : "";
199
199
  },
200
- filter: R,
201
- floatingFilterComponent: F,
200
+ filter: I,
201
+ floatingFilterComponent: R,
202
202
  filterParams: {
203
203
  // Undefined (not []) when the field declares no options, so the
204
204
  // filter derives its choices from the rows. An empty array would
205
205
  // mean "this column has no facets" and leave the filter unusable.
206
- options: (r = n.options) == null ? void 0 : r.map((l) => ({
207
- value: l,
208
- label: l
206
+ options: (l = n.options) == null ? void 0 : l.map((r) => ({
207
+ value: r,
208
+ label: r
209
209
  }))
210
210
  },
211
211
  sortable: !1,
212
212
  minWidth: 130,
213
213
  width: 160
214
214
  } : {
215
- ...s,
216
- valueGetter: (l) => {
217
- var f, c;
218
- const u = (c = (f = l.data) == null ? void 0 : f.customFields) == null ? void 0 : c[n.fieldName];
219
- return typeof u == "string" ? u : "";
215
+ ...o,
216
+ valueGetter: (r) => {
217
+ var h, d;
218
+ const c = (d = (h = r.data) == null ? void 0 : h.customFields) == null ? void 0 : d[n.fieldName];
219
+ return typeof c == "string" ? c : "";
220
220
  },
221
- filter: b,
222
- floatingFilterComponent: p,
221
+ filter: C,
222
+ floatingFilterComponent: g,
223
223
  minWidth: 140,
224
224
  width: 170
225
225
  };
226
226
  });
227
227
  }
228
- function Qe(e, n = {}) {
228
+ function qe(e, n = {}) {
229
229
  const {
230
- hideDetails: d = !1,
231
- getActionsCompact: s = Ke,
232
- onRowAction: r,
233
- identityHref: l,
234
- customFields: u = []
235
- } = n, f = je(e, r), c = {
230
+ hideDetails: s = !1,
231
+ getActionsCompact: o = je,
232
+ onRowAction: l,
233
+ identityHref: r,
234
+ customFields: c = []
235
+ } = n, h = $e(e, l), d = {
236
236
  m: e("patientTable.gender.m"),
237
237
  f: e("patientTable.gender.f"),
238
238
  x: e("patientTable.gender.x")
239
- }, m = {
239
+ }, u = {
240
240
  yes: e("patientTable.consent.yes"),
241
241
  no: e("patientTable.consent.no"),
242
242
  notSpecified: e("patientTable.consent.notSpecified")
243
- }, C = {
244
- [m.yes]: "success",
245
- [m.no]: "error",
246
- [m.notSpecified]: "neutral"
243
+ }, p = {
244
+ [u.yes]: "success",
245
+ [u.no]: "error",
246
+ [u.notSpecified]: "neutral"
247
247
  }, a = (t) => e(`patientTable.column.${t}`);
248
248
  return [
249
249
  /* ── Avatar (P0, pinned-start) ─────────────────────────────────── */
@@ -286,8 +286,8 @@ function Qe(e, n = {}) {
286
286
  headerName: a("firstName"),
287
287
  pinned: "left",
288
288
  field: "firstName",
289
- filter: b,
290
- floatingFilterComponent: p,
289
+ filter: C,
290
+ floatingFilterComponent: g,
291
291
  // Size to content: width === minWidth so the pinned column sits tight with
292
292
  // no dead space before the next pinned column (pinned columns can't flex).
293
293
  width: 140,
@@ -302,16 +302,16 @@ function Qe(e, n = {}) {
302
302
  field: "lastName",
303
303
  cellRenderer: we,
304
304
  cellRendererParams: {
305
- href: l,
305
+ href: r,
306
306
  // When no detail href is supplied the cell renders a button; route its
307
307
  // click through the same `show` row action.
308
- onClick: r ? (t) => r(
308
+ onClick: l ? (t) => l(
309
309
  { id: "show", label: e("patientTable.actions.show") },
310
310
  t
311
311
  ) : void 0
312
312
  },
313
- filter: b,
314
- floatingFilterComponent: p,
313
+ filter: C,
314
+ floatingFilterComponent: g,
315
315
  // Size to content: a modest pinned width with no stretched default, so the
316
316
  // avatar + first + last group ends tight against the scrollable columns.
317
317
  width: 150,
@@ -325,11 +325,11 @@ function Qe(e, n = {}) {
325
325
  responsiveTier: "P1",
326
326
  // The primary phone number string (prefix + number).
327
327
  valueGetter: (t) => {
328
- var i, o, h;
329
- return ((h = (o = (i = t.data) == null ? void 0 : i.phoneNumbers) == null ? void 0 : o[0]) == null ? void 0 : h.number) ?? "";
328
+ var i, f, b;
329
+ return ((b = (f = (i = t.data) == null ? void 0 : i.phoneNumbers) == null ? void 0 : f[0]) == null ? void 0 : b.number) ?? "";
330
330
  },
331
- filter: b,
332
- floatingFilterComponent: p,
331
+ filter: C,
332
+ floatingFilterComponent: g,
333
333
  minWidth: 160,
334
334
  width: 180
335
335
  },
@@ -340,8 +340,8 @@ function Qe(e, n = {}) {
340
340
  responsiveTier: "P1",
341
341
  field: "nextAppointment",
342
342
  cellRenderer: ze,
343
- filter: _,
344
- floatingFilterComponent: L,
343
+ filter: z,
344
+ floatingFilterComponent: _,
345
345
  minWidth: 160,
346
346
  width: 180
347
347
  },
@@ -353,10 +353,10 @@ function Qe(e, n = {}) {
353
353
  field: "unpaidAmount",
354
354
  type: "numericColumn",
355
355
  // The kit's financial-state pill: `debt` while anything is owed, `settled` at zero.
356
- cellRenderer: J,
356
+ cellRenderer: Z,
357
357
  cellRendererParams: { positiveState: "debt" },
358
- filter: H,
359
- floatingFilterComponent: U,
358
+ filter: $,
359
+ floatingFilterComponent: H,
360
360
  // Money is integer cents; the inRange filter compares cents directly.
361
361
  filterParams: { defaultOperator: "inRange", min: 0 },
362
362
  minWidth: 150,
@@ -371,9 +371,9 @@ function Qe(e, n = {}) {
371
371
  // Emit `hide` ONLY when masking (never a literal `hide: false`). A static
372
372
  // `hide: false` is re-applied by AG Grid on every `columnDefs` reconcile,
373
373
  // clobbering a runtime hide from the ViewSwitcher / responsive hook.
374
- hide: d || void 0,
375
- filter: b,
376
- floatingFilterComponent: p,
374
+ hide: s || void 0,
375
+ filter: C,
376
+ floatingFilterComponent: g,
377
377
  minWidth: 200,
378
378
  width: 240
379
379
  },
@@ -383,9 +383,9 @@ function Qe(e, n = {}) {
383
383
  headerName: a("carePlanStatus"),
384
384
  responsiveTier: "P2",
385
385
  field: "carePlanStatus",
386
- cellRenderer: Ge,
387
- filter: R,
388
- floatingFilterComponent: F,
386
+ cellRenderer: ke,
387
+ filter: I,
388
+ floatingFilterComponent: R,
389
389
  filterParams: {
390
390
  options: [
391
391
  {
@@ -409,8 +409,8 @@ function Qe(e, n = {}) {
409
409
  headerName: a("fiscalCode"),
410
410
  responsiveTier: "P3",
411
411
  field: "italianFiscalCode",
412
- filter: b,
413
- floatingFilterComponent: p,
412
+ filter: C,
413
+ floatingFilterComponent: g,
414
414
  minWidth: 160,
415
415
  width: 180
416
416
  },
@@ -424,10 +424,10 @@ function Qe(e, n = {}) {
424
424
  // numeric because the valueGetter returns a number.
425
425
  valueGetter: (t) => {
426
426
  var i;
427
- return Ye((i = t.data) == null ? void 0 : i.dateOfBirth) ?? void 0;
427
+ return Ke((i = t.data) == null ? void 0 : i.dateOfBirth) ?? void 0;
428
428
  },
429
- filter: H,
430
- floatingFilterComponent: U,
429
+ filter: $,
430
+ floatingFilterComponent: H,
431
431
  minWidth: 90,
432
432
  width: 110
433
433
  },
@@ -439,15 +439,15 @@ function Qe(e, n = {}) {
439
439
  // Map the raw code to a localised label for both cell + set filter.
440
440
  valueGetter: (t) => {
441
441
  var i;
442
- return (i = t.data) != null && i.gender ? c[t.data.gender] : W;
442
+ return (i = t.data) != null && i.gender ? d[t.data.gender] : W;
443
443
  },
444
- filter: R,
445
- floatingFilterComponent: F,
444
+ filter: I,
445
+ floatingFilterComponent: R,
446
446
  filterParams: {
447
447
  options: [
448
- { value: c.m, label: c.m },
449
- { value: c.f, label: c.f },
450
- { value: c.x, label: c.x }
448
+ { value: d.m, label: d.m },
449
+ { value: d.f, label: d.f },
450
+ { value: d.x, label: d.x }
451
451
  ]
452
452
  },
453
453
  minWidth: 110,
@@ -460,17 +460,17 @@ function Qe(e, n = {}) {
460
460
  responsiveTier: "P3",
461
461
  // TagListCellRenderer expects an array; wrap the resolved source string.
462
462
  valueGetter: (t) => {
463
- var o, h;
464
- const i = ((o = t.data) == null ? void 0 : o.source) ?? ((h = t.data) == null ? void 0 : h.customSource);
463
+ var f, b;
464
+ const i = ((f = t.data) == null ? void 0 : f.source) ?? ((b = t.data) == null ? void 0 : b.customSource);
465
465
  return i ? [i] : [];
466
466
  },
467
467
  cellRenderer: ae,
468
468
  filterValueGetter: (t) => {
469
- var i, o;
470
- return ((i = t.data) == null ? void 0 : i.source) ?? ((o = t.data) == null ? void 0 : o.customSource) ?? "";
469
+ var i, f;
470
+ return ((i = t.data) == null ? void 0 : i.source) ?? ((f = t.data) == null ? void 0 : f.customSource) ?? "";
471
471
  },
472
- filter: R,
473
- floatingFilterComponent: F,
472
+ filter: I,
473
+ floatingFilterComponent: R,
474
474
  sortable: !1,
475
475
  minWidth: 120,
476
476
  width: 150
@@ -481,10 +481,10 @@ function Qe(e, n = {}) {
481
481
  headerName: a("dateOfBirth"),
482
482
  hide: !0,
483
483
  field: "dateOfBirth",
484
- cellRenderer: K,
484
+ cellRenderer: q,
485
485
  cellRendererParams: { format: "date" },
486
- filter: _,
487
- floatingFilterComponent: L,
486
+ filter: z,
487
+ floatingFilterComponent: _,
488
488
  minWidth: 140,
489
489
  width: 160
490
490
  },
@@ -493,8 +493,8 @@ function Qe(e, n = {}) {
493
493
  headerName: a("placeOfBirth"),
494
494
  hide: !0,
495
495
  field: "placeOfBirth",
496
- filter: b,
497
- floatingFilterComponent: p,
496
+ filter: C,
497
+ floatingFilterComponent: g,
498
498
  minWidth: 140,
499
499
  width: 160
500
500
  },
@@ -503,8 +503,8 @@ function Qe(e, n = {}) {
503
503
  headerName: a("countryOfBirth"),
504
504
  hide: !0,
505
505
  field: "countryOfBirth",
506
- filter: b,
507
- floatingFilterComponent: p,
506
+ filter: C,
507
+ floatingFilterComponent: g,
508
508
  minWidth: 130,
509
509
  width: 150
510
510
  },
@@ -517,12 +517,12 @@ function Qe(e, n = {}) {
517
517
  var i;
518
518
  return !!((i = t.data) != null && i.smsReminderEligible);
519
519
  },
520
- valueFormatter: (t) => t.value === !0 ? B : W,
521
- filter: R,
522
- floatingFilterComponent: F,
520
+ valueFormatter: (t) => t.value === !0 ? A : W,
521
+ filter: I,
522
+ floatingFilterComponent: R,
523
523
  filterParams: {
524
524
  options: [
525
- { value: !0, label: B },
525
+ { value: !0, label: A },
526
526
  { value: !1, label: W }
527
527
  ]
528
528
  },
@@ -537,12 +537,12 @@ function Qe(e, n = {}) {
537
537
  var i;
538
538
  return !!((i = t.data) != null && i.emailReminderEligible);
539
539
  },
540
- valueFormatter: (t) => t.value === !0 ? B : W,
541
- filter: R,
542
- floatingFilterComponent: F,
540
+ valueFormatter: (t) => t.value === !0 ? A : W,
541
+ filter: I,
542
+ floatingFilterComponent: R,
543
543
  filterParams: {
544
544
  options: [
545
- { value: !0, label: B },
545
+ { value: !0, label: A },
546
546
  { value: !1, label: W }
547
547
  ]
548
548
  },
@@ -554,8 +554,8 @@ function Qe(e, n = {}) {
554
554
  headerName: a("pec"),
555
555
  hide: !0,
556
556
  field: "pecAddress",
557
- filter: b,
558
- floatingFilterComponent: p,
557
+ filter: C,
558
+ floatingFilterComponent: g,
559
559
  minWidth: 200,
560
560
  width: 240
561
561
  },
@@ -565,10 +565,10 @@ function Qe(e, n = {}) {
565
565
  headerName: a("lastVisit"),
566
566
  hide: !0,
567
567
  field: "lastAppointment",
568
- cellRenderer: K,
568
+ cellRenderer: q,
569
569
  cellRendererParams: { format: "relative" },
570
- filter: _,
571
- floatingFilterComponent: L,
570
+ filter: z,
571
+ floatingFilterComponent: _,
572
572
  minWidth: 140,
573
573
  width: 160
574
574
  },
@@ -582,10 +582,10 @@ function Qe(e, n = {}) {
582
582
  // "Fatturabile" is the chip's own `to-invoice` state; `settled` at zero.
583
583
  // Same shape as unpaidBalance: the cell value stays in cents and the
584
584
  // renderer converts, so the inRange filter compares cents directly.
585
- cellRenderer: J,
585
+ cellRenderer: Z,
586
586
  cellRendererParams: { positiveState: "to-invoice" },
587
- filter: H,
588
- floatingFilterComponent: U,
587
+ filter: $,
588
+ floatingFilterComponent: H,
589
589
  filterParams: { defaultOperator: "inRange", min: 0 },
590
590
  minWidth: 140,
591
591
  width: 160
@@ -597,8 +597,8 @@ function Qe(e, n = {}) {
597
597
  field: "defaultDiscount",
598
598
  type: "numericColumn",
599
599
  valueFormatter: (t) => t.value == null ? "" : `${t.value}%`,
600
- filter: H,
601
- floatingFilterComponent: U,
600
+ filter: $,
601
+ floatingFilterComponent: H,
602
602
  minWidth: 110,
603
603
  width: 130
604
604
  },
@@ -608,8 +608,8 @@ function Qe(e, n = {}) {
608
608
  headerName: a("diagnosis"),
609
609
  hide: !0,
610
610
  field: "diagnosis",
611
- filter: b,
612
- floatingFilterComponent: p,
611
+ filter: C,
612
+ floatingFilterComponent: g,
613
613
  minWidth: 180,
614
614
  width: 220
615
615
  },
@@ -618,8 +618,8 @@ function Qe(e, n = {}) {
618
618
  headerName: a("insurance"),
619
619
  hide: !0,
620
620
  field: "defaultInsurance",
621
- filter: R,
622
- floatingFilterComponent: F,
621
+ filter: I,
622
+ floatingFilterComponent: R,
623
623
  minWidth: 140,
624
624
  width: 160
625
625
  },
@@ -627,7 +627,7 @@ function Qe(e, n = {}) {
627
627
  colId: "assignedTo",
628
628
  headerName: a("assignedTo"),
629
629
  hide: !0,
630
- cellRenderer: Ie,
630
+ cellRenderer: Re,
631
631
  valueGetter: (t) => {
632
632
  var i;
633
633
  return (i = t.data) != null && i.personalAssistant ? { name: t.data.personalAssistant } : null;
@@ -637,8 +637,8 @@ function Qe(e, n = {}) {
637
637
  var i;
638
638
  return ((i = t.data) == null ? void 0 : i.personalAssistant) ?? "";
639
639
  },
640
- filter: Re,
641
- floatingFilterComponent: Fe,
640
+ filter: Fe,
641
+ floatingFilterComponent: Ne,
642
642
  minWidth: 160,
643
643
  width: 180
644
644
  },
@@ -647,8 +647,8 @@ function Qe(e, n = {}) {
647
647
  headerName: a("job"),
648
648
  hide: !0,
649
649
  field: "job",
650
- filter: b,
651
- floatingFilterComponent: p,
650
+ filter: C,
651
+ floatingFilterComponent: g,
652
652
  minWidth: 140,
653
653
  width: 160
654
654
  },
@@ -657,30 +657,30 @@ function Qe(e, n = {}) {
657
657
  colId: "marketingConsent",
658
658
  headerName: a("marketingConsent"),
659
659
  hide: !0,
660
- cellRenderer: Pe,
660
+ cellRenderer: Ie,
661
661
  cellRendererParams: {
662
- variantMap: C
662
+ variantMap: p
663
663
  },
664
664
  valueGetter: (t) => {
665
665
  var i;
666
666
  switch ((i = t.data) == null ? void 0 : i.marketingConsent) {
667
667
  case 1:
668
- return m.yes;
668
+ return u.yes;
669
669
  case 0:
670
- return m.no;
670
+ return u.no;
671
671
  default:
672
- return m.notSpecified;
672
+ return u.notSpecified;
673
673
  }
674
674
  },
675
- filter: R,
676
- floatingFilterComponent: F,
675
+ filter: I,
676
+ floatingFilterComponent: R,
677
677
  filterParams: {
678
678
  options: [
679
- { value: m.yes, label: m.yes },
680
- { value: m.no, label: m.no },
679
+ { value: u.yes, label: u.yes },
680
+ { value: u.no, label: u.no },
681
681
  {
682
- value: m.notSpecified,
683
- label: m.notSpecified
682
+ value: u.notSpecified,
683
+ label: u.notSpecified
684
684
  }
685
685
  ]
686
686
  },
@@ -694,12 +694,12 @@ function Qe(e, n = {}) {
694
694
  hide: !0,
695
695
  // `YYYY/N` yearly numbering.
696
696
  valueGetter: (t) => {
697
- var h, v;
698
- const i = (h = t.data) == null ? void 0 : h.yearlyNumberingYear, o = (v = t.data) == null ? void 0 : v.yearlyNumberingNumber;
699
- return i != null && o != null ? `${i}/${o}` : "";
697
+ var b, m;
698
+ const i = (b = t.data) == null ? void 0 : b.yearlyNumberingYear, f = (m = t.data) == null ? void 0 : m.yearlyNumberingNumber;
699
+ return i != null && f != null ? `${i}/${f}` : "";
700
700
  },
701
- filter: b,
702
- floatingFilterComponent: p,
701
+ filter: C,
702
+ floatingFilterComponent: g,
703
703
  minWidth: 120,
704
704
  width: 140
705
705
  },
@@ -711,12 +711,12 @@ function Qe(e, n = {}) {
711
711
  var i;
712
712
  return !!((i = t.data) != null && i.mydentista);
713
713
  },
714
- valueFormatter: (t) => t.value === !0 ? B : W,
715
- filter: R,
716
- floatingFilterComponent: F,
714
+ valueFormatter: (t) => t.value === !0 ? A : W,
715
+ filter: I,
716
+ floatingFilterComponent: R,
717
717
  filterParams: {
718
718
  options: [
719
- { value: !0, label: B },
719
+ { value: !0, label: A },
720
720
  { value: !1, label: W }
721
721
  ]
722
722
  },
@@ -728,10 +728,10 @@ function Qe(e, n = {}) {
728
728
  headerName: a("createdAt"),
729
729
  hide: !0,
730
730
  field: "createdAt",
731
- cellRenderer: K,
731
+ cellRenderer: q,
732
732
  cellRendererParams: { format: "date" },
733
- filter: _,
734
- floatingFilterComponent: L,
733
+ filter: z,
734
+ floatingFilterComponent: _,
735
735
  minWidth: 140,
736
736
  width: 160
737
737
  },
@@ -741,8 +741,8 @@ function Qe(e, n = {}) {
741
741
  headerName: a("city"),
742
742
  hide: !0,
743
743
  field: "city",
744
- filter: b,
745
- floatingFilterComponent: p,
744
+ filter: C,
745
+ floatingFilterComponent: g,
746
746
  minWidth: 120,
747
747
  width: 150
748
748
  },
@@ -751,8 +751,8 @@ function Qe(e, n = {}) {
751
751
  headerName: a("province"),
752
752
  hide: !0,
753
753
  field: "province",
754
- filter: b,
755
- floatingFilterComponent: p,
754
+ filter: C,
755
+ floatingFilterComponent: g,
756
756
  minWidth: 100,
757
757
  width: 120
758
758
  },
@@ -761,8 +761,8 @@ function Qe(e, n = {}) {
761
761
  headerName: a("postcode"),
762
762
  hide: !0,
763
763
  field: "postcode",
764
- filter: b,
765
- floatingFilterComponent: p,
764
+ filter: C,
765
+ floatingFilterComponent: g,
766
766
  minWidth: 110,
767
767
  width: 130
768
768
  },
@@ -771,8 +771,8 @@ function Qe(e, n = {}) {
771
771
  headerName: a("country"),
772
772
  hide: !0,
773
773
  field: "countryCode",
774
- filter: b,
775
- floatingFilterComponent: p,
774
+ filter: C,
775
+ floatingFilterComponent: g,
776
776
  minWidth: 110,
777
777
  width: 130
778
778
  },
@@ -781,13 +781,13 @@ function Qe(e, n = {}) {
781
781
  headerName: a("street"),
782
782
  hide: !0,
783
783
  field: "street",
784
- filter: b,
785
- floatingFilterComponent: p,
784
+ filter: C,
785
+ floatingFilterComponent: g,
786
786
  minWidth: 180,
787
787
  width: 220
788
788
  },
789
789
  /* ── Custom fields (per-practice, dynamic) — appended, hidden ──── */
790
- ...qe(u),
790
+ ...Ye(c),
791
791
  /* ── Actions (P0, pinned-end) ──────────────────────────────────── */
792
792
  {
793
793
  colId: "actions",
@@ -803,13 +803,13 @@ function Qe(e, n = {}) {
803
803
  // other column — no right-aligned header (the actions still sit at the
804
804
  // pinned inline-end edge, the group just starts at the cell's leading edge).
805
805
  cellClass: "ds:justify-start ag-cell-graphic",
806
- cellRenderer: ge,
806
+ cellRenderer: be,
807
807
  cellRendererParams: {
808
- actions: f,
808
+ actions: h,
809
809
  intent: "ghost",
810
810
  group: !0,
811
811
  label: e("patientTable.actions.group"),
812
- collapsed: s
812
+ collapsed: o
813
813
  },
814
814
  sortable: !1,
815
815
  filter: !1,
@@ -817,304 +817,325 @@ function Qe(e, n = {}) {
817
817
  // The renderer collapses to a single overflow trigger via
818
818
  // `getActionsCompact`; the expanded width is DERIVED from the action count
819
819
  // so a row showing every action can't clip — 88px collapsed → fits-all.
820
- width: ie(f.length),
820
+ width: ie(h.length),
821
821
  minWidth: 88
822
822
  // Anchor — never auto-hidden (no tier).
823
823
  }
824
824
  ];
825
825
  }
826
- const Xe = [
826
+ const Qe = /* @__PURE__ */ new Set([
827
+ "api",
828
+ "flex",
829
+ "gridInitializing",
830
+ "gridOptionsChanged",
831
+ "autosizeColumns",
832
+ "sizeColumnsToFit",
833
+ "rowDataUpdated",
834
+ "rowModelUpdated"
835
+ ]), Xe = [
827
836
  { minWidth: 0, tier: "P0" },
828
837
  { minWidth: 640, tier: "P1" },
829
838
  { minWidth: 900, tier: "P2" },
830
839
  { minWidth: 1200, tier: "P3" }
831
840
  ];
832
- function ee(e, n) {
833
- const d = /* @__PURE__ */ new Set();
834
- for (const s of n)
835
- e >= s.minWidth && d.add(s.tier);
836
- return d.add("P0"), d;
837
- }
838
841
  function Je(e, n) {
842
+ const s = /* @__PURE__ */ new Set();
843
+ for (const o of n)
844
+ e >= o.minWidth && s.add(o.tier);
845
+ return s.add("P0"), s;
846
+ }
847
+ function Ze(e, n) {
839
848
  const {
840
- containerRef: d,
841
- enabled: s = !0,
842
- breakpoints: r = Xe
843
- } = n, l = k(/* @__PURE__ */ new Set()), u = k(!1);
849
+ containerRef: s,
850
+ enabled: o = !0,
851
+ breakpoints: l = Xe
852
+ } = n, r = G(/* @__PURE__ */ new Set()), c = G(!1);
844
853
  return te(() => {
845
- const c = d.current;
846
- if (!s || !c) return;
847
- const m = () => {
848
- var o;
849
- return (o = e.current) == null ? void 0 : o.getRawApi();
850
- }, C = (o) => {
851
- if (u.current || o.source === "api") return;
852
- const h = o.columns ?? (o.column ? [o.column] : []);
853
- for (const v of h)
854
- l.current.add(v.getColId());
854
+ const d = s.current;
855
+ if (!o || !d) return;
856
+ const u = () => {
857
+ var m;
858
+ return (m = e.current) == null ? void 0 : m.getRawApi();
855
859
  };
856
- let a = !1;
857
- const T = (o) => {
858
- if (a) return;
859
- a = !0;
860
- const h = o.getColumns(), v = c.getBoundingClientRect().width, D = ee(v, r);
861
- if (h)
862
- for (const w of h) {
863
- const I = q(w.getColDef());
864
- I && !w.isVisible() && D.has(I) && l.current.add(w.getColId());
865
- }
866
- o.addEventListener("columnVisible", C);
867
- }, t = () => {
868
- const o = m();
869
- if (!o) return;
870
- T(o);
871
- const h = o.getColumns();
872
- if (!h) return;
873
- const v = c.getBoundingClientRect().width, D = ee(v, r), w = [], I = [];
874
- for (const S of h) {
875
- const V = S.getColId();
876
- if (l.current.has(V)) continue;
877
- const A = q(S.getColDef());
878
- if (!A) continue;
879
- const E = D.has(A);
880
- E && !S.isVisible() ? w.push(S) : !E && S.isVisible() && I.push(S);
860
+ let p;
861
+ const a = () => {
862
+ p === void 0 && (p = window.setTimeout(() => {
863
+ p = void 0, f();
864
+ }, 0));
865
+ }, T = (m) => {
866
+ var O;
867
+ if (c.current) return;
868
+ if (Qe.has(m.source)) {
869
+ a();
870
+ return;
881
871
  }
882
- if (!(w.length === 0 && I.length === 0)) {
883
- u.current = !0;
872
+ const V = (m.columns ?? (m.column ? [m.column] : [])).map((D) => D.getColId());
873
+ for (const D of V) r.current.add(D);
874
+ (O = e.current) == null || O.markColumnsUserTouched(V);
875
+ };
876
+ let t = !1;
877
+ const i = (m) => {
878
+ t || (t = !0, m.addEventListener("columnVisible", T));
879
+ }, f = () => {
880
+ var M;
881
+ const m = u();
882
+ if (!m) return;
883
+ i(m);
884
+ const x = m.getColumns();
885
+ if (!x) return;
886
+ const V = d.getBoundingClientRect().width, O = Je(V, l), D = new Set(
887
+ ((M = e.current) == null ? void 0 : M.getUserTouchedColumns()) ?? []
888
+ ), P = [], F = [];
889
+ for (const N of x) {
890
+ const L = N.getColId();
891
+ if (r.current.has(L) || D.has(L))
892
+ continue;
893
+ const U = le(N.getColDef());
894
+ if (!U) continue;
895
+ const B = O.has(U);
896
+ B && !N.isVisible() ? P.push(N) : !B && N.isVisible() && F.push(N);
897
+ }
898
+ if (!(P.length === 0 && F.length === 0)) {
899
+ c.current = !0;
884
900
  try {
885
- w.length > 0 && o.setColumnsVisible(w, !0), I.length > 0 && o.setColumnsVisible(I, !1);
901
+ P.length > 0 && m.setColumnsVisible(P, !0), F.length > 0 && m.setColumnsVisible(F, !1);
886
902
  } finally {
887
- u.current = !1;
903
+ c.current = !1;
888
904
  }
889
905
  }
890
- }, i = new ResizeObserver(() => t());
891
- return i.observe(c), t(), () => {
892
- var o;
893
- i.disconnect(), (o = m()) == null || o.removeEventListener("columnVisible", C);
906
+ }, b = new ResizeObserver(() => f());
907
+ return b.observe(d), f(), () => {
908
+ var m;
909
+ b.disconnect(), p !== void 0 && window.clearTimeout(p), (m = u()) == null || m.removeEventListener("columnVisible", T);
894
910
  };
895
- }, [d, s, r, e]), { lockColumns: z((c) => {
896
- for (const m of c) l.current.add(m);
897
- }, []) };
911
+ }, [s, o, l, e]), { lockColumns: j(
912
+ (d) => {
913
+ var u;
914
+ for (const p of d) r.current.add(p);
915
+ (u = e.current) == null || u.markColumnsUserTouched(d);
916
+ },
917
+ [e]
918
+ ) };
898
919
  }
899
- function Ze(e) {
920
+ function et(e) {
900
921
  var n;
901
922
  return (n = e.data) != null && n.isArchived ? "data-table-row-archived" : void 0;
902
923
  }
903
- function et(e) {
924
+ function tt(e) {
904
925
  return e.data.id;
905
926
  }
906
- function tt({
927
+ function nt({
907
928
  views: e,
908
929
  handleRef: n,
909
- lockColumns: d,
910
- label: s
930
+ lockColumns: s,
931
+ label: o
911
932
  }) {
912
- const [r, l] = ne(""), u = Y(
913
- () => e.map((m) => ({ value: m.id, label: m.label })),
933
+ const [l, r] = ne(""), c = Q(
934
+ () => e.map((u) => ({ value: u.id, label: u.label })),
914
935
  [e]
915
- ), f = z(
916
- (m) => {
917
- const C = e.find((t) => t.id === m), a = n.current;
918
- if (!C || !a) return;
936
+ ), h = j(
937
+ (u) => {
938
+ const p = e.find((t) => t.id === u), a = n.current;
939
+ if (!p || !a) return;
919
940
  const T = a.getRawApi();
920
941
  if (T) {
921
- const t = new Set(C.columns), i = [], o = [];
922
- for (const h of T.getColumns() ?? []) {
923
- if (q(h.getColDef()) === void 0) continue;
924
- const v = h.getColId();
925
- t.has(v) ? i.push(v) : o.push(v);
942
+ const t = new Set(p.columns), i = [], f = [];
943
+ for (const b of T.getColumns() ?? []) {
944
+ if (le(b.getColDef()) === void 0) continue;
945
+ const m = b.getColId();
946
+ t.has(m) ? i.push(m) : f.push(m);
926
947
  }
927
- d([...i, ...o]), i.length > 0 && T.setColumnsVisible(i, !0), o.length > 0 && T.setColumnsVisible(o, !1);
948
+ s([...i, ...f]), i.length > 0 && T.setColumnsVisible(i, !0), f.length > 0 && T.setColumnsVisible(f, !1);
928
949
  }
929
- a.setFilter(C.filterModel), a.setSort(C.sortModel), T == null || T.onFilterChanged();
950
+ a.setFilter(p.filterModel), a.setSort(p.sortModel), T == null || T.onFilterChanged();
930
951
  },
931
- [e, n, d]
932
- ), c = z(
933
- (m) => {
934
- l(m), m && f(m);
952
+ [e, n, s]
953
+ ), d = j(
954
+ (u) => {
955
+ r(u), u && h(u);
935
956
  },
936
- [f]
957
+ [h]
937
958
  );
938
959
  return (
939
960
  // Width-constraining wrapper (same pattern as the toolbar's QuickSearch) so
940
961
  // the Select's intrinsic `w-full` trigger sizes to a compact, legible width
941
962
  // instead of absorbing the whole FilterBar row.
942
- /* @__PURE__ */ g("div", { className: "ds:w-[12rem] ds:max-w-full ds:min-w-0 ds:shrink-0", children: /* @__PURE__ */ g(
943
- ve,
963
+ /* @__PURE__ */ v("div", { className: "ds:w-[12rem] ds:max-w-full ds:min-w-0 ds:shrink-0", children: /* @__PURE__ */ v(
964
+ Ce,
944
965
  {
945
- options: u,
946
- value: r,
947
- onValueChange: c,
966
+ options: c,
967
+ value: l,
968
+ onValueChange: d,
948
969
  size: "sm",
949
- "aria-label": s
970
+ "aria-label": o
950
971
  }
951
972
  ) })
952
973
  );
953
974
  }
954
- const nt = pe(
975
+ const it = he(
955
976
  function({
956
977
  rowData: n,
957
- columns: d,
958
- gridId: s,
959
- density: r,
960
- actionsCompact: l,
961
- heightClass: u,
962
- responsive: f = !0,
963
- views: c,
964
- onRowAction: m,
965
- bulkActions: C,
978
+ columns: s,
979
+ gridId: o,
980
+ density: l,
981
+ actionsCompact: r,
982
+ heightClass: c,
983
+ responsive: h = !0,
984
+ views: d,
985
+ onRowAction: u,
986
+ bulkActions: p,
966
987
  loading: a = !1,
967
988
  toolbar: T,
968
989
  hideQuickSearch: t = !1,
969
990
  pagination: i = !1,
970
- paginationPageSizeSelector: o,
971
- hideDetails: h = !1,
972
- identityHref: v,
973
- customFields: D,
974
- "aria-label": w,
975
- className: I
976
- }, S) {
977
- const { t: V } = $("ui"), A = k(null), E = k(null), [M, re] = ne(null);
978
- be(
979
- S,
980
- () => M ?? A.current,
981
- [M]
991
+ paginationPageSizeSelector: f,
992
+ hideDetails: b = !1,
993
+ identityHref: m,
994
+ customFields: x,
995
+ "aria-label": V,
996
+ className: O
997
+ }, D) {
998
+ const { t: P } = K("ui"), F = G(null), M = G(null), [N, L] = ne(null);
999
+ pe(
1000
+ D,
1001
+ () => N ?? F.current,
1002
+ [N]
982
1003
  );
983
- const { lockColumns: oe } = Je(A, {
984
- containerRef: E,
985
- enabled: f
986
- }), G = l ?? r === "compact", Q = k(G), X = z(() => Q.current, []);
1004
+ const { lockColumns: U } = Ze(F, {
1005
+ containerRef: M,
1006
+ enabled: h
1007
+ }), B = r ?? l === "compact", X = G(B), J = j(() => X.current, []);
987
1008
  te(() => {
988
- var P;
989
- Q.current = G;
990
- const N = (P = A.current) == null ? void 0 : P.getRawApi();
991
- N && (N.setColumnWidths([
1009
+ var y;
1010
+ X.current = B;
1011
+ const w = (y = F.current) == null ? void 0 : y.getRawApi();
1012
+ w && (w.setColumnWidths([
992
1013
  {
993
1014
  key: "actions",
994
- newWidth: G ? 88 : ie($e)
1015
+ newWidth: B ? 88 : ie(He)
995
1016
  }
996
- ]), N.refreshCells({ force: !0 }));
997
- }, [G, M]);
998
- const se = Y(
999
- () => d ?? Qe(V, {
1000
- hideDetails: h,
1001
- onRowAction: m,
1002
- identityHref: v,
1003
- customFields: D,
1004
- getActionsCompact: X
1017
+ ]), w.refreshCells({ force: !0 }));
1018
+ }, [B, N]);
1019
+ const oe = Q(
1020
+ () => s ?? qe(P, {
1021
+ hideDetails: b,
1022
+ onRowAction: u,
1023
+ identityHref: m,
1024
+ customFields: x,
1025
+ getActionsCompact: J
1005
1026
  }),
1006
1027
  [
1007
- d,
1008
- V,
1009
- h,
1028
+ s,
1029
+ P,
1030
+ b,
1031
+ u,
1010
1032
  m,
1011
- v,
1012
- D,
1013
- X
1033
+ x,
1034
+ J
1014
1035
  ]
1015
- ), de = ((c == null ? void 0 : c.length) ?? 0) > 0, ce = /* @__PURE__ */ O(y.Toolbar, { children: [
1016
- /* @__PURE__ */ O(y.Toolbar.FilterBar, { children: [
1017
- de && c ? /* @__PURE__ */ g(
1018
- tt,
1036
+ ), se = ((d == null ? void 0 : d.length) ?? 0) > 0, de = /* @__PURE__ */ k(S.Toolbar, { children: [
1037
+ /* @__PURE__ */ k(S.Toolbar.FilterBar, { children: [
1038
+ se && d ? /* @__PURE__ */ v(
1039
+ nt,
1019
1040
  {
1020
- views: c,
1021
- handleRef: A,
1022
- lockColumns: oe,
1023
- label: V("patientTable.views.label")
1041
+ views: d,
1042
+ handleRef: F,
1043
+ lockColumns: U,
1044
+ label: P("patientTable.views.label")
1024
1045
  }
1025
1046
  ) : null,
1026
- t ? null : /* @__PURE__ */ g(y.Toolbar.QuickSearch, {}),
1027
- /* @__PURE__ */ g(y.Toolbar.FilterChips, {})
1047
+ t ? null : /* @__PURE__ */ v(S.Toolbar.QuickSearch, {}),
1048
+ /* @__PURE__ */ v(S.Toolbar.FilterChips, {})
1028
1049
  ] }),
1029
- /* @__PURE__ */ O(y.Toolbar.Actions, { children: [
1030
- C == null ? void 0 : C.map((N) => /* @__PURE__ */ g(
1031
- y.Toolbar.BulkAction,
1050
+ /* @__PURE__ */ k(S.Toolbar.Actions, { children: [
1051
+ p == null ? void 0 : p.map((w) => /* @__PURE__ */ v(
1052
+ S.Toolbar.BulkAction,
1032
1053
  {
1033
- label: N.label,
1034
- icon: N.icon,
1035
- variant: N.variant,
1036
- onClick: (P) => {
1037
- const he = (P == null ? void 0 : P.getSelectedNodes().map((j) => j.id).filter((j) => j != null)) ?? [];
1038
- N.onSelect(he);
1054
+ label: w.label,
1055
+ icon: w.icon,
1056
+ variant: w.variant,
1057
+ onClick: (y) => {
1058
+ const fe = (y == null ? void 0 : y.getSelectedNodes().map((Y) => Y.id).filter((Y) => Y != null)) ?? [];
1059
+ w.onSelect(fe);
1039
1060
  }
1040
1061
  },
1041
- N.id
1062
+ w.id
1042
1063
  )),
1043
- /* @__PURE__ */ g(y.Toolbar.ColumnToggle, {}),
1044
- /* @__PURE__ */ g(y.Toolbar.ExportMenu, {})
1064
+ /* @__PURE__ */ v(S.Toolbar.ColumnToggle, {}),
1065
+ /* @__PURE__ */ v(S.Toolbar.ExportMenu, {})
1045
1066
  ] })
1046
- ] }), ue = T ?? ce, me = a ? void 0 : n, fe = Y(() => ({ getRowId: et }), []);
1047
- return Ne(
1048
- Ce,
1049
- M,
1050
- s
1051
- ), /* @__PURE__ */ g(
1067
+ ] }), ce = T ?? de, ue = a ? void 0 : n, me = Q(() => ({ getRowId: tt }), []);
1068
+ return ve(
1069
+ ge,
1070
+ N,
1071
+ o
1072
+ ), /* @__PURE__ */ v(
1052
1073
  "div",
1053
1074
  {
1054
- ref: E,
1075
+ ref: M,
1055
1076
  role: "region",
1056
- "aria-label": w ?? V("patientTable.regionLabel"),
1077
+ "aria-label": V ?? P("patientTable.regionLabel"),
1057
1078
  "data-component": "patient-table",
1058
- "data-component-id": s,
1079
+ "data-component-id": o,
1059
1080
  className: "ds:flex ds:w-full ds:min-h-0 ds:flex-1 ds:flex-col",
1060
- children: /* @__PURE__ */ g(
1061
- y,
1081
+ children: /* @__PURE__ */ v(
1082
+ S,
1062
1083
  {
1063
- ref: (N) => {
1064
- A.current = N, re(
1065
- (P) => P === N ? P : N
1084
+ ref: (w) => {
1085
+ F.current = w, L(
1086
+ (y) => y === w ? y : w
1066
1087
  );
1067
1088
  },
1068
- gridId: s,
1069
- columnDefs: se,
1070
- rowData: me,
1089
+ gridId: o,
1090
+ columnDefs: oe,
1091
+ rowData: ue,
1071
1092
  rowSelection: "multiple",
1072
1093
  pagination: i,
1073
- ...u !== void 0 ? { heightClass: u } : {},
1074
- ...o !== void 0 ? { paginationPageSizeSelector: o } : {},
1075
- density: r,
1076
- getRowClass: Ze,
1077
- gridOptions: fe,
1078
- className: I,
1079
- children: ue
1094
+ ...c !== void 0 ? { heightClass: c } : {},
1095
+ ...f !== void 0 ? { paginationPageSizeSelector: f } : {},
1096
+ density: l,
1097
+ getRowClass: et,
1098
+ gridOptions: me,
1099
+ className: O,
1100
+ children: ce
1080
1101
  }
1081
1102
  )
1082
1103
  }
1083
1104
  );
1084
1105
  }
1085
1106
  );
1086
- nt.displayName = "PatientTable";
1087
- const it = 5e4;
1088
- function at(e) {
1089
- return e === 0 ? { variant: "success", statusKey: "settled" } : e <= it ? { variant: "warning", statusKey: "pending" } : { variant: "error", statusKey: "overdue" };
1107
+ it.displayName = "PatientTable";
1108
+ const at = 5e4;
1109
+ function rt(e) {
1110
+ return e === 0 ? { variant: "success", statusKey: "settled" } : e <= at ? { variant: "warning", statusKey: "pending" } : { variant: "error", statusKey: "overdue" };
1090
1111
  }
1091
1112
  function lt(e) {
1092
1113
  if (e == null || e === "") return null;
1093
1114
  const n = typeof e == "number" ? e : Number(e);
1094
1115
  return Number.isFinite(n) ? n : null;
1095
1116
  }
1096
- function Rt(e) {
1097
- const { value: n, currency: d = "EUR", options: s } = e, { t: r, i18n: l } = $("ui"), u = lt(n);
1098
- if (u === null) return null;
1099
- const f = l.language || "en", c = new Intl.NumberFormat(f, {
1117
+ function It(e) {
1118
+ const { value: n, currency: s = "EUR", options: o } = e, { t: l, i18n: r } = K("ui"), c = lt(n);
1119
+ if (c === null) return null;
1120
+ const h = r.language || "en", d = new Intl.NumberFormat(h, {
1100
1121
  style: "currency",
1101
- currency: d,
1102
- ...s
1103
- }).format(u / 100), { variant: m, statusKey: C } = at(u), a = r(`patientTable.balance.status.${C}`);
1104
- return /* @__PURE__ */ O(le, { variant: m, withDot: !0, size: "sm", className: "ds:tabular-nums", children: [
1105
- /* @__PURE__ */ g("span", { children: c }),
1106
- /* @__PURE__ */ g("span", { className: "ds:sr-only", children: a })
1122
+ currency: s,
1123
+ ...o
1124
+ }).format(c / 100), { variant: u, statusKey: p } = rt(c), a = l(`patientTable.balance.status.${p}`);
1125
+ return /* @__PURE__ */ k(re, { variant: u, withDot: !0, size: "sm", className: "ds:tabular-nums", children: [
1126
+ /* @__PURE__ */ v("span", { children: d }),
1127
+ /* @__PURE__ */ v("span", { className: "ds:sr-only", children: a })
1107
1128
  ] });
1108
1129
  }
1109
1130
  export {
1110
- Rt as B,
1111
- Ge as C,
1131
+ It as B,
1132
+ ke as C,
1112
1133
  ze as N,
1113
- $e as P,
1114
- J as T,
1115
- nt as a,
1116
- Qe as b,
1117
- q as g,
1118
- Je as u
1134
+ He as P,
1135
+ Z as T,
1136
+ it as a,
1137
+ qe as b,
1138
+ le as g,
1139
+ Ze as u
1119
1140
  };
1120
- //# sourceMappingURL=balance-badge-cell-DHTiSFyD.js.map
1141
+ //# sourceMappingURL=balance-badge-cell-C_Qz76x7.js.map