@bahmni/appointments-app 0.0.1-dev.193 → 0.0.1-dev.194

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,7 +1,7 @@
1
- import { jsx as o, jsxs as l, Fragment as $ } from "react/jsx-runtime";
2
- import { d as V, u as F, t as H, a as x, O as z, R as P, N as j, L as G, z as W } from "./index-Dsl0jQut.js";
3
- import { useState as C, useCallback as T, useEffect as S, useMemo as E } from "react";
4
- const Y = "_documentsTableBody_6qsah_1", J = "_viewAttachmentsLink_6qsah_11", K = "_documentViewerContainer_6qsah_15", Q = "_attachmentItem_6qsah_23", X = "_attachmentCounter_6qsah_27", Z = "_attachmentError_6qsah_36", ee = "_documentIframe_6qsah_44", te = "_documentImage_6qsah_50", d = {
1
+ import { jsx as o, jsxs as l, Fragment as k } from "react/jsx-runtime";
2
+ import { d as V, u as F, t as H, a as q, O as x, R as z, N as P, L as G, z as W } from "./index-ClooEAJt.js";
3
+ import { useState as O, useCallback as T, useEffect as S, useMemo as p } from "react";
4
+ const Y = "_documentsTableBody_1voj8_1", J = "_viewAttachmentsLink_1voj8_11", K = "_documentViewerContainer_1voj8_15", Q = "_attachmentItem_1voj8_23", X = "_attachmentCounter_1voj8_27", Z = "_attachmentError_1voj8_36", ee = "_documentIframe_1voj8_44", te = "_documentImage_1voj8_50", d = {
5
5
  documentsTableBody: Y,
6
6
  viewAttachmentsLink: J,
7
7
  documentViewerContainer: K,
@@ -32,60 +32,60 @@ const re = [
32
32
  "uploadedOn",
33
33
  "uploadedBy",
34
34
  "action"
35
- ], w = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], ce = ({ config: a, encounterUuids: u }) => {
36
- const [s, A] = C(!1), [r, g] = C(
35
+ ], oe = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, v = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], ie = ({ config: a, encounterUuids: u }) => {
36
+ const [s, C] = O(!1), [r, A] = O(
37
37
  null
38
- ), [M, N] = C(
38
+ ), [w, E] = O(
39
39
  /* @__PURE__ */ new Set()
40
- ), p = V(), { t: n } = F(), { addNotification: y } = H(), D = T((e) => {
41
- g(e), A(!0);
42
- }, []), b = T(() => {
43
- A(!1), g(null), N(/* @__PURE__ */ new Set());
40
+ ), N = V(), { t: n } = F(), { addNotification: y } = H(), D = T((e) => {
41
+ A(e), C(!0);
42
+ }, []), M = T(() => {
43
+ C(!1), A(null), E(/* @__PURE__ */ new Set());
44
44
  }, []), L = T((e) => {
45
- N((t) => new Set(t).add(e));
46
- }, []), { data: R, isLoading: q, isError: f, error: I } = x({
47
- queryKey: ["documents", p, u],
48
- enabled: !!p,
49
- queryFn: () => W(p, u)
45
+ E((t) => new Set(t).add(e));
46
+ }, []), { data: b, isLoading: R, isError: f, error: g } = q({
47
+ queryKey: ["documents", N, u],
48
+ enabled: !!N,
49
+ queryFn: () => W(N, u)
50
50
  });
51
51
  S(() => {
52
52
  f && y({
53
53
  title: n("ERROR_DEFAULT_TITLE"),
54
- message: I?.message ?? "",
54
+ message: g?.message ?? "",
55
55
  type: "error"
56
56
  });
57
- }, [f, I, y, n]), S(() => {
57
+ }, [f, g, y, n]), S(() => {
58
58
  const e = new AbortController();
59
59
  return (async () => {
60
60
  if (!s || !r) return;
61
- const t = /* @__PURE__ */ new Set(), c = w(r);
62
- for (let m = 0; m < c.length; m++) {
63
- const O = U(c[m].url);
61
+ const t = /* @__PURE__ */ new Set(), c = v(r);
62
+ for (let i = 0; i < c.length; i++) {
63
+ const I = U(c[i].url);
64
64
  try {
65
- (await fetch(O, {
65
+ (await fetch(I, {
66
66
  method: "HEAD",
67
67
  signal: e.signal
68
- })).ok || t.add(m);
69
- } catch (_) {
70
- _ instanceof Error && _.name !== "AbortError" && t.add(m);
68
+ })).ok || t.add(i);
69
+ } catch (h) {
70
+ h instanceof Error && h.name !== "AbortError" && t.add(i);
71
71
  }
72
72
  }
73
- e.signal.aborted || N(t);
73
+ e.signal.aborted || E(t);
74
74
  })(), () => e.abort();
75
75
  }, [s, r]);
76
- const h = E(
76
+ const _ = p(
77
77
  () => a?.fields ?? re,
78
78
  [a?.fields]
79
- ), B = E(() => ne(h, n), [h, n]), v = E(
80
- () => h.map((e) => ({
79
+ ), j = p(() => ne(_, n), [_, n]), B = p(
80
+ () => _.map((e) => ({
81
81
  key: e,
82
82
  sortable: e !== "action"
83
83
  })),
84
- [h]
85
- ), i = E(
86
- () => r ? w(r) : [],
84
+ [_]
85
+ ), m = p(
86
+ () => r ? v(r) : [],
87
87
  [r]
88
- ), k = T(
88
+ ), $ = T(
89
89
  (e, t) => {
90
90
  switch (t) {
91
91
  case "documentIdentifier":
@@ -93,7 +93,7 @@ const re = [
93
93
  case "documentType":
94
94
  return e.documentType ?? n("DOCUMENTS_NOT_AVAILABLE");
95
95
  case "uploadedOn":
96
- return P(
96
+ return z(
97
97
  e.uploadedOn,
98
98
  n,
99
99
  !0
@@ -102,7 +102,7 @@ const re = [
102
102
  return e.uploadedBy ?? n("DOCUMENTS_NOT_AVAILABLE");
103
103
  case "action":
104
104
  return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ o(
105
- z,
105
+ x,
106
106
  {
107
107
  onClick: () => D(e),
108
108
  className: d.viewAttachmentsLink,
@@ -116,18 +116,18 @@ const re = [
116
116
  },
117
117
  [D, n]
118
118
  );
119
- return /* @__PURE__ */ l($, { children: [
119
+ return /* @__PURE__ */ l(k, { children: [
120
120
  /* @__PURE__ */ o("div", { "data-testid": "documents-table", children: /* @__PURE__ */ o(
121
- j,
121
+ P,
122
122
  {
123
- headers: B,
123
+ headers: j,
124
124
  ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
125
- rows: R ?? [],
126
- loading: q,
127
- errorStateMessage: f ? I?.message : null,
128
- sortable: v,
125
+ rows: b ?? [],
126
+ loading: R,
127
+ errorStateMessage: f ? g?.message : null,
128
+ sortable: B,
129
129
  emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
130
- renderCell: k,
130
+ renderCell: $,
131
131
  className: d.documentsTableBody,
132
132
  dataTestId: "documents-table"
133
133
  }
@@ -138,23 +138,23 @@ const re = [
138
138
  id: "modalIdForActionAreaLayout",
139
139
  portalId: "main-display-area",
140
140
  open: s,
141
- onRequestClose: b,
141
+ onRequestClose: M,
142
142
  modalHeading: r.documentIdentifier,
143
143
  passiveModal: !0,
144
144
  size: "lg",
145
145
  testId: "document-view-modal",
146
- children: /* @__PURE__ */ o("div", { className: d.documentViewerContainer, children: i.map((e, t) => {
147
- const c = U(e.url), m = e.contentType?.toLowerCase().includes("pdf"), O = e.contentType?.toLowerCase().includes("image"), _ = M.has(t);
148
- return c === "#" || _ ? /* @__PURE__ */ l(
146
+ children: /* @__PURE__ */ o("div", { className: d.documentViewerContainer, children: m.map((e, t) => {
147
+ const c = U(e.url), i = e.contentType?.toLowerCase().includes("pdf"), I = (e.contentType?.toLowerCase().includes("image") ?? !1) || oe.test(e.url ?? ""), h = w.has(t);
148
+ return c === "#" || h ? /* @__PURE__ */ l(
149
149
  "div",
150
150
  {
151
151
  className: d.attachmentError,
152
152
  "data-testid": `attachment-error-${t}`,
153
153
  children: [
154
- i.length > 1 && /* @__PURE__ */ l("p", { className: d.attachmentCounter, children: [
154
+ m.length > 1 && /* @__PURE__ */ l("p", { className: d.attachmentCounter, children: [
155
155
  t + 1,
156
156
  "/",
157
- i.length
157
+ m.length
158
158
  ] }),
159
159
  /* @__PURE__ */ o("p", { children: n("DOCUMENTS_ERROR_LOADING_ATTACHMENT") })
160
160
  ]
@@ -166,12 +166,12 @@ const re = [
166
166
  className: d.attachmentItem,
167
167
  "data-testid": `attachment-item-${t}`,
168
168
  children: [
169
- i.length > 1 && /* @__PURE__ */ l("p", { className: d.attachmentCounter, children: [
169
+ m.length > 1 && /* @__PURE__ */ l("p", { className: d.attachmentCounter, children: [
170
170
  t + 1,
171
171
  "/",
172
- i.length
172
+ m.length
173
173
  ] }),
174
- O ? /* @__PURE__ */ o(
174
+ I ? /* @__PURE__ */ o(
175
175
  "img",
176
176
  {
177
177
  src: c,
@@ -182,7 +182,7 @@ const re = [
182
182
  ) : /* @__PURE__ */ o(
183
183
  "iframe",
184
184
  {
185
- src: m ? `${c}#toolbar=0` : c,
185
+ src: i ? `${c}#toolbar=0` : c,
186
186
  className: d.documentIframe,
187
187
  title: r.documentIdentifier,
188
188
  onError: () => L(t)
@@ -198,5 +198,5 @@ const re = [
198
198
  ] });
199
199
  };
200
200
  export {
201
- ce as default
201
+ ie as default
202
202
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as o, jsxs as p, Fragment as P } from "react/jsx-runtime";
2
- import { u as O, d as ae, m as te, b as oe, a as L, E as ne, R as se, O as de, N as q, W as me, K as ie, L as le, X as ce, I as H, V as ue, n as k, C, c as be, e as pe, r as _e, f as fe, g as $e, h as ge, i as he, x as ve, M as ye } from "./index-Dsl0jQut.js";
2
+ import { u as O, d as ae, m as te, b as oe, a as L, E as ne, R as se, O as de, N as q, W as me, K as ie, L as le, X as ce, I as H, V as ue, n as k, C, c as be, e as pe, r as _e, f as fe, g as $e, h as ge, i as he, x as ve, M as ye } from "./index-ClooEAJt.js";
3
3
  import { useState as K, useMemo as v, useCallback as R } from "react";
4
4
  const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re = "_formContent_1pd36_18", Ce = "_formDetailsContainer_1pd36_25", Ae = "_observation_1pd36_30", Fe = "_groupContainer_1pd36_39", Ie = "_rowContainer_1pd36_43", Me = "_groupLabel_1pd36_48", Oe = "_rowLabel_1pd36_58", Te = "_rowValue_1pd36_67", Ve = "_groupMembers_1pd36_75", Ee = "_memberRow_1pd36_81", xe = "_memberLabel_1pd36_86", De = "_memberValue_1pd36_94", Se = "_abnormalValue_1pd36_102", we = "_commentSection_1pd36_110", Be = "_commentText_1pd36_116", Ge = "_nestedGroup_1pd36_125", Ue = "_nestedGroupLabel_1pd36_132", qe = "_nestedGroupMembers_1pd36_141", n = {
5
5
  formsTableBody: Ne,
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-DCPBjVgD.js";
2
- import { B as d, D as f, F as e } from "./index-Dsl0jQut.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-DqqyN0CG.js";
2
+ import { B as d, D as f, F as e } from "./index-ClooEAJt.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-DCPBjVgD.js";
2
- import { B as v, D as C, F as e } from "./index-Dsl0jQut.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-DqqyN0CG.js";
2
+ import { B as v, D as C, F as e } from "./index-ClooEAJt.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
1
1
  import { jsxs as N, jsx as l } from "react/jsx-runtime";
2
- import { d as k, t as B, u as I, j as Q, y as H, a as K, E as j, V as w, k as x, l as G, o as M, N as z, p as P, Q as S, T as Y, c as J, $ as W, e as X, r as Z, f as ee, H as te } from "./index-Dsl0jQut.js";
2
+ import { d as k, t as B, u as I, j as Q, y as H, a as K, E as j, V as w, k as x, l as G, o as M, N as z, p as P, Q as S, T as Y, c as J, $ as W, e as X, r as Z, f as ee, H as te } from "./index-ClooEAJt.js";
3
3
  import { useRef as ae, useEffect as T, useMemo as R } from "react";
4
4
  const D = (t, d, n, u, r) => {
5
5
  const a = Y(t, d, r), s = a.value, o = J(s);
@@ -1,4 +1,4 @@
1
- import { J as we, P as z, S as xt, U as B, D as q, F as y, Y as Ro, a0 as ye, a1 as R, a2 as _, a3 as k, a4 as N, a5 as A, a6 as bs, a7 as ir, a8 as $e, a9 as U, aa as Hn, ab as Vn, ac as dt, ad as D, ae as xs, af as cn, ag as Be, ah as ws, ai as qt, aj as zt, ak as $s, al as Cs, am as $n, an as Ss, ao as Nr, ap as Bt, aq as zo, ar as ks, as as Es, at as j, au as Ur, av as Ms, aw as Ds, ax as sr, ay as As, az as Ts, aA as zn, aB as Fs, aC as Is, aD as Z, aE as Ps, aF as Ls } from "./index-Dsl0jQut.js";
1
+ import { J as we, P as z, S as xt, U as B, D as q, F as y, Y as Ro, a0 as ye, a1 as R, a2 as _, a3 as k, a4 as N, a5 as A, a6 as bs, a7 as ir, a8 as $e, a9 as U, aa as Hn, ab as Vn, ac as dt, ad as D, ae as xs, af as cn, ag as Be, ah as ws, ai as qt, aj as zt, ak as $s, al as Cs, am as $n, an as Ss, ao as Nr, ap as Bt, aq as zo, ar as ks, as as Es, at as j, au as Ur, av as Ms, aw as Ds, ax as sr, ay as As, az as Ts, aA as zn, aB as Fs, aC as Is, aD as Z, aE as Ps, aF as Ls } from "./index-ClooEAJt.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {
@@ -1,5 +1,5 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { Z as E, A as S, q as C, u as M, a as f, s as L, G as N, _ as g, v as y, w as I } from "./index-Dsl0jQut.js";
2
+ import { Z as E, A as S, q as C, u as M, a as f, s as L, G as N, _ as g, v as y, w as I } from "./index-ClooEAJt.js";
3
3
  import { useMemo as o } from "react";
4
4
  const R = E(
5
5
  S,
@@ -158073,7 +158073,7 @@ function Ob0(t, e, r) {
158073
158073
  return o;
158074
158074
  };
158075
158075
  }
158076
- S0(() => Promise.resolve().then(() => ig0)), S0(() => Promise.resolve().then(() => rM0)), S0(() => Promise.resolve().then(() => OM0)), S0(() => Promise.resolve().then(() => IM0)), S0(() => import("./DocumentsTable-CYxu-75r-CMgVnY1U.js")), S0(() => Promise.resolve().then(() => QV0)), S0(() => import("./FormsTable-DrKr31Pe-DJQo456W.js")), S0(() => Promise.resolve().then(() => TV0)), S0(() => import("./Observations-21c_55Fg-CDmG2tnd.js")), S0(
158076
+ S0(() => Promise.resolve().then(() => ig0)), S0(() => Promise.resolve().then(() => rM0)), S0(() => Promise.resolve().then(() => OM0)), S0(() => Promise.resolve().then(() => IM0)), S0(() => import("./DocumentsTable-BJ1OXT8Q-BmIIwUYw.js")), S0(() => Promise.resolve().then(() => QV0)), S0(() => import("./FormsTable-CF5ZuCw3-BTYNr00D.js")), S0(() => Promise.resolve().then(() => TV0)), S0(() => import("./Observations-COn04_t4-tBg3kkPB.js")), S0(
158077
158077
  () => Promise.resolve().then(() => iz0)
158078
158078
  ), S0(
158079
158079
  () => Promise.resolve().then(() => rV0)
@@ -159912,7 +159912,7 @@ var nN0 = (t, e = !1) => {
159912
159912
  const e = PCe(() => {
159913
159913
  const r = this, [o] = this.#a, [a] = this.#h, [c] = this.#d, [l] = this.#u, [i] = this.#p, [s] = this.#t;
159914
159914
  let d;
159915
- return this.#i ? d = this.#i : (d = ICe(() => import("./LNWAZHJI-DaVaAnER.js")), this.#i = d), lAe(this.#l, this.#c), kCe(d, ZCe({
159915
+ return this.#i ? d = this.#i : (d = ICe(() => import("./LNWAZHJI-FQDP9PoL.js")), this.#i = d), lAe(this.#l, this.#c), kCe(d, ZCe({
159916
159916
  get queryFlavor() {
159917
159917
  return r.#r;
159918
159918
  },
@@ -160010,7 +160010,7 @@ var nN0 = (t, e = !1) => {
160010
160010
  const e = PCe(() => {
160011
160011
  const r = this, [o] = this.#a, [a] = this.#h, [c] = this.#d, [l] = this.#u, [i] = this.#p, [s] = this.#t, [d] = this.#i;
160012
160012
  let u;
160013
- return this.#s ? u = this.#s : (u = ICe(() => import("./MWZ6AO7Z-B7RLd1ZE.js")), this.#s = u), lAe(this.#l, this.#c), kCe(u, ZCe({
160013
+ return this.#s ? u = this.#s : (u = ICe(() => import("./MWZ6AO7Z-CYJOkJ6j.js")), this.#s = u), lAe(this.#l, this.#c), kCe(u, ZCe({
160014
160014
  get queryFlavor() {
160015
160015
  return r.#r;
160016
160016
  },
@@ -160170,7 +160170,7 @@ const YH0 = {
160170
160170
  }), sx0 = S0(
160171
160171
  () => import("./index-CFigb5vF.js").then((t) => ({ default: t.IndexPage }))
160172
160172
  ), dx0 = S0(
160173
- () => import("./index-DRjB6xTr.js").then((t) => ({
160173
+ () => import("./index-67wnk8J0.js").then((t) => ({
160174
160174
  default: t.default
160175
160175
  }))
160176
160176
  ), ux0 = [