@bahmni/admin-app 0.0.1-dev.441 → 0.0.1-dev.442

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,11 +1,11 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { A as o, p as a, r as s, t as r } from "./index-C1nJC-ZZ.js";
2
+ import { C as o, F as a, G as s, I } from "./index-gUvbXTOR.js";
3
3
  import "react";
4
4
  import "@tanstack/react-query";
5
5
  const i = () => /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(
6
6
  a,
7
7
  {
8
- extensionPointId: r,
8
+ extensionPointId: I,
9
9
  appName: s,
10
10
  loadingLabelKey: "ADMIN_LOADING_MODULES",
11
11
  errorMessageKey: "ADMIN_ERROR_FETCH_CONFIG",
@@ -1,6 +1,6 @@
1
1
  import { jsx as d, jsxs as S } from "react/jsx-runtime";
2
- import { _ as ee, a0 as te, a1 as se, a2 as K, u as ae, a3 as ne, a4 as re, A as ie, S as oe, a5 as ue, a6 as de, a7 as U, U as H, a8 as le } from "./index-C1nJC-ZZ.js";
3
- import { useState as l, useRef as C, useEffect as k, useMemo as ce, useCallback as me } from "react";
2
+ import { _ as ee, a0 as te, a1 as se, a2 as K, u as ae, a3 as ne, a4 as re, C as ie, U as oe, a5 as ue, a6 as de, a7 as C, Y as V, a8 as le } from "./index-gUvbXTOR.js";
3
+ import { useState as l, useRef as U, useEffect as k, useMemo as ce, useCallback as me } from "react";
4
4
  import { useQuery as _e } from "@tanstack/react-query";
5
5
  const G = Symbol.for("constructDateFrom");
6
6
  function y(e, t) {
@@ -38,9 +38,9 @@ const Le = (e, t) => {
38
38
  startTime: "00:00",
39
39
  username: "",
40
40
  patientId: ""
41
- }), [r, a] = l(0), [i, u] = l(0), [_, E] = l([]), [R, p] = l(null), [b, f] = l(!1), [F, g] = l(!1), [O, M] = l(1), T = C(1), s = (c) => {
41
+ }), [r, a] = l(0), [i, u] = l(0), [_, E] = l([]), [R, p] = l(null), [b, f] = l(!1), [F, g] = l(!1), [O, M] = l(1), T = U(1), s = (c) => {
42
42
  T.current = c, M(c);
43
- }, o = C(0), [n, j] = l(null), B = C(null), { data: N, isLoading: z, isFetching: L, isError: Q } = _e({
43
+ }, o = U(0), [n, j] = l(null), B = U(null), { data: N, isLoading: X, isFetching: L, isError: z } = _e({
44
44
  queryKey: ["auditLogs", n?.requestId],
45
45
  queryFn: () => te(n.params),
46
46
  enabled: !!n,
@@ -48,17 +48,17 @@ const Le = (e, t) => {
48
48
  // (and audit logs must always be fetched fresh). Drop entries as soon as
49
49
  // they become inactive instead of retaining them for the default gcTime.
50
50
  gcTime: 0
51
- }), I = (c, V, m, D, h, $) => {
51
+ }), I = (c, H, m, D, h, $) => {
52
52
  o.current += 1, j({
53
53
  action: c,
54
- params: V,
54
+ params: H,
55
55
  alwaysReplace: m,
56
56
  defaultFirstIndex: D,
57
57
  defaultLastIndex: h,
58
58
  emptyMessageKey: $,
59
59
  requestId: o.current
60
60
  });
61
- }, A = Le(e.startDate, e.startTime), X = () => {
61
+ }, A = Le(e.startDate, e.startTime), Q = () => {
62
62
  I(
63
63
  "init",
64
64
  { startFrom: A, defaultView: !0 },
@@ -131,7 +131,7 @@ const Le = (e, t) => {
131
131
  }), I("init", { defaultView: !0 }, !0, 0, 0, q));
132
132
  };
133
133
  return k(() => {
134
- X();
134
+ Q();
135
135
  }, []), k(() => {
136
136
  if (!n || N === void 0 || B.current === n.requestId) return;
137
137
  B.current = n.requestId;
@@ -152,9 +152,9 @@ const Le = (e, t) => {
152
152
  filters: e,
153
153
  setFilters: t,
154
154
  logs: _,
155
- isLoading: z || L,
155
+ isLoading: X || L,
156
156
  isFetching: L,
157
- isError: Q,
157
+ isError: z,
158
158
  emptyMessageKey: R,
159
159
  firstIndex: r,
160
160
  lastIndex: i,
@@ -256,7 +256,7 @@ const Le = (e, t) => {
256
256
  t.startDate?.getTime() ?? "empty"
257
257
  ),
258
258
  /* @__PURE__ */ d(
259
- U,
259
+ C,
260
260
  {
261
261
  id: "audit-log-start-time",
262
262
  type: "time",
@@ -270,7 +270,7 @@ const Le = (e, t) => {
270
270
  }
271
271
  ),
272
272
  /* @__PURE__ */ d(
273
- U,
273
+ C,
274
274
  {
275
275
  id: "audit-log-username",
276
276
  labelText: e("USERNAME_FILTER_LABEL"),
@@ -284,7 +284,7 @@ const Le = (e, t) => {
284
284
  }
285
285
  ),
286
286
  /* @__PURE__ */ d(
287
- U,
287
+ C,
288
288
  {
289
289
  id: "audit-log-patient-id",
290
290
  labelText: e("PATIENT_ID_FILTER_LABEL"),
@@ -298,7 +298,7 @@ const Le = (e, t) => {
298
298
  }
299
299
  ),
300
300
  /* @__PURE__ */ d(
301
- H,
301
+ V,
302
302
  {
303
303
  kind: "tertiary",
304
304
  onClick: O,
@@ -308,7 +308,7 @@ const Le = (e, t) => {
308
308
  }
309
309
  ),
310
310
  /* @__PURE__ */ d(
311
- H,
311
+ V,
312
312
  {
313
313
  kind: "primary",
314
314
  onClick: g,
@@ -1,22 +1,22 @@
1
1
  import { jsx as n, jsxs as d } from "react/jsx-runtime";
2
- import { u as M, z as N, x as R, y as O, C as h, M as P, O as g, A as V, S as x, T as D, U as f, V as y } from "./index-C1nJC-ZZ.js";
3
- import { useState as E, useMemo as b } from "react";
2
+ import { u as N, z as A, K as R, M as O, N as h, O as P, P as g, C as V, U as D, V as f, Y as x, Z as b } from "./index-gUvbXTOR.js";
3
+ import { useState as E, useMemo as y } from "react";
4
4
  import { useQuery as L, useMutation as v } from "@tanstack/react-query";
5
5
  const X = "CsvExport-module_tile__yBrLM", B = "CsvExport-module_title__epZnI", U = "CsvExport-module_form__w-cN-", z = "CsvExport-module_search__G82i7", r = {
6
6
  tile: X,
7
7
  title: B,
8
8
  form: U,
9
9
  search: z
10
- }, G = 300, S = 2, _ = 5e3, H = "custom:(uuid,setMembers:(uuid))", K = () => {
11
- const { t } = M(), { addNotification: i } = N(), [p, C] = E(""), [s, c] = E(
10
+ }, G = 300, p = 2, _ = 5e3, H = "custom:(uuid,setMembers:(uuid))", K = () => {
11
+ const { t } = N(), { addNotification: i } = A(), [C, S] = E(""), [s, c] = E(
12
12
  null
13
- ), a = R(p.trim(), G), { data: l = [] } = L({
13
+ ), a = R(C.trim(), G), { data: l = [] } = L({
14
14
  queryKey: ["csvExportConceptSearch", a],
15
15
  queryFn: () => O(a),
16
- enabled: a.length >= S && a !== s?.name,
16
+ enabled: a.length >= p && a !== s?.name,
17
17
  // Keep prior options visible while the next term loads, but not once the input is too short to search
18
- placeholderData: (e) => a.length >= S ? e : void 0
19
- }), T = b(
18
+ placeholderData: (e) => a.length >= p ? e : void 0
19
+ }), T = y(
20
20
  () => l.flatMap(
21
21
  (e) => e.name?.name ? [{ uuid: e.uuid, name: e.name.name }] : []
22
22
  ),
@@ -50,8 +50,8 @@ const X = "CsvExport-module_tile__yBrLM", B = "CsvExport-module_title__epZnI", U
50
50
  });
51
51
  }
52
52
  }), I = (e) => {
53
- C(e), s && e !== s.name && c(null);
54
- }, A = (e) => {
53
+ S(e), s && e !== s.name && c(null);
54
+ }, M = (e) => {
55
55
  if (e.preventDefault(), !o.isPending) {
56
56
  if (!s) {
57
57
  i({
@@ -66,7 +66,7 @@ const X = "CsvExport-module_tile__yBrLM", B = "CsvExport-module_title__epZnI", U
66
66
  }
67
67
  };
68
68
  return /* @__PURE__ */ n(V, { breadcrumbLabel: t("BREADCRUMB_CSV_EXPORT"), children: /* @__PURE__ */ d(
69
- x,
69
+ D,
70
70
  {
71
71
  id: "admin-csv-export-page",
72
72
  "data-testid": "admin-csv-export-page-test-id",
@@ -74,9 +74,9 @@ const X = "CsvExport-module_tile__yBrLM", B = "CsvExport-module_title__epZnI", U
74
74
  className: r.tile,
75
75
  children: [
76
76
  /* @__PURE__ */ n("h2", { className: r.title, children: t("ADMIN_CSV_EXPORT_TITLE") }),
77
- /* @__PURE__ */ d("form", { className: r.form, onSubmit: A, noValidate: !0, children: [
77
+ /* @__PURE__ */ d("form", { className: r.form, onSubmit: M, noValidate: !0, children: [
78
78
  /* @__PURE__ */ n("div", { className: r.search, children: /* @__PURE__ */ n(
79
- D,
79
+ f,
80
80
  {
81
81
  id: "csv-export-concept-search",
82
82
  "data-testid": "csv-export-concept-search-test-id",
@@ -96,7 +96,7 @@ const X = "CsvExport-module_tile__yBrLM", B = "CsvExport-module_title__epZnI", U
96
96
  }
97
97
  ) }),
98
98
  /* @__PURE__ */ n(
99
- f,
99
+ x,
100
100
  {
101
101
  type: "submit",
102
102
  kind: "primary",
@@ -104,7 +104,7 @@ const X = "CsvExport-module_tile__yBrLM", B = "CsvExport-module_title__epZnI", U
104
104
  testId: "csv-export-button-test-id",
105
105
  disabled: o.isPending,
106
106
  children: o.isPending ? /* @__PURE__ */ n(
107
- y,
107
+ b,
108
108
  {
109
109
  description: t("ADMIN_CSV_EXPORT_IN_PROGRESS"),
110
110
  testId: "csv-export-loading-test-id"
@@ -1,5 +1,5 @@
1
1
  import { jsx as a, jsxs as e } from "react/jsx-runtime";
2
- import { u as d, A as o } from "./index-C1nJC-ZZ.js";
2
+ import { u as d, C as o } from "./index-gUvbXTOR.js";
3
3
  const t = "CsvUpload-module_page__AxMNv", i = {
4
4
  page: t
5
5
  }, n = () => {
@@ -1,5 +1,5 @@
1
- import { jsx as d, jsxs as h, Fragment as x } from "react/jsx-runtime";
2
- import { d as G, u as W, z as Y, P as J, s as X, h as Z, $ as ee, a as te } from "./index-C1nJC-ZZ.js";
1
+ import { jsx as d, jsxs as h, Fragment as G } from "react/jsx-runtime";
2
+ import { d as Q, u as W, z as J, a as Y, J as X, h as Z, $ as ee, b as te } from "./index-gUvbXTOR.js";
3
3
  import { useQuery as ae } from "@tanstack/react-query";
4
4
  import { useState as l, useCallback as _, useEffect as I, useMemo as p } from "react";
5
5
  const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTable-module_viewAttachmentsLink__aQ1on", de = "DocumentsTable-module_documentViewerContainer__F5m8D", re = "DocumentsTable-module_attachmentItem__17KA7", se = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", ce = "DocumentsTable-module_documentIframe__ptq5I", le = "DocumentsTable-module_documentImage__KQVgS", r = {
@@ -38,13 +38,13 @@ const Te = [
38
38
  null
39
39
  ), [$, O] = l(
40
40
  /* @__PURE__ */ new Set()
41
- ), g = G(), { t: n } = W(), { addNotification: L } = Y(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), M = _((e) => {
41
+ ), g = Q(), { t: n } = W(), { addNotification: L } = J(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), M = _((e) => {
42
42
  U(e), w(!0);
43
43
  }, []), H = _(() => {
44
44
  w(!1), U(null), O(/* @__PURE__ */ new Set());
45
45
  }, []), v = _((e) => {
46
46
  O((t) => new Set(t).add(e));
47
- }, []), { data: i, isLoading: P, isError: y, error: b } = ae({
47
+ }, []), { data: i, isLoading: q, isError: y, error: b } = ae({
48
48
  queryKey: [
49
49
  "documents",
50
50
  g,
@@ -53,7 +53,7 @@ const Te = [
53
53
  u
54
54
  ],
55
55
  enabled: !!g,
56
- queryFn: () => J(
56
+ queryFn: () => Y(
57
57
  g,
58
58
  E,
59
59
  u,
@@ -89,7 +89,7 @@ const Te = [
89
89
  e.signal.aborted || O(t);
90
90
  })(), () => e.abort();
91
91
  }, [s, o]);
92
- const q = _(
92
+ const z = _(
93
93
  (e, t) => {
94
94
  t !== u ? (V(t), C(1), A(void 0)) : C(e);
95
95
  },
@@ -97,7 +97,7 @@ const Te = [
97
97
  ), N = p(
98
98
  () => a?.fields ?? Te,
99
99
  [a?.fields]
100
- ), z = p(() => [...i?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [i]), j = p(() => ie(N, n), [N, n]), K = p(
100
+ ), j = p(() => [...i?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [i]), P = p(() => ie(N, n), [N, n]), K = p(
101
101
  () => N.map((e) => ({
102
102
  key: e,
103
103
  sortable: e !== "attachments"
@@ -106,7 +106,7 @@ const Te = [
106
106
  ), T = p(
107
107
  () => o ? B(o) : [],
108
108
  [o]
109
- ), Q = _(
109
+ ), x = _(
110
110
  (e, t) => {
111
111
  switch (t) {
112
112
  case "documentIdentifier":
@@ -137,24 +137,24 @@ const Te = [
137
137
  },
138
138
  [M, n]
139
139
  );
140
- return /* @__PURE__ */ h(x, { children: [
140
+ return /* @__PURE__ */ h(G, { children: [
141
141
  /* @__PURE__ */ d("div", { "data-testid": "documents-table", children: /* @__PURE__ */ d(
142
142
  ee,
143
143
  {
144
- headers: j,
144
+ headers: P,
145
145
  ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
146
- rows: z,
147
- loading: P,
146
+ rows: j,
147
+ loading: q,
148
148
  errorStateMessage: y ? b?.message : null,
149
149
  sortable: K,
150
150
  emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
151
- renderCell: Q,
151
+ renderCell: x,
152
152
  className: r.documentsTableBody,
153
153
  dataTestId: "documents-table",
154
154
  pageSize: u,
155
155
  totalItems: F,
156
156
  page: f,
157
- onPageChange: q
157
+ onPageChange: z
158
158
  }
159
159
  ) }),
160
160
  s && o && /* @__PURE__ */ d(
@@ -1,48 +1,48 @@
1
1
  import { jsx as n, jsxs as q, Fragment as ne } from "react/jsx-runtime";
2
- import { u as de, d as ie, v as le, k as me, H as ue, B as ce, b as fe, D as ye, w as Ne, N as he, c as ge, R as Te, h as pe, L as V, e as $, s as Oe, $ as K, W as be, q as Ie, a as Ee, f as _e, g as Ae } from "./index-C1nJC-ZZ.js";
3
- import { useQueryClient as ve, useQuery as E } from "@tanstack/react-query";
4
- import { useState as j, useMemo as d, useCallback as i } from "react";
5
- const Be = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_modalHeading__wnTmA", Re = "FormsTable-module_customAccordianItem__isszs", g = {
6
- formsTableBody: Be,
7
- modalHeading: Le,
8
- customAccordianItem: Re
9
- }, Ce = "startConsultation", Me = ({
10
- episodeOfCareUuids: _,
2
+ import { u as ie, d as de, c as le, k as me, H as ue, o as ce, E as fe, Q as ye, w as Te, D as he, R as Ne, e as ge, h as pe, L as V, T as $, J as Oe, $ as K, W as be, q as Ee, b as Ie, f as Ae, g as Re } from "./index-gUvbXTOR.js";
3
+ import { useQueryClient as _e, useQuery as I } from "@tanstack/react-query";
4
+ import { useState as Q, useMemo as i, useCallback as d } from "react";
5
+ const Le = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_modalHeading__wnTmA", ve = "FormsTable-module_customAccordianItem__isszs", N = {
6
+ formsTableBody: Le,
7
+ modalHeading: Ce,
8
+ customAccordianItem: ve
9
+ }, Fe = "startConsultation", Me = ({
10
+ episodeOfCareUuids: A,
11
11
  encounterUuids: l,
12
- config: x,
13
- disableActions: z = !1,
12
+ config: z,
13
+ disableActions: j = !1,
14
14
  activeEncounterUuid: y = null
15
15
  }) => {
16
- const { t: o } = de(), m = ie(), [T, A] = j(!1), [t, v] = j(null), {
17
- numberOfVisits: Q,
16
+ const { t: o } = ie(), m = de(), [g, R] = Q(!1), [t, _] = Q(null), {
17
+ numberOfVisits: x,
18
18
  hideThumbnail: G = !1,
19
- forms: N
20
- } = x ?? {}, W = le(
21
- Ae.EDIT_OBSERVATIONS
22
- ), { userPrivileges: h } = me(), p = W && !z && !!y, B = ue(
23
- _,
19
+ forms: T
20
+ } = z ?? {}, J = le(
21
+ Re.EDIT_OBSERVATIONS
22
+ ), { userPrivileges: h } = me(), p = J && !j && !!y, L = ue(
23
+ A,
24
24
  l
25
- ), P = ve(), {
26
- data: L = [],
27
- isLoading: R,
28
- isError: C,
29
- error: Y,
30
- refetch: J
31
- } = E({
32
- queryKey: ["forms", m, _],
33
- queryFn: () => ce(m, void 0, Q),
34
- enabled: !!m && !B
35
- }), F = d(() => {
36
- let e = L;
25
+ ), W = _e(), {
26
+ data: C = [],
27
+ isLoading: v,
28
+ isError: F,
29
+ error: P,
30
+ refetch: Y
31
+ } = I({
32
+ queryKey: ["forms", m, A],
33
+ queryFn: () => ce(m, void 0, x),
34
+ enabled: !!m && !L
35
+ }), B = i(() => {
36
+ let e = C;
37
37
  return l && l.length > 0 && (e = e.filter(
38
38
  (r) => l.includes(r.encounterUuid)
39
- )), Array.isArray(N) && N.length > 0 && (e = e.filter(
40
- (r) => N.some((a) => a.toLowerCase() === r.formName.toLowerCase())
39
+ )), Array.isArray(T) && T.length > 0 && (e = e.filter(
40
+ (r) => T.some((a) => a.toLowerCase() === r.formName.toLowerCase())
41
41
  )), e;
42
- }, [L, l, N]), { data: D = [] } = E({
42
+ }, [C, l, T]), { data: D = [] } = I({
43
43
  queryKey: ["observationForms"],
44
44
  queryFn: () => fe()
45
- }), U = i(
45
+ }), U = d(
46
46
  (e) => {
47
47
  const r = D.find(
48
48
  (s) => s.name.toLowerCase() === e.toLowerCase()
@@ -55,7 +55,7 @@ const Be = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
55
55
  );
56
56
  },
57
57
  [D, h]
58
- ), u = i(
58
+ ), u = d(
59
59
  (e) => !y || e.encounterUuid !== y ? !1 : U(e.formName),
60
60
  [y, U]
61
61
  ), {
@@ -63,40 +63,40 @@ const Be = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
63
63
  isLoading: X,
64
64
  isError: Z,
65
65
  error: b
66
- } = E({
66
+ } = I({
67
67
  queryKey: ["formsEncounterFHIR", t?.encounterUuid],
68
68
  queryFn: () => ye(t.encounterUuid),
69
- enabled: !!t?.encounterUuid && T
69
+ enabled: !!t?.encounterUuid && g
70
70
  });
71
- Ne(
71
+ Te(
72
72
  (e) => {
73
- e.patientUUID === m && (J(), P.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
73
+ e.patientUUID === m && (Y(), W.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
74
74
  },
75
75
  [m]
76
76
  );
77
- const ee = d(() => !O?.entry || !t?.formName ? [] : O.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => he(e) ? ge(e)?.toLowerCase() === t.formName.toLowerCase() : !0), [O, t?.formName]), re = d(() => {
77
+ const ee = i(() => !O?.entry || !t?.formName ? [] : O.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => he(e) ? Ne(e)?.toLowerCase() === t.formName.toLowerCase() : !0), [O, t?.formName]), re = i(() => {
78
78
  if (b)
79
- return Te(b).message;
80
- }, [b]), c = d(
79
+ return ge(b).message;
80
+ }, [b]), c = i(
81
81
  () => [
82
82
  { key: "recordedOn", header: o("RECORDED_ON") },
83
83
  { key: "recordedBy", header: o("RECORDED_BY") }
84
84
  ],
85
85
  [o]
86
- ), S = d(
86
+ ), S = i(
87
87
  () => [...c, { key: "actions", header: o("ACTIONS") }],
88
88
  [c, o]
89
- ), ae = i(
89
+ ), ae = d(
90
90
  (e) => p && e.some((r) => u(r)) ? S : c,
91
91
  [p, u, S, c]
92
- ), oe = c, te = d(
92
+ ), oe = c, te = i(
93
93
  () => [
94
94
  { key: "recordedOn", sortable: !0 },
95
95
  { key: "recordedBy", sortable: !0 }
96
96
  ],
97
97
  []
98
- ), M = d(() => {
99
- const e = F.reduce(
98
+ ), M = i(() => {
99
+ const e = B.reduce(
100
100
  (r, a) => {
101
101
  const s = a.formName;
102
102
  r[s] ??= [];
@@ -120,13 +120,13 @@ const Be = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
120
120
  )
121
121
  })
122
122
  ).sort((r, a) => r.formName.localeCompare(a.formName));
123
- }, [F, o]), k = i((e) => {
124
- v(e), A(!0);
125
- }, []), w = i(() => {
126
- A(!1), v(null);
127
- }, []), I = i((e) => {
123
+ }, [B, o]), k = d((e) => {
124
+ _(e), R(!0);
125
+ }, []), w = d(() => {
126
+ R(!1), _(null);
127
+ }, []), E = d((e) => {
128
128
  globalThis.dispatchEvent(
129
- new CustomEvent(Ce, {
129
+ new CustomEvent(Fe, {
130
130
  detail: {
131
131
  editOnly: "observationForms",
132
132
  editTitle: "EDIT_OBSERVATION_FORM_TITLE",
@@ -136,7 +136,7 @@ const Be = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
136
136
  }
137
137
  })
138
138
  );
139
- }, []), H = i(
139
+ }, []), H = d(
140
140
  (e, r) => {
141
141
  switch (r) {
142
142
  case "recordedOn":
@@ -151,7 +151,7 @@ const Be = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
151
151
  kind: "ghost",
152
152
  size: "sm",
153
153
  testId: `edit-form-${e.encounterUuid}`,
154
- onClick: () => I(e),
154
+ onClick: () => E(e),
155
155
  children: /* @__PURE__ */ n($, {})
156
156
  }
157
157
  ) : null;
@@ -159,29 +159,29 @@ const Be = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
159
159
  return null;
160
160
  }
161
161
  },
162
- [k, I, u, o]
162
+ [k, E, u, o]
163
163
  );
164
164
  return /* @__PURE__ */ q(ne, { children: [
165
- /* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: R || C || M.length === 0 || B ? /* @__PURE__ */ n(
165
+ /* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: v || F || M.length === 0 || L ? /* @__PURE__ */ n(
166
166
  K,
167
167
  {
168
168
  headers: oe,
169
169
  ariaLabel: o("FORMS_HEADING"),
170
170
  rows: [],
171
- loading: R,
172
- errorStateMessage: C ? Y?.message : void 0,
171
+ loading: v,
172
+ errorStateMessage: F ? P?.message : void 0,
173
173
  emptyStateMessage: o("FORMS_UNAVAILABLE"),
174
174
  renderCell: H,
175
- className: g.formsTableBody,
175
+ className: N.formsTableBody,
176
176
  dataTestId: "forms-table"
177
177
  }
178
178
  ) : /* @__PURE__ */ n(be, { align: "start", children: M.map((e, r) => {
179
179
  const { formName: a, records: s } = e, f = ae(s);
180
180
  return /* @__PURE__ */ n(
181
- Ie,
181
+ Ee,
182
182
  {
183
183
  title: a,
184
- className: g.customAccordianItem,
184
+ className: N.customAccordianItem,
185
185
  testId: `accordian-title-${a}`,
186
186
  open: r === 0,
187
187
  children: /* @__PURE__ */ n(
@@ -195,7 +195,7 @@ const Be = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
195
195
  sortable: te,
196
196
  emptyStateMessage: o("FORMS_UNAVAILABLE"),
197
197
  renderCell: H,
198
- className: g.formsTableBody,
198
+ className: N.formsTableBody,
199
199
  dataTestId: `forms-table-${a}`
200
200
  }
201
201
  )
@@ -203,14 +203,14 @@ const Be = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
203
203
  a
204
204
  );
205
205
  }) }) }),
206
- T && t && /* @__PURE__ */ n(
207
- Ee,
206
+ g && t && /* @__PURE__ */ n(
207
+ Ie,
208
208
  {
209
209
  id: "modalIdForActionAreaLayout",
210
210
  portalId: "main-display-area",
211
- open: T,
211
+ open: g,
212
212
  onRequestClose: w,
213
- modalHeading: /* @__PURE__ */ q("div", { className: g.modalHeading, children: [
213
+ modalHeading: /* @__PURE__ */ q("div", { className: N.modalHeading, children: [
214
214
  /* @__PURE__ */ n("span", { children: t.formName }),
215
215
  p && u(t) && /* @__PURE__ */ n(
216
216
  V,
@@ -220,7 +220,7 @@ const Be = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
220
220
  size: "sm",
221
221
  testId: `edit-form-modal-${t.encounterUuid}`,
222
222
  onClick: () => {
223
- w(), I(t);
223
+ w(), E(t);
224
224
  },
225
225
  children: /* @__PURE__ */ n($, {})
226
226
  }
@@ -231,7 +231,7 @@ const Be = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
231
231
  size: "md",
232
232
  testId: "form-details-modal",
233
233
  children: /* @__PURE__ */ n(
234
- _e,
234
+ Ae,
235
235
  {
236
236
  observations: ee,
237
237
  isLoading: X,
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-DsTQkrYO.js";
2
- import { a9 as d, aa as f, ab as e } from "./index-C1nJC-ZZ.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-Dyjz9YII.js";
2
+ import { a9 as d, aa as f, ab as e } from "./index-gUvbXTOR.js";
3
3
  var p = (a) => {
4
4
  const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
1
- import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-DsTQkrYO.js";
2
- import { a9 as v, aa as C, ab as e } from "./index-C1nJC-ZZ.js";
1
+ import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-Dyjz9YII.js";
2
+ import { a9 as v, aa as C, ab as e } from "./index-gUvbXTOR.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"