@medplum/agent 3.2.25 → 3.2.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cjs/index.cjs +826 -818
  2. package/package.json +5 -5
@@ -12,13 +12,13 @@ var __export = (target, all) => {
12
12
  for (var name in all)
13
13
  __defProp(target, name, { get: all[name], enumerable: true });
14
14
  };
15
- var __copyProps = (to2, from, except, desc) => {
15
+ var __copyProps = (to, from, except, desc) => {
16
16
  if (from && typeof from === "object" || typeof from === "function") {
17
17
  for (let key of __getOwnPropNames(from))
18
- if (!__hasOwnProp.call(to2, key) && key !== except)
19
- __defProp(to2, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ if (!__hasOwnProp.call(to, key) && key !== except)
19
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
20
  }
21
- return to2;
21
+ return to;
22
22
  };
23
23
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
24
  // If the importer is in node compatibility mode or this is not an ESM
@@ -483,8 +483,8 @@ var require_utf32 = __commonJS({
483
483
  outer_loop:
484
484
  for (var i = 0; i < bufs.length; i++) {
485
485
  var buf = bufs[i];
486
- for (var j2 = 0; j2 < buf.length; j2++) {
487
- b2.push(buf[j2]);
486
+ for (var j = 0; j < buf.length; j++) {
487
+ b2.push(buf[j]);
488
488
  if (b2.length === 4) {
489
489
  if (charsProcessed === 0) {
490
490
  if (b2[0] === 255 && b2[1] === 254 && b2[2] === 0 && b2[3] === 0) {
@@ -543,19 +543,19 @@ var require_utf16 = __commonJS({
543
543
  Utf16BEDecoder.prototype.write = function(buf) {
544
544
  if (buf.length == 0)
545
545
  return "";
546
- var buf2 = Buffer2.alloc(buf.length + 1), i = 0, j2 = 0;
546
+ var buf2 = Buffer2.alloc(buf.length + 1), i = 0, j = 0;
547
547
  if (this.overflowByte !== -1) {
548
548
  buf2[0] = buf[0];
549
549
  buf2[1] = this.overflowByte;
550
550
  i = 1;
551
- j2 = 2;
551
+ j = 2;
552
552
  }
553
- for (; i < buf.length - 1; i += 2, j2 += 2) {
554
- buf2[j2] = buf[i + 1];
555
- buf2[j2 + 1] = buf[i];
553
+ for (; i < buf.length - 1; i += 2, j += 2) {
554
+ buf2[j] = buf[i + 1];
555
+ buf2[j + 1] = buf[i];
556
556
  }
557
557
  this.overflowByte = i == buf.length - 1 ? buf[buf.length - 1] : -1;
558
- return buf2.slice(0, j2).toString("ucs2");
558
+ return buf2.slice(0, j).toString("ucs2");
559
559
  };
560
560
  Utf16BEDecoder.prototype.end = function() {
561
561
  this.overflowByte = -1;
@@ -623,8 +623,8 @@ var require_utf16 = __commonJS({
623
623
  outer_loop:
624
624
  for (var i = 0; i < bufs.length; i++) {
625
625
  var buf = bufs[i];
626
- for (var j2 = 0; j2 < buf.length; j2++) {
627
- b2.push(buf[j2]);
626
+ for (var j = 0; j < buf.length; j++) {
627
+ b2.push(buf[j]);
628
628
  if (b2.length === 2) {
629
629
  if (charsProcessed === 0) {
630
630
  if (b2[0] === 255 && b2[1] === 254) return "utf-16le";
@@ -1548,13 +1548,13 @@ var require_dbcs_codec = __commonJS({
1548
1548
  var firstByteNode = this.decodeTables[0];
1549
1549
  for (var i2 = 129; i2 <= 254; i2++) {
1550
1550
  var secondByteNode = this.decodeTables[NODE_START - firstByteNode[i2]];
1551
- for (var j2 = 48; j2 <= 57; j2++) {
1552
- if (secondByteNode[j2] === UNASSIGNED) {
1553
- secondByteNode[j2] = NODE_START - commonThirdByteNodeIdx;
1554
- } else if (secondByteNode[j2] > NODE_START) {
1551
+ for (var j = 48; j <= 57; j++) {
1552
+ if (secondByteNode[j] === UNASSIGNED) {
1553
+ secondByteNode[j] = NODE_START - commonThirdByteNodeIdx;
1554
+ } else if (secondByteNode[j] > NODE_START) {
1555
1555
  throw new Error("gb18030 decode tables conflict at byte 2");
1556
1556
  }
1557
- var thirdByteNode = this.decodeTables[NODE_START - secondByteNode[j2]];
1557
+ var thirdByteNode = this.decodeTables[NODE_START - secondByteNode[j]];
1558
1558
  for (var k2 = 129; k2 <= 254; k2++) {
1559
1559
  if (thirdByteNode[k2] === UNASSIGNED) {
1560
1560
  thirdByteNode[k2] = NODE_START - commonFourthByteNodeIdx;
@@ -1582,8 +1582,8 @@ var require_dbcs_codec = __commonJS({
1582
1582
  if (typeof val === "number")
1583
1583
  skipEncodeChars[val] = true;
1584
1584
  else
1585
- for (var j2 = val.from; j2 <= val.to; j2++)
1586
- skipEncodeChars[j2] = true;
1585
+ for (var j = val.from; j <= val.to; j++)
1586
+ skipEncodeChars[j] = true;
1587
1587
  }
1588
1588
  this._fillEncodeTable(0, 0, skipEncodeChars);
1589
1589
  if (codecOptions.encodeAdd) {
@@ -1678,7 +1678,7 @@ var require_dbcs_codec = __commonJS({
1678
1678
  bucket[low] = SEQ_START - this.encodeTableSeq.length;
1679
1679
  this.encodeTableSeq.push(node);
1680
1680
  }
1681
- for (var j2 = 1; j2 < seq.length - 1; j2++) {
1681
+ for (var j = 1; j < seq.length - 1; j++) {
1682
1682
  var oldVal = node[uCode];
1683
1683
  if (typeof oldVal === "object")
1684
1684
  node = oldVal;
@@ -1728,7 +1728,7 @@ var require_dbcs_codec = __commonJS({
1728
1728
  this.gb18030 = codec.gb18030;
1729
1729
  }
1730
1730
  DBCSEncoder.prototype.write = function(str) {
1731
- var newBuf = Buffer2.alloc(str.length * (this.gb18030 ? 4 : 3)), leadSurrogate = this.leadSurrogate, seqObj = this.seqObj, nextChar = -1, i2 = 0, j2 = 0;
1731
+ var newBuf = Buffer2.alloc(str.length * (this.gb18030 ? 4 : 3)), leadSurrogate = this.leadSurrogate, seqObj = this.seqObj, nextChar = -1, i2 = 0, j = 0;
1732
1732
  while (true) {
1733
1733
  if (nextChar === -1) {
1734
1734
  if (i2 == str.length) break;
@@ -1788,13 +1788,13 @@ var require_dbcs_codec = __commonJS({
1788
1788
  var idx = findIdx(this.gb18030.uChars, uCode);
1789
1789
  if (idx != -1) {
1790
1790
  var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]);
1791
- newBuf[j2++] = 129 + Math.floor(dbcsCode / 12600);
1791
+ newBuf[j++] = 129 + Math.floor(dbcsCode / 12600);
1792
1792
  dbcsCode = dbcsCode % 12600;
1793
- newBuf[j2++] = 48 + Math.floor(dbcsCode / 1260);
1793
+ newBuf[j++] = 48 + Math.floor(dbcsCode / 1260);
1794
1794
  dbcsCode = dbcsCode % 1260;
1795
- newBuf[j2++] = 129 + Math.floor(dbcsCode / 10);
1795
+ newBuf[j++] = 129 + Math.floor(dbcsCode / 10);
1796
1796
  dbcsCode = dbcsCode % 10;
1797
- newBuf[j2++] = 48 + dbcsCode;
1797
+ newBuf[j++] = 48 + dbcsCode;
1798
1798
  continue;
1799
1799
  }
1800
1800
  }
@@ -1802,47 +1802,47 @@ var require_dbcs_codec = __commonJS({
1802
1802
  if (dbcsCode === UNASSIGNED)
1803
1803
  dbcsCode = this.defaultCharSingleByte;
1804
1804
  if (dbcsCode < 256) {
1805
- newBuf[j2++] = dbcsCode;
1805
+ newBuf[j++] = dbcsCode;
1806
1806
  } else if (dbcsCode < 65536) {
1807
- newBuf[j2++] = dbcsCode >> 8;
1808
- newBuf[j2++] = dbcsCode & 255;
1807
+ newBuf[j++] = dbcsCode >> 8;
1808
+ newBuf[j++] = dbcsCode & 255;
1809
1809
  } else if (dbcsCode < 16777216) {
1810
- newBuf[j2++] = dbcsCode >> 16;
1811
- newBuf[j2++] = dbcsCode >> 8 & 255;
1812
- newBuf[j2++] = dbcsCode & 255;
1810
+ newBuf[j++] = dbcsCode >> 16;
1811
+ newBuf[j++] = dbcsCode >> 8 & 255;
1812
+ newBuf[j++] = dbcsCode & 255;
1813
1813
  } else {
1814
- newBuf[j2++] = dbcsCode >>> 24;
1815
- newBuf[j2++] = dbcsCode >>> 16 & 255;
1816
- newBuf[j2++] = dbcsCode >>> 8 & 255;
1817
- newBuf[j2++] = dbcsCode & 255;
1814
+ newBuf[j++] = dbcsCode >>> 24;
1815
+ newBuf[j++] = dbcsCode >>> 16 & 255;
1816
+ newBuf[j++] = dbcsCode >>> 8 & 255;
1817
+ newBuf[j++] = dbcsCode & 255;
1818
1818
  }
1819
1819
  }
1820
1820
  this.seqObj = seqObj;
1821
1821
  this.leadSurrogate = leadSurrogate;
1822
- return newBuf.slice(0, j2);
1822
+ return newBuf.slice(0, j);
1823
1823
  };
1824
1824
  DBCSEncoder.prototype.end = function() {
1825
1825
  if (this.leadSurrogate === -1 && this.seqObj === void 0)
1826
1826
  return;
1827
- var newBuf = Buffer2.alloc(10), j2 = 0;
1827
+ var newBuf = Buffer2.alloc(10), j = 0;
1828
1828
  if (this.seqObj) {
1829
1829
  var dbcsCode = this.seqObj[DEF_CHAR];
1830
1830
  if (dbcsCode !== void 0) {
1831
1831
  if (dbcsCode < 256) {
1832
- newBuf[j2++] = dbcsCode;
1832
+ newBuf[j++] = dbcsCode;
1833
1833
  } else {
1834
- newBuf[j2++] = dbcsCode >> 8;
1835
- newBuf[j2++] = dbcsCode & 255;
1834
+ newBuf[j++] = dbcsCode >> 8;
1835
+ newBuf[j++] = dbcsCode & 255;
1836
1836
  }
1837
1837
  } else {
1838
1838
  }
1839
1839
  this.seqObj = void 0;
1840
1840
  }
1841
1841
  if (this.leadSurrogate !== -1) {
1842
- newBuf[j2++] = this.defaultCharSingleByte;
1842
+ newBuf[j++] = this.defaultCharSingleByte;
1843
1843
  this.leadSurrogate = -1;
1844
1844
  }
1845
- return newBuf.slice(0, j2);
1845
+ return newBuf.slice(0, j);
1846
1846
  };
1847
1847
  DBCSEncoder.prototype.findIdx = findIdx;
1848
1848
  function DBCSDecoder(options, codec) {
@@ -1855,7 +1855,7 @@ var require_dbcs_codec = __commonJS({
1855
1855
  }
1856
1856
  DBCSDecoder.prototype.write = function(buf) {
1857
1857
  var newBuf = Buffer2.alloc(buf.length * 2), nodeIdx = this.nodeIdx, prevBytes = this.prevBytes, prevOffset = this.prevBytes.length, seqStart = -this.prevBytes.length, uCode;
1858
- for (var i2 = 0, j2 = 0; i2 < buf.length; i2++) {
1858
+ for (var i2 = 0, j = 0; i2 < buf.length; i2++) {
1859
1859
  var curByte = i2 >= 0 ? buf[i2] : prevBytes[i2 + prevOffset];
1860
1860
  var uCode = this.decodeTables[nodeIdx][curByte];
1861
1861
  if (uCode >= 0) {
@@ -1877,8 +1877,8 @@ var require_dbcs_codec = __commonJS({
1877
1877
  var seq = this.decodeTableSeq[SEQ_START - uCode];
1878
1878
  for (var k2 = 0; k2 < seq.length - 1; k2++) {
1879
1879
  uCode = seq[k2];
1880
- newBuf[j2++] = uCode & 255;
1881
- newBuf[j2++] = uCode >> 8;
1880
+ newBuf[j++] = uCode & 255;
1881
+ newBuf[j++] = uCode >> 8;
1882
1882
  }
1883
1883
  uCode = seq[seq.length - 1];
1884
1884
  } else
@@ -1886,18 +1886,18 @@ var require_dbcs_codec = __commonJS({
1886
1886
  if (uCode >= 65536) {
1887
1887
  uCode -= 65536;
1888
1888
  var uCodeLead = 55296 | uCode >> 10;
1889
- newBuf[j2++] = uCodeLead & 255;
1890
- newBuf[j2++] = uCodeLead >> 8;
1889
+ newBuf[j++] = uCodeLead & 255;
1890
+ newBuf[j++] = uCodeLead >> 8;
1891
1891
  uCode = 56320 | uCode & 1023;
1892
1892
  }
1893
- newBuf[j2++] = uCode & 255;
1894
- newBuf[j2++] = uCode >> 8;
1893
+ newBuf[j++] = uCode & 255;
1894
+ newBuf[j++] = uCode >> 8;
1895
1895
  nodeIdx = 0;
1896
1896
  seqStart = i2 + 1;
1897
1897
  }
1898
1898
  this.nodeIdx = nodeIdx;
1899
1899
  this.prevBytes = seqStart >= 0 ? Array.prototype.slice.call(buf, seqStart) : prevBytes.slice(seqStart + prevOffset).concat(Array.prototype.slice.call(buf));
1900
- return newBuf.slice(0, j2).toString("ucs2");
1900
+ return newBuf.slice(0, j).toString("ucs2");
1901
1901
  };
1902
1902
  DBCSDecoder.prototype.end = function() {
1903
1903
  var ret = "";
@@ -7387,9 +7387,9 @@ var require_dcmjs = __commonJS({
7387
7387
  }
7388
7388
  interpolate(level) {
7389
7389
  return this.options.template.replace(/{{([^{}]*)}}/g, (stache, prop) => {
7390
- const fn2 = this.options[prop];
7391
- if (fn2) {
7392
- return fn2({ level, logger: this.logger });
7390
+ const fn = this.options[prop];
7391
+ if (fn) {
7392
+ return fn({ level, logger: this.logger });
7393
7393
  }
7394
7394
  return stache;
7395
7395
  });
@@ -7667,8 +7667,8 @@ var require_dcmjs = __commonJS({
7667
7667
  }
7668
7668
  return _construct.apply(null, arguments);
7669
7669
  }
7670
- function _isNativeFunction(fn2) {
7671
- return Function.toString.call(fn2).indexOf("[native code]") !== -1;
7670
+ function _isNativeFunction(fn) {
7671
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
7672
7672
  }
7673
7673
  function _wrapNativeSuper(Class) {
7674
7674
  var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
@@ -7765,22 +7765,22 @@ var require_dcmjs = __commonJS({
7765
7765
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
7766
7766
  if (_i == null) return;
7767
7767
  var _arr = [];
7768
- var _n = true;
7768
+ var _n2 = true;
7769
7769
  var _d = false;
7770
- var _s, _e;
7770
+ var _s, _e2;
7771
7771
  try {
7772
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
7772
+ for (_i = _i.call(arr); !(_n2 = (_s = _i.next()).done); _n2 = true) {
7773
7773
  _arr.push(_s.value);
7774
7774
  if (i && _arr.length === i) break;
7775
7775
  }
7776
7776
  } catch (err2) {
7777
7777
  _d = true;
7778
- _e = err2;
7778
+ _e2 = err2;
7779
7779
  } finally {
7780
7780
  try {
7781
- if (!_n && _i["return"] != null) _i["return"]();
7781
+ if (!_n2 && _i["return"] != null) _i["return"]();
7782
7782
  } finally {
7783
- if (_d) throw _e;
7783
+ if (_d) throw _e2;
7784
7784
  }
7785
7785
  }
7786
7786
  return _arr;
@@ -7805,10 +7805,10 @@ var require_dcmjs = __commonJS({
7805
7805
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
7806
7806
  }
7807
7807
  function _createForOfIteratorHelper(o, allowArrayLike) {
7808
- var it2 = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
7809
- if (!it2) {
7810
- if (Array.isArray(o) || (it2 = _unsupportedIterableToArray(o)) || allowArrayLike) {
7811
- if (it2) o = it2;
7808
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
7809
+ if (!it) {
7810
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike) {
7811
+ if (it) o = it;
7812
7812
  var i = 0;
7813
7813
  var F2 = function() {
7814
7814
  };
@@ -7834,10 +7834,10 @@ var require_dcmjs = __commonJS({
7834
7834
  var normalCompletion = true, didErr = false, err2;
7835
7835
  return {
7836
7836
  s: function() {
7837
- it2 = it2.call(o);
7837
+ it = it.call(o);
7838
7838
  },
7839
7839
  n: function() {
7840
- var step = it2.next();
7840
+ var step = it.next();
7841
7841
  normalCompletion = step.done;
7842
7842
  return step;
7843
7843
  },
@@ -7847,7 +7847,7 @@ var require_dcmjs = __commonJS({
7847
7847
  },
7848
7848
  f: function() {
7849
7849
  try {
7850
- if (!normalCompletion && it2.return != null) it2.return();
7850
+ if (!normalCompletion && it.return != null) it.return();
7851
7851
  } finally {
7852
7852
  if (didErr) throw err2;
7853
7853
  }
@@ -7927,9 +7927,9 @@ var require_dcmjs = __commonJS({
7927
7927
  const d_code = (dist2) => {
7928
7928
  return dist2 < 256 ? _dist_code[dist2] : _dist_code[256 + (dist2 >>> 7)];
7929
7929
  };
7930
- const put_short = (s, w3) => {
7931
- s.pending_buf[s.pending++] = w3 & 255;
7932
- s.pending_buf[s.pending++] = w3 >>> 8 & 255;
7930
+ const put_short = (s, w2) => {
7931
+ s.pending_buf[s.pending++] = w2 & 255;
7932
+ s.pending_buf[s.pending++] = w2 >>> 8 & 255;
7933
7933
  };
7934
7934
  const send_bits = (s, value, length2) => {
7935
7935
  if (s.bi_valid > Buf_size - length2) {
@@ -8156,17 +8156,17 @@ var require_dcmjs = __commonJS({
8156
8156
  };
8157
8157
  const pqdownheap = (s, tree, k2) => {
8158
8158
  const v2 = s.heap[k2];
8159
- let j2 = k2 << 1;
8160
- while (j2 <= s.heap_len) {
8161
- if (j2 < s.heap_len && smaller(tree, s.heap[j2 + 1], s.heap[j2], s.depth)) {
8162
- j2++;
8159
+ let j = k2 << 1;
8160
+ while (j <= s.heap_len) {
8161
+ if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {
8162
+ j++;
8163
8163
  }
8164
- if (smaller(tree, v2, s.heap[j2], s.depth)) {
8164
+ if (smaller(tree, v2, s.heap[j], s.depth)) {
8165
8165
  break;
8166
8166
  }
8167
- s.heap[k2] = s.heap[j2];
8168
- k2 = j2;
8169
- j2 <<= 1;
8167
+ s.heap[k2] = s.heap[j];
8168
+ k2 = j;
8169
+ j <<= 1;
8170
8170
  }
8171
8171
  s.heap[k2] = v2;
8172
8172
  };
@@ -13156,8 +13156,8 @@ var require_dcmjs = __commonJS({
13156
13156
  if (fragmentMultiframe) {
13157
13157
  fragmentsLength = Math.ceil(frameStream.size / fragmentSize);
13158
13158
  }
13159
- for (var j2 = 0, fragmentStart = 0; j2 < fragmentsLength; j2++) {
13160
- var isFinalFragment = j2 === fragmentsLength - 1;
13159
+ for (var j = 0, fragmentStart = 0; j < fragmentsLength; j++) {
13160
+ var isFinalFragment = j === fragmentsLength - 1;
13161
13161
  var fragmentEnd = fragmentStart + frameStream.size;
13162
13162
  if (fragmentMultiframe) {
13163
13163
  fragmentEnd = fragmentStart + fragmentSize;
@@ -17727,8 +17727,8 @@ var require_dcmjs = __commonJS({
17727
17727
  var _matrix$shape = _slicedToArray(matrix.shape, 2), rows = _matrix$shape[0], cols = _matrix$shape[1];
17728
17728
  var result = ndarray$1(new Uint8Array(rows * cols), [rows, cols]);
17729
17729
  for (var i = 0; i < rows; i++) {
17730
- for (var j2 = 0; j2 < cols; j2++) {
17731
- result.set(i, j2, matrix.get(i, cols - 1 - j2));
17730
+ for (var j = 0; j < cols; j++) {
17731
+ result.set(i, j, matrix.get(i, cols - 1 - j));
17732
17732
  }
17733
17733
  }
17734
17734
  return result;
@@ -17736,9 +17736,9 @@ var require_dcmjs = __commonJS({
17736
17736
  function v(matrix) {
17737
17737
  var _matrix$shape2 = _slicedToArray(matrix.shape, 2), rows = _matrix$shape2[0], cols = _matrix$shape2[1];
17738
17738
  var result = ndarray$1(new Uint8Array(rows * cols), [rows, cols]);
17739
- for (var j2 = 0; j2 < cols; j2++) {
17739
+ for (var j = 0; j < cols; j++) {
17740
17740
  for (var i = 0; i < rows; i++) {
17741
- result.set(i, j2, matrix.get(rows - 1 - i, j2));
17741
+ result.set(i, j, matrix.get(rows - 1 - i, j));
17742
17742
  }
17743
17743
  }
17744
17744
  return result;
@@ -17748,8 +17748,8 @@ var require_dcmjs = __commonJS({
17748
17748
  var result = ndarray$1(new Uint8Array(rows * cols), [cols, rows]);
17749
17749
  var resultColsMinus1 = result.shape[1] - 1;
17750
17750
  for (var i = 0; i < rows; i++) {
17751
- for (var j2 = 0; j2 < cols; j2++) {
17752
- result.set(j2, resultColsMinus1 - i, matrix.get(i, j2));
17751
+ for (var j = 0; j < cols; j++) {
17752
+ result.set(j, resultColsMinus1 - i, matrix.get(i, j));
17753
17753
  }
17754
17754
  }
17755
17755
  return result;
@@ -18271,11 +18271,11 @@ var require_dcmjs = __commonJS({
18271
18271
  }
18272
18272
  function transformMat4(out, a2, m2) {
18273
18273
  var x2 = a2[0], y2 = a2[1], z2 = a2[2];
18274
- var w3 = m2[3] * x2 + m2[7] * y2 + m2[11] * z2 + m2[15];
18275
- w3 = w3 || 1;
18276
- out[0] = (m2[0] * x2 + m2[4] * y2 + m2[8] * z2 + m2[12]) / w3;
18277
- out[1] = (m2[1] * x2 + m2[5] * y2 + m2[9] * z2 + m2[13]) / w3;
18278
- out[2] = (m2[2] * x2 + m2[6] * y2 + m2[10] * z2 + m2[14]) / w3;
18274
+ var w2 = m2[3] * x2 + m2[7] * y2 + m2[11] * z2 + m2[15];
18275
+ w2 = w2 || 1;
18276
+ out[0] = (m2[0] * x2 + m2[4] * y2 + m2[8] * z2 + m2[12]) / w2;
18277
+ out[1] = (m2[1] * x2 + m2[5] * y2 + m2[9] * z2 + m2[13]) / w2;
18278
+ out[2] = (m2[2] * x2 + m2[6] * y2 + m2[10] * z2 + m2[14]) / w2;
18279
18279
  return out;
18280
18280
  }
18281
18281
  function transformMat3(out, a2, m2) {
@@ -18290,10 +18290,10 @@ var require_dcmjs = __commonJS({
18290
18290
  var x2 = a2[0], y2 = a2[1], z2 = a2[2];
18291
18291
  var uvx = qy * z2 - qz * y2, uvy = qz * x2 - qx * z2, uvz = qx * y2 - qy * x2;
18292
18292
  var uuvx = qy * uvz - qz * uvy, uuvy = qz * uvx - qx * uvz, uuvz = qx * uvy - qy * uvx;
18293
- var w22 = qw * 2;
18294
- uvx *= w22;
18295
- uvy *= w22;
18296
- uvz *= w22;
18293
+ var w2 = qw * 2;
18294
+ uvx *= w2;
18295
+ uvy *= w2;
18296
+ uvz *= w2;
18297
18297
  uuvx *= 2;
18298
18298
  uuvy *= 2;
18299
18299
  uuvz *= 2;
@@ -18371,7 +18371,7 @@ var require_dcmjs = __commonJS({
18371
18371
  var sqrLen = squaredLength;
18372
18372
  var forEach = function() {
18373
18373
  var vec = create();
18374
- return function(a2, stride, offset, count, fn2, arg) {
18374
+ return function(a2, stride, offset, count, fn, arg) {
18375
18375
  var i, l3;
18376
18376
  if (!stride) {
18377
18377
  stride = 3;
@@ -18388,7 +18388,7 @@ var require_dcmjs = __commonJS({
18388
18388
  vec[0] = a2[i];
18389
18389
  vec[1] = a2[i + 1];
18390
18390
  vec[2] = a2[i + 2];
18391
- fn2(vec, vec, arg);
18391
+ fn(vec, vec, arg);
18392
18392
  a2[i] = vec[0];
18393
18393
  a2[i + 1] = vec[1];
18394
18394
  a2[i + 2] = vec[2];
@@ -19459,10 +19459,10 @@ var require_dcmjs = __commonJS({
19459
19459
  continue;
19460
19460
  }
19461
19461
  var data3 = alignedPixelDataI.data;
19462
- for (var j2 = 0, len2 = data3.length; j2 < len2; ++j2) {
19463
- if (data3[j2] !== 0) {
19464
- temp2DArray[j2]++;
19465
- if (temp2DArray[j2] > 1) {
19462
+ for (var j = 0, len2 = data3.length; j < len2; ++j) {
19463
+ if (data3[j] !== 0) {
19464
+ temp2DArray[j]++;
19465
+ if (temp2DArray[j] > 1) {
19466
19466
  return true;
19467
19467
  }
19468
19468
  }
@@ -19526,9 +19526,9 @@ var require_dcmjs = __commonJS({
19526
19526
  var labelmap2DView = new Uint16Array(tempBuffer, byteOffset, sliceLength);
19527
19527
  var data3 = alignedPixelDataI.data;
19528
19528
  var segmentOnFrame = false;
19529
- for (var j2 = 0, len2 = alignedPixelDataI.data.length; j2 < len2; ++j2) {
19530
- if (data3[j2]) {
19531
- if (labelmap2DView[j2] !== 0) {
19529
+ for (var j = 0, len2 = alignedPixelDataI.data.length; j < len2; ++j) {
19530
+ if (data3[j]) {
19531
+ if (labelmap2DView[j] !== 0) {
19532
19532
  m2++;
19533
19533
  if (m2 >= M3) {
19534
19534
  labelmapBufferArray[m2] = new ArrayBuffer(arrayBufferLength);
@@ -19540,7 +19540,7 @@ var require_dcmjs = __commonJS({
19540
19540
  _i2 = 0;
19541
19541
  break;
19542
19542
  } else {
19543
- labelmap2DView[j2] = segmentIndex;
19543
+ labelmap2DView[j] = segmentIndex;
19544
19544
  segmentOnFrame = true;
19545
19545
  }
19546
19546
  }
@@ -19610,9 +19610,9 @@ var require_dcmjs = __commonJS({
19610
19610
  var byteOffset = sliceLength * 2 * imageIdIndex;
19611
19611
  var labelmap2DView = new Uint16Array(labelmapBufferArray[0], byteOffset, sliceLength);
19612
19612
  var data3 = alignedPixelDataI.data;
19613
- for (var j2 = 0, len2 = alignedPixelDataI.data.length; j2 < len2; ++j2) {
19614
- if (data3[j2]) {
19615
- for (var x2 = j2; x2 < len2; ++x2) {
19613
+ for (var j = 0, len2 = alignedPixelDataI.data.length; j < len2; ++j) {
19614
+ if (data3[j]) {
19615
+ for (var x2 = j; x2 < len2; ++x2) {
19616
19616
  if (data3[x2]) {
19617
19617
  labelmap2DView[x2] = segmentIndex;
19618
19618
  }
@@ -21237,8 +21237,8 @@ var require_dcmjs = __commonJS({
21237
21237
  return item.GraphicData;
21238
21238
  }).filter(/* @__PURE__ */ function(s) {
21239
21239
  return function(a2) {
21240
- return function(j2) {
21241
- return !s.has(j2) && s.add(j2);
21240
+ return function(j) {
21241
+ return !s.has(j) && s.add(j);
21242
21242
  }(JSON.stringify(a2));
21243
21243
  };
21244
21244
  }(/* @__PURE__ */ new Set()));
@@ -21356,8 +21356,8 @@ var require_dcmjs = __commonJS({
21356
21356
  return item.GraphicData;
21357
21357
  }).filter(/* @__PURE__ */ function(s) {
21358
21358
  return function(a2) {
21359
- return function(j2) {
21360
- return !s.has(j2) && s.add(j2);
21359
+ return function(j) {
21360
+ return !s.has(j) && s.add(j);
21361
21361
  }(JSON.stringify(a2));
21362
21362
  };
21363
21363
  }(/* @__PURE__ */ new Set()));
@@ -21402,8 +21402,8 @@ var require_dcmjs = __commonJS({
21402
21402
  });
21403
21403
  return measurement.filter(/* @__PURE__ */ function(s) {
21404
21404
  return function(a2) {
21405
- return function(j2) {
21406
- return !s.has(j2) && s.add(j2);
21405
+ return function(j) {
21406
+ return !s.has(j) && s.add(j);
21407
21407
  }(JSON.stringify(a2));
21408
21408
  };
21409
21409
  }(/* @__PURE__ */ new Set()));
@@ -21440,8 +21440,8 @@ var require_dcmjs = __commonJS({
21440
21440
  return item.GraphicData;
21441
21441
  }).filter(/* @__PURE__ */ function(s) {
21442
21442
  return function(a2) {
21443
- return function(j2) {
21444
- return !s.has(j2) && s.add(j2);
21443
+ return function(j) {
21444
+ return !s.has(j) && s.add(j);
21445
21445
  }(JSON.stringify(a2));
21446
21446
  };
21447
21447
  }(/* @__PURE__ */ new Set()));
@@ -21485,8 +21485,8 @@ var require_dcmjs = __commonJS({
21485
21485
  return item.GraphicData;
21486
21486
  }).filter(/* @__PURE__ */ function(s) {
21487
21487
  return function(a2) {
21488
- return function(j2) {
21489
- return !s.has(j2) && s.add(j2);
21488
+ return function(j) {
21489
+ return !s.has(j) && s.add(j);
21490
21490
  }(JSON.stringify(a2));
21491
21491
  };
21492
21492
  }(/* @__PURE__ */ new Set()));
@@ -21600,7 +21600,7 @@ var require_dcmjs = __commonJS({
21600
21600
  }
21601
21601
  function stringToUint8Array(str2) {
21602
21602
  var arr = new Uint8Array(str2.length);
21603
- for (var i = 0, j2 = str2.length; i < j2; i++) {
21603
+ for (var i = 0, j = str2.length; i < j; i++) {
21604
21604
  arr[i] = str2.charCodeAt(i);
21605
21605
  }
21606
21606
  return arr;
@@ -24860,11 +24860,11 @@ var require_once = __commonJS({
24860
24860
  value: true
24861
24861
  });
24862
24862
  exports2.default = once;
24863
- function once(fn2) {
24863
+ function once(fn) {
24864
24864
  return function() {
24865
- if (fn2 === null) return;
24866
- var callFn = fn2;
24867
- fn2 = null;
24865
+ if (fn === null) return;
24866
+ var callFn = fn;
24867
+ fn = null;
24868
24868
  callFn.apply(this, arguments);
24869
24869
  };
24870
24870
  }
@@ -25404,11 +25404,11 @@ var require_onlyOnce = __commonJS({
25404
25404
  value: true
25405
25405
  });
25406
25406
  exports2.default = onlyOnce;
25407
- function onlyOnce(fn2) {
25407
+ function onlyOnce(fn) {
25408
25408
  return function() {
25409
- if (fn2 === null) throw new Error("Callback was already called.");
25410
- var callFn = fn2;
25411
- fn2 = null;
25409
+ if (fn === null) throw new Error("Callback was already called.");
25410
+ var callFn = fn;
25411
+ fn = null;
25412
25412
  callFn.apply(this, arguments);
25413
25413
  };
25414
25414
  }
@@ -25539,11 +25539,11 @@ var require_initialParams = __commonJS({
25539
25539
  Object.defineProperty(exports2, "__esModule", {
25540
25540
  value: true
25541
25541
  });
25542
- exports2.default = function(fn2) {
25542
+ exports2.default = function(fn) {
25543
25543
  return function() {
25544
25544
  var args = (0, _slice2.default)(arguments);
25545
25545
  var callback = args.pop();
25546
- fn2.call(this, args, callback);
25546
+ fn.call(this, args, callback);
25547
25547
  };
25548
25548
  };
25549
25549
  var _slice = require_slice();
@@ -25572,14 +25572,14 @@ var require_setImmediate = __commonJS({
25572
25572
  }
25573
25573
  var hasSetImmediate = exports2.hasSetImmediate = typeof setImmediate === "function" && setImmediate;
25574
25574
  var hasNextTick = exports2.hasNextTick = typeof process === "object" && typeof process.nextTick === "function";
25575
- function fallback(fn2) {
25576
- setTimeout(fn2, 0);
25575
+ function fallback(fn) {
25576
+ setTimeout(fn, 0);
25577
25577
  }
25578
25578
  function wrap(defer) {
25579
- return function(fn2) {
25579
+ return function(fn) {
25580
25580
  var args = (0, _slice2.default)(arguments, 1);
25581
25581
  defer(function() {
25582
- fn2.apply(null, args);
25582
+ fn.apply(null, args);
25583
25583
  });
25584
25584
  };
25585
25585
  }
@@ -25659,8 +25659,8 @@ var require_wrapAsync = __commonJS({
25659
25659
  return obj && obj.__esModule ? obj : { default: obj };
25660
25660
  }
25661
25661
  var supportsSymbol = typeof Symbol === "function";
25662
- function isAsync(fn2) {
25663
- return supportsSymbol && fn2[Symbol.toStringTag] === "AsyncFunction";
25662
+ function isAsync(fn) {
25663
+ return supportsSymbol && fn[Symbol.toStringTag] === "AsyncFunction";
25664
25664
  }
25665
25665
  function wrapAsync(asyncFn) {
25666
25666
  return isAsync(asyncFn) ? (0, _asyncify2.default)(asyncFn) : asyncFn;
@@ -25702,9 +25702,9 @@ var require_doLimit = __commonJS({
25702
25702
  value: true
25703
25703
  });
25704
25704
  exports2.default = doLimit;
25705
- function doLimit(fn2, limit) {
25705
+ function doLimit(fn, limit) {
25706
25706
  return function(iterable, iteratee, callback) {
25707
- return fn2(iterable, limit, iteratee, callback);
25707
+ return fn(iterable, limit, iteratee, callback);
25708
25708
  };
25709
25709
  }
25710
25710
  module2.exports = exports2["default"];
@@ -25756,17 +25756,17 @@ var require_AsyncEventEmitter = __commonJS({
25756
25756
  callback = void 0;
25757
25757
  }
25758
25758
  listeners = Array.isArray(listeners) ? listeners : [listeners];
25759
- eachSeries(listeners.slice(), function(fn2, next) {
25759
+ eachSeries(listeners.slice(), function(fn, next) {
25760
25760
  var err;
25761
- if (fn2.length < 2) {
25761
+ if (fn.length < 2) {
25762
25762
  try {
25763
- fn2.call(self2, data2);
25763
+ fn.call(self2, data2);
25764
25764
  } catch (e) {
25765
25765
  err = e;
25766
25766
  }
25767
25767
  return next(err);
25768
25768
  }
25769
- fn2.call(self2, data2, next);
25769
+ fn.call(self2, data2, next);
25770
25770
  }, callback);
25771
25771
  return self2;
25772
25772
  };
@@ -27288,11 +27288,11 @@ var require_decorator = __commonJS({
27288
27288
  };
27289
27289
  };
27290
27290
  var mergeDecorators = (d1, d22) => {
27291
- var _a, _b, _c, _d, _e, _f;
27291
+ var _a, _b, _c, _d, _e2, _f;
27292
27292
  return {
27293
27293
  class: (0, util_1.unique)([...(_a = d1 === null || d1 === void 0 ? void 0 : d1.class) !== null && _a !== void 0 ? _a : [], ...(_b = d22 === null || d22 === void 0 ? void 0 : d22.class) !== null && _b !== void 0 ? _b : []]),
27294
27294
  static: mergePropertyAndMethodDecorators((_c = d1 === null || d1 === void 0 ? void 0 : d1.static) !== null && _c !== void 0 ? _c : {}, (_d = d22 === null || d22 === void 0 ? void 0 : d22.static) !== null && _d !== void 0 ? _d : {}),
27295
- instance: mergePropertyAndMethodDecorators((_e = d1 === null || d1 === void 0 ? void 0 : d1.instance) !== null && _e !== void 0 ? _e : {}, (_f = d22 === null || d22 === void 0 ? void 0 : d22.instance) !== null && _f !== void 0 ? _f : {})
27295
+ instance: mergePropertyAndMethodDecorators((_e2 = d1 === null || d1 === void 0 ? void 0 : d1.instance) !== null && _e2 !== void 0 ? _e2 : {}, (_f = d22 === null || d22 === void 0 ? void 0 : d22.instance) !== null && _f !== void 0 ? _f : {})
27296
27296
  };
27297
27297
  };
27298
27298
  var decorators = /* @__PURE__ */ new Map();
@@ -27590,7 +27590,7 @@ var require_has_flag = __commonJS({
27590
27590
  var require_supports_colors = __commonJS({
27591
27591
  "../../node_modules/logform/node_modules/@colors/colors/lib/system/supports-colors.js"(exports2, module2) {
27592
27592
  "use strict";
27593
- var os2 = require("os");
27593
+ var os = require("os");
27594
27594
  var hasFlag = require_has_flag();
27595
27595
  var env = process.env;
27596
27596
  var forceColor = void 0;
@@ -27628,7 +27628,7 @@ var require_supports_colors = __commonJS({
27628
27628
  }
27629
27629
  var min = forceColor ? 1 : 0;
27630
27630
  if (process.platform === "win32") {
27631
- var osRelease = os2.release().split(".");
27631
+ var osRelease = os.release().split(".");
27632
27632
  if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
27633
27633
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
27634
27634
  }
@@ -29288,7 +29288,7 @@ var require_ms = __commonJS({
29288
29288
  var m2 = s * 60;
29289
29289
  var h2 = m2 * 60;
29290
29290
  var d3 = h2 * 24;
29291
- var w3 = d3 * 7;
29291
+ var w2 = d3 * 7;
29292
29292
  var y2 = d3 * 365.25;
29293
29293
  module2.exports = function(val, options) {
29294
29294
  options = options || {};
@@ -29325,7 +29325,7 @@ var require_ms = __commonJS({
29325
29325
  case "weeks":
29326
29326
  case "week":
29327
29327
  case "w":
29328
- return n * w3;
29328
+ return n * w2;
29329
29329
  case "days":
29330
29330
  case "day":
29331
29331
  case "d":
@@ -30887,21 +30887,21 @@ var require_string_decoder = __commonJS({
30887
30887
  return byte >> 6 === 2 ? -1 : -2;
30888
30888
  }
30889
30889
  function utf8CheckIncomplete(self2, buf, i) {
30890
- var j2 = buf.length - 1;
30891
- if (j2 < i) return 0;
30892
- var nb = utf8CheckByte(buf[j2]);
30890
+ var j = buf.length - 1;
30891
+ if (j < i) return 0;
30892
+ var nb = utf8CheckByte(buf[j]);
30893
30893
  if (nb >= 0) {
30894
30894
  if (nb > 0) self2.lastNeed = nb - 1;
30895
30895
  return nb;
30896
30896
  }
30897
- if (--j2 < i || nb === -2) return 0;
30898
- nb = utf8CheckByte(buf[j2]);
30897
+ if (--j < i || nb === -2) return 0;
30898
+ nb = utf8CheckByte(buf[j]);
30899
30899
  if (nb >= 0) {
30900
30900
  if (nb > 0) self2.lastNeed = nb - 2;
30901
30901
  return nb;
30902
30902
  }
30903
- if (--j2 < i || nb === -2) return 0;
30904
- nb = utf8CheckByte(buf[j2]);
30903
+ if (--j < i || nb === -2) return 0;
30904
+ nb = utf8CheckByte(buf[j]);
30905
30905
  if (nb >= 0) {
30906
30906
  if (nb > 0) {
30907
30907
  if (nb === 2) nb = 0;
@@ -31298,11 +31298,11 @@ var require_from = __commonJS({
31298
31298
  Promise.resolve(value).then(_next, _throw);
31299
31299
  }
31300
31300
  }
31301
- function _asyncToGenerator(fn2) {
31301
+ function _asyncToGenerator(fn) {
31302
31302
  return function() {
31303
31303
  var self2 = this, args = arguments;
31304
31304
  return new Promise(function(resolve2, reject) {
31305
- var gen = fn2.apply(self2, args);
31305
+ var gen = fn.apply(self2, args);
31306
31306
  function _next(value) {
31307
31307
  asyncGeneratorStep(gen, resolve2, reject, _next, _throw, "next", value);
31308
31308
  }
@@ -31445,11 +31445,11 @@ var require_stream_readable = __commonJS({
31445
31445
  require_inherits()(Readable2, Stream);
31446
31446
  var errorOrDestroy = destroyImpl.errorOrDestroy;
31447
31447
  var kProxyEvents = ["error", "close", "destroy", "pause", "resume"];
31448
- function prependListener(emitter, event, fn2) {
31449
- if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn2);
31450
- if (!emitter._events || !emitter._events[event]) emitter.on(event, fn2);
31451
- else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn2);
31452
- else emitter._events[event] = [fn2, emitter._events[event]];
31448
+ function prependListener(emitter, event, fn) {
31449
+ if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn);
31450
+ if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);
31451
+ else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);
31452
+ else emitter._events[event] = [fn, emitter._events[event]];
31453
31453
  }
31454
31454
  function ReadableState(options, stream, isDuplex) {
31455
31455
  Duplex = Duplex || require_stream_duplex();
@@ -31548,10 +31548,10 @@ var require_stream_readable = __commonJS({
31548
31548
  state.reading = false;
31549
31549
  onEofChunk(stream, state);
31550
31550
  } else {
31551
- var er2;
31552
- if (!skipChunkCheck) er2 = chunkInvalid(state, chunk);
31553
- if (er2) {
31554
- errorOrDestroy(stream, er2);
31551
+ var er;
31552
+ if (!skipChunkCheck) er = chunkInvalid(state, chunk);
31553
+ if (er) {
31554
+ errorOrDestroy(stream, er);
31555
31555
  } else if (state.objectMode || chunk && chunk.length > 0) {
31556
31556
  if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer2.prototype) {
31557
31557
  chunk = _uint8ArrayToBuffer(chunk);
@@ -31593,11 +31593,11 @@ var require_stream_readable = __commonJS({
31593
31593
  maybeReadMore(stream, state);
31594
31594
  }
31595
31595
  function chunkInvalid(state, chunk) {
31596
- var er2;
31596
+ var er;
31597
31597
  if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) {
31598
- er2 = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer", "Uint8Array"], chunk);
31598
+ er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer", "Uint8Array"], chunk);
31599
31599
  }
31600
- return er2;
31600
+ return er;
31601
31601
  }
31602
31602
  Readable2.prototype.isPaused = function() {
31603
31603
  return this._readableState.flowing === false;
@@ -31823,11 +31823,11 @@ var require_stream_readable = __commonJS({
31823
31823
  src.pause();
31824
31824
  }
31825
31825
  }
31826
- function onerror(er2) {
31827
- debug("onerror", er2);
31826
+ function onerror(er) {
31827
+ debug("onerror", er);
31828
31828
  unpipe();
31829
31829
  dest.removeListener("error", onerror);
31830
- if (EElistenerCount(dest, "error") === 0) errorOrDestroy(dest, er2);
31830
+ if (EElistenerCount(dest, "error") === 0) errorOrDestroy(dest, er);
31831
31831
  }
31832
31832
  prependListener(dest, "error", onerror);
31833
31833
  function onclose() {
@@ -31897,8 +31897,8 @@ var require_stream_readable = __commonJS({
31897
31897
  dest.emit("unpipe", this, unpipeInfo);
31898
31898
  return this;
31899
31899
  };
31900
- Readable2.prototype.on = function(ev, fn2) {
31901
- var res = Stream.prototype.on.call(this, ev, fn2);
31900
+ Readable2.prototype.on = function(ev, fn) {
31901
+ var res = Stream.prototype.on.call(this, ev, fn);
31902
31902
  var state = this._readableState;
31903
31903
  if (ev === "data") {
31904
31904
  state.readableListening = this.listenerCount("readable") > 0;
@@ -31919,8 +31919,8 @@ var require_stream_readable = __commonJS({
31919
31919
  return res;
31920
31920
  };
31921
31921
  Readable2.prototype.addListener = Readable2.prototype.on;
31922
- Readable2.prototype.removeListener = function(ev, fn2) {
31923
- var res = Stream.prototype.removeListener.call(this, ev, fn2);
31922
+ Readable2.prototype.removeListener = function(ev, fn) {
31923
+ var res = Stream.prototype.removeListener.call(this, ev, fn);
31924
31924
  if (ev === "readable") {
31925
31925
  process.nextTick(updateReadableListening, this);
31926
31926
  }
@@ -32292,8 +32292,8 @@ var require_stream_writable = __commonJS({
32292
32292
  this.corked = 0;
32293
32293
  this.sync = true;
32294
32294
  this.bufferProcessing = false;
32295
- this.onwrite = function(er2) {
32296
- onwrite(stream, er2);
32295
+ this.onwrite = function(er) {
32296
+ onwrite(stream, er);
32297
32297
  };
32298
32298
  this.writecb = null;
32299
32299
  this.writelen = 0;
@@ -32359,20 +32359,20 @@ var require_stream_writable = __commonJS({
32359
32359
  errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE());
32360
32360
  };
32361
32361
  function writeAfterEnd(stream, cb) {
32362
- var er2 = new ERR_STREAM_WRITE_AFTER_END();
32363
- errorOrDestroy(stream, er2);
32364
- process.nextTick(cb, er2);
32362
+ var er = new ERR_STREAM_WRITE_AFTER_END();
32363
+ errorOrDestroy(stream, er);
32364
+ process.nextTick(cb, er);
32365
32365
  }
32366
32366
  function validChunk(stream, state, chunk, cb) {
32367
- var er2;
32367
+ var er;
32368
32368
  if (chunk === null) {
32369
- er2 = new ERR_STREAM_NULL_VALUES();
32369
+ er = new ERR_STREAM_NULL_VALUES();
32370
32370
  } else if (typeof chunk !== "string" && !state.objectMode) {
32371
- er2 = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer"], chunk);
32371
+ er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer"], chunk);
32372
32372
  }
32373
- if (er2) {
32374
- errorOrDestroy(stream, er2);
32375
- process.nextTick(cb, er2);
32373
+ if (er) {
32374
+ errorOrDestroy(stream, er);
32375
+ process.nextTick(cb, er);
32376
32376
  return false;
32377
32377
  }
32378
32378
  return true;
@@ -32481,17 +32481,17 @@ var require_stream_writable = __commonJS({
32481
32481
  else stream._write(chunk, encoding, state.onwrite);
32482
32482
  state.sync = false;
32483
32483
  }
32484
- function onwriteError(stream, state, sync, er2, cb) {
32484
+ function onwriteError(stream, state, sync, er, cb) {
32485
32485
  --state.pendingcb;
32486
32486
  if (sync) {
32487
- process.nextTick(cb, er2);
32487
+ process.nextTick(cb, er);
32488
32488
  process.nextTick(finishMaybe, stream, state);
32489
32489
  stream._writableState.errorEmitted = true;
32490
- errorOrDestroy(stream, er2);
32490
+ errorOrDestroy(stream, er);
32491
32491
  } else {
32492
- cb(er2);
32492
+ cb(er);
32493
32493
  stream._writableState.errorEmitted = true;
32494
- errorOrDestroy(stream, er2);
32494
+ errorOrDestroy(stream, er);
32495
32495
  finishMaybe(stream, state);
32496
32496
  }
32497
32497
  }
@@ -32501,13 +32501,13 @@ var require_stream_writable = __commonJS({
32501
32501
  state.length -= state.writelen;
32502
32502
  state.writelen = 0;
32503
32503
  }
32504
- function onwrite(stream, er2) {
32504
+ function onwrite(stream, er) {
32505
32505
  var state = stream._writableState;
32506
32506
  var sync = state.sync;
32507
32507
  var cb = state.writecb;
32508
32508
  if (typeof cb !== "function") throw new ERR_MULTIPLE_CALLBACK();
32509
32509
  onwriteStateUpdate(state);
32510
- if (er2) onwriteError(stream, state, sync, er2, cb);
32510
+ if (er) onwriteError(stream, state, sync, er, cb);
32511
32511
  else {
32512
32512
  var finished = needFinish(state) || stream.destroyed;
32513
32513
  if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
@@ -32889,7 +32889,7 @@ var require_winston_transport = __commonJS({
32889
32889
  var require_console = __commonJS({
32890
32890
  "../../node_modules/winston/lib/winston/transports/console.js"(exports2, module2) {
32891
32891
  "use strict";
32892
- var os2 = require("os");
32892
+ var os = require("os");
32893
32893
  var { LEVEL, MESSAGE } = require_triple_beam();
32894
32894
  var TransportStream = require_winston_transport();
32895
32895
  module2.exports = class Console extends TransportStream {
@@ -32903,7 +32903,7 @@ var require_console = __commonJS({
32903
32903
  this.name = options.name || "console";
32904
32904
  this.stderrLevels = this._stringArrayToSet(options.stderrLevels);
32905
32905
  this.consoleWarnLevels = this._stringArrayToSet(options.consoleWarnLevels);
32906
- this.eol = typeof options.eol === "string" ? options.eol : os2.EOL;
32906
+ this.eol = typeof options.eol === "string" ? options.eol : os.EOL;
32907
32907
  this.forceConsole = options.forceConsole || false;
32908
32908
  this._consoleLog = console.log.bind(console);
32909
32909
  this._consoleWarn = console.warn.bind(console);
@@ -32996,10 +32996,10 @@ var require_initialParams2 = __commonJS({
32996
32996
  Object.defineProperty(exports2, "__esModule", {
32997
32997
  value: true
32998
32998
  });
32999
- exports2.default = function(fn2) {
32999
+ exports2.default = function(fn) {
33000
33000
  return function(...args) {
33001
33001
  var callback = args.pop();
33002
- return fn2.call(this, args, callback);
33002
+ return fn.call(this, args, callback);
33003
33003
  };
33004
33004
  };
33005
33005
  module2.exports = exports2.default;
@@ -33018,11 +33018,11 @@ var require_setImmediate2 = __commonJS({
33018
33018
  var hasQueueMicrotask = exports2.hasQueueMicrotask = typeof queueMicrotask === "function" && queueMicrotask;
33019
33019
  var hasSetImmediate = exports2.hasSetImmediate = typeof setImmediate === "function" && setImmediate;
33020
33020
  var hasNextTick = exports2.hasNextTick = typeof process === "object" && typeof process.nextTick === "function";
33021
- function fallback(fn2) {
33022
- setTimeout(fn2, 0);
33021
+ function fallback(fn) {
33022
+ setTimeout(fn, 0);
33023
33023
  }
33024
33024
  function wrap(defer) {
33025
- return (fn2, ...args) => defer(() => fn2(...args));
33025
+ return (fn, ...args) => defer(() => fn(...args));
33026
33026
  }
33027
33027
  var _defer;
33028
33028
  if (hasQueueMicrotask) {
@@ -33109,11 +33109,11 @@ var require_wrapAsync2 = __commonJS({
33109
33109
  function _interopRequireDefault(obj) {
33110
33110
  return obj && obj.__esModule ? obj : { default: obj };
33111
33111
  }
33112
- function isAsync(fn2) {
33113
- return fn2[Symbol.toStringTag] === "AsyncFunction";
33112
+ function isAsync(fn) {
33113
+ return fn[Symbol.toStringTag] === "AsyncFunction";
33114
33114
  }
33115
- function isAsyncGenerator(fn2) {
33116
- return fn2[Symbol.toStringTag] === "AsyncGenerator";
33115
+ function isAsyncGenerator(fn) {
33116
+ return fn[Symbol.toStringTag] === "AsyncGenerator";
33117
33117
  }
33118
33118
  function isAsyncIterable(obj) {
33119
33119
  return typeof obj[Symbol.asyncIterator] === "function";
@@ -33198,14 +33198,14 @@ var require_once2 = __commonJS({
33198
33198
  value: true
33199
33199
  });
33200
33200
  exports2.default = once;
33201
- function once(fn2) {
33201
+ function once(fn) {
33202
33202
  function wrapper(...args) {
33203
- if (fn2 === null) return;
33204
- var callFn = fn2;
33205
- fn2 = null;
33203
+ if (fn === null) return;
33204
+ var callFn = fn;
33205
+ fn = null;
33206
33206
  callFn.apply(this, args);
33207
33207
  }
33208
- Object.assign(wrapper, fn2);
33208
+ Object.assign(wrapper, fn);
33209
33209
  return wrapper;
33210
33210
  }
33211
33211
  module2.exports = exports2.default;
@@ -33288,11 +33288,11 @@ var require_onlyOnce2 = __commonJS({
33288
33288
  value: true
33289
33289
  });
33290
33290
  exports2.default = onlyOnce;
33291
- function onlyOnce(fn2) {
33291
+ function onlyOnce(fn) {
33292
33292
  return function(...args) {
33293
- if (fn2 === null) throw new Error("Callback was already called.");
33294
- var callFn = fn2;
33295
- fn2 = null;
33293
+ if (fn === null) throw new Error("Callback was already called.");
33294
+ var callFn = fn;
33295
+ fn = null;
33296
33296
  callFn.apply(this, args);
33297
33297
  };
33298
33298
  }
@@ -33538,7 +33538,7 @@ var require_stream_transform = __commonJS({
33538
33538
  var ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;
33539
33539
  var Duplex = require_stream_duplex();
33540
33540
  require_inherits()(Transform, Duplex);
33541
- function afterTransform(er2, data2) {
33541
+ function afterTransform(er, data2) {
33542
33542
  var ts = this._transformState;
33543
33543
  ts.transforming = false;
33544
33544
  var cb = ts.writecb;
@@ -33549,7 +33549,7 @@ var require_stream_transform = __commonJS({
33549
33549
  ts.writecb = null;
33550
33550
  if (data2 != null)
33551
33551
  this.push(data2);
33552
- cb(er2);
33552
+ cb(er);
33553
33553
  var rs = this._readableState;
33554
33554
  rs.reading = false;
33555
33555
  if (rs.needReadable || rs.length < rs.highWaterMark) {
@@ -33578,8 +33578,8 @@ var require_stream_transform = __commonJS({
33578
33578
  function prefinish() {
33579
33579
  var _this = this;
33580
33580
  if (typeof this._flush === "function" && !this._readableState.destroyed) {
33581
- this._flush(function(er2, data2) {
33582
- done(_this, er2, data2);
33581
+ this._flush(function(er, data2) {
33582
+ done(_this, er, data2);
33583
33583
  });
33584
33584
  } else {
33585
33585
  done(this, null, null);
@@ -33616,8 +33616,8 @@ var require_stream_transform = __commonJS({
33616
33616
  cb(err2);
33617
33617
  });
33618
33618
  };
33619
- function done(stream, er2, data2) {
33620
- if (er2) return stream.emit("error", er2);
33619
+ function done(stream, er, data2) {
33620
+ if (er) return stream.emit("error", er);
33621
33621
  if (data2 != null)
33622
33622
  stream.push(data2);
33623
33623
  if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0();
@@ -33691,11 +33691,11 @@ var require_pipeline = __commonJS({
33691
33691
  callback(err || new ERR_STREAM_DESTROYED("pipe"));
33692
33692
  };
33693
33693
  }
33694
- function call(fn2) {
33695
- fn2();
33694
+ function call(fn) {
33695
+ fn();
33696
33696
  }
33697
- function pipe(from, to2) {
33698
- return from.pipe(to2);
33697
+ function pipe(from, to) {
33698
+ return from.pipe(to);
33699
33699
  }
33700
33700
  function popCallback(streams) {
33701
33701
  if (!streams.length) return noop;
@@ -33780,17 +33780,17 @@ var require_diagnostics = __commonJS({
33780
33780
  if (!async.length) return false;
33781
33781
  return new Promise(function pinky(resolve2) {
33782
33782
  Promise.all(
33783
- async.map(function prebind(fn2) {
33784
- return fn2(namespace);
33783
+ async.map(function prebind(fn) {
33784
+ return fn(namespace);
33785
33785
  })
33786
33786
  ).then(function resolved(values) {
33787
33787
  resolve2(values.some(Boolean));
33788
33788
  });
33789
33789
  });
33790
33790
  }
33791
- function modify(fn2) {
33792
- if (~modifiers.indexOf(fn2)) return false;
33793
- modifiers.push(fn2);
33791
+ function modify(fn) {
33792
+ if (~modifiers.indexOf(fn)) return false;
33793
+ modifiers.push(fn);
33794
33794
  return true;
33795
33795
  }
33796
33796
  function write() {
@@ -33802,14 +33802,14 @@ var require_diagnostics = __commonJS({
33802
33802
  }
33803
33803
  return message;
33804
33804
  }
33805
- function introduce(fn2, options) {
33805
+ function introduce(fn, options) {
33806
33806
  var has = Object.prototype.hasOwnProperty;
33807
33807
  for (var key in options) {
33808
33808
  if (has.call(options, key)) {
33809
- fn2[key] = options[key];
33809
+ fn[key] = options[key];
33810
33810
  }
33811
33811
  }
33812
- return fn2;
33812
+ return fn;
33813
33813
  }
33814
33814
  function nope(options) {
33815
33815
  options.enabled = false;
@@ -34053,9 +34053,9 @@ var require_simple_swizzle = __commonJS({
34053
34053
  }
34054
34054
  return results;
34055
34055
  };
34056
- swizzle.wrap = function(fn2) {
34056
+ swizzle.wrap = function(fn) {
34057
34057
  return function() {
34058
- return fn2(swizzle(arguments));
34058
+ return fn(swizzle(arguments));
34059
34059
  };
34060
34060
  };
34061
34061
  }
@@ -34075,25 +34075,25 @@ var require_color_string = __commonJS({
34075
34075
  }
34076
34076
  }
34077
34077
  var name;
34078
- var cs = module2.exports = {
34078
+ var cs2 = module2.exports = {
34079
34079
  to: {},
34080
34080
  get: {}
34081
34081
  };
34082
- cs.get = function(string) {
34082
+ cs2.get = function(string) {
34083
34083
  var prefix = string.substring(0, 3).toLowerCase();
34084
34084
  var val;
34085
34085
  var model;
34086
34086
  switch (prefix) {
34087
34087
  case "hsl":
34088
- val = cs.get.hsl(string);
34088
+ val = cs2.get.hsl(string);
34089
34089
  model = "hsl";
34090
34090
  break;
34091
34091
  case "hwb":
34092
- val = cs.get.hwb(string);
34092
+ val = cs2.get.hwb(string);
34093
34093
  model = "hwb";
34094
34094
  break;
34095
34095
  default:
34096
- val = cs.get.rgb(string);
34096
+ val = cs2.get.rgb(string);
34097
34097
  model = "rgb";
34098
34098
  break;
34099
34099
  }
@@ -34102,7 +34102,7 @@ var require_color_string = __commonJS({
34102
34102
  }
34103
34103
  return { model, value: val };
34104
34104
  };
34105
- cs.get.rgb = function(string) {
34105
+ cs2.get.rgb = function(string) {
34106
34106
  if (!string) {
34107
34107
  return null;
34108
34108
  }
@@ -34175,7 +34175,7 @@ var require_color_string = __commonJS({
34175
34175
  rgb[3] = clamp(rgb[3], 0, 1);
34176
34176
  return rgb;
34177
34177
  };
34178
- cs.get.hsl = function(string) {
34178
+ cs2.get.hsl = function(string) {
34179
34179
  if (!string) {
34180
34180
  return null;
34181
34181
  }
@@ -34191,7 +34191,7 @@ var require_color_string = __commonJS({
34191
34191
  }
34192
34192
  return null;
34193
34193
  };
34194
- cs.get.hwb = function(string) {
34194
+ cs2.get.hwb = function(string) {
34195
34195
  if (!string) {
34196
34196
  return null;
34197
34197
  }
@@ -34200,33 +34200,33 @@ var require_color_string = __commonJS({
34200
34200
  if (match) {
34201
34201
  var alpha = parseFloat(match[4]);
34202
34202
  var h2 = (parseFloat(match[1]) % 360 + 360) % 360;
34203
- var w3 = clamp(parseFloat(match[2]), 0, 100);
34203
+ var w2 = clamp(parseFloat(match[2]), 0, 100);
34204
34204
  var b2 = clamp(parseFloat(match[3]), 0, 100);
34205
34205
  var a2 = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
34206
- return [h2, w3, b2, a2];
34206
+ return [h2, w2, b2, a2];
34207
34207
  }
34208
34208
  return null;
34209
34209
  };
34210
- cs.to.hex = function() {
34210
+ cs2.to.hex = function() {
34211
34211
  var rgba = swizzle(arguments);
34212
34212
  return "#" + hexDouble(rgba[0]) + hexDouble(rgba[1]) + hexDouble(rgba[2]) + (rgba[3] < 1 ? hexDouble(Math.round(rgba[3] * 255)) : "");
34213
34213
  };
34214
- cs.to.rgb = function() {
34214
+ cs2.to.rgb = function() {
34215
34215
  var rgba = swizzle(arguments);
34216
34216
  return rgba.length < 4 || rgba[3] === 1 ? "rgb(" + Math.round(rgba[0]) + ", " + Math.round(rgba[1]) + ", " + Math.round(rgba[2]) + ")" : "rgba(" + Math.round(rgba[0]) + ", " + Math.round(rgba[1]) + ", " + Math.round(rgba[2]) + ", " + rgba[3] + ")";
34217
34217
  };
34218
- cs.to.rgb.percent = function() {
34218
+ cs2.to.rgb.percent = function() {
34219
34219
  var rgba = swizzle(arguments);
34220
34220
  var r7 = Math.round(rgba[0] / 255 * 100);
34221
34221
  var g2 = Math.round(rgba[1] / 255 * 100);
34222
34222
  var b2 = Math.round(rgba[2] / 255 * 100);
34223
34223
  return rgba.length < 4 || rgba[3] === 1 ? "rgb(" + r7 + "%, " + g2 + "%, " + b2 + "%)" : "rgba(" + r7 + "%, " + g2 + "%, " + b2 + "%, " + rgba[3] + ")";
34224
34224
  };
34225
- cs.to.hsl = function() {
34225
+ cs2.to.hsl = function() {
34226
34226
  var hsla = swizzle(arguments);
34227
34227
  return hsla.length < 4 || hsla[3] === 1 ? "hsl(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%)" : "hsla(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%, " + hsla[3] + ")";
34228
34228
  };
34229
- cs.to.hwb = function() {
34229
+ cs2.to.hwb = function() {
34230
34230
  var hwba = swizzle(arguments);
34231
34231
  var a2 = "";
34232
34232
  if (hwba.length >= 4 && hwba[3] !== 1) {
@@ -34234,7 +34234,7 @@ var require_color_string = __commonJS({
34234
34234
  }
34235
34235
  return "hwb(" + hwba[0] + ", " + hwba[1] + "%, " + hwba[2] + "%" + a2 + ")";
34236
34236
  };
34237
- cs.to.keyword = function(rgb) {
34237
+ cs2.to.keyword = function(rgb) {
34238
34238
  return reverseNames[rgb.slice(0, 3)];
34239
34239
  };
34240
34240
  function clamp(num, min, max) {
@@ -34533,9 +34533,9 @@ var require_conversions = __commonJS({
34533
34533
  var g2 = rgb[1];
34534
34534
  var b2 = rgb[2];
34535
34535
  var h2 = convert.rgb.hsl(rgb)[0];
34536
- var w3 = 1 / 255 * Math.min(r7, Math.min(g2, b2));
34536
+ var w2 = 1 / 255 * Math.min(r7, Math.min(g2, b2));
34537
34537
  b2 = 1 - 1 / 255 * Math.max(r7, Math.max(g2, b2));
34538
- return [h2, w3 * 100, b2 * 100];
34538
+ return [h2, w2 * 100, b2 * 100];
34539
34539
  };
34540
34540
  convert.rgb.cmyk = function(rgb) {
34541
34541
  var r7 = rgb[0] / 255;
@@ -35005,7 +35005,7 @@ var require_conversions = __commonJS({
35005
35005
  var pure = [0, 0, 0];
35006
35006
  var hi2 = h2 % 1 * 6;
35007
35007
  var v = hi2 % 1;
35008
- var w3 = 1 - v;
35008
+ var w2 = 1 - v;
35009
35009
  var mg = 0;
35010
35010
  switch (Math.floor(hi2)) {
35011
35011
  case 0:
@@ -35014,7 +35014,7 @@ var require_conversions = __commonJS({
35014
35014
  pure[2] = 0;
35015
35015
  break;
35016
35016
  case 1:
35017
- pure[0] = w3;
35017
+ pure[0] = w2;
35018
35018
  pure[1] = 1;
35019
35019
  pure[2] = 0;
35020
35020
  break;
@@ -35025,7 +35025,7 @@ var require_conversions = __commonJS({
35025
35025
  break;
35026
35026
  case 3:
35027
35027
  pure[0] = 0;
35028
- pure[1] = w3;
35028
+ pure[1] = w2;
35029
35029
  pure[2] = 1;
35030
35030
  break;
35031
35031
  case 4:
@@ -35036,7 +35036,7 @@ var require_conversions = __commonJS({
35036
35036
  default:
35037
35037
  pure[0] = 1;
35038
35038
  pure[1] = 0;
35039
- pure[2] = w3;
35039
+ pure[2] = w2;
35040
35040
  }
35041
35041
  mg = (1 - c) * g2;
35042
35042
  return [
@@ -35074,10 +35074,10 @@ var require_conversions = __commonJS({
35074
35074
  return [hcg[0], (v - c) * 100, (1 - v) * 100];
35075
35075
  };
35076
35076
  convert.hwb.hcg = function(hwb) {
35077
- var w3 = hwb[1] / 100;
35077
+ var w2 = hwb[1] / 100;
35078
35078
  var b2 = hwb[2] / 100;
35079
35079
  var v = 1 - b2;
35080
- var c = v - w3;
35080
+ var c = v - w2;
35081
35081
  var g2 = 0;
35082
35082
  if (c < 1) {
35083
35083
  g2 = (v - c) / (1 - c);
@@ -35155,22 +35155,22 @@ var require_route = __commonJS({
35155
35155
  }
35156
35156
  return graph;
35157
35157
  }
35158
- function link(from, to2) {
35158
+ function link(from, to) {
35159
35159
  return function(args) {
35160
- return to2(from(args));
35160
+ return to(from(args));
35161
35161
  };
35162
35162
  }
35163
35163
  function wrapConversion(toModel, graph) {
35164
35164
  var path = [graph[toModel].parent, toModel];
35165
- var fn2 = conversions[graph[toModel].parent][toModel];
35165
+ var fn = conversions[graph[toModel].parent][toModel];
35166
35166
  var cur = graph[toModel].parent;
35167
35167
  while (graph[cur].parent) {
35168
35168
  path.unshift(graph[cur].parent);
35169
- fn2 = link(conversions[graph[cur].parent][cur], fn2);
35169
+ fn = link(conversions[graph[cur].parent][cur], fn);
35170
35170
  cur = graph[cur].parent;
35171
35171
  }
35172
- fn2.conversion = path;
35173
- return fn2;
35172
+ fn.conversion = path;
35173
+ return fn;
35174
35174
  }
35175
35175
  module2.exports = function(fromModel) {
35176
35176
  var graph = deriveBFS(fromModel);
@@ -35197,7 +35197,7 @@ var require_color_convert = __commonJS({
35197
35197
  var route = require_route();
35198
35198
  var convert = {};
35199
35199
  var models = Object.keys(conversions);
35200
- function wrapRaw(fn2) {
35200
+ function wrapRaw(fn) {
35201
35201
  var wrappedFn = function(args) {
35202
35202
  if (args === void 0 || args === null) {
35203
35203
  return args;
@@ -35205,14 +35205,14 @@ var require_color_convert = __commonJS({
35205
35205
  if (arguments.length > 1) {
35206
35206
  args = Array.prototype.slice.call(arguments);
35207
35207
  }
35208
- return fn2(args);
35208
+ return fn(args);
35209
35209
  };
35210
- if ("conversion" in fn2) {
35211
- wrappedFn.conversion = fn2.conversion;
35210
+ if ("conversion" in fn) {
35211
+ wrappedFn.conversion = fn.conversion;
35212
35212
  }
35213
35213
  return wrappedFn;
35214
35214
  }
35215
- function wrapRounded(fn2) {
35215
+ function wrapRounded(fn) {
35216
35216
  var wrappedFn = function(args) {
35217
35217
  if (args === void 0 || args === null) {
35218
35218
  return args;
@@ -35220,7 +35220,7 @@ var require_color_convert = __commonJS({
35220
35220
  if (arguments.length > 1) {
35221
35221
  args = Array.prototype.slice.call(arguments);
35222
35222
  }
35223
- var result = fn2(args);
35223
+ var result = fn(args);
35224
35224
  if (typeof result === "object") {
35225
35225
  for (var len = result.length, i = 0; i < len; i++) {
35226
35226
  result[i] = Math.round(result[i]);
@@ -35228,8 +35228,8 @@ var require_color_convert = __commonJS({
35228
35228
  }
35229
35229
  return result;
35230
35230
  };
35231
- if ("conversion" in fn2) {
35232
- wrappedFn.conversion = fn2.conversion;
35231
+ if ("conversion" in fn) {
35232
+ wrappedFn.conversion = fn.conversion;
35233
35233
  }
35234
35234
  return wrappedFn;
35235
35235
  }
@@ -35240,9 +35240,9 @@ var require_color_convert = __commonJS({
35240
35240
  var routes = route(fromModel);
35241
35241
  var routeModels = Object.keys(routes);
35242
35242
  routeModels.forEach(function(toModel) {
35243
- var fn2 = routes[toModel];
35244
- convert[fromModel][toModel] = wrapRounded(fn2);
35245
- convert[fromModel][toModel].raw = wrapRaw(fn2);
35243
+ var fn = routes[toModel];
35244
+ convert[fromModel][toModel] = wrapRounded(fn);
35245
+ convert[fromModel][toModel].raw = wrapRaw(fn);
35246
35246
  });
35247
35247
  });
35248
35248
  module2.exports = convert;
@@ -35546,9 +35546,9 @@ var require_color = __commonJS({
35546
35546
  var color1 = mixinColor.rgb();
35547
35547
  var color2 = this.rgb();
35548
35548
  var p2 = weight === void 0 ? 0.5 : weight;
35549
- var w3 = 2 * p2 - 1;
35549
+ var w2 = 2 * p2 - 1;
35550
35550
  var a2 = color1.alpha() - color2.alpha();
35551
- var w1 = ((w3 * a2 === -1 ? w3 : (w3 + a2) / (1 + w3 * a2)) + 1) / 2;
35551
+ var w1 = ((w2 * a2 === -1 ? w2 : (w2 + a2) / (1 + w2 * a2)) + 1) / 2;
35552
35552
  var w22 = 1 - w1;
35553
35553
  return Color.rgb(
35554
35554
  w1 * color1.red() + w22 * color2.red(),
@@ -35752,10 +35752,10 @@ var require_adapters = __commonJS({
35752
35752
  "../../node_modules/@dabh/diagnostics/adapters/index.js"(exports2, module2) {
35753
35753
  "use strict";
35754
35754
  var enabled = require_enabled();
35755
- module2.exports = function create(fn2) {
35755
+ module2.exports = function create(fn) {
35756
35756
  return function adapter(namespace) {
35757
35757
  try {
35758
- return enabled(namespace, fn2());
35758
+ return enabled(namespace, fn());
35759
35759
  } catch (e) {
35760
35760
  }
35761
35761
  return false;
@@ -35931,7 +35931,7 @@ var require_file = __commonJS({
35931
35931
  var { Stream, PassThrough } = require_readable();
35932
35932
  var TransportStream = require_winston_transport();
35933
35933
  var debug = require_node2()("winston:file");
35934
- var os2 = require("os");
35934
+ var os = require("os");
35935
35935
  var tailFile = require_tail_file();
35936
35936
  module2.exports = class File extends TransportStream {
35937
35937
  /**
@@ -35969,7 +35969,7 @@ var require_file = __commonJS({
35969
35969
  this.rotationFormat = options.rotationFormat || false;
35970
35970
  this.zippedArchive = options.zippedArchive || false;
35971
35971
  this.maxFiles = options.maxFiles || null;
35972
- this.eol = typeof options.eol === "string" ? options.eol : os2.EOL;
35972
+ this.eol = typeof options.eol === "string" ? options.eol : os.EOL;
35973
35973
  this.tailable = options.tailable || false;
35974
35974
  this.lazy = options.lazy || false;
35975
35975
  this._size = 0;
@@ -36750,7 +36750,7 @@ var require_stream3 = __commonJS({
36750
36750
  "use strict";
36751
36751
  var isStream = require_is_stream();
36752
36752
  var { MESSAGE } = require_triple_beam();
36753
- var os2 = require("os");
36753
+ var os = require("os");
36754
36754
  var TransportStream = require_winston_transport();
36755
36755
  module2.exports = class Stream extends TransportStream {
36756
36756
  /**
@@ -36766,7 +36766,7 @@ var require_stream3 = __commonJS({
36766
36766
  this._stream = options.stream;
36767
36767
  this._stream.setMaxListeners(Infinity);
36768
36768
  this.isObjectMode = options.stream._writableState.objectMode;
36769
- this.eol = typeof options.eol === "string" ? options.eol : os2.EOL;
36769
+ this.eol = typeof options.eol === "string" ? options.eol : os.EOL;
36770
36770
  }
36771
36771
  /**
36772
36772
  * Core logging method exposed to Winston.
@@ -36944,14 +36944,14 @@ var require_fn = __commonJS({
36944
36944
  "../../node_modules/fn.name/index.js"(exports2, module2) {
36945
36945
  "use strict";
36946
36946
  var toString = Object.prototype.toString;
36947
- module2.exports = function name(fn2) {
36948
- if ("string" === typeof fn2.displayName && fn2.constructor.name) {
36949
- return fn2.displayName;
36950
- } else if ("string" === typeof fn2.name && fn2.name) {
36951
- return fn2.name;
36952
- }
36953
- if ("object" === typeof fn2 && fn2.constructor && "string" === typeof fn2.constructor.name) return fn2.constructor.name;
36954
- var named = fn2.toString(), type = toString.call(fn2).slice(8, -1);
36947
+ module2.exports = function name(fn) {
36948
+ if ("string" === typeof fn.displayName && fn.constructor.name) {
36949
+ return fn.displayName;
36950
+ } else if ("string" === typeof fn.name && fn.name) {
36951
+ return fn.name;
36952
+ }
36953
+ if ("object" === typeof fn && fn.constructor && "string" === typeof fn.constructor.name) return fn.constructor.name;
36954
+ var named = fn.toString(), type = toString.call(fn).slice(8, -1);
36955
36955
  if ("Function" === type) {
36956
36956
  named = named.substring(named.indexOf("(") + 1, named.indexOf(")"));
36957
36957
  } else {
@@ -36967,16 +36967,16 @@ var require_one_time = __commonJS({
36967
36967
  "../../node_modules/one-time/index.js"(exports2, module2) {
36968
36968
  "use strict";
36969
36969
  var name = require_fn();
36970
- module2.exports = function one(fn2) {
36970
+ module2.exports = function one(fn) {
36971
36971
  var called = 0, value;
36972
36972
  function onetime() {
36973
36973
  if (called) return value;
36974
36974
  called = 1;
36975
- value = fn2.apply(this, arguments);
36976
- fn2 = null;
36975
+ value = fn.apply(this, arguments);
36976
+ fn = null;
36977
36977
  return value;
36978
36978
  }
36979
- onetime.displayName = name(fn2);
36979
+ onetime.displayName = name(fn);
36980
36980
  return onetime;
36981
36981
  };
36982
36982
  }
@@ -37150,7 +37150,7 @@ var require_exception_stream = __commonJS({
37150
37150
  var require_exception_handler = __commonJS({
37151
37151
  "../../node_modules/winston/lib/winston/exception-handler.js"(exports2, module2) {
37152
37152
  "use strict";
37153
- var os2 = require("os");
37153
+ var os = require("os");
37154
37154
  var asyncForEach = require_forEach();
37155
37155
  var debug = require_node2()("winston:exception");
37156
37156
  var once = require_one_time();
@@ -37245,8 +37245,8 @@ var require_exception_handler = __commonJS({
37245
37245
  */
37246
37246
  getOsInfo() {
37247
37247
  return {
37248
- loadavg: os2.loadavg(),
37249
- uptime: os2.uptime()
37248
+ loadavg: os.loadavg(),
37249
+ uptime: os.uptime()
37250
37250
  };
37251
37251
  }
37252
37252
  /**
@@ -37388,7 +37388,7 @@ var require_rejection_stream = __commonJS({
37388
37388
  var require_rejection_handler = __commonJS({
37389
37389
  "../../node_modules/winston/lib/winston/rejection-handler.js"(exports2, module2) {
37390
37390
  "use strict";
37391
- var os2 = require("os");
37391
+ var os = require("os");
37392
37392
  var asyncForEach = require_forEach();
37393
37393
  var debug = require_node2()("winston:rejection");
37394
37394
  var once = require_one_time();
@@ -37485,8 +37485,8 @@ var require_rejection_handler = __commonJS({
37485
37485
  */
37486
37486
  getOsInfo() {
37487
37487
  return {
37488
- loadavg: os2.loadavg(),
37489
- uptime: os2.uptime()
37488
+ loadavg: os.loadavg(),
37489
+ uptime: os.uptime()
37490
37490
  };
37491
37491
  }
37492
37492
  /**
@@ -39100,7 +39100,7 @@ var require_dcmjs_dimse_min = __commonJS({
39100
39100
  return o3.setDataset(new a2(r9)), o3.getCommandDataset().setElement("MoveDestination", e3), o3;
39101
39101
  }
39102
39102
  }
39103
- class A extends p2 {
39103
+ class A2 extends p2 {
39104
39104
  constructor(e3, t3) {
39105
39105
  super(n2.CMoveResponse, r8.StudyRootQueryRetrieveInformationModelMove, false, e3, t3);
39106
39106
  }
@@ -39118,7 +39118,7 @@ var require_dcmjs_dimse_min = __commonJS({
39118
39118
  }
39119
39119
  static fromRequest(e3) {
39120
39120
  if (!(e3 instanceof P2)) throw new Error("Request should be an instance of CMoveRequest");
39121
- const t3 = new A(o2.ProcessingFailure);
39121
+ const t3 = new A2(o2.ProcessingFailure);
39122
39122
  return t3.setMessageIdBeingRespondedTo(e3.getMessageId()), t3;
39123
39123
  }
39124
39124
  }
@@ -39151,7 +39151,7 @@ var require_dcmjs_dimse_min = __commonJS({
39151
39151
  return r9.setDataset(new a2(i3)), r9;
39152
39152
  }
39153
39153
  }
39154
- class w3 extends p2 {
39154
+ class w2 extends p2 {
39155
39155
  constructor(e3, t3) {
39156
39156
  super(n2.CGetResponse, r8.StudyRootQueryRetrieveInformationModelGet, false, e3, t3);
39157
39157
  }
@@ -39169,7 +39169,7 @@ var require_dcmjs_dimse_min = __commonJS({
39169
39169
  }
39170
39170
  static fromRequest(e3) {
39171
39171
  if (!(e3 instanceof v)) throw new Error("Request should be an instance of CGetRequest");
39172
- const t3 = new w3(o2.ProcessingFailure);
39172
+ const t3 = new w2(o2.ProcessingFailure);
39173
39173
  return t3.setMessageIdBeingRespondedTo(e3.getMessageId()), t3;
39174
39174
  }
39175
39175
  }
@@ -39323,7 +39323,7 @@ var require_dcmjs_dimse_min = __commonJS({
39323
39323
  return new F2(e3.getAffectedSopClassUid(), e3.getMessageId());
39324
39324
  }
39325
39325
  }
39326
- e2.exports = { CCancelRequest: F2, CEchoRequest: R2, CEchoResponse: S2, CFindRequest: f2, CFindResponse: y2, CGetRequest: v, CGetResponse: w3, CMoveRequest: P2, CMoveResponse: A, Command: g2, CStoreRequest: I2, CStoreResponse: C2, NActionRequest: q2, NActionResponse: D2, NCreateRequest: x2, NCreateResponse: U2, NDeleteRequest: E2, NDeleteResponse: T, NEventReportRequest: b2, NEventReportResponse: O2, NGetRequest: N2, NGetResponse: B2, NSetRequest: M3, NSetResponse: L2, Request: l3, Response: p2 };
39326
+ e2.exports = { CCancelRequest: F2, CEchoRequest: R2, CEchoResponse: S2, CFindRequest: f2, CFindResponse: y2, CGetRequest: v, CGetResponse: w2, CMoveRequest: P2, CMoveResponse: A2, Command: g2, CStoreRequest: I2, CStoreResponse: C2, NActionRequest: q2, NActionResponse: D2, NCreateRequest: x2, NCreateResponse: U2, NDeleteRequest: E2, NDeleteResponse: T, NEventReportRequest: b2, NEventReportResponse: O2, NGetRequest: N2, NGetResponse: B2, NSetRequest: M3, NSetResponse: L2, Request: l3, Response: p2 };
39327
39327
  }, 492: (e2) => {
39328
39328
  const t2 = { AAbort: 7, AAssociateAC: 2, AAssociateRJ: 3, AAssociateRQ: 1, AReleaseRP: 6, AReleaseRQ: 5, PDataTF: 4 };
39329
39329
  Object.freeze(t2);
@@ -39447,7 +39447,7 @@ var require_dcmjs_dimse_min = __commonJS({
39447
39447
  }
39448
39448
  };
39449
39449
  }, 371: (e2, t2, s2) => {
39450
- const { Association: n2 } = s2(570), { AAbort: i2, AAssociateAC: r8, AAssociateRJ: o2, AAssociateRQ: a2, AReleaseRP: c, AReleaseRQ: d3, PDataTF: u2, Pdv: h2, RawPdu: m2 } = s2(942), { CommandFieldType: g2, RawPduType: l3, Status: p2, TranscodableTransferSyntaxes: R2 } = s2(492), { CCancelRequest: S2, CEchoRequest: f2, CEchoResponse: y2, CFindRequest: I2, CFindResponse: C2, CGetRequest: P2, CGetResponse: A, CMoveRequest: v, CMoveResponse: w3, Command: x2, CStoreRequest: U2, CStoreResponse: q2, NActionRequest: D2, NActionResponse: E2, NCreateRequest: T, NCreateResponse: b2, NDeleteRequest: O2, NDeleteResponse: N2, NEventReportRequest: B2, NEventReportResponse: M3, NGetRequest: L2, NGetResponse: F2, NSetRequest: k2, NSetResponse: $2, Response: j2 } = s2(940), V2 = s2(825), _ = s2(139), G2 = s2(906), z2 = s2(547), { SmartBuffer: Q } = s2(766), { EOL: W } = s2(857), J2 = s2(733);
39450
+ const { Association: n2 } = s2(570), { AAbort: i2, AAssociateAC: r8, AAssociateRJ: o2, AAssociateRQ: a2, AReleaseRP: c, AReleaseRQ: d3, PDataTF: u2, Pdv: h2, RawPdu: m2 } = s2(942), { CommandFieldType: g2, RawPduType: l3, Status: p2, TranscodableTransferSyntaxes: R2 } = s2(492), { CCancelRequest: S2, CEchoRequest: f2, CEchoResponse: y2, CFindRequest: I2, CFindResponse: C2, CGetRequest: P2, CGetResponse: A2, CMoveRequest: v, CMoveResponse: w2, Command: x2, CStoreRequest: U2, CStoreResponse: q2, NActionRequest: D2, NActionResponse: E2, NCreateRequest: T, NCreateResponse: b2, NDeleteRequest: O2, NDeleteResponse: N2, NEventReportRequest: B2, NEventReportResponse: M3, NGetRequest: L2, NGetResponse: F2, NSetRequest: k2, NSetResponse: $2, Response: j } = s2(940), V2 = s2(825), _ = s2(139), G2 = s2(906), z2 = s2(547), { SmartBuffer: Q } = s2(766), { EOL: W2 } = s2(857), J2 = s2(733);
39451
39451
  class X2 extends J2 {
39452
39452
  constructor() {
39453
39453
  super();
@@ -39488,12 +39488,12 @@ var require_dcmjs_dimse_min = __commonJS({
39488
39488
  sendAssociationRequest(e3) {
39489
39489
  this.association = e3;
39490
39490
  const t3 = new a2(this.association).write();
39491
- this.logId = this.association.getCalledAeTitle(), z2.info(`${this.logId} -> Association request:${W}${this.association.toString()}`), this._sendPdu(t3);
39491
+ this.logId = this.association.getCalledAeTitle(), z2.info(`${this.logId} -> Association request:${W2}${this.association.toString()}`), this._sendPdu(t3);
39492
39492
  }
39493
39493
  sendAssociationAccept() {
39494
39494
  this.association.setImplementationClassUid(_.getImplementationClassUid()), this.association.setImplementationVersion(_.getImplementationVersion()), this.association.setMaxPduLength(Math.min(this.association.getMaxPduLength(), _.getMaxPduLength()));
39495
39495
  const e3 = new r8(this.association).write();
39496
- z2.info(`${this.logId} -> Association accept:${W}${this.association.toString()}`), this._sendPdu(e3);
39496
+ z2.info(`${this.logId} -> Association accept:${W2}${this.association.toString()}`), this._sendPdu(e3);
39497
39497
  }
39498
39498
  sendAssociationReject(e3, t3, s3) {
39499
39499
  const n3 = new o2(e3, t3, s3), i3 = n3.write();
@@ -39591,10 +39591,10 @@ var require_dcmjs_dimse_min = __commonJS({
39591
39591
  try {
39592
39592
  switch (t3.readPdu(), t3.getType()) {
39593
39593
  case l3.AAssociateRQ:
39594
- this.association = new n2(), new a2(this.association).read(t3), this.logId = this.association.getCallingAeTitle(), z2.info(`${this.logId} <- Association request:${W}${this.association.toString()}`), this.emit("associationRequested", this.association);
39594
+ this.association = new n2(), new a2(this.association).read(t3), this.logId = this.association.getCallingAeTitle(), z2.info(`${this.logId} <- Association request:${W2}${this.association.toString()}`), this.emit("associationRequested", this.association);
39595
39595
  break;
39596
39596
  case l3.AAssociateAC:
39597
- new r8(this.association).read(t3), this.logId = this.association.getCalledAeTitle(), z2.info(`${this.logId} <- Association accept:${W}${this.association.toString()}`), this.emit("associationAccepted", this.association);
39597
+ new r8(this.association).read(t3), this.logId = this.association.getCalledAeTitle(), z2.info(`${this.logId} <- Association accept:${W2}${this.association.toString()}`), this.emit("associationAccepted", this.association);
39598
39598
  break;
39599
39599
  case l3.AAssociateRJ: {
39600
39600
  const e4 = new o2();
@@ -39656,13 +39656,13 @@ var require_dcmjs_dimse_min = __commonJS({
39656
39656
  this.dimse = Object.assign(new v(), s3);
39657
39657
  break;
39658
39658
  case g2.CMoveResponse:
39659
- this.dimse = Object.assign(new w3(), s3);
39659
+ this.dimse = Object.assign(new w2(), s3);
39660
39660
  break;
39661
39661
  case g2.CGetRequest:
39662
39662
  this.dimse = Object.assign(new P2(), s3);
39663
39663
  break;
39664
39664
  case g2.CGetResponse:
39665
- this.dimse = Object.assign(new A(), s3);
39665
+ this.dimse = Object.assign(new A2(), s3);
39666
39666
  break;
39667
39667
  case g2.NCreateRequest:
39668
39668
  this.dimse = Object.assign(new T(), s3);
@@ -39718,7 +39718,7 @@ var require_dcmjs_dimse_min = __commonJS({
39718
39718
  }
39719
39719
  }
39720
39720
  _performDimse(e3, t3) {
39721
- if (t3 instanceof j2) {
39721
+ if (t3 instanceof j) {
39722
39722
  const e4 = Object.assign(Object.create(Object.getPrototypeOf(t3)), t3), s3 = this.pending.find((e5) => e5.getMessageId() === t3.getMessageIdBeingRespondedTo());
39723
39723
  s3 && (s3.raiseResponseEvent(e4), e4.getStatus() !== p2.Pending && s3.raiseDoneEvent());
39724
39724
  } else t3.getCommandFieldType() === g2.CEchoRequest ? this.emit("cEchoRequest", t3, (t4) => {
@@ -40357,7 +40357,7 @@ var require_dcmjs_dimse_min = __commonJS({
40357
40357
  }
40358
40358
  };
40359
40359
  }, 237: (e2, t2, s2) => {
40360
- const { Association: n2, PresentationContext: i2 } = s2(570), { Scp: r8, Server: o2 } = s2(538), { CCancelRequest: a2, CEchoRequest: c, CEchoResponse: d3, CFindRequest: u2, CFindResponse: h2, CGetRequest: m2, CGetResponse: g2, CMoveRequest: l3, CMoveResponse: p2, CStoreRequest: R2, CStoreResponse: S2, NActionRequest: f2, NActionResponse: y2, NCreateRequest: I2, NCreateResponse: C2, NDeleteRequest: P2, NDeleteResponse: A, NEventReportRequest: v, NEventReportResponse: w3, NGetRequest: x2, NGetResponse: U2, NSetRequest: q2, NSetResponse: D2 } = s2(940), { AbortReason: E2, AbortSource: T, CommandFieldType: b2, PresentationContextResult: O2, Priority: N2, RawPduType: B2, RejectReason: M3, RejectResult: L2, RejectSource: F2, SopClass: k2, Status: $2, StorageClass: j2, TransferSyntax: V2, Uid: _, UserIdentityType: G2 } = s2(492), z2 = s2(422), Q = s2(825), W = s2(139), J2 = s2(906), X2 = { association: { Association: n2, PresentationContext: i2 }, Client: z2, constants: { AbortReason: E2, AbortSource: T, CommandFieldType: b2, PresentationContextResult: O2, Priority: N2, RawPduType: B2, RejectReason: M3, RejectResult: L2, RejectSource: F2, SopClass: k2, Status: $2, StorageClass: j2, TransferSyntax: V2, Uid: _, UserIdentityType: G2 }, Dataset: Q, Implementation: W, log: s2(547), requests: { CCancelRequest: a2, CEchoRequest: c, CFindRequest: u2, CGetRequest: m2, CMoveRequest: l3, CStoreRequest: R2, NActionRequest: f2, NCreateRequest: I2, NDeleteRequest: P2, NEventReportRequest: v, NGetRequest: x2, NSetRequest: q2 }, responses: { CEchoResponse: d3, CFindResponse: h2, CGetResponse: g2, CMoveResponse: p2, CStoreResponse: S2, NActionResponse: y2, NCreateResponse: C2, NDeleteResponse: A, NEventReportResponse: w3, NGetResponse: U2, NSetResponse: D2 }, Scp: r8, Server: o2, Statistics: J2, version: s2(837) };
40360
+ const { Association: n2, PresentationContext: i2 } = s2(570), { Scp: r8, Server: o2 } = s2(538), { CCancelRequest: a2, CEchoRequest: c, CEchoResponse: d3, CFindRequest: u2, CFindResponse: h2, CGetRequest: m2, CGetResponse: g2, CMoveRequest: l3, CMoveResponse: p2, CStoreRequest: R2, CStoreResponse: S2, NActionRequest: f2, NActionResponse: y2, NCreateRequest: I2, NCreateResponse: C2, NDeleteRequest: P2, NDeleteResponse: A2, NEventReportRequest: v, NEventReportResponse: w2, NGetRequest: x2, NGetResponse: U2, NSetRequest: q2, NSetResponse: D2 } = s2(940), { AbortReason: E2, AbortSource: T, CommandFieldType: b2, PresentationContextResult: O2, Priority: N2, RawPduType: B2, RejectReason: M3, RejectResult: L2, RejectSource: F2, SopClass: k2, Status: $2, StorageClass: j, TransferSyntax: V2, Uid: _, UserIdentityType: G2 } = s2(492), z2 = s2(422), Q = s2(825), W2 = s2(139), J2 = s2(906), X2 = { association: { Association: n2, PresentationContext: i2 }, Client: z2, constants: { AbortReason: E2, AbortSource: T, CommandFieldType: b2, PresentationContextResult: O2, Priority: N2, RawPduType: B2, RejectReason: M3, RejectResult: L2, RejectSource: F2, SopClass: k2, Status: $2, StorageClass: j, TransferSyntax: V2, Uid: _, UserIdentityType: G2 }, Dataset: Q, Implementation: W2, log: s2(547), requests: { CCancelRequest: a2, CEchoRequest: c, CFindRequest: u2, CGetRequest: m2, CMoveRequest: l3, CStoreRequest: R2, NActionRequest: f2, NCreateRequest: I2, NDeleteRequest: P2, NEventReportRequest: v, NGetRequest: x2, NSetRequest: q2 }, responses: { CEchoResponse: d3, CFindResponse: h2, CGetResponse: g2, CMoveResponse: p2, CStoreResponse: S2, NActionResponse: y2, NCreateResponse: C2, NDeleteResponse: A2, NEventReportResponse: w2, NGetResponse: U2, NSetResponse: D2 }, Scp: r8, Server: o2, Statistics: J2, version: s2(837) };
40361
40361
  e2.exports = X2;
40362
40362
  }, 547: (e2, t2, s2) => {
40363
40363
  const { createLogger: n2, format: i2, transports: r8 } = s2(688), { combine: o2, printf: a2, timestamp: c } = i2, d3 = n2({ format: o2(c(), a2(({ level: e3, message: t3, timestamp: s3 }) => `${s3} -- ${e3.toUpperCase()} -- ${t3}`)), transports: [new r8.Console()] });
@@ -40410,7 +40410,7 @@ __export(main_exports, {
40410
40410
  module.exports = __toCommonJS(main_exports);
40411
40411
 
40412
40412
  // ../core/dist/esm/index.mjs
40413
- var ze = class {
40413
+ var Ye = class {
40414
40414
  constructor(e, t) {
40415
40415
  this.operator = e;
40416
40416
  this.child = t;
@@ -40429,7 +40429,7 @@ var Y = class {
40429
40429
  return `${this.left.toString()} ${this.operator} ${this.right.toString()}`;
40430
40430
  }
40431
40431
  };
40432
- var Je = class {
40432
+ var Ze = class {
40433
40433
  constructor() {
40434
40434
  this.prefixParselets = {};
40435
40435
  this.infixParselets = {};
@@ -40453,10 +40453,10 @@ var Je = class {
40453
40453
  }, precedence: t });
40454
40454
  }
40455
40455
  construct(e) {
40456
- return new Kt(e, this.prefixParselets, this.infixParselets);
40456
+ return new zt(e, this.prefixParselets, this.infixParselets);
40457
40457
  }
40458
40458
  };
40459
- var Kt = class {
40459
+ var zt = class {
40460
40460
  constructor(e, t, n) {
40461
40461
  this.tokens = e, this.prefixParselets = t, this.infixParselets = n;
40462
40462
  }
@@ -40504,100 +40504,100 @@ var Kt = class {
40504
40504
  return this.infixParselets[e.id === "Symbol" ? e.value : e.id];
40505
40505
  }
40506
40506
  };
40507
- var zt = "ok";
40508
- var Ye = "created";
40509
- var Yt = "not-modified";
40510
- var Zt = "not-found";
40511
- var er = "unauthorized";
40512
- var Ze = "accepted";
40513
- var on = { resourceType: "OperationOutcome", id: Zt, issue: [{ severity: "error", code: "not-found", details: { text: "Not found" } }] };
40514
- var Ee = { resourceType: "OperationOutcome", id: er, issue: [{ severity: "error", code: "login", details: { text: "Unauthorized" } }] };
40515
- var sn = { ...Ee, issue: [...Ee.issue, { severity: "error", code: "expired", details: { text: "Token expired" } }] };
40516
- var tr = { ...Ee, issue: [...Ee.issue, { severity: "error", code: "invalid", details: { text: "Token not issued for this audience" } }] };
40507
+ var Jt = "ok";
40508
+ var Xe = "created";
40509
+ var Zt = "not-modified";
40510
+ var Xt = "not-found";
40511
+ var tr = "unauthorized";
40512
+ var et = "accepted";
40513
+ var cn = { resourceType: "OperationOutcome", id: Xt, issue: [{ severity: "error", code: "not-found", details: { text: "Not found" } }] };
40514
+ var Ee = { resourceType: "OperationOutcome", id: tr, issue: [{ severity: "error", code: "login", details: { text: "Unauthorized" } }] };
40515
+ var un = { ...Ee, issue: [...Ee.issue, { severity: "error", code: "expired", details: { text: "Token expired" } }] };
40516
+ var rr = { ...Ee, issue: [...Ee.issue, { severity: "error", code: "invalid", details: { text: "Token not issued for this audience" } }] };
40517
40517
  function E(r7, e) {
40518
40518
  return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "invalid", details: { text: r7 }, ...e ? { expression: [e] } : void 0 }] };
40519
40519
  }
40520
40520
  function h(r7) {
40521
40521
  return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "structure", details: { text: r7 } }] };
40522
40522
  }
40523
- function an(r7) {
40523
+ function ln(r7) {
40524
40524
  return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "exception", details: { text: "Internal server error" }, diagnostics: r7.toString() }] };
40525
40525
  }
40526
40526
  function be(r7) {
40527
40527
  return typeof r7 == "object" && r7 !== null && r7.resourceType === "OperationOutcome";
40528
40528
  }
40529
- function rr(r7) {
40530
- return r7.id === zt || r7.id === Ye || r7.id === Yt || r7.id === Ze;
40529
+ function nr(r7) {
40530
+ return r7.id === Jt || r7.id === Xe || r7.id === Zt || r7.id === et;
40531
40531
  }
40532
40532
  var d = class extends Error {
40533
40533
  constructor(e, t) {
40534
- super(cn(e)), this.outcome = e, this.cause = t;
40534
+ super(pn(e)), this.outcome = e, this.cause = t;
40535
40535
  }
40536
40536
  };
40537
- function Xe(r7) {
40538
- return r7 instanceof d ? r7.outcome : be(r7) ? r7 : E(Ne(r7));
40537
+ function tt(r7) {
40538
+ return r7 instanceof d ? r7.outcome : be(r7) ? r7 : E(Re(r7));
40539
40539
  }
40540
- function Ne(r7) {
40541
- return r7 ? typeof r7 == "string" ? r7 : r7 instanceof Error ? r7.message : be(r7) ? cn(r7) : typeof r7 == "object" && "code" in r7 && typeof r7.code == "string" ? r7.code : JSON.stringify(r7) : "Unknown error";
40540
+ function Re(r7) {
40541
+ return r7 ? typeof r7 == "string" ? r7 : r7 instanceof Error ? r7.message : be(r7) ? pn(r7) : typeof r7 == "object" && "code" in r7 && typeof r7.code == "string" ? r7.code : JSON.stringify(r7) : "Unknown error";
40542
40542
  }
40543
- function cn(r7) {
40544
- let e = r7.issue?.map(Yi) ?? [];
40543
+ function pn(r7) {
40544
+ let e = r7.issue?.map(eo) ?? [];
40545
40545
  return e.length > 0 ? e.join("; ") : "Unknown error";
40546
40546
  }
40547
- function Yi(r7) {
40547
+ function eo(r7) {
40548
40548
  let e;
40549
40549
  return r7.details?.text ? r7.diagnostics ? e = `${r7.details.text} (${r7.diagnostics})` : e = r7.details.text : r7.diagnostics ? e = r7.diagnostics : e = "Unknown error", r7.expression?.length && (e += ` (${r7.expression.join(", ")})`), e;
40550
40550
  }
40551
- function Xi(r7, e) {
40551
+ function ro(r7, e) {
40552
40552
  let t = e.max && e.max === Number.MAX_SAFE_INTEGER ? Number.POSITIVE_INFINITY : e.max;
40553
40553
  return { path: r7, description: "", type: e.type ?? [], min: e.min ?? 0, max: t ?? 1, isArray: !!t && t > 1, constraints: [] };
40554
40554
  }
40555
- function pn(r7) {
40555
+ function mn(r7) {
40556
40556
  let e = /* @__PURE__ */ Object.create(null);
40557
- for (let [t, n] of Object.entries(r7)) e[t] = { name: t, type: t, path: t, elements: Object.fromEntries(Object.entries(n.elements).map(([i, o]) => [i, Xi(i, o)])), constraints: [], innerTypes: [] };
40557
+ for (let [t, n] of Object.entries(r7)) e[t] = { name: t, type: t, path: t, elements: Object.fromEntries(Object.entries(n.elements).map(([i, o]) => [i, ro(i, o)])), constraints: [], innerTypes: [] };
40558
40558
  return e;
40559
40559
  }
40560
- var dn = { Element: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, BackboneElement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, Address: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, line: { max: 9007199254740991, type: [{ code: "string" }] }, city: { type: [{ code: "string" }] }, district: { type: [{ code: "string" }] }, state: { type: [{ code: "string" }] }, postalCode: { type: [{ code: "string" }] }, country: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Age: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Annotation: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "author[x]": { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Organization"] }, { code: "string" }] }, time: { type: [{ code: "dateTime" }] }, text: { min: 1, type: [{ code: "markdown" }] } } }, Attachment: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, contentType: { type: [{ code: "code" }] }, language: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] }, url: { type: [{ code: "url" }] }, size: { type: [{ code: "unsignedInt" }] }, hash: { type: [{ code: "base64Binary" }] }, title: { type: [{ code: "string" }] }, creation: { type: [{ code: "dateTime" }] } } }, CodeableConcept: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, coding: { max: 9007199254740991, type: [{ code: "Coding" }] }, text: { type: [{ code: "string" }] } } }, Coding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "uri" }] }, version: { type: [{ code: "string" }] }, code: { type: [{ code: "code" }] }, display: { type: [{ code: "string" }] }, userSelected: { type: [{ code: "boolean" }] } } }, ContactDetail: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "string" }] }, telecom: { max: 9007199254740991, type: [{ code: "ContactPoint" }] } } }, ContactPoint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "code" }] }, value: { type: [{ code: "string" }] }, use: { type: [{ code: "code" }] }, rank: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "Period" }] } } }, Contributor: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { min: 1, type: [{ code: "string" }] }, contact: { max: 9007199254740991, type: [{ code: "ContactDetail" }] } } }, Count: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, DataRequirement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, "subject[x]": { type: [{ code: "CodeableConcept" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Group"] }] }, mustSupport: { max: 9007199254740991, type: [{ code: "string" }] }, codeFilter: { max: 9007199254740991, type: [{ code: "DataRequirementCodeFilter" }] }, dateFilter: { max: 9007199254740991, type: [{ code: "DataRequirementDateFilter" }] }, limit: { type: [{ code: "positiveInt" }] }, sort: { max: 9007199254740991, type: [{ code: "DataRequirementSort" }] } } }, DataRequirementCodeFilter: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, valueSet: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/ValueSet"] }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] } } }, DataRequirementDateFilter: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, "value[x]": { type: [{ code: "dateTime" }, { code: "Period" }, { code: "Duration" }] } } }, DataRequirementSort: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, direction: { min: 1, type: [{ code: "code" }] } } }, Distance: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Dosage: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, sequence: { type: [{ code: "integer" }] }, text: { type: [{ code: "string" }] }, additionalInstruction: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] }, patientInstruction: { type: [{ code: "string" }] }, timing: { type: [{ code: "Timing" }] }, "asNeeded[x]": { type: [{ code: "boolean" }, { code: "CodeableConcept" }] }, site: { type: [{ code: "CodeableConcept" }] }, route: { type: [{ code: "CodeableConcept" }] }, method: { type: [{ code: "CodeableConcept" }] }, doseAndRate: { max: 9007199254740991, type: [{ code: "DosageDoseAndRate" }] }, maxDosePerPeriod: { type: [{ code: "Ratio" }] }, maxDosePerAdministration: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, maxDosePerLifetime: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, DosageDoseAndRate: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { type: [{ code: "CodeableConcept" }] }, "dose[x]": { type: [{ code: "Range" }, { code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, "rate[x]": { type: [{ code: "Ratio" }, { code: "Range" }, { code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Duration: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, ElementDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, representation: { max: 9007199254740991, type: [{ code: "code" }] }, sliceName: { type: [{ code: "string" }] }, sliceIsConstraining: { type: [{ code: "boolean" }] }, label: { type: [{ code: "string" }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] }, slicing: { type: [{ code: "ElementDefinitionSlicing" }] }, short: { type: [{ code: "string" }] }, definition: { type: [{ code: "markdown" }] }, comment: { type: [{ code: "markdown" }] }, requirements: { type: [{ code: "markdown" }] }, alias: { max: 9007199254740991, type: [{ code: "string" }] }, min: { type: [{ code: "unsignedInt" }] }, max: { type: [{ code: "string" }] }, base: { type: [{ code: "ElementDefinitionBase" }] }, contentReference: { type: [{ code: "uri" }] }, type: { max: 9007199254740991, type: [{ code: "ElementDefinitionType" }] }, "defaultValue[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, meaningWhenMissing: { type: [{ code: "markdown" }] }, orderMeaning: { type: [{ code: "string" }] }, "fixed[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, "pattern[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, example: { max: 9007199254740991, type: [{ code: "ElementDefinitionExample" }] }, "minValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, "maxValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, maxLength: { type: [{ code: "integer" }] }, condition: { max: 9007199254740991, type: [{ code: "id" }] }, constraint: { max: 9007199254740991, type: [{ code: "ElementDefinitionConstraint" }] }, mustSupport: { type: [{ code: "boolean" }] }, isModifier: { type: [{ code: "boolean" }] }, isModifierReason: { type: [{ code: "string" }] }, isSummary: { type: [{ code: "boolean" }] }, binding: { type: [{ code: "ElementDefinitionBinding" }] }, mapping: { max: 9007199254740991, type: [{ code: "ElementDefinitionMapping" }] } } }, ElementDefinitionSlicingDiscriminator: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, path: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionSlicing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, discriminator: { max: 9007199254740991, type: [{ code: "ElementDefinitionSlicingDiscriminator" }] }, description: { type: [{ code: "string" }] }, ordered: { type: [{ code: "boolean" }] }, rules: { min: 1, type: [{ code: "code" }] } } }, ElementDefinitionBase: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, min: { min: 1, type: [{ code: "unsignedInt" }] }, max: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionType: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, targetProfile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, aggregation: { max: 9007199254740991, type: [{ code: "code" }] }, versioning: { type: [{ code: "code" }] } } }, ElementDefinitionExample: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, label: { min: 1, type: [{ code: "string" }] }, "value[x]": { min: 1, type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, ElementDefinitionConstraint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, key: { min: 1, type: [{ code: "id" }] }, requirements: { type: [{ code: "string" }] }, severity: { min: 1, type: [{ code: "code" }] }, human: { min: 1, type: [{ code: "string" }] }, expression: { type: [{ code: "string" }] }, xpath: { type: [{ code: "string" }] }, source: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, ElementDefinitionBinding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, strength: { min: 1, type: [{ code: "code" }] }, description: { type: [{ code: "string" }] }, valueSet: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/ValueSet"] }] } } }, ElementDefinitionMapping: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identity: { min: 1, type: [{ code: "id" }] }, language: { type: [{ code: "code" }] }, map: { min: 1, type: [{ code: "string" }] }, comment: { type: [{ code: "string" }] } } }, Expression: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, description: { type: [{ code: "string" }] }, name: { type: [{ code: "id" }] }, language: { min: 1, type: [{ code: "code" }] }, expression: { type: [{ code: "string" }] }, reference: { type: [{ code: "uri" }] } } }, Extension: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, url: { min: 1, type: [{ code: "uri" }] }, "value[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, HumanName: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, family: { type: [{ code: "string" }] }, given: { max: 9007199254740991, type: [{ code: "string" }] }, prefix: { max: 9007199254740991, type: [{ code: "string" }] }, suffix: { max: 9007199254740991, type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Identifier: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "CodeableConcept" }] }, system: { type: [{ code: "uri" }] }, value: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] }, assigner: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MarketingStatus: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, country: { min: 1, type: [{ code: "CodeableConcept" }] }, jurisdiction: { type: [{ code: "CodeableConcept" }] }, status: { min: 1, type: [{ code: "CodeableConcept" }] }, dateRange: { min: 1, type: [{ code: "Period" }] }, restoreDate: { type: [{ code: "dateTime" }] } } }, Meta: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, versionId: { type: [{ code: "id" }] }, lastUpdated: { type: [{ code: "instant" }] }, source: { type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, security: { max: 9007199254740991, type: [{ code: "Coding" }] }, tag: { max: 9007199254740991, type: [{ code: "Coding" }] }, project: { type: [{ code: "uri" }] }, author: { type: [{ code: "Reference" }] }, onBehalfOf: { type: [{ code: "Reference" }] }, account: { type: [{ code: "Reference" }] }, accounts: { max: 9007199254740991, type: [{ code: "Reference" }] }, compartment: { max: 9007199254740991, type: [{ code: "Reference" }] } } }, Money: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, currency: { type: [{ code: "code" }] } } }, Narrative: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, status: { min: 1, type: [{ code: "code" }] }, div: { min: 1, type: [{ code: "xhtml" }] } } }, ParameterDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "code" }] }, use: { min: 1, type: [{ code: "code" }] }, min: { type: [{ code: "integer" }] }, max: { type: [{ code: "string" }] }, documentation: { type: [{ code: "string" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, Period: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, start: { type: [{ code: "dateTime" }] }, end: { type: [{ code: "dateTime" }] } } }, Population: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "age[x]": { type: [{ code: "Range" }, { code: "CodeableConcept" }] }, gender: { type: [{ code: "CodeableConcept" }] }, race: { type: [{ code: "CodeableConcept" }] }, physiologicalCondition: { type: [{ code: "CodeableConcept" }] } } }, ProdCharacteristic: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, height: { type: [{ code: "Quantity" }] }, width: { type: [{ code: "Quantity" }] }, depth: { type: [{ code: "Quantity" }] }, weight: { type: [{ code: "Quantity" }] }, nominalVolume: { type: [{ code: "Quantity" }] }, externalDiameter: { type: [{ code: "Quantity" }] }, shape: { type: [{ code: "string" }] }, color: { max: 9007199254740991, type: [{ code: "string" }] }, imprint: { max: 9007199254740991, type: [{ code: "string" }] }, image: { max: 9007199254740991, type: [{ code: "Attachment" }] }, scoring: { type: [{ code: "CodeableConcept" }] } } }, ProductShelfLife: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identifier: { type: [{ code: "Identifier" }] }, type: { min: 1, type: [{ code: "CodeableConcept" }] }, period: { min: 1, type: [{ code: "Quantity" }] }, specialPrecautionsForStorage: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] } } }, Quantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Range: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, low: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, high: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Ratio: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, numerator: { type: [{ code: "Quantity" }] }, denominator: { type: [{ code: "Quantity" }] } } }, Reference: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, reference: { type: [{ code: "string" }] }, type: { type: [{ code: "uri" }] }, identifier: { type: [{ code: "Identifier" }] }, display: { type: [{ code: "string" }] } } }, RelatedArtifact: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, label: { type: [{ code: "string" }] }, display: { type: [{ code: "string" }] }, citation: { type: [{ code: "markdown" }] }, url: { type: [{ code: "url" }] }, document: { type: [{ code: "Attachment" }] }, resource: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Resource"] }] } } }, SampledData: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, origin: { min: 1, type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, period: { min: 1, type: [{ code: "decimal" }] }, factor: { type: [{ code: "decimal" }] }, lowerLimit: { type: [{ code: "decimal" }] }, upperLimit: { type: [{ code: "decimal" }] }, dimensions: { min: 1, type: [{ code: "positiveInt" }] }, data: { type: [{ code: "string" }] } } }, Signature: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, max: 9007199254740991, type: [{ code: "Coding" }] }, when: { min: 1, type: [{ code: "instant" }] }, who: { min: 1, type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, onBehalfOf: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, targetFormat: { type: [{ code: "code" }] }, sigFormat: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] } } }, SubstanceAmount: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "amount[x]": { type: [{ code: "Quantity" }, { code: "Range" }, { code: "string" }] }, amountType: { type: [{ code: "CodeableConcept" }] }, amountText: { type: [{ code: "string" }] }, referenceRange: { type: [{ code: "SubstanceAmountReferenceRange" }] } } }, SubstanceAmountReferenceRange: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, lowLimit: { type: [{ code: "Quantity" }] }, highLimit: { type: [{ code: "Quantity" }] } } }, Timing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, event: { max: 9007199254740991, type: [{ code: "dateTime" }] }, repeat: { type: [{ code: "TimingRepeat" }] }, code: { type: [{ code: "CodeableConcept" }] } } }, TimingRepeat: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "bounds[x]": { type: [{ code: "Duration" }, { code: "Range" }, { code: "Period" }] }, count: { type: [{ code: "positiveInt" }] }, countMax: { type: [{ code: "positiveInt" }] }, duration: { type: [{ code: "decimal" }] }, durationMax: { type: [{ code: "decimal" }] }, durationUnit: { type: [{ code: "code" }] }, frequency: { type: [{ code: "positiveInt" }] }, frequencyMax: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "decimal" }] }, periodMax: { type: [{ code: "decimal" }] }, periodUnit: { type: [{ code: "code" }] }, dayOfWeek: { max: 9007199254740991, type: [{ code: "code" }] }, timeOfDay: { max: 9007199254740991, type: [{ code: "time" }] }, when: { max: 9007199254740991, type: [{ code: "code" }] }, offset: { type: [{ code: "unsignedInt" }] } } }, TriggerDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { type: [{ code: "string" }] }, "timing[x]": { type: [{ code: "Timing" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Schedule"] }, { code: "date" }, { code: "dateTime" }] }, data: { max: 9007199254740991, type: [{ code: "DataRequirement" }] }, condition: { type: [{ code: "Expression" }] } } }, UsageContext: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "Coding" }] }, "value[x]": { min: 1, type: [{ code: "CodeableConcept" }, { code: "Quantity" }, { code: "Range" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/PlanDefinition", "http://hl7.org/fhir/StructureDefinition/ResearchStudy", "http://hl7.org/fhir/StructureDefinition/InsurancePlan", "http://hl7.org/fhir/StructureDefinition/HealthcareService", "http://hl7.org/fhir/StructureDefinition/Group", "http://hl7.org/fhir/StructureDefinition/Location", "http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MoneyQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, SimpleQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { max: 0, type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, IdentityProvider: { elements: { authorizeUrl: { min: 1, type: [{ code: "string" }] }, tokenUrl: { min: 1, type: [{ code: "string" }] }, tokenAuthMethod: { type: [{ code: "code" }] }, userInfoUrl: { min: 1, type: [{ code: "string" }] }, clientId: { min: 1, type: [{ code: "string" }] }, clientSecret: { min: 1, type: [{ code: "string" }] }, usePkce: { type: [{ code: "boolean" }] }, useSubject: { type: [{ code: "boolean" }] } } } };
40561
- function sr(r7) {
40562
- return new ir(r7).parse();
40560
+ var hn = { Element: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, BackboneElement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, Address: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, line: { max: 9007199254740991, type: [{ code: "string" }] }, city: { type: [{ code: "string" }] }, district: { type: [{ code: "string" }] }, state: { type: [{ code: "string" }] }, postalCode: { type: [{ code: "string" }] }, country: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Age: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Annotation: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "author[x]": { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Organization"] }, { code: "string" }] }, time: { type: [{ code: "dateTime" }] }, text: { min: 1, type: [{ code: "markdown" }] } } }, Attachment: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, contentType: { type: [{ code: "code" }] }, language: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] }, url: { type: [{ code: "url" }] }, size: { type: [{ code: "unsignedInt" }] }, hash: { type: [{ code: "base64Binary" }] }, title: { type: [{ code: "string" }] }, creation: { type: [{ code: "dateTime" }] } } }, CodeableConcept: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, coding: { max: 9007199254740991, type: [{ code: "Coding" }] }, text: { type: [{ code: "string" }] } } }, Coding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "uri" }] }, version: { type: [{ code: "string" }] }, code: { type: [{ code: "code" }] }, display: { type: [{ code: "string" }] }, userSelected: { type: [{ code: "boolean" }] } } }, ContactDetail: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "string" }] }, telecom: { max: 9007199254740991, type: [{ code: "ContactPoint" }] } } }, ContactPoint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "code" }] }, value: { type: [{ code: "string" }] }, use: { type: [{ code: "code" }] }, rank: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "Period" }] } } }, Contributor: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { min: 1, type: [{ code: "string" }] }, contact: { max: 9007199254740991, type: [{ code: "ContactDetail" }] } } }, Count: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, DataRequirement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, "subject[x]": { type: [{ code: "CodeableConcept" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Group"] }] }, mustSupport: { max: 9007199254740991, type: [{ code: "string" }] }, codeFilter: { max: 9007199254740991, type: [{ code: "DataRequirementCodeFilter" }] }, dateFilter: { max: 9007199254740991, type: [{ code: "DataRequirementDateFilter" }] }, limit: { type: [{ code: "positiveInt" }] }, sort: { max: 9007199254740991, type: [{ code: "DataRequirementSort" }] } } }, DataRequirementCodeFilter: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, valueSet: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/ValueSet"] }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] } } }, DataRequirementDateFilter: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, "value[x]": { type: [{ code: "dateTime" }, { code: "Period" }, { code: "Duration" }] } } }, DataRequirementSort: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, direction: { min: 1, type: [{ code: "code" }] } } }, Distance: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Dosage: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, sequence: { type: [{ code: "integer" }] }, text: { type: [{ code: "string" }] }, additionalInstruction: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] }, patientInstruction: { type: [{ code: "string" }] }, timing: { type: [{ code: "Timing" }] }, "asNeeded[x]": { type: [{ code: "boolean" }, { code: "CodeableConcept" }] }, site: { type: [{ code: "CodeableConcept" }] }, route: { type: [{ code: "CodeableConcept" }] }, method: { type: [{ code: "CodeableConcept" }] }, doseAndRate: { max: 9007199254740991, type: [{ code: "DosageDoseAndRate" }] }, maxDosePerPeriod: { type: [{ code: "Ratio" }] }, maxDosePerAdministration: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, maxDosePerLifetime: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, DosageDoseAndRate: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { type: [{ code: "CodeableConcept" }] }, "dose[x]": { type: [{ code: "Range" }, { code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, "rate[x]": { type: [{ code: "Ratio" }, { code: "Range" }, { code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Duration: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, ElementDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, representation: { max: 9007199254740991, type: [{ code: "code" }] }, sliceName: { type: [{ code: "string" }] }, sliceIsConstraining: { type: [{ code: "boolean" }] }, label: { type: [{ code: "string" }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] }, slicing: { type: [{ code: "ElementDefinitionSlicing" }] }, short: { type: [{ code: "string" }] }, definition: { type: [{ code: "markdown" }] }, comment: { type: [{ code: "markdown" }] }, requirements: { type: [{ code: "markdown" }] }, alias: { max: 9007199254740991, type: [{ code: "string" }] }, min: { type: [{ code: "unsignedInt" }] }, max: { type: [{ code: "string" }] }, base: { type: [{ code: "ElementDefinitionBase" }] }, contentReference: { type: [{ code: "uri" }] }, type: { max: 9007199254740991, type: [{ code: "ElementDefinitionType" }] }, "defaultValue[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, meaningWhenMissing: { type: [{ code: "markdown" }] }, orderMeaning: { type: [{ code: "string" }] }, "fixed[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, "pattern[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, example: { max: 9007199254740991, type: [{ code: "ElementDefinitionExample" }] }, "minValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, "maxValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, maxLength: { type: [{ code: "integer" }] }, condition: { max: 9007199254740991, type: [{ code: "id" }] }, constraint: { max: 9007199254740991, type: [{ code: "ElementDefinitionConstraint" }] }, mustSupport: { type: [{ code: "boolean" }] }, isModifier: { type: [{ code: "boolean" }] }, isModifierReason: { type: [{ code: "string" }] }, isSummary: { type: [{ code: "boolean" }] }, binding: { type: [{ code: "ElementDefinitionBinding" }] }, mapping: { max: 9007199254740991, type: [{ code: "ElementDefinitionMapping" }] } } }, ElementDefinitionSlicingDiscriminator: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, path: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionSlicing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, discriminator: { max: 9007199254740991, type: [{ code: "ElementDefinitionSlicingDiscriminator" }] }, description: { type: [{ code: "string" }] }, ordered: { type: [{ code: "boolean" }] }, rules: { min: 1, type: [{ code: "code" }] } } }, ElementDefinitionBase: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, min: { min: 1, type: [{ code: "unsignedInt" }] }, max: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionType: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, targetProfile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, aggregation: { max: 9007199254740991, type: [{ code: "code" }] }, versioning: { type: [{ code: "code" }] } } }, ElementDefinitionExample: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, label: { min: 1, type: [{ code: "string" }] }, "value[x]": { min: 1, type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, ElementDefinitionConstraint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, key: { min: 1, type: [{ code: "id" }] }, requirements: { type: [{ code: "string" }] }, severity: { min: 1, type: [{ code: "code" }] }, human: { min: 1, type: [{ code: "string" }] }, expression: { type: [{ code: "string" }] }, xpath: { type: [{ code: "string" }] }, source: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, ElementDefinitionBinding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, strength: { min: 1, type: [{ code: "code" }] }, description: { type: [{ code: "string" }] }, valueSet: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/ValueSet"] }] } } }, ElementDefinitionMapping: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identity: { min: 1, type: [{ code: "id" }] }, language: { type: [{ code: "code" }] }, map: { min: 1, type: [{ code: "string" }] }, comment: { type: [{ code: "string" }] } } }, Expression: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, description: { type: [{ code: "string" }] }, name: { type: [{ code: "id" }] }, language: { min: 1, type: [{ code: "code" }] }, expression: { type: [{ code: "string" }] }, reference: { type: [{ code: "uri" }] } } }, Extension: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, url: { min: 1, type: [{ code: "uri" }] }, "value[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, HumanName: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, family: { type: [{ code: "string" }] }, given: { max: 9007199254740991, type: [{ code: "string" }] }, prefix: { max: 9007199254740991, type: [{ code: "string" }] }, suffix: { max: 9007199254740991, type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Identifier: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "CodeableConcept" }] }, system: { type: [{ code: "uri" }] }, value: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] }, assigner: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MarketingStatus: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, country: { min: 1, type: [{ code: "CodeableConcept" }] }, jurisdiction: { type: [{ code: "CodeableConcept" }] }, status: { min: 1, type: [{ code: "CodeableConcept" }] }, dateRange: { min: 1, type: [{ code: "Period" }] }, restoreDate: { type: [{ code: "dateTime" }] } } }, Meta: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, versionId: { type: [{ code: "id" }] }, lastUpdated: { type: [{ code: "instant" }] }, source: { type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, security: { max: 9007199254740991, type: [{ code: "Coding" }] }, tag: { max: 9007199254740991, type: [{ code: "Coding" }] }, project: { type: [{ code: "uri" }] }, author: { type: [{ code: "Reference" }] }, onBehalfOf: { type: [{ code: "Reference" }] }, account: { type: [{ code: "Reference" }] }, accounts: { max: 9007199254740991, type: [{ code: "Reference" }] }, compartment: { max: 9007199254740991, type: [{ code: "Reference" }] } } }, Money: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, currency: { type: [{ code: "code" }] } } }, Narrative: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, status: { min: 1, type: [{ code: "code" }] }, div: { min: 1, type: [{ code: "xhtml" }] } } }, ParameterDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "code" }] }, use: { min: 1, type: [{ code: "code" }] }, min: { type: [{ code: "integer" }] }, max: { type: [{ code: "string" }] }, documentation: { type: [{ code: "string" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, Period: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, start: { type: [{ code: "dateTime" }] }, end: { type: [{ code: "dateTime" }] } } }, Population: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "age[x]": { type: [{ code: "Range" }, { code: "CodeableConcept" }] }, gender: { type: [{ code: "CodeableConcept" }] }, race: { type: [{ code: "CodeableConcept" }] }, physiologicalCondition: { type: [{ code: "CodeableConcept" }] } } }, ProdCharacteristic: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, height: { type: [{ code: "Quantity" }] }, width: { type: [{ code: "Quantity" }] }, depth: { type: [{ code: "Quantity" }] }, weight: { type: [{ code: "Quantity" }] }, nominalVolume: { type: [{ code: "Quantity" }] }, externalDiameter: { type: [{ code: "Quantity" }] }, shape: { type: [{ code: "string" }] }, color: { max: 9007199254740991, type: [{ code: "string" }] }, imprint: { max: 9007199254740991, type: [{ code: "string" }] }, image: { max: 9007199254740991, type: [{ code: "Attachment" }] }, scoring: { type: [{ code: "CodeableConcept" }] } } }, ProductShelfLife: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identifier: { type: [{ code: "Identifier" }] }, type: { min: 1, type: [{ code: "CodeableConcept" }] }, period: { min: 1, type: [{ code: "Quantity" }] }, specialPrecautionsForStorage: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] } } }, Quantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Range: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, low: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, high: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Ratio: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, numerator: { type: [{ code: "Quantity" }] }, denominator: { type: [{ code: "Quantity" }] } } }, Reference: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, reference: { type: [{ code: "string" }] }, type: { type: [{ code: "uri" }] }, identifier: { type: [{ code: "Identifier" }] }, display: { type: [{ code: "string" }] } } }, RelatedArtifact: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, label: { type: [{ code: "string" }] }, display: { type: [{ code: "string" }] }, citation: { type: [{ code: "markdown" }] }, url: { type: [{ code: "url" }] }, document: { type: [{ code: "Attachment" }] }, resource: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Resource"] }] } } }, SampledData: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, origin: { min: 1, type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, period: { min: 1, type: [{ code: "decimal" }] }, factor: { type: [{ code: "decimal" }] }, lowerLimit: { type: [{ code: "decimal" }] }, upperLimit: { type: [{ code: "decimal" }] }, dimensions: { min: 1, type: [{ code: "positiveInt" }] }, data: { type: [{ code: "string" }] } } }, Signature: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, max: 9007199254740991, type: [{ code: "Coding" }] }, when: { min: 1, type: [{ code: "instant" }] }, who: { min: 1, type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, onBehalfOf: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, targetFormat: { type: [{ code: "code" }] }, sigFormat: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] } } }, SubstanceAmount: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "amount[x]": { type: [{ code: "Quantity" }, { code: "Range" }, { code: "string" }] }, amountType: { type: [{ code: "CodeableConcept" }] }, amountText: { type: [{ code: "string" }] }, referenceRange: { type: [{ code: "SubstanceAmountReferenceRange" }] } } }, SubstanceAmountReferenceRange: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, lowLimit: { type: [{ code: "Quantity" }] }, highLimit: { type: [{ code: "Quantity" }] } } }, Timing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, event: { max: 9007199254740991, type: [{ code: "dateTime" }] }, repeat: { type: [{ code: "TimingRepeat" }] }, code: { type: [{ code: "CodeableConcept" }] } } }, TimingRepeat: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "bounds[x]": { type: [{ code: "Duration" }, { code: "Range" }, { code: "Period" }] }, count: { type: [{ code: "positiveInt" }] }, countMax: { type: [{ code: "positiveInt" }] }, duration: { type: [{ code: "decimal" }] }, durationMax: { type: [{ code: "decimal" }] }, durationUnit: { type: [{ code: "code" }] }, frequency: { type: [{ code: "positiveInt" }] }, frequencyMax: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "decimal" }] }, periodMax: { type: [{ code: "decimal" }] }, periodUnit: { type: [{ code: "code" }] }, dayOfWeek: { max: 9007199254740991, type: [{ code: "code" }] }, timeOfDay: { max: 9007199254740991, type: [{ code: "time" }] }, when: { max: 9007199254740991, type: [{ code: "code" }] }, offset: { type: [{ code: "unsignedInt" }] } } }, TriggerDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { type: [{ code: "string" }] }, "timing[x]": { type: [{ code: "Timing" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Schedule"] }, { code: "date" }, { code: "dateTime" }] }, data: { max: 9007199254740991, type: [{ code: "DataRequirement" }] }, condition: { type: [{ code: "Expression" }] } } }, UsageContext: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "Coding" }] }, "value[x]": { min: 1, type: [{ code: "CodeableConcept" }, { code: "Quantity" }, { code: "Range" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/PlanDefinition", "http://hl7.org/fhir/StructureDefinition/ResearchStudy", "http://hl7.org/fhir/StructureDefinition/InsurancePlan", "http://hl7.org/fhir/StructureDefinition/HealthcareService", "http://hl7.org/fhir/StructureDefinition/Group", "http://hl7.org/fhir/StructureDefinition/Location", "http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MoneyQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, SimpleQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { max: 0, type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, IdentityProvider: { elements: { authorizeUrl: { min: 1, type: [{ code: "string" }] }, tokenUrl: { min: 1, type: [{ code: "string" }] }, tokenAuthMethod: { type: [{ code: "code" }] }, userInfoUrl: { min: 1, type: [{ code: "string" }] }, clientId: { min: 1, type: [{ code: "string" }] }, clientSecret: { min: 1, type: [{ code: "string" }] }, usePkce: { type: [{ code: "boolean" }] }, useSubject: { type: [{ code: "boolean" }] } } } };
40561
+ function ar(r7) {
40562
+ return new or(r7).parse();
40563
40563
  }
40564
- var ce = pn(dn);
40565
- var ar = /* @__PURE__ */ Object.create(null);
40566
- var fn = /* @__PURE__ */ Object.create(null);
40567
- var to = { "http://hl7.org/fhir/StructureDefinition/MoneyQuantity": "MoneyQuantity", "http://hl7.org/fhir/StructureDefinition/SimpleQuantity": "SimpleQuantity", "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/ViewDefinition": "ViewDefinition" };
40568
- function gn(r7) {
40564
+ var ue = mn(hn);
40565
+ var cr = /* @__PURE__ */ Object.create(null);
40566
+ var yn = /* @__PURE__ */ Object.create(null);
40567
+ var io = { "http://hl7.org/fhir/StructureDefinition/MoneyQuantity": "MoneyQuantity", "http://hl7.org/fhir/StructureDefinition/SimpleQuantity": "SimpleQuantity", "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/ViewDefinition": "ViewDefinition" };
40568
+ function Tn(r7) {
40569
40569
  let e;
40570
- return e = fn[r7], e || (e = fn[r7] = /* @__PURE__ */ Object.create(null)), e;
40570
+ return e = yn[r7], e || (e = yn[r7] = /* @__PURE__ */ Object.create(null)), e;
40571
40571
  }
40572
- function cr(r7) {
40572
+ function ur(r7) {
40573
40573
  let e = Array.isArray(r7) ? r7 : r7.entry?.map((t) => t.resource) ?? [];
40574
- for (let t of e) ur(t);
40574
+ for (let t of e) lr(t);
40575
40575
  }
40576
- function ur(r7) {
40576
+ function lr(r7) {
40577
40577
  if (!r7?.name) throw new Error("Failed loading StructureDefinition from bundle");
40578
40578
  if (r7.resourceType !== "StructureDefinition") return;
40579
- let e = sr(r7), t = to[r7.url], n, i;
40580
- t ? (n = ce, i = t) : r7.url === `http://hl7.org/fhir/StructureDefinition/${r7.type}` || r7.url === `https://medplum.com/fhir/StructureDefinition/${r7.type}` || r7.type?.startsWith("http://") || r7.type?.startsWith("https://") ? (n = ce, i = r7.type) : (n = gn(r7.url), i = r7.type), n[i] = e;
40579
+ let e = ar(r7), t = io[r7.url], n, i;
40580
+ t ? (n = ue, i = t) : r7.url === `http://hl7.org/fhir/StructureDefinition/${r7.type}` || r7.url === `https://medplum.com/fhir/StructureDefinition/${r7.type}` || r7.type?.startsWith("http://") || r7.type?.startsWith("https://") ? (n = ue, i = r7.type) : (n = Tn(r7.url), i = r7.type), n[i] = e;
40581
40581
  for (let o of e.innerTypes) o.parentType = e, n[o.name] = o;
40582
- ar[r7.url] = e;
40582
+ cr[r7.url] = e;
40583
40583
  }
40584
- function vn(r7) {
40585
- return !!ce[r7];
40584
+ function En(r7) {
40585
+ return !!ue[r7];
40586
40586
  }
40587
40587
  function Le(r7, e) {
40588
40588
  if (e) {
40589
- let t = gn(e)[r7];
40589
+ let t = Tn(e)[r7];
40590
40590
  if (t) return t;
40591
40591
  }
40592
- return ce[r7];
40592
+ return ue[r7];
40593
40593
  }
40594
- function Sn(r7) {
40595
- return !!ar[r7];
40594
+ function Rn(r7) {
40595
+ return !!cr[r7];
40596
40596
  }
40597
- var ir = class {
40597
+ var or = class {
40598
40598
  constructor(e) {
40599
40599
  if (!e.snapshot?.element || e.snapshot.element.length === 0) throw new Error(`No snapshot defined for StructureDefinition '${e.name}'`);
40600
- this.root = e.snapshot.element[0], this.elements = e.snapshot.element.slice(1), this.elementIndex = /* @__PURE__ */ Object.create(null), this.index = 0, this.resourceSchema = { name: e.name, path: this.root.path, title: e.title, type: e.type, url: e.url, kind: e.kind, description: oo(e), elements: {}, constraints: this.parseElementDefinition(this.root).constraints, innerTypes: [], summaryProperties: /* @__PURE__ */ new Set(), mandatoryProperties: /* @__PURE__ */ new Set() }, this.innerTypes = [];
40600
+ this.root = e.snapshot.element[0], this.elements = e.snapshot.element.slice(1), this.elementIndex = /* @__PURE__ */ Object.create(null), this.index = 0, this.resourceSchema = { name: e.name, path: this.root.path, title: e.title, type: e.type, url: e.url, kind: e.kind, description: co(e), elements: {}, constraints: this.parseElementDefinition(this.root).constraints, innerTypes: [], summaryProperties: /* @__PURE__ */ new Set(), mandatoryProperties: /* @__PURE__ */ new Set() }, this.innerTypes = [];
40601
40601
  }
40602
40602
  parse() {
40603
40603
  let e = this.next();
@@ -40605,7 +40605,7 @@ var ir = class {
40605
40605
  if (e.sliceName) this.parseSliceStart(e);
40606
40606
  else if (e.id?.includes(":")) {
40607
40607
  if (this.slicingContext?.current) {
40608
- let t = nr(e, this.slicingContext.path);
40608
+ let t = ir(e, this.slicingContext.path);
40609
40609
  this.slicingContext.current.elements[t] = this.parseElementDefinition(e);
40610
40610
  }
40611
40611
  } else {
@@ -40614,13 +40614,13 @@ var ir = class {
40614
40614
  let n = this.backboneContext;
40615
40615
  for (; n; ) {
40616
40616
  if (e.path?.startsWith(n.path + ".")) {
40617
- n.type.elements[nr(e, n.path)] = t;
40617
+ n.type.elements[ir(e, n.path)] = t;
40618
40618
  break;
40619
40619
  }
40620
40620
  n = n.parent;
40621
40621
  }
40622
40622
  if (!n) {
40623
- let i = nr(e, this.root.path);
40623
+ let i = ir(e, this.root.path);
40624
40624
  e.isSummary && this.resourceSchema.summaryProperties?.add(i.replace("[x]", "")), t.min > 0 && this.resourceSchema.mandatoryProperties?.add(i.replace("[x]", "")), this.resourceSchema.elements[i] = t;
40625
40625
  }
40626
40626
  this.checkFieldExit(e);
@@ -40630,23 +40630,23 @@ var ir = class {
40630
40630
  return this.checkFieldExit(), this.innerTypes.length > 0 && (this.resourceSchema.innerTypes = this.innerTypes), this.resourceSchema;
40631
40631
  }
40632
40632
  checkFieldEnter(e, t) {
40633
- this.isInnerType(e) && this.enterInnerType(e), this.slicingContext && !Re(this.slicingContext.path, e?.path) && (this.slicingContext = void 0), e.slicing && !this.slicingContext && this.enterSlice(e, t);
40633
+ this.isInnerType(e) && this.enterInnerType(e), this.slicingContext && !Ce(this.slicingContext.path, e?.path) && (this.slicingContext = void 0), e.slicing && !this.slicingContext && this.enterSlice(e, t);
40634
40634
  }
40635
40635
  enterInnerType(e) {
40636
- for (; this.backboneContext && !Re(this.backboneContext?.path, e.path); ) this.innerTypes.push(this.backboneContext.type), this.backboneContext = this.backboneContext.parent;
40637
- let t = or(e);
40638
- this.backboneContext = { type: { name: t, type: t, path: e.path, title: e.label, description: e.definition, elements: {}, constraints: this.parseElementDefinition(e).constraints, innerTypes: [] }, path: e.path, parent: Re(this.backboneContext?.path, e.path) ? this.backboneContext : this.backboneContext?.parent };
40636
+ for (; this.backboneContext && !Ce(this.backboneContext?.path, e.path); ) this.innerTypes.push(this.backboneContext.type), this.backboneContext = this.backboneContext.parent;
40637
+ let t = sr(e);
40638
+ this.backboneContext = { type: { name: t, type: t, path: e.path, title: e.label, description: e.definition, elements: {}, constraints: this.parseElementDefinition(e).constraints, innerTypes: [] }, path: e.path, parent: Ce(this.backboneContext?.path, e.path) ? this.backboneContext : this.backboneContext?.parent };
40639
40639
  }
40640
40640
  enterSlice(e, t) {
40641
- io(e) && !this.peek()?.sliceName || (t.slicing = { discriminator: (e.slicing?.discriminator ?? []).map((n) => {
40641
+ ao(e) && !this.peek()?.sliceName || (t.slicing = { discriminator: (e.slicing?.discriminator ?? []).map((n) => {
40642
40642
  if (n.type !== "value" && n.type !== "pattern" && n.type !== "type") throw new Error(`Unsupported slicing discriminator type: ${n.type}`);
40643
40643
  return { path: n.path, type: n.type };
40644
40644
  }), slices: [], ordered: e.slicing?.ordered ?? false, rule: e.slicing?.rules }, this.slicingContext = { field: t.slicing, path: e.path ?? "" });
40645
40645
  }
40646
40646
  checkFieldExit(e = void 0) {
40647
- if (this.backboneContext && !Re(this.backboneContext.path, e?.path)) if (this.backboneContext.parent) do
40647
+ if (this.backboneContext && !Ce(this.backboneContext.path, e?.path)) if (this.backboneContext.parent) do
40648
40648
  this.innerTypes.push(this.backboneContext.type), this.backboneContext = this.backboneContext.parent;
40649
- while (this.backboneContext && !Re(this.backboneContext.path, e?.path));
40649
+ while (this.backboneContext && !Ce(this.backboneContext.path, e?.path));
40650
40650
  else this.innerTypes.push(this.backboneContext.type), this.backboneContext = void 0;
40651
40651
  }
40652
40652
  next() {
@@ -40665,7 +40665,7 @@ var ir = class {
40665
40665
  }
40666
40666
  isInnerType(e) {
40667
40667
  let t = this.peek();
40668
- return !!(Re(e?.path, t?.path) && e.type?.some((n) => ["BackboneElement", "Element"].includes(n.code)));
40668
+ return !!(Ce(e?.path, t?.path) && e.type?.some((n) => ["BackboneElement", "Element"].includes(n.code)));
40669
40669
  }
40670
40670
  parseSliceStart(e) {
40671
40671
  if (!this.slicingContext) throw new Error(`Invalid slice start before discriminator: ${e.sliceName} (${e.id})`);
@@ -40674,48 +40674,48 @@ var ir = class {
40674
40674
  parseElementDefinitionType(e) {
40675
40675
  return (e.type ?? []).map((t) => {
40676
40676
  let n;
40677
- return (t.code === "BackboneElement" || t.code === "Element") && (n = or(e)), n || (n = X(t, "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type")?.valueUrl), n || (n = t.code ?? ""), { code: n, targetProfile: t.targetProfile, profile: t.profile };
40677
+ return (t.code === "BackboneElement" || t.code === "Element") && (n = sr(e)), n || (n = X(t, "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type")?.valueUrl), n || (n = t.code ?? ""), { code: n, targetProfile: t.targetProfile, profile: t.profile };
40678
40678
  });
40679
40679
  }
40680
40680
  parseElementDefinition(e) {
40681
- let t = hn(e.max), n = e.base?.max ? hn(e.base.max) : t, i = { type: "ElementDefinition", value: e };
40682
- return { description: e.definition || "", path: e.path || e.base?.path || "", min: e.min ?? 0, max: t, isArray: n > 1, constraints: (e.constraint ?? []).map((o) => ({ key: o.key ?? "", severity: o.severity ?? "error", expression: o.expression ?? "", description: o.human ?? "" })), type: this.parseElementDefinitionType(e), fixed: yn(P(i, "fixed[x]")), pattern: yn(P(i, "pattern[x]")), binding: e.binding };
40681
+ let t = xn(e.max), n = e.base?.max ? xn(e.base.max) : t, i = { type: "ElementDefinition", value: e };
40682
+ return { description: e.definition || "", path: e.path || e.base?.path || "", min: e.min ?? 0, max: t, isArray: n > 1, constraints: (e.constraint ?? []).map((o) => ({ key: o.key ?? "", severity: o.severity ?? "error", expression: o.expression ?? "", description: o.human ?? "" })), type: this.parseElementDefinitionType(e), fixed: vn(P(i, "fixed[x]")), pattern: vn(P(i, "pattern[x]")), binding: e.binding };
40683
40683
  }
40684
40684
  };
40685
- function hn(r7) {
40685
+ function xn(r7) {
40686
40686
  return r7 === "*" ? Number.POSITIVE_INFINITY : Number.parseInt(r7, 10);
40687
40687
  }
40688
- function nr(r7, e = "") {
40689
- return no(r7.path, e);
40688
+ function ir(r7, e = "") {
40689
+ return so(r7.path, e);
40690
40690
  }
40691
- function no(r7, e) {
40691
+ function so(r7, e) {
40692
40692
  return r7 ? e && r7.startsWith(e) ? r7.substring(e.length + 1) : r7 : "";
40693
40693
  }
40694
- function Re(r7, e) {
40694
+ function Ce(r7, e) {
40695
40695
  return !r7 || !e ? false : e.startsWith(r7 + ".") || e === r7;
40696
40696
  }
40697
- function yn(r7) {
40697
+ function vn(r7) {
40698
40698
  return Array.isArray(r7) && r7.length > 0 ? r7[0] : S(r7) ? void 0 : r7;
40699
40699
  }
40700
- function io(r7) {
40700
+ function ao(r7) {
40701
40701
  let e = r7.slicing?.discriminator;
40702
40702
  return !!(r7.type?.some((t) => t.code === "Extension") && e?.length === 1 && e[0].type === "value" && e[0].path === "url");
40703
40703
  }
40704
- function oo(r7) {
40704
+ function co(r7) {
40705
40705
  let e = r7.description;
40706
40706
  return e?.startsWith(`Base StructureDefinition for ${r7.name} Type: `) && (e = e.substring(`Base StructureDefinition for ${r7.name} Type: `.length)), e;
40707
40707
  }
40708
- var nt = { base64Binary: /^([A-Za-z\d+/]{4})*([A-Za-z\d+/]{2}==|[A-Za-z\d+/]{3}=)?$/, canonical: /^\S*$/, code: /^[^\s]+( [^\s]+)*$/, date: /^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2]\d|3[0-1]))?)?$/, dateTime: /^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2]\d|3[0-1])(T([01]\d|2[0-3])(:[0-5]\d:([0-5]\d|60)(\.\d{1,9})?)?)?)?(Z|[+-]((0\d|1[0-3]):[0-5]\d|14:00)?)?)?$/, id: /^[A-Za-z0-9\-.]{1,64}$/, instant: /^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)-(0[1-9]|1[0-2])-(0[1-9]|[1-2]\d|3[0-1])T([01]\d|2[0-3]):[0-5]\d:([0-5]\d|60)(\.\d{1,9})?(Z|[+-]((0\d|1[0-3]):[0-5]\d|14:00))$/, markdown: /^[\s\S]+$/, oid: /^urn:oid:[0-2](\.(0|[1-9]\d*))+$/, string: /^[\s\S]+$/, time: /^([01]\d|2[0-3]):[0-5]\d:([0-5]\d|60)(\.\d{1,9})?$/, uri: /^\S*$/, url: /^\S*$/, uuid: /^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/, xhtml: /.*/ };
40708
+ var ot = { base64Binary: /^([A-Za-z\d+/]{4})*([A-Za-z\d+/]{2}==|[A-Za-z\d+/]{3}=)?$/, canonical: /^\S*$/, code: /^[^\s]+( [^\s]+)*$/, date: /^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2]\d|3[0-1]))?)?$/, dateTime: /^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2]\d|3[0-1])(T([01]\d|2[0-3])(:[0-5]\d:([0-5]\d|60)(\.\d{1,9})?)?)?)?(Z|[+-]((0\d|1[0-3]):[0-5]\d|14:00)?)?)?$/, id: /^[A-Za-z0-9\-.]{1,64}$/, instant: /^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)-(0[1-9]|1[0-2])-(0[1-9]|[1-2]\d|3[0-1])T([01]\d|2[0-3]):[0-5]\d:([0-5]\d|60)(\.\d{1,9})?(Z|[+-]((0\d|1[0-3]):[0-5]\d|14:00))$/, markdown: /^[\s\S]+$/, oid: /^urn:oid:[0-2](\.(0|[1-9]\d*))+$/, string: /^[\s\S]+$/, time: /^([01]\d|2[0-3]):[0-5]\d:([0-5]\d|60)(\.\d{1,9})?$/, uri: /^\S*$/, url: /^\S*$/, uuid: /^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/, xhtml: /.*/ };
40709
40709
  function f(r7) {
40710
40710
  return [{ type: l.boolean, value: r7 }];
40711
40711
  }
40712
40712
  function g(r7) {
40713
- return r7 == null ? { type: "undefined", value: void 0 } : Number.isSafeInteger(r7) ? { type: l.integer, value: r7 } : typeof r7 == "number" ? { type: l.decimal, value: r7 } : typeof r7 == "boolean" ? { type: l.boolean, value: r7 } : typeof r7 == "string" ? { type: l.string, value: r7 } : k(r7) ? { type: l.Quantity, value: r7 } : I(r7) ? { type: r7.resourceType, value: r7 } : Tr(r7) ? { type: l.CodeableConcept, value: r7 } : vr(r7) ? { type: l.Coding, value: r7 } : { type: l.BackboneElement, value: r7 };
40713
+ return r7 == null ? { type: "undefined", value: void 0 } : Number.isSafeInteger(r7) ? { type: l.integer, value: r7 } : typeof r7 == "number" ? { type: l.decimal, value: r7 } : typeof r7 == "boolean" ? { type: l.boolean, value: r7 } : typeof r7 == "string" ? { type: l.string, value: r7 } : k(r7) ? { type: l.Quantity, value: r7 } : I(r7) ? { type: r7.resourceType, value: r7 } : Sr(r7) ? { type: l.CodeableConcept, value: r7 } : Tr(r7) ? { type: l.Coding, value: r7 } : { type: l.BackboneElement, value: r7 };
40714
40714
  }
40715
40715
  function N(r7) {
40716
40716
  return r7.length === 0 ? false : !!r7[0].value;
40717
40717
  }
40718
- function j(r7, e) {
40718
+ function W(r7, e) {
40719
40719
  if (r7.length !== 0) {
40720
40720
  if (r7.length === 1 && (!e || r7[0].type === e)) return r7[0];
40721
40721
  throw new Error(`Expected singleton of type ${e}, but found ${JSON.stringify(r7)}`);
@@ -40723,15 +40723,15 @@ function j(r7, e) {
40723
40723
  }
40724
40724
  function P(r7, e, t) {
40725
40725
  if (!r7.value) return;
40726
- let n = st(r7.type, e, t?.profileUrl);
40727
- return n ? go(r7, e, n) : xo(r7, e);
40726
+ let n = ct(r7.type, e, t?.profileUrl);
40727
+ return n ? To(r7, e, n) : So(r7, e);
40728
40728
  }
40729
- function go(r7, e, t) {
40729
+ function To(r7, e, t) {
40730
40730
  let n = r7.value, i = t.type;
40731
40731
  if (!i || i.length === 0) return;
40732
40732
  let o, s = "undefined", a2, c = t.path.lastIndexOf("."), u2 = t.path.substring(c + 1);
40733
40733
  for (let p2 of i) {
40734
- let m2 = u2.replace("[x]", w(p2.code));
40734
+ let m2 = u2.replace("[x]", O(p2.code));
40735
40735
  if (o = n[m2], a2 = n["_" + m2], o !== void 0 || a2 !== void 0) {
40736
40736
  s = p2.code;
40737
40737
  break;
@@ -40739,14 +40739,14 @@ function go(r7, e, t) {
40739
40739
  }
40740
40740
  if (a2) if (Array.isArray(o)) {
40741
40741
  o = o.slice();
40742
- for (let p2 = 0; p2 < Math.max(o.length, a2.length); p2++) o[p2] = An(o[p2], a2[p2]);
40743
- } else o = An(o, a2);
40744
- if (!S(o)) return (s === "Element" || s === "BackboneElement") && (s = t.type[0].code), Array.isArray(o) ? o.map((p2) => Rn(p2, s)) : Rn(o, s);
40742
+ for (let p2 = 0; p2 < Math.max(o.length, a2.length); p2++) o[p2] = kn(o[p2], a2[p2]);
40743
+ } else o = kn(o, a2);
40744
+ if (!S(o)) return (s === "Element" || s === "BackboneElement") && (s = t.type[0].code), Array.isArray(o) ? o.map((p2) => wn(p2, s)) : wn(o, s);
40745
40745
  }
40746
- function Rn(r7, e) {
40746
+ function wn(r7, e) {
40747
40747
  return e === "Resource" && I(r7) && (e = r7.resourceType), { type: e, value: r7 };
40748
40748
  }
40749
- function xo(r7, e) {
40749
+ function So(r7, e) {
40750
40750
  let t = r7.value;
40751
40751
  if (!t || typeof t != "object") return;
40752
40752
  let n;
@@ -40756,7 +40756,7 @@ function xo(r7, e) {
40756
40756
  } else {
40757
40757
  let i = e.endsWith("[x]") ? e.substring(0, e.length - 3) : e;
40758
40758
  for (let o of Object.values(l)) {
40759
- let s = i + w(o);
40759
+ let s = i + O(o);
40760
40760
  if (s in t) {
40761
40761
  let a2 = t[s];
40762
40762
  Array.isArray(a2) ? n = a2.map((c) => ({ type: o, value: c })) : n = { type: o, value: a2 };
@@ -40769,11 +40769,11 @@ function xo(r7, e) {
40769
40769
  } else if (S(n)) return;
40770
40770
  return n;
40771
40771
  }
40772
- function it(r7) {
40772
+ function st(r7) {
40773
40773
  let e = [];
40774
40774
  for (let t of r7) {
40775
40775
  let n = false;
40776
- for (let i of e) if (N(yr(t, i))) {
40776
+ for (let i of e) if (N(gr(t, i))) {
40777
40777
  n = true;
40778
40778
  break;
40779
40779
  }
@@ -40781,31 +40781,31 @@ function it(r7) {
40781
40781
  }
40782
40782
  return e;
40783
40783
  }
40784
- function On(r7) {
40784
+ function Vn(r7) {
40785
40785
  return f(!N(r7));
40786
40786
  }
40787
- function In(r7, e) {
40788
- return r7.length === 0 || e.length === 0 ? [] : r7.length !== e.length ? f(false) : f(r7.every((t, n) => N(yr(t, e[n]))));
40787
+ function Dn(r7, e) {
40788
+ return r7.length === 0 || e.length === 0 ? [] : r7.length !== e.length ? f(false) : f(r7.every((t, n) => N(gr(t, e[n]))));
40789
40789
  }
40790
- function kn(r7, e) {
40791
- return r7.length === 0 || e.length === 0 ? [] : r7.length !== e.length ? f(true) : f(r7.some((t, n) => !N(yr(t, e[n]))));
40790
+ function Mn(r7, e) {
40791
+ return r7.length === 0 || e.length === 0 ? [] : r7.length !== e.length ? f(true) : f(r7.some((t, n) => !N(gr(t, e[n]))));
40792
40792
  }
40793
- function yr(r7, e) {
40793
+ function gr(r7, e) {
40794
40794
  let t = r7.value?.valueOf(), n = e.value?.valueOf();
40795
- return typeof t == "number" && typeof n == "number" ? f(Math.abs(t - n) < 1e-8) : k(t) && k(n) ? f(Mn(t, n)) : f(typeof t == "object" && typeof n == "object" ? xr(r7, e) : t === n);
40795
+ return typeof t == "number" && typeof n == "number" ? f(Math.abs(t - n) < 1e-8) : k(t) && k(n) ? f(Ln(t, n)) : f(typeof t == "object" && typeof n == "object" ? vr(r7, e) : t === n);
40796
40796
  }
40797
- function gr(r7, e) {
40798
- return r7.length === 0 && e.length === 0 ? f(true) : r7.length !== e.length ? f(false) : (r7.sort(Cn), e.sort(Cn), f(r7.every((t, n) => N(vo(t, e[n])))));
40797
+ function xr(r7, e) {
40798
+ return r7.length === 0 && e.length === 0 ? f(true) : r7.length !== e.length ? f(false) : (r7.sort(An), e.sort(An), f(r7.every((t, n) => N(Eo(t, e[n])))));
40799
40799
  }
40800
- function vo(r7, e) {
40800
+ function Eo(r7, e) {
40801
40801
  let { type: t, value: n } = r7, { type: i, value: o } = e, s = n?.valueOf(), a2 = o?.valueOf();
40802
- return typeof s == "number" && typeof a2 == "number" ? f(Math.abs(s - a2) < 0.01) : k(s) && k(a2) ? f(Mn(s, a2)) : f(t === "Coding" && i === "Coding" ? typeof s != "object" || typeof a2 != "object" ? false : s.code === a2.code && s.system === a2.system : typeof s == "object" && typeof a2 == "object" ? xr({ ...s, id: void 0 }, { ...a2, id: void 0 }) : typeof s == "string" && typeof a2 == "string" ? s.toLowerCase() === a2.toLowerCase() : s === a2);
40802
+ return typeof s == "number" && typeof a2 == "number" ? f(Math.abs(s - a2) < 0.01) : k(s) && k(a2) ? f(Ln(s, a2)) : f(t === "Coding" && i === "Coding" ? typeof s != "object" || typeof a2 != "object" ? false : s.code === a2.code && s.system === a2.system : typeof s == "object" && typeof a2 == "object" ? vr({ ...s, id: void 0 }, { ...a2, id: void 0 }) : typeof s == "string" && typeof a2 == "string" ? s.toLowerCase() === a2.toLowerCase() : s === a2);
40803
40803
  }
40804
- function Cn(r7, e) {
40804
+ function An(r7, e) {
40805
40805
  let t = r7.value?.valueOf(), n = e.value?.valueOf();
40806
40806
  return typeof t == "number" && typeof n == "number" ? t - n : typeof t == "string" && typeof n == "string" ? t.localeCompare(n) : 0;
40807
40807
  }
40808
- function ot(r7, e) {
40808
+ function at(r7, e) {
40809
40809
  let { value: t } = r7;
40810
40810
  if (t == null) return false;
40811
40811
  switch (e) {
@@ -40815,100 +40815,100 @@ function ot(r7, e) {
40815
40815
  case "Integer":
40816
40816
  return typeof t == "number";
40817
40817
  case "Date":
40818
- return Vn(t);
40818
+ return _n(t);
40819
40819
  case "DateTime":
40820
- return Pe(t);
40820
+ return we(t);
40821
40821
  case "Time":
40822
40822
  return typeof t == "string" && !!/^T\d/.exec(t);
40823
40823
  case "Period":
40824
- return Dn(t);
40824
+ return Nn(t);
40825
40825
  case "Quantity":
40826
40826
  return k(t);
40827
40827
  default:
40828
40828
  return typeof t == "object" && t?.resourceType === e;
40829
40829
  }
40830
40830
  }
40831
- function Vn(r7) {
40832
- return typeof r7 == "string" && !!nt.date.exec(r7);
40831
+ function _n(r7) {
40832
+ return typeof r7 == "string" && !!ot.date.exec(r7);
40833
40833
  }
40834
- function Pe(r7) {
40835
- return typeof r7 == "string" && !!nt.dateTime.exec(r7);
40834
+ function we(r7) {
40835
+ return typeof r7 == "string" && !!ot.dateTime.exec(r7);
40836
40836
  }
40837
- function Dn(r7) {
40838
- return !!(r7 && typeof r7 == "object" && ("start" in r7 && Pe(r7.start) || "end" in r7 && Pe(r7.end)));
40837
+ function Nn(r7) {
40838
+ return !!(r7 && typeof r7 == "object" && ("start" in r7 && we(r7.start) || "end" in r7 && we(r7.end)));
40839
40839
  }
40840
40840
  function k(r7) {
40841
40841
  return !!(r7 && typeof r7 == "object" && "value" in r7 && typeof r7.value == "number");
40842
40842
  }
40843
- function Mn(r7, e) {
40843
+ function Ln(r7, e) {
40844
40844
  return Math.abs(r7.value - e.value) < 0.01 && (r7.unit === e.unit || r7.code === e.code || r7.unit === e.code || r7.code === e.unit);
40845
40845
  }
40846
- function xr(r7, e) {
40846
+ function vr(r7, e) {
40847
40847
  let t = Object.keys(r7), n = Object.keys(e);
40848
40848
  if (t.length !== n.length) return false;
40849
40849
  for (let i of t) {
40850
40850
  let o = r7[i], s = e[i];
40851
- if (wn(o) && wn(s)) {
40852
- if (!xr(o, s)) return false;
40851
+ if (In(o) && In(s)) {
40852
+ if (!vr(o, s)) return false;
40853
40853
  } else if (o !== s) return false;
40854
40854
  }
40855
40855
  return true;
40856
40856
  }
40857
- function wn(r7) {
40857
+ function In(r7) {
40858
40858
  return r7 !== null && typeof r7 == "object";
40859
40859
  }
40860
- function An(r7, e) {
40860
+ function kn(r7, e) {
40861
40861
  if (e) {
40862
40862
  if (typeof e != "object") throw new Error("Primitive extension must be an object");
40863
- return To(r7 ?? {}, e);
40863
+ return bo(r7 ?? {}, e);
40864
40864
  }
40865
40865
  return r7;
40866
40866
  }
40867
- function To(r7, e) {
40867
+ function bo(r7, e) {
40868
40868
  return delete e.__proto__, delete e.constructor, Object.assign(r7, e);
40869
40869
  }
40870
40870
  function te(r7) {
40871
- let e = le(r7), t = Eo(r7);
40871
+ let e = pe(r7), t = Co(r7);
40872
40872
  return t === e ? { reference: e } : { reference: e, display: t };
40873
40873
  }
40874
- function le(r7) {
40875
- return ue(r7) ? r7.reference : `${r7.resourceType}/${r7.id}`;
40876
- }
40877
40874
  function pe(r7) {
40878
- if (r7) return ue(r7) ? r7.reference.split("/")[1] : r7.id;
40875
+ return le(r7) ? r7.reference : `${r7.resourceType}/${r7.id}`;
40876
+ }
40877
+ function de(r7) {
40878
+ if (r7) return le(r7) ? r7.reference.split("/")[1] : r7.id;
40879
40879
  }
40880
- function So(r7) {
40880
+ function Ro(r7) {
40881
40881
  return r7.resourceType === "Patient" || r7.resourceType === "Practitioner" || r7.resourceType === "RelatedPerson";
40882
40882
  }
40883
- function Eo(r7) {
40884
- if (So(r7)) {
40885
- let e = bo(r7);
40883
+ function Co(r7) {
40884
+ if (Ro(r7)) {
40885
+ let e = Po(r7);
40886
40886
  if (e) return e;
40887
40887
  }
40888
40888
  if (r7.resourceType === "Device") {
40889
- let e = Ro(r7);
40889
+ let e = wo(r7);
40890
40890
  if (e) return e;
40891
40891
  }
40892
- if (r7.resourceType === "MedicationRequest" && r7.medicationCodeableConcept) return at(r7.medicationCodeableConcept);
40892
+ if (r7.resourceType === "MedicationRequest" && r7.medicationCodeableConcept) return Be(r7.medicationCodeableConcept);
40893
40893
  if (r7.resourceType === "Subscription" && r7.criteria) return r7.criteria;
40894
40894
  if (r7.resourceType === "User" && r7.email) return r7.email;
40895
40895
  if ("name" in r7 && r7.name && typeof r7.name == "string") return r7.name;
40896
40896
  if ("code" in r7 && r7.code) {
40897
40897
  let e = r7.code;
40898
- if (Array.isArray(e) && (e = e[0]), Tr(e)) return at(e);
40899
- if (Do(e)) return e.text;
40898
+ if (Array.isArray(e) && (e = e[0]), Sr(e)) return Be(e);
40899
+ if (No(e)) return e.text;
40900
40900
  }
40901
- return le(r7);
40901
+ return pe(r7);
40902
40902
  }
40903
- function bo(r7) {
40903
+ function Po(r7) {
40904
40904
  let e = r7.name;
40905
- if (e && e.length > 0) return lt(e[0]);
40905
+ if (e && e.length > 0) return qe(e[0]);
40906
40906
  }
40907
- function Ro(r7) {
40907
+ function wo(r7) {
40908
40908
  let e = r7.deviceName;
40909
40909
  if (e && e.length > 0) return e[0].name;
40910
40910
  }
40911
- function ct(r7, e) {
40911
+ function ut(r7, e) {
40912
40912
  let t = new Date(r7);
40913
40913
  t.setUTCHours(0, 0, 0, 0);
40914
40914
  let n = e ? new Date(e) : /* @__PURE__ */ new Date();
@@ -40925,13 +40925,13 @@ function X(r7, ...e) {
40925
40925
  for (let n = 0; n < e.length && t; n++) t = t?.extension?.find((i) => i.url === e[n]);
40926
40926
  return t;
40927
40927
  }
40928
- function Fn(r7, e) {
40929
- return JSON.stringify(r7, Po, e ? 2 : void 0);
40928
+ function lt(r7, e) {
40929
+ return JSON.stringify(r7, Oo, e ? 2 : void 0) ?? "";
40930
40930
  }
40931
- function Po(r7, e) {
40932
- return !wo(r7) && S(e) ? void 0 : e;
40931
+ function Oo(r7, e) {
40932
+ return !Io(r7) && S(e) ? void 0 : e;
40933
40933
  }
40934
- function wo(r7) {
40934
+ function Io(r7) {
40935
40935
  return !!/\d+$/.exec(r7);
40936
40936
  }
40937
40937
  function S(r7) {
@@ -40945,14 +40945,14 @@ function K(r7) {
40945
40945
  return e === "string" && r7 !== "" || e === "object" && ("length" in r7 && r7.length > 0 || Object.keys(r7).length > 0);
40946
40946
  }
40947
40947
  function ee(r7, e, t) {
40948
- return r7 === e || S(r7) && S(e) ? true : S(r7) || S(e) ? false : Array.isArray(r7) && Array.isArray(e) ? Ao(r7, e) : Array.isArray(r7) || Array.isArray(e) ? false : R(r7) && R(e) ? Oo(r7, e, t) : (R(r7) || R(e), false);
40948
+ return r7 === e || S(r7) && S(e) ? true : S(r7) || S(e) ? false : Array.isArray(r7) && Array.isArray(e) ? ko(r7, e) : Array.isArray(r7) || Array.isArray(e) ? false : R(r7) && R(e) ? Vo(r7, e, t) : (R(r7) || R(e), false);
40949
40949
  }
40950
- function Ao(r7, e) {
40950
+ function ko(r7, e) {
40951
40951
  if (r7.length !== e.length) return false;
40952
40952
  for (let t = 0; t < r7.length; t++) if (!ee(r7[t], e[t])) return false;
40953
40953
  return true;
40954
40954
  }
40955
- function Oo(r7, e, t) {
40955
+ function Vo(r7, e, t) {
40956
40956
  let n = /* @__PURE__ */ new Set();
40957
40957
  Object.keys(r7).forEach((i) => n.add(i)), Object.keys(e).forEach((i) => n.add(i)), t === "meta" && (n.delete("versionId"), n.delete("lastUpdated"), n.delete("author"));
40958
40958
  for (let i of n) {
@@ -40964,65 +40964,65 @@ function Oo(r7, e, t) {
40964
40964
  function R(r7) {
40965
40965
  return r7 !== null && typeof r7 == "object";
40966
40966
  }
40967
- function Un(r7) {
40968
- return r7.every(Vo);
40967
+ function qn(r7) {
40968
+ return r7.every(_o);
40969
40969
  }
40970
- function Vo(r7) {
40970
+ function _o(r7) {
40971
40971
  return typeof r7 == "string";
40972
40972
  }
40973
- function vr(r7) {
40973
+ function Tr(r7) {
40974
40974
  return R(r7) && "code" in r7 && typeof r7.code == "string";
40975
40975
  }
40976
- function Tr(r7) {
40977
- return R(r7) && "coding" in r7 && Array.isArray(r7.coding) && r7.coding.every(vr);
40976
+ function Sr(r7) {
40977
+ return R(r7) && "coding" in r7 && Array.isArray(r7.coding) && r7.coding.every(Tr);
40978
40978
  }
40979
- function Do(r7) {
40979
+ function No(r7) {
40980
40980
  return R(r7) && "text" in r7 && typeof r7.text == "string";
40981
40981
  }
40982
- var Bn = [];
40983
- for (let r7 = 0; r7 < 256; r7++) Bn.push(r7.toString(16).padStart(2, "0"));
40984
- function qn(r7) {
40985
- let e = Wn(r7), t = new Uint8Array(e), n = new Array(t.length);
40986
- for (let i = 0; i < t.length; i++) n[i] = Bn[t[i]];
40982
+ var Wn = [];
40983
+ for (let r7 = 0; r7 < 256; r7++) Wn.push(r7.toString(16).padStart(2, "0"));
40984
+ function jn(r7) {
40985
+ let e = Gn(r7), t = new Uint8Array(e), n = new Array(t.length);
40986
+ for (let i = 0; i < t.length; i++) n[i] = Wn[t[i]];
40987
40987
  return n.join("");
40988
40988
  }
40989
- function jn(r7) {
40990
- let e = Wn(r7), t = new Uint8Array(e), n = new Array(t.length);
40989
+ function $n(r7) {
40990
+ let e = Gn(r7), t = new Uint8Array(e), n = new Array(t.length);
40991
40991
  for (let i = 0; i < t.length; i++) n[i] = String.fromCharCode(t[i]);
40992
40992
  return window.btoa(n.join(""));
40993
40993
  }
40994
- function Wn(r7) {
40994
+ function Gn(r7) {
40995
40995
  return ArrayBuffer.isView(r7) ? r7.buffer : r7;
40996
40996
  }
40997
- function w(r7) {
40997
+ function O(r7) {
40998
40998
  return r7 ? r7.charAt(0).toUpperCase() + r7.substring(1) : "";
40999
40999
  }
41000
- var br = (r7) => new Promise((e) => {
41000
+ var Rr = (r7) => new Promise((e) => {
41001
41001
  setTimeout(e, r7);
41002
41002
  });
41003
- function ut(r7) {
41003
+ function pt(r7) {
41004
41004
  return r7.sort((e, t) => e.localeCompare(t));
41005
41005
  }
41006
- function Cr(r7) {
41006
+ function Pr(r7) {
41007
41007
  return r7.endsWith("/") ? r7 : r7 + "/";
41008
41008
  }
41009
- function Uo(r7) {
41009
+ function Wo(r7) {
41010
41010
  return r7.startsWith("/") ? r7.slice(1) : r7;
41011
41011
  }
41012
41012
  function B(r7, e) {
41013
- return new URL(Uo(e), Cr(r7.toString())).toString();
41013
+ return new URL(Wo(e), Pr(r7.toString())).toString();
41014
41014
  }
41015
- function Qn(r7, e) {
41015
+ function zn(r7, e) {
41016
41016
  return B(r7, e).toString().replace("http://", "ws://").replace("https://", "wss://");
41017
41017
  }
41018
- function Kn(r7) {
41018
+ function Jn(r7) {
41019
41019
  return typeof r7 == "object" && !Array.isArray(r7) && !(r7 instanceof URLSearchParams) && (r7 = Object.fromEntries(Object.entries(r7).filter((e) => e[1] !== void 0))), new URLSearchParams(r7).toString();
41020
41020
  }
41021
- var Bo = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-_]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-_]*[A-Za-z0-9])$/;
41022
- function il(r7) {
41023
- return Bo.test(r7);
41021
+ var jo = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-_]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-_]*[A-Za-z0-9])$/;
41022
+ function ul(r7) {
41023
+ return jo.test(r7);
41024
41024
  }
41025
- function lt(r7, e) {
41025
+ function qe(r7, e) {
41026
41026
  let t = [];
41027
41027
  if (r7.prefix && e?.prefix !== false && t.push(...r7.prefix), r7.given && t.push(...r7.given), r7.family && t.push(r7.family), r7.suffix && e?.suffix !== false && t.push(...r7.suffix), r7.use && (e?.all || e?.use) && t.push("[" + r7.use + "]"), t.length === 0) {
41028
41028
  let n = me(r7.text);
@@ -41030,12 +41030,12 @@ function lt(r7, e) {
41030
41030
  }
41031
41031
  return t.join(" ").trim();
41032
41032
  }
41033
- function at(r7) {
41033
+ function Be(r7) {
41034
41034
  if (!r7) return "";
41035
41035
  let e = me(r7.text);
41036
- return e || (r7.coding ? r7.coding.map((t) => Ho(t)).join(", ") : "");
41036
+ return e || (r7.coding ? r7.coding.map((t) => Zn(t)).join(", ") : "");
41037
41037
  }
41038
- function Ho(r7, e) {
41038
+ function Zn(r7, e) {
41039
41039
  let t = me(r7?.display);
41040
41040
  if (t) {
41041
41041
  let n = e ? me(r7?.code) : void 0;
@@ -41047,28 +41047,28 @@ function me(r7) {
41047
41047
  return typeof r7 == "string" ? r7 : void 0;
41048
41048
  }
41049
41049
  var l = { Address: "Address", Age: "Age", Annotation: "Annotation", Attachment: "Attachment", BackboneElement: "BackboneElement", CodeableConcept: "CodeableConcept", Coding: "Coding", ContactDetail: "ContactDetail", ContactPoint: "ContactPoint", Contributor: "Contributor", Count: "Count", DataRequirement: "DataRequirement", Distance: "Distance", Dosage: "Dosage", Duration: "Duration", Expression: "Expression", Extension: "Extension", HumanName: "HumanName", Identifier: "Identifier", MarketingStatus: "MarketingStatus", Meta: "Meta", Money: "Money", Narrative: "Narrative", ParameterDefinition: "ParameterDefinition", Period: "Period", Population: "Population", ProdCharacteristic: "ProdCharacteristic", ProductShelfLife: "ProductShelfLife", Quantity: "Quantity", Range: "Range", Ratio: "Ratio", Reference: "Reference", RelatedArtifact: "RelatedArtifact", SampledData: "SampledData", Signature: "Signature", SubstanceAmount: "SubstanceAmount", SystemString: "http://hl7.org/fhirpath/System.String", Timing: "Timing", TriggerDefinition: "TriggerDefinition", UsageContext: "UsageContext", base64Binary: "base64Binary", boolean: "boolean", canonical: "canonical", code: "code", date: "date", dateTime: "dateTime", decimal: "decimal", id: "id", instant: "instant", integer: "integer", markdown: "markdown", oid: "oid", positiveInt: "positiveInt", string: "string", time: "time", unsignedInt: "unsignedInt", uri: "uri", url: "url", uuid: "uuid" };
41050
- function Zn(r7) {
41050
+ function ti(r7) {
41051
41051
  let e = L.types[r7];
41052
41052
  return e || (e = { searchParamsDetails: {} }, L.types[r7] = e), e.searchParams || (e.searchParams = { _id: { base: [r7], code: "_id", type: "token", expression: r7 + ".id" }, _lastUpdated: { base: [r7], code: "_lastUpdated", type: "date", expression: r7 + ".meta.lastUpdated" }, _compartment: { base: [r7], code: "_compartment", type: "reference", expression: r7 + ".meta.compartment" }, _profile: { base: [r7], code: "_profile", type: "uri", expression: r7 + ".meta.profile" }, _security: { base: [r7], code: "_security", type: "token", expression: r7 + ".meta.security" }, _source: { base: [r7], code: "_source", type: "uri", expression: r7 + ".meta.source" }, _tag: { base: [r7], code: "_tag", type: "token", expression: r7 + ".meta.tag" } }), e;
41053
41053
  }
41054
- function Ar(r7) {
41054
+ function Or(r7) {
41055
41055
  for (let e of r7.base ?? []) {
41056
- let t = Zn(e);
41056
+ let t = ti(e);
41057
41057
  t.searchParams || (t.searchParams = {}), t.searchParams[r7.code] = r7;
41058
41058
  }
41059
41059
  }
41060
- function or(r7) {
41060
+ function sr(r7) {
41061
41061
  let e = r7.type?.[0]?.code;
41062
- return e === "BackboneElement" || e === "Element" ? Jo((r7.base?.path ?? r7.path)?.split(".")) : e;
41062
+ return e === "BackboneElement" || e === "Element" ? es((r7.base?.path ?? r7.path)?.split(".")) : e;
41063
41063
  }
41064
- function Jo(r7) {
41065
- return r7.length === 1 ? r7[0] : r7.map(w).join("");
41064
+ function es(r7) {
41065
+ return r7.length === 1 ? r7[0] : r7.map(O).join("");
41066
41066
  }
41067
- function st(r7, e, t) {
41067
+ function ct(r7, e, t) {
41068
41068
  let n = Le(r7, t);
41069
- if (n) return es(n.elements, e);
41069
+ if (n) return is(n.elements, e);
41070
41070
  }
41071
- function es(r7, e) {
41071
+ function is(r7, e) {
41072
41072
  let t = r7[e] ?? r7[e + "[x]"];
41073
41073
  if (t) return t;
41074
41074
  for (let n = 0; n < e.length; n++) {
@@ -41082,11 +41082,11 @@ function es(r7, e) {
41082
41082
  function I(r7) {
41083
41083
  return !!(r7 && typeof r7 == "object" && "resourceType" in r7);
41084
41084
  }
41085
- function ue(r7) {
41085
+ function le(r7) {
41086
41086
  return !!(r7 && typeof r7 == "object" && "reference" in r7 && typeof r7.reference == "string");
41087
41087
  }
41088
41088
  var L = { types: {} };
41089
- function Oe(r7) {
41089
+ function Ie(r7) {
41090
41090
  if (r7.startsWith("T")) return r7 + "T00:00:00.000Z".substring(r7.length);
41091
41091
  if (r7.length <= 10) return r7;
41092
41092
  try {
@@ -41096,7 +41096,7 @@ function Oe(r7) {
41096
41096
  }
41097
41097
  }
41098
41098
  var z = () => [];
41099
- var O = { empty: (r7, e) => f(e.length === 0 || e.every((t) => S(t.value))), hasValue: (r7, e) => f(e.length !== 0), exists: (r7, e, t) => t ? f(e.filter((n) => N(t.eval(r7, [n]))).length > 0) : f(e.length > 0 && e.every((n) => !S(n.value))), all: (r7, e, t) => f(e.every((n) => N(t.eval(r7, [n])))), allTrue: (r7, e) => {
41099
+ var A = { empty: (r7, e) => f(e.length === 0 || e.every((t) => S(t.value))), hasValue: (r7, e) => f(e.length !== 0), exists: (r7, e, t) => t ? f(e.filter((n) => N(t.eval(r7, [n]))).length > 0) : f(e.length > 0 && e.every((n) => !S(n.value))), all: (r7, e, t) => f(e.every((n) => N(t.eval(r7, [n])))), allTrue: (r7, e) => {
41100
41100
  for (let t of e) if (!t.value) return f(false);
41101
41101
  return f(true);
41102
41102
  }, anyTrue: (r7, e) => {
@@ -41119,7 +41119,7 @@ var O = { empty: (r7, e) => f(e.length === 0 || e.every((t) => S(t.value))), has
41119
41119
  let t = [];
41120
41120
  for (let n of e) t.some((i) => i.value === n.value) || t.push(n);
41121
41121
  return t;
41122
- }, isDistinct: (r7, e) => f(e.length === O.distinct(r7, e).length), where: (r7, e, t) => e.filter((n) => N(t.eval(r7, [n]))), select: (r7, e, t) => e.map((n) => t.eval({ parent: r7, variables: { $this: n } }, [n])).flat(), repeat: z, ofType: (r7, e, t) => e.filter((n) => n.type === t.name), single: (r7, e) => {
41122
+ }, isDistinct: (r7, e) => f(e.length === A.distinct(r7, e).length), where: (r7, e, t) => e.filter((n) => N(t.eval(r7, [n]))), select: (r7, e, t) => e.map((n) => t.eval({ parent: r7, variables: { $this: n } }, [n])).flat(), repeat: z, ofType: (r7, e, t) => e.filter((n) => n.type === t.name), single: (r7, e) => {
41123
41123
  if (e.length > 1) throw new Error("Expected input length one for single()");
41124
41124
  return e.length === 0 ? [] : e.slice(0, 1);
41125
41125
  }, first: (r7, e) => e.length === 0 ? [] : e.slice(0, 1), last: (r7, e) => e.length === 0 ? [] : e.slice(e.length - 1, e.length), tail: (r7, e) => e.length === 0 ? [] : e.slice(1, e.length), skip: (r7, e, t) => {
@@ -41143,7 +41143,7 @@ var O = { empty: (r7, e) => f(e.length === 0 || e.every((t) => S(t.value))), has
41143
41143
  }, union: (r7, e, t) => {
41144
41144
  if (!t) return e;
41145
41145
  let n = t.eval(r7, he(r7));
41146
- return it([...e, ...n]);
41146
+ return st([...e, ...n]);
41147
41147
  }, combine: (r7, e, t) => {
41148
41148
  if (!t) return e;
41149
41149
  let n = t.eval(r7, he(r7));
@@ -41163,39 +41163,39 @@ var O = { empty: (r7, e) => f(e.length === 0 || e.every((t) => S(t.value))), has
41163
41163
  if (["false", "f", "no", "n", "0", "0.0"].includes(n)) return f(false);
41164
41164
  }
41165
41165
  return [];
41166
- }, convertsToBoolean: (r7, e) => e.length === 0 ? [] : f(O.toBoolean(r7, e).length === 1), toInteger: (r7, e) => {
41166
+ }, convertsToBoolean: (r7, e) => e.length === 0 ? [] : f(A.toBoolean(r7, e).length === 1), toInteger: (r7, e) => {
41167
41167
  if (e.length === 0) return [];
41168
41168
  let [{ value: t }] = G(e, 1);
41169
41169
  return typeof t == "number" ? [{ type: l.integer, value: t }] : typeof t == "string" && /^[+-]?\d+$/.exec(t) ? [{ type: l.integer, value: parseInt(t, 10) }] : typeof t == "boolean" ? [{ type: l.integer, value: t ? 1 : 0 }] : [];
41170
- }, convertsToInteger: (r7, e) => e.length === 0 ? [] : f(O.toInteger(r7, e).length === 1), toDate: (r7, e) => {
41170
+ }, convertsToInteger: (r7, e) => e.length === 0 ? [] : f(A.toInteger(r7, e).length === 1), toDate: (r7, e) => {
41171
41171
  if (e.length === 0) return [];
41172
41172
  let [{ value: t }] = G(e, 1);
41173
- return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: l.date, value: Oe(t) }] : [];
41174
- }, convertsToDate: (r7, e) => e.length === 0 ? [] : f(O.toDate(r7, e).length === 1), toDateTime: (r7, e) => {
41173
+ return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: l.date, value: Ie(t) }] : [];
41174
+ }, convertsToDate: (r7, e) => e.length === 0 ? [] : f(A.toDate(r7, e).length === 1), toDateTime: (r7, e) => {
41175
41175
  if (e.length === 0) return [];
41176
41176
  let [{ value: t }] = G(e, 1);
41177
- return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: l.dateTime, value: Oe(t) }] : [];
41178
- }, convertsToDateTime: (r7, e) => e.length === 0 ? [] : f(O.toDateTime(r7, e).length === 1), toDecimal: (r7, e) => {
41177
+ return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: l.dateTime, value: Ie(t) }] : [];
41178
+ }, convertsToDateTime: (r7, e) => e.length === 0 ? [] : f(A.toDateTime(r7, e).length === 1), toDecimal: (r7, e) => {
41179
41179
  if (e.length === 0) return [];
41180
41180
  let [{ value: t }] = G(e, 1);
41181
41181
  return typeof t == "number" ? [{ type: l.decimal, value: t }] : typeof t == "string" && /^-?\d{1,9}(\.\d{1,9})?$/.exec(t) ? [{ type: l.decimal, value: parseFloat(t) }] : typeof t == "boolean" ? [{ type: l.decimal, value: t ? 1 : 0 }] : [];
41182
- }, convertsToDecimal: (r7, e) => e.length === 0 ? [] : f(O.toDecimal(r7, e).length === 1), toQuantity: (r7, e) => {
41182
+ }, convertsToDecimal: (r7, e) => e.length === 0 ? [] : f(A.toDecimal(r7, e).length === 1), toQuantity: (r7, e) => {
41183
41183
  if (e.length === 0) return [];
41184
41184
  let [{ value: t }] = G(e, 1);
41185
41185
  return k(t) ? [{ type: l.Quantity, value: t }] : typeof t == "number" ? [{ type: l.Quantity, value: { value: t, unit: "1" } }] : typeof t == "string" && /^-?\d{1,9}(\.\d{1,9})?/.exec(t) ? [{ type: l.Quantity, value: { value: parseFloat(t), unit: "1" } }] : typeof t == "boolean" ? [{ type: l.Quantity, value: { value: t ? 1 : 0, unit: "1" } }] : [];
41186
- }, convertsToQuantity: (r7, e) => e.length === 0 ? [] : f(O.toQuantity(r7, e).length === 1), toString: (r7, e) => {
41186
+ }, convertsToQuantity: (r7, e) => e.length === 0 ? [] : f(A.toQuantity(r7, e).length === 1), toString: (r7, e) => {
41187
41187
  if (e.length === 0) return [];
41188
41188
  let [{ value: t }] = G(e, 1);
41189
41189
  return t == null ? [] : k(t) ? [{ type: l.string, value: `${t.value} '${t.unit}'` }] : [{ type: l.string, value: t.toString() }];
41190
- }, convertsToString: (r7, e) => e.length === 0 ? [] : f(O.toString(r7, e).length === 1), toTime: (r7, e) => {
41190
+ }, convertsToString: (r7, e) => e.length === 0 ? [] : f(A.toString(r7, e).length === 1), toTime: (r7, e) => {
41191
41191
  if (e.length === 0) return [];
41192
41192
  let [{ value: t }] = G(e, 1);
41193
41193
  if (typeof t == "string") {
41194
41194
  let n = /^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(t);
41195
- if (n) return [{ type: l.time, value: Oe("T" + n[1]) }];
41195
+ if (n) return [{ type: l.time, value: Ie("T" + n[1]) }];
41196
41196
  }
41197
41197
  return [];
41198
- }, convertsToTime: (r7, e) => e.length === 0 ? [] : f(O.toTime(r7, e).length === 1), indexOf: (r7, e, t) => F((n, i) => n.indexOf(i), r7, e, t), substring: (r7, e, t, n) => F((i, o, s) => {
41198
+ }, convertsToTime: (r7, e) => e.length === 0 ? [] : f(A.toTime(r7, e).length === 1), indexOf: (r7, e, t) => F((n, i) => n.indexOf(i), r7, e, t), substring: (r7, e, t, n) => F((i, o, s) => {
41199
41199
  let a2 = o, c = s ? a2 + s : i.length;
41200
41200
  return a2 < 0 || a2 >= i.length ? void 0 : i.substring(a2, c);
41201
41201
  }, r7, e, t, n), startsWith: (r7, e, t) => F((n, i) => n.startsWith(i), r7, e, t), endsWith: (r7, e, t) => F((n, i) => n.endsWith(i), r7, e, t), contains: (r7, e, t) => F((n, i) => n.includes(i), r7, e, t), upper: (r7, e) => F((t) => t.toUpperCase(), r7, e), lower: (r7, e) => F((t) => t.toLowerCase(), r7, e), replace: (r7, e, t, n) => F((i, o, s) => i.replaceAll(o, s), r7, e, t, n), matches: (r7, e, t) => F((n, i) => !!new RegExp(i).exec(n), r7, e, t), replaceMatches: (r7, e, t, n) => F((i, o, s) => i.replaceAll(o, s), r7, e, t, n), length: (r7, e) => F((t) => t.length, r7, e), toChars: (r7, e) => F((t) => t ? t.split("") : void 0, r7, e), encode: z, decode: z, escape: z, unescape: z, trim: z, split: z, join: (r7, e, t) => {
@@ -41203,18 +41203,18 @@ var O = { empty: (r7, e) => f(e.length === 0 || e.every((t) => S(t.value))), has
41203
41203
  if (typeof n != "string") throw new Error("Separator must be a string.");
41204
41204
  return [{ type: l.string, value: e.map((i) => i.value?.toString() ?? "").join(n) }];
41205
41205
  }, abs: (r7, e) => $(Math.abs, r7, e), ceiling: (r7, e) => $(Math.ceil, r7, e), exp: (r7, e) => $(Math.exp, r7, e), floor: (r7, e) => $(Math.floor, r7, e), ln: (r7, e) => $(Math.log, r7, e), log: (r7, e, t) => $((n, i) => Math.log(n) / Math.log(i), r7, e, t), power: (r7, e, t) => $(Math.pow, r7, e, t), round: (r7, e) => $(Math.round, r7, e), sqrt: (r7, e) => $(Math.sqrt, r7, e), truncate: (r7, e) => $((t) => t | 0, r7, e), children: z, descendants: z, trace: (r7, e, t) => e, now: () => [{ type: l.dateTime, value: (/* @__PURE__ */ new Date()).toISOString() }], timeOfDay: () => [{ type: l.time, value: (/* @__PURE__ */ new Date()).toISOString().substring(11) }], today: () => [{ type: l.date, value: (/* @__PURE__ */ new Date()).toISOString().substring(0, 10) }], between: (r7, e, t, n, i) => {
41206
- let o = O.toDateTime(r7, t.eval(r7, e));
41206
+ let o = A.toDateTime(r7, t.eval(r7, e));
41207
41207
  if (o.length === 0) throw new Error("Invalid start date");
41208
- let s = O.toDateTime(r7, n.eval(r7, e));
41208
+ let s = A.toDateTime(r7, n.eval(r7, e));
41209
41209
  if (s.length === 0) throw new Error("Invalid end date");
41210
41210
  let a2 = i.eval(r7, e)[0]?.value;
41211
41211
  if (a2 !== "years" && a2 !== "months" && a2 !== "days") throw new Error("Invalid units");
41212
- let c = ct(o[0].value, s[0].value);
41212
+ let c = ut(o[0].value, s[0].value);
41213
41213
  return [{ type: l.Quantity, value: { value: c[a2], unit: a2 } }];
41214
41214
  }, is: (r7, e, t) => {
41215
41215
  let n = "";
41216
- return t instanceof q ? n = t.name : t instanceof re && (n = t.left.name + "." + t.right.name), n ? e.map((i) => ({ type: l.boolean, value: ot(i, n) })) : [];
41217
- }, not: (r7, e) => O.toBoolean(r7, e).map((t) => ({ type: l.boolean, value: !t.value })), resolve: (r7, e) => e.map((t) => {
41216
+ return t instanceof q ? n = t.name : t instanceof ne && (n = t.left.name + "." + t.right.name), n ? e.map((i) => ({ type: l.boolean, value: at(i, n) })) : [];
41217
+ }, not: (r7, e) => A.toBoolean(r7, e).map((t) => ({ type: l.boolean, value: !t.value })), resolve: (r7, e) => e.map((t) => {
41218
41218
  let n = t.value, i;
41219
41219
  if (typeof n == "string") i = n;
41220
41220
  else if (typeof n == "object") {
@@ -41243,7 +41243,7 @@ var O = { empty: (r7, e) => f(e.length === 0 || e.every((t) => S(t.value))), has
41243
41243
  let n = e[0].value;
41244
41244
  if (!n?.reference) return [];
41245
41245
  let i = "";
41246
- return t instanceof q && (i = t.name), i && !n.reference.startsWith(i + "/") ? [] : [{ type: l.id, value: pe(n) }];
41246
+ return t instanceof q && (i = t.name), i && !n.reference.startsWith(i + "/") ? [] : [{ type: l.id, value: de(n) }];
41247
41247
  }, extension: (r7, e, t) => {
41248
41248
  let n = t.eval(r7, e)[0].value, i = e?.[0]?.value;
41249
41249
  if (i) {
@@ -41312,7 +41312,7 @@ var q = class {
41312
41312
  return this.name;
41313
41313
  }
41314
41314
  };
41315
- var dt = class {
41315
+ var ft = class {
41316
41316
  eval() {
41317
41317
  return [];
41318
41318
  }
@@ -41320,7 +41320,7 @@ var dt = class {
41320
41320
  return "{}";
41321
41321
  }
41322
41322
  };
41323
- var ft = class extends ze {
41323
+ var mt = class extends Ye {
41324
41324
  constructor(t, n, i) {
41325
41325
  super(t, n);
41326
41326
  this.impl = i;
@@ -41337,7 +41337,7 @@ var ye = class extends Y {
41337
41337
  super("as", e, t);
41338
41338
  }
41339
41339
  eval(e, t) {
41340
- return O.ofType(e, this.left.eval(e, t), this.right);
41340
+ return A.ofType(e, this.left.eval(e, t), this.right);
41341
41341
  }
41342
41342
  };
41343
41343
  var C = class extends Y {
@@ -41356,7 +41356,7 @@ var V = class extends C {
41356
41356
  return typeof p2 == "boolean" ? f(p2) : k(s) ? [{ type: l.Quantity, value: { ...s, value: p2 } }] : [g(p2)];
41357
41357
  }
41358
41358
  };
41359
- var mt = class extends Y {
41359
+ var ht = class extends Y {
41360
41360
  constructor(e, t) {
41361
41361
  super("&", e, t);
41362
41362
  }
@@ -41365,7 +41365,7 @@ var mt = class extends Y {
41365
41365
  return o.length > 0 && o.every((s) => typeof s.value == "string") ? [{ type: l.string, value: o.map((s) => s.value).join("") }] : o;
41366
41366
  }
41367
41367
  };
41368
- var ht = class extends C {
41368
+ var yt = class extends C {
41369
41369
  constructor(e, t) {
41370
41370
  super("contains", e, t);
41371
41371
  }
@@ -41374,16 +41374,16 @@ var ht = class extends C {
41374
41374
  return f(n.some((o) => o.value === i[0].value));
41375
41375
  }
41376
41376
  };
41377
- var yt = class extends C {
41377
+ var gt = class extends C {
41378
41378
  constructor(e, t) {
41379
41379
  super("in", e, t);
41380
41380
  }
41381
41381
  eval(e, t) {
41382
- let n = j(this.left.eval(e, t)), i = this.right.eval(e, t);
41382
+ let n = W(this.left.eval(e, t)), i = this.right.eval(e, t);
41383
41383
  return n ? f(i.some((o) => o.value === n.value)) : [];
41384
41384
  }
41385
41385
  };
41386
- var re = class extends Y {
41386
+ var ne = class extends Y {
41387
41387
  constructor(e, t) {
41388
41388
  super(".", e, t);
41389
41389
  }
@@ -41394,49 +41394,49 @@ var re = class extends Y {
41394
41394
  return `${this.left.toString()}.${this.right.toString()}`;
41395
41395
  }
41396
41396
  };
41397
- var Ie = class extends Y {
41397
+ var ke = class extends Y {
41398
41398
  constructor(e, t) {
41399
41399
  super("|", e, t);
41400
41400
  }
41401
41401
  eval(e, t) {
41402
41402
  let n = this.left.eval(e, t), i = this.right.eval(e, t);
41403
- return it([...n, ...i]);
41403
+ return st([...n, ...i]);
41404
41404
  }
41405
41405
  };
41406
- var gt = class extends C {
41406
+ var xt = class extends C {
41407
41407
  constructor(e, t) {
41408
41408
  super("=", e, t);
41409
41409
  }
41410
41410
  eval(e, t) {
41411
41411
  let n = this.left.eval(e, t), i = this.right.eval(e, t);
41412
- return In(n, i);
41412
+ return Dn(n, i);
41413
41413
  }
41414
41414
  };
41415
- var xt = class extends C {
41415
+ var vt = class extends C {
41416
41416
  constructor(e, t) {
41417
41417
  super("!=", e, t);
41418
41418
  }
41419
41419
  eval(e, t) {
41420
41420
  let n = this.left.eval(e, t), i = this.right.eval(e, t);
41421
- return kn(n, i);
41421
+ return Mn(n, i);
41422
41422
  }
41423
41423
  };
41424
- var vt = class extends C {
41424
+ var Tt = class extends C {
41425
41425
  constructor(e, t) {
41426
41426
  super("~", e, t);
41427
41427
  }
41428
41428
  eval(e, t) {
41429
41429
  let n = this.left.eval(e, t), i = this.right.eval(e, t);
41430
- return gr(n, i);
41430
+ return xr(n, i);
41431
41431
  }
41432
41432
  };
41433
- var Tt = class extends C {
41433
+ var St = class extends C {
41434
41434
  constructor(e, t) {
41435
41435
  super("!~", e, t);
41436
41436
  }
41437
41437
  eval(e, t) {
41438
41438
  let n = this.left.eval(e, t), i = this.right.eval(e, t);
41439
- return On(gr(n, i));
41439
+ return Vn(xr(n, i));
41440
41440
  }
41441
41441
  };
41442
41442
  var ge = class extends C {
@@ -41447,42 +41447,42 @@ var ge = class extends C {
41447
41447
  let n = this.left.eval(e, t);
41448
41448
  if (n.length !== 1) return [];
41449
41449
  let i = this.right.name;
41450
- return f(ot(n[0], i));
41450
+ return f(at(n[0], i));
41451
41451
  }
41452
41452
  };
41453
- var St = class extends C {
41453
+ var Et = class extends C {
41454
41454
  constructor(e, t) {
41455
41455
  super("and", e, t);
41456
41456
  }
41457
41457
  eval(e, t) {
41458
- let n = j(this.left.eval(e, t), "boolean"), i = j(this.right.eval(e, t), "boolean");
41458
+ let n = W(this.left.eval(e, t), "boolean"), i = W(this.right.eval(e, t), "boolean");
41459
41459
  return n?.value === true && i?.value === true ? f(true) : n?.value === false || i?.value === false ? f(false) : [];
41460
41460
  }
41461
41461
  };
41462
- var Et = class extends C {
41462
+ var bt = class extends C {
41463
41463
  constructor(e, t) {
41464
41464
  super("or", e, t);
41465
41465
  }
41466
41466
  eval(e, t) {
41467
- let n = j(this.left.eval(e, t), "boolean"), i = j(this.right.eval(e, t), "boolean");
41467
+ let n = W(this.left.eval(e, t), "boolean"), i = W(this.right.eval(e, t), "boolean");
41468
41468
  return n?.value === false && i?.value === false ? f(false) : n?.value || i?.value ? f(true) : [];
41469
41469
  }
41470
41470
  };
41471
- var bt = class extends C {
41471
+ var Rt = class extends C {
41472
41472
  constructor(e, t) {
41473
41473
  super("xor", e, t);
41474
41474
  }
41475
41475
  eval(e, t) {
41476
- let n = j(this.left.eval(e, t), "boolean"), i = j(this.right.eval(e, t), "boolean");
41476
+ let n = W(this.left.eval(e, t), "boolean"), i = W(this.right.eval(e, t), "boolean");
41477
41477
  return !n || !i ? [] : f(n.value !== i.value);
41478
41478
  }
41479
41479
  };
41480
- var Rt = class extends C {
41480
+ var Ct = class extends C {
41481
41481
  constructor(e, t) {
41482
41482
  super("implies", e, t);
41483
41483
  }
41484
41484
  eval(e, t) {
41485
- let n = j(this.left.eval(e, t), "boolean"), i = j(this.right.eval(e, t), "boolean");
41485
+ let n = W(this.left.eval(e, t), "boolean"), i = W(this.right.eval(e, t), "boolean");
41486
41486
  return i?.value === true || n?.value === false ? f(true) : !n || !i ? [] : f(false);
41487
41487
  }
41488
41488
  };
@@ -41492,7 +41492,7 @@ var J = class {
41492
41492
  this.args = t;
41493
41493
  }
41494
41494
  eval(e, t) {
41495
- let n = O[this.name];
41495
+ let n = A[this.name];
41496
41496
  if (!n) throw new Error("Unrecognized function: " + this.name);
41497
41497
  return n(e, t, ...this.args);
41498
41498
  }
@@ -41517,36 +41517,36 @@ var xe = class {
41517
41517
  return `${this.left.toString()}[${this.expr.toString()}]`;
41518
41518
  }
41519
41519
  };
41520
- var qe = ["!=", "!~", "<=", ">=", "{}", "->"];
41520
+ var je = ["!=", "!~", "<=", ">=", "{}", "->"];
41521
41521
  var y = { FunctionCall: 0, Dot: 1, Indexer: 2, UnaryAdd: 3, UnarySubtract: 3, Multiply: 4, Divide: 4, IntegerDivide: 4, Modulo: 4, Add: 5, Subtract: 5, Ampersand: 5, Is: 6, As: 6, Union: 7, GreaterThan: 8, GreaterThanOrEquals: 8, LessThan: 8, LessThanOrEquals: 8, Equals: 9, Equivalent: 9, NotEquals: 9, NotEquivalent: 9, In: 10, Contains: 10, And: 11, Xor: 12, Or: 12, Implies: 13, Arrow: 100, Semicolon: 200 };
41522
- var ns = { parse(r7) {
41522
+ var as = { parse(r7) {
41523
41523
  let e = r7.consumeAndParse();
41524
41524
  if (!r7.match(")")) throw new Error("Parse error: expected `)` got `" + r7.peek()?.value + "`");
41525
41525
  return e;
41526
41526
  } };
41527
- var is = { parse(r7, e) {
41527
+ var cs = { parse(r7, e) {
41528
41528
  let t = r7.consumeAndParse();
41529
41529
  if (!r7.match("]")) throw new Error("Parse error: expected `]`");
41530
41530
  return new xe(e, t);
41531
41531
  }, precedence: y.Indexer };
41532
- var os = { parse(r7, e) {
41532
+ var us = { parse(r7, e) {
41533
41533
  if (!(e instanceof q)) throw new Error("Unexpected parentheses");
41534
41534
  let t = [];
41535
41535
  for (; !r7.match(")"); ) t.push(r7.consumeAndParse()), r7.match(",");
41536
41536
  return new J(e.name, t);
41537
41537
  }, precedence: y.FunctionCall };
41538
- function ss(r7) {
41538
+ function ls(r7) {
41539
41539
  let e = r7.split(" "), t = parseFloat(e[0]), n = e[1];
41540
41540
  return n?.startsWith("'") && n.endsWith("'") ? n = n.substring(1, n.length - 1) : n = "{" + n + "}", { value: t, unit: n };
41541
41541
  }
41542
- function je() {
41543
- return new Je().registerPrefix("String", { parse: (r7, e) => new U({ type: l.string, value: e.value }) }).registerPrefix("DateTime", { parse: (r7, e) => new U({ type: l.dateTime, value: Oe(e.value) }) }).registerPrefix("Quantity", { parse: (r7, e) => new U({ type: l.Quantity, value: ss(e.value) }) }).registerPrefix("Number", { parse: (r7, e) => new U({ type: e.value.includes(".") ? l.decimal : l.integer, value: parseFloat(e.value) }) }).registerPrefix("true", { parse: () => new U({ type: l.boolean, value: true }) }).registerPrefix("false", { parse: () => new U({ type: l.boolean, value: false }) }).registerPrefix("Symbol", { parse: (r7, e) => new q(e.value) }).registerPrefix("{}", { parse: () => new dt() }).registerPrefix("(", ns).registerInfix("[", is).registerInfix("(", os).prefix("+", y.UnaryAdd, (r7, e) => new ft("+", e, (t) => t)).prefix("-", y.UnarySubtract, (r7, e) => new V("-", e, e, (t, n) => -n)).infixLeft(".", y.Dot, (r7, e, t) => new re(r7, t)).infixLeft("/", y.Divide, (r7, e, t) => new V("/", r7, t, (n, i) => n / i)).infixLeft("*", y.Multiply, (r7, e, t) => new V("*", r7, t, (n, i) => n * i)).infixLeft("+", y.Add, (r7, e, t) => new V("+", r7, t, (n, i) => n + i)).infixLeft("-", y.Subtract, (r7, e, t) => new V("-", r7, t, (n, i) => n - i)).infixLeft("|", y.Union, (r7, e, t) => new Ie(r7, t)).infixLeft("=", y.Equals, (r7, e, t) => new gt(r7, t)).infixLeft("!=", y.NotEquals, (r7, e, t) => new xt(r7, t)).infixLeft("~", y.Equivalent, (r7, e, t) => new vt(r7, t)).infixLeft("!~", y.NotEquivalent, (r7, e, t) => new Tt(r7, t)).infixLeft("<", y.LessThan, (r7, e, t) => new V("<", r7, t, (n, i) => n < i)).infixLeft("<=", y.LessThanOrEquals, (r7, e, t) => new V("<=", r7, t, (n, i) => n <= i)).infixLeft(">", y.GreaterThan, (r7, e, t) => new V(">", r7, t, (n, i) => n > i)).infixLeft(">=", y.GreaterThanOrEquals, (r7, e, t) => new V(">=", r7, t, (n, i) => n >= i)).infixLeft("&", y.Ampersand, (r7, e, t) => new mt(r7, t)).infixLeft("and", y.And, (r7, e, t) => new St(r7, t)).infixLeft("as", y.As, (r7, e, t) => new ye(r7, t)).infixLeft("contains", y.Contains, (r7, e, t) => new ht(r7, t)).infixLeft("div", y.Divide, (r7, e, t) => new V("div", r7, t, (n, i) => n / i | 0)).infixLeft("in", y.In, (r7, e, t) => new yt(r7, t)).infixLeft("is", y.Is, (r7, e, t) => new ge(r7, t)).infixLeft("mod", y.Modulo, (r7, e, t) => new V("mod", r7, t, (n, i) => n % i)).infixLeft("or", y.Or, (r7, e, t) => new Et(r7, t)).infixLeft("xor", y.Xor, (r7, e, t) => new bt(r7, t)).infixLeft("implies", y.Implies, (r7, e, t) => new Rt(r7, t));
41542
+ function $e() {
41543
+ return new Ze().registerPrefix("String", { parse: (r7, e) => new U({ type: l.string, value: e.value }) }).registerPrefix("DateTime", { parse: (r7, e) => new U({ type: l.dateTime, value: Ie(e.value) }) }).registerPrefix("Quantity", { parse: (r7, e) => new U({ type: l.Quantity, value: ls(e.value) }) }).registerPrefix("Number", { parse: (r7, e) => new U({ type: e.value.includes(".") ? l.decimal : l.integer, value: parseFloat(e.value) }) }).registerPrefix("true", { parse: () => new U({ type: l.boolean, value: true }) }).registerPrefix("false", { parse: () => new U({ type: l.boolean, value: false }) }).registerPrefix("Symbol", { parse: (r7, e) => new q(e.value) }).registerPrefix("{}", { parse: () => new ft() }).registerPrefix("(", as).registerInfix("[", cs).registerInfix("(", us).prefix("+", y.UnaryAdd, (r7, e) => new mt("+", e, (t) => t)).prefix("-", y.UnarySubtract, (r7, e) => new V("-", e, e, (t, n) => -n)).infixLeft(".", y.Dot, (r7, e, t) => new ne(r7, t)).infixLeft("/", y.Divide, (r7, e, t) => new V("/", r7, t, (n, i) => n / i)).infixLeft("*", y.Multiply, (r7, e, t) => new V("*", r7, t, (n, i) => n * i)).infixLeft("+", y.Add, (r7, e, t) => new V("+", r7, t, (n, i) => n + i)).infixLeft("-", y.Subtract, (r7, e, t) => new V("-", r7, t, (n, i) => n - i)).infixLeft("|", y.Union, (r7, e, t) => new ke(r7, t)).infixLeft("=", y.Equals, (r7, e, t) => new xt(r7, t)).infixLeft("!=", y.NotEquals, (r7, e, t) => new vt(r7, t)).infixLeft("~", y.Equivalent, (r7, e, t) => new Tt(r7, t)).infixLeft("!~", y.NotEquivalent, (r7, e, t) => new St(r7, t)).infixLeft("<", y.LessThan, (r7, e, t) => new V("<", r7, t, (n, i) => n < i)).infixLeft("<=", y.LessThanOrEquals, (r7, e, t) => new V("<=", r7, t, (n, i) => n <= i)).infixLeft(">", y.GreaterThan, (r7, e, t) => new V(">", r7, t, (n, i) => n > i)).infixLeft(">=", y.GreaterThanOrEquals, (r7, e, t) => new V(">=", r7, t, (n, i) => n >= i)).infixLeft("&", y.Ampersand, (r7, e, t) => new ht(r7, t)).infixLeft("and", y.And, (r7, e, t) => new Et(r7, t)).infixLeft("as", y.As, (r7, e, t) => new ye(r7, t)).infixLeft("contains", y.Contains, (r7, e, t) => new yt(r7, t)).infixLeft("div", y.Divide, (r7, e, t) => new V("div", r7, t, (n, i) => n / i | 0)).infixLeft("in", y.In, (r7, e, t) => new gt(r7, t)).infixLeft("is", y.Is, (r7, e, t) => new ge(r7, t)).infixLeft("mod", y.Modulo, (r7, e, t) => new V("mod", r7, t, (n, i) => n % i)).infixLeft("or", y.Or, (r7, e, t) => new bt(r7, t)).infixLeft("xor", y.Xor, (r7, e, t) => new Rt(r7, t)).infixLeft("implies", y.Implies, (r7, e, t) => new Ct(r7, t));
41544
41544
  }
41545
- var as = je();
41546
- var ti = ((p2) => (p2.BOOLEAN = "BOOLEAN", p2.NUMBER = "NUMBER", p2.QUANTITY = "QUANTITY", p2.TEXT = "TEXT", p2.REFERENCE = "REFERENCE", p2.CANONICAL = "CANONICAL", p2.DATE = "DATE", p2.DATETIME = "DATETIME", p2.PERIOD = "PERIOD", p2.UUID = "UUID", p2))(ti || {});
41547
- var ai = ((v) => (v.EQUALS = "eq", v.NOT_EQUALS = "ne", v.GREATER_THAN = "gt", v.LESS_THAN = "lt", v.GREATER_THAN_OR_EQUALS = "ge", v.LESS_THAN_OR_EQUALS = "le", v.STARTS_AFTER = "sa", v.ENDS_BEFORE = "eb", v.APPROXIMATELY = "ap", v.CONTAINS = "contains", v.STARTS_WITH = "sw", v.EXACT = "exact", v.TEXT = "text", v.NOT = "not", v.ABOVE = "above", v.BELOW = "below", v.IN = "in", v.NOT_IN = "not-in", v.OF_TYPE = "of-type", v.MISSING = "missing", v.PRESENT = "present", v.IDENTIFIER = "identifier", v.ITERATE = "iterate", v))(ai || {});
41548
- var Ns = ((b2) => (b2.READ = "read", b2.VREAD = "vread", b2.UPDATE = "update", b2.PATCH = "patch", b2.DELETE = "delete", b2.HISTORY = "history", b2.HISTORY_INSTANCE = "history-instance", b2.HISTORY_TYPE = "history-type", b2.HISTORY_SYSTEM = "history-system", b2.CREATE = "create", b2.SEARCH = "search", b2.SEARCH_TYPE = "search-type", b2.SEARCH_SYSTEM = "search-system", b2.SEARCH_COMPARTMENT = "search-compartment", b2.CAPABILITIES = "capabilities", b2.TRANSACTION = "transaction", b2.BATCH = "batch", b2.OPERATION = "operation", b2))(Ns || {});
41549
- function pi(r7) {
41545
+ var ps = $e();
41546
+ var ii = ((p2) => (p2.BOOLEAN = "BOOLEAN", p2.NUMBER = "NUMBER", p2.QUANTITY = "QUANTITY", p2.TEXT = "TEXT", p2.REFERENCE = "REFERENCE", p2.CANONICAL = "CANONICAL", p2.DATE = "DATE", p2.DATETIME = "DATETIME", p2.PERIOD = "PERIOD", p2.UUID = "UUID", p2))(ii || {});
41547
+ var li = ((v) => (v.EQUALS = "eq", v.NOT_EQUALS = "ne", v.GREATER_THAN = "gt", v.LESS_THAN = "lt", v.GREATER_THAN_OR_EQUALS = "ge", v.LESS_THAN_OR_EQUALS = "le", v.STARTS_AFTER = "sa", v.ENDS_BEFORE = "eb", v.APPROXIMATELY = "ap", v.CONTAINS = "contains", v.STARTS_WITH = "sw", v.EXACT = "exact", v.TEXT = "text", v.NOT = "not", v.ABOVE = "above", v.BELOW = "below", v.IN = "in", v.NOT_IN = "not-in", v.OF_TYPE = "of-type", v.MISSING = "missing", v.PRESENT = "present", v.IDENTIFIER = "identifier", v.ITERATE = "iterate", v))(li || {});
41548
+ var Us = ((b2) => (b2.READ = "read", b2.VREAD = "vread", b2.UPDATE = "update", b2.PATCH = "patch", b2.DELETE = "delete", b2.HISTORY = "history", b2.HISTORY_INSTANCE = "history-instance", b2.HISTORY_TYPE = "history-type", b2.HISTORY_SYSTEM = "history-system", b2.CREATE = "create", b2.SEARCH = "search", b2.SEARCH_TYPE = "search-type", b2.SEARCH_SYSTEM = "search-system", b2.SEARCH_COMPARTMENT = "search-compartment", b2.CAPABILITIES = "capabilities", b2.TRANSACTION = "transaction", b2.BATCH = "batch", b2.OPERATION = "operation", b2))(Us || {});
41549
+ function mi(r7) {
41550
41550
  if (typeof window < "u") {
41551
41551
  let e = window.atob(r7), t = Uint8Array.from(e, (n) => n.charCodeAt(0));
41552
41552
  return new window.TextDecoder().decode(t);
@@ -41554,7 +41554,7 @@ function pi(r7) {
41554
41554
  if (typeof Buffer < "u") return Buffer.from(r7, "base64").toString("utf-8");
41555
41555
  throw new Error("Unable to decode base64");
41556
41556
  }
41557
- function di(r7) {
41557
+ function hi(r7) {
41558
41558
  if (typeof window < "u") {
41559
41559
  let e = new window.TextEncoder().encode(r7), t = String.fromCharCode.apply(null, e);
41560
41560
  return window.btoa(t);
@@ -41562,11 +41562,11 @@ function di(r7) {
41562
41562
  if (typeof Buffer < "u") return Buffer.from(r7, "utf8").toString("base64");
41563
41563
  throw new Error("Unable to encode base64");
41564
41564
  }
41565
- function _r() {
41565
+ function Nr() {
41566
41566
  let r7 = new Uint32Array(28);
41567
- return crypto.getRandomValues(r7), qn(r7.buffer);
41567
+ return crypto.getRandomValues(r7), jn(r7.buffer);
41568
41568
  }
41569
- async function fi(r7) {
41569
+ async function yi(r7) {
41570
41570
  return crypto.subtle.digest("SHA-256", new TextEncoder().encode(r7));
41571
41571
  }
41572
41572
  function ve() {
@@ -41575,7 +41575,7 @@ function ve() {
41575
41575
  return (r7 === "x" ? e : e & 3 | 8).toString(16);
41576
41576
  });
41577
41577
  }
41578
- var At = class {
41578
+ var Ot = class {
41579
41579
  constructor(e = 10) {
41580
41580
  this.max = e, this.cache = /* @__PURE__ */ new Map();
41581
41581
  }
@@ -41600,7 +41600,7 @@ var At = class {
41600
41600
  }
41601
41601
  };
41602
41602
  var D = { CSS: "text/css", DICOM: "application/dicom", FAVICON: "image/vnd.microsoft.icon", FHIR_JSON: "application/fhir+json", FORM_URL_ENCODED: "application/x-www-form-urlencoded", HL7_V2: "x-application/hl7-v2+er7", HTML: "text/html", JAVASCRIPT: "text/javascript", JSON: "application/json", JSON_PATCH: "application/json-patch+json", PNG: "image/png", SCIM_JSON: "application/scim+json", SVG: "image/svg+xml", TEXT: "text/plain", TYPESCRIPT: "text/typescript", PING: "x-application/ping" };
41603
- var Nr = class {
41603
+ var Lr = class {
41604
41604
  constructor() {
41605
41605
  this.listeners = {};
41606
41606
  }
@@ -41627,7 +41627,7 @@ var Nr = class {
41627
41627
  };
41628
41628
  var H = class {
41629
41629
  constructor() {
41630
- this.emitter = new Nr();
41630
+ this.emitter = new Lr();
41631
41631
  }
41632
41632
  dispatchEvent(e) {
41633
41633
  this.emitter.dispatchEvent(e);
@@ -41642,76 +41642,76 @@ var H = class {
41642
41642
  this.emitter.removeAllListeners();
41643
41643
  }
41644
41644
  };
41645
- var Lr = { "Patient-open": "Patient-open", "Patient-close": "Patient-close", "ImagingStudy-open": "ImagingStudy-open", "ImagingStudy-close": "ImagingStudy-close", "Encounter-open": "Encounter-open", "Encounter-close": "Encounter-close", "DiagnosticReport-open": "DiagnosticReport-open", "DiagnosticReport-close": "DiagnosticReport-close", "DiagnosticReport-select": "DiagnosticReport-select", "DiagnosticReport-update": "DiagnosticReport-update", syncerror: "syncerror" };
41646
- var Gs = ["Patient", "Encounter", "ImagingStudy", "DiagnosticReport", "OperationOutcome", "Bundle"];
41647
- var Fr = ["DiagnosticReport-update"];
41648
- function yi(r7) {
41649
- return Fr.includes(r7);
41645
+ var Fr = { "Patient-open": "Patient-open", "Patient-close": "Patient-close", "ImagingStudy-open": "ImagingStudy-open", "ImagingStudy-close": "ImagingStudy-close", "Encounter-open": "Encounter-open", "Encounter-close": "Encounter-close", "DiagnosticReport-open": "DiagnosticReport-open", "DiagnosticReport-close": "DiagnosticReport-close", "DiagnosticReport-select": "DiagnosticReport-select", "DiagnosticReport-update": "DiagnosticReport-update", syncerror: "syncerror" };
41646
+ var Ks = ["Patient", "Encounter", "ImagingStudy", "DiagnosticReport", "OperationOutcome", "Bundle"];
41647
+ var Ur = ["DiagnosticReport-update"];
41648
+ function vi(r7) {
41649
+ return Ur.includes(r7);
41650
41650
  }
41651
- function gi(r7) {
41652
- if (Fr.includes(r7)) throw new d(h(`'context.version' is required for '${r7}'.`));
41651
+ function Ti(r7) {
41652
+ if (Ur.includes(r7)) throw new d(h(`'context.version' is required for '${r7}'.`));
41653
41653
  }
41654
- var Hs = { "Patient-open": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "Patient-close": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "ImagingStudy-open": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "ImagingStudy-close": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "Encounter-open": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "Encounter-close": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "DiagnosticReport-open": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-close": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-select": { report: { resourceType: "DiagnosticReport" }, select: { resourceType: "*", isArray: true } }, "DiagnosticReport-update": { report: { resourceType: "DiagnosticReport" }, patient: { resourceType: "Patient", optional: true }, study: { resourceType: "ImagingStudy", optional: true }, updates: { resourceType: "Bundle" } }, syncerror: { operationoutcome: { resourceType: "OperationOutcome" } } };
41655
- function Qs(r7) {
41656
- return Gs.includes(r7);
41654
+ var zs = { "Patient-open": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "Patient-close": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "ImagingStudy-open": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "ImagingStudy-close": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "Encounter-open": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "Encounter-close": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "DiagnosticReport-open": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-close": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-select": { report: { resourceType: "DiagnosticReport" }, select: { resourceType: "*", isArray: true } }, "DiagnosticReport-update": { report: { resourceType: "DiagnosticReport" }, patient: { resourceType: "Patient", optional: true }, study: { resourceType: "ImagingStudy", optional: true }, updates: { resourceType: "Bundle" } }, syncerror: { operationoutcome: { resourceType: "OperationOutcome" } } };
41655
+ function Js(r7) {
41656
+ return Ks.includes(r7);
41657
41657
  }
41658
- function xi(r7) {
41658
+ function Si(r7) {
41659
41659
  return !!r7.endpoint;
41660
41660
  }
41661
- function Ur(r7) {
41662
- if (!It(r7)) throw new d(h("subscriptionRequest must be an object conforming to SubscriptionRequest type."));
41661
+ function Br(r7) {
41662
+ if (!kt(r7)) throw new d(h("subscriptionRequest must be an object conforming to SubscriptionRequest type."));
41663
41663
  let { channelType: e, mode: t, topic: n, events: i } = r7, o = { "hub.channel.type": e, "hub.mode": t, "hub.topic": n, "hub.events": i.join(",") };
41664
- return xi(r7) && (o.endpoint = r7.endpoint), new URLSearchParams(o).toString();
41664
+ return Si(r7) && (o.endpoint = r7.endpoint), new URLSearchParams(o).toString();
41665
41665
  }
41666
- function It(r7) {
41666
+ function kt(r7) {
41667
41667
  if (typeof r7 != "object") return false;
41668
41668
  let { channelType: e, mode: t, topic: n, events: i } = r7;
41669
41669
  if (!(e && t && n && i) || typeof n != "string" || typeof i != "object" || !Array.isArray(i) || i.length < 1 || e !== "websocket" || t !== "subscribe" && t !== "unsubscribe") return false;
41670
- for (let o of i) if (!Lr[o]) return false;
41671
- return !(xi(r7) && !(typeof r7.endpoint == "string" && r7.endpoint.startsWith("ws")));
41670
+ for (let o of i) if (!Fr[o]) return false;
41671
+ return !(Si(r7) && !(typeof r7.endpoint == "string" && r7.endpoint.startsWith("ws")));
41672
41672
  }
41673
- function hi(r7, e, t, n) {
41673
+ function xi(r7, e, t, n) {
41674
41674
  if (typeof e != "object") throw new d(h(`context[${t}] is invalid. Context must contain a single valid FHIR resource! Resource is not an object.`));
41675
41675
  if (!(e.id && typeof e.id == "string")) throw new d(h(`context[${t}] is invalid. Resource must contain a valid string ID.`));
41676
41676
  if (!e.resourceType) throw new d(h(`context[${t}] is invalid. Resource must contain a resource type. No resource type found.`));
41677
41677
  let i = n.resourceType;
41678
41678
  if (i !== "*") {
41679
- if (!Qs(e.resourceType)) throw new d(h(`context[${t}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));
41679
+ if (!Js(e.resourceType)) throw new d(h(`context[${t}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));
41680
41680
  if (i && e.resourceType !== i) throw new d(h(`context[${t}] is invalid. context[${t}] for the '${r7}' event should contain resource of type ${i}.`));
41681
41681
  }
41682
41682
  }
41683
- function Ks(r7, e, t, n, i) {
41684
- if (i.set(e.key, (i.get(e.key) ?? 0) + 1), !n.isArray) hi(r7, e.resource, t, n);
41683
+ function Ys(r7, e, t, n, i) {
41684
+ if (i.set(e.key, (i.get(e.key) ?? 0) + 1), !n.isArray) xi(r7, e.resource, t, n);
41685
41685
  else {
41686
41686
  let { resources: o } = e;
41687
41687
  if (!o) throw new d(h(`context[${t}] is invalid. context[${t}] for the '${r7}' with key '${String(e.key)}' should contain an array of resources on the key 'resources'.`));
41688
- for (let s of o) hi(r7, s, t, n);
41688
+ for (let s of o) xi(r7, s, t, n);
41689
41689
  }
41690
41690
  }
41691
- function zs(r7, e) {
41692
- let t = /* @__PURE__ */ new Map(), n = Hs[r7];
41691
+ function Zs(r7, e) {
41692
+ let t = /* @__PURE__ */ new Map(), n = zs[r7];
41693
41693
  for (let i = 0; i < e.length; i++) {
41694
41694
  let o = e[i].key;
41695
41695
  if (!n[o]) throw new d(h(`Key '${o}' not found for event '${r7}'. Make sure to add only valid keys.`));
41696
- Ks(r7, e[i], i, n[o], t);
41696
+ Ys(r7, e[i], i, n[o], t);
41697
41697
  }
41698
41698
  for (let [i, o] of Object.entries(n)) {
41699
41699
  if (!(o.optional || t.has(i))) throw new d(h(`Missing required key '${i}' on context for '${r7}' event.`));
41700
41700
  if (!o.manyAllowed && (t.get(i) || 0) > 1) throw new d(h(`${t.get(i)} context entries with key '${i}' found for the '${r7}' event when schema only allows for 1.`));
41701
41701
  }
41702
41702
  }
41703
- function Br(r7, e, t, n) {
41703
+ function qr(r7, e, t, n) {
41704
41704
  if (!(r7 && typeof r7 == "string")) throw new d(h("Must provide a topic."));
41705
- if (!Lr[e]) throw new d(h(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Lr).join(", ")}`));
41705
+ if (!Fr[e]) throw new d(h(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Fr).join(", ")}`));
41706
41706
  if (typeof t != "object") throw new d(h("context must be a context object or array of context objects."));
41707
- if (Fr.includes(e) && !n) throw new d(h(`The '${e}' event must contain a 'context.versionId'.`));
41707
+ if (Ur.includes(e) && !n) throw new d(h(`The '${e}' event must contain a 'context.versionId'.`));
41708
41708
  let i = Array.isArray(t) ? t : [t];
41709
- return zs(e, i), { timestamp: (/* @__PURE__ */ new Date()).toISOString(), id: ve(), event: { "hub.topic": r7, "hub.event": e, context: i, ...n ? { "context.versionId": n } : {} } };
41709
+ return Zs(e, i), { timestamp: (/* @__PURE__ */ new Date()).toISOString(), id: ve(), event: { "hub.topic": r7, "hub.event": e, context: i, ...n ? { "context.versionId": n } : {} } };
41710
41710
  }
41711
- var Ot = class extends H {
41711
+ var It = class extends H {
41712
41712
  constructor(e) {
41713
41713
  if (super(), this.subRequest = e, !e.endpoint) throw new d(h("Subscription request should contain an endpoint."));
41714
- if (!It(e)) throw new d(h("Subscription request failed validation."));
41714
+ if (!kt(e)) throw new d(h("Subscription request failed validation."));
41715
41715
  let t = new WebSocket(e.endpoint);
41716
41716
  t.addEventListener("open", () => {
41717
41717
  this.dispatchEvent({ type: "connect" }), t.addEventListener("message", (n) => {
@@ -41728,36 +41728,36 @@ var Ot = class extends H {
41728
41728
  this.websocket.close();
41729
41729
  }
41730
41730
  };
41731
- function Js(r7) {
41732
- let e = r7.replace(/-/g, "+").replace(/_/g, "/"), t = pi(e), n = Array.from(t).reduce((o, s) => {
41731
+ function Xs(r7) {
41732
+ let e = r7.replace(/-/g, "+").replace(/_/g, "/"), t = mi(e), n = Array.from(t).reduce((o, s) => {
41733
41733
  let a2 = ("00" + s.charCodeAt(0).toString(16)).slice(-2);
41734
41734
  return `${o}%${a2}`;
41735
41735
  }, ""), i = decodeURIComponent(n);
41736
41736
  return JSON.parse(i);
41737
41737
  }
41738
- function vi(r7) {
41738
+ function Ei(r7) {
41739
41739
  return r7.split(".").length === 3;
41740
41740
  }
41741
- function kt(r7) {
41741
+ function Vt(r7) {
41742
41742
  let [e, t, n] = r7.split(".");
41743
- return Js(t);
41743
+ return Xs(t);
41744
41744
  }
41745
- function Ti(r7) {
41745
+ function bi(r7) {
41746
41746
  try {
41747
- return typeof kt(r7).login_id == "string";
41747
+ return typeof Vt(r7).login_id == "string";
41748
41748
  } catch {
41749
41749
  return false;
41750
41750
  }
41751
41751
  }
41752
- function Si(r7) {
41752
+ function Ri(r7) {
41753
41753
  try {
41754
- let t = kt(r7).exp;
41754
+ let t = Vt(r7).exp;
41755
41755
  return typeof t == "number" ? t * 1e3 : void 0;
41756
41756
  } catch {
41757
41757
  return;
41758
41758
  }
41759
41759
  }
41760
- var Vt = class {
41760
+ var Dt = class {
41761
41761
  constructor(e) {
41762
41762
  this.medplum = e;
41763
41763
  }
@@ -41771,11 +41771,11 @@ var Vt = class {
41771
41771
  await this.medplum.delete(`keyvalue/v1/${e}`);
41772
41772
  }
41773
41773
  };
41774
- var Ei;
41775
- Ei = Symbol.toStringTag;
41774
+ var Ci;
41775
+ Ci = Symbol.toStringTag;
41776
41776
  var M = class {
41777
41777
  constructor(e) {
41778
- this[Ei] = "ReadablePromise";
41778
+ this[Ci] = "ReadablePromise";
41779
41779
  this.status = "pending";
41780
41780
  this.suspender = e.then((t) => (this.status = "success", this.response = t, t), (t) => {
41781
41781
  throw this.status = "error", this.error = t, t;
@@ -41807,9 +41807,9 @@ var M = class {
41807
41807
  return this.suspender.finally(e);
41808
41808
  }
41809
41809
  };
41810
- var $e = class {
41810
+ var He = class {
41811
41811
  constructor(e) {
41812
- this.storage = e ?? (typeof localStorage < "u" ? localStorage : new qr());
41812
+ this.storage = e ?? (typeof localStorage < "u" ? localStorage : new Wr());
41813
41813
  }
41814
41814
  clear() {
41815
41815
  this.storage.clear();
@@ -41825,10 +41825,10 @@ var $e = class {
41825
41825
  return t ? JSON.parse(t) : void 0;
41826
41826
  }
41827
41827
  setObject(e, t) {
41828
- this.setString(e, t ? Fn(t) : void 0);
41828
+ this.setString(e, t ? lt(t) : void 0);
41829
41829
  }
41830
41830
  };
41831
- var qr = class {
41831
+ var Wr = class {
41832
41832
  constructor() {
41833
41833
  this.data = /* @__PURE__ */ new Map();
41834
41834
  }
@@ -41851,15 +41851,15 @@ var qr = class {
41851
41851
  return Array.from(this.data.keys())[e];
41852
41852
  }
41853
41853
  };
41854
- var Ve = { Event: typeof globalThis.Event < "u" ? globalThis.Event : void 0, ErrorEvent: void 0, CloseEvent: void 0 };
41855
- var Ri = false;
41856
- function Ys() {
41854
+ var De = { Event: typeof globalThis.Event < "u" ? globalThis.Event : void 0, ErrorEvent: void 0, CloseEvent: void 0 };
41855
+ var wi = false;
41856
+ function ea() {
41857
41857
  if (typeof globalThis.Event > "u") throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");
41858
- Ve.Event = globalThis.Event, Ve.ErrorEvent = class extends Event {
41858
+ De.Event = globalThis.Event, De.ErrorEvent = class extends Event {
41859
41859
  constructor(e, t) {
41860
41860
  super("error", t), this.message = e.message, this.error = e;
41861
41861
  }
41862
- }, Ve.CloseEvent = class extends Event {
41862
+ }, De.CloseEvent = class extends Event {
41863
41863
  constructor(t = 1e3, n = "", i) {
41864
41864
  super("close", i);
41865
41865
  this.wasClean = true;
@@ -41867,17 +41867,17 @@ function Ys() {
41867
41867
  }
41868
41868
  };
41869
41869
  }
41870
- function Zs(r7, e) {
41870
+ function ta(r7, e) {
41871
41871
  if (!r7) throw new Error(e);
41872
41872
  }
41873
- function Dt(r7) {
41873
+ function Mt(r7) {
41874
41874
  return new r7.constructor(r7.type, r7);
41875
41875
  }
41876
41876
  var Te = { maxReconnectionDelay: 1e4, minReconnectionDelay: 1e3 + Math.random() * 4e3, minUptime: 5e3, reconnectionDelayGrowFactor: 1.3, connectionTimeout: 4e3, maxRetries: 1 / 0, maxEnqueuedMessages: 1 / 0, startClosed: false, debug: false };
41877
- var Ci = false;
41878
- var Mt = class r extends H {
41877
+ var Ai = false;
41878
+ var _t = class r extends H {
41879
41879
  constructor(t, n, i = {}) {
41880
- Ri || (Ys(), Ri = true);
41880
+ wi || (ea(), wi = true);
41881
41881
  super();
41882
41882
  this._retryCount = -1;
41883
41883
  this._shouldReconnect = true;
@@ -41892,16 +41892,16 @@ var Mt = class r extends H {
41892
41892
  this._handleOpen = (t2) => {
41893
41893
  this._debug("open event");
41894
41894
  let { minUptime: n2 = Te.minUptime } = this._options;
41895
- clearTimeout(this._connectTimeout), this._uptimeTimeout = setTimeout(() => this._acceptOpen(), n2), Zs(this._ws, "WebSocket is not defined"), this._ws.binaryType = this._binaryType, this._messageQueue.forEach((i2) => this._ws?.send(i2)), this._messageQueue = [], this.onopen && this.onopen(t2), this.dispatchEvent(Dt(t2));
41895
+ clearTimeout(this._connectTimeout), this._uptimeTimeout = setTimeout(() => this._acceptOpen(), n2), ta(this._ws, "WebSocket is not defined"), this._ws.binaryType = this._binaryType, this._messageQueue.forEach((i2) => this._ws?.send(i2)), this._messageQueue = [], this.onopen && this.onopen(t2), this.dispatchEvent(Mt(t2));
41896
41896
  };
41897
41897
  this._handleMessage = (t2) => {
41898
- this._debug("message event"), this.onmessage && this.onmessage(t2), this.dispatchEvent(Dt(t2));
41898
+ this._debug("message event"), this.onmessage && this.onmessage(t2), this.dispatchEvent(Mt(t2));
41899
41899
  };
41900
41900
  this._handleError = (t2) => {
41901
- this._debug("error event", t2.message), this._disconnect(void 0, t2.message === "TIMEOUT" ? "timeout" : void 0), this.onerror && this.onerror(t2), this._debug("exec error listeners"), this.dispatchEvent(Dt(t2)), this._connect();
41901
+ this._debug("error event", t2.message), this._disconnect(void 0, t2.message === "TIMEOUT" ? "timeout" : void 0), this.onerror && this.onerror(t2), this._debug("exec error listeners"), this.dispatchEvent(Mt(t2)), this._connect();
41902
41902
  };
41903
41903
  this._handleClose = (t2) => {
41904
- this._debug("close event"), this._clearTimeouts(), this._shouldReconnect && this._connect(), this.onclose && this.onclose(t2), this.dispatchEvent(Dt(t2));
41904
+ this._debug("close event"), this._clearTimeouts(), this._shouldReconnect && this._connect(), this.onclose && this.onclose(t2), this.dispatchEvent(Mt(t2));
41905
41905
  };
41906
41906
  this._url = t, this._protocols = n, this._options = i, this._options.startClosed && (this._shouldReconnect = false), this._options.binaryType ? this._binaryType = this._options.binaryType : this._binaryType = "blob", this._options.debugLogger && (this._debugLogger = this._options.debugLogger), this._connect();
41907
41907
  }
@@ -42002,21 +42002,21 @@ var Mt = class r extends H {
42002
42002
  this._connectLock = false;
42003
42003
  return;
42004
42004
  }
42005
- !this._options.WebSocket && typeof WebSocket > "u" && !Ci && (console.error("\u203C\uFE0F No WebSocket implementation available. You should define options.WebSocket."), Ci = true);
42005
+ !this._options.WebSocket && typeof WebSocket > "u" && !Ai && (console.error("\u203C\uFE0F No WebSocket implementation available. You should define options.WebSocket."), Ai = true);
42006
42006
  let i = this._options.WebSocket || WebSocket;
42007
42007
  this._debug("connect", { url: this._url, protocols: this._protocols }), this._ws = this._protocols ? new i(this._url, this._protocols) : new i(this._url), this._ws.binaryType = this._binaryType, this._connectLock = false, this._addListeners(), this._connectTimeout = setTimeout(() => this._handleTimeout(), n);
42008
42008
  }).catch((i) => {
42009
- this._connectLock = false, this._handleError(new Ve.ErrorEvent(Error(i.message), this));
42009
+ this._connectLock = false, this._handleError(new De.ErrorEvent(Error(i.message), this));
42010
42010
  });
42011
42011
  }
42012
42012
  _handleTimeout() {
42013
- this._debug("timeout event"), this._handleError(new Ve.ErrorEvent(Error("TIMEOUT"), this));
42013
+ this._debug("timeout event"), this._handleError(new De.ErrorEvent(Error("TIMEOUT"), this));
42014
42014
  }
42015
42015
  _disconnect(t = 1e3, n) {
42016
42016
  if (this._clearTimeouts(), !!this._ws) {
42017
42017
  this._removeListeners();
42018
42018
  try {
42019
- this._ws.close(t, n), this._handleClose(new Ve.CloseEvent(t, n, this));
42019
+ this._ws.close(t, n), this._handleClose(new De.CloseEvent(t, n, this));
42020
42020
  } catch {
42021
42021
  }
42022
42022
  }
@@ -42034,8 +42034,8 @@ var Mt = class r extends H {
42034
42034
  clearTimeout(this._connectTimeout), clearTimeout(this._uptimeTimeout);
42035
42035
  }
42036
42036
  };
42037
- var Xs = 5e3;
42038
- var Ge = class extends H {
42037
+ var ra = 5e3;
42038
+ var Qe = class extends H {
42039
42039
  constructor(...e) {
42040
42040
  super(), this.criteria = new Set(e);
42041
42041
  }
@@ -42052,25 +42052,25 @@ var Ge = class extends H {
42052
42052
  var jr = class {
42053
42053
  constructor(e, t) {
42054
42054
  this.connecting = false;
42055
- this.criteria = e, this.emitter = new Ge(e), this.refCount = 1, this.subscriptionProps = t ? { ...t } : void 0;
42055
+ this.criteria = e, this.emitter = new Qe(e), this.refCount = 1, this.subscriptionProps = t ? { ...t } : void 0;
42056
42056
  }
42057
42057
  clearAttachedSubscription() {
42058
42058
  this.subscriptionId = void 0, this.token = void 0;
42059
42059
  }
42060
42060
  };
42061
- var _t = class {
42061
+ var Nt = class {
42062
42062
  constructor(e, t, n) {
42063
42063
  this.pingTimer = void 0;
42064
42064
  this.waitingForPong = false;
42065
- if (!(e instanceof Nt)) throw new d(h("First arg of constructor should be a `MedplumClient`"));
42065
+ if (!(e instanceof Lt)) throw new d(h("First arg of constructor should be a `MedplumClient`"));
42066
42066
  let i;
42067
42067
  try {
42068
42068
  i = new URL(t).toString();
42069
42069
  } catch {
42070
42070
  throw new d(h("Not a valid URL"));
42071
42071
  }
42072
- let o = n?.ReconnectingWebSocket ? new n.ReconnectingWebSocket(i, void 0, { debug: n?.debug, debugLogger: n?.debugLogger }) : new Mt(i, void 0, { debug: n?.debug, debugLogger: n?.debugLogger });
42073
- this.medplum = e, this.ws = o, this.masterSubEmitter = new Ge(), this.criteriaEntries = /* @__PURE__ */ new Map(), this.criteriaEntriesBySubscriptionId = /* @__PURE__ */ new Map(), this.wsClosed = false, this.pingIntervalMs = n?.pingIntervalMs ?? Xs, this.currentProfile = e.getProfile(), this.setupListeners();
42072
+ let o = n?.ReconnectingWebSocket ? new n.ReconnectingWebSocket(i, void 0, { debug: n?.debug, debugLogger: n?.debugLogger }) : new _t(i, void 0, { debug: n?.debug, debugLogger: n?.debugLogger });
42073
+ this.medplum = e, this.ws = o, this.masterSubEmitter = new Qe(), this.criteriaEntries = /* @__PURE__ */ new Map(), this.criteriaEntriesBySubscriptionId = /* @__PURE__ */ new Map(), this.wsClosed = false, this.pingIntervalMs = n?.pingIntervalMs ?? ra, this.currentProfile = e.getProfile(), this.setupListeners();
42074
42074
  }
42075
42075
  setupListeners() {
42076
42076
  let e = this.ws;
@@ -42087,7 +42087,7 @@ var _t = class {
42087
42087
  return;
42088
42088
  }
42089
42089
  if (o.type === "handshake") {
42090
- let a2 = pe(o.subscription), c = { type: "connect", payload: { subscriptionId: a2 } };
42090
+ let a2 = de(o.subscription), c = { type: "connect", payload: { subscriptionId: a2 } };
42091
42091
  this.masterSubEmitter?.dispatchEvent(c);
42092
42092
  let u2 = this.criteriaEntriesBySubscriptionId.get(a2);
42093
42093
  if (!u2) {
@@ -42098,7 +42098,7 @@ var _t = class {
42098
42098
  return;
42099
42099
  }
42100
42100
  this.masterSubEmitter?.dispatchEvent({ type: "message", payload: i });
42101
- let s = this.criteriaEntriesBySubscriptionId.get(pe(o.subscription));
42101
+ let s = this.criteriaEntriesBySubscriptionId.get(de(o.subscription));
42102
42102
  if (!s) {
42103
42103
  console.warn("Received notification for criteria the SubscriptionManager is not listening for");
42104
42104
  return;
@@ -42111,7 +42111,7 @@ var _t = class {
42111
42111
  for (let o of this.getAllCriteriaEmitters()) o.dispatchEvent({ ...i });
42112
42112
  }
42113
42113
  }), e.addEventListener("error", () => {
42114
- let t = { type: "error", payload: new d(an(new Error("WebSocket error"))) };
42114
+ let t = { type: "error", payload: new d(ln(new Error("WebSocket error"))) };
42115
42115
  this.masterSubEmitter?.dispatchEvent(t);
42116
42116
  for (let n of this.getAllCriteriaEmitters()) n.dispatchEvent({ ...t });
42117
42117
  }), e.addEventListener("close", () => {
@@ -42148,7 +42148,7 @@ var _t = class {
42148
42148
  }
42149
42149
  async getTokenForCriteria(e) {
42150
42150
  let t = e?.subscriptionId;
42151
- t || (t = (await this.medplum.createResource({ ...e.subscriptionProps, resourceType: "Subscription", status: "active", reason: `WebSocket subscription for ${le(this.medplum.getProfile())}`, channel: { type: "websocket" }, criteria: e.criteria })).id);
42151
+ t || (t = (await this.medplum.createResource({ ...e.subscriptionProps, resourceType: "Subscription", status: "active", reason: `WebSocket subscription for ${pe(this.medplum.getProfile())}`, channel: { type: "websocket" }, criteria: e.criteria })).id);
42152
42152
  let { parameter: n } = await this.medplum.get(`fhir/R4/Subscription/${t}/$get-ws-binding-token`), i = n?.find((s) => s.name === "token")?.valueString, o = n?.find((s) => s.name === "websocket-url")?.valueUrl;
42153
42153
  if (!i) throw new d(h("Failed to get token"));
42154
42154
  if (!o) throw new d(h("Failed to get URL from $get-ws-binding-token"));
@@ -42189,7 +42189,7 @@ var _t = class {
42189
42189
  let [t, n] = await this.getTokenForCriteria(e);
42190
42190
  e.subscriptionId = t, e.token = n, this.criteriaEntriesBySubscriptionId.set(t, e), this.ws.send(JSON.stringify({ type: "bind-with-token", payload: { token: n } }));
42191
42191
  } catch (t) {
42192
- console.error(Ne(t)), this.emitError(e, t), this.removeCriteriaEntry(e);
42192
+ console.error(Re(t)), this.emitError(e, t), this.removeCriteriaEntry(e);
42193
42193
  }
42194
42194
  }
42195
42195
  }
@@ -42225,28 +42225,28 @@ var _t = class {
42225
42225
  return this.getAllCriteriaEmitters().length;
42226
42226
  }
42227
42227
  getMasterEmitter() {
42228
- return this.masterSubEmitter || (this.masterSubEmitter = new Ge(...Array.from(this.criteriaEntries.keys()))), this.masterSubEmitter;
42228
+ return this.masterSubEmitter || (this.masterSubEmitter = new Qe(...Array.from(this.criteriaEntries.keys()))), this.masterSubEmitter;
42229
42229
  }
42230
42230
  };
42231
- var tf = "3.2.25-41ee56551";
42232
- var ra = D.FHIR_JSON + ", */*; q=0.1";
42233
- var na = "https://api.medplum.com/";
42234
- var ia = 1e3;
42235
- var oa = 6e4;
42236
- var sa = 0;
42237
- var aa = 3e5;
42238
- var ca = "Binary/";
42239
- var Pi = { resourceType: "Device", id: "system", deviceName: [{ type: "model-name", name: "System" }] };
42240
- var ua = ((o) => (o.ClientCredentials = "client_credentials", o.AuthorizationCode = "authorization_code", o.RefreshToken = "refresh_token", o.JwtBearer = "urn:ietf:params:oauth:grant-type:jwt-bearer", o.TokenExchange = "urn:ietf:params:oauth:grant-type:token-exchange", o))(ua || {});
42241
- var la = ((o) => (o.AccessToken = "urn:ietf:params:oauth:token-type:access_token", o.RefreshToken = "urn:ietf:params:oauth:token-type:refresh_token", o.IdToken = "urn:ietf:params:oauth:token-type:id_token", o.Saml1Token = "urn:ietf:params:oauth:token-type:saml1", o.Saml2Token = "urn:ietf:params:oauth:token-type:saml2", o))(la || {});
42242
- var pa = ((o) => (o.ClientSecretBasic = "client_secret_basic", o.ClientSecretPost = "client_secret_post", o.ClientSecretJwt = "client_secret_jwt", o.PrivateKeyJwt = "private_key_jwt", o.None = "none", o))(pa || {});
42243
- var da = ((e) => (e.JwtBearer = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", e))(da || {});
42244
- var Nt = class extends H {
42231
+ var $r = "3.2.27-4cec0e5ad";
42232
+ var oa = D.FHIR_JSON + ", */*; q=0.1";
42233
+ var sa = "https://api.medplum.com/";
42234
+ var aa = 1e3;
42235
+ var ca = 6e4;
42236
+ var ua = 0;
42237
+ var la = 3e5;
42238
+ var pa = "Binary/";
42239
+ var Oi = { resourceType: "Device", id: "system", deviceName: [{ type: "model-name", name: "System" }] };
42240
+ var da = ((o) => (o.ClientCredentials = "client_credentials", o.AuthorizationCode = "authorization_code", o.RefreshToken = "refresh_token", o.JwtBearer = "urn:ietf:params:oauth:grant-type:jwt-bearer", o.TokenExchange = "urn:ietf:params:oauth:grant-type:token-exchange", o))(da || {});
42241
+ var fa = ((o) => (o.AccessToken = "urn:ietf:params:oauth:token-type:access_token", o.RefreshToken = "urn:ietf:params:oauth:token-type:refresh_token", o.IdToken = "urn:ietf:params:oauth:token-type:id_token", o.Saml1Token = "urn:ietf:params:oauth:token-type:saml1", o.Saml2Token = "urn:ietf:params:oauth:token-type:saml2", o))(fa || {});
42242
+ var ma = ((o) => (o.ClientSecretBasic = "client_secret_basic", o.ClientSecretPost = "client_secret_post", o.ClientSecretJwt = "client_secret_jwt", o.PrivateKeyJwt = "private_key_jwt", o.None = "none", o))(ma || {});
42243
+ var ha = ((e) => (e.JwtBearer = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", e))(ha || {});
42244
+ var Lt = class extends H {
42245
42245
  constructor(t) {
42246
42246
  super();
42247
42247
  this.initComplete = true;
42248
42248
  if (t?.baseUrl && !t.baseUrl.startsWith("http")) throw new Error("Base URL must start with http or https");
42249
- this.options = t ?? {}, this.fetch = t?.fetch ?? fa(), this.storage = t?.storage ?? new $e(), this.createPdfImpl = t?.createPdf, this.baseUrl = Cr(t?.baseUrl ?? na), this.fhirBaseUrl = B(this.baseUrl, t?.fhirUrlPath ?? "fhir/R4"), this.authorizeUrl = B(this.baseUrl, t?.authorizeUrl ?? "oauth2/authorize"), this.tokenUrl = B(this.baseUrl, t?.tokenUrl ?? "oauth2/token"), this.logoutUrl = B(this.baseUrl, t?.logoutUrl ?? "oauth2/logout"), this.fhircastHubUrl = B(this.baseUrl, t?.fhircastHubUrl ?? "fhircast/STU3"), this.clientId = t?.clientId ?? "", this.clientSecret = t?.clientSecret ?? "", this.defaultHeaders = t?.defaultHeaders ?? {}, this.onUnauthenticated = t?.onUnauthenticated, this.refreshGracePeriod = t?.refreshGracePeriod ?? aa, this.cacheTime = t?.cacheTime ?? (typeof window > "u" ? sa : oa), this.cacheTime > 0 ? this.requestCache = new At(t?.resourceCacheSize ?? ia) : this.requestCache = void 0, t?.autoBatchTime ? (this.autoBatchTime = t.autoBatchTime, this.autoBatchQueue = []) : (this.autoBatchTime = 0, this.autoBatchQueue = void 0), t?.accessToken && this.setAccessToken(t.accessToken), this.storage.getInitPromise === void 0 ? (t?.accessToken || this.attemptResumeActiveLogin().catch(console.error), this.initPromise = Promise.resolve(), this.dispatchEvent({ type: "storageInitialized" })) : (this.initComplete = false, this.initPromise = this.storage.getInitPromise(), this.initPromise.then(() => {
42249
+ this.options = t ?? {}, this.fetch = t?.fetch ?? ya(), this.storage = t?.storage ?? new He(), this.createPdfImpl = t?.createPdf, this.baseUrl = Pr(t?.baseUrl ?? sa), this.fhirBaseUrl = B(this.baseUrl, t?.fhirUrlPath ?? "fhir/R4"), this.authorizeUrl = B(this.baseUrl, t?.authorizeUrl ?? "oauth2/authorize"), this.tokenUrl = B(this.baseUrl, t?.tokenUrl ?? "oauth2/token"), this.logoutUrl = B(this.baseUrl, t?.logoutUrl ?? "oauth2/logout"), this.fhircastHubUrl = B(this.baseUrl, t?.fhircastHubUrl ?? "fhircast/STU3"), this.clientId = t?.clientId ?? "", this.clientSecret = t?.clientSecret ?? "", this.defaultHeaders = t?.defaultHeaders ?? {}, this.onUnauthenticated = t?.onUnauthenticated, this.refreshGracePeriod = t?.refreshGracePeriod ?? la, this.cacheTime = t?.cacheTime ?? (typeof window > "u" ? ua : ca), this.cacheTime > 0 ? this.requestCache = new Ot(t?.resourceCacheSize ?? aa) : this.requestCache = void 0, t?.autoBatchTime ? (this.autoBatchTime = t.autoBatchTime, this.autoBatchQueue = []) : (this.autoBatchTime = 0, this.autoBatchQueue = void 0), t?.accessToken && this.setAccessToken(t.accessToken), this.storage.getInitPromise === void 0 ? (t?.accessToken || this.attemptResumeActiveLogin().catch(console.error), this.initPromise = Promise.resolve(), this.dispatchEvent({ type: "storageInitialized" })) : (this.initComplete = false, this.initPromise = this.storage.getInitPromise(), this.initPromise.then(() => {
42250
42250
  t?.accessToken || this.attemptResumeActiveLogin().catch(console.error), this.initComplete = true, this.dispatchEvent({ type: "storageInitialized" });
42251
42251
  }).catch((n) => {
42252
42252
  console.error(n), this.initComplete = true, this.dispatchEvent({ type: "storageInitFailed", payload: { error: n } });
@@ -42376,7 +42376,7 @@ var Nt = class extends H {
42376
42376
  }
42377
42377
  fhirSearchUrl(t, n) {
42378
42378
  let i = this.fhirUrl(t);
42379
- return n && (i.search = Kn(n)), i;
42379
+ return n && (i.search = Jn(n)), i;
42380
42380
  }
42381
42381
  search(t, n, i) {
42382
42382
  let o = this.fhirSearchUrl(t, n), s = "search-" + o.toString(), a2 = this.getCacheEntry(s, i);
@@ -42399,7 +42399,7 @@ var Nt = class extends H {
42399
42399
  searchResources(t, n, i) {
42400
42400
  let s = "searchResources-" + this.fhirSearchUrl(t, n).toString(), a2 = this.getCacheEntry(s, i);
42401
42401
  if (a2) return a2.value;
42402
- let c = new M(this.search(t, n, i).then(Oi));
42402
+ let c = new M(this.search(t, n, i).then(Vi));
42403
42403
  return this.setCacheEntry(s, c), c;
42404
42404
  }
42405
42405
  async *searchResourcePages(t, n, i) {
@@ -42407,7 +42407,7 @@ var Nt = class extends H {
42407
42407
  for (; o; ) {
42408
42408
  let s = new URL(o).searchParams, a2 = await this.search(t, s, i), c = a2.link?.find((u2) => u2.relation === "next");
42409
42409
  if (!a2.entry?.length && !c) break;
42410
- yield Oi(a2), o = c?.url ? new URL(c.url) : void 0;
42410
+ yield Vi(a2), o = c?.url ? new URL(c.url) : void 0;
42411
42411
  }
42412
42412
  }
42413
42413
  searchValueSet(t, n, i) {
@@ -42424,7 +42424,7 @@ var Nt = class extends H {
42424
42424
  getCachedReference(t) {
42425
42425
  let n = t.reference;
42426
42426
  if (!n) return;
42427
- if (n === "system") return Pi;
42427
+ if (n === "system") return Oi;
42428
42428
  let [i, o] = n.split("/");
42429
42429
  if (!(!i || !o)) return this.getCached(i, o);
42430
42430
  }
@@ -42435,12 +42435,12 @@ var Nt = class extends H {
42435
42435
  readReference(t, n) {
42436
42436
  let i = t.reference;
42437
42437
  if (!i) return new M(Promise.reject(new Error("Missing reference")));
42438
- if (i === "system") return new M(Promise.resolve(Pi));
42438
+ if (i === "system") return new M(Promise.resolve(Oi));
42439
42439
  let [o, s] = i.split("/");
42440
42440
  return !o || !s ? new M(Promise.reject(new Error("Invalid reference"))) : this.readResource(o, s, n);
42441
42441
  }
42442
42442
  requestSchema(t) {
42443
- if (vn(t)) return Promise.resolve();
42443
+ if (En(t)) return Promise.resolve();
42444
42444
  let n = t + "-requestSchema", i = this.getCacheEntry(n, void 0);
42445
42445
  if (i) return i.value;
42446
42446
  let o = new M((async () => {
@@ -42485,13 +42485,13 @@ var Nt = class extends H {
42485
42485
  target
42486
42486
  }
42487
42487
  }`.replace(/\s+/g, " "), a2 = await this.graphql(s);
42488
- cr(a2.data.StructureDefinitionList.filter((c) => c.name === t));
42489
- for (let c of a2.data.SearchParameterList) Ar(c);
42488
+ ur(a2.data.StructureDefinitionList.filter((c) => c.name === t));
42489
+ for (let c of a2.data.SearchParameterList) Or(c);
42490
42490
  })());
42491
42491
  return this.setCacheEntry(n, o), o;
42492
42492
  }
42493
42493
  requestProfileSchema(t, n) {
42494
- if (!n?.expandProfile && Sn(t)) return Promise.resolve();
42494
+ if (!n?.expandProfile && Rn(t)) return Promise.resolve();
42495
42495
  let i = t + "-requestSchema" + (n?.expandProfile ? "-nested" : ""), o = this.getCacheEntry(i, void 0);
42496
42496
  if (o) return o.value;
42497
42497
  let s = new M((async () => {
@@ -42499,14 +42499,14 @@ var Nt = class extends H {
42499
42499
  let a2 = this.fhirUrl("StructureDefinition", "$expand-profile");
42500
42500
  a2.search = new URLSearchParams({ url: t }).toString();
42501
42501
  let c = await this.post(a2.toString(), {});
42502
- cr(c);
42502
+ ur(c);
42503
42503
  } else {
42504
42504
  let a2 = await this.searchOne("StructureDefinition", { url: t, _sort: "-_lastUpdated" });
42505
42505
  if (!a2) {
42506
42506
  console.warn(`No StructureDefinition found for ${t}!`);
42507
42507
  return;
42508
42508
  }
42509
- ur(a2);
42509
+ lr(a2);
42510
42510
  }
42511
42511
  })());
42512
42512
  return this.setCacheEntry(i, s), s;
@@ -42535,12 +42535,12 @@ var Nt = class extends H {
42535
42535
  return s || (s = t), this.cacheResource(s), this.invalidateUrl(this.fhirUrl(t.resourceType, t.id, "_history")), this.invalidateSearches(t.resourceType), s;
42536
42536
  }
42537
42537
  async createAttachment(t, n, i, o, s) {
42538
- let a2 = Ii(t, n, i, o), c = s ?? (typeof n == "object" ? n : {}), u2 = await this.createBinary(a2, c);
42538
+ let a2 = Di(t, n, i, o), c = s ?? (typeof n == "object" ? n : {}), u2 = await this.createBinary(a2, c);
42539
42539
  return { contentType: a2.contentType, url: u2.url, title: a2.filename };
42540
42540
  }
42541
42541
  createBinary(t, n, i, o, s) {
42542
- let a2 = Ii(t, n, i, o), c = s ?? (typeof n == "object" ? n : {}), { data: u2, contentType: p2, filename: m2, securityContext: x2, onProgress: Q } = a2, _e = this.fhirUrl("Binary");
42543
- return m2 && _e.searchParams.set("_filename", m2), x2?.reference && this.setRequestHeader(c, "X-Security-Context", x2.reference), Q ? this.uploadwithProgress(_e, u2, p2, Q, c) : this.post(_e, u2, p2, c);
42542
+ let a2 = Di(t, n, i, o), c = s ?? (typeof n == "object" ? n : {}), { data: u2, contentType: p2, filename: m2, securityContext: x2, onProgress: Q } = a2, Ne = this.fhirUrl("Binary");
42543
+ return m2 && Ne.searchParams.set("_filename", m2), x2?.reference && this.setRequestHeader(c, "X-Security-Context", x2.reference), Q ? this.uploadwithProgress(Ne, u2, p2, Q, c) : this.post(Ne, u2, p2, c);
42544
42544
  }
42545
42545
  uploadwithProgress(t, n, i, o, s) {
42546
42546
  return new Promise((a2, c) => {
@@ -42550,17 +42550,17 @@ var Nt = class extends H {
42550
42550
  s?.signal?.removeEventListener("abort", p2), x2 instanceof Error ? c(x2) : a2(x2);
42551
42551
  };
42552
42552
  if (u2.responseType = "json", u2.onabort = () => m2(new DOMException("Request aborted", "AbortError")), u2.onerror = () => m2(new Error("Request error")), o && (u2.upload.onprogress = (x2) => o(x2), u2.upload.onload = (x2) => o(x2)), u2.onload = () => {
42553
- u2.status >= 200 && u2.status < 300 ? m2(u2.response) : m2(new d(Xe(u2.response || u2.statusText)));
42553
+ u2.status >= 200 && u2.status < 300 ? m2(u2.response) : m2(new d(tt(u2.response || u2.statusText)));
42554
42554
  }, u2.open("POST", t), u2.withCredentials = true, u2.setRequestHeader("Authorization", "Bearer " + this.accessToken), u2.setRequestHeader("Cache-Control", "no-cache, no-store, max-age=0"), u2.setRequestHeader("Content-Type", i), this.options.extendedMode !== false && u2.setRequestHeader("X-Medplum", "extended"), s?.headers) {
42555
42555
  let x2 = s.headers;
42556
- for (let [Q, _e] of Object.entries(x2)) u2.setRequestHeader(Q, _e);
42556
+ for (let [Q, Ne] of Object.entries(x2)) u2.setRequestHeader(Q, Ne);
42557
42557
  }
42558
42558
  u2.send(n);
42559
42559
  });
42560
42560
  }
42561
42561
  async createPdf(t, n, i, o) {
42562
42562
  if (!this.createPdfImpl) throw new Error("PDF creation not enabled");
42563
- let s = ya(t, n, i, o), a2 = typeof n == "object" ? n : {}, { docDefinition: c, tableLayouts: u2, fonts: p2, ...m2 } = s, x2 = await this.createPdfImpl(c, u2, p2), Q = { ...m2, data: x2, contentType: "application/pdf" };
42563
+ let s = va(t, n, i, o), a2 = typeof n == "object" ? n : {}, { docDefinition: c, tableLayouts: u2, fonts: p2, ...m2 } = s, x2 = await this.createPdfImpl(c, u2, p2), Q = { ...m2, data: x2, contentType: "application/pdf" };
42564
42564
  return this.createBinary(Q, a2);
42565
42565
  }
42566
42566
  createComment(t, n, i) {
@@ -42607,19 +42607,22 @@ var Nt = class extends H {
42607
42607
  return this.get(`${this.fhirUrl(t, n)}/$graph?graph=${i}`, o);
42608
42608
  }
42609
42609
  pushToAgent(t, n, i, o, s, a2) {
42610
- return this.post(this.fhirUrl("Agent", pe(t), "$push"), { destination: typeof n == "string" ? n : le(n), body: i, contentType: o, waitForResponse: s }, D.FHIR_JSON, a2);
42610
+ return this.post(this.fhirUrl("Agent", de(t), "$push"), { destination: typeof n == "string" ? n : pe(n), body: i, contentType: o, waitForResponse: s }, D.FHIR_JSON, a2);
42611
42611
  }
42612
42612
  getActiveLogin() {
42613
42613
  return this.storage.getObject("activeLogin");
42614
42614
  }
42615
42615
  async setActiveLogin(t) {
42616
- (!this.sessionDetails?.profile || le(this.sessionDetails.profile) !== t.profile?.reference) && this.clearActiveLogin(), this.setAccessToken(t.accessToken, t.refreshToken), this.storage.setObject("activeLogin", t), this.addLogin(t), this.refreshPromise = void 0, await this.refreshProfile();
42616
+ (!this.sessionDetails?.profile || pe(this.sessionDetails.profile) !== t.profile?.reference) && this.clearActiveLogin(), this.setAccessToken(t.accessToken, t.refreshToken), this.storage.setObject("activeLogin", t), this.addLogin(t), this.refreshPromise = void 0, await this.refreshProfile();
42617
42617
  }
42618
42618
  getAccessToken() {
42619
42619
  return this.accessToken;
42620
42620
  }
42621
+ isAuthenticated(t) {
42622
+ return this.accessTokenExpires !== void 0 && Date.now() < this.accessTokenExpires - (t ?? this.refreshGracePeriod);
42623
+ }
42621
42624
  setAccessToken(t, n) {
42622
- this.accessToken = t, this.refreshToken = n, this.accessTokenExpires = Si(t), this.medplumServer = Ti(t);
42625
+ this.accessToken = t, this.refreshToken = n, this.accessTokenExpires = Ri(t), this.medplumServer = bi(t);
42623
42626
  }
42624
42627
  getLogins() {
42625
42628
  return this.storage.getObject("logins") ?? [];
@@ -42667,7 +42670,7 @@ var Nt = class extends H {
42667
42670
  async download(t, n = {}) {
42668
42671
  this.refreshPromise && await this.refreshPromise;
42669
42672
  let i = t.toString();
42670
- i.startsWith(ca) && (t = this.fhirUrl(i));
42673
+ i.startsWith(pa) && (t = this.fhirUrl(i));
42671
42674
  let o = n.headers;
42672
42675
  return o || (o = {}, n.headers = o), o.Accept || (o.Accept = "*/*"), this.addFetchOptionsDefaults(n), (await this.fetchWithRetry(t.toString(), n)).blob();
42673
42676
  }
@@ -42690,7 +42693,7 @@ var Nt = class extends H {
42690
42693
  return i.Prefer = "respond-async", this.request("POST", t, n);
42691
42694
  }
42692
42695
  get keyValue() {
42693
- return this.keyValueClient || (this.keyValueClient = new Vt(this)), this.keyValueClient;
42696
+ return this.keyValueClient || (this.keyValueClient = new Dt(this)), this.keyValueClient;
42694
42697
  }
42695
42698
  getCacheEntry(t, n) {
42696
42699
  if (!this.requestCache || n?.cache === "no-cache" || n?.cache === "reload") return;
@@ -42712,28 +42715,30 @@ var Nt = class extends H {
42712
42715
  if (s.status === 401) return this.handleUnauthenticated(t, n, i);
42713
42716
  if (s.status === 204 || s.status === 304) return;
42714
42717
  let c = s.headers.get("content-type")?.includes("json");
42715
- if (s.status === 404 && !c) throw new d(on);
42718
+ if (s.status === 404 && !c) throw new d(cn);
42716
42719
  let u2 = await this.parseBody(s, c);
42717
42720
  if (s.status === 200 && i.followRedirectOnOk || s.status === 201 && i.followRedirectOnCreated) {
42718
- let p2 = await Ai(s, u2);
42721
+ let p2 = await ki(s, u2);
42719
42722
  if (p2) return this.request("GET", p2, { ...i, body: void 0 });
42720
42723
  }
42721
42724
  if (s.status === 202 && i.pollStatusOnAccepted) {
42722
- let m2 = await Ai(s, u2) ?? o.statusUrl;
42725
+ let m2 = await ki(s, u2) ?? o.statusUrl;
42723
42726
  if (m2) return this.pollStatus(m2, i, o);
42724
42727
  }
42725
- if (s.status >= 400) throw new d(Xe(u2));
42728
+ if (s.status >= 400) throw new d(tt(u2));
42726
42729
  return u2;
42727
42730
  }
42728
42731
  async parseBody(t, n) {
42729
42732
  let i;
42730
- if (n) try {
42731
- i = await t.json();
42732
- } catch (o) {
42733
- throw console.error("Error parsing response", t.status, o), o;
42733
+ if (t.headers.get("content-length") !== "0") {
42734
+ if (n) try {
42735
+ i = await t.json();
42736
+ } catch (o) {
42737
+ throw console.error("Error parsing response", t.status, o), o;
42738
+ }
42739
+ else i = await t.text();
42740
+ return i;
42734
42741
  }
42735
- else i = await t.text();
42736
- return i;
42737
42742
  }
42738
42743
  async fetchWithRetry(t, n) {
42739
42744
  t.startsWith("http") || (t = B(this.baseUrl, t));
@@ -42746,14 +42751,14 @@ var Nt = class extends H {
42746
42751
  } catch (a2) {
42747
42752
  if (a2.message === "Failed to fetch" && s === 0 && this.dispatchEvent({ type: "offline" }), a2.name === "AbortError" || s === i) throw a2;
42748
42753
  }
42749
- await br(o);
42754
+ await Rr(o);
42750
42755
  }
42751
42756
  throw new Error("Unreachable");
42752
42757
  }
42753
42758
  logRequest(t, n) {
42754
42759
  if (console.log(`> ${n.method} ${t}`), n.headers) {
42755
42760
  let i = n.headers;
42756
- for (let o of ut(Object.keys(i))) console.log(`> ${o}: ${i[o]}`);
42761
+ for (let o of pt(Object.keys(i))) console.log(`> ${o}: ${i[o]}`);
42757
42762
  }
42758
42763
  }
42759
42764
  logResponse(t) {
@@ -42764,7 +42769,7 @@ var Nt = class extends H {
42764
42769
  if (i.pollCount === void 0) n.headers && typeof n.headers == "object" && "Prefer" in n.headers && (o.headers = { ...n.headers }, delete o.headers.Prefer), i.statusUrl = t, i.pollCount = 1;
42765
42770
  else {
42766
42771
  let s = n.pollStatusPeriod ?? 1e3;
42767
- await br(s), i.pollCount++;
42772
+ await Rr(s), i.pollCount++;
42768
42773
  }
42769
42774
  return this.request("GET", t, o, i);
42770
42775
  }
@@ -42776,20 +42781,20 @@ var Nt = class extends H {
42776
42781
  try {
42777
42782
  o.resolve(await this.request(o.method, B(this.fhirBaseUrl, o.url), o.options));
42778
42783
  } catch (s) {
42779
- o.reject(new d(Xe(s)));
42784
+ o.reject(new d(tt(s)));
42780
42785
  }
42781
42786
  return;
42782
42787
  }
42783
42788
  let n = { resourceType: "Bundle", type: "batch", entry: t.map((o) => ({ request: { method: o.method, url: o.url }, resource: o.options.body ? JSON.parse(o.options.body) : void 0 })) }, i = await this.post(this.fhirBaseUrl, n);
42784
42789
  for (let o = 0; o < t.length; o++) {
42785
42790
  let s = t[o], a2 = i.entry?.[o];
42786
- a2?.response?.outcome && !rr(a2.response.outcome) ? s.reject(new d(a2.response.outcome)) : s.resolve(a2?.resource);
42791
+ a2?.response?.outcome && !nr(a2.response.outcome) ? s.reject(new d(a2.response.outcome)) : s.resolve(a2?.resource);
42787
42792
  }
42788
42793
  }
42789
42794
  addFetchOptionsDefaults(t) {
42790
42795
  Object.entries(this.defaultHeaders).forEach(([n, i]) => {
42791
42796
  this.setRequestHeader(t, n, i);
42792
- }), this.setRequestHeader(t, "Accept", ra, true), this.options.extendedMode !== false && this.setRequestHeader(t, "X-Medplum", "extended"), t.body && this.setRequestHeader(t, "Content-Type", D.FHIR_JSON, true), this.accessToken ? this.setRequestHeader(t, "Authorization", "Bearer " + this.accessToken) : this.basicAuth && this.setRequestHeader(t, "Authorization", "Basic " + this.basicAuth), t.cache || (t.cache = "no-cache"), t.credentials || (t.credentials = "include");
42797
+ }), this.setRequestHeader(t, "Accept", oa, true), this.options.extendedMode !== false && this.setRequestHeader(t, "X-Medplum", "extended"), t.body && this.setRequestHeader(t, "Content-Type", D.FHIR_JSON, true), this.accessToken ? this.setRequestHeader(t, "Authorization", "Bearer " + this.accessToken) : this.basicAuth && this.setRequestHeader(t, "Authorization", "Basic " + this.basicAuth), t.cache || (t.cache = "no-cache"), t.credentials || (t.credentials = "include");
42793
42798
  }
42794
42799
  setRequestContentType(t, n) {
42795
42800
  this.setRequestHeader(t, "Content-Type", n);
@@ -42806,27 +42811,27 @@ var Nt = class extends H {
42806
42811
  return this.refresh() ? this.request(t, n, i) : (this.clear(), this.onUnauthenticated && this.onUnauthenticated(), Promise.reject(new d(Ee)));
42807
42812
  }
42808
42813
  async startPkce() {
42809
- let t = _r();
42814
+ let t = Nr();
42810
42815
  sessionStorage.setItem("pkceState", t);
42811
- let n = _r().slice(0, 128);
42816
+ let n = Nr().slice(0, 128);
42812
42817
  sessionStorage.setItem("codeVerifier", n);
42813
- let i = await fi(n), o = jn(i).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
42818
+ let i = await yi(n), o = $n(i).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
42814
42819
  return sessionStorage.setItem("codeChallenge", o), { codeChallengeMethod: "S256", codeChallenge: o };
42815
42820
  }
42816
42821
  async requestAuthorization(t) {
42817
42822
  let n = await this.ensureCodeChallenge(t ?? {}), i = new URL(this.authorizeUrl);
42818
- i.searchParams.set("response_type", "code"), i.searchParams.set("state", sessionStorage.getItem("pkceState")), i.searchParams.set("client_id", n.clientId ?? this.clientId), i.searchParams.set("redirect_uri", n.redirectUri ?? wi()), i.searchParams.set("code_challenge_method", n.codeChallengeMethod), i.searchParams.set("code_challenge", n.codeChallenge), i.searchParams.set("scope", n.scope ?? "openid profile"), window.location.assign(i.toString());
42823
+ i.searchParams.set("response_type", "code"), i.searchParams.set("state", sessionStorage.getItem("pkceState")), i.searchParams.set("client_id", n.clientId ?? this.clientId), i.searchParams.set("redirect_uri", n.redirectUri ?? Ii()), i.searchParams.set("code_challenge_method", n.codeChallengeMethod), i.searchParams.set("code_challenge", n.codeChallenge), i.searchParams.set("scope", n.scope ?? "openid profile"), window.location.assign(i.toString());
42819
42824
  }
42820
42825
  processCode(t, n) {
42821
42826
  let i = new URLSearchParams();
42822
- if (i.set("grant_type", "authorization_code"), i.set("code", t), i.set("client_id", n?.clientId ?? this.clientId), i.set("redirect_uri", n?.redirectUri ?? wi()), typeof sessionStorage < "u") {
42827
+ if (i.set("grant_type", "authorization_code"), i.set("code", t), i.set("client_id", n?.clientId ?? this.clientId), i.set("redirect_uri", n?.redirectUri ?? Ii()), typeof sessionStorage < "u") {
42823
42828
  let o = sessionStorage.getItem("codeVerifier");
42824
42829
  o && i.set("code_verifier", o);
42825
42830
  }
42826
42831
  return this.fetchTokens(i);
42827
42832
  }
42828
42833
  refreshIfExpired(t) {
42829
- return t === void 0 && (t = this.refreshGracePeriod), !this.refreshPromise && this.accessTokenExpires !== void 0 && Date.now() > this.accessTokenExpires - t && this.refresh(), this.refreshPromise ?? Promise.resolve();
42834
+ return !this.refreshPromise && this.accessTokenExpires !== void 0 && !this.isAuthenticated(t) && this.refresh(), this.refreshPromise ?? Promise.resolve();
42830
42835
  }
42831
42836
  refresh() {
42832
42837
  if (this.refreshPromise) return this.refreshPromise;
@@ -42851,25 +42856,25 @@ var Nt = class extends H {
42851
42856
  return n.append("grant_type", "client_credentials"), n.append("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), n.append("client_assertion", t), this.fetchTokens(n);
42852
42857
  }
42853
42858
  setBasicAuth(t, n) {
42854
- this.clientId = t, this.clientSecret = n, this.basicAuth = di(t + ":" + n);
42859
+ this.clientId = t, this.clientSecret = n, this.basicAuth = hi(t + ":" + n);
42855
42860
  }
42856
42861
  async fhircastSubscribe(t, n) {
42857
42862
  if (!(typeof t == "string" && t !== "")) throw new d(h("Invalid topic provided. Topic must be a valid string."));
42858
42863
  if (!(typeof n == "object" && Array.isArray(n) && n.length > 0)) throw new d(h("Invalid events provided. Events must be an array of event names containing at least one event."));
42859
- let i = { channelType: "websocket", mode: "subscribe", topic: t, events: n }, s = (await this.post(this.fhircastHubUrl, Ur(i), D.FORM_URL_ENCODED))["hub.channel.endpoint"];
42864
+ let i = { channelType: "websocket", mode: "subscribe", topic: t, events: n }, s = (await this.post(this.fhircastHubUrl, Br(i), D.FORM_URL_ENCODED))["hub.channel.endpoint"];
42860
42865
  if (!s) throw new Error("Invalid response!");
42861
42866
  return i.endpoint = s, i;
42862
42867
  }
42863
42868
  async fhircastUnsubscribe(t) {
42864
- if (!It(t)) throw new d(h("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));
42869
+ if (!kt(t)) throw new d(h("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));
42865
42870
  if (!(t.endpoint && typeof t.endpoint == "string" && t.endpoint.startsWith("ws"))) throw new d(h("Provided subscription request must have an endpoint in order to unsubscribe."));
42866
- t.mode = "unsubscribe", await this.post(this.fhircastHubUrl, Ur(t), D.FORM_URL_ENCODED);
42871
+ t.mode = "unsubscribe", await this.post(this.fhircastHubUrl, Br(t), D.FORM_URL_ENCODED);
42867
42872
  }
42868
42873
  fhircastConnect(t) {
42869
- return new Ot(t);
42874
+ return new It(t);
42870
42875
  }
42871
42876
  async fhircastPublish(t, n, i, o) {
42872
- return yi(n) ? this.post(this.fhircastHubUrl, Br(t, n, i, o), D.JSON) : (gi(n), this.post(this.fhircastHubUrl, Br(t, n, i), D.JSON));
42877
+ return vi(n) ? this.post(this.fhircastHubUrl, qr(t, n, i, o), D.JSON) : (Ti(n), this.post(this.fhircastHubUrl, qr(t, n, i), D.JSON));
42873
42878
  }
42874
42879
  async fhircastGetContext(t) {
42875
42880
  return this.get(`${this.fhircastHubUrl}/${t}`);
@@ -42900,12 +42905,12 @@ var Nt = class extends H {
42900
42905
  }
42901
42906
  async verifyTokens(t) {
42902
42907
  let n = t.access_token;
42903
- if (vi(n)) {
42904
- let i = kt(n);
42905
- if (Date.now() >= i.exp * 1e3) throw this.clearActiveLogin(), new d(sn);
42908
+ if (Ei(n)) {
42909
+ let i = Vt(n);
42910
+ if (Date.now() >= i.exp * 1e3) throw this.clearActiveLogin(), new d(un);
42906
42911
  if (i.cid) {
42907
- if (i.cid !== this.clientId) throw this.clearActiveLogin(), new d(tr);
42908
- } else if (this.clientId && i.client_id !== this.clientId) throw this.clearActiveLogin(), new d(tr);
42912
+ if (i.cid !== this.clientId) throw this.clearActiveLogin(), new d(rr);
42913
+ } else if (this.clientId && i.client_id !== this.clientId) throw this.clearActiveLogin(), new d(rr);
42909
42914
  }
42910
42915
  return this.setActiveLogin({ accessToken: n, refreshToken: t.refresh_token, project: t.project, profile: t.profile });
42911
42916
  }
@@ -42925,7 +42930,7 @@ var Nt = class extends H {
42925
42930
  }
42926
42931
  }
42927
42932
  getSubscriptionManager() {
42928
- return this.subscriptionManager || (this.subscriptionManager = new _t(this, Qn(this.baseUrl, "/ws/subscriptions-r4"))), this.subscriptionManager;
42933
+ return this.subscriptionManager || (this.subscriptionManager = new Nt(this, zn(this.baseUrl, "/ws/subscriptions-r4"))), this.subscriptionManager;
42929
42934
  }
42930
42935
  subscribeToCriteria(t, n) {
42931
42936
  return this.getSubscriptionManager().addCriteria(t, n);
@@ -42937,41 +42942,42 @@ var Nt = class extends H {
42937
42942
  return this.getSubscriptionManager().getMasterEmitter();
42938
42943
  }
42939
42944
  };
42940
- function fa() {
42945
+ function ya() {
42941
42946
  if (!globalThis.fetch) throw new Error("Fetch not available in this environment");
42942
42947
  return globalThis.fetch.bind(globalThis);
42943
42948
  }
42944
- function wi() {
42949
+ function Ii() {
42945
42950
  return typeof window > "u" ? "" : window.location.protocol + "//" + window.location.host + "/";
42946
42951
  }
42947
- async function Ai(r7, e) {
42952
+ async function ki(r7, e) {
42948
42953
  let t = r7.headers.get("content-location");
42949
42954
  if (t) return t;
42950
42955
  let n = r7.headers.get("location");
42951
42956
  if (n) return n;
42952
42957
  if (be(e) && e.issue?.[0]?.diagnostics) return e.issue[0].diagnostics;
42953
42958
  }
42954
- function Oi(r7) {
42959
+ function Vi(r7) {
42955
42960
  let e = r7.entry?.map((t) => t.resource) ?? [];
42956
42961
  return Object.assign(e, { bundle: r7 });
42957
42962
  }
42958
- function ma(r7) {
42963
+ function ga(r7) {
42959
42964
  return R(r7) && "data" in r7 && "contentType" in r7;
42960
42965
  }
42961
- function Ii(r7, e, t, n) {
42962
- return ma(r7) ? r7 : { data: r7, filename: e, contentType: t, onProgress: n };
42966
+ function Di(r7, e, t, n) {
42967
+ return ga(r7) ? r7 : { data: r7, filename: e, contentType: t, onProgress: n };
42963
42968
  }
42964
- function ha(r7) {
42969
+ function xa(r7) {
42965
42970
  return R(r7) && "docDefinition" in r7;
42966
42971
  }
42967
- function ya(r7, e, t, n) {
42968
- return ha(r7) ? r7 : { docDefinition: r7, filename: e, tableLayouts: t, fonts: n };
42972
+ function va(r7, e, t, n) {
42973
+ return xa(r7) ? r7 : { docDefinition: r7, filename: e, tableLayouts: t, fonts: n };
42969
42974
  }
42970
- var Aa = [...qe, "->", "<<", ">>", "=="];
42971
- var ka = je().registerInfix("->", { precedence: y.Arrow }).registerInfix(";", { precedence: y.Semicolon });
42972
- var za = [...qe, "eq", "ne", "co"];
42973
- var Za = je();
42974
- var se = class {
42975
+ var ka = [...je, "->", "<<", ">>", "=="];
42976
+ var Ma = $e().registerInfix("->", { precedence: y.Arrow }).registerInfix(";", { precedence: y.Semicolon });
42977
+ var Za = " ".repeat(2);
42978
+ var ec = [...je, "eq", "ne", "co"];
42979
+ var nc = $e();
42980
+ var ae = class {
42975
42981
  constructor(e = "\r", t = "|", n = "^", i = "~", o = "\\", s = "&") {
42976
42982
  this.segmentSeparator = e;
42977
42983
  this.fieldSeparator = t;
@@ -42987,8 +42993,8 @@ var se = class {
42987
42993
  return this.componentSeparator + this.repetitionSeparator + this.escapeCharacter + this.subcomponentSeparator;
42988
42994
  }
42989
42995
  };
42990
- var Qi = class r2 {
42991
- constructor(e, t = new se()) {
42996
+ var Yi = class r2 {
42997
+ constructor(e, t = new ae()) {
42992
42998
  this.context = t, this.segments = e;
42993
42999
  }
42994
43000
  get header() {
@@ -43011,7 +43017,7 @@ var Qi = class r2 {
43011
43017
  }
43012
43018
  buildAck() {
43013
43019
  let e = /* @__PURE__ */ new Date(), t = this.getSegment("MSH"), n = t?.getField(3)?.toString() ?? "", i = t?.getField(4)?.toString() ?? "", o = t?.getField(5)?.toString() ?? "", s = t?.getField(6)?.toString() ?? "", a2 = t?.getField(10)?.toString() ?? "", c = t?.getField(12)?.toString() ?? "2.5.1";
43014
- return new r2([new Ke(["MSH", this.context.getMsh2(), o, s, n, i, ec(e), "", this.buildAckMessageType(t), e.getTime().toString(), "P", c], this.context), new Ke(["MSA", "AA", a2, "OK"], this.context)]);
43020
+ return new r2([new Je(["MSH", this.context.getMsh2(), o, s, n, i, oc(e), "", this.buildAckMessageType(t), e.getTime().toString(), "P", c], this.context), new Je(["MSA", "AA", a2, "OK"], this.context)]);
43015
43021
  }
43016
43022
  buildAckMessageType(e) {
43017
43023
  let t = e?.getField(9), n = t?.getComponent(2), i = t?.getComponent(3), o = "ACK";
@@ -43022,21 +43028,21 @@ var Qi = class r2 {
43022
43028
  let n = new Error("Invalid HL7 message");
43023
43029
  throw n.type = "entity.parse.failed", n;
43024
43030
  }
43025
- let t = new se("\r", e.charAt(3), e.charAt(4), e.charAt(5), e.charAt(6), e.charAt(7));
43026
- return new r2(e.split(/[\r\n]+/).map((n) => Ke.parse(n, t)), t);
43031
+ let t = new ae("\r", e.charAt(3), e.charAt(4), e.charAt(5), e.charAt(6), e.charAt(7));
43032
+ return new r2(e.split(/[\r\n]+/).map((n) => Je.parse(n, t)), t);
43027
43033
  }
43028
43034
  };
43029
- var Ke = class r3 {
43030
- constructor(e, t = new se()) {
43031
- this.context = t, Un(e) ? this.fields = e.map((n) => Me.parse(n, t)) : this.fields = e, this.name = this.fields[0].components[0][0];
43035
+ var Je = class r3 {
43036
+ constructor(e, t = new ae()) {
43037
+ this.context = t, qn(e) ? this.fields = e.map((n) => _e.parse(n, t)) : this.fields = e, this.name = this.fields[0].components[0][0];
43032
43038
  }
43033
43039
  get(e) {
43034
43040
  return this.fields[e];
43035
43041
  }
43036
43042
  getField(e) {
43037
43043
  if (this.name === "MSH") {
43038
- if (e === 1) return new Me([[this.context.getMsh1()]], this.context);
43039
- if (e === 2) return new Me([[this.context.getMsh2()]], this.context);
43044
+ if (e === 1) return new _e([[this.context.getMsh1()]], this.context);
43045
+ if (e === 2) return new _e([[this.context.getMsh2()]], this.context);
43040
43046
  if (e > 2) return this.fields[e - 1];
43041
43047
  }
43042
43048
  return this.fields[e];
@@ -43047,12 +43053,12 @@ var Ke = class r3 {
43047
43053
  toString() {
43048
43054
  return this.fields.map((e) => e.toString()).join(this.context.fieldSeparator);
43049
43055
  }
43050
- static parse(e, t = new se()) {
43051
- return new r3(e.split(t.fieldSeparator).map((n) => Me.parse(n, t)), t);
43056
+ static parse(e, t = new ae()) {
43057
+ return new r3(e.split(t.fieldSeparator).map((n) => _e.parse(n, t)), t);
43052
43058
  }
43053
43059
  };
43054
- var Me = class r4 {
43055
- constructor(e, t = new se()) {
43060
+ var _e = class r4 {
43061
+ constructor(e, t = new ae()) {
43056
43062
  this.context = t, this.components = e;
43057
43063
  }
43058
43064
  get(e, t, n = 0) {
@@ -43065,16 +43071,16 @@ var Me = class r4 {
43065
43071
  toString() {
43066
43072
  return this.components.map((e) => e.join(this.context.componentSeparator)).join(this.context.repetitionSeparator);
43067
43073
  }
43068
- static parse(e, t = new se()) {
43074
+ static parse(e, t = new ae()) {
43069
43075
  return new r4(e.split(t.repetitionSeparator).map((n) => n.split(t.componentSeparator)), t);
43070
43076
  }
43071
43077
  };
43072
- function ec(r7) {
43078
+ function oc(r7) {
43073
43079
  let e = r7 instanceof Date ? r7 : new Date(r7), n = e.toISOString().replace(/[-:T]/g, "").replace(/(\.\d+)?Z$/, ""), i = e.getUTCMilliseconds();
43074
43080
  return i > 0 && (n += "." + i.toString()), n;
43075
43081
  }
43076
- var zr = ((o) => (o[o.NONE = 0] = "NONE", o[o.ERROR = 1] = "ERROR", o[o.WARN = 2] = "WARN", o[o.INFO = 3] = "INFO", o[o.DEBUG = 4] = "DEBUG", o))(zr || {});
43077
- var Ki = class r5 {
43082
+ var Yr = ((o) => (o[o.NONE = 0] = "NONE", o[o.ERROR = 1] = "ERROR", o[o.WARN = 2] = "WARN", o[o.INFO = 3] = "INFO", o[o.DEBUG = 4] = "DEBUG", o))(Yr || {});
43083
+ var Zi = class r5 {
43078
43084
  constructor(e, t = {}, n = 3, i) {
43079
43085
  this.write = e;
43080
43086
  this.metadata = t;
@@ -43104,17 +43110,17 @@ var Ki = class r5 {
43104
43110
  }
43105
43111
  log(e, t, n) {
43106
43112
  e > this.level || (n instanceof Error && (n = { error: n.toString(), stack: n.stack?.split(`
43107
- `) }), this.write(JSON.stringify({ level: zr[e], timestamp: (/* @__PURE__ */ new Date()).toISOString(), msg: this.prefix ? `${this.prefix}${t}` : t, ...n, ...this.metadata })));
43113
+ `) }), this.write(JSON.stringify({ level: Yr[e], timestamp: (/* @__PURE__ */ new Date()).toISOString(), msg: this.prefix ? `${this.prefix}${t}` : t, ...n, ...this.metadata })));
43108
43114
  }
43109
43115
  };
43110
- function mm(r7) {
43111
- let e = zr[r7.toUpperCase()];
43116
+ function vm(r7) {
43117
+ let e = Yr[r7.toUpperCase()];
43112
43118
  if (e === void 0) throw new Error(`Invalid log level: ${r7}`);
43113
43119
  return e;
43114
43120
  }
43115
- var ac = "https://api.github.com/repos/medplum/medplum/releases";
43116
- var Qt = /* @__PURE__ */ new Map();
43117
- function cc(r7) {
43121
+ var dc = "https://meta.medplum.com/releases";
43122
+ var Kt = /* @__PURE__ */ new Map();
43123
+ function fc(r7) {
43118
43124
  let e = r7;
43119
43125
  if (!e.tag_name) throw new Error("Manifest missing tag_name");
43120
43126
  let t = e.assets;
@@ -43124,40 +43130,42 @@ function cc(r7) {
43124
43130
  if (!n.name) throw new Error("Asset missing name");
43125
43131
  }
43126
43132
  }
43127
- async function Ji(r7) {
43128
- let e = Qt.get(r7 ?? "latest");
43129
- if (!e) {
43130
- let t = r7 ? `tags/v${r7}` : "latest", n = await fetch(`${ac}/${t}`);
43131
- if (n.status !== 200) {
43132
- let o;
43133
+ async function Xr(r7, e, t) {
43134
+ let n = Kt.get(e ?? "latest");
43135
+ if (!n) {
43136
+ let i = e ? `v${e}` : "latest", o = new URL(`${dc}/${i}.json`);
43137
+ if (o.searchParams.set("a", r7), o.searchParams.set("c", $r), t) for (let [c, u2] of Object.entries(t)) o.searchParams.set(c, u2);
43138
+ let s = await fetch(o.toString());
43139
+ if (s.status !== 200) {
43140
+ let c;
43133
43141
  try {
43134
- o = (await n.json()).message;
43135
- } catch (s) {
43136
- console.error(`Failed to parse message from body: ${Ne(s)}`);
43142
+ c = (await s.json()).message;
43143
+ } catch (u2) {
43144
+ console.error(`Failed to parse message from body: ${Re(u2)}`);
43137
43145
  }
43138
- throw new Error(`Received status code ${n.status} while fetching manifest for version '${r7 ?? "latest"}'. Message: ${o}`);
43146
+ throw new Error(`Received status code ${s.status} while fetching manifest for version '${e ?? "latest"}'. Message: ${c}`);
43139
43147
  }
43140
- let i = await n.json();
43141
- cc(i), e = i, Qt.set(r7 ?? "latest", e), r7 || Qt.set(e.tag_name.slice(1), e);
43148
+ let a2 = await s.json();
43149
+ fc(a2), n = a2, Kt.set(e ?? "latest", n), e || Kt.set(n.tag_name.slice(1), n);
43142
43150
  }
43143
- return e;
43151
+ return n;
43144
43152
  }
43145
- function uc(r7) {
43153
+ function mc(r7) {
43146
43154
  return /^\d+\.\d+\.\d+$/.test(r7);
43147
43155
  }
43148
- async function Am(r7) {
43149
- if (!uc(r7)) return false;
43156
+ async function Mm(r7, e) {
43157
+ if (!mc(e)) return false;
43150
43158
  try {
43151
- await Ji(r7);
43159
+ await Xr(r7, e);
43152
43160
  } catch {
43153
43161
  return false;
43154
43162
  }
43155
43163
  return true;
43156
43164
  }
43157
- async function Om() {
43158
- let r7 = await Ji();
43159
- if (!r7.tag_name.startsWith("v")) throw new Error(`Invalid release name found. Release tag '${r7.tag_name}' did not start with 'v'`);
43160
- return r7.tag_name.slice(1);
43165
+ async function _m(r7) {
43166
+ let e = await Xr(r7);
43167
+ if (!e.tag_name.startsWith("v")) throw new Error(`Invalid release name found. Release tag '${e.tag_name}' did not start with 'v'`);
43168
+ return e.tag_name.slice(1);
43161
43169
  }
43162
43170
 
43163
43171
  // src/agent-main.ts
@@ -43203,7 +43211,7 @@ var p = class extends a {
43203
43211
  e.on("data", (s) => {
43204
43212
  try {
43205
43213
  if (this.appendData(s), s.at(-2) === 28 && s.at(-1) === 13) {
43206
- let o = Buffer.concat(this.chunks), i = o.subarray(1, o.length - 2), f2 = (0, import_iconv_lite.decode)(i, this.encoding), g2 = Qi.parse(f2);
43214
+ let o = Buffer.concat(this.chunks), i = o.subarray(1, o.length - 2), f2 = (0, import_iconv_lite.decode)(i, this.encoding), g2 = Yi.parse(f2);
43207
43215
  this.dispatchEvent(new d2(this, g2)), this.resetBuffer();
43208
43216
  }
43209
43217
  } catch (o) {
@@ -43456,7 +43464,7 @@ var AgentDicomChannel = class extends BaseChannel {
43456
43464
  });
43457
43465
  response.setStatus(dimse.constants.Status.Success);
43458
43466
  } catch (err) {
43459
- DcmjsDimseScp.channel.log.error(`DICOM error: ${Ne(err)}`);
43467
+ DcmjsDimseScp.channel.log.error(`DICOM error: ${Re(err)}`);
43460
43468
  response.setStatus(dimse.constants.Status.ProcessingFailure);
43461
43469
  }
43462
43470
  return response;
@@ -43532,7 +43540,7 @@ var AgentHl7Channel = class extends BaseChannel {
43532
43540
  sendToRemote(msg) {
43533
43541
  const connection = this.connections.get(msg.remote);
43534
43542
  if (connection) {
43535
- connection.hl7Connection.send(Qi.parse(msg.body));
43543
+ connection.hl7Connection.send(Yi.parse(msg.body));
43536
43544
  }
43537
43545
  }
43538
43546
  handleNewConnection(connection) {
@@ -43561,7 +43569,7 @@ var AgentHl7ChannelConnection = class {
43561
43569
  callback: `Agent/${this.channel.app.agentId}-${(0, import_node_crypto2.randomUUID)()}`
43562
43570
  });
43563
43571
  } catch (err) {
43564
- this.channel.log.error(`HL7 error: ${Ne(err)}`);
43572
+ this.channel.log.error(`HL7 error: ${Re(err)}`);
43565
43573
  }
43566
43574
  }
43567
43575
  close() {
@@ -43581,7 +43589,7 @@ var UPGRADER_LOG_PATH = (0, import_node_path2.resolve)(
43581
43589
  );
43582
43590
  var RELEASES_PATH = (0, import_node_path2.resolve)(__dirname);
43583
43591
  async function downloadRelease(version, path) {
43584
- const release = await Ji(version);
43592
+ const release = await Xr("agent-upgrader", version);
43585
43593
  const downloadUrl = parseDownloadUrl(release, (0, import_node_os2.platform)());
43586
43594
  const { body } = await fetch(downloadUrl);
43587
43595
  if (!body) {
@@ -43593,9 +43601,9 @@ async function downloadRelease(version, path) {
43593
43601
  writeStream.once("close", resolve2);
43594
43602
  });
43595
43603
  }
43596
- function parseDownloadUrl(release, os2) {
43604
+ function parseDownloadUrl(release, os) {
43597
43605
  let endingToMatch;
43598
- switch (os2) {
43606
+ switch (os) {
43599
43607
  case "win32":
43600
43608
  endingToMatch = ".exe";
43601
43609
  break;
@@ -43603,14 +43611,14 @@ function parseDownloadUrl(release, os2) {
43603
43611
  endingToMatch = "linux";
43604
43612
  break;
43605
43613
  default:
43606
- throw new Error(`Unsupported platform: ${os2}`);
43614
+ throw new Error(`Unsupported platform: ${os}`);
43607
43615
  }
43608
43616
  for (const asset of release.assets) {
43609
43617
  if (asset.name.endsWith(endingToMatch)) {
43610
43618
  return asset.browser_download_url;
43611
43619
  }
43612
43620
  }
43613
- throw new Error(`No download URL found for release '${release.tag_name}' for ${os2}`);
43621
+ throw new Error(`No download URL found for release '${release.tag_name}' for ${os}`);
43614
43622
  }
43615
43623
  function getReleaseBinPath(version) {
43616
43624
  let binaryName;
@@ -43657,7 +43665,7 @@ var App = class _App {
43657
43665
  this.shutdown = false;
43658
43666
  this.keepAlive = false;
43659
43667
  _App.instance = this;
43660
- this.log = new Ki((msg) => console.log(msg), void 0, logLevel);
43668
+ this.log = new Zi((msg) => console.log(msg), void 0, logLevel);
43661
43669
  }
43662
43670
  async start() {
43663
43671
  this.log.info("Medplum service starting...");
@@ -43677,7 +43685,7 @@ var App = class _App {
43677
43685
  if ((0, import_node_fs3.existsSync)(UPGRADE_MANIFEST_PATH)) {
43678
43686
  const upgradeFile = (0, import_node_fs3.readFileSync)(UPGRADE_MANIFEST_PATH, { encoding: "utf-8" });
43679
43687
  const upgradeDetails = JSON.parse(upgradeFile);
43680
- if (upgradeDetails.targetVersion === tf.split("-")[0]) {
43688
+ if (upgradeDetails.targetVersion === $r.split("-")[0]) {
43681
43689
  await this.sendToWebSocket({
43682
43690
  type: "agent:upgrade:response",
43683
43691
  statusCode: 200,
@@ -43685,7 +43693,7 @@ var App = class _App {
43685
43693
  });
43686
43694
  this.log.info(`Successfully upgraded to version ${upgradeDetails.targetVersion}`);
43687
43695
  } else {
43688
- const errMsg = `Failed to upgrade to version ${upgradeDetails.targetVersion}. Agent still running with version ${tf}`;
43696
+ const errMsg = `Failed to upgrade to version ${upgradeDetails.targetVersion}. Agent still running with version ${$r}`;
43689
43697
  await this.sendToWebSocket({
43690
43698
  type: "agent:error",
43691
43699
  body: errMsg,
@@ -43722,7 +43730,7 @@ var App = class _App {
43722
43730
  webSocketUrl.protocol = webSocketUrl.protocol === "https:" ? "wss:" : "ws:";
43723
43731
  webSocketUrl.pathname = "/ws/agent";
43724
43732
  this.log.info(`Connecting to WebSocket: ${webSocketUrl.href}`);
43725
- this.webSocket = new Mt(webSocketUrl.toString(), void 0, {
43733
+ this.webSocket = new _t(webSocketUrl.toString(), void 0, {
43726
43734
  WebSocket: wrapper_default,
43727
43735
  binaryType: "nodebuffer"
43728
43736
  });
@@ -43760,7 +43768,7 @@ var App = class _App {
43760
43768
  break;
43761
43769
  case "agent:heartbeat:request":
43762
43770
  this.outstandingHeartbeats = 0;
43763
- await this.sendToWebSocket({ type: "agent:heartbeat:response", version: tf });
43771
+ await this.sendToWebSocket({ type: "agent:heartbeat:response", version: $r });
43764
43772
  break;
43765
43773
  case "agent:heartbeat:response":
43766
43774
  this.outstandingHeartbeats = 0;
@@ -43803,7 +43811,7 @@ var App = class _App {
43803
43811
  } catch (err) {
43804
43812
  await this.sendToWebSocket({
43805
43813
  type: "agent:error",
43806
- body: Ne(err),
43814
+ body: Re(err),
43807
43815
  callback: command.callback
43808
43816
  });
43809
43817
  }
@@ -43818,7 +43826,7 @@ var App = class _App {
43818
43826
  this.log.error(`Unknown message type: ${command.type}`);
43819
43827
  }
43820
43828
  } catch (err) {
43821
- this.log.error(`WebSocket error on incoming message: ${Ne(err)}`);
43829
+ this.log.error(`WebSocket error on incoming message: ${Re(err)}`);
43822
43830
  }
43823
43831
  });
43824
43832
  return new Promise((resolve2, reject) => {
@@ -43893,7 +43901,7 @@ var App = class _App {
43893
43901
  try {
43894
43902
  await this.startOrReloadChannel(definition, endpoint);
43895
43903
  } catch (err) {
43896
- this.log.error(Ne(err));
43904
+ this.log.error(Re(err));
43897
43905
  }
43898
43906
  }
43899
43907
  }
@@ -43919,7 +43927,7 @@ var App = class _App {
43919
43927
  parsedEndpoint = new URL(endpoint.address);
43920
43928
  } catch (err) {
43921
43929
  throw new Error(
43922
- `Error while validating endpoint address for channel '${channel.name}': ${Ne(err)}`
43930
+ `Error while validating endpoint address for channel '${channel.name}': ${Re(err)}`
43923
43931
  );
43924
43932
  }
43925
43933
  if (seenPorts.has(parsedEndpoint.port)) {
@@ -43998,7 +44006,7 @@ var App = class _App {
43998
44006
  try {
43999
44007
  await this.sendToWebSocket(msg);
44000
44008
  } catch (err) {
44001
- this.log.error(`WebSocket error while attempting to send message: ${Ne(err)}`);
44009
+ this.log.error(`WebSocket error while attempting to send message: ${Re(err)}`);
44002
44010
  this.webSocketQueue.unshift(msg);
44003
44011
  throw err;
44004
44012
  }
@@ -44035,7 +44043,7 @@ IPv6 is currently unsupported.`;
44035
44043
  this.log.error(errMsg);
44036
44044
  throw new Error(errMsg);
44037
44045
  }
44038
- if (!((0, import_node_net3.isIPv4)(message.remote) || il(message.remote))) {
44046
+ if (!((0, import_node_net3.isIPv4)(message.remote) || ul(message.remote))) {
44039
44047
  const errMsg = `Attempted to ping an invalid host.
44040
44048
 
44041
44049
  "${message.remote}" is not a valid IPv4 address or a resolvable hostname.`;
@@ -44074,7 +44082,7 @@ ${result}`);
44074
44082
  body: result
44075
44083
  });
44076
44084
  } catch (err) {
44077
- this.log.error(`Error during ping attempt to ${message.remote ?? "NO_HOST_GIVEN"}: ${Ne(err)}`);
44085
+ this.log.error(`Error during ping attempt to ${message.remote ?? "NO_HOST_GIVEN"}: ${Re(err)}`);
44078
44086
  this.addToWebSocketQueue({
44079
44087
  type: "agent:transmit:response",
44080
44088
  channel: message.channel,
@@ -44082,7 +44090,7 @@ ${result}`);
44082
44090
  remote: message.remote,
44083
44091
  callback: message.callback,
44084
44092
  statusCode: 400,
44085
- body: Ne(err)
44093
+ body: Re(err)
44086
44094
  });
44087
44095
  }
44088
44096
  }
@@ -44098,7 +44106,7 @@ ${result}`);
44098
44106
  return;
44099
44107
  }
44100
44108
  let child;
44101
- if (message.version && !await Am(message.version)) {
44109
+ if (message.version && !await Mm("agent-upgrader", message.version)) {
44102
44110
  const versionTag = message.version ? `v${message.version}` : "latest";
44103
44111
  const errMsg = `Error during upgrading to version '${versionTag}'. '${message.version}' is not a valid version`;
44104
44112
  this.log.error(errMsg);
@@ -44129,11 +44137,11 @@ ${result}`);
44129
44137
  });
44130
44138
  });
44131
44139
  child.on("error", (err) => {
44132
- this.log.error(Ne(err));
44140
+ this.log.error(Re(err));
44133
44141
  });
44134
44142
  } catch (err) {
44135
44143
  const versionTag = message.version ? `v${message.version}` : "latest";
44136
- const errMsg = `Error during upgrading to version '${versionTag}': ${Ne(err)}`;
44144
+ const errMsg = `Error during upgrading to version '${versionTag}': ${Re(err)}`;
44137
44145
  this.log.error(errMsg);
44138
44146
  await this.sendToWebSocket({
44139
44147
  type: "agent:error",
@@ -44145,12 +44153,12 @@ ${result}`);
44145
44153
  try {
44146
44154
  await this.stop();
44147
44155
  this.log.info("Successfully stopped agent network services");
44148
- const targetVersion = message.version ?? await Om();
44149
- this.log.info("Writing upgrade manifest...", { previousVersion: tf, targetVersion });
44156
+ const targetVersion = message.version ?? await _m("agent-upgrader");
44157
+ this.log.info("Writing upgrade manifest...", { previousVersion: $r, targetVersion });
44150
44158
  (0, import_node_fs3.writeFileSync)(
44151
44159
  UPGRADE_MANIFEST_PATH,
44152
44160
  JSON.stringify({
44153
- previousVersion: tf,
44161
+ previousVersion: $r,
44154
44162
  targetVersion,
44155
44163
  callback: message.callback ?? null
44156
44164
  }),
@@ -44160,7 +44168,7 @@ ${result}`);
44160
44168
  child.disconnect();
44161
44169
  } catch (err) {
44162
44170
  this.log.error(
44163
- `Error while stopping agent or messaging child process as part of upgrade: ${Ne(err)}`
44171
+ `Error while stopping agent or messaging child process as part of upgrade: ${Re(err)}`
44164
44172
  );
44165
44173
  import_node_process.default.exit(1);
44166
44174
  }
@@ -44218,7 +44226,7 @@ ${result}`);
44218
44226
  });
44219
44227
  }
44220
44228
  }
44221
- client.sendAndWait(Qi.parse(message.body)).then((response) => {
44229
+ client.sendAndWait(Yi.parse(message.body)).then((response) => {
44222
44230
  this.log.info(`Response: ${response.toString().replaceAll("\r", "\n")}`);
44223
44231
  this.addToWebSocketQueue({
44224
44232
  type: "agent:transmit:response",
@@ -44230,7 +44238,7 @@ ${result}`);
44230
44238
  body: response.toString()
44231
44239
  });
44232
44240
  }).catch((err) => {
44233
- this.log.error(`HL7 error: ${Ne(err)}`);
44241
+ this.log.error(`HL7 error: ${Re(err)}`);
44234
44242
  this.addToWebSocketQueue({
44235
44243
  type: "agent:transmit:response",
44236
44244
  channel: message.channel,
@@ -44238,7 +44246,7 @@ ${result}`);
44238
44246
  callback: message.callback,
44239
44247
  contentType: D.TEXT,
44240
44248
  statusCode: 400,
44241
- body: Ne(err)
44249
+ body: Re(err)
44242
44250
  });
44243
44251
  if (client.keepAlive) {
44244
44252
  this.hl7Clients.delete(message.remote);
@@ -44285,9 +44293,9 @@ async function agentMain(argv) {
44285
44293
  process.exit(1);
44286
44294
  }
44287
44295
  const { baseUrl, clientId, clientSecret, agentId } = args;
44288
- const medplum = new Nt({ baseUrl, clientId });
44296
+ const medplum = new Lt({ baseUrl, clientId });
44289
44297
  await medplum.startClientLogin(clientId, clientSecret);
44290
- const app = new App(medplum, agentId, mm(args.logLevel ?? "INFO"));
44298
+ const app = new App(medplum, agentId, vm(args.logLevel ?? "INFO"));
44291
44299
  await app.start();
44292
44300
  process.on("SIGINT", async () => {
44293
44301
  console.log("Gracefully shutting down from SIGINT (Ctrl-C)");
@@ -44315,7 +44323,7 @@ async function upgraderMain(argv) {
44315
44323
  if ((0, import_node_os4.platform)() !== "win32") {
44316
44324
  throw new Error(`Unsupported platform: ${(0, import_node_os4.platform)()}. Agent upgrader currently only supports Windows`);
44317
44325
  }
44318
- const globalLogger = new Ki((msg) => console.log(msg));
44326
+ const globalLogger = new Zi((msg) => console.log(msg));
44319
44327
  if (!import_node_process2.default.send) {
44320
44328
  globalLogger.error("Upgrader not started as a child process with Node IPC enabled. Aborting...");
44321
44329
  import_node_process2.default.exit(1);
@@ -44328,10 +44336,10 @@ async function upgraderMain(argv) {
44328
44336
  });
44329
44337
  });
44330
44338
  import_node_process2.default.send({ type: "STARTED" });
44331
- if (argv[3] && !uc(argv[3])) {
44339
+ if (argv[3] && !mc(argv[3])) {
44332
44340
  throw new Error("Invalid version specified");
44333
44341
  }
44334
- const version = argv[3] ?? await Om();
44342
+ const version = argv[3] ?? await _m("agent-upgrader");
44335
44343
  const binPath = getReleaseBinPath(version);
44336
44344
  if (!(0, import_node_fs5.existsSync)(binPath)) {
44337
44345
  globalLogger.info(`Could not find binary at "${binPath}". Downloading release from GitHub...`);
@@ -44354,7 +44362,7 @@ async function upgraderMain(argv) {
44354
44362
  (0, import_node_child_process2.spawnSync)(binPath, ["/S"]);
44355
44363
  globalLogger.info(`Agent version ${version} successfully installed`);
44356
44364
  } catch (err) {
44357
- globalLogger.error(`Error while attempting to run installer: ${Ne(err)}`);
44365
+ globalLogger.error(`Error while attempting to run installer: ${Re(err)}`);
44358
44366
  globalLogger.error("Failed to run installer, attempting to restart agent service...");
44359
44367
  try {
44360
44368
  (0, import_node_child_process2.execSync)('net start "Medplum Agent"');