@bahmni/services 0.0.1-dev.192 → 0.0.1-dev.193

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.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { initReactI18next as oi } from "react-i18next";
2
- import { useTranslation as cv } from "react-i18next";
2
+ import { useTranslation as uv } from "react-i18next";
3
3
  import { useRef as wn, useCallback as Yr, useEffect as En } from "react";
4
4
  function ra(e, t) {
5
5
  return function() {
@@ -1797,22 +1797,22 @@ ce.getAdapter = Ea.getAdapter;
1797
1797
  ce.HttpStatusCode = Rn;
1798
1798
  ce.default = ce;
1799
1799
  const {
1800
- Axios: wm,
1801
- AxiosError: Em,
1802
- CanceledError: bm,
1803
- isCancel: _m,
1804
- CancelToken: Sm,
1805
- VERSION: Rm,
1806
- all: Tm,
1807
- Cancel: Om,
1808
- isAxiosError: Am,
1809
- spread: Nm,
1810
- toFormData: $m,
1811
- AxiosHeaders: Pm,
1812
- HttpStatusCode: Im,
1813
- formToJSON: Dm,
1814
- getAdapter: Cm,
1815
- mergeConfig: Lm
1800
+ Axios: Em,
1801
+ AxiosError: bm,
1802
+ CanceledError: _m,
1803
+ isCancel: Sm,
1804
+ CancelToken: Rm,
1805
+ VERSION: Tm,
1806
+ all: Om,
1807
+ Cancel: Am,
1808
+ isAxiosError: Nm,
1809
+ spread: $m,
1810
+ toFormData: Pm,
1811
+ AxiosHeaders: Im,
1812
+ HttpStatusCode: Dm,
1813
+ formToJSON: Cm,
1814
+ getAdapter: Lm,
1815
+ mergeConfig: km
1816
1816
  } = ce, kc = (e) => typeof e == "object" && e !== null && "resourceType" in e && e.resourceType === "OperationOutcome", xc = (e) => {
1817
1817
  if (!e.issue || !Array.isArray(e.issue))
1818
1818
  return null;
@@ -2017,7 +2017,7 @@ qe.interceptors.response.use(
2017
2017
  return r.startsWith("ERROR_") || /^[A-Z_]+$/.test(r) ? Promise.reject(new Error(r)) : Promise.reject(`${t}: ${r}`);
2018
2018
  }
2019
2019
  );
2020
- const z = async (e) => (await qe.get(e)).data, Me = async (e, t) => (await qe.post(e, t)).data, km = async (e, t) => (await qe.put(e, t)).data, xm = async (e, t) => (await qe.patch(e, t)).data, Um = async (e) => (await qe.delete(e)).data, Y = (e) => typeof e == "string", ft = () => {
2020
+ const z = async (e) => (await qe.get(e)).data, Me = async (e, t) => (await qe.post(e, t)).data, xm = async (e, t) => (await qe.put(e, t)).data, Um = async (e, t) => (await qe.patch(e, t)).data, qm = async (e) => (await qe.delete(e)).data, Y = (e) => typeof e == "string", ft = () => {
2021
2021
  let e, t;
2022
2022
  const r = new Promise((n, s) => {
2023
2023
  e = n, t = s;
@@ -3691,7 +3691,7 @@ class $a {
3691
3691
  }
3692
3692
  }
3693
3693
  $a.type = "languageDetector";
3694
- const $u = process.env.PUBLIC_URL ?? "/", le = "/openmrs/ws/fhir2/R4", Z = "/openmrs/ws/rest/v1", Pu = "/openmrs/ws/rest/v2", Iu = "bahmni.user", qm = "/bahmni/home/index.html", Du = Z + "/session", Cu = "en", Pa = "NG_TRANSLATE_LANG_KEY", Lu = (e, t) => $u + `${e}/locales/locale_${t}.json`, ku = (e, t) => `/bahmni_config/openmrs/i18n/${e}/locale_${t}.json`, qr = () => localStorage.getItem(Pa) ?? Cu, $s = async (e) => {
3694
+ const $u = process.env.PUBLIC_URL ?? "/", le = "/openmrs/ws/fhir2/R4", Z = "/openmrs/ws/rest/v1", Pu = "/openmrs/ws/rest/v2", Iu = "bahmni.user", Mm = "/bahmni/home/index.html", Du = Z + "/session", Cu = "en", Pa = "NG_TRANSLATE_LANG_KEY", Lu = (e, t) => $u + `${e}/locales/locale_${t}.json`, ku = (e, t) => `/bahmni_config/openmrs/i18n/${e}/locale_${t}.json`, qr = () => localStorage.getItem(Pa) ?? Cu, $s = async (e) => {
3695
3695
  try {
3696
3696
  const t = await z(e);
3697
3697
  return t || (console.error(`Invalid response from ${e}`), {});
@@ -3715,7 +3715,7 @@ const $u = process.env.PUBLIC_URL ?? "/", le = "/openmrs/ws/fhir2/R4", Z = "/ope
3715
3715
  }, e !== "en" && (r.en = {
3716
3716
  [t]: await Ps(t, "en")
3717
3717
  }), r;
3718
- }, Mm = (e, t) => {
3718
+ }, jm = (e, t) => {
3719
3719
  const r = e.toUpperCase(), n = t.toUpperCase().replace(/\s+/g, "_").replace(/[^A-Z0-9_]/g, "");
3720
3720
  return `${r}_${n}`;
3721
3721
  }, Uu = (e, t) => {
@@ -3732,7 +3732,7 @@ const $u = process.env.PUBLIC_URL ?? "/", le = "/openmrs/ws/fhir2/R4", Z = "/ope
3732
3732
  labels: n.labels ?? {},
3733
3733
  concepts: n.concepts ?? {}
3734
3734
  };
3735
- }, jm = async (e) => {
3735
+ }, Fm = async (e) => {
3736
3736
  const t = qr(), r = await xu(t, e);
3737
3737
  return await ue.use($a).use(oi).init({
3738
3738
  fallbackLng: "en",
@@ -3751,7 +3751,7 @@ const $u = process.env.PUBLIC_URL ?? "/", le = "/openmrs/ws/fhir2/R4", Z = "/ope
3751
3751
  }
3752
3752
  }), ue;
3753
3753
  };
3754
- function Fm() {
3754
+ function Vm() {
3755
3755
  const e = wn(null), t = wn(null), r = Yr(async () => {
3756
3756
  t.current && (t.current.getTracks().forEach((a) => a.stop()), t.current = null);
3757
3757
  const o = await navigator.mediaDevices.getUserMedia({
@@ -3774,11 +3774,11 @@ function Fm() {
3774
3774
  }, []);
3775
3775
  return En(() => () => n(), [n]), { videoRef: e, start: r, stop: n, capture: s };
3776
3776
  }
3777
- const qu = "bahmni.enableAuditLog", Ia = (e) => `${Z}/bahmnicore/sql/globalproperty?property=${e}`, Vm = async (e, t, r) => {
3777
+ const qu = "bahmni.enableAuditLog", Ia = (e) => `${Z}/bahmnicore/sql/globalproperty?property=${e}`, Hm = async (e, t, r) => {
3778
3778
  const { exact: n = !0, refetchActiveNow: s = !0 } = r ?? {};
3779
3779
  await e.cancelQueries({ queryKey: t, exact: n }), await e.removeQueries({ queryKey: t, exact: n }), await e.invalidateQueries({ queryKey: t, exact: n }), s && await e.refetchQueries({ queryKey: t, exact: n, type: "active" });
3780
- }, Hm = () => Math.random().toString(36).substring(2, 9);
3781
- function Bm(e, t = " -") {
3780
+ }, Bm = () => Math.random().toString(36).substring(2, 9);
3781
+ function zm(e, t = " -") {
3782
3782
  return e ? e.toLowerCase().split(new RegExp(`[${t}]+`)).map((n) => n.charAt(0).toUpperCase() + n.slice(1)).join(" ") : "";
3783
3783
  }
3784
3784
  function Da(e) {
@@ -3790,7 +3790,7 @@ function Da(e) {
3790
3790
  }
3791
3791
  return "";
3792
3792
  }
3793
- const zm = (e) => !e || e.trim().length === 0, Gm = (e, t) => {
3793
+ const Gm = (e) => !e || e.trim().length === 0, Km = (e, t) => {
3794
3794
  if (!e || !t || t.length === 0)
3795
3795
  return 999;
3796
3796
  const r = t.findIndex(
@@ -3798,7 +3798,7 @@ const zm = (e) => !e || e.trim().length === 0, Gm = (e, t) => {
3798
3798
  );
3799
3799
  return r === -1 ? 999 : r;
3800
3800
  };
3801
- function Km(e, t) {
3801
+ function Ym(e, t) {
3802
3802
  if (!e || e.length === 0)
3803
3803
  return [];
3804
3804
  const r = /* @__PURE__ */ new Map();
@@ -3810,7 +3810,7 @@ function Km(e, t) {
3810
3810
  items: s
3811
3811
  }));
3812
3812
  }
3813
- function Ym(e, t, r) {
3813
+ function Wm(e, t, r) {
3814
3814
  if (!e || e.length === 0)
3815
3815
  return [];
3816
3816
  const n = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
@@ -3831,7 +3831,7 @@ function Mu(e) {
3831
3831
  o[n(a[1])] = n(a[2]);
3832
3832
  return o;
3833
3833
  }
3834
- function Wm(e, t, r) {
3834
+ function Jm(e, t, r) {
3835
3835
  const n = /{{([^}]*)}}/g, s = e.match(n);
3836
3836
  let o = e;
3837
3837
  const a = r ?? !1, i = a ? Mu() : {};
@@ -3844,7 +3844,7 @@ function Wm(e, t, r) {
3844
3844
  const ju = (e) => new Promise((t, r) => {
3845
3845
  const n = new FileReader();
3846
3846
  n.onloadend = () => t(n.result), n.onerror = r, n.readAsDataURL(e);
3847
- }), Jm = (e) => {
3847
+ }), Qm = (e) => {
3848
3848
  if (typeof e == "number" && !isNaN(e))
3849
3849
  return "number";
3850
3850
  if (typeof e != "string")
@@ -3852,14 +3852,14 @@ const ju = (e) => new Promise((t, r) => {
3852
3852
  const t = e.toLowerCase();
3853
3853
  return t.endsWith(".pdf") ? "PDF" : [".png", ".jpg", ".jpeg", ".gif", ".bmp", ".svg"].some((s) => t.endsWith(s)) ? "Image" : [".mp4", ".ogg", ".webm", ".mkv", ".flv"].some((s) => t.endsWith(s)) ? "Video" : typeof e == "string" ? "string" : "object";
3854
3854
  };
3855
- function Qm(e) {
3855
+ function Xm(e) {
3856
3856
  return e.replace(/[\s-]+/g, "_").replace(/([a-z])([A-Z])/g, "$1_$2").replace(/([A-Z])([A-Z][a-z])/g, "$1_$2").toUpperCase();
3857
3857
  }
3858
- function Xm(e) {
3858
+ function Zm(e) {
3859
3859
  return e ? e.replaceAll(/[_-]/g, " ").replaceAll(/([a-z])([A-Z])/g, "$1 $2").replaceAll(/([A-Z])([A-Z][a-z])/g, "$1 $2").replaceAll(/([a-z])(\d)/gi, "$1 $2").replaceAll(/(\d)([a-z])/gi, "$1 $2").replaceAll(/\s+/g, " ").trim().toLowerCase().replace(/^./, (t) => t.toUpperCase()) : "";
3860
3860
  }
3861
3861
  const Fu = (e) => Z + `/user?username=${e}&v=custom:(username,uuid)`, Vu = "bahmni.user.location", Hu = (e) => Z + `/bahmni/app/setting?module=${e}`, Bu = "default_dateFormat";
3862
- async function Zm() {
3862
+ async function eg() {
3863
3863
  const e = Da(Iu);
3864
3864
  if (!e)
3865
3865
  return null;
@@ -3883,7 +3883,7 @@ const xn = () => {
3883
3883
  if (!t.name || !t.uuid)
3884
3884
  throw new Error(ue.t("ERROR_FETCHING_USER_LOCATION_DETAILS"));
3885
3885
  return t;
3886
- }, eg = async () => (await z(Hu("commons"))).find(
3886
+ }, tg = async () => (await z(Hu("commons"))).find(
3887
3887
  (r) => r.property === Bu
3888
3888
  )?.value ?? null, Un = {
3889
3889
  person: {
@@ -3931,7 +3931,7 @@ const xn = () => {
3931
3931
  }, Ca = Z + "/idgen/identifiertype", Wu = (e) => Z + `/bahmni/app/setting?module=${e}`, Ju = "bahmni.primaryIdentifierType", Qu = Z + "/bahmnicore/patientprofile", Xu = (e) => Z + `/bahmnicore/patientprofile/${e}`, Zu = (e) => Z + `/patientprofile/${e}?v=full`, el = (e, t, r = 20, n) => {
3932
3932
  let s = `/openmrs/module/addresshierarchy/ajax/getPossibleAddressHierarchyEntriesWithParents.form?addressField=${e}&limit=${r}&searchString=${encodeURIComponent(t)}`;
3933
3933
  return n && (s += `&parent=${n}`), s;
3934
- }, tl = "/openmrs/module/addresshierarchy/ajax/getOrderedAddressHierarchyLevels.form", rl = Z + "/relationshiptype?v=custom:(aIsToB,bIsToA,uuid)&limit=150", nl = 20, sl = 2, tg = 120, rg = 50, ng = 15, ol = /^[a-f0-9-]{36}$/i, al = (e) => Pu + `/patientImage?patientUuid=${e}`, il = Z + "/personattributetype?v=custom:(uuid,name,sortWeight,description,format,concept:(uuid,display,answers:(uuid,name)))", cl = async (e) => {
3934
+ }, tl = "/openmrs/module/addresshierarchy/ajax/getOrderedAddressHierarchyLevels.form", rl = Z + "/relationshiptype?v=custom:(aIsToB,bIsToA,uuid)&limit=150", nl = 20, sl = 2, rg = 120, ng = 50, sg = 15, ol = /^[a-f0-9-]{36}$/i, al = (e) => Pu + `/patientImage?patientUuid=${e}`, il = Z + "/personattributetype?v=custom:(uuid,name,sortWeight,description,format,concept:(uuid,display,answers:(uuid,name)))", cl = async (e) => {
3935
3935
  if (!e || e.trim() === "")
3936
3936
  throw new Error("Invalid patient UUID: UUID cannot be empty");
3937
3937
  if (!ol.test(e))
@@ -3964,20 +3964,20 @@ const xn = () => {
3964
3964
  formattedContact: r,
3965
3965
  identifiers: s
3966
3966
  };
3967
- }, sg = async (e) => {
3967
+ }, og = async (e) => {
3968
3968
  const t = await cl(e);
3969
3969
  return hl(t);
3970
- }, og = async (e) => {
3970
+ }, ag = async (e) => {
3971
3971
  const t = await fetch(al(e));
3972
3972
  if (!t.ok) return null;
3973
3973
  const r = await t.blob();
3974
3974
  return await ju(r);
3975
- }, ag = async (e, t) => {
3975
+ }, ig = async (e, t) => {
3976
3976
  const r = xn();
3977
3977
  return await z(
3978
3978
  Ku(e, r.uuid, t)
3979
3979
  );
3980
- }, ig = async (e, t, r, n, s) => {
3980
+ }, cg = async (e, t, r, n, s) => {
3981
3981
  const o = xn();
3982
3982
  return await z(
3983
3983
  Yu(
@@ -3988,9 +3988,9 @@ const xn = () => {
3988
3988
  o.uuid
3989
3989
  )
3990
3990
  );
3991
- }, cg = async () => z(Ca), pl = async () => (await z(Wu("core"))).find(
3991
+ }, ug = async () => z(Ca), pl = async () => (await z(Wu("core"))).find(
3992
3992
  (r) => r.property === Ju
3993
- )?.value ?? null, ug = async () => {
3993
+ )?.value ?? null, lg = async () => {
3994
3994
  const [e, t] = await Promise.all([
3995
3995
  z(Ca),
3996
3996
  pl()
@@ -4007,10 +4007,10 @@ const xn = () => {
4007
4007
  sourcesByPrefix: n,
4008
4008
  primaryIdentifierTypeUuid: t
4009
4009
  }) : { prefixes: r, sourcesByPrefix: n, primaryIdentifierTypeUuid: t };
4010
- }, lg = async (e) => Me(Qu, e), dg = async (e, t) => Me(
4010
+ }, dg = async (e) => Me(Qu, e), fg = async (e, t) => Me(
4011
4011
  Xu(e),
4012
4012
  t
4013
- ), fg = async () => z(Ia("mrs.genders")), hg = async (e, t, r = nl, n) => {
4013
+ ), hg = async () => z(Ia("mrs.genders")), pg = async (e, t, r = nl, n) => {
4014
4014
  if (!t || t.length < sl)
4015
4015
  return [];
4016
4016
  try {
@@ -4022,7 +4022,7 @@ const xn = () => {
4022
4022
  `Failed to fetch address hierarchy for field "${e}": ${s instanceof Error ? s.message : "Unknown error"}`
4023
4023
  );
4024
4024
  }
4025
- }, pg = async () => z(tl), mg = async (e) => z(Zu(e)), gg = async () => {
4025
+ }, mg = async () => z(tl), gg = async (e) => z(Zu(e)), yg = async () => {
4026
4026
  try {
4027
4027
  return (await z(
4028
4028
  rl
@@ -4036,9 +4036,9 @@ const xn = () => {
4036
4036
  `Failed to fetch relationship types: ${e instanceof Error ? e.message : "Unknown error"}`
4037
4037
  );
4038
4038
  }
4039
- }, yg = async () => z(il);
4039
+ }, vg = async () => z(il);
4040
4040
  var ml = /* @__PURE__ */ ((e) => (e.BOOLEAN = "java.lang.Boolean", e.BOOLEAN_DATATYPE = "org.openmrs.customdatatype.datatype.BooleanDatatype", e.CONCEPT = "org.openmrs.Concept", e.CODED_CONCEPT = "org.bahmni.module.bahmnicore.customdatatype.datatype.CodedConceptDatatype", e.CONCEPT_DATATYPE = "org.openmrs.customdatatype.datatype.ConceptDatatype", e.STRING = "java.lang.String", e.FREE_TEXT = "org.openmrs.customdatatype.datatype.FreeTextDatatype", e.REGEX_VALIDATED_TEXT = "org.openmrs.customdatatype.datatype.RegexValidatedTextDatatype", e.INTEGER = "java.lang.Integer", e.FLOAT = "java.lang.Float", e.ATTRIBUTABLE_DATE = "org.openmrs.util.AttributableDate", e.DATE_DATATYPE = "org.openmrs.customdatatype.datatype.DateDatatype", e))(ml || {}), gl = /* @__PURE__ */ ((e) => (e.CHECKBOX = "checkbox", e.DROPDOWN = "dropdown", e.TEXT = "text", e.NUMBER = "number", e.DATE = "date", e))(gl || {});
4041
- const vg = (e) => e === "java.lang.Boolean" || e === "org.openmrs.customdatatype.datatype.BooleanDatatype" ? "checkbox" : e === "org.openmrs.Concept" || e === "org.bahmni.module.bahmnicore.customdatatype.datatype.CodedConceptDatatype" || e === "org.openmrs.customdatatype.datatype.ConceptDatatype" ? "dropdown" : e === "java.lang.Integer" || e === "java.lang.Float" ? "number" : e === "org.openmrs.util.AttributableDate" || e === "org.openmrs.customdatatype.datatype.DateDatatype" ? "date" : "text", wg = (e) => e === "java.lang.Boolean" || e === "org.openmrs.customdatatype.datatype.BooleanDatatype", Eg = (e) => e === "org.openmrs.Concept" || e === "org.bahmni.module.bahmnicore.customdatatype.datatype.CodedConceptDatatype" || e === "org.openmrs.customdatatype.datatype.ConceptDatatype", bg = (e) => e === "java.lang.Integer" || e === "java.lang.Float", _g = (e) => e === "org.openmrs.util.AttributableDate" || e === "org.openmrs.customdatatype.datatype.DateDatatype", Sg = (e) => e === "java.lang.String" || e === "org.openmrs.customdatatype.datatype.FreeTextDatatype" || e === "org.openmrs.customdatatype.datatype.RegexValidatedTextDatatype", yl = (e) => {
4041
+ const wg = (e) => e === "java.lang.Boolean" || e === "org.openmrs.customdatatype.datatype.BooleanDatatype" ? "checkbox" : e === "org.openmrs.Concept" || e === "org.bahmni.module.bahmnicore.customdatatype.datatype.CodedConceptDatatype" || e === "org.openmrs.customdatatype.datatype.ConceptDatatype" ? "dropdown" : e === "java.lang.Integer" || e === "java.lang.Float" ? "number" : e === "org.openmrs.util.AttributableDate" || e === "org.openmrs.customdatatype.datatype.DateDatatype" ? "date" : "text", Eg = (e) => e === "java.lang.Boolean" || e === "org.openmrs.customdatatype.datatype.BooleanDatatype", bg = (e) => e === "org.openmrs.Concept" || e === "org.bahmni.module.bahmnicore.customdatatype.datatype.CodedConceptDatatype" || e === "org.openmrs.customdatatype.datatype.ConceptDatatype", _g = (e) => e === "java.lang.Integer" || e === "java.lang.Float", Sg = (e) => e === "org.openmrs.util.AttributableDate" || e === "org.openmrs.customdatatype.datatype.DateDatatype", Rg = (e) => e === "java.lang.String" || e === "org.openmrs.customdatatype.datatype.FreeTextDatatype" || e === "org.openmrs.customdatatype.datatype.RegexValidatedTextDatatype", yl = (e) => {
4042
4042
  const t = new CustomEvent("bahmni-audit-log", { detail: e });
4043
4043
  window.dispatchEvent(t);
4044
4044
  }, vl = (e) => {
@@ -4091,10 +4091,10 @@ const vg = (e) => e === "java.lang.Boolean" || e === "org.openmrs.customdatatype
4091
4091
  }
4092
4092
  }, wl = Z + "/auditlog", El = {
4093
4093
  UNKNOWN_EVENT_TYPE: "AUDIT_LOG_ERROR_UNKNOWN_EVENT_TYPE"
4094
- }, bl = () => Z + "/bahmnicore/config/bahmniencounter?callerContext=REGISTRATION_CONCEPTS", _l = Z + "/visit", Sl = (e) => Z + `/visit?patient=${e}&includeInactive=false&v=custom:(uuid,visitType,startDatetime,stopDatetime)`, Rl = (e) => Z + `/bahmnicore/visitLocation/${e}`, Rg = async () => z(bl()), Tl = async (e) => z(Sl(e)), Ol = async (e) => z(Rl(e)), Al = async (e) => Me(_l, e), Tg = async (e) => {
4094
+ }, bl = () => Z + "/bahmnicore/config/bahmniencounter?callerContext=REGISTRATION_CONCEPTS", _l = Z + "/visit", Sl = (e) => Z + `/visit?patient=${e}&includeInactive=false&v=custom:(uuid,visitType,startDatetime,stopDatetime)`, Rl = (e) => Z + `/bahmnicore/visitLocation/${e}`, Tg = async () => z(bl()), Tl = async (e) => z(Sl(e)), Ol = async (e) => z(Rl(e)), Al = async (e) => Me(_l, e), Og = async (e) => {
4095
4095
  const t = await Tl(e);
4096
4096
  return t?.results && t.results.length > 0;
4097
- }, Og = async (e, t) => {
4097
+ }, Ag = async (e, t) => {
4098
4098
  const r = await Ol(
4099
4099
  xn().uuid
4100
4100
  ), n = {
@@ -5561,7 +5561,7 @@ function tf(e, t, r) {
5561
5561
  function rf(e, t, r) {
5562
5562
  return Mn(e, -t, r);
5563
5563
  }
5564
- const Ag = {
5564
+ const Ng = {
5565
5565
  PROPOSED: "proposed",
5566
5566
  PENDING: "pending",
5567
5567
  BOOKED: "booked",
@@ -5572,34 +5572,34 @@ const Ag = {
5572
5572
  CHECKED_IN: "checked-in",
5573
5573
  WAITLIST: "waitlist",
5574
5574
  ENTERED_IN_ERROR: "entered-in-error"
5575
- }, nf = Z + "/appointments/search", Va = Z + "/appointments", Ng = "http://fhir.bahmni.org/code-system/appointments", sf = (e) => `${Va}/${e}`, Ha = (e, t, r) => {
5575
+ }, nf = Z + "/appointments/search", Va = Z + "/appointments", $g = "http://fhir.bahmni.org/code-system/appointments", sf = (e) => `${Va}/${e}`, Ha = (e, t, r) => {
5576
5576
  const n = t === "upcoming", s = n ? "ge" : "le", o = n ? "date" : "-date", a = n ? (/* @__PURE__ */ new Date()).toISOString() : tf(/* @__PURE__ */ new Date()).toISOString();
5577
5577
  let i = `${le}/Appointment?patient=${e}&date=${s}${a}&_sort=${o}`;
5578
5578
  return r !== void 0 && r > 0 && (i += `&_count=${r}`), i;
5579
- }, of = (e) => Ha(e, "upcoming"), af = (e, t) => Ha(e, "past", t), cf = (e) => `${Va}/${e}/status-change`, uf = Z + "/appointmentService/all/full", $g = async (e) => await Me(nf, e);
5580
- async function Pg(e) {
5579
+ }, of = (e) => Ha(e, "upcoming"), af = (e, t) => Ha(e, "past", t), cf = (e) => `${Va}/${e}/status-change`, uf = Z + "/appointmentService/all/full", Pg = async (e) => await Me(nf, e);
5580
+ async function Ig(e) {
5581
5581
  return await z(of(e));
5582
5582
  }
5583
- async function Ig(e, t) {
5583
+ async function Dg(e, t) {
5584
5584
  return await z(
5585
5585
  af(e, t)
5586
5586
  );
5587
5587
  }
5588
- const Dg = async (e, t, r) => await Me(cf(e), {
5588
+ const Cg = async (e, t, r) => await Me(cf(e), {
5589
5589
  toStatus: t,
5590
5590
  onDate: r
5591
5591
  });
5592
- async function Cg(e) {
5592
+ async function Lg(e) {
5593
5593
  return await z(sf(e));
5594
5594
  }
5595
- const Lg = async () => await z(uf), lf = "dd/MM/yyyy", df = "default_dateFormat", ff = "P", Te = {
5595
+ const kg = async () => await z(uf), lf = "dd/MM/yyyy", df = "default_dateFormat", ff = "P", Te = {
5596
5596
  PARSE_ERROR: "DATE_ERROR_PARSE",
5597
5597
  FORMAT_ERROR: "DATE_ERROR_FORMAT",
5598
5598
  EMPTY_OR_INVALID: "DATE_ERROR_EMPTY_OR_INVALID",
5599
5599
  INVALID_FORMAT: "DATE_ERROR_INVALID_FORMAT",
5600
5600
  NULL_OR_UNDEFINED: "DATE_ERROR_NULL_OR_UNDEFINED"
5601
5601
  };
5602
- function kg(e) {
5602
+ function xg(e) {
5603
5603
  if (typeof e != "string" || !/^\d{4}-\d{2}-\d{2}$/.test(e))
5604
5604
  return null;
5605
5605
  const t = Vn(e);
@@ -5655,7 +5655,7 @@ function hf(e, t, r) {
5655
5655
  }
5656
5656
  } : { formattedResult: xd(n, t) };
5657
5657
  }
5658
- function xg(e, t, r = !1, n) {
5658
+ function Ug(e, t, r = !1, n) {
5659
5659
  const s = t ?? ((a) => a);
5660
5660
  let o;
5661
5661
  try {
@@ -5665,7 +5665,7 @@ function xg(e, t, r = !1, n) {
5665
5665
  }
5666
5666
  return r && !n && (o = `${o} h:mm a`), hf(e, o, s);
5667
5667
  }
5668
- function Ug(e, t, r) {
5668
+ function qg(e, t, r) {
5669
5669
  if (!e || !$t(e) || t === null || t === void 0 || !r || typeof t != "number")
5670
5670
  return;
5671
5671
  const n = new Date(e);
@@ -5680,7 +5680,7 @@ function Ug(e, t, r) {
5680
5680
  return;
5681
5681
  }
5682
5682
  }
5683
- function qg(e, t) {
5683
+ function Mg(e, t) {
5684
5684
  if (e == null)
5685
5685
  return {
5686
5686
  formattedResult: "",
@@ -5732,11 +5732,11 @@ function qg(e, t) {
5732
5732
  }
5733
5733
  return { formattedResult: c };
5734
5734
  }
5735
- const Mg = () => {
5735
+ const jg = () => {
5736
5736
  const e = /* @__PURE__ */ new Date();
5737
5737
  return e.setHours(0, 0, 0, 0), e;
5738
5738
  };
5739
- function jg(e, t) {
5739
+ function Fg(e, t) {
5740
5740
  const r = typeof e == "string" ? Vn(e) : new Date(e), n = /* @__PURE__ */ new Date(), s = Fn(n, r), o = Mn(r, s), a = jn(n, o), i = Mr(o, a), c = Nn(n, i), d = {
5741
5741
  years: "YEARS",
5742
5742
  months: "MONTHS",
@@ -5770,14 +5770,14 @@ const pf = {
5770
5770
  h: 1 / 24,
5771
5771
  min: 1 / 1440,
5772
5772
  s: 1 / 86400
5773
- }, Fg = (e, t, r) => {
5773
+ }, Vg = (e, t, r) => {
5774
5774
  const n = typeof e == "string" ? new Date(e) : e;
5775
5775
  if (isNaN(n.getTime()))
5776
5776
  throw new Error(`Invalid date: ${e}`);
5777
5777
  const s = pf[r] ?? 1, o = t * s;
5778
5778
  return xa(n, o);
5779
- }, Vg = (e, t, r, n) => e <= n && r <= t;
5780
- function Hg(e, t, r = !1) {
5779
+ }, Hg = (e, t, r, n) => e <= n && r <= t;
5780
+ function Bg(e, t, r = !1) {
5781
5781
  return !e || !Array.isArray(e) ? [] : e.sort((n, s) => {
5782
5782
  const o = new Date(n[t]), a = new Date(s[t]);
5783
5783
  if (isNaN(o.getTime()) && isNaN(a.getTime())) return 0;
@@ -5816,7 +5816,7 @@ const mf = () => {
5816
5816
  );
5817
5817
  }
5818
5818
  };
5819
- }, Bg = mf(), gf = (e) => le + `/ValueSet/${e}/$expand`, yf = (e) => le + `/ValueSet/$expand?filter=${encodeURIComponent(e)}`, vf = (e, t, r) => Z + `/bahmni/terminologies/concepts?limit=${t}&locale=${r}&term=${e}`, wf = (e) => Z + `/concept/${e}`, Ef = (e) => `${Z}/concept?s=byFullySpecifiedName&name=${encodeURIComponent(e)}`, bf = "SHORT", _f = "FULLY_SPECIFIED", zg = async (e, t = 20) => {
5819
+ }, zg = mf(), gf = (e) => le + `/ValueSet/${e}/$expand`, yf = (e) => le + `/ValueSet/$expand?filter=${encodeURIComponent(e)}`, vf = (e, t, r) => Z + `/bahmni/terminologies/concepts?limit=${t}&locale=${r}&term=${e}`, wf = (e) => Z + `/concept/${e}`, Ef = (e) => `${Z}/concept?s=byFullySpecifiedName&name=${encodeURIComponent(e)}`, bf = "SHORT", _f = "FULLY_SPECIFIED", Gg = async (e, t = 20) => {
5820
5820
  const r = qr(), n = vf(e, t, r);
5821
5821
  return z(n);
5822
5822
  }, br = async (e) => {
@@ -5826,10 +5826,10 @@ const mf = () => {
5826
5826
  const t = `${yf(e)}`;
5827
5827
  return z(t);
5828
5828
  };
5829
- async function Gg(e) {
5829
+ async function Kg(e) {
5830
5830
  return await z(wf(e));
5831
5831
  }
5832
- async function Kg(e) {
5832
+ async function Yg(e) {
5833
5833
  const t = Ef(e), r = await z(t);
5834
5834
  return !r.results || r.results.length === 0 ? null : r.results[0];
5835
5835
  }
@@ -5865,7 +5865,7 @@ const Tf = (e) => le + `/AllergyIntolerance?patient=${e}&_count=100&_sort=-_last
5865
5865
  }), sn = (e, t) => {
5866
5866
  const r = e.expansion?.contains ?? [];
5867
5867
  return Af(r).map((s) => Nf(s, t));
5868
- }, Yg = async (e, t, r) => {
5868
+ }, Wg = async (e, t, r) => {
5869
5869
  const n = e ?? et.MEDICATION.code, s = t ?? et.FOOD.code, o = r ?? et.ENVIRONMENT.code, [a, i, c] = await Promise.all([
5870
5870
  br(n),
5871
5871
  br(s),
@@ -5885,7 +5885,7 @@ const Tf = (e) => le + `/AllergyIntolerance?patient=${e}&_count=100&_sort=-_last
5885
5885
  et.ENVIRONMENT.display
5886
5886
  )
5887
5887
  ];
5888
- }, Wg = async (e) => {
5888
+ }, Jg = async (e) => {
5889
5889
  const t = e ?? Of.code;
5890
5890
  return (await br(t)).compose?.include[0]?.concept ?? [];
5891
5891
  };
@@ -5919,19 +5919,19 @@ function If(e) {
5919
5919
  };
5920
5920
  });
5921
5921
  }
5922
- async function Jg(e) {
5922
+ async function Qg(e) {
5923
5923
  const t = await Pf(e);
5924
5924
  return If(t);
5925
5925
  }
5926
5926
  var Df = /* @__PURE__ */ ((e) => (e.Active = "Active", e.Inactive = "Inactive", e))(Df || {}), Cf = /* @__PURE__ */ ((e) => (e.mild = "mild", e.moderate = "moderate", e.severe = "severe", e))(Cf || {});
5927
- const Qg = "http://fhir.openmrs.org/code-system/encounter-type", Lf = "problem-list-item", Xg = "http://terminology.hl7.org/CodeSystem/condition-ver-status", kf = "encounter-diagnosis", Zg = "http://terminology.hl7.org/CodeSystem/condition-clinical", ey = "http://terminology.hl7.org/CodeSystem/condition-category", ty = "http://fhir.bahmni.org/ext/lab-order-concept-type", ry = "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", ny = "http://fhir.bahmni.org/ext/observation/form-namespace-path", sy = "http://fhir.bahmni.org/ext/observation/obs-value-attachment", oy = "Numeric", ay = "Complex", iy = "final", cy = "Observation", uy = /^\d{4}-\d{2}-\d{2}/, xf = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/, ly = {
5927
+ const Xg = "http://fhir.openmrs.org/code-system/encounter-type", Lf = "problem-list-item", Zg = "http://terminology.hl7.org/CodeSystem/condition-ver-status", kf = "encounter-diagnosis", ey = "http://terminology.hl7.org/CodeSystem/condition-clinical", ty = "http://terminology.hl7.org/CodeSystem/condition-category", ry = "http://fhir.bahmni.org/ext/lab-order-concept-type", ny = "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", sy = "http://fhir.bahmni.org/ext/observation/form-namespace-path", oy = "http://fhir.bahmni.org/ext/observation/obs-value-attachment", ay = "Numeric", iy = "Complex", cy = "final", uy = "Observation", ly = /^\d{4}-\d{2}-\d{2}/, xf = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/, dy = {
5928
5928
  ABNORMAL: { code: "A", display: "Abnormal" },
5929
5929
  NORMAL: { code: "N", display: "Normal" }
5930
5930
  }, Uf = (e) => le + `/Condition?category=${Lf}&patient=${e}&_count=100&_sort=-_lastUpdated`;
5931
5931
  async function qf(e) {
5932
5932
  return await z(`${Uf(e)}`);
5933
5933
  }
5934
- async function dy(e) {
5934
+ async function fy(e) {
5935
5935
  return (await qf(e)).entry?.filter((n) => n.resource?.resourceType === "Condition").map((n) => n.resource) ?? [];
5936
5936
  }
5937
5937
  const Mf = (e) => le + `/Condition?category=${kf}&patient=${e}&_count=100&_sort=-_lastUpdated`, on = [
@@ -5987,7 +5987,7 @@ function Gf(e) {
5987
5987
  }
5988
5988
  return Array.from(t.values());
5989
5989
  }
5990
- async function fy(e) {
5990
+ async function hy(e) {
5991
5991
  const t = await Vf(e), r = zf(t);
5992
5992
  return Gf(r);
5993
5993
  }
@@ -6154,7 +6154,7 @@ function lh(e) {
6154
6154
  });
6155
6155
  }
6156
6156
  const Ms = (e) => e.priority === "stat" || e.dosageInstruction?.[0]?.timing?.code?.text === "Immediately" || !1;
6157
- async function hy(e, t, r, n = !1) {
6157
+ async function py(e, t, r, n = !1) {
6158
6158
  const s = await Zf(
6159
6159
  e,
6160
6160
  t,
@@ -6163,24 +6163,24 @@ async function hy(e, t, r, n = !1) {
6163
6163
  );
6164
6164
  return lh(s);
6165
6165
  }
6166
- async function py() {
6166
+ async function my() {
6167
6167
  return await z(
6168
6168
  Wf
6169
6169
  );
6170
6170
  }
6171
- async function my(e, t = 20) {
6171
+ async function gy(e, t = 20) {
6172
6172
  return await z(
6173
6173
  Jf(e, t)
6174
6174
  );
6175
6175
  }
6176
- async function gy() {
6176
+ async function yy() {
6177
6177
  return await z(Qf);
6178
6178
  }
6179
- const dh = (e, t, r, n, s) => {
6180
- let a = `${le + "/ServiceRequest?_sort=-_lastUpdated"}&category=${e}&patient=${t}`;
6179
+ const dh = 200, fh = (e, t, r, n, s) => {
6180
+ let a = `${le + `/ServiceRequest?_count=${dh}&_sort=-_lastUpdated`}&category=${e}&patient=${t}`;
6181
6181
  return s && (a += `&_revinclude=${s}`), r ? a += `&encounter=${r}` : n && (a += `&numberOfVisits=${n}`), a;
6182
6182
  };
6183
- function fh(e) {
6183
+ function hh(e) {
6184
6184
  if (!e || e.length === 0)
6185
6185
  return [];
6186
6186
  const t = /* @__PURE__ */ new Set();
@@ -6196,7 +6196,7 @@ async function Pt(e, t, r, n, s) {
6196
6196
  let o;
6197
6197
  r && r.length > 0 && (o = r.join(","));
6198
6198
  const a = await z(
6199
- dh(
6199
+ fh(
6200
6200
  e,
6201
6201
  t,
6202
6202
  o,
@@ -6204,9 +6204,9 @@ async function Pt(e, t, r, n, s) {
6204
6204
  s
6205
6205
  )
6206
6206
  );
6207
- return a.entry && (a.entry = fh(a.entry), a.total = a.entry.length), a;
6207
+ return a.entry && (a.entry = hh(a.entry), a.total = a.entry.length), a;
6208
6208
  }
6209
- async function yy(e, t, r, n) {
6209
+ async function vy(e, t, r, n) {
6210
6210
  return await Pt(
6211
6211
  t,
6212
6212
  e,
@@ -6214,7 +6214,7 @@ async function yy(e, t, r, n) {
6214
6214
  n
6215
6215
  );
6216
6216
  }
6217
- async function vy(e, t, r, n) {
6217
+ async function wy(e, t, r, n) {
6218
6218
  return await Pt(
6219
6219
  t,
6220
6220
  e,
@@ -6223,7 +6223,7 @@ async function vy(e, t, r, n) {
6223
6223
  "ImagingStudy:basedon"
6224
6224
  );
6225
6225
  }
6226
- async function wy(e, t, r, n) {
6226
+ async function Ey(e, t, r, n) {
6227
6227
  return (await Pt(
6228
6228
  t,
6229
6229
  e,
@@ -6231,7 +6231,7 @@ async function wy(e, t, r, n) {
6231
6231
  n
6232
6232
  )).entry?.filter((a) => a.resource?.resourceType === "ServiceRequest").map((a) => a.resource) ?? [];
6233
6233
  }
6234
- async function Ey(e, t, r, n) {
6234
+ async function by(e, t, r, n) {
6235
6235
  return await Pt(
6236
6236
  t,
6237
6237
  e,
@@ -6239,36 +6239,36 @@ async function Ey(e, t, r, n) {
6239
6239
  n
6240
6240
  );
6241
6241
  }
6242
- const hh = (e, t) => {
6242
+ const ph = (e, t) => {
6243
6243
  const r = `${le}/DiagnosticReport?patient=${e}`;
6244
6244
  return t ? `${r}&based-on=${t}` : r;
6245
- }, ph = (e) => `${le}/DiagnosticReport/${e}/$fetch-bundle`, mh = (e) => `${le}/DiagnosticReport/${e}/$update-bundle`;
6246
- async function by(e, t = []) {
6247
- const r = t.length > 0 ? t.join(",") : void 0, n = hh(e, r);
6245
+ }, mh = (e) => `${le}/DiagnosticReport/${e}/$fetch-bundle`, gh = (e) => `${le}/DiagnosticReport/${e}/$update-bundle`;
6246
+ async function _y(e, t = []) {
6247
+ const r = t.length > 0 ? t.join(",") : void 0, n = ph(e, r);
6248
6248
  return await z(n);
6249
6249
  }
6250
- async function _y(e) {
6251
- const t = ph(e);
6250
+ async function Sy(e) {
6251
+ const t = mh(e);
6252
6252
  return await z(t);
6253
6253
  }
6254
- async function Sy(e, t) {
6255
- const r = mh(e);
6254
+ async function Ry(e, t) {
6255
+ const r = gh(e);
6256
6256
  return await Me(r, t);
6257
6257
  }
6258
- const Ry = [
6258
+ const Ty = [
6259
6259
  "preliminary",
6260
6260
  "final",
6261
6261
  "amended",
6262
6262
  "corrected",
6263
6263
  "appended"
6264
- ], Ty = [
6264
+ ], Oy = [
6265
6265
  "registered",
6266
6266
  "unknown",
6267
6267
  "partial"
6268
- ], gh = "All Orderables", yh = "/openmrs/ws/rest/v1/ordertype?v=custom:(uuid,display,conceptClasses:(uuid,name))", vh = "LabSet", wh = "http://fhir.bahmni.org/ext/ValueSet/concept-class", Oy = ["orderTypes"], Eh = async () => await Sf(gh), Hn = async () => await z(yh), bh = (e) => {
6268
+ ], yh = "All Orderables", vh = "/openmrs/ws/rest/v1/ordertype?v=custom:(uuid,display,conceptClasses:(uuid,name))", wh = "LabSet", Eh = "http://fhir.bahmni.org/ext/ValueSet/concept-class", Ay = ["orderTypes"], bh = async () => await Sf(yh), Hn = async () => await z(vh), _h = (e) => {
6269
6269
  let t = e.display ?? "Unknown investigation";
6270
- return za(e) === vh && (t += ` (${ue.t("INVESTIGATION_PANEL")})`), t;
6271
- }, _h = (e) => {
6270
+ return za(e) === wh && (t += ` (${ue.t("INVESTIGATION_PANEL")})`), t;
6271
+ }, Sh = (e) => {
6272
6272
  const t = /* @__PURE__ */ new Map();
6273
6273
  return e.results.forEach((r) => {
6274
6274
  r.conceptClasses.forEach((n) => {
@@ -6277,10 +6277,10 @@ const Ry = [
6277
6277
  }), t;
6278
6278
  }, za = (e) => {
6279
6279
  const t = e.extension?.find(
6280
- (r) => r.url === wh
6280
+ (r) => r.url === Eh
6281
6281
  );
6282
6282
  return t ? t.valueString ?? "" : "";
6283
- }, Sh = (e, t) => {
6283
+ }, Rh = (e, t) => {
6284
6284
  const r = [];
6285
6285
  return !e.expansion?.contains || e.expansion.contains.length === 0 || t.size === 0 || e.expansion.contains.forEach((n) => {
6286
6286
  n.contains?.forEach((s) => {
@@ -6290,19 +6290,19 @@ const Ry = [
6290
6290
  return;
6291
6291
  r.filter((d) => d.code === o.code && d.categoryCode === i.uuid).length > 0 || r.push({
6292
6292
  code: o.code ?? "",
6293
- display: bh(o),
6293
+ display: _h(o),
6294
6294
  category: i.display,
6295
6295
  categoryCode: i.uuid
6296
6296
  });
6297
6297
  });
6298
6298
  });
6299
6299
  }), r;
6300
- }, Ay = async () => {
6301
- const e = await Eh(), t = await Hn();
6302
- return Sh(e, _h(t));
6303
- }, Ny = async (e) => e ? (await Hn()).results.find(
6300
+ }, Ny = async () => {
6301
+ const e = await bh(), t = await Hn();
6302
+ return Rh(e, Sh(t));
6303
+ }, $y = async (e) => e ? (await Hn()).results.find(
6304
6304
  (n) => n.display.toLowerCase() === e.toLowerCase()
6305
- )?.uuid : void 0, $y = async () => (await Hn()).results.map((t) => t.display), Py = async (e, t, r) => {
6305
+ )?.uuid : void 0, Py = async () => (await Hn()).results.map((t) => t.display), Iy = async (e, t, r) => {
6306
6306
  const n = [];
6307
6307
  for (const s of e) {
6308
6308
  const o = s.uuid;
@@ -6322,7 +6322,7 @@ const Ry = [
6322
6322
  }
6323
6323
  return n;
6324
6324
  };
6325
- function Rh(e) {
6325
+ function Th(e) {
6326
6326
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
6327
6327
  }
6328
6328
  var Lt = { exports: {} }, an = {}, De = {}, Fe = {}, cn = {}, un = {}, ln = {}, js;
@@ -7386,7 +7386,7 @@ function Fr() {
7386
7386
  })(cn)), cn;
7387
7387
  }
7388
7388
  var Ks;
7389
- function Th() {
7389
+ function Oh() {
7390
7390
  if (Ks) return Fe;
7391
7391
  Ks = 1, Object.defineProperty(Fe, "__esModule", { value: !0 }), Fe.boolOrEmptySchema = Fe.topBoolOrEmptySchema = void 0;
7392
7392
  const e = Fr(), t = X(), r = je(), n = {
@@ -7611,7 +7611,7 @@ function Ir() {
7611
7611
  return me;
7612
7612
  }
7613
7613
  var gt = {}, Qs;
7614
- function Oh() {
7614
+ function Ah() {
7615
7615
  if (Qs) return gt;
7616
7616
  Qs = 1, Object.defineProperty(gt, "__esModule", { value: !0 }), gt.assignDefaults = void 0;
7617
7617
  const e = X(), t = te();
@@ -7747,7 +7747,7 @@ function Pe() {
7747
7747
  return oe.validateUnion = h, oe;
7748
7748
  }
7749
7749
  var Zs;
7750
- function Ah() {
7750
+ function Nh() {
7751
7751
  if (Zs) return Ne;
7752
7752
  Zs = 1, Object.defineProperty(Ne, "__esModule", { value: !0 }), Ne.validateKeywordUsage = Ne.validSchemaType = Ne.funcKeywordCode = Ne.macroKeywordCode = void 0;
7753
7753
  const e = X(), t = je(), r = Pe(), n = Fr();
@@ -7836,7 +7836,7 @@ function Ah() {
7836
7836
  return Ne.validateKeywordUsage = m, Ne;
7837
7837
  }
7838
7838
  var Le = {}, eo;
7839
- function Nh() {
7839
+ function $h() {
7840
7840
  if (eo) return Le;
7841
7841
  eo = 1, Object.defineProperty(Le, "__esModule", { value: !0 }), Le.extendSubschemaMode = Le.extendSubschemaData = Le.getSubschema = void 0;
7842
7842
  const e = X(), t = te();
@@ -7920,7 +7920,7 @@ function Ya() {
7920
7920
  }), fn;
7921
7921
  }
7922
7922
  var hn = { exports: {} }, ro;
7923
- function $h() {
7923
+ function Ph() {
7924
7924
  if (ro) return hn.exports;
7925
7925
  ro = 1;
7926
7926
  var e = hn.exports = function(n, s, o) {
@@ -7998,7 +7998,7 @@ var no;
7998
7998
  function Vr() {
7999
7999
  if (no) return ye;
8000
8000
  no = 1, Object.defineProperty(ye, "__esModule", { value: !0 }), ye.getSchemaRefs = ye.resolveUrl = ye.normalizeId = ye._getFullPath = ye.getFullPath = ye.inlineRef = void 0;
8001
- const e = te(), t = Ya(), r = $h(), n = /* @__PURE__ */ new Set([
8001
+ const e = te(), t = Ya(), r = Ph(), n = /* @__PURE__ */ new Set([
8002
8002
  "type",
8003
8003
  "format",
8004
8004
  "pattern",
@@ -8107,7 +8107,7 @@ var so;
8107
8107
  function Hr() {
8108
8108
  if (so) return De;
8109
8109
  so = 1, Object.defineProperty(De, "__esModule", { value: !0 }), De.getData = De.KeywordCxt = De.validateFunctionCode = void 0;
8110
- const e = Th(), t = Ir(), r = Ka(), n = Ir(), s = Oh(), o = Ah(), a = Nh(), i = X(), c = je(), d = Vr(), l = te(), m = Fr();
8110
+ const e = Oh(), t = Ir(), r = Ka(), n = Ir(), s = Ah(), o = Nh(), a = $h(), i = X(), c = je(), d = Vr(), l = te(), m = Fr();
8111
8111
  function y(O) {
8112
8112
  if (_(O) && (R(O), E(O))) {
8113
8113
  f(O);
@@ -8597,16 +8597,16 @@ function zn() {
8597
8597
  }
8598
8598
  return _e;
8599
8599
  }
8600
- const Ph = "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", Ih = "Meta-schema for $data reference (JSON AnySchema extension proposal)", Dh = "object", Ch = ["$data"], Lh = { $data: { type: "string", anyOf: [{ format: "relative-json-pointer" }, { format: "json-pointer" }] } }, kh = !1, xh = {
8601
- $id: Ph,
8602
- description: Ih,
8603
- type: Dh,
8604
- required: Ch,
8605
- properties: Lh,
8606
- additionalProperties: kh
8600
+ const Ih = "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", Dh = "Meta-schema for $data reference (JSON AnySchema extension proposal)", Ch = "object", Lh = ["$data"], kh = { $data: { type: "string", anyOf: [{ format: "relative-json-pointer" }, { format: "json-pointer" }] } }, xh = !1, Uh = {
8601
+ $id: Ih,
8602
+ description: Dh,
8603
+ type: Ch,
8604
+ required: Lh,
8605
+ properties: kh,
8606
+ additionalProperties: xh
8607
8607
  };
8608
8608
  var qt = {}, yt = { exports: {} }, pn, co;
8609
- function Uh() {
8609
+ function qh() {
8610
8610
  return co || (co = 1, pn = {
8611
8611
  HEX: {
8612
8612
  0: 0,
@@ -8635,10 +8635,10 @@ function Uh() {
8635
8635
  }), pn;
8636
8636
  }
8637
8637
  var mn, uo;
8638
- function qh() {
8638
+ function Mh() {
8639
8639
  if (uo) return mn;
8640
8640
  uo = 1;
8641
- const { HEX: e } = Uh(), t = /^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;
8641
+ const { HEX: e } = qh(), t = /^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;
8642
8642
  function r(g) {
8643
8643
  if (i(g, ".") < 3)
8644
8644
  return { host: g, isIPV4: !1 };
@@ -8770,7 +8770,7 @@ function qh() {
8770
8770
  }, mn;
8771
8771
  }
8772
8772
  var gn, lo;
8773
- function Mh() {
8773
+ function jh() {
8774
8774
  if (lo) return gn;
8775
8775
  lo = 1;
8776
8776
  const e = /^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu, t = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
@@ -8862,10 +8862,10 @@ function Mh() {
8862
8862
  return gn = h, gn;
8863
8863
  }
8864
8864
  var fo;
8865
- function jh() {
8865
+ function Fh() {
8866
8866
  if (fo) return yt.exports;
8867
8867
  fo = 1;
8868
- const { normalizeIPv6: e, normalizeIPv4: t, removeDotSegments: r, recomposeAuthority: n, normalizeComponentEncoding: s } = qh(), o = Mh();
8868
+ const { normalizeIPv6: e, normalizeIPv4: t, removeDotSegments: r, recomposeAuthority: n, normalizeComponentEncoding: s } = Mh(), o = jh();
8869
8869
  function a(f, h) {
8870
8870
  return typeof f == "string" ? f = l(v(f, h), h) : typeof f == "object" && (f = v(l(f, h), h)), f;
8871
8871
  }
@@ -8961,14 +8961,14 @@ function jh() {
8961
8961
  return yt.exports = g, yt.exports.default = g, yt.exports.fastUri = g, yt.exports;
8962
8962
  }
8963
8963
  var ho;
8964
- function Fh() {
8964
+ function Vh() {
8965
8965
  if (ho) return qt;
8966
8966
  ho = 1, Object.defineProperty(qt, "__esModule", { value: !0 });
8967
- const e = jh();
8967
+ const e = Fh();
8968
8968
  return e.code = 'require("ajv/dist/runtime/uri").default', qt.default = e, qt;
8969
8969
  }
8970
8970
  var po;
8971
- function Vh() {
8971
+ function Hh() {
8972
8972
  return po || (po = 1, (function(e) {
8973
8973
  Object.defineProperty(e, "__esModule", { value: !0 }), e.CodeGen = e.Name = e.nil = e.stringify = e.str = e._ = e.KeywordCxt = void 0;
8974
8974
  var t = Hr();
@@ -8989,7 +8989,7 @@ function Vh() {
8989
8989
  } }), Object.defineProperty(e, "CodeGen", { enumerable: !0, get: function() {
8990
8990
  return r.CodeGen;
8991
8991
  } });
8992
- const n = Bn(), s = Br(), o = Ga(), a = zn(), i = X(), c = Vr(), d = Ir(), l = te(), m = xh, y = Fh(), S = (x, A) => new RegExp(x, A);
8992
+ const n = Bn(), s = Br(), o = Ga(), a = zn(), i = X(), c = Vr(), d = Ir(), l = te(), m = Uh, y = Vh(), S = (x, A) => new RegExp(x, A);
8993
8993
  S.code = "new RegExp";
8994
8994
  const v = ["removeAdditional", "useDefaults", "coerceTypes"], g = /* @__PURE__ */ new Set([
8995
8995
  "validate",
@@ -9411,7 +9411,7 @@ function Vh() {
9411
9411
  })(an)), an;
9412
9412
  }
9413
9413
  var Mt = {}, jt = {}, Ft = {}, mo;
9414
- function Hh() {
9414
+ function Bh() {
9415
9415
  if (mo) return Ft;
9416
9416
  mo = 1, Object.defineProperty(Ft, "__esModule", { value: !0 });
9417
9417
  const e = {
@@ -9423,7 +9423,7 @@ function Hh() {
9423
9423
  return Ft.default = e, Ft;
9424
9424
  }
9425
9425
  var Ue = {}, go;
9426
- function Bh() {
9426
+ function zh() {
9427
9427
  if (go) return Ue;
9428
9428
  go = 1, Object.defineProperty(Ue, "__esModule", { value: !0 }), Ue.callRef = Ue.getValidate = void 0;
9429
9429
  const e = Br(), t = Pe(), r = X(), n = je(), s = zn(), o = te(), a = {
@@ -9510,10 +9510,10 @@ function Bh() {
9510
9510
  return Ue.callRef = c, Ue.default = a, Ue;
9511
9511
  }
9512
9512
  var yo;
9513
- function zh() {
9513
+ function Gh() {
9514
9514
  if (yo) return jt;
9515
9515
  yo = 1, Object.defineProperty(jt, "__esModule", { value: !0 });
9516
- const e = Hh(), t = Bh(), r = [
9516
+ const e = Bh(), t = zh(), r = [
9517
9517
  "$schema",
9518
9518
  "$id",
9519
9519
  "$defs",
@@ -9526,7 +9526,7 @@ function zh() {
9526
9526
  return jt.default = r, jt;
9527
9527
  }
9528
9528
  var Vt = {}, Ht = {}, vo;
9529
- function Gh() {
9529
+ function Kh() {
9530
9530
  if (vo) return Ht;
9531
9531
  vo = 1, Object.defineProperty(Ht, "__esModule", { value: !0 });
9532
9532
  const e = X(), t = e.operators, r = {
@@ -9551,7 +9551,7 @@ function Gh() {
9551
9551
  return Ht.default = s, Ht;
9552
9552
  }
9553
9553
  var Bt = {}, wo;
9554
- function Kh() {
9554
+ function Yh() {
9555
9555
  if (wo) return Bt;
9556
9556
  wo = 1, Object.defineProperty(Bt, "__esModule", { value: !0 });
9557
9557
  const e = X(), r = {
@@ -9571,7 +9571,7 @@ function Kh() {
9571
9571
  return Bt.default = r, Bt;
9572
9572
  }
9573
9573
  var zt = {}, Gt = {}, Eo;
9574
- function Yh() {
9574
+ function Wh() {
9575
9575
  if (Eo) return Gt;
9576
9576
  Eo = 1, Object.defineProperty(Gt, "__esModule", { value: !0 });
9577
9577
  function e(t) {
@@ -9584,10 +9584,10 @@ function Yh() {
9584
9584
  return Gt.default = e, e.code = 'require("ajv/dist/runtime/ucs2length").default', Gt;
9585
9585
  }
9586
9586
  var bo;
9587
- function Wh() {
9587
+ function Jh() {
9588
9588
  if (bo) return zt;
9589
9589
  bo = 1, Object.defineProperty(zt, "__esModule", { value: !0 });
9590
- const e = X(), t = te(), r = Yh(), s = {
9590
+ const e = X(), t = te(), r = Wh(), s = {
9591
9591
  keyword: ["maxLength", "minLength"],
9592
9592
  type: "string",
9593
9593
  schemaType: "number",
@@ -9607,7 +9607,7 @@ function Wh() {
9607
9607
  return zt.default = s, zt;
9608
9608
  }
9609
9609
  var Kt = {}, _o;
9610
- function Jh() {
9610
+ function Qh() {
9611
9611
  if (_o) return Kt;
9612
9612
  _o = 1, Object.defineProperty(Kt, "__esModule", { value: !0 });
9613
9613
  const e = Pe(), t = X(), n = {
@@ -9627,7 +9627,7 @@ function Jh() {
9627
9627
  return Kt.default = n, Kt;
9628
9628
  }
9629
9629
  var Yt = {}, So;
9630
- function Qh() {
9630
+ function Xh() {
9631
9631
  if (So) return Yt;
9632
9632
  So = 1, Object.defineProperty(Yt, "__esModule", { value: !0 });
9633
9633
  const e = X(), r = {
@@ -9650,7 +9650,7 @@ function Qh() {
9650
9650
  return Yt.default = r, Yt;
9651
9651
  }
9652
9652
  var Wt = {}, Ro;
9653
- function Xh() {
9653
+ function Zh() {
9654
9654
  if (Ro) return Wt;
9655
9655
  Ro = 1, Object.defineProperty(Wt, "__esModule", { value: !0 });
9656
9656
  const e = Pe(), t = X(), r = te(), s = {
@@ -9707,7 +9707,7 @@ function Xh() {
9707
9707
  return Wt.default = s, Wt;
9708
9708
  }
9709
9709
  var Jt = {}, To;
9710
- function Zh() {
9710
+ function ep() {
9711
9711
  if (To) return Jt;
9712
9712
  To = 1, Object.defineProperty(Jt, "__esModule", { value: !0 });
9713
9713
  const e = X(), r = {
@@ -9737,7 +9737,7 @@ function Gn() {
9737
9737
  return e.code = 'require("ajv/dist/runtime/equal").default', Xt.default = e, Xt;
9738
9738
  }
9739
9739
  var Ao;
9740
- function ep() {
9740
+ function tp() {
9741
9741
  if (Ao) return Qt;
9742
9742
  Ao = 1, Object.defineProperty(Qt, "__esModule", { value: !0 });
9743
9743
  const e = Ir(), t = X(), r = te(), n = Gn(), o = {
@@ -9781,7 +9781,7 @@ function ep() {
9781
9781
  return Qt.default = o, Qt;
9782
9782
  }
9783
9783
  var Zt = {}, No;
9784
- function tp() {
9784
+ function rp() {
9785
9785
  if (No) return Zt;
9786
9786
  No = 1, Object.defineProperty(Zt, "__esModule", { value: !0 });
9787
9787
  const e = X(), t = te(), r = Gn(), s = {
@@ -9799,7 +9799,7 @@ function tp() {
9799
9799
  return Zt.default = s, Zt;
9800
9800
  }
9801
9801
  var er = {}, $o;
9802
- function rp() {
9802
+ function np() {
9803
9803
  if ($o) return er;
9804
9804
  $o = 1, Object.defineProperty(er, "__esModule", { value: !0 });
9805
9805
  const e = X(), t = te(), r = Gn(), s = {
@@ -9839,10 +9839,10 @@ function rp() {
9839
9839
  return er.default = s, er;
9840
9840
  }
9841
9841
  var Po;
9842
- function np() {
9842
+ function sp() {
9843
9843
  if (Po) return Vt;
9844
9844
  Po = 1, Object.defineProperty(Vt, "__esModule", { value: !0 });
9845
- const e = Gh(), t = Kh(), r = Wh(), n = Jh(), s = Qh(), o = Xh(), a = Zh(), i = ep(), c = tp(), d = rp(), l = [
9845
+ const e = Kh(), t = Yh(), r = Jh(), n = Qh(), s = Xh(), o = Zh(), a = ep(), i = tp(), c = rp(), d = np(), l = [
9846
9846
  // number
9847
9847
  e.default,
9848
9848
  t.default,
@@ -9941,7 +9941,7 @@ function Ja() {
9941
9941
  return rt.validateTuple = s, rt.default = n, rt;
9942
9942
  }
9943
9943
  var Co;
9944
- function sp() {
9944
+ function op() {
9945
9945
  if (Co) return rr;
9946
9946
  Co = 1, Object.defineProperty(rr, "__esModule", { value: !0 });
9947
9947
  const e = Ja(), t = {
@@ -9954,7 +9954,7 @@ function sp() {
9954
9954
  return rr.default = t, rr;
9955
9955
  }
9956
9956
  var nr = {}, Lo;
9957
- function op() {
9957
+ function ap() {
9958
9958
  if (Lo) return nr;
9959
9959
  Lo = 1, Object.defineProperty(nr, "__esModule", { value: !0 });
9960
9960
  const e = X(), t = te(), r = Pe(), n = Wa(), o = {
@@ -9974,7 +9974,7 @@ function op() {
9974
9974
  return nr.default = o, nr;
9975
9975
  }
9976
9976
  var sr = {}, ko;
9977
- function ap() {
9977
+ function ip() {
9978
9978
  if (ko) return sr;
9979
9979
  ko = 1, Object.defineProperty(sr, "__esModule", { value: !0 });
9980
9980
  const e = X(), t = te(), n = {
@@ -10031,7 +10031,7 @@ function ap() {
10031
10031
  return sr.default = n, sr;
10032
10032
  }
10033
10033
  var yn = {}, xo;
10034
- function ip() {
10034
+ function cp() {
10035
10035
  return xo || (xo = 1, (function(e) {
10036
10036
  Object.defineProperty(e, "__esModule", { value: !0 }), e.validateSchemaDeps = e.validatePropertyDeps = e.error = void 0;
10037
10037
  const t = X(), r = te(), n = Pe();
@@ -10104,7 +10104,7 @@ function ip() {
10104
10104
  })(yn)), yn;
10105
10105
  }
10106
10106
  var or = {}, Uo;
10107
- function cp() {
10107
+ function up() {
10108
10108
  if (Uo) return or;
10109
10109
  Uo = 1, Object.defineProperty(or, "__esModule", { value: !0 });
10110
10110
  const e = X(), t = te(), n = {
@@ -10207,7 +10207,7 @@ function Qa() {
10207
10207
  return ar.default = o, ar;
10208
10208
  }
10209
10209
  var ir = {}, Mo;
10210
- function up() {
10210
+ function lp() {
10211
10211
  if (Mo) return ir;
10212
10212
  Mo = 1, Object.defineProperty(ir, "__esModule", { value: !0 });
10213
10213
  const e = Hr(), t = Pe(), r = te(), n = Qa(), s = {
@@ -10242,7 +10242,7 @@ function up() {
10242
10242
  return ir.default = s, ir;
10243
10243
  }
10244
10244
  var cr = {}, jo;
10245
- function lp() {
10245
+ function dp() {
10246
10246
  if (jo) return cr;
10247
10247
  jo = 1, Object.defineProperty(cr, "__esModule", { value: !0 });
10248
10248
  const e = Pe(), t = X(), r = te(), n = te(), s = {
@@ -10283,7 +10283,7 @@ function lp() {
10283
10283
  return cr.default = s, cr;
10284
10284
  }
10285
10285
  var ur = {}, Fo;
10286
- function dp() {
10286
+ function fp() {
10287
10287
  if (Fo) return ur;
10288
10288
  Fo = 1, Object.defineProperty(ur, "__esModule", { value: !0 });
10289
10289
  const e = te(), t = {
@@ -10309,7 +10309,7 @@ function dp() {
10309
10309
  return ur.default = t, ur;
10310
10310
  }
10311
10311
  var lr = {}, Vo;
10312
- function fp() {
10312
+ function hp() {
10313
10313
  if (Vo) return lr;
10314
10314
  Vo = 1, Object.defineProperty(lr, "__esModule", { value: !0 });
10315
10315
  const t = {
@@ -10322,7 +10322,7 @@ function fp() {
10322
10322
  return lr.default = t, lr;
10323
10323
  }
10324
10324
  var dr = {}, Ho;
10325
- function hp() {
10325
+ function pp() {
10326
10326
  if (Ho) return dr;
10327
10327
  Ho = 1, Object.defineProperty(dr, "__esModule", { value: !0 });
10328
10328
  const e = X(), t = te(), n = {
@@ -10358,7 +10358,7 @@ function hp() {
10358
10358
  return dr.default = n, dr;
10359
10359
  }
10360
10360
  var fr = {}, Bo;
10361
- function pp() {
10361
+ function mp() {
10362
10362
  if (Bo) return fr;
10363
10363
  Bo = 1, Object.defineProperty(fr, "__esModule", { value: !0 });
10364
10364
  const e = te(), t = {
@@ -10380,7 +10380,7 @@ function pp() {
10380
10380
  return fr.default = t, fr;
10381
10381
  }
10382
10382
  var hr = {}, zo;
10383
- function mp() {
10383
+ function gp() {
10384
10384
  if (zo) return hr;
10385
10385
  zo = 1, Object.defineProperty(hr, "__esModule", { value: !0 });
10386
10386
  const e = X(), t = te(), n = {
@@ -10427,7 +10427,7 @@ function mp() {
10427
10427
  return hr.default = n, hr;
10428
10428
  }
10429
10429
  var pr = {}, Go;
10430
- function gp() {
10430
+ function yp() {
10431
10431
  if (Go) return pr;
10432
10432
  Go = 1, Object.defineProperty(pr, "__esModule", { value: !0 });
10433
10433
  const e = te(), t = {
@@ -10440,10 +10440,10 @@ function gp() {
10440
10440
  return pr.default = t, pr;
10441
10441
  }
10442
10442
  var Ko;
10443
- function yp() {
10443
+ function vp() {
10444
10444
  if (Ko) return tr;
10445
10445
  Ko = 1, Object.defineProperty(tr, "__esModule", { value: !0 });
10446
- const e = Wa(), t = sp(), r = Ja(), n = op(), s = ap(), o = ip(), a = cp(), i = Qa(), c = up(), d = lp(), l = dp(), m = fp(), y = hp(), S = pp(), v = mp(), g = gp();
10446
+ const e = Wa(), t = op(), r = Ja(), n = ap(), s = ip(), o = cp(), a = up(), i = Qa(), c = lp(), d = dp(), l = fp(), m = hp(), y = pp(), S = mp(), v = gp(), g = yp();
10447
10447
  function f(h = !1) {
10448
10448
  const u = [
10449
10449
  // any
@@ -10465,7 +10465,7 @@ function yp() {
10465
10465
  return tr.default = f, tr;
10466
10466
  }
10467
10467
  var mr = {}, gr = {}, Yo;
10468
- function vp() {
10468
+ function wp() {
10469
10469
  if (Yo) return gr;
10470
10470
  Yo = 1, Object.defineProperty(gr, "__esModule", { value: !0 });
10471
10471
  const e = X(), r = {
@@ -10534,14 +10534,14 @@ function vp() {
10534
10534
  return gr.default = r, gr;
10535
10535
  }
10536
10536
  var Wo;
10537
- function wp() {
10537
+ function Ep() {
10538
10538
  if (Wo) return mr;
10539
10539
  Wo = 1, Object.defineProperty(mr, "__esModule", { value: !0 });
10540
- const t = [vp().default];
10540
+ const t = [wp().default];
10541
10541
  return mr.default = t, mr;
10542
10542
  }
10543
10543
  var He = {}, Jo;
10544
- function Ep() {
10544
+ function bp() {
10545
10545
  return Jo || (Jo = 1, Object.defineProperty(He, "__esModule", { value: !0 }), He.contentVocabulary = He.metadataVocabulary = void 0, He.metadataVocabulary = [
10546
10546
  "title",
10547
10547
  "description",
@@ -10557,10 +10557,10 @@ function Ep() {
10557
10557
  ]), He;
10558
10558
  }
10559
10559
  var Qo;
10560
- function bp() {
10560
+ function _p() {
10561
10561
  if (Qo) return Mt;
10562
10562
  Qo = 1, Object.defineProperty(Mt, "__esModule", { value: !0 });
10563
- const e = zh(), t = np(), r = yp(), n = wp(), s = Ep(), o = [
10563
+ const e = Gh(), t = sp(), r = vp(), n = Ep(), s = bp(), o = [
10564
10564
  e.default,
10565
10565
  t.default,
10566
10566
  (0, r.default)(),
@@ -10571,7 +10571,7 @@ function bp() {
10571
10571
  return Mt.default = o, Mt;
10572
10572
  }
10573
10573
  var yr = {}, vt = {}, Xo;
10574
- function _p() {
10574
+ function Sp() {
10575
10575
  if (Xo) return vt;
10576
10576
  Xo = 1, Object.defineProperty(vt, "__esModule", { value: !0 }), vt.DiscrError = void 0;
10577
10577
  var e;
@@ -10580,10 +10580,10 @@ function _p() {
10580
10580
  })(e || (vt.DiscrError = e = {})), vt;
10581
10581
  }
10582
10582
  var Zo;
10583
- function Sp() {
10583
+ function Rp() {
10584
10584
  if (Zo) return yr;
10585
10585
  Zo = 1, Object.defineProperty(yr, "__esModule", { value: !0 });
10586
- const e = X(), t = _p(), r = zn(), n = Br(), s = te(), a = {
10586
+ const e = X(), t = Sp(), r = zn(), n = Br(), s = te(), a = {
10587
10587
  keyword: "discriminator",
10588
10588
  type: "object",
10589
10589
  schemaType: "object",
@@ -10656,20 +10656,20 @@ function Sp() {
10656
10656
  };
10657
10657
  return yr.default = a, yr;
10658
10658
  }
10659
- const Rp = "http://json-schema.org/draft-07/schema#", Tp = "http://json-schema.org/draft-07/schema#", Op = "Core schema meta-schema", Ap = { schemaArray: { type: "array", minItems: 1, items: { $ref: "#" } }, nonNegativeInteger: { type: "integer", minimum: 0 }, nonNegativeIntegerDefault0: { allOf: [{ $ref: "#/definitions/nonNegativeInteger" }, { default: 0 }] }, simpleTypes: { enum: ["array", "boolean", "integer", "null", "number", "object", "string"] }, stringArray: { type: "array", items: { type: "string" }, uniqueItems: !0, default: [] } }, Np = ["object", "boolean"], $p = { $id: { type: "string", format: "uri-reference" }, $schema: { type: "string", format: "uri" }, $ref: { type: "string", format: "uri-reference" }, $comment: { type: "string" }, title: { type: "string" }, description: { type: "string" }, default: !0, readOnly: { type: "boolean", default: !1 }, examples: { type: "array", items: !0 }, multipleOf: { type: "number", exclusiveMinimum: 0 }, maximum: { type: "number" }, exclusiveMaximum: { type: "number" }, minimum: { type: "number" }, exclusiveMinimum: { type: "number" }, maxLength: { $ref: "#/definitions/nonNegativeInteger" }, minLength: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, pattern: { type: "string", format: "regex" }, additionalItems: { $ref: "#" }, items: { anyOf: [{ $ref: "#" }, { $ref: "#/definitions/schemaArray" }], default: !0 }, maxItems: { $ref: "#/definitions/nonNegativeInteger" }, minItems: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, uniqueItems: { type: "boolean", default: !1 }, contains: { $ref: "#" }, maxProperties: { $ref: "#/definitions/nonNegativeInteger" }, minProperties: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, required: { $ref: "#/definitions/stringArray" }, additionalProperties: { $ref: "#" }, definitions: { type: "object", additionalProperties: { $ref: "#" }, default: {} }, properties: { type: "object", additionalProperties: { $ref: "#" }, default: {} }, patternProperties: { type: "object", additionalProperties: { $ref: "#" }, propertyNames: { format: "regex" }, default: {} }, dependencies: { type: "object", additionalProperties: { anyOf: [{ $ref: "#" }, { $ref: "#/definitions/stringArray" }] } }, propertyNames: { $ref: "#" }, const: !0, enum: { type: "array", items: !0, minItems: 1, uniqueItems: !0 }, type: { anyOf: [{ $ref: "#/definitions/simpleTypes" }, { type: "array", items: { $ref: "#/definitions/simpleTypes" }, minItems: 1, uniqueItems: !0 }] }, format: { type: "string" }, contentMediaType: { type: "string" }, contentEncoding: { type: "string" }, if: { $ref: "#" }, then: { $ref: "#" }, else: { $ref: "#" }, allOf: { $ref: "#/definitions/schemaArray" }, anyOf: { $ref: "#/definitions/schemaArray" }, oneOf: { $ref: "#/definitions/schemaArray" }, not: { $ref: "#" } }, Pp = {
10660
- $schema: Rp,
10661
- $id: Tp,
10662
- title: Op,
10663
- definitions: Ap,
10664
- type: Np,
10665
- properties: $p,
10659
+ const Tp = "http://json-schema.org/draft-07/schema#", Op = "http://json-schema.org/draft-07/schema#", Ap = "Core schema meta-schema", Np = { schemaArray: { type: "array", minItems: 1, items: { $ref: "#" } }, nonNegativeInteger: { type: "integer", minimum: 0 }, nonNegativeIntegerDefault0: { allOf: [{ $ref: "#/definitions/nonNegativeInteger" }, { default: 0 }] }, simpleTypes: { enum: ["array", "boolean", "integer", "null", "number", "object", "string"] }, stringArray: { type: "array", items: { type: "string" }, uniqueItems: !0, default: [] } }, $p = ["object", "boolean"], Pp = { $id: { type: "string", format: "uri-reference" }, $schema: { type: "string", format: "uri" }, $ref: { type: "string", format: "uri-reference" }, $comment: { type: "string" }, title: { type: "string" }, description: { type: "string" }, default: !0, readOnly: { type: "boolean", default: !1 }, examples: { type: "array", items: !0 }, multipleOf: { type: "number", exclusiveMinimum: 0 }, maximum: { type: "number" }, exclusiveMaximum: { type: "number" }, minimum: { type: "number" }, exclusiveMinimum: { type: "number" }, maxLength: { $ref: "#/definitions/nonNegativeInteger" }, minLength: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, pattern: { type: "string", format: "regex" }, additionalItems: { $ref: "#" }, items: { anyOf: [{ $ref: "#" }, { $ref: "#/definitions/schemaArray" }], default: !0 }, maxItems: { $ref: "#/definitions/nonNegativeInteger" }, minItems: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, uniqueItems: { type: "boolean", default: !1 }, contains: { $ref: "#" }, maxProperties: { $ref: "#/definitions/nonNegativeInteger" }, minProperties: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, required: { $ref: "#/definitions/stringArray" }, additionalProperties: { $ref: "#" }, definitions: { type: "object", additionalProperties: { $ref: "#" }, default: {} }, properties: { type: "object", additionalProperties: { $ref: "#" }, default: {} }, patternProperties: { type: "object", additionalProperties: { $ref: "#" }, propertyNames: { format: "regex" }, default: {} }, dependencies: { type: "object", additionalProperties: { anyOf: [{ $ref: "#" }, { $ref: "#/definitions/stringArray" }] } }, propertyNames: { $ref: "#" }, const: !0, enum: { type: "array", items: !0, minItems: 1, uniqueItems: !0 }, type: { anyOf: [{ $ref: "#/definitions/simpleTypes" }, { type: "array", items: { $ref: "#/definitions/simpleTypes" }, minItems: 1, uniqueItems: !0 }] }, format: { type: "string" }, contentMediaType: { type: "string" }, contentEncoding: { type: "string" }, if: { $ref: "#" }, then: { $ref: "#" }, else: { $ref: "#" }, allOf: { $ref: "#/definitions/schemaArray" }, anyOf: { $ref: "#/definitions/schemaArray" }, oneOf: { $ref: "#/definitions/schemaArray" }, not: { $ref: "#" } }, Ip = {
10660
+ $schema: Tp,
10661
+ $id: Op,
10662
+ title: Ap,
10663
+ definitions: Np,
10664
+ type: $p,
10665
+ properties: Pp,
10666
10666
  default: !0
10667
10667
  };
10668
10668
  var ea;
10669
- function Ip() {
10669
+ function Dp() {
10670
10670
  return ea || (ea = 1, (function(e, t) {
10671
10671
  Object.defineProperty(t, "__esModule", { value: !0 }), t.MissingRefError = t.ValidationError = t.CodeGen = t.Name = t.nil = t.stringify = t.str = t._ = t.KeywordCxt = t.Ajv = void 0;
10672
- const r = Vh(), n = bp(), s = Sp(), o = Pp, a = ["/properties"], i = "http://json-schema.org/draft-07/schema";
10672
+ const r = Hh(), n = _p(), s = Rp(), o = Ip, a = ["/properties"], i = "http://json-schema.org/draft-07/schema";
10673
10673
  class c extends r.default {
10674
10674
  _addVocabularies() {
10675
10675
  super._addVocabularies(), n.default.forEach((v) => this.addVocabulary(v)), this.opts.discriminator && this.addKeyword(s.default);
@@ -10713,86 +10713,86 @@ function Ip() {
10713
10713
  } });
10714
10714
  })(Lt, Lt.exports)), Lt.exports;
10715
10715
  }
10716
- var Dp = Ip();
10717
- const Cp = /* @__PURE__ */ Rh(Dp), ta = {
10716
+ var Cp = Dp();
10717
+ const Lp = /* @__PURE__ */ Th(Cp), ta = {
10718
10718
  CONFIG_NOT_FOUND: "CONFIG_ERROR_NOT_FOUND",
10719
10719
  VALIDATION_FAILED: "CONFIG_ERROR_VALIDATION_FAILED"
10720
- }, Iy = async (e, t) => {
10721
- const r = await Lp(e);
10720
+ }, Dy = async (e, t) => {
10721
+ const r = await kp(e);
10722
10722
  if (!r)
10723
10723
  throw new Error(ta.CONFIG_NOT_FOUND);
10724
- if (!await kp(r, t))
10724
+ if (!await xp(r, t))
10725
10725
  throw new Error(ta.VALIDATION_FAILED);
10726
10726
  return r;
10727
- }, Lp = async (e) => await z(e), kp = async (e, t) => new Cp().compile(t)(e), xp = (e) => Z + `/form/${e}?v=custom:(resources:(value))`, Up = (e) => {
10727
+ }, kp = async (e) => await z(e), xp = async (e, t) => new Lp().compile(t)(e), Up = (e) => Z + `/form/${e}?v=custom:(resources:(value))`, qp = (e) => {
10728
10728
  const t = Z + "/bahmniie/form/latestPublishedForms";
10729
10729
  return e ? t + `?episodeUuid=${e}` : t;
10730
- }, Dy = (e) => Z + `/user/${e}?v=full`, qp = (e, t, r, n) => Z + `/bahmniie/form/translations?formName=${encodeURIComponent(e)}&formUuid=${t}&formVersion=${r}&locale=${n}`, _r = "Bahmni", Mp = (e, t, r) => {
10730
+ }, Cy = (e) => Z + `/user/${e}?v=full`, Mp = (e, t, r, n) => Z + `/bahmniie/form/translations?formName=${encodeURIComponent(e)}&formUuid=${t}&formVersion=${r}&locale=${n}`, _r = "Bahmni", jp = (e, t, r) => {
10731
10731
  let s = Z + "/bahmnicore/patient/" + e + "/forms";
10732
10732
  return r ? s += `?patientProgramUuid=${r}` : t && (s += `?numberOfVisits=${t}`), s;
10733
- }, jp = (e, t) => {
10733
+ }, Fp = (e, t) => {
10734
10734
  const r = t.join(",");
10735
10735
  return `${le}/Observation?patient=${e}&code=${r}&_include=Observation:has-member&_sort=-_lastUpdated`;
10736
- }, Fp = (e, t) => {
10736
+ }, Vp = (e, t) => {
10737
10737
  const r = t.join(",");
10738
10738
  return `${le}/Observation?patient=${e}&code=${r}&_include=Observation:has-member&_include=Observation:encounter&_sort=-_lastUpdated`;
10739
10739
  };
10740
- async function Vp(e, t) {
10741
- const r = jp(e, t);
10742
- return await z(r);
10743
- }
10744
- async function Cy(e, t) {
10740
+ async function Hp(e, t) {
10745
10741
  const r = Fp(e, t);
10746
10742
  return await z(r);
10747
10743
  }
10748
10744
  async function Ly(e, t) {
10749
- return (await Vp(e, t)).entry?.filter((s) => s.resource?.resourceType === "Observation").map((s) => s.resource) ?? [];
10745
+ const r = Vp(e, t);
10746
+ return await z(r);
10750
10747
  }
10751
- const Hp = (e) => Z + `/provider?user=${e}&v=custom:(uuid,display,person)`;
10752
- async function ky(e) {
10748
+ async function ky(e, t) {
10749
+ return (await Hp(e, t)).entry?.filter((s) => s.resource?.resourceType === "Observation").map((s) => s.resource) ?? [];
10750
+ }
10751
+ const Bp = (e) => Z + `/provider?user=${e}&v=custom:(uuid,display,person)`;
10752
+ async function xy(e) {
10753
10753
  const t = await z(
10754
- Hp(e)
10754
+ Bp(e)
10755
10755
  );
10756
10756
  return !t.results || t.results.length === 0 ? null : t.results[0];
10757
10757
  }
10758
- const Bp = (e) => le + `/Encounter?subject:Patient=${e}&_tag=visit`, zp = (e) => `${le}/Observation/$fetch-all?encounter=${e}`;
10759
- async function Gp(e) {
10760
- return await z(Bp(e));
10761
- }
10758
+ const zp = (e) => le + `/Encounter?subject:Patient=${e}&_tag=visit`, Gp = (e) => `${le}/Observation/$fetch-all?encounter=${e}`;
10762
10759
  async function Kp(e) {
10763
- return (await Gp(e)).entry?.map((r) => r.resource).filter((r) => r !== void 0) ?? [];
10760
+ return await z(zp(e));
10764
10761
  }
10765
10762
  async function Yp(e) {
10766
- return (await Kp(e)).find((r) => !r.period?.end) ?? null;
10763
+ return (await Kp(e)).entry?.map((r) => r.resource).filter((r) => r !== void 0) ?? [];
10767
10764
  }
10768
- async function xy(e) {
10765
+ async function Wp(e) {
10766
+ return (await Yp(e)).find((r) => !r.period?.end) ?? null;
10767
+ }
10768
+ async function Uy(e) {
10769
10769
  return await z(
10770
- zp(e)
10770
+ Gp(e)
10771
10771
  );
10772
10772
  }
10773
- const Uy = (e, t) => e?.length === 0 ? !1 : t?.length === 0, Wp = le + "/Encounter", Jp = Z + "/systemsetting/bahmni.encountersession.duration", Qp = "d34fe3ab-5e07-11ef-8f7c-0242ac120002";
10774
- async function Xp(e) {
10773
+ const qy = (e, t) => e?.length === 0 ? !1 : t?.length === 0, Jp = le + "/Encounter", Qp = Z + "/systemsetting/bahmni.encountersession.duration", Xp = "d34fe3ab-5e07-11ef-8f7c-0242ac120002";
10774
+ async function Zp(e) {
10775
10775
  const t = new URLSearchParams();
10776
10776
  Object.entries(e).forEach(([s, o]) => {
10777
10777
  o && t.append(s, o);
10778
10778
  });
10779
- const r = `${Wp}?${t.toString()}`;
10779
+ const r = `${Jp}?${t.toString()}`;
10780
10780
  return (await z(r)).entry?.map((s) => s.resource).filter((s) => s !== void 0) ?? [];
10781
10781
  }
10782
- async function Zp() {
10782
+ async function em() {
10783
10783
  try {
10784
10784
  const e = await z(
10785
- Jp
10785
+ Qp
10786
10786
  ), t = Number(e.value);
10787
10787
  return !isNaN(t) && t > 0 ? t : 60;
10788
10788
  } catch {
10789
10789
  return 30;
10790
10790
  }
10791
10791
  }
10792
- async function em(e, t) {
10792
+ async function tm(e, t) {
10793
10793
  if (!e.length) return null;
10794
10794
  try {
10795
- const r = await Yp(t);
10795
+ const r = await Wp(t);
10796
10796
  return r ? e.find((n) => {
10797
10797
  const s = n.partOf?.reference?.split("/")[1];
10798
10798
  return r.id === s;
@@ -10801,25 +10801,25 @@ async function em(e, t) {
10801
10801
  return null;
10802
10802
  }
10803
10803
  }
10804
- async function qy(e, t, r) {
10804
+ async function My(e, t, r) {
10805
10805
  try {
10806
10806
  if (!e) return null;
10807
- const n = r ?? await Zp(), o = `ge${new Date(Date.now() - n * 60 * 1e3).toISOString()}`, a = {
10807
+ const n = r ?? await em(), o = `ge${new Date(Date.now() - n * 60 * 1e3).toISOString()}`, a = {
10808
10808
  patient: e,
10809
10809
  _tag: "encounter",
10810
10810
  _lastUpdated: o,
10811
- type: Qp
10811
+ type: Xp
10812
10812
  };
10813
10813
  t && (a.participant = t);
10814
- const i = await Xp(a);
10815
- return i.length === 0 ? null : await em(i, e);
10814
+ const i = await Zp(a);
10815
+ return i.length === 0 ? null : await tm(i, e);
10816
10816
  } catch {
10817
10817
  return null;
10818
10818
  }
10819
10819
  }
10820
- const tm = (e) => le + `/EpisodeOfCare?_revinclude=Encounter:episode-of-care&_id=${e}`;
10821
- async function My(e) {
10822
- const t = e.join(","), r = await z(tm(t));
10820
+ const rm = (e) => le + `/EpisodeOfCare?_revinclude=Encounter:episode-of-care&_id=${e}`;
10821
+ async function jy(e) {
10822
+ const t = e.join(","), r = await z(rm(t));
10823
10823
  if (r.total === 0)
10824
10824
  throw new Error(
10825
10825
  "No episode of care found for the provided UUIDs: " + e.join(", ")
@@ -10831,13 +10831,13 @@ async function My(e) {
10831
10831
  c && s.add(c);
10832
10832
  }), { visitUuids: Array.from(s), encounterUuids: o };
10833
10833
  }
10834
- const vn = /* @__PURE__ */ new Map(), rm = async (e) => {
10834
+ const vn = /* @__PURE__ */ new Map(), nm = async (e) => {
10835
10835
  if (vn.has(e))
10836
10836
  return vn.get(e) ?? null;
10837
10837
  const t = await z(Ia(e)), r = t ? String(t) : null;
10838
10838
  return vn.set(e, r), r;
10839
- }, nm = async () => await rm(qu) === "true", sm = async (e, t, r, n = nt.CLINICAL) => {
10840
- if (!await nm())
10839
+ }, sm = async () => await nm(qu) === "true", om = async (e, t, r, n = nt.CLINICAL) => {
10840
+ if (!await sm())
10841
10841
  return { logged: !1 };
10842
10842
  const o = An[t];
10843
10843
  if (!o)
@@ -10854,21 +10854,21 @@ const vn = /* @__PURE__ */ new Map(), rm = async (e) => {
10854
10854
  module: n
10855
10855
  };
10856
10856
  return await Me(wl, a), { logged: !0 };
10857
- }, jy = () => vl(async (t) => {
10858
- await sm(
10857
+ }, Fy = () => vl(async (t) => {
10858
+ await om(
10859
10859
  t.patientUuid,
10860
10860
  t.eventType,
10861
10861
  t.messageParams,
10862
10862
  t.module
10863
10863
  );
10864
- }), Fy = async () => {
10864
+ }), Vy = async () => {
10865
10865
  try {
10866
10866
  return (await z(Du)).user.privileges;
10867
10867
  } catch (e) {
10868
10868
  const { message: t } = Rr(e);
10869
10869
  throw new Error(t);
10870
10870
  }
10871
- }, Vy = (e, t) => {
10871
+ }, Hy = (e, t) => {
10872
10872
  if (!e || e.length === 0)
10873
10873
  return !1;
10874
10874
  if (!t || t.length === 0)
@@ -10877,17 +10877,17 @@ const vn = /* @__PURE__ */ new Map(), rm = async (e) => {
10877
10877
  return e.some(
10878
10878
  (n) => r.includes(n.name)
10879
10879
  );
10880
- }, om = async (e) => {
10880
+ }, am = async (e) => {
10881
10881
  let t;
10882
10882
  e && e.length > 0 && (t = e.join(","));
10883
- const r = await fetch(Up(t));
10883
+ const r = await fetch(qp(t));
10884
10884
  if (!r.ok)
10885
10885
  throw new Error(
10886
10886
  `HTTP error! status for latestPublishedForms: ${r.status}`
10887
10887
  );
10888
10888
  const n = await r.json();
10889
10889
  return Array.isArray(n) ? n : [];
10890
- }, am = (e, t) => {
10890
+ }, im = (e, t) => {
10891
10891
  const r = JSON.parse(e.nameTranslation);
10892
10892
  if (Array.isArray(r) && r.length > 0) {
10893
10893
  const n = r.find(
@@ -10897,8 +10897,8 @@ const vn = /* @__PURE__ */ new Map(), rm = async (e) => {
10897
10897
  return n.display;
10898
10898
  }
10899
10899
  return e.name;
10900
- }, im = (e, t) => {
10901
- const r = am(e, t);
10900
+ }, cm = (e, t) => {
10901
+ const r = im(e, t);
10902
10902
  return {
10903
10903
  uuid: e.uuid,
10904
10904
  name: r,
@@ -10908,13 +10908,13 @@ const vn = /* @__PURE__ */ new Map(), rm = async (e) => {
10908
10908
  editable: n.editable
10909
10909
  }))
10910
10910
  };
10911
- }, Hy = async (e) => {
10912
- const t = await om(e), r = qr();
10911
+ }, By = async (e) => {
10912
+ const t = await am(e), r = qr();
10913
10913
  return t.map(
10914
- (n) => im(n, r)
10914
+ (n) => cm(n, r)
10915
10915
  );
10916
- }, By = async (e) => {
10917
- const t = await fetch(xp(e));
10916
+ }, zy = async (e) => {
10917
+ const t = await fetch(Up(e));
10918
10918
  if (!t.ok)
10919
10919
  throw new Error(
10920
10920
  `Failed to fetch form metadata for ${e}: ${t.status}`
@@ -10925,7 +10925,7 @@ const vn = /* @__PURE__ */ new Map(), rm = async (e) => {
10925
10925
  const n = JSON.parse(r.resources[0].value), s = qr(), o = r.name ?? n.name, a = r.uuid ?? n.uuid, i = r.version ?? n.version ?? "1", c = r.published ?? !1;
10926
10926
  let d = { labels: {}, concepts: {} };
10927
10927
  if (n && typeof n == "object" && "translationsUrl" in n && typeof n.translationsUrl == "string") {
10928
- const l = qp(
10928
+ const l = Mp(
10929
10929
  o,
10930
10930
  a,
10931
10931
  i,
@@ -10947,10 +10947,10 @@ const vn = /* @__PURE__ */ new Map(), rm = async (e) => {
10947
10947
  schema: n,
10948
10948
  translations: d
10949
10949
  };
10950
- }, zy = async (e, t, r) => {
10950
+ }, Gy = async (e, t, r) => {
10951
10951
  let n;
10952
10952
  t && t.length > 0 && (n = t.join(","));
10953
- const s = Mp(e, r, n), o = await z(s);
10953
+ const s = jp(e, r, n), o = await z(s);
10954
10954
  return Array.isArray(o) ? o : [];
10955
10955
  };
10956
10956
  function Xa(e) {
@@ -10992,7 +10992,7 @@ function ei(e, t) {
10992
10992
  };
10993
10993
  return n(r.controls);
10994
10994
  }
10995
- function Gy(e, t) {
10995
+ function Ky(e, t) {
10996
10996
  if (!e.controls || e.controls.length === 0)
10997
10997
  return [];
10998
10998
  const r = [], n = (/* @__PURE__ */ new Date()).toISOString();
@@ -11037,7 +11037,7 @@ function Gy(e, t) {
11037
11037
  s.interpretation && (a.interpretation = s.interpretation), s.comment && (a.comment = s.comment), r.push(a);
11038
11038
  }), r;
11039
11039
  }
11040
- function Ky(e, t) {
11040
+ function Yy(e, t) {
11041
11041
  if (!e || e.length === 0)
11042
11042
  return {
11043
11043
  controls: [],
@@ -11070,7 +11070,7 @@ function Ky(e, t) {
11070
11070
  metadata: { formMetadata: t }
11071
11071
  };
11072
11072
  }
11073
- function Yy(e) {
11073
+ function Wy(e) {
11074
11074
  const t = (n) => {
11075
11075
  const s = (d) => d == null ? null : typeof d == "string" || typeof d == "number" || typeof d == "boolean" || typeof d == "object" ? d : null, o = n.concept, a = typeof o == "object" && o !== null && "uuid" in o ? o.uuid : o, i = typeof o == "object" && o !== null && "datatype" in o ? o.datatype : void 0, c = {
11076
11076
  concept: {
@@ -11090,11 +11090,11 @@ function Yy(e) {
11090
11090
  };
11091
11091
  return (e?.filter((n) => n.uuid && n.voided ? !0 : !(!n.uuid && n.voided || n.value && typeof n.value == "string" && n.value.endsWith("voided"))) ?? []).map(t);
11092
11092
  }
11093
- function Wy(e) {
11093
+ function Jy(e) {
11094
11094
  if (!(!e || typeof e != "object"))
11095
11095
  return "toJS" in e && typeof e.toJS == "function" ? e.toJS() : e;
11096
11096
  }
11097
- function Jy(e, t) {
11097
+ function Qy(e, t) {
11098
11098
  !e || !Array.isArray(e.children) || e.children.forEach((r) => {
11099
11099
  r && typeof r == "object" && ti(
11100
11100
  r,
@@ -11124,7 +11124,7 @@ function ti(e, t) {
11124
11124
  );
11125
11125
  });
11126
11126
  }
11127
- const cm = Z + "/bahmnicore/diseaseSummaryData?", Qy = async (e, t, r, n) => {
11127
+ const um = Z + "/bahmnicore/diseaseSummaryData?", Xy = async (e, t, r, n) => {
11128
11128
  const s = new URLSearchParams({
11129
11129
  groupBy: n,
11130
11130
  latestCount: t.toString(),
@@ -11133,9 +11133,9 @@ const cm = Z + "/bahmnicore/diseaseSummaryData?", Qy = async (e, t, r, n) => {
11133
11133
  r.forEach((a) => {
11134
11134
  s.append("obsConcepts", a);
11135
11135
  });
11136
- const o = cm + s.toString();
11136
+ const o = um + s.toString();
11137
11137
  return z(o);
11138
- }, ri = "custom:(uuid,episodeUuid,patient,program,display,dateEnrolled,dateCompleted,location,voided,allowedStates,outcome,states:(uuid,startDate,endDate,voided,state:(uuid,concept:(uuid,display,name,names)),auditInfo),auditInfo,attributes)", um = (e) => `${Z}/bahmniprogramenrollment?patient=${e}&v=${ri}`, ni = (e) => `${Z}/bahmniprogramenrollment/${e}`, lm = (e) => `${ni(e)}?v=${ri}`, Xy = async (e) => await z(um(e)), Zy = async (e) => await z(lm(e)), ev = async (e, t) => {
11138
+ }, ri = "custom:(uuid,episodeUuid,patient,program,display,dateEnrolled,dateCompleted,location,voided,allowedStates,outcome,states:(uuid,startDate,endDate,voided,state:(uuid,concept:(uuid,display,name,names)),auditInfo),auditInfo,attributes)", lm = (e) => `${Z}/bahmniprogramenrollment?patient=${e}&v=${ri}`, ni = (e) => `${Z}/bahmniprogramenrollment/${e}`, dm = (e) => `${ni(e)}?v=${ri}`, Zy = async (e) => await z(lm(e)), ev = async (e) => await z(dm(e)), tv = async (e, t) => {
11139
11139
  const r = {
11140
11140
  uuid: e,
11141
11141
  states: [
@@ -11149,7 +11149,7 @@ const cm = Z + "/bahmnicore/diseaseSummaryData?", Qy = async (e, t, r, n) => {
11149
11149
  r
11150
11150
  );
11151
11151
  };
11152
- function tv(e) {
11152
+ function rv(e) {
11153
11153
  if (e.states.length === 0)
11154
11154
  return null;
11155
11155
  let t;
@@ -11165,7 +11165,7 @@ function tv(e) {
11165
11165
  t = e.states.find((r) => r.endDate === null);
11166
11166
  return t ? Rf(t.state.concept.names) ?? t.state.concept.display : null;
11167
11167
  }
11168
- function rv(e, t) {
11168
+ function nv(e, t) {
11169
11169
  if (t.length === 0)
11170
11170
  return {};
11171
11171
  const r = {};
@@ -11177,12 +11177,12 @@ function rv(e, t) {
11177
11177
  }
11178
11178
  return r;
11179
11179
  }
11180
- const $n = "consultation:saved", nv = (e) => {
11180
+ const $n = "consultation:saved", sv = (e) => {
11181
11181
  const t = new CustomEvent($n, {
11182
11182
  detail: e
11183
11183
  });
11184
11184
  window.dispatchEvent(t);
11185
- }, sv = (e, t = []) => {
11185
+ }, ov = (e, t = []) => {
11186
11186
  const r = wn(e);
11187
11187
  En(() => {
11188
11188
  r.current = e;
@@ -11195,7 +11195,7 @@ const $n = "consultation:saved", nv = (e) => {
11195
11195
  window.removeEventListener($n, n);
11196
11196
  };
11197
11197
  }, t);
11198
- }, dm = (e, t) => {
11198
+ }, fm = (e, t) => {
11199
11199
  const r = `${le}/DocumentReference?patient=${e}&_sort=-date&_count=100`;
11200
11200
  if (t && t.length > 0) {
11201
11201
  const n = t.join(",");
@@ -11203,7 +11203,7 @@ const $n = "consultation:saved", nv = (e) => {
11203
11203
  }
11204
11204
  return r;
11205
11205
  };
11206
- function fm(e) {
11206
+ function hm(e) {
11207
11207
  return e.filter((t) => t.resource?.resourceType === "DocumentReference").map((t) => {
11208
11208
  const r = t.resource, n = r.masterIdentifier?.value ?? r.id ?? "", s = (r.content ?? []).map((a) => a.attachment).filter((a) => !!a).map((a) => ({ url: a.url ?? "", contentType: a.contentType })), o = s[0];
11209
11209
  return {
@@ -11218,185 +11218,185 @@ function fm(e) {
11218
11218
  };
11219
11219
  });
11220
11220
  }
11221
- async function hm(e, t) {
11222
- const r = dm(e, t);
11221
+ async function pm(e, t) {
11222
+ const r = fm(e, t);
11223
11223
  return z(r);
11224
11224
  }
11225
- async function ov(e, t) {
11226
- const n = ((await hm(e, t)).entry ?? []).filter(
11225
+ async function av(e, t) {
11226
+ const n = ((await pm(e, t)).entry ?? []).filter(
11227
11227
  (s) => !!s.resource
11228
11228
  );
11229
- return fm(n);
11229
+ return hm(n);
11230
11230
  }
11231
11231
  export {
11232
- Ng as APPOINTMENT_IDENTIFIER_SYSTEM,
11233
- Ag as APPOINTMENT_STATUSES,
11232
+ $g as APPOINTMENT_IDENTIFIER_SYSTEM,
11233
+ Ng as APPOINTMENT_STATUSES,
11234
11234
  An as AUDIT_LOG_EVENT_DETAILS,
11235
11235
  Cf as AllergySeverity,
11236
11236
  Df as AllergyStatus,
11237
11237
  ml as AttributeFormat,
11238
11238
  gl as AttributeInputType,
11239
- qm as BAHMNI_HOME_PATH,
11240
- ay as CONCEPT_DATATYPE_COMPLEX,
11241
- oy as CONCEPT_DATATYPE_NUMERIC,
11239
+ Mm as BAHMNI_HOME_PATH,
11240
+ iy as CONCEPT_DATATYPE_COMPLEX,
11241
+ ay as CONCEPT_DATATYPE_NUMERIC,
11242
11242
  $n as CONSULTATION_SAVED_EVENT,
11243
11243
  xf as DATETIME_REGEX_PATTERN,
11244
- uy as DATE_REGEX_PATTERN,
11244
+ ly as DATE_REGEX_PATTERN,
11245
11245
  lf as DEFAULT_DATE_FORMAT,
11246
11246
  df as DEFAULT_DATE_FORMAT_STORAGE_KEY,
11247
11247
  pf as DURATION_UNIT_TO_DAYS,
11248
- Qg as FHIR_ENCOUNTER_TYPE_CODE_SYSTEM,
11249
- ty as FHIR_LAB_ORDER_CONCEPT_TYPE_EXTENSION_URL,
11250
- ny as FHIR_OBSERVATION_FORM_NAMESPACE_PATH_URL,
11251
- ry as FHIR_OBSERVATION_INTERPRETATION_SYSTEM,
11252
- iy as FHIR_OBSERVATION_STATUS_FINAL,
11253
- sy as FHIR_OBSERVATION_VALUE_ATTACHMENT_URL,
11254
- cy as FHIR_RESOURCE_TYPE_OBSERVATION,
11255
- ey as HL7_CONDITION_CATEGORY_CODE_SYSTEM,
11248
+ Xg as FHIR_ENCOUNTER_TYPE_CODE_SYSTEM,
11249
+ ry as FHIR_LAB_ORDER_CONCEPT_TYPE_EXTENSION_URL,
11250
+ sy as FHIR_OBSERVATION_FORM_NAMESPACE_PATH_URL,
11251
+ ny as FHIR_OBSERVATION_INTERPRETATION_SYSTEM,
11252
+ cy as FHIR_OBSERVATION_STATUS_FINAL,
11253
+ oy as FHIR_OBSERVATION_VALUE_ATTACHMENT_URL,
11254
+ uy as FHIR_RESOURCE_TYPE_OBSERVATION,
11255
+ ty as HL7_CONDITION_CATEGORY_CODE_SYSTEM,
11256
11256
  Lf as HL7_CONDITION_CATEGORY_CONDITION_CODE,
11257
11257
  kf as HL7_CONDITION_CATEGORY_DIAGNOSIS_CODE,
11258
- Zg as HL7_CONDITION_CLINICAL_STATUS_CODE_SYSTEM,
11259
- Xg as HL7_CONDITION_VERIFICATION_STATUS_CODE_SYSTEM,
11260
- ly as INTERPRETATION_TO_CODE,
11261
- rg as MAX_NAME_LENGTH,
11262
- tg as MAX_PATIENT_AGE_YEARS,
11263
- ng as MAX_PHONE_NUMBER_LENGTH,
11258
+ ey as HL7_CONDITION_CLINICAL_STATUS_CODE_SYSTEM,
11259
+ Zg as HL7_CONDITION_VERIFICATION_STATUS_CODE_SYSTEM,
11260
+ dy as INTERPRETATION_TO_CODE,
11261
+ ng as MAX_NAME_LENGTH,
11262
+ rg as MAX_PATIENT_AGE_YEARS,
11263
+ sg as MAX_PHONE_NUMBER_LENGTH,
11264
11264
  ke as MedicationStatus,
11265
11265
  le as OPENMRS_FHIR_R4,
11266
11266
  Z as OPENMRS_REST_V1,
11267
- Oy as ORDER_TYPE_QUERY_KEY,
11268
- Ty as PENDING_REPORT_STATUSES,
11269
- Ry as PROCESSED_REPORT_STATUSES,
11270
- Dy as USER_PINNED_PREFERENCE_URL,
11271
- kg as calculateAge,
11272
- Fg as calculateEndDate,
11273
- Ug as calculateOnsetDate,
11274
- Qm as camelToScreamingSnakeCase,
11275
- Bm as capitalize,
11276
- Tg as checkIfActiveVisitExists,
11277
- Wy as convertImmutableToPlainObject,
11278
- Xm as convertToSentenceCase,
11279
- lg as createPatient,
11280
- Og as createVisitForPatient,
11281
- Um as del,
11267
+ Ay as ORDER_TYPE_QUERY_KEY,
11268
+ Oy as PENDING_REPORT_STATUSES,
11269
+ Ty as PROCESSED_REPORT_STATUSES,
11270
+ Cy as USER_PINNED_PREFERENCE_URL,
11271
+ xg as calculateAge,
11272
+ Vg as calculateEndDate,
11273
+ qg as calculateOnsetDate,
11274
+ Xm as camelToScreamingSnakeCase,
11275
+ zm as capitalize,
11276
+ Og as checkIfActiveVisitExists,
11277
+ Jy as convertImmutableToPlainObject,
11278
+ Zm as convertToSentenceCase,
11279
+ dg as createPatient,
11280
+ Ag as createVisitForPatient,
11281
+ qm as del,
11282
11282
  yl as dispatchAuditEvent,
11283
- nv as dispatchConsultationSaved,
11284
- Vg as doDateRangesOverlap,
11285
- rv as extractAttributes,
11286
- Jy as extractNotesFromFormData,
11287
- Yg as fetchAndFormatAllergenConcepts,
11288
- By as fetchFormMetadata,
11289
- py as fetchMedicationOrdersMetadata,
11290
- Hy as fetchObservationForms,
11291
- Wg as fetchReactionConcepts,
11292
- Ym as filterReplacementEntries,
11293
- qy as findActiveEncounterInSession,
11294
- qg as formatDateDistance,
11295
- xg as formatDateTime,
11296
- Wm as formatUrl,
11297
- Hm as generateId,
11283
+ sv as dispatchConsultationSaved,
11284
+ Hg as doDateRangesOverlap,
11285
+ nv as extractAttributes,
11286
+ Qy as extractNotesFromFormData,
11287
+ Wg as fetchAndFormatAllergenConcepts,
11288
+ zy as fetchFormMetadata,
11289
+ my as fetchMedicationOrdersMetadata,
11290
+ By as fetchObservationForms,
11291
+ Jg as fetchReactionConcepts,
11292
+ Wm as filterReplacementEntries,
11293
+ My as findActiveEncounterInSession,
11294
+ Mg as formatDateDistance,
11295
+ Ug as formatDateTime,
11296
+ Jm as formatUrl,
11297
+ Bm as generateId,
11298
11298
  z as get,
11299
- Yp as getActiveVisit,
11299
+ Wp as getActiveVisit,
11300
11300
  Tl as getActiveVisitByPatient,
11301
- hg as getAddressHierarchyEntries,
11302
- Lg as getAllAppointmentServices,
11301
+ pg as getAddressHierarchyEntries,
11302
+ kg as getAllAppointmentServices,
11303
11303
  Pf as getAllergies,
11304
- Cg as getAppointmentById,
11305
- Ny as getCategoryUuidFromOrderTypes,
11306
- Gg as getConceptById,
11307
- dy as getConditions,
11308
- Iy as getConfig,
11304
+ Lg as getAppointmentById,
11305
+ $y as getCategoryUuidFromOrderTypes,
11306
+ Kg as getConceptById,
11307
+ fy as getConditions,
11308
+ Dy as getConfig,
11309
11309
  Da as getCookieByName,
11310
- ky as getCurrentProvider,
11311
- tv as getCurrentStateName,
11312
- Zm as getCurrentUser,
11313
- Fy as getCurrentUserPrivileges,
11314
- eg as getDefaultDateFormat,
11315
- _y as getDiagnosticReportBundle,
11316
- by as getDiagnosticReports,
11317
- hm as getDocumentReferences,
11318
- My as getEncountersAndVisitsForEOC,
11319
- Py as getExistingServiceRequestsForAllCategories,
11320
- Ay as getFlattenedInvestigations,
11321
- jg as getFormattedAge,
11322
- Jg as getFormattedAllergies,
11323
- ov as getFormattedDocumentReferences,
11310
+ xy as getCurrentProvider,
11311
+ rv as getCurrentStateName,
11312
+ eg as getCurrentUser,
11313
+ Vy as getCurrentUserPrivileges,
11314
+ tg as getDefaultDateFormat,
11315
+ Sy as getDiagnosticReportBundle,
11316
+ _y as getDiagnosticReports,
11317
+ pm as getDocumentReferences,
11318
+ jy as getEncountersAndVisitsForEOC,
11319
+ Iy as getExistingServiceRequestsForAllCategories,
11320
+ Ny as getFlattenedInvestigations,
11321
+ Fg as getFormattedAge,
11322
+ Qg as getFormattedAllergies,
11323
+ av as getFormattedDocumentReferences,
11324
11324
  Rr as getFormattedError,
11325
- sg as getFormattedPatientById,
11326
- fg as getGenders,
11327
- ug as getIdentifierData,
11328
- cg as getIdentifierTypes,
11329
- vg as getInputTypeForFormat,
11330
- Ey as getLabInvestigationsBundle,
11331
- xy as getObservationsBundleByEncounterUuid,
11332
- $y as getOrderTypeNames,
11325
+ og as getFormattedPatientById,
11326
+ hg as getGenders,
11327
+ lg as getIdentifierData,
11328
+ ug as getIdentifierTypes,
11329
+ wg as getInputTypeForFormat,
11330
+ by as getLabInvestigationsBundle,
11331
+ Uy as getObservationsBundleByEncounterUuid,
11332
+ Py as getOrderTypeNames,
11333
11333
  Hn as getOrderTypes,
11334
- pg as getOrderedAddressHierarchyLevels,
11335
- Ig as getPastAppointments,
11334
+ mg as getOrderedAddressHierarchyLevels,
11335
+ Dg as getPastAppointments,
11336
11336
  cl as getPatientById,
11337
- fy as getPatientDiagnoses,
11338
- zy as getPatientFormData,
11339
- og as getPatientImageAsDataUrl,
11337
+ hy as getPatientDiagnoses,
11338
+ Gy as getPatientFormData,
11339
+ ag as getPatientImageAsDataUrl,
11340
11340
  Zf as getPatientMedicationBundle,
11341
- hy as getPatientMedications,
11342
- Ly as getPatientObservations,
11343
- Vp as getPatientObservationsBundle,
11344
- Cy as getPatientObservationsWithEncounterBundle,
11345
- mg as getPatientProfile,
11346
- Xy as getPatientPrograms,
11347
- yy as getPatientRadiologyInvestigationBundle,
11348
- vy as getPatientRadiologyInvestigationBundleWithImagingStudy,
11349
- wy as getPatientRadiologyInvestigations,
11350
- yg as getPersonAttributeTypes,
11341
+ py as getPatientMedications,
11342
+ ky as getPatientObservations,
11343
+ Hp as getPatientObservationsBundle,
11344
+ Ly as getPatientObservationsWithEncounterBundle,
11345
+ gg as getPatientProfile,
11346
+ Zy as getPatientPrograms,
11347
+ vy as getPatientRadiologyInvestigationBundle,
11348
+ wy as getPatientRadiologyInvestigationBundleWithImagingStudy,
11349
+ Ey as getPatientRadiologyInvestigations,
11350
+ vg as getPersonAttributeTypes,
11351
11351
  pl as getPrimaryIdentifierType,
11352
- Gm as getPriorityByOrder,
11353
- Zy as getProgramByUUID,
11354
- gg as getRelationshipTypes,
11352
+ Km as getPriorityByOrder,
11353
+ ev as getProgramByUUID,
11354
+ yg as getRelationshipTypes,
11355
11355
  Pt as getServiceRequests,
11356
- Mg as getTodayDate,
11357
- Pg as getUpcomingAppointments,
11356
+ jg as getTodayDate,
11357
+ Ig as getUpcomingAppointments,
11358
11358
  xn as getUserLoginLocation,
11359
11359
  qr as getUserPreferredLocale,
11360
- gy as getVaccinations,
11361
- Jm as getValueType,
11362
- Rg as getVisitTypes,
11363
- Qy as getVitalFlowSheetData,
11364
- Km as groupByDate,
11365
- Vy as hasPrivilege,
11366
- jm as initAppI18n,
11367
- jy as initializeAuditListener,
11368
- wg as isBooleanFormat,
11369
- Eg as isConceptFormat,
11370
- _g as isDateFormat,
11371
- bg as isNumberFormat,
11372
- zm as isStringEmpty,
11373
- Sg as isTextFormat,
11374
- sm as logAuditEvent,
11375
- Mm as normalizeTranslationKey,
11376
- Bg as notificationService,
11360
+ yy as getVaccinations,
11361
+ Qm as getValueType,
11362
+ Tg as getVisitTypes,
11363
+ Xy as getVitalFlowSheetData,
11364
+ Ym as groupByDate,
11365
+ Hy as hasPrivilege,
11366
+ Fm as initAppI18n,
11367
+ Fy as initializeAuditListener,
11368
+ Eg as isBooleanFormat,
11369
+ bg as isConceptFormat,
11370
+ Sg as isDateFormat,
11371
+ _g as isNumberFormat,
11372
+ Gm as isStringEmpty,
11373
+ Rg as isTextFormat,
11374
+ om as logAuditEvent,
11375
+ jm as normalizeTranslationKey,
11376
+ zg as notificationService,
11377
11377
  Mu as parseQueryParams,
11378
- xm as patch,
11378
+ Um as patch,
11379
11379
  Me as post,
11380
- km as put,
11381
- Vm as refreshQueries,
11382
- $g as searchAppointmentsByAttribute,
11383
- Kg as searchConceptByName,
11384
- zg as searchConcepts,
11380
+ xm as put,
11381
+ Hm as refreshQueries,
11382
+ Pg as searchAppointmentsByAttribute,
11383
+ Yg as searchConceptByName,
11384
+ Gg as searchConcepts,
11385
11385
  br as searchFHIRConcepts,
11386
11386
  Sf as searchFHIRConceptsByName,
11387
- my as searchMedications,
11388
- ig as searchPatientByCustomAttribute,
11389
- ag as searchPatientByNameOrId,
11390
- Uy as shouldEnableEncounterFilter,
11391
- Hg as sortByDate,
11392
- Yy as transformContainerObservationsToForm2Observations,
11393
- Gy as transformFormDataToObservations,
11394
- Ky as transformObservationsToFormData,
11395
- Dg as updateAppointmentStatus,
11396
- Sy as updateDiagnosticReportBundle,
11397
- dg as updatePatient,
11398
- ev as updateProgramState,
11399
- Fm as useCamera,
11400
- sv as useSubscribeConsultationSaved,
11401
- cv as useTranslation
11387
+ gy as searchMedications,
11388
+ cg as searchPatientByCustomAttribute,
11389
+ ig as searchPatientByNameOrId,
11390
+ qy as shouldEnableEncounterFilter,
11391
+ Bg as sortByDate,
11392
+ Wy as transformContainerObservationsToForm2Observations,
11393
+ Ky as transformFormDataToObservations,
11394
+ Yy as transformObservationsToFormData,
11395
+ Cg as updateAppointmentStatus,
11396
+ Ry as updateDiagnosticReportBundle,
11397
+ fg as updatePatient,
11398
+ tv as updateProgramState,
11399
+ Vm as useCamera,
11400
+ ov as useSubscribeConsultationSaved,
11401
+ uv as useTranslation
11402
11402
  };