@ohif/app 3.8.0-beta.49 → 3.8.0-beta.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{170.bundle.e577dc0d956f1953e380.js → 170.bundle.c897981826842ee375b5.js} +5 -5
- package/dist/{181.bundle.59bc83ea0a5cf5d335e7.js → 181.bundle.aff453c348111303ceac.js} +50 -5
- package/dist/{185.bundle.bb532c5a39336cc50ec4.js → 185.bundle.87b32cd8145a37e8d07b.js} +9 -9
- package/dist/{19.bundle.7d12fbb10f0b7d9f423f.js → 19.bundle.89cb082532a16f04ce74.js} +2 -2
- package/dist/{199.bundle.a7b34913c5cc04dcee37.js → 199.bundle.08204857a65f29ec5dca.js} +6 -6
- package/dist/{202.bundle.c7c412d83b745f890834.js → 202.bundle.495cba6bbee744cf8f72.js} +90 -20
- package/dist/{250.bundle.96a47756a15efbdf78af.js → 250.bundle.577da106dd763c7bf9d0.js} +4 -4
- package/dist/{456.bundle.12c7f46372c1282e1037.js → 290.bundle.fac1e48a4027ad949764.js} +51 -20
- package/dist/{359.bundle.7145c9bbf727742152fe.js → 359.bundle.deef89c05907539f5718.js} +1 -1
- package/dist/{410.bundle.cff6e306a549ee8bf189.js → 410.bundle.0c7d688cd70a4980fdbb.js} +1 -1
- package/dist/{451.bundle.9b9abf9ca8967a46fa93.js → 451.bundle.311cd3be9916e08450e9.js} +1 -1
- package/dist/{466.bundle.87b78b8e78ec45730add.js → 466.bundle.e0169e052354437a4fd0.js} +3 -3
- package/dist/{471.bundle.a646b0616732bbc945b4.js → 471.bundle.eeb78105b59e688832a6.js} +2 -2
- package/dist/{483.bundle.dd1479f9915ebc0853c8.js → 483.bundle.17425951eb8bd48dce01.js} +3 -3
- package/dist/{613.bundle.edb1ecd62324ef2ade89.js → 613.bundle.a1e84b764ea6f872169a.js} +3 -3
- package/dist/{738.bundle.a2820bc290ae21f68ba2.js → 738.bundle.443a3c3dd2aaa0d02a38.js} +4 -4
- package/dist/{822.bundle.b3c3a7d5a0768cd9c990.js → 822.bundle.8b745e28bc9eb9afbc61.js} +2 -2
- package/dist/{886.bundle.69f07c567a3dc69b060f.js → 886.bundle.94a4536167d0f8cae1ae.js} +1 -1
- package/dist/{95.bundle.644c927d99988ff60b36.js → 95.bundle.2236101be3cc36b322e8.js} +2 -2
- package/dist/{965.bundle.7b8c20af8a16c950ebfb.js → 965.bundle.527f031a2bf5fc4202a0.js} +1 -1
- package/dist/{app.bundle.db1ef573f40277a1ba59.js → app.bundle.be53f58aee6b64f5a624.js} +603 -286
- package/dist/index.html +1 -1
- package/dist/sw.js +1 -1
- package/package.json +17 -17
- /package/dist/{12.bundle.775757e347ff672d7e94.js → 12.bundle.aebca43849fb89e4487c.js} +0 -0
- /package/dist/{281.bundle.8fa2c03372e7cba54c5c.js → 281.bundle.987f88c6aea8b8bc35e4.js} +0 -0
- /package/dist/{456.css → 290.css} +0 -0
- /package/dist/{506.bundle.d54a44f344cd9103765e.js → 506.bundle.65012c25d91e5be25425.js} +0 -0
- /package/dist/{687.bundle.2de3c342a07c51febc7d.js → 687.bundle.72ba0b232154d01b3b5c.js} +0 -0
- /package/dist/{814.bundle.4fb84b711e1be0d81358.js → 814.bundle.f6d799e21bcc5b5b0ab3.js} +0 -0
|
@@ -100,7 +100,7 @@ Compose.propTypes = {
|
|
|
100
100
|
children: (prop_types_default()).node.isRequired
|
|
101
101
|
};
|
|
102
102
|
// EXTERNAL MODULE: ../../ui/src/index.js + 487 modules
|
|
103
|
-
var ui_src = __webpack_require__(
|
|
103
|
+
var ui_src = __webpack_require__(18414);
|
|
104
104
|
// EXTERNAL MODULE: ./state/index.js + 1 modules
|
|
105
105
|
var state = __webpack_require__(62657);
|
|
106
106
|
// EXTERNAL MODULE: ../../core/src/index.ts + 65 modules
|
|
@@ -362,7 +362,7 @@ function _getQueryFilterValues(query, queryLimit) {
|
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
364
|
// EXTERNAL MODULE: ../../../node_modules/classnames/index.js
|
|
365
|
-
var classnames = __webpack_require__(
|
|
365
|
+
var classnames = __webpack_require__(33901);
|
|
366
366
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
367
367
|
// EXTERNAL MODULE: ../../../node_modules/moment/moment.js
|
|
368
368
|
var moment = __webpack_require__(71271);
|
|
@@ -987,8 +987,8 @@ function WorkList({
|
|
|
987
987
|
};
|
|
988
988
|
});
|
|
989
989
|
const hasStudies = numOfStudies > 0;
|
|
990
|
-
const versionNumber = "3.8.0-beta.
|
|
991
|
-
const commitHash = "
|
|
990
|
+
const versionNumber = "3.8.0-beta.50";
|
|
991
|
+
const commitHash = "e4a116b074fcb85c8cbcc9db44fdec565f3386db";
|
|
992
992
|
const menuOptions = [{
|
|
993
993
|
title: t('Header:About'),
|
|
994
994
|
icon: 'info',
|
|
@@ -1934,7 +1934,7 @@ async function loadModule(module) {
|
|
|
1934
1934
|
return imported.default;
|
|
1935
1935
|
}
|
|
1936
1936
|
if (module === "@ohif/extension-cornerstone") {
|
|
1937
|
-
const imported = await Promise.all(/* import() */[__webpack_require__.e(661), __webpack_require__.e(95), __webpack_require__.e(
|
|
1937
|
+
const imported = await Promise.all(/* import() */[__webpack_require__.e(661), __webpack_require__.e(95), __webpack_require__.e(290)]).then(__webpack_require__.bind(__webpack_require__, 21290));
|
|
1938
1938
|
return imported.default;
|
|
1939
1939
|
}
|
|
1940
1940
|
if (module === "@ohif/extension-measurement-tracking") {
|
|
@@ -6457,7 +6457,7 @@ const detectionOptions = {
|
|
|
6457
6457
|
}
|
|
6458
6458
|
});
|
|
6459
6459
|
;// CONCATENATED MODULE: ../../i18n/package.json
|
|
6460
|
-
const package_namespaceObject = JSON.parse('{"i8":"3.8.0-beta.
|
|
6460
|
+
const package_namespaceObject = JSON.parse('{"i8":"3.8.0-beta.49"}');
|
|
6461
6461
|
;// CONCATENATED MODULE: ../../i18n/src/utils.js
|
|
6462
6462
|
const languagesMap = {
|
|
6463
6463
|
ar: 'Arabic',
|
|
@@ -10321,7 +10321,7 @@ var react = __webpack_require__(43001);
|
|
|
10321
10321
|
var prop_types = __webpack_require__(3827);
|
|
10322
10322
|
var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);
|
|
10323
10323
|
// EXTERNAL MODULE: ../../../node_modules/classnames/index.js
|
|
10324
|
-
var classnames = __webpack_require__(
|
|
10324
|
+
var classnames = __webpack_require__(33901);
|
|
10325
10325
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
10326
10326
|
;// CONCATENATED MODULE: ../../ui/src/components/Typography/Typography.tsx
|
|
10327
10327
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
@@ -10434,7 +10434,7 @@ Typography.propTypes = {
|
|
|
10434
10434
|
|
|
10435
10435
|
/***/ }),
|
|
10436
10436
|
|
|
10437
|
-
/***/
|
|
10437
|
+
/***/ 18414:
|
|
10438
10438
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
10439
10439
|
|
|
10440
10440
|
"use strict";
|
|
@@ -10567,7 +10567,7 @@ var react_namespaceObject = /*#__PURE__*/__webpack_require__.t(react, 2);
|
|
|
10567
10567
|
var cjs = __webpack_require__(98869);
|
|
10568
10568
|
var cjs_default = /*#__PURE__*/__webpack_require__.n(cjs);
|
|
10569
10569
|
// EXTERNAL MODULE: ../../../node_modules/classnames/index.js
|
|
10570
|
-
var classnames = __webpack_require__(
|
|
10570
|
+
var classnames = __webpack_require__(33901);
|
|
10571
10571
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
10572
10572
|
// EXTERNAL MODULE: ../../core/src/utils/guid.js
|
|
10573
10573
|
var guid = __webpack_require__(77127);
|
|
@@ -21107,15 +21107,12 @@ var inherits = __webpack_require__(57652);
|
|
|
21107
21107
|
var getPrototypeOf = __webpack_require__(69721);
|
|
21108
21108
|
;// CONCATENATED MODULE: ../../../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js
|
|
21109
21109
|
function isNativeReflectConstruct_isNativeReflectConstruct() {
|
|
21110
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
21111
|
-
if (Reflect.construct.sham) return false;
|
|
21112
|
-
if (typeof Proxy === "function") return true;
|
|
21113
21110
|
try {
|
|
21114
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
21115
|
-
|
|
21116
|
-
|
|
21117
|
-
return
|
|
21118
|
-
}
|
|
21111
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
21112
|
+
} catch (t) {}
|
|
21113
|
+
return (isNativeReflectConstruct_isNativeReflectConstruct = function _isNativeReflectConstruct() {
|
|
21114
|
+
return !!t;
|
|
21115
|
+
})();
|
|
21119
21116
|
}
|
|
21120
21117
|
// EXTERNAL MODULE: ../../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
|
|
21121
21118
|
var possibleConstructorReturn = __webpack_require__(36639);
|
|
@@ -23438,7 +23435,7 @@ var Emotion$1 = Emotion;
|
|
|
23438
23435
|
|
|
23439
23436
|
var pkg = {
|
|
23440
23437
|
name: "@emotion/react",
|
|
23441
|
-
version: "11.11.
|
|
23438
|
+
version: "11.11.3",
|
|
23442
23439
|
main: "dist/emotion-react.cjs.js",
|
|
23443
23440
|
module: "dist/emotion-react.esm.js",
|
|
23444
23441
|
browser: {
|
|
@@ -23511,7 +23508,7 @@ var pkg = {
|
|
|
23511
23508
|
"@babel/runtime": "^7.18.3",
|
|
23512
23509
|
"@emotion/babel-plugin": "^11.11.0",
|
|
23513
23510
|
"@emotion/cache": "^11.11.0",
|
|
23514
|
-
"@emotion/serialize": "^1.1.
|
|
23511
|
+
"@emotion/serialize": "^1.1.3",
|
|
23515
23512
|
"@emotion/use-insertion-effect-with-fallbacks": "^1.0.1",
|
|
23516
23513
|
"@emotion/utils": "^1.2.1",
|
|
23517
23514
|
"@emotion/weak-memoize": "^0.3.1",
|
|
@@ -23527,7 +23524,7 @@ var pkg = {
|
|
|
23527
23524
|
},
|
|
23528
23525
|
devDependencies: {
|
|
23529
23526
|
"@definitelytyped/dtslint": "0.0.112",
|
|
23530
|
-
"@emotion/css": "11.11.
|
|
23527
|
+
"@emotion/css": "11.11.2",
|
|
23531
23528
|
"@emotion/css-prettifier": "1.1.3",
|
|
23532
23529
|
"@emotion/server": "11.11.0",
|
|
23533
23530
|
"@emotion/styled": "11.11.0",
|
|
@@ -23848,6 +23845,11 @@ function _taggedTemplateLiteral(strings, raw) {
|
|
|
23848
23845
|
// EXTERNAL MODULE: ../../../node_modules/react-dom/index.js
|
|
23849
23846
|
var react_dom = __webpack_require__(14347);
|
|
23850
23847
|
;// CONCATENATED MODULE: ../../../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
23848
|
+
/**
|
|
23849
|
+
* Custom positioning reference element.
|
|
23850
|
+
* @see https://floating-ui.com/docs/virtual-elements
|
|
23851
|
+
*/
|
|
23852
|
+
|
|
23851
23853
|
const floating_ui_utils_sides = (/* unused pure expression or super */ null && (['top', 'right', 'bottom', 'left']));
|
|
23852
23854
|
const alignments = (/* unused pure expression or super */ null && (['start', 'end']));
|
|
23853
23855
|
const floating_ui_utils_placements = /*#__PURE__*/(/* unused pure expression or super */ null && (floating_ui_utils_sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), [])));
|
|
@@ -24035,7 +24037,7 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
24035
24037
|
|
|
24036
24038
|
/**
|
|
24037
24039
|
* Computes the `x` and `y` coordinates that will place the floating element
|
|
24038
|
-
* next to a reference element
|
|
24040
|
+
* next to a given reference element.
|
|
24039
24041
|
*
|
|
24040
24042
|
* This export does not have any `platform` interface logic. You will need to
|
|
24041
24043
|
* write one for the platform you are using Floating UI with.
|
|
@@ -24690,6 +24692,7 @@ const inline = function (options) {
|
|
|
24690
24692
|
|
|
24691
24693
|
// For type backwards-compatibility, the `OffsetOptions` type was also
|
|
24692
24694
|
// Derivable.
|
|
24695
|
+
|
|
24693
24696
|
async function convertValueToCoords(state, options) {
|
|
24694
24697
|
const {
|
|
24695
24698
|
placement,
|
|
@@ -24998,7 +25001,7 @@ const floating_ui_core_size = function (options) {
|
|
|
24998
25001
|
|
|
24999
25002
|
|
|
25000
25003
|
|
|
25001
|
-
;// CONCATENATED MODULE: ../../../node_modules/@floating-ui/utils/
|
|
25004
|
+
;// CONCATENATED MODULE: ../../../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
|
|
25002
25005
|
function getNodeName(node) {
|
|
25003
25006
|
if (isNode(node)) {
|
|
25004
25007
|
return (node.nodeName || '').toLowerCase();
|
|
@@ -25010,7 +25013,7 @@ function getNodeName(node) {
|
|
|
25010
25013
|
}
|
|
25011
25014
|
function floating_ui_utils_dom_getWindow(node) {
|
|
25012
25015
|
var _node$ownerDocument;
|
|
25013
|
-
return (node == null
|
|
25016
|
+
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
25014
25017
|
}
|
|
25015
25018
|
function getDocumentElement(node) {
|
|
25016
25019
|
var _ref;
|
|
@@ -25458,7 +25461,14 @@ function getClippingRect(_ref) {
|
|
|
25458
25461
|
}
|
|
25459
25462
|
|
|
25460
25463
|
function getDimensions(element) {
|
|
25461
|
-
|
|
25464
|
+
const {
|
|
25465
|
+
width,
|
|
25466
|
+
height
|
|
25467
|
+
} = getCssDimensions(element);
|
|
25468
|
+
return {
|
|
25469
|
+
width,
|
|
25470
|
+
height
|
|
25471
|
+
};
|
|
25462
25472
|
}
|
|
25463
25473
|
|
|
25464
25474
|
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
@@ -25704,10 +25714,66 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
25704
25714
|
};
|
|
25705
25715
|
}
|
|
25706
25716
|
|
|
25717
|
+
/**
|
|
25718
|
+
* Optimizes the visibility of the floating element by choosing the placement
|
|
25719
|
+
* that has the most space available automatically, without needing to specify a
|
|
25720
|
+
* preferred placement. Alternative to `flip`.
|
|
25721
|
+
* @see https://floating-ui.com/docs/autoPlacement
|
|
25722
|
+
*/
|
|
25723
|
+
const floating_ui_dom_autoPlacement = (/* unused pure expression or super */ null && (autoPlacement$1));
|
|
25724
|
+
|
|
25725
|
+
/**
|
|
25726
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
25727
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
25728
|
+
* @see https://floating-ui.com/docs/shift
|
|
25729
|
+
*/
|
|
25730
|
+
const floating_ui_dom_shift = (/* unused pure expression or super */ null && (shift$1));
|
|
25731
|
+
|
|
25732
|
+
/**
|
|
25733
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
25734
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
25735
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
25736
|
+
* @see https://floating-ui.com/docs/flip
|
|
25737
|
+
*/
|
|
25738
|
+
const floating_ui_dom_flip = (/* unused pure expression or super */ null && (flip$1));
|
|
25739
|
+
|
|
25740
|
+
/**
|
|
25741
|
+
* Provides data that allows you to change the size of the floating element —
|
|
25742
|
+
* for instance, prevent it from overflowing the clipping boundary or match the
|
|
25743
|
+
* width of the reference element.
|
|
25744
|
+
* @see https://floating-ui.com/docs/size
|
|
25745
|
+
*/
|
|
25746
|
+
const floating_ui_dom_size = (/* unused pure expression or super */ null && (size$1));
|
|
25747
|
+
|
|
25748
|
+
/**
|
|
25749
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
25750
|
+
* when it is not in the same clipping context as the reference element.
|
|
25751
|
+
* @see https://floating-ui.com/docs/hide
|
|
25752
|
+
*/
|
|
25753
|
+
const floating_ui_dom_hide = (/* unused pure expression or super */ null && (hide$1));
|
|
25754
|
+
|
|
25755
|
+
/**
|
|
25756
|
+
* Provides data to position an inner element of the floating element so that it
|
|
25757
|
+
* appears centered to the reference element.
|
|
25758
|
+
* @see https://floating-ui.com/docs/arrow
|
|
25759
|
+
*/
|
|
25760
|
+
const floating_ui_dom_arrow = (/* unused pure expression or super */ null && (arrow$1));
|
|
25761
|
+
|
|
25762
|
+
/**
|
|
25763
|
+
* Provides improved positioning for inline reference elements that can span
|
|
25764
|
+
* over multiple lines, such as hyperlinks or range selections.
|
|
25765
|
+
* @see https://floating-ui.com/docs/inline
|
|
25766
|
+
*/
|
|
25767
|
+
const floating_ui_dom_inline = (/* unused pure expression or super */ null && (inline$1));
|
|
25768
|
+
|
|
25769
|
+
/**
|
|
25770
|
+
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
25771
|
+
*/
|
|
25772
|
+
const floating_ui_dom_limitShift = (/* unused pure expression or super */ null && (limitShift$1));
|
|
25773
|
+
|
|
25707
25774
|
/**
|
|
25708
25775
|
* Computes the `x` and `y` coordinates that will place the floating element
|
|
25709
|
-
* next to a reference element
|
|
25710
|
-
* strategy.
|
|
25776
|
+
* next to a given reference element.
|
|
25711
25777
|
*/
|
|
25712
25778
|
const floating_ui_dom_computePosition = (reference, floating, options) => {
|
|
25713
25779
|
// This caches the expensive `getClippingElementAncestors` function so that
|
|
@@ -58414,7 +58480,7 @@ webpackContext.id = 84179;
|
|
|
58414
58480
|
|
|
58415
58481
|
/***/ }),
|
|
58416
58482
|
|
|
58417
|
-
/***/
|
|
58483
|
+
/***/ 64225:
|
|
58418
58484
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
58419
58485
|
|
|
58420
58486
|
"use strict";
|
|
@@ -58624,6 +58690,7 @@ __webpack_require__.d(utilities_namespaceObject, {
|
|
|
58624
58690
|
clamp: () => (clamp),
|
|
58625
58691
|
colormap: () => (utilities_colormap_namespaceObject),
|
|
58626
58692
|
convertStackToVolumeViewport: () => (convertStackToVolumeViewport),
|
|
58693
|
+
convertToGrayscale: () => (convertToGrayscale),
|
|
58627
58694
|
convertVolumeToStackViewport: () => (convertVolumeToStackViewport),
|
|
58628
58695
|
createFloat32SharedArray: () => (utilities_createFloat32SharedArray),
|
|
58629
58696
|
createInt16SharedArray: () => (utilities_createInt16SharedArray),
|
|
@@ -104317,6 +104384,12 @@ class Viewport {
|
|
|
104317
104384
|
const result = (esm/* vec2.subtract */.K4.subtract(esm/* vec2.create */.K4.create(), initialCanvasFocal, currentCanvasFocal));
|
|
104318
104385
|
return result;
|
|
104319
104386
|
}
|
|
104387
|
+
getCurrentImageIdIndex() {
|
|
104388
|
+
throw new Error('Not implemented');
|
|
104389
|
+
}
|
|
104390
|
+
getTargetId(specifier) {
|
|
104391
|
+
return null;
|
|
104392
|
+
}
|
|
104320
104393
|
setPan(pan, storeAsInitialCamera = false) {
|
|
104321
104394
|
const previousCamera = this.getCamera();
|
|
104322
104395
|
const { focalPoint, position } = previousCamera;
|
|
@@ -105343,6 +105416,19 @@ class BaseVolumeViewport extends RenderingEngine_Viewport {
|
|
|
105343
105416
|
index[0];
|
|
105344
105417
|
return volume.getScalarData()[voxelIndex];
|
|
105345
105418
|
}
|
|
105419
|
+
getTargetId(specifier = {}) {
|
|
105420
|
+
let { volumeId, sliceIndex } = specifier;
|
|
105421
|
+
if (!volumeId) {
|
|
105422
|
+
const actorEntries = this.getActors();
|
|
105423
|
+
if (!actorEntries) {
|
|
105424
|
+
return;
|
|
105425
|
+
}
|
|
105426
|
+
volumeId = actorEntries.find((actorEntry) => actorEntry.actor.getClassName() === 'vtkVolume')?.uid;
|
|
105427
|
+
}
|
|
105428
|
+
sliceIndex ??= this.getCurrentImageIdIndex();
|
|
105429
|
+
const { viewPlaneNormal, focalPoint } = this.getCamera();
|
|
105430
|
+
return `volumeId:${volumeId}?sliceIndex=${sliceIndex}&viewPlaneNormal=${viewPlaneNormal.join(',')}&focalPoint=${focalPoint.join(',')}`;
|
|
105431
|
+
}
|
|
105346
105432
|
}
|
|
105347
105433
|
/* harmony default export */ const RenderingEngine_BaseVolumeViewport = (BaseVolumeViewport);
|
|
105348
105434
|
|
|
@@ -105706,20 +105792,21 @@ function roundNumber(value, precision = 2) {
|
|
|
105706
105792
|
return 'NaN';
|
|
105707
105793
|
}
|
|
105708
105794
|
value = Number(value);
|
|
105709
|
-
|
|
105795
|
+
const absValue = Math.abs(value);
|
|
105796
|
+
if (absValue < 0.0001) {
|
|
105710
105797
|
return `${value}`;
|
|
105711
105798
|
}
|
|
105712
|
-
const fixedPrecision =
|
|
105799
|
+
const fixedPrecision = absValue >= 100
|
|
105713
105800
|
? precision - 2
|
|
105714
|
-
:
|
|
105801
|
+
: absValue >= 10
|
|
105715
105802
|
? precision - 1
|
|
105716
|
-
:
|
|
105803
|
+
: absValue >= 1
|
|
105717
105804
|
? precision
|
|
105718
|
-
:
|
|
105805
|
+
: absValue >= 0.1
|
|
105719
105806
|
? precision + 1
|
|
105720
|
-
:
|
|
105807
|
+
: absValue >= 0.01
|
|
105721
105808
|
? precision + 2
|
|
105722
|
-
:
|
|
105809
|
+
: absValue >= 0.001
|
|
105723
105810
|
? precision + 3
|
|
105724
105811
|
: precision + 4;
|
|
105725
105812
|
return value.toFixed(fixedPrecision);
|
|
@@ -105730,6 +105817,32 @@ function roundToPrecision(value) {
|
|
|
105730
105817
|
|
|
105731
105818
|
/* harmony default export */ const utilities_roundNumber = (roundNumber);
|
|
105732
105819
|
|
|
105820
|
+
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/convertToGrayscale.js
|
|
105821
|
+
function convertToGrayscale(scalarData, width, height) {
|
|
105822
|
+
const isRGBA = scalarData.length === width * height * 4;
|
|
105823
|
+
const isRGB = scalarData.length === width * height * 3;
|
|
105824
|
+
if (isRGBA || isRGB) {
|
|
105825
|
+
const newScalarData = new Float32Array(width * height);
|
|
105826
|
+
let offset = 0;
|
|
105827
|
+
let destOffset = 0;
|
|
105828
|
+
const increment = isRGBA ? 4 : 3;
|
|
105829
|
+
for (let x = 0; x < width; x++) {
|
|
105830
|
+
for (let y = 0; y < height; y++) {
|
|
105831
|
+
const r = scalarData[offset];
|
|
105832
|
+
const g = scalarData[offset + 1];
|
|
105833
|
+
const b = scalarData[offset + 2];
|
|
105834
|
+
newScalarData[destOffset] = (r + g + b) / 3;
|
|
105835
|
+
offset += increment;
|
|
105836
|
+
destOffset++;
|
|
105837
|
+
}
|
|
105838
|
+
}
|
|
105839
|
+
return newScalarData;
|
|
105840
|
+
}
|
|
105841
|
+
else {
|
|
105842
|
+
return scalarData;
|
|
105843
|
+
}
|
|
105844
|
+
}
|
|
105845
|
+
|
|
105733
105846
|
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/planar.js
|
|
105734
105847
|
|
|
105735
105848
|
function linePlaneIntersection(p0, p1, plane) {
|
|
@@ -105864,6 +105977,7 @@ function getColormapNames() {
|
|
|
105864
105977
|
|
|
105865
105978
|
|
|
105866
105979
|
|
|
105980
|
+
|
|
105867
105981
|
|
|
105868
105982
|
|
|
105869
105983
|
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/VolumeViewport.js
|
|
@@ -109076,6 +109190,10 @@ class StackViewport extends RenderingEngine_Viewport {
|
|
|
109076
109190
|
}
|
|
109077
109191
|
return voiLUTFunction;
|
|
109078
109192
|
}
|
|
109193
|
+
getTargetId(specifier = {}) {
|
|
109194
|
+
const { sliceIndex: imageIdIndex = this.currentImageIdIndex } = specifier;
|
|
109195
|
+
return `imageId:${this.imageIds[imageIdIndex]}`;
|
|
109196
|
+
}
|
|
109079
109197
|
getCPUFallbackError(method) {
|
|
109080
109198
|
return new Error(`method ${method} cannot be used during CPU Fallback mode`);
|
|
109081
109199
|
}
|
|
@@ -109382,6 +109500,9 @@ class VideoViewport extends RenderingEngine_Viewport {
|
|
|
109382
109500
|
}
|
|
109383
109501
|
const rowCosineVec = esm/* vec3.fromValues */.R3.fromValues(rowCosines[0], rowCosines[1], rowCosines[2]);
|
|
109384
109502
|
const colCosineVec = esm/* vec3.fromValues */.R3.fromValues(columnCosines[0], columnCosines[1], columnCosines[2]);
|
|
109503
|
+
const { rows, columns } = imagePlaneModule;
|
|
109504
|
+
this.videoWidth = columns;
|
|
109505
|
+
this.videoHeight = rows;
|
|
109385
109506
|
const scanAxisNormal = esm/* vec3.create */.R3.create();
|
|
109386
109507
|
esm/* vec3.cross */.R3.cross(scanAxisNormal, rowCosineVec, colCosineVec);
|
|
109387
109508
|
let origin = imagePlaneModule.imagePositionPatient;
|
|
@@ -109424,10 +109545,11 @@ class VideoViewport extends RenderingEngine_Viewport {
|
|
|
109424
109545
|
this.fps = cineRate;
|
|
109425
109546
|
this.numberOfFrames = numberOfFrames;
|
|
109426
109547
|
this.setFrameRange([1, numberOfFrames]);
|
|
109427
|
-
|
|
109548
|
+
this.play();
|
|
109549
|
+
window.setTimeout(() => {
|
|
109428
109550
|
this.pause();
|
|
109429
|
-
this.setFrameNumber(frameNumber);
|
|
109430
|
-
}
|
|
109551
|
+
this.setFrameNumber(frameNumber || 1);
|
|
109552
|
+
}, 50);
|
|
109431
109553
|
});
|
|
109432
109554
|
}
|
|
109433
109555
|
async setVideoURL(videoURL) {
|
|
@@ -109454,16 +109576,24 @@ class VideoViewport extends RenderingEngine_Viewport {
|
|
|
109454
109576
|
return true;
|
|
109455
109577
|
}
|
|
109456
109578
|
}
|
|
109457
|
-
play() {
|
|
109458
|
-
|
|
109459
|
-
this.
|
|
109460
|
-
|
|
109461
|
-
|
|
109579
|
+
async play() {
|
|
109580
|
+
try {
|
|
109581
|
+
if (!this.isPlaying) {
|
|
109582
|
+
await this.videoElement.play();
|
|
109583
|
+
this.isPlaying = true;
|
|
109584
|
+
this.renderWhilstPlaying();
|
|
109585
|
+
}
|
|
109586
|
+
}
|
|
109587
|
+
catch (e) {
|
|
109462
109588
|
}
|
|
109463
109589
|
}
|
|
109464
109590
|
async pause() {
|
|
109465
|
-
|
|
109466
|
-
|
|
109591
|
+
try {
|
|
109592
|
+
await this.videoElement.pause();
|
|
109593
|
+
this.isPlaying = false;
|
|
109594
|
+
}
|
|
109595
|
+
catch (e) {
|
|
109596
|
+
}
|
|
109467
109597
|
}
|
|
109468
109598
|
async scroll(delta = 1) {
|
|
109469
109599
|
await this.pause();
|
|
@@ -109585,7 +109715,7 @@ class VideoViewport extends RenderingEngine_Viewport {
|
|
|
109585
109715
|
getImageData() {
|
|
109586
109716
|
const { metadata } = this;
|
|
109587
109717
|
const spacing = metadata.spacing;
|
|
109588
|
-
|
|
109718
|
+
const imageData = {
|
|
109589
109719
|
dimensions: metadata.dimensions,
|
|
109590
109720
|
spacing,
|
|
109591
109721
|
origin: metadata.origin,
|
|
@@ -109614,6 +109744,11 @@ class VideoViewport extends RenderingEngine_Viewport {
|
|
|
109614
109744
|
scaled: false,
|
|
109615
109745
|
},
|
|
109616
109746
|
};
|
|
109747
|
+
Object.defineProperty(imageData, 'scalarData', {
|
|
109748
|
+
get: () => this.getScalarData(),
|
|
109749
|
+
enumerable: true,
|
|
109750
|
+
});
|
|
109751
|
+
return imageData;
|
|
109617
109752
|
}
|
|
109618
109753
|
hasImageURI(imageURI) {
|
|
109619
109754
|
const framesMatch = imageURI.match(VideoViewport.frameRangeExtractor);
|
|
@@ -109690,12 +109825,23 @@ class VideoViewport extends RenderingEngine_Viewport {
|
|
|
109690
109825
|
}
|
|
109691
109826
|
getCurrentImageId() {
|
|
109692
109827
|
const current = this.imageId.replace('/frames/1', this.isPlaying
|
|
109693
|
-
? `/frames
|
|
109828
|
+
? `/frames/${this.frameRange[0]}-${this.frameRange[1]}`
|
|
109694
109829
|
: `/frames/${this.getFrameNumber()}`);
|
|
109695
109830
|
return current;
|
|
109696
109831
|
}
|
|
109832
|
+
getTargetId(specifier = {}) {
|
|
109833
|
+
const { sliceIndex } = specifier;
|
|
109834
|
+
if (sliceIndex === undefined) {
|
|
109835
|
+
return `videoId:${this.getCurrentImageId()}`;
|
|
109836
|
+
}
|
|
109837
|
+
const baseTarget = this.imageId.replace('/frames/1', `/frames/${1 + sliceIndex}`);
|
|
109838
|
+
return `videoId:${baseTarget}`;
|
|
109839
|
+
}
|
|
109697
109840
|
getFrameNumber() {
|
|
109698
|
-
return 1 +
|
|
109841
|
+
return 1 + this.getCurrentImageIdIndex();
|
|
109842
|
+
}
|
|
109843
|
+
getCurrentImageIdIndex() {
|
|
109844
|
+
return Math.round(this.videoElement.currentTime * this.fps);
|
|
109699
109845
|
}
|
|
109700
109846
|
getCamera() {
|
|
109701
109847
|
const { parallelScale } = this.videoCamera;
|
|
@@ -118482,7 +118628,7 @@ async function createAndCacheGeometry(geometryId, options) {
|
|
|
118482
118628
|
/***/ 61539:
|
|
118483
118629
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
118484
118630
|
|
|
118485
|
-
!function(e,t){ true?module.exports=t(__webpack_require__(56846),__webpack_require__(56660)):0}(this,((e,t)=>(()=>{"use strict";var r={578:(e,t,r)=>{const n=r(823),a=r(187),o=r(592),i=r(604),s=r(249),l=r(968),c=Object.prototype.toString,{Z_NO_FLUSH:u,Z_FINISH:d,Z_OK:f,Z_STREAM_END:m,Z_NEED_DICT:g,Z_STREAM_ERROR:h,Z_DATA_ERROR:p,Z_MEM_ERROR:b}=r(684);function x(e){this.options=a.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;let r=n.inflateInit2(this.strm,t.windowBits);if(r!==f)throw new Error(i[r]);if(this.header=new l,n.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=o.string2buf(t.dictionary):"[object ArrayBuffer]"===c.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=n.inflateSetDictionary(this.strm,t.dictionary),r!==f)))throw new Error(i[r])}function w(e,t){const r=new x(t);if(r.push(e),r.err)throw r.msg||i[r.err];return r.result}x.prototype.push=function(e,t){const r=this.strm,a=this.options.chunkSize,i=this.options.dictionary;let s,l,x;if(this.ended)return!1;for(l=t===~~t?t:!0===t?d:u,"[object ArrayBuffer]"===c.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(a),r.next_out=0,r.avail_out=a),s=n.inflate(r,l),s===g&&i&&(s=n.inflateSetDictionary(r,i),s===f?s=n.inflate(r,l):s===p&&(s=g));r.avail_in>0&&s===m&&r.state.wrap>0&&0!==e[r.next_in];)n.inflateReset(r),s=n.inflate(r,l);switch(s){case h:case p:case g:case b:return this.onEnd(s),this.ended=!0,!1}if(x=r.avail_out,r.next_out&&(0===r.avail_out||s===m))if("string"===this.options.to){let e=o.utf8border(r.output,r.next_out),t=r.next_out-e,n=o.buf2string(r.output,e);r.next_out=t,r.avail_out=a-t,t&&r.output.set(r.output.subarray(e,e+t),0),this.onData(n)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(s!==f||0!==x){if(s===m)return s=n.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},x.prototype.onData=function(e){this.chunks.push(e)},x.prototype.onEnd=function(e){e===f&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},e.exports.Hq=function(e,t){return(t=t||{}).raw=!0,w(e,t)},r(684)},187:e=>{const t=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);e.exports.assign=function(e){const r=Array.prototype.slice.call(arguments,1);for(;r.length;){const n=r.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const r in n)t(n,r)&&(e[r]=n[r])}}return e},e.exports.flattenChunks=e=>{let t=0;for(let r=0,n=e.length;r<n;r++)t+=e[r].length;const r=new Uint8Array(t);for(let t=0,n=0,a=e.length;t<a;t++){let a=e[t];r.set(a,n),n+=a.length}return r}},592:e=>{let t=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){t=!1}const r=new Uint8Array(256);for(let e=0;e<256;e++)r[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;r[254]=r[254]=1,e.exports.string2buf=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,r,n,a,o,i=e.length,s=0;for(a=0;a<i;a++)r=e.charCodeAt(a),55296==(64512&r)&&a+1<i&&(n=e.charCodeAt(a+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),a++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(s),o=0,a=0;o<s;a++)r=e.charCodeAt(a),55296==(64512&r)&&a+1<i&&(n=e.charCodeAt(a+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),a++)),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t};e.exports.buf2string=(e,n)=>{const a=n||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,n));let o,i;const s=new Array(2*a);for(i=0,o=0;o<a;){let t=e[o++];if(t<128){s[i++]=t;continue}let n=r[t];if(n>4)s[i++]=65533,o+=n-1;else{for(t&=2===n?31:3===n?15:7;n>1&&o<a;)t=t<<6|63&e[o++],n--;n>1?s[i++]=65533:t<65536?s[i++]=t:(t-=65536,s[i++]=55296|t>>10&1023,s[i++]=56320|1023&t)}}return((e,r)=>{if(r<65534&&e.subarray&&t)return String.fromCharCode.apply(null,e.length===r?e:e.subarray(0,r));let n="";for(let t=0;t<r;t++)n+=String.fromCharCode(e[t]);return n})(s,i)},e.exports.utf8border=(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let n=t-1;for(;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+r[e[n]]>t?n:t}},693:e=>{e.exports=(e,t,r,n)=>{let a=65535&e|0,o=e>>>16&65535|0,i=0;for(;0!==r;){i=r>2e3?2e3:r,r-=i;do{a=a+t[n++]|0,o=o+a|0}while(--i);a%=65521,o%=65521}return a|o<<16|0}},684:e=>{e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},863:e=>{const t=new Uint32Array((()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t})());e.exports=(e,r,n,a)=>{const o=t,i=a+n;e^=-1;for(let t=a;t<i;t++)e=e>>>8^o[255&(e^r[t])];return-1^e}},968:e=>{e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},365:e=>{const t=16209;e.exports=function(e,r){let n,a,o,i,s,l,c,u,d,f,m,g,h,p,b,x,w,y,k,S,D,v,T,P;const I=e.state;n=e.next_in,T=e.input,a=n+(e.avail_in-5),o=e.next_out,P=e.output,i=o-(r-e.avail_out),s=o+(e.avail_out-257),l=I.dmax,c=I.wsize,u=I.whave,d=I.wnext,f=I.window,m=I.hold,g=I.bits,h=I.lencode,p=I.distcode,b=(1<<I.lenbits)-1,x=(1<<I.distbits)-1;e:do{g<15&&(m+=T[n++]<<g,g+=8,m+=T[n++]<<g,g+=8),w=h[m&b];t:for(;;){if(y=w>>>24,m>>>=y,g-=y,y=w>>>16&255,0===y)P[o++]=65535&w;else{if(!(16&y)){if(0==(64&y)){w=h[(65535&w)+(m&(1<<y)-1)];continue t}if(32&y){I.mode=16191;break e}e.msg="invalid literal/length code",I.mode=t;break e}k=65535&w,y&=15,y&&(g<y&&(m+=T[n++]<<g,g+=8),k+=m&(1<<y)-1,m>>>=y,g-=y),g<15&&(m+=T[n++]<<g,g+=8,m+=T[n++]<<g,g+=8),w=p[m&x];r:for(;;){if(y=w>>>24,m>>>=y,g-=y,y=w>>>16&255,!(16&y)){if(0==(64&y)){w=p[(65535&w)+(m&(1<<y)-1)];continue r}e.msg="invalid distance code",I.mode=t;break e}if(S=65535&w,y&=15,g<y&&(m+=T[n++]<<g,g+=8,g<y&&(m+=T[n++]<<g,g+=8)),S+=m&(1<<y)-1,S>l){e.msg="invalid distance too far back",I.mode=t;break e}if(m>>>=y,g-=y,y=o-i,S>y){if(y=S-y,y>u&&I.sane){e.msg="invalid distance too far back",I.mode=t;break e}if(D=0,v=f,0===d){if(D+=c-y,y<k){k-=y;do{P[o++]=f[D++]}while(--y);D=o-S,v=P}}else if(d<y){if(D+=c+d-y,y-=d,y<k){k-=y;do{P[o++]=f[D++]}while(--y);if(D=0,d<k){y=d,k-=y;do{P[o++]=f[D++]}while(--y);D=o-S,v=P}}}else if(D+=d-y,y<k){k-=y;do{P[o++]=f[D++]}while(--y);D=o-S,v=P}for(;k>2;)P[o++]=v[D++],P[o++]=v[D++],P[o++]=v[D++],k-=3;k&&(P[o++]=v[D++],k>1&&(P[o++]=v[D++]))}else{D=o-S;do{P[o++]=P[D++],P[o++]=P[D++],P[o++]=P[D++],k-=3}while(k>2);k&&(P[o++]=P[D++],k>1&&(P[o++]=P[D++]))}break}}break}}while(n<a&&o<s);k=g>>3,n-=k,g-=k<<3,m&=(1<<g)-1,e.next_in=n,e.next_out=o,e.avail_in=n<a?a-n+5:5-(n-a),e.avail_out=o<s?s-o+257:257-(o-s),I.hold=m,I.bits=g}},823:(e,t,r)=>{const n=r(693),a=r(863),o=r(365),i=r(446),{Z_FINISH:s,Z_BLOCK:l,Z_TREES:c,Z_OK:u,Z_STREAM_END:d,Z_NEED_DICT:f,Z_STREAM_ERROR:m,Z_DATA_ERROR:g,Z_MEM_ERROR:h,Z_BUF_ERROR:p,Z_DEFLATED:b}=r(684),x=16180,w=16190,y=16191,k=16192,S=16194,D=16199,v=16200,T=16206,P=16209,I=16210,C=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function L(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const _=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<x||t.mode>16211?1:0},A=e=>{if(_(e))return m;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=x,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,u},E=e=>{if(_(e))return m;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,A(e)},M=(e,t)=>{let r;if(_(e))return m;const n=e.state;return t<0?(r=0,t=-t):(r=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?m:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,E(e))},O=(e,t)=>{if(!e)return m;const r=new L;e.state=r,r.strm=e,r.window=null,r.mode=x;const n=M(e,t);return n!==u&&(e.state=null),n};let R,F,B=!0;const U=e=>{if(B){R=new Int32Array(512),F=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(i(1,e.lens,0,288,R,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;i(2,e.lens,0,32,F,0,e.work,{bits:5}),B=!1}e.lencode=R,e.lenbits=9,e.distcode=F,e.distbits=5},N=(e,t,r,n)=>{let a;const o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),n>=o.wsize?(o.window.set(t.subarray(r-o.wsize,r),0),o.wnext=0,o.whave=o.wsize):(a=o.wsize-o.wnext,a>n&&(a=n),o.window.set(t.subarray(r-n,r-n+a),o.wnext),(n-=a)?(o.window.set(t.subarray(r-n,r),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=a))),0};e.exports.inflateReset=E,e.exports.inflateReset2=M,e.exports.inflateResetKeep=A,e.exports.inflateInit=e=>O(e,15),e.exports.inflateInit2=O,e.exports.inflate=(e,t)=>{let r,L,A,E,M,O,R,F,B,j,$,V,W,q,G,Z,z,Y,H,Q,X,K,J=0;const ee=new Uint8Array(4);let te,re;const ne=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(_(e)||!e.output||!e.input&&0!==e.avail_in)return m;r=e.state,r.mode===y&&(r.mode=k),M=e.next_out,A=e.output,R=e.avail_out,E=e.next_in,L=e.input,O=e.avail_in,F=r.hold,B=r.bits,j=O,$=R,K=u;e:for(;;)switch(r.mode){case x:if(0===r.wrap){r.mode=k;break}for(;B<16;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}if(2&r.wrap&&35615===F){0===r.wbits&&(r.wbits=15),r.check=0,ee[0]=255&F,ee[1]=F>>>8&255,r.check=a(r.check,ee,2,0),F=0,B=0,r.mode=16181;break}if(r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&F)<<8)+(F>>8))%31){e.msg="incorrect header check",r.mode=P;break}if((15&F)!==b){e.msg="unknown compression method",r.mode=P;break}if(F>>>=4,B-=4,X=8+(15&F),0===r.wbits&&(r.wbits=X),X>15||X>r.wbits){e.msg="invalid window size",r.mode=P;break}r.dmax=1<<r.wbits,r.flags=0,e.adler=r.check=1,r.mode=512&F?16189:y,F=0,B=0;break;case 16181:for(;B<16;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}if(r.flags=F,(255&r.flags)!==b){e.msg="unknown compression method",r.mode=P;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=P;break}r.head&&(r.head.text=F>>8&1),512&r.flags&&4&r.wrap&&(ee[0]=255&F,ee[1]=F>>>8&255,r.check=a(r.check,ee,2,0)),F=0,B=0,r.mode=16182;case 16182:for(;B<32;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}r.head&&(r.head.time=F),512&r.flags&&4&r.wrap&&(ee[0]=255&F,ee[1]=F>>>8&255,ee[2]=F>>>16&255,ee[3]=F>>>24&255,r.check=a(r.check,ee,4,0)),F=0,B=0,r.mode=16183;case 16183:for(;B<16;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}r.head&&(r.head.xflags=255&F,r.head.os=F>>8),512&r.flags&&4&r.wrap&&(ee[0]=255&F,ee[1]=F>>>8&255,r.check=a(r.check,ee,2,0)),F=0,B=0,r.mode=16184;case 16184:if(1024&r.flags){for(;B<16;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}r.length=F,r.head&&(r.head.extra_len=F),512&r.flags&&4&r.wrap&&(ee[0]=255&F,ee[1]=F>>>8&255,r.check=a(r.check,ee,2,0)),F=0,B=0}else r.head&&(r.head.extra=null);r.mode=16185;case 16185:if(1024&r.flags&&(V=r.length,V>O&&(V=O),V&&(r.head&&(X=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(L.subarray(E,E+V),X)),512&r.flags&&4&r.wrap&&(r.check=a(r.check,L,V,E)),O-=V,E+=V,r.length-=V),r.length))break e;r.length=0,r.mode=16186;case 16186:if(2048&r.flags){if(0===O)break e;V=0;do{X=L[E+V++],r.head&&X&&r.length<65536&&(r.head.name+=String.fromCharCode(X))}while(X&&V<O);if(512&r.flags&&4&r.wrap&&(r.check=a(r.check,L,V,E)),O-=V,E+=V,X)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=16187;case 16187:if(4096&r.flags){if(0===O)break e;V=0;do{X=L[E+V++],r.head&&X&&r.length<65536&&(r.head.comment+=String.fromCharCode(X))}while(X&&V<O);if(512&r.flags&&4&r.wrap&&(r.check=a(r.check,L,V,E)),O-=V,E+=V,X)break e}else r.head&&(r.head.comment=null);r.mode=16188;case 16188:if(512&r.flags){for(;B<16;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}if(4&r.wrap&&F!==(65535&r.check)){e.msg="header crc mismatch",r.mode=P;break}F=0,B=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=y;break;case 16189:for(;B<32;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}e.adler=r.check=C(F),F=0,B=0,r.mode=w;case w:if(0===r.havedict)return e.next_out=M,e.avail_out=R,e.next_in=E,e.avail_in=O,r.hold=F,r.bits=B,f;e.adler=r.check=1,r.mode=y;case y:if(t===l||t===c)break e;case k:if(r.last){F>>>=7&B,B-=7&B,r.mode=T;break}for(;B<3;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}switch(r.last=1&F,F>>>=1,B-=1,3&F){case 0:r.mode=16193;break;case 1:if(U(r),r.mode=D,t===c){F>>>=2,B-=2;break e}break;case 2:r.mode=16196;break;case 3:e.msg="invalid block type",r.mode=P}F>>>=2,B-=2;break;case 16193:for(F>>>=7&B,B-=7&B;B<32;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}if((65535&F)!=(F>>>16^65535)){e.msg="invalid stored block lengths",r.mode=P;break}if(r.length=65535&F,F=0,B=0,r.mode=S,t===c)break e;case S:r.mode=16195;case 16195:if(V=r.length,V){if(V>O&&(V=O),V>R&&(V=R),0===V)break e;A.set(L.subarray(E,E+V),M),O-=V,E+=V,R-=V,M+=V,r.length-=V;break}r.mode=y;break;case 16196:for(;B<14;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}if(r.nlen=257+(31&F),F>>>=5,B-=5,r.ndist=1+(31&F),F>>>=5,B-=5,r.ncode=4+(15&F),F>>>=4,B-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=P;break}r.have=0,r.mode=16197;case 16197:for(;r.have<r.ncode;){for(;B<3;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}r.lens[ne[r.have++]]=7&F,F>>>=3,B-=3}for(;r.have<19;)r.lens[ne[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,te={bits:r.lenbits},K=i(0,r.lens,0,19,r.lencode,0,r.work,te),r.lenbits=te.bits,K){e.msg="invalid code lengths set",r.mode=P;break}r.have=0,r.mode=16198;case 16198:for(;r.have<r.nlen+r.ndist;){for(;J=r.lencode[F&(1<<r.lenbits)-1],G=J>>>24,Z=J>>>16&255,z=65535&J,!(G<=B);){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}if(z<16)F>>>=G,B-=G,r.lens[r.have++]=z;else{if(16===z){for(re=G+2;B<re;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}if(F>>>=G,B-=G,0===r.have){e.msg="invalid bit length repeat",r.mode=P;break}X=r.lens[r.have-1],V=3+(3&F),F>>>=2,B-=2}else if(17===z){for(re=G+3;B<re;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}F>>>=G,B-=G,X=0,V=3+(7&F),F>>>=3,B-=3}else{for(re=G+7;B<re;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}F>>>=G,B-=G,X=0,V=11+(127&F),F>>>=7,B-=7}if(r.have+V>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=P;break}for(;V--;)r.lens[r.have++]=X}}if(r.mode===P)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=P;break}if(r.lenbits=9,te={bits:r.lenbits},K=i(1,r.lens,0,r.nlen,r.lencode,0,r.work,te),r.lenbits=te.bits,K){e.msg="invalid literal/lengths set",r.mode=P;break}if(r.distbits=6,r.distcode=r.distdyn,te={bits:r.distbits},K=i(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,te),r.distbits=te.bits,K){e.msg="invalid distances set",r.mode=P;break}if(r.mode=D,t===c)break e;case D:r.mode=v;case v:if(O>=6&&R>=258){e.next_out=M,e.avail_out=R,e.next_in=E,e.avail_in=O,r.hold=F,r.bits=B,o(e,$),M=e.next_out,A=e.output,R=e.avail_out,E=e.next_in,L=e.input,O=e.avail_in,F=r.hold,B=r.bits,r.mode===y&&(r.back=-1);break}for(r.back=0;J=r.lencode[F&(1<<r.lenbits)-1],G=J>>>24,Z=J>>>16&255,z=65535&J,!(G<=B);){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}if(Z&&0==(240&Z)){for(Y=G,H=Z,Q=z;J=r.lencode[Q+((F&(1<<Y+H)-1)>>Y)],G=J>>>24,Z=J>>>16&255,z=65535&J,!(Y+G<=B);){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}F>>>=Y,B-=Y,r.back+=Y}if(F>>>=G,B-=G,r.back+=G,r.length=z,0===Z){r.mode=16205;break}if(32&Z){r.back=-1,r.mode=y;break}if(64&Z){e.msg="invalid literal/length code",r.mode=P;break}r.extra=15&Z,r.mode=16201;case 16201:if(r.extra){for(re=r.extra;B<re;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}r.length+=F&(1<<r.extra)-1,F>>>=r.extra,B-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=16202;case 16202:for(;J=r.distcode[F&(1<<r.distbits)-1],G=J>>>24,Z=J>>>16&255,z=65535&J,!(G<=B);){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}if(0==(240&Z)){for(Y=G,H=Z,Q=z;J=r.distcode[Q+((F&(1<<Y+H)-1)>>Y)],G=J>>>24,Z=J>>>16&255,z=65535&J,!(Y+G<=B);){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}F>>>=Y,B-=Y,r.back+=Y}if(F>>>=G,B-=G,r.back+=G,64&Z){e.msg="invalid distance code",r.mode=P;break}r.offset=z,r.extra=15&Z,r.mode=16203;case 16203:if(r.extra){for(re=r.extra;B<re;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}r.offset+=F&(1<<r.extra)-1,F>>>=r.extra,B-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=P;break}r.mode=16204;case 16204:if(0===R)break e;if(V=$-R,r.offset>V){if(V=r.offset-V,V>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=P;break}V>r.wnext?(V-=r.wnext,W=r.wsize-V):W=r.wnext-V,V>r.length&&(V=r.length),q=r.window}else q=A,W=M-r.offset,V=r.length;V>R&&(V=R),R-=V,r.length-=V;do{A[M++]=q[W++]}while(--V);0===r.length&&(r.mode=v);break;case 16205:if(0===R)break e;A[M++]=r.length,R--,r.mode=v;break;case T:if(r.wrap){for(;B<32;){if(0===O)break e;O--,F|=L[E++]<<B,B+=8}if($-=R,e.total_out+=$,r.total+=$,4&r.wrap&&$&&(e.adler=r.check=r.flags?a(r.check,A,$,M-$):n(r.check,A,$,M-$)),$=R,4&r.wrap&&(r.flags?F:C(F))!==r.check){e.msg="incorrect data check",r.mode=P;break}F=0,B=0}r.mode=16207;case 16207:if(r.wrap&&r.flags){for(;B<32;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}if(4&r.wrap&&F!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=P;break}F=0,B=0}r.mode=16208;case 16208:K=d;break e;case P:K=g;break e;case I:return h;default:return m}return e.next_out=M,e.avail_out=R,e.next_in=E,e.avail_in=O,r.hold=F,r.bits=B,(r.wsize||$!==e.avail_out&&r.mode<P&&(r.mode<T||t!==s))&&N(e,e.output,e.next_out,$-e.avail_out)?(r.mode=I,h):(j-=e.avail_in,$-=e.avail_out,e.total_in+=j,e.total_out+=$,r.total+=$,4&r.wrap&&$&&(e.adler=r.check=r.flags?a(r.check,A,$,e.next_out-$):n(r.check,A,$,e.next_out-$)),e.data_type=r.bits+(r.last?64:0)+(r.mode===y?128:0)+(r.mode===D||r.mode===S?256:0),(0===j&&0===$||t===s)&&K===u&&(K=p),K)},e.exports.inflateEnd=e=>{if(_(e))return m;let t=e.state;return t.window&&(t.window=null),e.state=null,u},e.exports.inflateGetHeader=(e,t)=>{if(_(e))return m;const r=e.state;return 0==(2&r.wrap)?m:(r.head=t,t.done=!1,u)},e.exports.inflateSetDictionary=(e,t)=>{const r=t.length;let a,o,i;return _(e)?m:(a=e.state,0!==a.wrap&&a.mode!==w?m:a.mode===w&&(o=1,o=n(o,t,r,0),o!==a.check)?g:(i=N(e,t,r,r),i?(a.mode=I,h):(a.havedict=1,u)))},e.exports.inflateInfo="pako inflate (from Nodeca project)"},446:e=>{const t=15,r=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),n=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),a=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),o=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);e.exports=(e,i,s,l,c,u,d,f)=>{const m=f.bits;let g,h,p,b,x,w,y=0,k=0,S=0,D=0,v=0,T=0,P=0,I=0,C=0,L=0,_=null;const A=new Uint16Array(16),E=new Uint16Array(16);let M,O,R,F=null;for(y=0;y<=t;y++)A[y]=0;for(k=0;k<l;k++)A[i[s+k]]++;for(v=m,D=t;D>=1&&0===A[D];D--);if(v>D&&(v=D),0===D)return c[u++]=20971520,c[u++]=20971520,f.bits=1,0;for(S=1;S<D&&0===A[S];S++);for(v<S&&(v=S),I=1,y=1;y<=t;y++)if(I<<=1,I-=A[y],I<0)return-1;if(I>0&&(0===e||1!==D))return-1;for(E[1]=0,y=1;y<t;y++)E[y+1]=E[y]+A[y];for(k=0;k<l;k++)0!==i[s+k]&&(d[E[i[s+k]]++]=k);if(0===e?(_=F=d,w=20):1===e?(_=r,F=n,w=257):(_=a,F=o,w=0),L=0,k=0,y=S,x=u,T=v,P=0,p=-1,C=1<<v,b=C-1,1===e&&C>852||2===e&&C>592)return 1;for(;;){M=y-P,d[k]+1<w?(O=0,R=d[k]):d[k]>=w?(O=F[d[k]-w],R=_[d[k]-w]):(O=96,R=0),g=1<<y-P,h=1<<T,S=h;do{h-=g,c[x+(L>>P)+h]=M<<24|O<<16|R|0}while(0!==h);for(g=1<<y-1;L&g;)g>>=1;if(0!==g?(L&=g-1,L+=g):L=0,k++,0==--A[y]){if(y===D)break;y=i[s+d[k]]}if(y>v&&(L&b)!==p){for(0===P&&(P=v),x+=S,T=y-P,I=1<<T;T+P<D&&(I-=A[T+P],!(I<=0));)T++,I<<=1;if(C+=1<<T,1===e&&C>852||2===e&&C>592)return 1;p=L&b,c[p]=v<<24|T<<16|x-u|0}}return 0!==L&&(c[x+L]=y-P<<24|64<<16|0),f.bits=v,0}},604:e=>{e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},249:e=>{e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},464:t=>{t.exports=e},713:e=>{e.exports=t}},n={};function a(e){var t=n[e];if(void 0!==t)return t.exports;var o=n[e]={exports:{}};return r[e](o,o.exports,a),o.exports}a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&!e;)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})();var o={};return(()=>{function e(e,t,r){if(void 0===e)throw new Error("decodeRGB: rgbBuffer must not be undefined");if(e.length%3!=0)throw new Error("decodeRGB: rgbBuffer length must be divisible by 3");const n=e.length/3;let a=0,o=0;if(r)for(let r=0;r<n;r++)t[o++]=e[a++],t[o++]=e[a++],t[o++]=e[a++],t[o++]=255;else t.set(e)}function t(e,t,r){if(void 0===e)throw new Error("decodeRGB: rgbBuffer must not be undefined");if(e.length%3!=0)throw new Error("decodeRGB: rgbBuffer length must be divisible by 3");const n=e.length/3;let a=0,o=0,i=n,s=2*n;if(r)for(let r=0;r<n;r++)t[a++]=e[o++],t[a++]=e[i++],t[a++]=e[s++],t[a++]=255;else for(let r=0;r<n;r++)t[a++]=e[o++],t[a++]=e[i++],t[a++]=e[s++]}function r(e,t,r){if(void 0===e)throw new Error("decodeRGB: ybrBuffer must not be undefined");if(e.length%3!=0)throw new Error("decodeRGB: ybrBuffer length must be divisble by 3");const n=e.length/3;let a=0,o=0;if(r)for(let r=0;r<n;r++){const r=e[a++],n=e[a++],i=e[a++];t[o++]=r+1.402*(i-128),t[o++]=r-.34414*(n-128)-.71414*(i-128),t[o++]=r+1.772*(n-128),t[o++]=255}else for(let r=0;r<n;r++){const r=e[a++],n=e[a++],i=e[a++];t[o++]=r+1.402*(i-128),t[o++]=r-.34414*(n-128)-.71414*(i-128),t[o++]=r+1.772*(n-128)}}function n(e,t,r){if(void 0===e)throw new Error("decodeRGB: ybrBuffer must not be undefined");if(e.length%3!=0)throw new Error("decodeRGB: ybrBuffer length must be divisble by 3");const n=e.length/3;let a=0,o=0,i=n,s=2*n;if(r)for(let r=0;r<n;r++){const r=e[o++],n=e[i++],l=e[s++];t[a++]=r+1.402*(l-128),t[a++]=r-.34414*(n-128)-.71414*(l-128),t[a++]=r+1.772*(n-128),t[a++]=255}else for(let r=0;r<n;r++){const r=e[o++],n=e[i++],l=e[s++];t[a++]=r+1.402*(l-128),t[a++]=r-.34414*(n-128)-.71414*(l-128),t[a++]=r+1.772*(n-128)}}a.r(o),a.d(o,{configure:()=>kt,convertColorSpace:()=>X,convertPALETTECOLOR:()=>yt,convertRGBColorByPixel:()=>e,convertRGBColorByPlane:()=>t,convertYBRFullByPixel:()=>r,convertYBRFullByPlane:()=>n,createImage:()=>ke,decodeImageFrame:()=>he,decodeJPEGBaseline8BitColor:()=>J,default:()=>Dt,external:()=>xt,getImageFrame:()=>pe,getMinMax:()=>H,getPixelData:()=>Y,internal:()=>U,isColorImage:()=>be,isJPEGBaseline8BitColor:()=>St,wadors:()=>Ce,wadouri:()=>mt,webWorkerManager:()=>fe});const i=function(e,t,r){return t=t||0,e&&e.Value?e.Value.length<=t?r:e.Value[t]:r};const s=function(e,t,r){const n=i(e,t,r);if(void 0!==n)return parseFloat(n)};const l=function(e,t){const r=i(e,t);if(void 0!==r)return parseFloat(r)};const c=function(e,t){if(!e)return;if(!e.Value)return;if(!Array.isArray(e.Value))return;if(t&&e.Value.length<t)return;const r=[];for(let t=0;t<e.Value.length;t++)r.push(parseFloat(e.Value[t]));return r};function u(e){const t=e.indexOf(":");return e.substring(t+1)}function d(e,t=!0){return e&&e.Value?e.Value[0]&&t?e.Value[0]:e.Value:e}function f(e,t,r){return{shared:(t?Object.values(t[0]):[]).map((e=>e[0])).filter((e=>void 0!==e&&"object"==typeof e)),perFrame:(e?Object.values(e[r-1]):[]).map((e=>e.Value[0])).filter((e=>void 0!==e&&"object"==typeof e))}}function m(e){let{52009230:t,52009229:r,"00280008":n,...a}=e;return t=d(t,!1),r=d(r,!1),n=d(n),{PerFrameFunctionalGroupsSequence:t,SharedFunctionalGroupsSequence:r,NumberOfFrames:n,rest:a}}function g(e){const t=e.indexOf("/frames/")+8,r=e.slice(0,t),n=parseInt(e.slice(t),10);return{metadata:p[`${r}1`],frame:n}}const h={_retrieveMultiframeMetadata:g,retrieveMultiframeMetadata:function(e){return g(u(e))},isMultiframe:function(e){const t=i(e["00280008"]);return t&&t>1}};let p=[],b={};const x={add:function(e,t){const r=u(e);t.isMultiframe=h.isMultiframe(t),p[r]=t},get:function(e){const t=u(e),r=p[t];if(r&&!r?.isMultiframe)return r;const n=b[t];if(n)return n;const a=h._retrieveMultiframeMetadata(t);if(!a||!a.metadata)return;const{metadata:o,frame:i}=a;if(o){const e=function(e,t){const{PerFrameFunctionalGroupsSequence:r,SharedFunctionalGroupsSequence:n,NumberOfFrames:a,rest:o}=m(t);if(r||a>1){const{shared:i,perFrame:s}=f(r,n,e),l=Object.assign(t,{frameNumber:e});return[...i,...s].forEach((e=>{Object.entries(e).forEach((([e,t])=>{l[e]=t}))})),Object.assign(o,{"00280008":a},l)}return t}(i,o);return b[t]=e,e}},remove:function(e){const t=u(e);p[t]=void 0,b[t]=void 0},purge:function(){p=[],b={}}};function w(e){return"RECON TOMO"===e||"RECON GATED TOMO"===e}function y(e){return i(e["00080060"]).includes("NM")}function k(e,t){const r=d(e["00080008"],!1);if(r)return r[t]}function S(e){let t=c(e["00200037"],6);return!t&&y(e)&&(t=function(e){let t;const r=k(e,2);if(r&&w(r)){const r=d(e["00540022"]);r&&(t=c(r["00200037"],6))}return t}(e)),t}function D(e){let t=c(e["00200032"],3);return!t&&y(e)&&(t=function(e){let t;const r=k(e,2);if(r&&w(r)){const r=d(e["00540022"]);r&&(t=c(r["00200032"],3))}return t}(e)),t}function v(e,t,r){const n={};for(const a of r)try{const r=t(a,e);if(r){const e={};for(const t in r)if(t in r){e[T(t)]=r[t]}Object.assign(n,e)}}catch(e){console.error(`Error retrieving ${a} data:`,e)}return n}const T=e=>e.charAt(0).toUpperCase()+e.slice(1),P=["multiframeModule","generalSeriesModule","patientStudyModule","imagePlaneModule","nmMultiframeGeometryModule","imagePixelModule","modalityLutModule","voiLutModule","sopCommonModule","petIsotopeModule","overlayPlaneModule","transferSyntax","petSeriesModule","petImageModule"];function I(e,t){const r=c(e[t]);return r?r[0]:null}const C=function(e){return e?.Value?.length?Array.isArray(e.Value)?e.Value:"object"==typeof e.Value?(console.warn("Warning: Value should be an array, but an object was found. Encapsulating the object in an array."),[e.Value]):[]:[]};function L(e){const t=C(e["00186011"]);if(!t||!t.length)return null;return t.map((e=>{const t=I(e,"0018602C"),r=I(e,"0018602E"),n=I(e,"00186024"),a=I(e,"00186026");return{regionLocationMinY0:I(e,"0018601A"),regionLocationMaxY1:I(e,"0018601E"),regionLocationMinX0:I(e,"00186018"),regionLocationMaxX1:I(e,"0018601C"),referencePixelX0:I(e,"00186020"),referencePixelY0:I(e,"00186022"),physicalDeltaX:t,physicalDeltaY:r,physicalUnitXDirection:n,physicalUnitYDirection:a,referencePhysicalPixelValueY:I(e,"0018602A"),referencePhysicalPixelValueX:I(e,"00186028"),regionSpatialFormat:I(e,"00186012"),regionDataType:I(e,"00186014"),regionFlags:I(e,"00186016"),transducerFrequency:I(e,"00186030")}}))}function _(e,t){return{transferSyntaxUID:i(t["00020010"])||i(t["00083002"])}}const A=function e(t,r){const{MetadataModules:n}=xt.cornerstone.Enums;if(t===n.MULTIFRAME){const{metadata:e,frame:t}=h.retrieveMultiframeMetadata(r);if(!e)return;const{PerFrameFunctionalGroupsSequence:n,SharedFunctionalGroupsSequence:a,NumberOfFrames:o}=m(e);if(n||o>1){const{shared:e,perFrame:r}=f(n,a,t);return{NumberOfFrames:o,PerFrameFunctionalInformation:r,SharedFunctionalInformation:e}}return{NumberOfFrames:o}}const{dicomParser:a}=xt,o=x.get(r);if(o){if(t===n.GENERAL_SERIES)return{modality:i(o["00080060"]),seriesInstanceUID:i(o["0020000E"]),seriesNumber:l(o["00200011"]),studyInstanceUID:i(o["0020000D"]),seriesDate:a.parseDA(i(o["00080021"])),seriesTime:a.parseTM(i(o["00080031"],0,"")),acquisitionDate:a.parseDA(i(o["00080022"]),""),acquisitionTime:a.parseTM(i(o["00080032"],0,""))};if(t===n.PATIENT_STUDY)return{patientAge:l(o["00101010"]),patientSize:l(o["00101020"]),patientSex:i(o["00100040"]),patientWeight:l(o["00101030"])};if(t===n.NM_MULTIFRAME_GEOMETRY){const e=i(o["00080060"]),t=k(o,2);return{modality:e,imageType:i(o["00080008"]),imageSubType:t,imageOrientationPatient:S(o),imagePositionPatient:D(o),sliceThickness:l(o["00180050"]),pixelSpacing:c(o["00280030"],2),numberOfFrames:l(o["00280008"]),isNMReconstructable:w(t)&&e.includes("NM")}}if(t===n.IMAGE_PLANE){const e=S(o),t=D(o),r=c(o["00280030"],2);let n=null,a=null;r&&(a=r[0],n=r[1]);let s=null,u=null;return e&&(s=[parseFloat(e[0]),parseFloat(e[1]),parseFloat(e[2])],u=[parseFloat(e[3]),parseFloat(e[4]),parseFloat(e[5])]),{frameOfReferenceUID:i(o["00200052"]),rows:l(o["00280010"]),columns:l(o["00280011"]),imageOrientationPatient:e,rowCosines:s,columnCosines:u,imagePositionPatient:t,sliceThickness:l(o["00180050"]),sliceLocation:l(o["00201041"]),pixelSpacing:r,rowPixelSpacing:a,columnPixelSpacing:n}}if(t===n.ULTRASOUND_ENHANCED_REGION)return L(o);if(t===n.CALIBRATION){if("US"===i(o["00080060"])){return{sequenceOfUltrasoundRegions:L(o)}}}if(t===n.IMAGE_URL)return function(e,t){const{transferSyntaxUID:r}=_(e,t),n=xt.cornerstone.utilities.isVideoTransferSyntax(r),a=e.substring(7),o=a.replace("/frames/","/thumbnail/");let i=a.replace("/frames/","/rendered/");n&&(i=i.replace("/rendered/1","/rendered"));return{isVideo:n,rendered:i,thumbnail:o}}(r,o);if(t===n.CINE)return function(e,t){const r=i(t["00180040"]);return{cineRate:r,numberOfFrames:l(t["00280008"])}}(0,o);if("imagePixelModule"===t)return{samplesPerPixel:l(o["00280002"]),photometricInterpretation:i(o["00280004"]),rows:l(o["00280010"]),columns:l(o["00280011"]),bitsAllocated:l(o["00280100"]),bitsStored:l(o["00280101"]),highBit:i(o["00280102"]),pixelRepresentation:l(o["00280103"]),planarConfiguration:l(o["00280006"]),pixelAspectRatio:i(o["00280034"]),smallestPixelValue:l(o["00280106"]),largestPixelValue:l(o["00280107"]),redPaletteColorLookupTableDescriptor:c(o["00281101"]),greenPaletteColorLookupTableDescriptor:c(o["00281102"]),bluePaletteColorLookupTableDescriptor:c(o["00281103"]),redPaletteColorLookupTableData:c(o["00281201"]),greenPaletteColorLookupTableData:c(o["00281202"]),bluePaletteColorLookupTableData:c(o["00281203"])};if("voiLutModule"===t)return{windowCenter:c(o["00281050"],1),windowWidth:c(o["00281051"],1)};if("modalityLutModule"===t)return{rescaleIntercept:l(o["00281052"]),rescaleSlope:l(o["00281053"]),rescaleType:i(o["00281054"])};if("sopCommonModule"===t)return{sopClassUID:i(o["00080016"]),sopInstanceUID:i(o["00080018"])};if("petIsotopeModule"===t){const e=i(o["00540016"]);if(void 0===e)return;return{radiopharmaceuticalInfo:{radiopharmaceuticalStartTime:a.parseTM(i(e["00181072"],0,"")),radiopharmaceuticalStartDateTime:i(e["00181078"],0,""),radionuclideTotalDose:l(e["00181074"]),radionuclideHalfLife:l(e["00181075"])}}}return"overlayPlaneModule"===t?function(e){const t=[];for(let r=0;r<=30;r+=2){let n=`x60${r.toString(16)}`;4===n.length&&(n=`x600${r.toString(16)}`);const a=i(e[`${n}3000`]);if(!a)continue;const o=[];for(let t=0;t<a.length;t++)for(let r=0;r<8;r++){const n=e.Value[a.dataOffset+t];o[8*t+r]=n>>r&1}t.push({rows:l(e[`${n}0010`]),columns:l(e[`${n}0011`]),type:i(e[`${n}0040`]),x:l(e[`${n}0050`],1)-1,y:l(e[`${n}0050`],0)-1,pixelData:o,description:i(e[`${n}0022`]),label:i(e[`${n}1500`]),roiArea:i(e[`${n}1301`]),roiMean:i(e[`${n}1302`]),roiStandardDeviation:i(e[`${n}1303`])})}return{overlays:t}}(o):"transferSyntax"===t?_(r,o):"petSeriesModule"===t?{correctedImage:i(o["00280051"]),units:i(o["00541001"]),decayCorrection:i(o["00541102"])}:"petImageModule"===t?{frameReferenceTime:l(o["00541300"]),actualFrameDuration:l(o["00181242"])}:"instance"===t?v(r,e,P):void 0}};function E(e,t,r){if(r+e.length>t.length)return!1;let n=r;for(let r=0;r<e.length;r++)if(e[r]!==t[n++])return!1;return!0}const M=function(e,t,r){r=r||0;const n=function(e){const t=new Uint8Array(e.length);for(let r=0,n=e.length;r<n;r++)t[r]=e.charCodeAt(r);return t}(t);for(let t=r;t<e.length;t++)if(n[0]===e[t]&&E(n,e,t))return t;return-1};let O={open(e,t){e.open("get",t,!0)},beforeSend(){},beforeProcessing:e=>Promise.resolve(e.response),imageCreated(){},strict:!1,decodeConfig:{convertFloatPixelDataToInt:!0,use16BitDataType:!1}};function R(e){O=Object.assign(O,e)}function F(){return O}const B=function(e,t,r={},n={}){const{cornerstone:a}=xt,o=F(),i=e=>{if("function"==typeof o.errorInterceptor){const t=new Error("request failed");t.request=e,t.response=e.response,t.status=e.status,o.errorInterceptor(t)}},s=new XMLHttpRequest,l=new Promise(((l,c)=>{o.open(s,e,r,n);const u=o.beforeSend(s,t,r,n);s.responseType="arraybuffer";const d=Object.assign({},r,u);Object.keys(d).forEach((function(t){null!==d[t]&&("Accept"===t&&-1!==e.indexOf("accept=")||s.setRequestHeader(t,d[t]))})),n.deferred={resolve:l,reject:c},n.url=e,n.imageId=t,s.onloadstart=function(r){o.onloadstart&&o.onloadstart(r,n);const i={url:e,imageId:t};a.triggerEvent(a.events,"cornerstoneimageloadstart",i)},s.onloadend=function(r){o.onloadend&&o.onloadend(r,n);const i={url:e,imageId:t};a.triggerEvent(a.events,"cornerstoneimageloadend",i)},s.onreadystatechange=function(e){o.onreadystatechange?o.onreadystatechange(e,n):4===s.readyState&&(200===s.status||206===s.status?o.beforeProcessing(s).then(l).catch((()=>{i(s),c(s)})):(i(s),c(s)))},s.onprogress=function(e){const t=e.loaded;let r,a;e.lengthComputable&&(r=e.total,a=Math.round(t/r*100)),o.onprogress&&o.onprogress(e,n)},s.onerror=function(){i(s),c(s)},s.onabort=function(){i(s),c(s)},s.send()}));return l.xhr=s,l},U={xhrRequest:B,setOptions:R,getOptions:F};var N=a(464);const{ImageQualityStatus:j}=N.Enums;function $(e,t,r){r||={};const n=new Uint8Array(t),a=!!r?.isPartial;if(-1===e.indexOf("multipart"))return{contentType:e,imageQualityStatus:a?j.SUBRESOLUTION:j.FULL_RESOLUTION,pixelData:n};let{tokenIndex:o,responseHeaders:i,boundary:s,multipartContentType:l}=r;if(o||=M(n,"\r\n\r\n"),-1===o)throw new Error("invalid response - no multipart mime header");if(!s){const e=function(e,t,r){t=t||0,r=r||e.length-t;let n="";for(let a=t;a<t+r;a++)n+=String.fromCharCode(e[a]);return n}(n,0,o);if(i=e.split("\r\n"),s=function(e){for(let t=0;t<e.length;t++)if("--"===e[t].substr(0,2))return e[t]}(i),!s)throw new Error("invalid response - no boundary marker")}const c=o+4,u=M(n,s,c);if(-1===u&&!a)throw new Error("invalid response - terminating boundary not found");return l||=function(e){for(let t=0;t<e.length;t++)if("Content-Type:"===e[t].substr(0,13))return e[t].substr(13).trim()}(i),r.tokenIndex=o,r.boundary=s,r.responseHeaders=i,r.multipartContentType=l,r.isPartial=-1===u,{contentType:l,extractDone:!a||-1!==u,tokenIndex:o,responseHeaders:i,boundary:s,multipartContentType:l,pixelData:t.slice(c,u-2)}}const{ImageQualityStatus:V}=N.Enums;function W(e,t=!0){return t?e.imageQualityStatus??V.FULL_RESOLUTION:V.SUBRESOLUTION}const{ProgressiveIterator:q}=N.utilities;function G(e,t,r={},n={}){const a=F(),{retrieveOptions:o={},streamingData:i={}}=n,s=o.minChunkSize||131072,l=new q("streamRequest");return l.generate((async(n,l)=>{const c=Object.assign({},r);Object.keys(c).forEach((function(t){null===c[t]&&(c[t]=void 0),"Accept"===t&&-1!==e.indexOf("accept=")&&(c[t]=void 0)}));try{const a=await fetch(e,{headers:r,signal:void 0});if(200!==a.status)throw new Error(`Couldn't retrieve ${e} got status ${a.status}`);const l=a.body.getReader(),c=a.headers,u=c.get("content-type"),d=Number(c.get("Content-Length"));let f=!1,m=i.encodedData,g=i.lastSize||0;for(i.isPartial=!0;!f;){const{done:r,value:a}=await l.read();if(m=Z(m,a),!m){if(f)throw new Error(`Done but no image frame available ${t}`);continue}if(f=r||m.byteLength===d,!f&&m.length<g+s)continue;g=m.length,i.isPartial=!r;const c=$(u,m,i),h=W(o,f),p={url:e,imageId:t,...c,percentComplete:r?100:100*c.pixelData?.length/d,imageQualityStatus:h,done:f};n.add(p,f)}}catch(e){(e=>{if("function"==typeof a.errorInterceptor){const e=new Error("request failed");a.errorInterceptor(e)}})(),console.error(e),l(e)}})),l.getNextPromise()}function Z(e,t){if(!e)return t;if(!t)return e;const r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r}function z(e,t,r={},n={}){const a=F(),{retrieveOptions:o={},streamingData:i}=n,s=i.chunkSize||function(e,t,r){const n=t[r];if("function"!=typeof n)return n;const a=x.get(e);return n(a,e)}(t,o,"chunkSize")||65536,l=new Promise((async(t,n)=>{const l=Object.assign({},r);Object.keys(l).forEach((function(e){null!==l[e]&&void 0!==l[e]||delete l[e]}));try{i.encodedData||(i.chunkSize=s,i.rangesFetched=0);const r=function(e,t){const{totalBytes:r,encodedData:n,chunkSize:a=65536}=e,{rangeIndex:o=0}=t;if(!(-1!==o||r&&n))return[0,""];if(-1===o||n?.byteLength>r-a)return[n?.byteLength||0,""];return[n?.byteLength||0,a*(o+1)-1]}(i,o),{encodedData:n,responseHeaders:a}=await async function(e,t,r,n){r&&(t=Object.assign(t,{Range:`bytes=${r[0]}-${r[1]}`}));let{encodedData:a}=n;if(r[1]&&a?.byteLength>r[1])return n;const o=await fetch(e,{headers:t,signal:void 0}),i=await o.arrayBuffer(),s=new Uint8Array(i),{status:l}=o;let c;a?(c=new Uint8Array(a.length+s.length),c.set(a,0),c.set(s,a.length),n.rangesFetched=1):(c=new Uint8Array(s.length),c.set(s,0),n.rangesFetched++);n.encodedData=a=c,n.responseHeaders=o.headers;const u=o.headers.get("Content-Range");u?n.totalBytes=Number(u.split("/")[1]):206===l&&r?""===r[1]||a?.length<r[1]?n.totalBytes=a.byteLength:n.totalBytes=Number.MAX_SAFE_INTEGER:n.totalBytes=a?.byteLength;return n}(e,l,r,i),c=a.get("content-type"),{totalBytes:u}=i,d=u===n.byteLength,f=$(c,n,{isPartial:!0}),m=W(o,d||f.extractDone);t({...f,imageQualityStatus:m,percentComplete:f.extractDone?100:100*s/u})}catch(e){(e=>{if("function"==typeof a.errorInterceptor){const e=new Error("request failed");a.errorInterceptor(e)}else console.warn("rangeRequest:Caught",e)})(e),console.error(e),n(e)}}));return l}const Y=function(e,t,r="application/octet-stream",n){const{streamingData:a,retrieveOptions:o={}}=n||{},i={Accept:r};let s=o.urlArguments?`${e}${-1===e.indexOf("?")?"?":"&"}${o.urlArguments}`:e;if(o.framesPath&&(s=s.replace("/frames/",o.framesPath)),a?.url!==s&&(n.streamingData={url:s}),void 0!==o.rangeIndex)return z(s,t,i,n);if(o.streaming)return G(s,t,i,n);const l=B(s,t,i),{xhr:c}=l;return l.then((function(e){const t=$(c.getResponseHeader("Content-Type")||"application/octet-stream",new Uint8Array(e));return t.imageQualityStatus=W(o,!0),t}))};const H=function(e){let t,r=e[0],n=e[0];const a=e.length;for(let o=1;o<a;o++)t=e[o],r=Math.min(r,t),n=Math.max(n,t);return{min:r,max:n}};function Q(r,n,a){0===r.planarConfiguration?e(r.pixelData,n,a):t(r.pixelData,n,a)}function X(e,t,a){if("RGB"===e.photometricInterpretation)Q(e,t,a);else if("YBR_RCT"===e.photometricInterpretation)Q(e,t,a);else if("YBR_ICT"===e.photometricInterpretation)Q(e,t,a);else if("PALETTE COLOR"===e.photometricInterpretation)yt(e,t,a);else if("YBR_FULL_422"===e.photometricInterpretation)!function(e,t,r){if(void 0===e)throw new Error("decodeRGB: ybrBuffer must not be undefined");if(e.length%2!=0)throw new Error("decodeRGB: ybrBuffer length must be divisble by 3");const n=e.length/2;let a=0,o=0;if(r)for(let r=0;r<n;r+=2){const r=e[a++],n=e[a++],i=e[a++],s=e[a++];t[o++]=r+1.402*(s-128),t[o++]=r-.34414*(i-128)-.71414*(s-128),t[o++]=r+1.772*(i-128),t[o++]=255,t[o++]=n+1.402*(s-128),t[o++]=n-.34414*(i-128)-.71414*(s-128),t[o++]=n+1.772*(i-128),t[o++]=255}else for(let r=0;r<n;r+=2){const r=e[a++],n=e[a++],i=e[a++],s=e[a++];t[o++]=r+1.402*(s-128),t[o++]=r-.34414*(i-128)-.71414*(s-128),t[o++]=r+1.772*(i-128),t[o++]=n+1.402*(s-128),t[o++]=n-.34414*(i-128)-.71414*(s-128),t[o++]=n+1.772*(i-128)}}(e.pixelData,t,a);else{if("YBR_FULL"!==e.photometricInterpretation)throw new Error(`No color space conversion for photometric interpretation ${e.photometricInterpretation}`);!function(e,t,a){0===e.planarConfiguration?r(e.pixelData,t,a):n(e.pixelData,t,a)}(e,t,a)}}function K(e){return function(e){let t;try{return decodeURIComponent(escape(e))}catch(r){if(t=r,t instanceof URIError)return e;throw t}}(String.fromCharCode.apply(null,Array.prototype.slice.apply(new Uint8Array(e))))}const J=function(e,t,r){const n=(new Date).getTime(),a=new Blob([t],{type:"image/jpeg"});return new Promise(((t,o)=>{const i=new FileReader;void 0===i.readAsBinaryString?i.readAsArrayBuffer(a):i.readAsBinaryString(a),i.onload=function(){const a=new Image;a.onload=function(){r.height=a.height,r.width=a.width,e.rows=a.height,e.columns=a.width;const o=r.getContext("2d");o.drawImage(this,0,0);const i=o.getImageData(0,0,a.width,a.height),s=(new Date).getTime();e.pixelData=new Uint8Array(i.data.buffer),e.imageData=i,e.decodeTimeInMS=s-n;const l=H(e.pixelData);e.smallestPixelValue=l.min,e.largestPixelValue=l.max,e.pixelDataLength=e.pixelData.length,t(e)},a.onerror=function(e){o(e)},void 0===i.readAsBinaryString?a.src=`data:image/jpeg;base64,${window.btoa(K(i.result))}`:a.src=`data:image/jpeg;base64,${window.btoa(i.result)}`},i.onerror=e=>{o(e)}}))};function ee(){return new Worker(a.p+"index.worker.64c896c4316fcd506666.worker.js")}let te=0;const re=[],ne=[],ae=F(),oe={maxWebWorkers:navigator.hardwareConcurrency||1,startWebWorkersOnDemand:!0,webWorkerTaskPaths:[],taskConfiguration:{decodeTask:{initializeCodecsOnStartup:!1,strict:ae.strict}}};let ie;const se={maxWebWorkers:0,numWebWorkers:0,numTasksQueued:0,numTasksExecuting:0,numTasksCompleted:0,totalTaskTimeInMS:0,totalTimeDelayedInMS:0};function le(){if(re.length){for(let e=0;e<ne.length;e++)if("ready"===ne[e].status){ne[e].status="busy";const t=re.shift();t.start=(new Date).getTime();const r=(new Date).getTime();return se.totalTimeDelayedInMS+=r-t.added,ne[e].task=t,ne[e].worker.postMessage({taskType:t.taskType,workerIndex:e,data:t.data},t.transferList),void se.numTasksExecuting++}ne.length<ie.maxWebWorkers&&ue()}}function ce(e){if("initialize"===e.data.taskType)ne[e.data.workerIndex].status="ready",le();else{const t=ne[e.data.workerIndex].task.start,r="success"===e.data.status?"resolve":"reject";try{ne[e.data.workerIndex].task.deferred[r](e.data.result)}catch(e){console.warn("Caught error delivering response",e)}ne[e.data.workerIndex].task=void 0,se.numTasksExecuting--,ne[e.data.workerIndex].status="ready",se.numTasksCompleted++;const n=(new Date).getTime();se.totalTaskTimeInMS+=n-t,le()}}function ue(){if(ne.length>=ie.maxWebWorkers)return;const e=new ee;ne.push({worker:e,status:"initializing"}),e.addEventListener("message",ce),e.postMessage({taskType:"initialize",workerIndex:ne.length-1,config:ie})}function de(e){if(ie=e=e||oe,ie.maxWebWorkers=ie.maxWebWorkers||navigator.hardwareConcurrency||1,!ie.startWebWorkersOnDemand)for(let e=0;e<ie.maxWebWorkers;e++)ue()}const fe={initialize:de,loadWebWorkerTask:function(e,t){ie.webWorkerTaskPaths.push(e),t&&(ie.taskConfiguration=Object.assign(ie.taskConfiguration,t));for(let t=0;t<ne.length;t++)ne[t].worker.postMessage({taskType:"loadWebWorkerTask",workerIndex:ne.length-1,sourcePath:e,config:ie})},addTask:function(e,t,r=0,n){ie||de();let a={resolve:void 0,reject:void 0};const o=new Promise(((e,t)=>{a={resolve:e,reject:t}}));let i;for(i=0;i<re.length&&!(re[i].priority<r);i++);const s=te++;return re.splice(i,0,{taskId:s,taskType:e,status:"ready",added:(new Date).getTime(),data:t,deferred:a,priority:r,transferList:n}),le(),{taskId:s,promise:o}},getStatistics:function(){return se.maxWebWorkers=ie.maxWebWorkers,se.numWebWorkers=ne.length,se.numTasksQueued=re.length,se},setTaskPriority:function(e,t=0){for(let r=0;r<re.length;r++)if(re[r].taskId===e){const e=re.splice(r,1)[0];for(e.priority=t,r=0;r<re.length&&!(re[r].priority<t);r++);return re.splice(r,0,e),!0}return!1},cancelTask:function(e,t){for(let r=0;r<re.length;r++)if(re[r].taskId===e){return re.splice(r,1).deferred.reject(t),!0}return!1},webWorkers:ne,terminate:function(){for(let e=0;e<ne.length;e++)ne[e].worker.terminate();ne.length=0,ie=void 0}};var me=a(578);function ge(e,t,r,n,a){const o={...n};delete o.loader,delete o.streamingData;const i=o.priority||void 0,s=o.transferPixelData?[r.buffer]:void 0;return fe.addTask("decodeTask",{imageFrame:e,transferSyntax:t,pixelData:r,options:o,decodeConfig:a},i,s).promise}window.pako={inflateRaw:me.Hq};const he=function(e,t,r,n,a={},o){switch(t){case"1.2.840.10008.1.2":case"1.2.840.10008.1.2.1":case"1.2.840.10008.1.2.2":case"1.2.840.10008.1.2.1.99":case"1.2.840.10008.1.2.5":case"1.2.840.10008.1.2.4.51":case"1.2.840.10008.1.2.4.57":case"1.2.840.10008.1.2.4.70":case"1.2.840.10008.1.2.4.80":case"1.2.840.10008.1.2.4.81":case"1.2.840.10008.1.2.4.90":case"1.2.840.10008.1.2.4.91":case"3.2.840.10008.1.2.4.96":case"1.2.840.10008.1.2.4.201":case"1.2.840.10008.1.2.4.202":case"1.2.840.10008.1.2.4.203":return ge(e,t,r,a,o);case"1.2.840.10008.1.2.4.50":return 8!==e.bitsAllocated||3!==e.samplesPerPixel&&4!==e.samplesPerPixel?ge(e,t,r,a,o):J(e,r,n)}return Promise.reject(new Error(`No decoder for transfer syntax ${t}`))};const pe=function(e){const{cornerstone:t}=xt,r=t.metaData.get("imagePixelModule",e);return{samplesPerPixel:r.samplesPerPixel,photometricInterpretation:r.photometricInterpretation,planarConfiguration:r.planarConfiguration,rows:r.rows,columns:r.columns,bitsAllocated:r.bitsAllocated,bitsStored:r.bitsStored,pixelRepresentation:r.pixelRepresentation,smallestPixelValue:r.smallestPixelValue,largestPixelValue:r.largestPixelValue,redPaletteColorLookupTableDescriptor:r.redPaletteColorLookupTableDescriptor,greenPaletteColorLookupTableDescriptor:r.greenPaletteColorLookupTableDescriptor,bluePaletteColorLookupTableDescriptor:r.bluePaletteColorLookupTableDescriptor,redPaletteColorLookupTableData:r.redPaletteColorLookupTableData,greenPaletteColorLookupTableData:r.greenPaletteColorLookupTableData,bluePaletteColorLookupTableData:r.bluePaletteColorLookupTableData,pixelData:void 0,imageId:e}};function be(e){return"RGB"===e||"PALETTE COLOR"===e||"YBR_FULL"===e||"YBR_FULL_422"===e||"YBR_PARTIAL_422"===e||"YBR_PARTIAL_420"===e||"YBR_RCT"===e||"YBR_ICT"===e}const xe={"1.2.840.10008.1.2.1":"application/octet-stream","1.2.840.10008.1.2":"application/octet-stream","1.2.840.10008.1.2.2":"application/octet-stream","1.2.840.10008.1.2.5":"image/dicom-rle"};let we="";function ye(e){const t=function(e,t){let r;return Number.isInteger(e)&&Number.isInteger(t)&&(e>=0?t<=255?r=Uint8Array:t<=65535&&(r=Uint16Array):e>=-128&&t<=127?r=Int8Array:e>=-32768&&t<=32767&&(r=Int16Array)),r||Float32Array}(e.smallestPixelValue,e.largestPixelValue);if(!t)throw new Error("Could not apply a typed array to the pixel data");{const r=new t(e.pixelData);e.pixelData=r}}const ke=function(e,t,r,n={}){const a=n.useRGBA;if(n.preScale={enabled:!(!n.preScale||void 0===n.preScale.enabled)&&n.preScale.enabled},!t?.length)return Promise.reject(new Error("The pixel data is missing"));const{cornerstone:o}=xt,{MetadataModules:i}=o.Enums,s=document.createElement("canvas"),l=pe(e);if(l.decodeLevel=n.decodeLevel,n.preScale.enabled){const t=function(e,t){const r=e.get("modalityLutModule",t)||{},n=e.get("generalSeriesModule",t)||{},{modality:a}=n,o={rescaleSlope:r.rescaleSlope,rescaleIntercept:r.rescaleIntercept,modality:a},i=e.get("scalingModule",t)||{};return{...o,..."PT"===a&&{suvbw:i.suvbw}}}(o.metaData,e);t&&(n.preScale={...n.preScale,scalingParameters:t})}n.isSharedArrayBuffer=n.targetBuffer?.arrayBuffer&&n.targetBuffer.arrayBuffer instanceof SharedArrayBuffer;const{decodeConfig:c}=F(),u=he(l,r,t,s,n,c),{use16BitDataType:d}=c,f=be(l.photometricInterpretation);return new Promise(((t,l)=>{u.then((function(l){if(n.skipCreateImage)return t(l);let c=!1;if(n.targetBuffer&&n.targetBuffer.type&&!f){const{arrayBuffer:e,type:t,offset:r=0,length:a}=n.targetBuffer,o=l.pixelDataLength,i=r,s=null!=a?a:o-i,u={Uint8Array,Uint16Array:d?Uint16Array:void 0,Int16Array:d?Int16Array:void 0,Float32Array};if(s!==l.pixelDataLength)throw new Error(`target array for image does not have the same length (${s}) as the decoded image length (${l.pixelDataLength}).`);const f=u[t],m=e?new f(e,i,s):new f(l.pixelData);if(s!==l.pixelDataLength)throw new Error("target array for image does not have the same length as the decoded image length.");l.pixelData=m,c=!0}c||ye(l);const u=o.metaData.get(i.IMAGE_PLANE,e)||{},m=o.metaData.get(i.VOI_LUT,e)||{},g=o.metaData.get(i.MODALITY_LUT,e)||{},h=o.metaData.get(i.SOP_COMMON,e)||{},p=o.metaData.get(i.CALIBRATION,e)||{};if(f){const{rows:e,columns:t}=l;if(xe[r]){s.height=l.rows,s.width=l.columns;const e=s.getContext("2d").createImageData(l.columns,l.rows);X(l,e.data,a),l.imageData=e,l.pixelData=e.data,l.pixelDataLength=e.data.length}else if(!a&&l.pixelDataLength===4*e*t){const e=new Uint8Array(l.pixelData.length/4*3);l.pixelData=function(e,t){const r=e.length/4;let n=0,a=0;for(let o=0;o<r;o++)t[a++]=e[n++],t[a++]=e[n++],t[a++]=e[n++],n++;return t}(l.pixelData,e),l.pixelDataLength=l.pixelData.length}const n=H(l.pixelData);l.smallestPixelValue=n.min,l.largestPixelValue=n.max}const b={imageId:e,color:f,calibration:p,columnPixelSpacing:u.columnPixelSpacing,columns:l.columns,height:l.rows,preScale:l.preScale,intercept:g.rescaleIntercept?g.rescaleIntercept:0,slope:g.rescaleSlope?g.rescaleSlope:1,invert:"MONOCHROME1"===l.photometricInterpretation,minPixelValue:l.smallestPixelValue,maxPixelValue:l.largestPixelValue,rowPixelSpacing:u.rowPixelSpacing,rows:l.rows,sizeInBytes:l.pixelData.byteLength,width:l.columns,windowCenter:m.windowCenter?m.windowCenter[0]:void 0,windowWidth:m.windowWidth?m.windowWidth[0]:void 0,voiLUTFunction:m.voiLUTFunction?m.voiLUTFunction:void 0,decodeTimeInMS:l.decodeTimeInMS,floatPixelData:void 0,imageFrame:l,rgba:f&&a,getPixelData:()=>l.pixelData,getCanvas:void 0,numComps:void 0};var x;if(b.color&&(b.getCanvas=function(){if(we===e)return s;const t=b.columns,r=b.rows;s.height=r,s.width=t;const n=s.getContext("2d"),a=n.createImageData(t,r),o=l.pixelData;if(o.length===t*r*4)for(let e=0;e<o.length;e++)a.data[e]=o[e];else if(o.length===t*r*3){let e=0;for(let t=0;t<o.length;t+=3)a.data[e++]=o[t],a.data[e++]=o[t+1],a.data[e++]=o[t+2],a.data[e++]=255}return l.pixelData=a.data,l.pixelDataLength=a.data.length,l.imageData=a,n.putImageData(l.imageData,0,0),we=e,s}),g.modalityLUTSequence&&g.modalityLUTSequence.length>0&&("1.2.840.10008.5.1.4.1.1.12.1"!==(x=h.sopClassUID)&&"1.2.840.10008.5.1.4.1.1.12.2.1"!==x)&&(b.modalityLUT=g.modalityLUTSequence[0]),m.voiLUTSequence&&m.voiLUTSequence.length>0&&(b.voiLUT=m.voiLUTSequence[0]),b.color&&(b.windowWidth=256,b.windowCenter=128),void 0===b.windowCenter||void 0===b.windowWidth){const e=b.imageFrame.minAfterScale,t=b.imageFrame.maxAfterScale;b.windowWidth=t-e,b.windowCenter=(t+e)/2}t(b)}),l)}))},{ProgressiveIterator:Se}=N.utilities,{ImageQualityStatus:De}=N.Enums,ve=new Set(["3.2.840.10008.1.2.4.96","1.2.840.10008.1.2.4.202","1.2.840.10008.1.2.4.203"]);function Te(e){const t="1.2.840.10008.1.2";if(!e)return t;const r=e.split(";"),n={};r.forEach((e=>{const t=e.split("=");if(2!==t.length)return;const r=t[1].trim().replace(/"/g,"");n[t[0].trim()]=r}));const a={"image/jpeg":"1.2.840.10008.1.2.4.50","image/x-dicom-rle":"1.2.840.10008.1.2.5","image/x-jls":"1.2.840.10008.1.2.4.80","image/jls":"1.2.840.10008.1.2.4.80","image/jll":"1.2.840.10008.1.2.4.70","image/jp2":"1.2.840.10008.1.2.4.90","image/jpx":"1.2.840.10008.1.2.4.92","image/jphc":"3.2.840.10008.1.2.4.96","image/jxl":"1.2.840.10008.1.2.4.140"};return n["transfer-syntax"]?n["transfer-syntax"]:e&&!Object.keys(n).length&&a[e]?a[e]:n.type&&a[n.type]?a[n.type]:a[e]?a[e]:t}function Pe(e,t=4){const r=e/100-.02;return r>1/4?Math.min(t,0):r>1/16?Math.min(t,1):r>1/64?Math.min(t,2):Math.min(t,3)}const Ie=function(e,t={}){const r=xt.cornerstone.imageRetrievalPoolManager,n=(new Date).getTime(),a=new Se("decompress"),o=t.requestType||"interaction",i=t.additionalDetails||{imageId:e},s=void 0===t.priority?5:t.priority,l=t.addToBeginning||!1,c=e.substring(7);return r.addRequest(async function(e,r,o){a.generate((async a=>{const i=Se.as(Y(e,r,o,t));let s=10;for await(const e of i){const{pixelData:o,imageQualityStatus:i=De.FULL_RESOLUTION,percentComplete:l,done:c=!0,extractDone:u=!0}=e,d=Te(e.contentType);if(!u&&!ve.has(d))continue;const f=e.decodeLevel??(i===De.FULL_RESOLUTION?0:Pe(l,t.retrieveOptions?.decodeLevel));if(c||!(s<=f))try{const e={...t,decodeLevel:f},l=await ke(r,o,d,e),u=(new Date).getTime();l.loadTimeInMS=u-n,l.transferSyntaxUID=d,l.imageQualityStatus=i,a.add(l,c),s=f}catch(e){if(u)throw console.warn("Couldn't decode",e),e}}}))}.bind(this,c,e,"multipart/related; type=application/octet-stream; transfer-syntax=*"),o,i,s,l),{promise:a.getDonePromise(),cancelFn:void 0}};const Ce={metaData:{getNumberString:s,getNumberValue:l,getNumberValues:c,getValue:i,metaDataProvider:A},findIndexOfString:M,getPixelData:Y,loadImage:Ie,metaDataManager:x,register:function(e){e.registerImageLoader("wadors",Ie),e.metaData.addProvider(A)}};function Le(e,t){if(e.elements[t]&&6===e.elements[t].length)return[e.uint16(t,0),e.uint16(t,1),e.uint16(t,2)]}function _e(e,t,r){const n=[],a=e.elements[t];for(let o=0;o<r[0];o++)16===r[2]?n[o]=e.uint16(t,o):n[o]=e.byteArray[o+a.dataOffset];return n}const Ae=function(e){const t={samplesPerPixel:e.uint16("x00280002"),photometricInterpretation:e.string("x00280004"),rows:e.uint16("x00280010"),columns:e.uint16("x00280011"),bitsAllocated:e.uint16("x00280100"),bitsStored:e.uint16("x00280101"),highBit:e.uint16("x00280102"),pixelRepresentation:e.uint16("x00280103"),planarConfiguration:e.uint16("x00280006"),pixelAspectRatio:e.string("x00280034")};return function(e,t){0===e.uint16("x00280103")?(t.smallestPixelValue=e.uint16("x00280106"),t.largestPixelValue=e.uint16("x00280107")):(t.smallestPixelValue=e.int16("x00280106"),t.largestPixelValue=e.int16("x00280107"))}(e,t),"PALETTE COLOR"===t.photometricInterpretation&&e.elements.x00281101&&function(e,t){t.redPaletteColorLookupTableDescriptor=Le(e,"x00281101"),t.greenPaletteColorLookupTableDescriptor=Le(e,"x00281102"),t.bluePaletteColorLookupTableDescriptor=Le(e,"x00281103"),0===t.redPaletteColorLookupTableDescriptor[0]&&(t.redPaletteColorLookupTableDescriptor[0]=65536,t.greenPaletteColorLookupTableDescriptor[0]=65536,t.bluePaletteColorLookupTableDescriptor[0]=65536);const r=t.redPaletteColorLookupTableDescriptor[0],n=e.elements.x00281201.length===r?8:16;t.redPaletteColorLookupTableDescriptor[2]!==n&&(t.redPaletteColorLookupTableDescriptor[2]=n,t.greenPaletteColorLookupTableDescriptor[2]=n,t.bluePaletteColorLookupTableDescriptor[2]=n),t.redPaletteColorLookupTableData=_e(e,"x00281201",t.redPaletteColorLookupTableDescriptor),t.greenPaletteColorLookupTableData=_e(e,"x00281202",t.greenPaletteColorLookupTableDescriptor),t.bluePaletteColorLookupTableData=_e(e,"x00281203",t.bluePaletteColorLookupTableDescriptor)}(e,t),t};function Ee(e,t){let r=t.uint16("x00283002",0);0===r&&(r=65535);let n=0;n=0===e?t.uint16("x00283002",1):t.int16("x00283002",1);const a={id:"1",firstValueMapped:n,numBitsPerEntry:t.uint16("x00283002",2),lut:[]};for(let n=0;n<r;n++)a.lut[n]=0===e?t.uint16("x00283006",n):t.int16("x00283006",n);return a}const Me=function(e,t){if(!t||!t.items||!t.items.length)return;const r=[];for(let n=0;n<t.items.length;n++){const a=Ee(e,t.items[n].dataSet);a&&r.push(a)}return r};const Oe=function(e){const t=e.string("x00080016");if("1.2.840.10008.5.1.4.1.1.2"===t||"1.2.840.10008.5.1.4.1.1.2.1"===t)return 1;const r=e.floatString("x00281052"),n=e.floatString("x00281053");if(void 0!==r&&void 0!==n){const t=function(e){const t=e.uint16("x00280103"),r=e.uint16("x00280101");return 0===t?0:-1<<r-1}(e);return t*n+r<0?1:0}return e.elements.x00283000&&e.elements.x00283000.length>0?0:e.uint16("x00280103")};const Re=function(e,t,r){const n=[],a=e.string(t);if(!a)return;const o=a.split("\\");if(!(r&&o.length<r)){for(let e=0;e<o.length;e++)n.push(parseFloat(o[e]));return n}};const Fe=function(e){const t=e.indexOf(":");let r=e.substring(t+1);const n=r.indexOf("frame=");let a;if(-1!==n){const e=r.substring(n+6);a=parseInt(e,10),r=r.substring(0,n-1)}return{scheme:e.substring(0,t),url:r,frame:a,pixelDataFrame:void 0!==a?a-1:void 0}};function Be(e){const{dicomParser:t}=xt;let r,n=t.parseDicom(e,{untilTag:"x7fe00010"});n.elements.x7fe00010||console.warn("Pixel data not found!");try{r=t.parseDicom(e)}catch(e){console.error(e),console.log("pixel data dataset:",e.dataSet),r=e.dataSet}return n.elements.x7fe00010=r.elements.x7fe00010,n=function(e){const t=e.elements.x7fe00010.fragments,r=e.byteArray.length;for(const e of t){const{position:t,length:n}=e;n>r-t&&(console.log(`Truncated fragment, changing fragment length from ${e.length} to ${r-t}`),e.length=r-t)}return e}(n),n}async function Ue(e,t,r){const n=Be(e),{uri:a,imageId:o,fileTotalLength:i}=r;return n.fetchMore=async function(s){const l=Object.assign({uri:a,imageId:o,fetchedLength:e.length,lengthToFetch:i-e.length},s),{fetchedLength:c,lengthToFetch:u}=l,{arrayBuffer:d}=await t(a,o,{byteRange:`${c}-${c+u}`}),f=new Uint8Array(d),m=new Uint8Array(n.byteArray.length+f.length);return m.set(n.byteArray),m.set(f,n.byteArray.length),Ue(m,t,r)},n}function Ne(e,t,r){const n={};(t?Object.values(t.items[0].dataSet.elements):[]).map((e=>n[e.tag]=e));const a={};return(e?Object.values(e.items[r-1].dataSet.elements):[]).map((e=>a[e.tag]=e)),{shared:n,perFrame:a}}function je(e){if(!e)return;const{elements:t,...r}=e,{x52009230:n,x52009229:a,...o}=t;return{NumberOfFrames:e.intString("x00280008"),PerFrameFunctionalGroupsSequence:n,SharedFunctionalGroupsSequence:a,otherElements:o,otherAttributtes:r}}function $e(e){if(Ge[e])return Ge[e]}function Ve(e){if(!e)return!1;const t=e.intString("x00280008");return t&&t>1}const We={_get:$e,generateMultiframeWADOURIs:function(e){const t=[],r=$e(e);if(Ve(r)){const n=r.intString("x00280008");for(let r=1;r<=n;r++)t.push(`${e}&frame=${r}`)}else t.push(e);return t},retrieveMultiframeDataset:function(e){const t=function(e){return e.indexOf("&frame=")}(e),r=-1===t?e:e.slice(0,t),n=parseInt(e.slice(t+7),10)||1;let a;return a=Ge[r]?Ge[r].dataSet:void 0,{dataSet:a,frame:n}},isMultiframeDataset:function(e){return Ve($e(e))}};let qe=0,Ge={},Ze={};function ze(){return{cacheSizeInBytes:qe,numberOfDataSetsCached:Object.keys(Ge).length}}const Ye={isLoaded:function(e){return void 0!==Ge[e]},load:function(e,t=B,r){const{cornerstone:n,dicomParser:a}=xt;if(Ge[e])return new Promise((t=>{Ge[e].cacheCount++,t(Ge[e].dataSet)}));if(Ze[e])return Ze[e].cacheCount++,Ze[e];const o=t(e,r),i=new Promise(((s,l)=>{o.then((async function(o){const c={isPartialContent:!1,fileTotalLength:null};if(!(o instanceof ArrayBuffer)){if(!o.arrayBuffer)return l(new Error("If not returning ArrayBuffer, must return object with `arrayBuffer` parameter"));c.isPartialContent=o.flags.isPartialContent,c.fileTotalLength=o.flags.fileTotalLength,o=o.arrayBuffer}const u=new Uint8Array(o);let d;try{d=c.isPartialContent?await Ue(u,t,{uri:e,imageId:r,fileTotalLength:c.fileTotalLength}):a.parseDicom(u)}catch(e){return l(e)}Ge[e]={dataSet:d,cacheCount:i.cacheCount},qe+=d.byteArray.length,s(d),n.triggerEvent(n.events,"datasetscachechanged",{uri:e,action:"loaded",cacheInfo:ze()})}),l).then((()=>{delete Ze[e]}),(()=>{delete Ze[e]}))}));return i.cacheCount=1,Ze[e]=i,i},unload:function(e){const{cornerstone:t}=xt;Ge[e]&&(Ge[e].cacheCount--,0===Ge[e].cacheCount&&(qe-=Ge[e].dataSet.byteArray.length,delete Ge[e],t.triggerEvent(t.events,"datasetscachechanged",{uri:e,action:"unloaded",cacheInfo:ze()})))},getInfo:ze,purge:function(){Ge={},Ze={},qe=0},get:function(e){let t;if(e.includes("&frame=")){const{frame:r,dataSet:n}=We.retrieveMultiframeDataset(e);t=function(e,t){if(!t)return;const{NumberOfFrames:r,PerFrameFunctionalGroupsSequence:n,SharedFunctionalGroupsSequence:a,otherElements:o}=je(t);if(n||r>1){const{shared:r,perFrame:i}=Ne(n,a,e),s={elements:{...o,...r,...i}},l=Object.create(t);return Object.assign(l,s)}return t}(r,n)}else Ge[e]&&(t=Ge[e].dataSet);return t},update:function(e,t){const r=Ge[e];r?(qe-=r.dataSet.byteArray.length,r.dataSet=t,qe+=t.byteArray.length,xt.cornerstone.triggerEvent(xt.cornerstone.events,"datasetscachechanged",{uri:e,action:"updated",cacheInfo:ze()})):console.error(`No loaded dataSet for uri ${e}`)}};function He(e,t){const r=e.string("x00080008");if(r){const e=r.split("\\");if(e.length>t)return e[t]}}function Qe(e){let t=Re(e,"x00200037",6);return!t&&e.elements.x00209116&&(t=Re(e.elements.x00209116.items[0].dataSet,"x00200037",6)),t||(t=function(e){let t;if(e.string("x00080060").includes("NM")){const r=He(e,2);r&&w(r)&&e.elements.x00540022&&(t=Re(e.elements.x00540022.items[0].dataSet,"x00200037",6))}return t}(e)),t}function Xe(e){let t=Re(e,"x00200032",3);return!t&&e.elements.x00209113&&(t=Re(e.elements.x00209113.items[0].dataSet,"x00200032",3)),t||(t=function(e){let t;if(e.string("x00080060").includes("NM")){const r=He(e,2);r&&w(r)&&e.elements.x00540022&&(t=Re(e.elements.x00540022.items[0].dataSet,"x00200032",3))}return t}(e)),t}function Ke(e){let t=Re(e,"x00280030",2);return!t&&e.elements.x00289110&&(t=Re(e.elements.x00289110.items[0].dataSet,"x00280030",2)),t}function Je(e){let t;return e.elements.x00180050?t=e.floatString("x00180050"):e.elements.x00289110&&e.elements.x00289110.items.length&&e.elements.x00289110.items[0].dataSet.elements.x00180050&&(t=e.elements.x00289110.items[0].dataSet.floatString("x00180050")),t}const et=function e(t,r){const{dicomParser:n}=xt;if(Array.isArray(r))return;const a=Fe(r);if("multiframeModule"===t){const e=We.retrieveMultiframeDataset(a.url);if(!e.dataSet)return;const t=function(e,t){if(!e)return;const{NumberOfFrames:r,PerFrameFunctionalGroupsSequence:n,SharedFunctionalGroupsSequence:a}=je(e);if(n||r>1){const{shared:e,perFrame:o}=Ne(n,a,t);return{NumberOfFrames:r,PerFrameFunctionalInformation:o,SharedFunctionalInformation:e}}return{NumberOfFrames:r}}(e.dataSet,e.frame);return t}let o=a.url;a.frame&&(o=`${o}&frame=${a.frame}`);const i=Ye.get(o);if(i){if("generalSeriesModule"===t)return{modality:i.string("x00080060"),seriesInstanceUID:i.string("x0020000e"),seriesNumber:i.intString("x00200011"),studyInstanceUID:i.string("x0020000d"),seriesDate:n.parseDA(i.string("x00080021")),seriesTime:n.parseTM(i.string("x00080031")||""),acquisitionDate:n.parseDA(i.string("x00080022")||""),acquisitionTime:n.parseTM(i.string("x00080032")||"")};if("patientStudyModule"===t)return{patientAge:i.intString("x00101010"),patientSize:i.floatString("x00101020"),patientWeight:i.floatString("x00101030")};if("imagePlaneModule"===t){const e=Qe(i),t=Xe(i),r=Ke(i);let n;i.elements.x00200052&&(n=i.string("x00200052"));const a=Je(i);let o;i.elements.x00201041&&(o=i.floatString("x00201041"));let s=null,l=null;r&&(l=r[0],s=r[1]);let c=null,u=null;return e&&(c=[parseFloat(e[0]),parseFloat(e[1]),parseFloat(e[2])],u=[parseFloat(e[3]),parseFloat(e[4]),parseFloat(e[5])]),{frameOfReferenceUID:n,rows:i.uint16("x00280010"),columns:i.uint16("x00280011"),imageOrientationPatient:e,rowCosines:c,columnCosines:u,imagePositionPatient:t,sliceThickness:a,sliceLocation:o,pixelSpacing:r,rowPixelSpacing:l,columnPixelSpacing:s}}if("nmMultiframeGeometryModule"===t){const e=i.string("x00080060"),t=He(i,2);return{modality:e,imageType:i.string("x00080008"),imageSubType:t,imageOrientationPatient:Qe(i),imagePositionPatient:Xe(i),sliceThickness:Je(i),pixelSpacing:Ke(i),numberOfFrames:i.uint16("x00280008"),isNMReconstructable:w(t)&&e.includes("NM")}}if("imagePixelModule"===t)return Ae(i);if("modalityLutModule"===t)return{rescaleIntercept:i.floatString("x00281052"),rescaleSlope:i.floatString("x00281053"),rescaleType:i.string("x00281054"),modalityLUTSequence:Me(i.uint16("x00280103"),i.elements.x00283000)};if("voiLutModule"===t){const e=Oe(i);return{windowCenter:Re(i,"x00281050",1),windowWidth:Re(i,"x00281051",1),voiLUTSequence:Me(e,i.elements.x00283010)}}if("sopCommonModule"===t)return{sopClassUID:i.string("x00080016"),sopInstanceUID:i.string("x00080018")};if("petIsotopeModule"===t){const e=i.elements.x00540016;if(void 0===e)return;const t=e.items[0].dataSet;return{radiopharmaceuticalInfo:{radiopharmaceuticalStartTime:n.parseTM(t.string("x00181072")||""),radionuclideTotalDose:t.floatString("x00181074"),radionuclideHalfLife:t.floatString("x00181075")}}}return"overlayPlaneModule"===t?function(e){const t=[];for(let r=0;r<=30;r+=2){let n=`x60${r.toString(16)}`;4===n.length&&(n=`x600${r.toString(16)}`);const a=e.elements[`${n}3000`];if(!a)continue;const o=[];for(let t=0;t<a.length;t++)for(let r=0;r<8;r++){const n=e.byteArray[a.dataOffset+t];o[8*t+r]=n>>r&1}t.push({rows:e.uint16(`${n}0010`),columns:e.uint16(`${n}0011`),type:e.string(`${n}0040`),x:e.int16(`${n}0050`,1)-1,y:e.int16(`${n}0050`,0)-1,pixelData:o,description:e.string(`${n}0022`),label:e.string(`${n}1500`),roiArea:e.string(`${n}1301`),roiMean:e.string(`${n}1302`),roiStandardDeviation:e.string(`${n}1303`)})}return{overlays:t}}(i):"transferSyntax"===t?{transferSyntaxUID:i.string("x00020010")}:"petSeriesModule"===t?{correctedImage:i.string("x00280051"),units:i.string("x00541001"),decayCorrection:i.string("x00541102")}:"petImageModule"===t?{frameReferenceTime:i.floatString(i.string("x00541300")||""),actualFrameDuration:i.intString(i.string("x00181242"))}:"instance"===t?v(r,e,P):void 0}};let tt=[];const rt={add:function(e){return"dicomfile:"+(tt.push(e)-1)},get:function(e){return tt[e]},remove:function(e){tt[e]=void 0},purge:function(){tt=[]}};var nt=a(713);function at(e,t){const{dicomParser:r}=xt;if(e.elements.x7fe00010&&e.elements.x7fe00010.basicOffsetTable.length)return r.readEncapsulatedImageFrame(e,e.elements.x7fe00010,t);if(function(e){return e.intString("x00280008")!==e.elements.x7fe00010.fragments.length}(e)){const n=r.createJPEGBasicOffsetTable(e,e.elements.x7fe00010);return r.readEncapsulatedImageFrame(e,e.elements.x7fe00010,t,n)}const n=e.elements.x7fe00010.fragments,a=new nt.ByteStream(e.byteArrayParser,e.byteArray,e.elements.x7fe00010.dataOffset),o=(0,nt.readSequenceItem)(a);if("xfffee000"!==o.tag)throw"dicomParser.readEncapsulatedPixelData: missing basic offset table xfffee000";a.seek(o.length);const i=a.position;if(t+1>n.length)throw"dicomParser.readEncapsulatedPixelData: frame exceeds number of fragments";const s=i+n[t].offset+8,l=n[t].length;return new Uint8Array(a.byteArray.buffer.slice(a.byteArray.byteOffset+s,a.byteArray.byteOffset+s+l))}function ot(e,t){return e&1<<t}const it=function(e,t,r){const n=new Uint8Array(r);for(let a=0;a<r;a++){const r=e[Math.floor(a/8)+t],o=a%8;n[a]=ot(r,o)?1:0}return n};const st=function(e,t){const r=e.elements.x7fe00010||e.elements.x7fe00008,n=e.uint16("x00280100"),a=e.uint16("x00280010"),o=e.uint16("x00280011");let i=e.uint16("x00280002");"YBR_FULL_422"===e.string("x00280004")&&(i=2,console.warn("Using SamplesPerPixel of 2 for YBR_FULL_422 photometric interpretation.\n See http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.7.6.3.html for more information."));const s=r.dataOffset,l=a*o*i;let c;if(8===n){if(c=s+t*l,c>=e.byteArray.length)throw new Error("frame exceeds size of pixelData");return new Uint8Array(e.byteArray.buffer.slice(c,c+l))}if(16===n){if(c=s+t*l*2,c>=e.byteArray.length)throw new Error("frame exceeds size of pixelData");return new Uint8Array(e.byteArray.buffer.slice(c,c+2*l))}if(1===n){if(c=s+t*l*.125,c>=e.byteArray.length)throw new Error("frame exceeds size of pixelData");return it(e.byteArray,c,l)}if(32===n){if(c=s+t*l*4,c>=e.byteArray.length)throw new Error("frame exceeds size of pixelData");return new Uint8Array(e.byteArray.buffer.slice(c,c+4*l))}throw new Error("unsupported pixel format")};const lt=function(e){const t=Fe(e),r=parseInt(t.url,10),n=rt.get(r);return new Promise(((e,t)=>{const r=new FileReader;r.onload=t=>{const r=t.target.result;e(r)},r.onerror=t,r.readAsArrayBuffer(n)}))};const ct=function(e,t=0){const r=e.elements.x7fe00010||e.elements.x7fe00008;return r?r.encapsulatedPixelData?at(e,t):st(e,t):null};function ut(e,t,r=0,n,a,o){const i=(new Date).getTime(),s={cancelFn:void 0,promise:void 0};return s.promise=new Promise(((l,c)=>{e.then((e=>{const u=ct(e,r),d=e.string("x00020010"),f=(new Date).getTime(),m=ke(t,u,d,a);!function(e,t){e.decache=function(){const e=Fe(t);Ye.unload(e.url)}}(s,t),m.then((t=>{t.data=e,t.sharedCacheKey=n;const r=(new Date).getTime();t.loadTimeInMS=f-i,t.totalTimeInMS=r-i,void 0!==o&&void 0!==o.imageDoneCallback&&o.imageDoneCallback(t),l(t)}),(function(t){c({error:t,dataSet:e})}))}),(function(e){c({error:e})}))})),s}function dt(e){return"dicomweb"===e||"wadouri"===e?B:"dicomfile"===e?lt:void 0}function ft(e,t={}){const r=Fe(e);delete(t=Object.assign({},t)).loader;const n=dt(r.scheme);if(Ye.isLoaded(r.url)){return function(e,t,r=0,n,a){const o=(new Date).getTime();return{promise:new Promise(((i,s)=>{const l=(new Date).getTime();let c;try{const n=ct(e,r),o=e.string("x00020010");c=ke(t,n,o,a)}catch(t){return void s({error:t,dataSet:e})}c.then((t=>{t.data=e,t.sharedCacheKey=n;const r=(new Date).getTime();t.loadTimeInMS=l-o,t.totalTimeInMS=r-o,i(t)}),s)})),cancelFn:void 0}}(Ye.get(r.url,n,e),e,r.pixelDataFrame,r.url,t)}return ut(Ye.load(r.url,n,e),e,r.frame,r.url,t)}const mt={metaData:{getImagePixelModule:Ae,getLUTs:Me,getModalityLUTOutputPixelRepresentation:Oe,getNumberValues:Re,metaDataProvider:et},dataSetCacheManager:Ye,fileManager:rt,getEncapsulatedImageFrame:at,getUncompressedImageFrame:st,loadFileRequest:lt,loadImageFromPromise:ut,getLoaderForScheme:dt,loadImage:ft,parseImageId:Fe,unpackBinaryFrame:it,register:function(e){e.registerImageLoader("dicomweb",ft),e.registerImageLoader("wadouri",ft),e.registerImageLoader("dicomfile",ft),e.metaData.addProvider(et)}};const gt=function(e){Ce.register(e),mt.register(e)};let ht,pt;const bt={set cornerstone(e){ht=e,gt(ht)},get cornerstone(){if(!ht){if(ht=window&&window.cornerstone,!ht)throw new Error("cornerstoneDICOMImageLoader requires a copy of Cornerstone to work properly. Please add cornerstoneDICOMImageLoader.external.cornerstone = cornerstone; to your application.");gt(ht)}return ht},set dicomParser(e){pt=e},get dicomParser(){if(!pt){if(!window||!window.dicomParser)throw new Error("cornerstoneDICOMImageLoader requires a copy of dicomParser to work properly. Please add cornerstoneDICOMImageLoader.external.dicomParser = dicomParser; to your application.");pt=window.dicomParser}return pt}},xt=bt;function wt(e,t){const r=e.length,n=new Uint8ClampedArray(r);for(let a=0;a<r;++a)n[a]=e[a]>>t;return n}function yt(e,t,r){const n=e.columns*e.rows,a=e.pixelData;let o=e.redPaletteColorLookupTableData;o||(o=xt.cornerstone.metaData.get("imagePixelModule",e.imageId)?.redPaletteColorLookupTableData);let i=e.greenPaletteColorLookupTableData;i||(i=xt.cornerstone.metaData.get("imagePixelModule",e.imageId)?.greenPaletteColorLookupTableData);let s=e.bluePaletteColorLookupTableData;if(s||(s=xt.cornerstone.metaData.get("imagePixelModule",e.imageId)?.bluePaletteColorLookupTableData),!o||!i||!s)throw new Error("The image does not have a complete color palette. R, G, and B palette data are required.");const l=e.redPaletteColorLookupTableData.length;let c=0,u=0;const d=e.redPaletteColorLookupTableDescriptor[1],f=8===e.redPaletteColorLookupTableDescriptor[2]?0:8,m=wt(o,f),g=wt(i,f),h=wt(s,f);if(r)for(let e=0;e<n;++e){let e=a[c++];e<d?e=0:e>d+l-1?e=l-1:e-=d,t[u++]=m[e],t[u++]=g[e],t[u++]=h[e],t[u++]=255}else for(let e=0;e<n;++e){let e=a[c++];e<d?e=0:e>d+l-1?e=l-1:e-=d,t[u++]=m[e],t[u++]=g[e],t[u++]=h[e]}}const kt=function(e){R(e)};const St=function(e,t){if(t=t||e.transferSyntax,8===e.bitsAllocated&&"1.2.840.10008.1.2.4.50"===t&&(3===e.samplesPerPixel||4===e.samplesPerPixel))return!0},Dt={convertRGBColorByPixel:e,convertRGBColorByPlane:t,convertYBRFullByPixel:r,convertYBRFullByPlane:n,convertPALETTECOLOR:yt,wadouri:mt,wadors:Ce,configure:kt,convertColorSpace:X,createImage:ke,decodeImageFrame:he,decodeJPEGBaseline8BitColor:J,getImageFrame:pe,getPixelData:Y,getMinMax:H,isColorImage:be,isJPEGBaseline8BitColor:St,webWorkerManager:fe,internal:U,external:bt}})(),o})()));
|
|
118631
|
+
!function(e,t){ true?module.exports=t(__webpack_require__(64225),__webpack_require__(56660)):0}(this,((e,t)=>(()=>{"use strict";var r={578:(e,t,r)=>{const n=r(823),a=r(187),o=r(592),i=r(604),s=r(249),l=r(968),c=Object.prototype.toString,{Z_NO_FLUSH:u,Z_FINISH:d,Z_OK:f,Z_STREAM_END:m,Z_NEED_DICT:g,Z_STREAM_ERROR:h,Z_DATA_ERROR:p,Z_MEM_ERROR:b}=r(684);function x(e){this.options=a.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;let r=n.inflateInit2(this.strm,t.windowBits);if(r!==f)throw new Error(i[r]);if(this.header=new l,n.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=o.string2buf(t.dictionary):"[object ArrayBuffer]"===c.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=n.inflateSetDictionary(this.strm,t.dictionary),r!==f)))throw new Error(i[r])}function w(e,t){const r=new x(t);if(r.push(e),r.err)throw r.msg||i[r.err];return r.result}x.prototype.push=function(e,t){const r=this.strm,a=this.options.chunkSize,i=this.options.dictionary;let s,l,x;if(this.ended)return!1;for(l=t===~~t?t:!0===t?d:u,"[object ArrayBuffer]"===c.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(a),r.next_out=0,r.avail_out=a),s=n.inflate(r,l),s===g&&i&&(s=n.inflateSetDictionary(r,i),s===f?s=n.inflate(r,l):s===p&&(s=g));r.avail_in>0&&s===m&&r.state.wrap>0&&0!==e[r.next_in];)n.inflateReset(r),s=n.inflate(r,l);switch(s){case h:case p:case g:case b:return this.onEnd(s),this.ended=!0,!1}if(x=r.avail_out,r.next_out&&(0===r.avail_out||s===m))if("string"===this.options.to){let e=o.utf8border(r.output,r.next_out),t=r.next_out-e,n=o.buf2string(r.output,e);r.next_out=t,r.avail_out=a-t,t&&r.output.set(r.output.subarray(e,e+t),0),this.onData(n)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(s!==f||0!==x){if(s===m)return s=n.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},x.prototype.onData=function(e){this.chunks.push(e)},x.prototype.onEnd=function(e){e===f&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},e.exports.Hq=function(e,t){return(t=t||{}).raw=!0,w(e,t)},r(684)},187:e=>{const t=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);e.exports.assign=function(e){const r=Array.prototype.slice.call(arguments,1);for(;r.length;){const n=r.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const r in n)t(n,r)&&(e[r]=n[r])}}return e},e.exports.flattenChunks=e=>{let t=0;for(let r=0,n=e.length;r<n;r++)t+=e[r].length;const r=new Uint8Array(t);for(let t=0,n=0,a=e.length;t<a;t++){let a=e[t];r.set(a,n),n+=a.length}return r}},592:e=>{let t=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){t=!1}const r=new Uint8Array(256);for(let e=0;e<256;e++)r[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;r[254]=r[254]=1,e.exports.string2buf=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,r,n,a,o,i=e.length,s=0;for(a=0;a<i;a++)r=e.charCodeAt(a),55296==(64512&r)&&a+1<i&&(n=e.charCodeAt(a+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),a++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(s),o=0,a=0;o<s;a++)r=e.charCodeAt(a),55296==(64512&r)&&a+1<i&&(n=e.charCodeAt(a+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),a++)),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t};e.exports.buf2string=(e,n)=>{const a=n||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,n));let o,i;const s=new Array(2*a);for(i=0,o=0;o<a;){let t=e[o++];if(t<128){s[i++]=t;continue}let n=r[t];if(n>4)s[i++]=65533,o+=n-1;else{for(t&=2===n?31:3===n?15:7;n>1&&o<a;)t=t<<6|63&e[o++],n--;n>1?s[i++]=65533:t<65536?s[i++]=t:(t-=65536,s[i++]=55296|t>>10&1023,s[i++]=56320|1023&t)}}return((e,r)=>{if(r<65534&&e.subarray&&t)return String.fromCharCode.apply(null,e.length===r?e:e.subarray(0,r));let n="";for(let t=0;t<r;t++)n+=String.fromCharCode(e[t]);return n})(s,i)},e.exports.utf8border=(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let n=t-1;for(;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+r[e[n]]>t?n:t}},693:e=>{e.exports=(e,t,r,n)=>{let a=65535&e|0,o=e>>>16&65535|0,i=0;for(;0!==r;){i=r>2e3?2e3:r,r-=i;do{a=a+t[n++]|0,o=o+a|0}while(--i);a%=65521,o%=65521}return a|o<<16|0}},684:e=>{e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},863:e=>{const t=new Uint32Array((()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t})());e.exports=(e,r,n,a)=>{const o=t,i=a+n;e^=-1;for(let t=a;t<i;t++)e=e>>>8^o[255&(e^r[t])];return-1^e}},968:e=>{e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},365:e=>{const t=16209;e.exports=function(e,r){let n,a,o,i,s,l,c,u,d,f,m,g,h,p,b,x,w,y,k,S,D,v,T,P;const I=e.state;n=e.next_in,T=e.input,a=n+(e.avail_in-5),o=e.next_out,P=e.output,i=o-(r-e.avail_out),s=o+(e.avail_out-257),l=I.dmax,c=I.wsize,u=I.whave,d=I.wnext,f=I.window,m=I.hold,g=I.bits,h=I.lencode,p=I.distcode,b=(1<<I.lenbits)-1,x=(1<<I.distbits)-1;e:do{g<15&&(m+=T[n++]<<g,g+=8,m+=T[n++]<<g,g+=8),w=h[m&b];t:for(;;){if(y=w>>>24,m>>>=y,g-=y,y=w>>>16&255,0===y)P[o++]=65535&w;else{if(!(16&y)){if(0==(64&y)){w=h[(65535&w)+(m&(1<<y)-1)];continue t}if(32&y){I.mode=16191;break e}e.msg="invalid literal/length code",I.mode=t;break e}k=65535&w,y&=15,y&&(g<y&&(m+=T[n++]<<g,g+=8),k+=m&(1<<y)-1,m>>>=y,g-=y),g<15&&(m+=T[n++]<<g,g+=8,m+=T[n++]<<g,g+=8),w=p[m&x];r:for(;;){if(y=w>>>24,m>>>=y,g-=y,y=w>>>16&255,!(16&y)){if(0==(64&y)){w=p[(65535&w)+(m&(1<<y)-1)];continue r}e.msg="invalid distance code",I.mode=t;break e}if(S=65535&w,y&=15,g<y&&(m+=T[n++]<<g,g+=8,g<y&&(m+=T[n++]<<g,g+=8)),S+=m&(1<<y)-1,S>l){e.msg="invalid distance too far back",I.mode=t;break e}if(m>>>=y,g-=y,y=o-i,S>y){if(y=S-y,y>u&&I.sane){e.msg="invalid distance too far back",I.mode=t;break e}if(D=0,v=f,0===d){if(D+=c-y,y<k){k-=y;do{P[o++]=f[D++]}while(--y);D=o-S,v=P}}else if(d<y){if(D+=c+d-y,y-=d,y<k){k-=y;do{P[o++]=f[D++]}while(--y);if(D=0,d<k){y=d,k-=y;do{P[o++]=f[D++]}while(--y);D=o-S,v=P}}}else if(D+=d-y,y<k){k-=y;do{P[o++]=f[D++]}while(--y);D=o-S,v=P}for(;k>2;)P[o++]=v[D++],P[o++]=v[D++],P[o++]=v[D++],k-=3;k&&(P[o++]=v[D++],k>1&&(P[o++]=v[D++]))}else{D=o-S;do{P[o++]=P[D++],P[o++]=P[D++],P[o++]=P[D++],k-=3}while(k>2);k&&(P[o++]=P[D++],k>1&&(P[o++]=P[D++]))}break}}break}}while(n<a&&o<s);k=g>>3,n-=k,g-=k<<3,m&=(1<<g)-1,e.next_in=n,e.next_out=o,e.avail_in=n<a?a-n+5:5-(n-a),e.avail_out=o<s?s-o+257:257-(o-s),I.hold=m,I.bits=g}},823:(e,t,r)=>{const n=r(693),a=r(863),o=r(365),i=r(446),{Z_FINISH:s,Z_BLOCK:l,Z_TREES:c,Z_OK:u,Z_STREAM_END:d,Z_NEED_DICT:f,Z_STREAM_ERROR:m,Z_DATA_ERROR:g,Z_MEM_ERROR:h,Z_BUF_ERROR:p,Z_DEFLATED:b}=r(684),x=16180,w=16190,y=16191,k=16192,S=16194,D=16199,v=16200,T=16206,P=16209,I=16210,C=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function L(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const _=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<x||t.mode>16211?1:0},A=e=>{if(_(e))return m;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=x,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,u},E=e=>{if(_(e))return m;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,A(e)},M=(e,t)=>{let r;if(_(e))return m;const n=e.state;return t<0?(r=0,t=-t):(r=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?m:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,E(e))},O=(e,t)=>{if(!e)return m;const r=new L;e.state=r,r.strm=e,r.window=null,r.mode=x;const n=M(e,t);return n!==u&&(e.state=null),n};let R,F,B=!0;const U=e=>{if(B){R=new Int32Array(512),F=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(i(1,e.lens,0,288,R,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;i(2,e.lens,0,32,F,0,e.work,{bits:5}),B=!1}e.lencode=R,e.lenbits=9,e.distcode=F,e.distbits=5},N=(e,t,r,n)=>{let a;const o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),n>=o.wsize?(o.window.set(t.subarray(r-o.wsize,r),0),o.wnext=0,o.whave=o.wsize):(a=o.wsize-o.wnext,a>n&&(a=n),o.window.set(t.subarray(r-n,r-n+a),o.wnext),(n-=a)?(o.window.set(t.subarray(r-n,r),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=a))),0};e.exports.inflateReset=E,e.exports.inflateReset2=M,e.exports.inflateResetKeep=A,e.exports.inflateInit=e=>O(e,15),e.exports.inflateInit2=O,e.exports.inflate=(e,t)=>{let r,L,A,E,M,O,R,F,B,j,$,V,W,q,G,Z,z,Y,H,Q,X,K,J=0;const ee=new Uint8Array(4);let te,re;const ne=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(_(e)||!e.output||!e.input&&0!==e.avail_in)return m;r=e.state,r.mode===y&&(r.mode=k),M=e.next_out,A=e.output,R=e.avail_out,E=e.next_in,L=e.input,O=e.avail_in,F=r.hold,B=r.bits,j=O,$=R,K=u;e:for(;;)switch(r.mode){case x:if(0===r.wrap){r.mode=k;break}for(;B<16;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}if(2&r.wrap&&35615===F){0===r.wbits&&(r.wbits=15),r.check=0,ee[0]=255&F,ee[1]=F>>>8&255,r.check=a(r.check,ee,2,0),F=0,B=0,r.mode=16181;break}if(r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&F)<<8)+(F>>8))%31){e.msg="incorrect header check",r.mode=P;break}if((15&F)!==b){e.msg="unknown compression method",r.mode=P;break}if(F>>>=4,B-=4,X=8+(15&F),0===r.wbits&&(r.wbits=X),X>15||X>r.wbits){e.msg="invalid window size",r.mode=P;break}r.dmax=1<<r.wbits,r.flags=0,e.adler=r.check=1,r.mode=512&F?16189:y,F=0,B=0;break;case 16181:for(;B<16;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}if(r.flags=F,(255&r.flags)!==b){e.msg="unknown compression method",r.mode=P;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=P;break}r.head&&(r.head.text=F>>8&1),512&r.flags&&4&r.wrap&&(ee[0]=255&F,ee[1]=F>>>8&255,r.check=a(r.check,ee,2,0)),F=0,B=0,r.mode=16182;case 16182:for(;B<32;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}r.head&&(r.head.time=F),512&r.flags&&4&r.wrap&&(ee[0]=255&F,ee[1]=F>>>8&255,ee[2]=F>>>16&255,ee[3]=F>>>24&255,r.check=a(r.check,ee,4,0)),F=0,B=0,r.mode=16183;case 16183:for(;B<16;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}r.head&&(r.head.xflags=255&F,r.head.os=F>>8),512&r.flags&&4&r.wrap&&(ee[0]=255&F,ee[1]=F>>>8&255,r.check=a(r.check,ee,2,0)),F=0,B=0,r.mode=16184;case 16184:if(1024&r.flags){for(;B<16;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}r.length=F,r.head&&(r.head.extra_len=F),512&r.flags&&4&r.wrap&&(ee[0]=255&F,ee[1]=F>>>8&255,r.check=a(r.check,ee,2,0)),F=0,B=0}else r.head&&(r.head.extra=null);r.mode=16185;case 16185:if(1024&r.flags&&(V=r.length,V>O&&(V=O),V&&(r.head&&(X=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(L.subarray(E,E+V),X)),512&r.flags&&4&r.wrap&&(r.check=a(r.check,L,V,E)),O-=V,E+=V,r.length-=V),r.length))break e;r.length=0,r.mode=16186;case 16186:if(2048&r.flags){if(0===O)break e;V=0;do{X=L[E+V++],r.head&&X&&r.length<65536&&(r.head.name+=String.fromCharCode(X))}while(X&&V<O);if(512&r.flags&&4&r.wrap&&(r.check=a(r.check,L,V,E)),O-=V,E+=V,X)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=16187;case 16187:if(4096&r.flags){if(0===O)break e;V=0;do{X=L[E+V++],r.head&&X&&r.length<65536&&(r.head.comment+=String.fromCharCode(X))}while(X&&V<O);if(512&r.flags&&4&r.wrap&&(r.check=a(r.check,L,V,E)),O-=V,E+=V,X)break e}else r.head&&(r.head.comment=null);r.mode=16188;case 16188:if(512&r.flags){for(;B<16;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}if(4&r.wrap&&F!==(65535&r.check)){e.msg="header crc mismatch",r.mode=P;break}F=0,B=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=y;break;case 16189:for(;B<32;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}e.adler=r.check=C(F),F=0,B=0,r.mode=w;case w:if(0===r.havedict)return e.next_out=M,e.avail_out=R,e.next_in=E,e.avail_in=O,r.hold=F,r.bits=B,f;e.adler=r.check=1,r.mode=y;case y:if(t===l||t===c)break e;case k:if(r.last){F>>>=7&B,B-=7&B,r.mode=T;break}for(;B<3;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}switch(r.last=1&F,F>>>=1,B-=1,3&F){case 0:r.mode=16193;break;case 1:if(U(r),r.mode=D,t===c){F>>>=2,B-=2;break e}break;case 2:r.mode=16196;break;case 3:e.msg="invalid block type",r.mode=P}F>>>=2,B-=2;break;case 16193:for(F>>>=7&B,B-=7&B;B<32;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}if((65535&F)!=(F>>>16^65535)){e.msg="invalid stored block lengths",r.mode=P;break}if(r.length=65535&F,F=0,B=0,r.mode=S,t===c)break e;case S:r.mode=16195;case 16195:if(V=r.length,V){if(V>O&&(V=O),V>R&&(V=R),0===V)break e;A.set(L.subarray(E,E+V),M),O-=V,E+=V,R-=V,M+=V,r.length-=V;break}r.mode=y;break;case 16196:for(;B<14;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}if(r.nlen=257+(31&F),F>>>=5,B-=5,r.ndist=1+(31&F),F>>>=5,B-=5,r.ncode=4+(15&F),F>>>=4,B-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=P;break}r.have=0,r.mode=16197;case 16197:for(;r.have<r.ncode;){for(;B<3;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}r.lens[ne[r.have++]]=7&F,F>>>=3,B-=3}for(;r.have<19;)r.lens[ne[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,te={bits:r.lenbits},K=i(0,r.lens,0,19,r.lencode,0,r.work,te),r.lenbits=te.bits,K){e.msg="invalid code lengths set",r.mode=P;break}r.have=0,r.mode=16198;case 16198:for(;r.have<r.nlen+r.ndist;){for(;J=r.lencode[F&(1<<r.lenbits)-1],G=J>>>24,Z=J>>>16&255,z=65535&J,!(G<=B);){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}if(z<16)F>>>=G,B-=G,r.lens[r.have++]=z;else{if(16===z){for(re=G+2;B<re;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}if(F>>>=G,B-=G,0===r.have){e.msg="invalid bit length repeat",r.mode=P;break}X=r.lens[r.have-1],V=3+(3&F),F>>>=2,B-=2}else if(17===z){for(re=G+3;B<re;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}F>>>=G,B-=G,X=0,V=3+(7&F),F>>>=3,B-=3}else{for(re=G+7;B<re;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}F>>>=G,B-=G,X=0,V=11+(127&F),F>>>=7,B-=7}if(r.have+V>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=P;break}for(;V--;)r.lens[r.have++]=X}}if(r.mode===P)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=P;break}if(r.lenbits=9,te={bits:r.lenbits},K=i(1,r.lens,0,r.nlen,r.lencode,0,r.work,te),r.lenbits=te.bits,K){e.msg="invalid literal/lengths set",r.mode=P;break}if(r.distbits=6,r.distcode=r.distdyn,te={bits:r.distbits},K=i(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,te),r.distbits=te.bits,K){e.msg="invalid distances set",r.mode=P;break}if(r.mode=D,t===c)break e;case D:r.mode=v;case v:if(O>=6&&R>=258){e.next_out=M,e.avail_out=R,e.next_in=E,e.avail_in=O,r.hold=F,r.bits=B,o(e,$),M=e.next_out,A=e.output,R=e.avail_out,E=e.next_in,L=e.input,O=e.avail_in,F=r.hold,B=r.bits,r.mode===y&&(r.back=-1);break}for(r.back=0;J=r.lencode[F&(1<<r.lenbits)-1],G=J>>>24,Z=J>>>16&255,z=65535&J,!(G<=B);){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}if(Z&&0==(240&Z)){for(Y=G,H=Z,Q=z;J=r.lencode[Q+((F&(1<<Y+H)-1)>>Y)],G=J>>>24,Z=J>>>16&255,z=65535&J,!(Y+G<=B);){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}F>>>=Y,B-=Y,r.back+=Y}if(F>>>=G,B-=G,r.back+=G,r.length=z,0===Z){r.mode=16205;break}if(32&Z){r.back=-1,r.mode=y;break}if(64&Z){e.msg="invalid literal/length code",r.mode=P;break}r.extra=15&Z,r.mode=16201;case 16201:if(r.extra){for(re=r.extra;B<re;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}r.length+=F&(1<<r.extra)-1,F>>>=r.extra,B-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=16202;case 16202:for(;J=r.distcode[F&(1<<r.distbits)-1],G=J>>>24,Z=J>>>16&255,z=65535&J,!(G<=B);){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}if(0==(240&Z)){for(Y=G,H=Z,Q=z;J=r.distcode[Q+((F&(1<<Y+H)-1)>>Y)],G=J>>>24,Z=J>>>16&255,z=65535&J,!(Y+G<=B);){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}F>>>=Y,B-=Y,r.back+=Y}if(F>>>=G,B-=G,r.back+=G,64&Z){e.msg="invalid distance code",r.mode=P;break}r.offset=z,r.extra=15&Z,r.mode=16203;case 16203:if(r.extra){for(re=r.extra;B<re;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}r.offset+=F&(1<<r.extra)-1,F>>>=r.extra,B-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=P;break}r.mode=16204;case 16204:if(0===R)break e;if(V=$-R,r.offset>V){if(V=r.offset-V,V>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=P;break}V>r.wnext?(V-=r.wnext,W=r.wsize-V):W=r.wnext-V,V>r.length&&(V=r.length),q=r.window}else q=A,W=M-r.offset,V=r.length;V>R&&(V=R),R-=V,r.length-=V;do{A[M++]=q[W++]}while(--V);0===r.length&&(r.mode=v);break;case 16205:if(0===R)break e;A[M++]=r.length,R--,r.mode=v;break;case T:if(r.wrap){for(;B<32;){if(0===O)break e;O--,F|=L[E++]<<B,B+=8}if($-=R,e.total_out+=$,r.total+=$,4&r.wrap&&$&&(e.adler=r.check=r.flags?a(r.check,A,$,M-$):n(r.check,A,$,M-$)),$=R,4&r.wrap&&(r.flags?F:C(F))!==r.check){e.msg="incorrect data check",r.mode=P;break}F=0,B=0}r.mode=16207;case 16207:if(r.wrap&&r.flags){for(;B<32;){if(0===O)break e;O--,F+=L[E++]<<B,B+=8}if(4&r.wrap&&F!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=P;break}F=0,B=0}r.mode=16208;case 16208:K=d;break e;case P:K=g;break e;case I:return h;default:return m}return e.next_out=M,e.avail_out=R,e.next_in=E,e.avail_in=O,r.hold=F,r.bits=B,(r.wsize||$!==e.avail_out&&r.mode<P&&(r.mode<T||t!==s))&&N(e,e.output,e.next_out,$-e.avail_out)?(r.mode=I,h):(j-=e.avail_in,$-=e.avail_out,e.total_in+=j,e.total_out+=$,r.total+=$,4&r.wrap&&$&&(e.adler=r.check=r.flags?a(r.check,A,$,e.next_out-$):n(r.check,A,$,e.next_out-$)),e.data_type=r.bits+(r.last?64:0)+(r.mode===y?128:0)+(r.mode===D||r.mode===S?256:0),(0===j&&0===$||t===s)&&K===u&&(K=p),K)},e.exports.inflateEnd=e=>{if(_(e))return m;let t=e.state;return t.window&&(t.window=null),e.state=null,u},e.exports.inflateGetHeader=(e,t)=>{if(_(e))return m;const r=e.state;return 0==(2&r.wrap)?m:(r.head=t,t.done=!1,u)},e.exports.inflateSetDictionary=(e,t)=>{const r=t.length;let a,o,i;return _(e)?m:(a=e.state,0!==a.wrap&&a.mode!==w?m:a.mode===w&&(o=1,o=n(o,t,r,0),o!==a.check)?g:(i=N(e,t,r,r),i?(a.mode=I,h):(a.havedict=1,u)))},e.exports.inflateInfo="pako inflate (from Nodeca project)"},446:e=>{const t=15,r=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),n=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),a=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),o=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);e.exports=(e,i,s,l,c,u,d,f)=>{const m=f.bits;let g,h,p,b,x,w,y=0,k=0,S=0,D=0,v=0,T=0,P=0,I=0,C=0,L=0,_=null;const A=new Uint16Array(16),E=new Uint16Array(16);let M,O,R,F=null;for(y=0;y<=t;y++)A[y]=0;for(k=0;k<l;k++)A[i[s+k]]++;for(v=m,D=t;D>=1&&0===A[D];D--);if(v>D&&(v=D),0===D)return c[u++]=20971520,c[u++]=20971520,f.bits=1,0;for(S=1;S<D&&0===A[S];S++);for(v<S&&(v=S),I=1,y=1;y<=t;y++)if(I<<=1,I-=A[y],I<0)return-1;if(I>0&&(0===e||1!==D))return-1;for(E[1]=0,y=1;y<t;y++)E[y+1]=E[y]+A[y];for(k=0;k<l;k++)0!==i[s+k]&&(d[E[i[s+k]]++]=k);if(0===e?(_=F=d,w=20):1===e?(_=r,F=n,w=257):(_=a,F=o,w=0),L=0,k=0,y=S,x=u,T=v,P=0,p=-1,C=1<<v,b=C-1,1===e&&C>852||2===e&&C>592)return 1;for(;;){M=y-P,d[k]+1<w?(O=0,R=d[k]):d[k]>=w?(O=F[d[k]-w],R=_[d[k]-w]):(O=96,R=0),g=1<<y-P,h=1<<T,S=h;do{h-=g,c[x+(L>>P)+h]=M<<24|O<<16|R|0}while(0!==h);for(g=1<<y-1;L&g;)g>>=1;if(0!==g?(L&=g-1,L+=g):L=0,k++,0==--A[y]){if(y===D)break;y=i[s+d[k]]}if(y>v&&(L&b)!==p){for(0===P&&(P=v),x+=S,T=y-P,I=1<<T;T+P<D&&(I-=A[T+P],!(I<=0));)T++,I<<=1;if(C+=1<<T,1===e&&C>852||2===e&&C>592)return 1;p=L&b,c[p]=v<<24|T<<16|x-u|0}}return 0!==L&&(c[x+L]=y-P<<24|64<<16|0),f.bits=v,0}},604:e=>{e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},249:e=>{e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},464:t=>{t.exports=e},713:e=>{e.exports=t}},n={};function a(e){var t=n[e];if(void 0!==t)return t.exports;var o=n[e]={exports:{}};return r[e](o,o.exports,a),o.exports}a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&!e;)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})();var o={};return(()=>{function e(e,t,r){if(void 0===e)throw new Error("decodeRGB: rgbBuffer must not be undefined");if(e.length%3!=0)throw new Error("decodeRGB: rgbBuffer length must be divisible by 3");const n=e.length/3;let a=0,o=0;if(r)for(let r=0;r<n;r++)t[o++]=e[a++],t[o++]=e[a++],t[o++]=e[a++],t[o++]=255;else t.set(e)}function t(e,t,r){if(void 0===e)throw new Error("decodeRGB: rgbBuffer must not be undefined");if(e.length%3!=0)throw new Error("decodeRGB: rgbBuffer length must be divisible by 3");const n=e.length/3;let a=0,o=0,i=n,s=2*n;if(r)for(let r=0;r<n;r++)t[a++]=e[o++],t[a++]=e[i++],t[a++]=e[s++],t[a++]=255;else for(let r=0;r<n;r++)t[a++]=e[o++],t[a++]=e[i++],t[a++]=e[s++]}function r(e,t,r){if(void 0===e)throw new Error("decodeRGB: ybrBuffer must not be undefined");if(e.length%3!=0)throw new Error("decodeRGB: ybrBuffer length must be divisble by 3");const n=e.length/3;let a=0,o=0;if(r)for(let r=0;r<n;r++){const r=e[a++],n=e[a++],i=e[a++];t[o++]=r+1.402*(i-128),t[o++]=r-.34414*(n-128)-.71414*(i-128),t[o++]=r+1.772*(n-128),t[o++]=255}else for(let r=0;r<n;r++){const r=e[a++],n=e[a++],i=e[a++];t[o++]=r+1.402*(i-128),t[o++]=r-.34414*(n-128)-.71414*(i-128),t[o++]=r+1.772*(n-128)}}function n(e,t,r){if(void 0===e)throw new Error("decodeRGB: ybrBuffer must not be undefined");if(e.length%3!=0)throw new Error("decodeRGB: ybrBuffer length must be divisble by 3");const n=e.length/3;let a=0,o=0,i=n,s=2*n;if(r)for(let r=0;r<n;r++){const r=e[o++],n=e[i++],l=e[s++];t[a++]=r+1.402*(l-128),t[a++]=r-.34414*(n-128)-.71414*(l-128),t[a++]=r+1.772*(n-128),t[a++]=255}else for(let r=0;r<n;r++){const r=e[o++],n=e[i++],l=e[s++];t[a++]=r+1.402*(l-128),t[a++]=r-.34414*(n-128)-.71414*(l-128),t[a++]=r+1.772*(n-128)}}a.r(o),a.d(o,{configure:()=>kt,convertColorSpace:()=>X,convertPALETTECOLOR:()=>yt,convertRGBColorByPixel:()=>e,convertRGBColorByPlane:()=>t,convertYBRFullByPixel:()=>r,convertYBRFullByPlane:()=>n,createImage:()=>ke,decodeImageFrame:()=>he,decodeJPEGBaseline8BitColor:()=>J,default:()=>Dt,external:()=>xt,getImageFrame:()=>pe,getMinMax:()=>H,getPixelData:()=>Y,internal:()=>U,isColorImage:()=>be,isJPEGBaseline8BitColor:()=>St,wadors:()=>Ce,wadouri:()=>mt,webWorkerManager:()=>fe});const i=function(e,t,r){return t=t||0,e&&e.Value?e.Value.length<=t?r:e.Value[t]:r};const s=function(e,t,r){const n=i(e,t,r);if(void 0!==n)return parseFloat(n)};const l=function(e,t){const r=i(e,t);if(void 0!==r)return parseFloat(r)};const c=function(e,t){if(!e)return;if(!e.Value)return;if(!Array.isArray(e.Value))return;if(t&&e.Value.length<t)return;const r=[];for(let t=0;t<e.Value.length;t++)r.push(parseFloat(e.Value[t]));return r};function u(e){const t=e.indexOf(":");return e.substring(t+1)}function d(e,t=!0){return e&&e.Value?e.Value[0]&&t?e.Value[0]:e.Value:e}function f(e,t,r){return{shared:(t?Object.values(t[0]):[]).map((e=>e[0])).filter((e=>void 0!==e&&"object"==typeof e)),perFrame:(e?Object.values(e[r-1]):[]).map((e=>e.Value[0])).filter((e=>void 0!==e&&"object"==typeof e))}}function m(e){let{52009230:t,52009229:r,"00280008":n,...a}=e;return t=d(t,!1),r=d(r,!1),n=d(n),{PerFrameFunctionalGroupsSequence:t,SharedFunctionalGroupsSequence:r,NumberOfFrames:n,rest:a}}function g(e){const t=e.indexOf("/frames/")+8,r=e.slice(0,t),n=parseInt(e.slice(t),10);return{metadata:p[`${r}1`],frame:n}}const h={_retrieveMultiframeMetadata:g,retrieveMultiframeMetadata:function(e){return g(u(e))},isMultiframe:function(e){const t=i(e["00280008"]);return t&&t>1}};let p=[],b={};const x={add:function(e,t){const r=u(e);t.isMultiframe=h.isMultiframe(t),p[r]=t},get:function(e){const t=u(e),r=p[t];if(r&&!r?.isMultiframe)return r;const n=b[t];if(n)return n;const a=h._retrieveMultiframeMetadata(t);if(!a||!a.metadata)return;const{metadata:o,frame:i}=a;if(o){const e=function(e,t){const{PerFrameFunctionalGroupsSequence:r,SharedFunctionalGroupsSequence:n,NumberOfFrames:a,rest:o}=m(t);if(r||a>1){const{shared:i,perFrame:s}=f(r,n,e),l=Object.assign(t,{frameNumber:e});return[...i,...s].forEach((e=>{Object.entries(e).forEach((([e,t])=>{l[e]=t}))})),Object.assign(o,{"00280008":a},l)}return t}(i,o);return b[t]=e,e}},remove:function(e){const t=u(e);p[t]=void 0,b[t]=void 0},purge:function(){p=[],b={}}};function w(e){return"RECON TOMO"===e||"RECON GATED TOMO"===e}function y(e){return i(e["00080060"]).includes("NM")}function k(e,t){const r=d(e["00080008"],!1);if(r)return r[t]}function S(e){let t=c(e["00200037"],6);return!t&&y(e)&&(t=function(e){let t;const r=k(e,2);if(r&&w(r)){const r=d(e["00540022"]);r&&(t=c(r["00200037"],6))}return t}(e)),t}function D(e){let t=c(e["00200032"],3);return!t&&y(e)&&(t=function(e){let t;const r=k(e,2);if(r&&w(r)){const r=d(e["00540022"]);r&&(t=c(r["00200032"],3))}return t}(e)),t}function v(e,t,r){const n={};for(const a of r)try{const r=t(a,e);if(r){const e={};for(const t in r)if(t in r){e[T(t)]=r[t]}Object.assign(n,e)}}catch(e){console.error(`Error retrieving ${a} data:`,e)}return n}const T=e=>e.charAt(0).toUpperCase()+e.slice(1),P=["multiframeModule","generalSeriesModule","patientStudyModule","imagePlaneModule","nmMultiframeGeometryModule","imagePixelModule","modalityLutModule","voiLutModule","sopCommonModule","petIsotopeModule","overlayPlaneModule","transferSyntax","petSeriesModule","petImageModule"];function I(e,t){const r=c(e[t]);return r?r[0]:null}const C=function(e){return e?.Value?.length?Array.isArray(e.Value)?e.Value:"object"==typeof e.Value?(console.warn("Warning: Value should be an array, but an object was found. Encapsulating the object in an array."),[e.Value]):[]:[]};function L(e){const t=C(e["00186011"]);if(!t||!t.length)return null;return t.map((e=>{const t=I(e,"0018602C"),r=I(e,"0018602E"),n=I(e,"00186024"),a=I(e,"00186026");return{regionLocationMinY0:I(e,"0018601A"),regionLocationMaxY1:I(e,"0018601E"),regionLocationMinX0:I(e,"00186018"),regionLocationMaxX1:I(e,"0018601C"),referencePixelX0:I(e,"00186020"),referencePixelY0:I(e,"00186022"),physicalDeltaX:t,physicalDeltaY:r,physicalUnitXDirection:n,physicalUnitYDirection:a,referencePhysicalPixelValueY:I(e,"0018602A"),referencePhysicalPixelValueX:I(e,"00186028"),regionSpatialFormat:I(e,"00186012"),regionDataType:I(e,"00186014"),regionFlags:I(e,"00186016"),transducerFrequency:I(e,"00186030")}}))}function _(e,t){return{transferSyntaxUID:i(t["00020010"])||i(t["00083002"])}}const A=function e(t,r){const{MetadataModules:n}=xt.cornerstone.Enums;if(t===n.MULTIFRAME){const{metadata:e,frame:t}=h.retrieveMultiframeMetadata(r);if(!e)return;const{PerFrameFunctionalGroupsSequence:n,SharedFunctionalGroupsSequence:a,NumberOfFrames:o}=m(e);if(n||o>1){const{shared:e,perFrame:r}=f(n,a,t);return{NumberOfFrames:o,PerFrameFunctionalInformation:r,SharedFunctionalInformation:e}}return{NumberOfFrames:o}}const{dicomParser:a}=xt,o=x.get(r);if(o){if(t===n.GENERAL_SERIES)return{modality:i(o["00080060"]),seriesInstanceUID:i(o["0020000E"]),seriesNumber:l(o["00200011"]),studyInstanceUID:i(o["0020000D"]),seriesDate:a.parseDA(i(o["00080021"])),seriesTime:a.parseTM(i(o["00080031"],0,"")),acquisitionDate:a.parseDA(i(o["00080022"]),""),acquisitionTime:a.parseTM(i(o["00080032"],0,""))};if(t===n.PATIENT_STUDY)return{patientAge:l(o["00101010"]),patientSize:l(o["00101020"]),patientSex:i(o["00100040"]),patientWeight:l(o["00101030"])};if(t===n.NM_MULTIFRAME_GEOMETRY){const e=i(o["00080060"]),t=k(o,2);return{modality:e,imageType:i(o["00080008"]),imageSubType:t,imageOrientationPatient:S(o),imagePositionPatient:D(o),sliceThickness:l(o["00180050"]),pixelSpacing:c(o["00280030"],2),numberOfFrames:l(o["00280008"]),isNMReconstructable:w(t)&&e.includes("NM")}}if(t===n.IMAGE_PLANE){const e=S(o),t=D(o),r=c(o["00280030"],2);let n=null,a=null;r&&(a=r[0],n=r[1]);let s=null,u=null;return e&&(s=[parseFloat(e[0]),parseFloat(e[1]),parseFloat(e[2])],u=[parseFloat(e[3]),parseFloat(e[4]),parseFloat(e[5])]),{frameOfReferenceUID:i(o["00200052"]),rows:l(o["00280010"]),columns:l(o["00280011"]),imageOrientationPatient:e,rowCosines:s,columnCosines:u,imagePositionPatient:t,sliceThickness:l(o["00180050"]),sliceLocation:l(o["00201041"]),pixelSpacing:r,rowPixelSpacing:a,columnPixelSpacing:n}}if(t===n.ULTRASOUND_ENHANCED_REGION)return L(o);if(t===n.CALIBRATION){if("US"===i(o["00080060"])){return{sequenceOfUltrasoundRegions:L(o)}}}if(t===n.IMAGE_URL)return function(e,t){const{transferSyntaxUID:r}=_(e,t),n=xt.cornerstone.utilities.isVideoTransferSyntax(r),a=e.substring(7),o=a.replace("/frames/","/thumbnail/");let i=a.replace("/frames/","/rendered/");n&&(i=i.replace("/rendered/1","/rendered"));return{isVideo:n,rendered:i,thumbnail:o}}(r,o);if(t===n.CINE)return function(e,t){const r=i(t["00180040"]);return{cineRate:r,numberOfFrames:l(t["00280008"])}}(0,o);if("imagePixelModule"===t)return{samplesPerPixel:l(o["00280002"]),photometricInterpretation:i(o["00280004"]),rows:l(o["00280010"]),columns:l(o["00280011"]),bitsAllocated:l(o["00280100"]),bitsStored:l(o["00280101"]),highBit:i(o["00280102"]),pixelRepresentation:l(o["00280103"]),planarConfiguration:l(o["00280006"]),pixelAspectRatio:i(o["00280034"]),smallestPixelValue:l(o["00280106"]),largestPixelValue:l(o["00280107"]),redPaletteColorLookupTableDescriptor:c(o["00281101"]),greenPaletteColorLookupTableDescriptor:c(o["00281102"]),bluePaletteColorLookupTableDescriptor:c(o["00281103"]),redPaletteColorLookupTableData:c(o["00281201"]),greenPaletteColorLookupTableData:c(o["00281202"]),bluePaletteColorLookupTableData:c(o["00281203"])};if("voiLutModule"===t)return{windowCenter:c(o["00281050"],1),windowWidth:c(o["00281051"],1)};if("modalityLutModule"===t)return{rescaleIntercept:l(o["00281052"]),rescaleSlope:l(o["00281053"]),rescaleType:i(o["00281054"])};if("sopCommonModule"===t)return{sopClassUID:i(o["00080016"]),sopInstanceUID:i(o["00080018"])};if("petIsotopeModule"===t){const e=i(o["00540016"]);if(void 0===e)return;return{radiopharmaceuticalInfo:{radiopharmaceuticalStartTime:a.parseTM(i(e["00181072"],0,"")),radiopharmaceuticalStartDateTime:i(e["00181078"],0,""),radionuclideTotalDose:l(e["00181074"]),radionuclideHalfLife:l(e["00181075"])}}}return"overlayPlaneModule"===t?function(e){const t=[];for(let r=0;r<=30;r+=2){let n=`x60${r.toString(16)}`;4===n.length&&(n=`x600${r.toString(16)}`);const a=i(e[`${n}3000`]);if(!a)continue;const o=[];for(let t=0;t<a.length;t++)for(let r=0;r<8;r++){const n=e.Value[a.dataOffset+t];o[8*t+r]=n>>r&1}t.push({rows:l(e[`${n}0010`]),columns:l(e[`${n}0011`]),type:i(e[`${n}0040`]),x:l(e[`${n}0050`],1)-1,y:l(e[`${n}0050`],0)-1,pixelData:o,description:i(e[`${n}0022`]),label:i(e[`${n}1500`]),roiArea:i(e[`${n}1301`]),roiMean:i(e[`${n}1302`]),roiStandardDeviation:i(e[`${n}1303`])})}return{overlays:t}}(o):"transferSyntax"===t?_(r,o):"petSeriesModule"===t?{correctedImage:i(o["00280051"]),units:i(o["00541001"]),decayCorrection:i(o["00541102"])}:"petImageModule"===t?{frameReferenceTime:l(o["00541300"]),actualFrameDuration:l(o["00181242"])}:"instance"===t?v(r,e,P):void 0}};function E(e,t,r){if(r+e.length>t.length)return!1;let n=r;for(let r=0;r<e.length;r++)if(e[r]!==t[n++])return!1;return!0}const M=function(e,t,r){r=r||0;const n=function(e){const t=new Uint8Array(e.length);for(let r=0,n=e.length;r<n;r++)t[r]=e.charCodeAt(r);return t}(t);for(let t=r;t<e.length;t++)if(n[0]===e[t]&&E(n,e,t))return t;return-1};let O={open(e,t){e.open("get",t,!0)},beforeSend(){},beforeProcessing:e=>Promise.resolve(e.response),imageCreated(){},strict:!1,decodeConfig:{convertFloatPixelDataToInt:!0,use16BitDataType:!1}};function R(e){O=Object.assign(O,e)}function F(){return O}const B=function(e,t,r={},n={}){const{cornerstone:a}=xt,o=F(),i=e=>{if("function"==typeof o.errorInterceptor){const t=new Error("request failed");t.request=e,t.response=e.response,t.status=e.status,o.errorInterceptor(t)}},s=new XMLHttpRequest,l=new Promise(((l,c)=>{o.open(s,e,r,n);const u=o.beforeSend(s,t,r,n);s.responseType="arraybuffer";const d=Object.assign({},r,u);Object.keys(d).forEach((function(t){null!==d[t]&&("Accept"===t&&-1!==e.indexOf("accept=")||s.setRequestHeader(t,d[t]))})),n.deferred={resolve:l,reject:c},n.url=e,n.imageId=t,s.onloadstart=function(r){o.onloadstart&&o.onloadstart(r,n);const i={url:e,imageId:t};a.triggerEvent(a.events,"cornerstoneimageloadstart",i)},s.onloadend=function(r){o.onloadend&&o.onloadend(r,n);const i={url:e,imageId:t};a.triggerEvent(a.events,"cornerstoneimageloadend",i)},s.onreadystatechange=function(e){o.onreadystatechange?o.onreadystatechange(e,n):4===s.readyState&&(200===s.status||206===s.status?o.beforeProcessing(s).then(l).catch((()=>{i(s),c(s)})):(i(s),c(s)))},s.onprogress=function(e){const t=e.loaded;let r,a;e.lengthComputable&&(r=e.total,a=Math.round(t/r*100)),o.onprogress&&o.onprogress(e,n)},s.onerror=function(){i(s),c(s)},s.onabort=function(){i(s),c(s)},s.send()}));return l.xhr=s,l},U={xhrRequest:B,setOptions:R,getOptions:F};var N=a(464);const{ImageQualityStatus:j}=N.Enums;function $(e,t,r){r||={};const n=new Uint8Array(t),a=!!r?.isPartial;if(-1===e.indexOf("multipart"))return{contentType:e,imageQualityStatus:a?j.SUBRESOLUTION:j.FULL_RESOLUTION,pixelData:n};let{tokenIndex:o,responseHeaders:i,boundary:s,multipartContentType:l}=r;if(o||=M(n,"\r\n\r\n"),-1===o)throw new Error("invalid response - no multipart mime header");if(!s){const e=function(e,t,r){t=t||0,r=r||e.length-t;let n="";for(let a=t;a<t+r;a++)n+=String.fromCharCode(e[a]);return n}(n,0,o);if(i=e.split("\r\n"),s=function(e){for(let t=0;t<e.length;t++)if("--"===e[t].substr(0,2))return e[t]}(i),!s)throw new Error("invalid response - no boundary marker")}const c=o+4,u=M(n,s,c);if(-1===u&&!a)throw new Error("invalid response - terminating boundary not found");return l||=function(e){for(let t=0;t<e.length;t++)if("Content-Type:"===e[t].substr(0,13))return e[t].substr(13).trim()}(i),r.tokenIndex=o,r.boundary=s,r.responseHeaders=i,r.multipartContentType=l,r.isPartial=-1===u,{contentType:l,extractDone:!a||-1!==u,tokenIndex:o,responseHeaders:i,boundary:s,multipartContentType:l,pixelData:t.slice(c,u-2)}}const{ImageQualityStatus:V}=N.Enums;function W(e,t=!0){return t?e.imageQualityStatus??V.FULL_RESOLUTION:V.SUBRESOLUTION}const{ProgressiveIterator:q}=N.utilities;function G(e,t,r={},n={}){const a=F(),{retrieveOptions:o={},streamingData:i={}}=n,s=o.minChunkSize||131072,l=new q("streamRequest");return l.generate((async(n,l)=>{const c=Object.assign({},r);Object.keys(c).forEach((function(t){null===c[t]&&(c[t]=void 0),"Accept"===t&&-1!==e.indexOf("accept=")&&(c[t]=void 0)}));try{const a=await fetch(e,{headers:r,signal:void 0});if(200!==a.status)throw new Error(`Couldn't retrieve ${e} got status ${a.status}`);const l=a.body.getReader(),c=a.headers,u=c.get("content-type"),d=Number(c.get("Content-Length"));let f=!1,m=i.encodedData,g=i.lastSize||0;for(i.isPartial=!0;!f;){const{done:r,value:a}=await l.read();if(m=Z(m,a),!m){if(f)throw new Error(`Done but no image frame available ${t}`);continue}if(f=r||m.byteLength===d,!f&&m.length<g+s)continue;g=m.length,i.isPartial=!r;const c=$(u,m,i),h=W(o,f),p={url:e,imageId:t,...c,percentComplete:r?100:100*c.pixelData?.length/d,imageQualityStatus:h,done:f};n.add(p,f)}}catch(e){(e=>{if("function"==typeof a.errorInterceptor){const e=new Error("request failed");a.errorInterceptor(e)}})(),console.error(e),l(e)}})),l.getNextPromise()}function Z(e,t){if(!e)return t;if(!t)return e;const r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r}function z(e,t,r={},n={}){const a=F(),{retrieveOptions:o={},streamingData:i}=n,s=i.chunkSize||function(e,t,r){const n=t[r];if("function"!=typeof n)return n;const a=x.get(e);return n(a,e)}(t,o,"chunkSize")||65536,l=new Promise((async(t,n)=>{const l=Object.assign({},r);Object.keys(l).forEach((function(e){null!==l[e]&&void 0!==l[e]||delete l[e]}));try{i.encodedData||(i.chunkSize=s,i.rangesFetched=0);const r=function(e,t){const{totalBytes:r,encodedData:n,chunkSize:a=65536}=e,{rangeIndex:o=0}=t;if(!(-1!==o||r&&n))return[0,""];if(-1===o||n?.byteLength>r-a)return[n?.byteLength||0,""];return[n?.byteLength||0,a*(o+1)-1]}(i,o),{encodedData:n,responseHeaders:a}=await async function(e,t,r,n){r&&(t=Object.assign(t,{Range:`bytes=${r[0]}-${r[1]}`}));let{encodedData:a}=n;if(r[1]&&a?.byteLength>r[1])return n;const o=await fetch(e,{headers:t,signal:void 0}),i=await o.arrayBuffer(),s=new Uint8Array(i),{status:l}=o;let c;a?(c=new Uint8Array(a.length+s.length),c.set(a,0),c.set(s,a.length),n.rangesFetched=1):(c=new Uint8Array(s.length),c.set(s,0),n.rangesFetched++);n.encodedData=a=c,n.responseHeaders=o.headers;const u=o.headers.get("Content-Range");u?n.totalBytes=Number(u.split("/")[1]):206===l&&r?""===r[1]||a?.length<r[1]?n.totalBytes=a.byteLength:n.totalBytes=Number.MAX_SAFE_INTEGER:n.totalBytes=a?.byteLength;return n}(e,l,r,i),c=a.get("content-type"),{totalBytes:u}=i,d=u===n.byteLength,f=$(c,n,{isPartial:!0}),m=W(o,d||f.extractDone);t({...f,imageQualityStatus:m,percentComplete:f.extractDone?100:100*s/u})}catch(e){(e=>{if("function"==typeof a.errorInterceptor){const e=new Error("request failed");a.errorInterceptor(e)}else console.warn("rangeRequest:Caught",e)})(e),console.error(e),n(e)}}));return l}const Y=function(e,t,r="application/octet-stream",n){const{streamingData:a,retrieveOptions:o={}}=n||{},i={Accept:r};let s=o.urlArguments?`${e}${-1===e.indexOf("?")?"?":"&"}${o.urlArguments}`:e;if(o.framesPath&&(s=s.replace("/frames/",o.framesPath)),a?.url!==s&&(n.streamingData={url:s}),void 0!==o.rangeIndex)return z(s,t,i,n);if(o.streaming)return G(s,t,i,n);const l=B(s,t,i),{xhr:c}=l;return l.then((function(e){const t=$(c.getResponseHeader("Content-Type")||"application/octet-stream",new Uint8Array(e));return t.imageQualityStatus=W(o,!0),t}))};const H=function(e){let t,r=e[0],n=e[0];const a=e.length;for(let o=1;o<a;o++)t=e[o],r=Math.min(r,t),n=Math.max(n,t);return{min:r,max:n}};function Q(r,n,a){0===r.planarConfiguration?e(r.pixelData,n,a):t(r.pixelData,n,a)}function X(e,t,a){if("RGB"===e.photometricInterpretation)Q(e,t,a);else if("YBR_RCT"===e.photometricInterpretation)Q(e,t,a);else if("YBR_ICT"===e.photometricInterpretation)Q(e,t,a);else if("PALETTE COLOR"===e.photometricInterpretation)yt(e,t,a);else if("YBR_FULL_422"===e.photometricInterpretation)!function(e,t,r){if(void 0===e)throw new Error("decodeRGB: ybrBuffer must not be undefined");if(e.length%2!=0)throw new Error("decodeRGB: ybrBuffer length must be divisble by 3");const n=e.length/2;let a=0,o=0;if(r)for(let r=0;r<n;r+=2){const r=e[a++],n=e[a++],i=e[a++],s=e[a++];t[o++]=r+1.402*(s-128),t[o++]=r-.34414*(i-128)-.71414*(s-128),t[o++]=r+1.772*(i-128),t[o++]=255,t[o++]=n+1.402*(s-128),t[o++]=n-.34414*(i-128)-.71414*(s-128),t[o++]=n+1.772*(i-128),t[o++]=255}else for(let r=0;r<n;r+=2){const r=e[a++],n=e[a++],i=e[a++],s=e[a++];t[o++]=r+1.402*(s-128),t[o++]=r-.34414*(i-128)-.71414*(s-128),t[o++]=r+1.772*(i-128),t[o++]=n+1.402*(s-128),t[o++]=n-.34414*(i-128)-.71414*(s-128),t[o++]=n+1.772*(i-128)}}(e.pixelData,t,a);else{if("YBR_FULL"!==e.photometricInterpretation)throw new Error(`No color space conversion for photometric interpretation ${e.photometricInterpretation}`);!function(e,t,a){0===e.planarConfiguration?r(e.pixelData,t,a):n(e.pixelData,t,a)}(e,t,a)}}function K(e){return function(e){let t;try{return decodeURIComponent(escape(e))}catch(r){if(t=r,t instanceof URIError)return e;throw t}}(String.fromCharCode.apply(null,Array.prototype.slice.apply(new Uint8Array(e))))}const J=function(e,t,r){const n=(new Date).getTime(),a=new Blob([t],{type:"image/jpeg"});return new Promise(((t,o)=>{const i=new FileReader;void 0===i.readAsBinaryString?i.readAsArrayBuffer(a):i.readAsBinaryString(a),i.onload=function(){const a=new Image;a.onload=function(){r.height=a.height,r.width=a.width,e.rows=a.height,e.columns=a.width;const o=r.getContext("2d");o.drawImage(this,0,0);const i=o.getImageData(0,0,a.width,a.height),s=(new Date).getTime();e.pixelData=new Uint8Array(i.data.buffer),e.imageData=i,e.decodeTimeInMS=s-n;const l=H(e.pixelData);e.smallestPixelValue=l.min,e.largestPixelValue=l.max,e.pixelDataLength=e.pixelData.length,t(e)},a.onerror=function(e){o(e)},void 0===i.readAsBinaryString?a.src=`data:image/jpeg;base64,${window.btoa(K(i.result))}`:a.src=`data:image/jpeg;base64,${window.btoa(i.result)}`},i.onerror=e=>{o(e)}}))};function ee(){return new Worker(a.p+"index.worker.64c896c4316fcd506666.worker.js")}let te=0;const re=[],ne=[],ae=F(),oe={maxWebWorkers:navigator.hardwareConcurrency||1,startWebWorkersOnDemand:!0,webWorkerTaskPaths:[],taskConfiguration:{decodeTask:{initializeCodecsOnStartup:!1,strict:ae.strict}}};let ie;const se={maxWebWorkers:0,numWebWorkers:0,numTasksQueued:0,numTasksExecuting:0,numTasksCompleted:0,totalTaskTimeInMS:0,totalTimeDelayedInMS:0};function le(){if(re.length){for(let e=0;e<ne.length;e++)if("ready"===ne[e].status){ne[e].status="busy";const t=re.shift();t.start=(new Date).getTime();const r=(new Date).getTime();return se.totalTimeDelayedInMS+=r-t.added,ne[e].task=t,ne[e].worker.postMessage({taskType:t.taskType,workerIndex:e,data:t.data},t.transferList),void se.numTasksExecuting++}ne.length<ie.maxWebWorkers&&ue()}}function ce(e){if("initialize"===e.data.taskType)ne[e.data.workerIndex].status="ready",le();else{const t=ne[e.data.workerIndex].task.start,r="success"===e.data.status?"resolve":"reject";try{ne[e.data.workerIndex].task.deferred[r](e.data.result)}catch(e){console.warn("Caught error delivering response",e)}ne[e.data.workerIndex].task=void 0,se.numTasksExecuting--,ne[e.data.workerIndex].status="ready",se.numTasksCompleted++;const n=(new Date).getTime();se.totalTaskTimeInMS+=n-t,le()}}function ue(){if(ne.length>=ie.maxWebWorkers)return;const e=new ee;ne.push({worker:e,status:"initializing"}),e.addEventListener("message",ce),e.postMessage({taskType:"initialize",workerIndex:ne.length-1,config:ie})}function de(e){if(ie=e=e||oe,ie.maxWebWorkers=ie.maxWebWorkers||navigator.hardwareConcurrency||1,!ie.startWebWorkersOnDemand)for(let e=0;e<ie.maxWebWorkers;e++)ue()}const fe={initialize:de,loadWebWorkerTask:function(e,t){ie.webWorkerTaskPaths.push(e),t&&(ie.taskConfiguration=Object.assign(ie.taskConfiguration,t));for(let t=0;t<ne.length;t++)ne[t].worker.postMessage({taskType:"loadWebWorkerTask",workerIndex:ne.length-1,sourcePath:e,config:ie})},addTask:function(e,t,r=0,n){ie||de();let a={resolve:void 0,reject:void 0};const o=new Promise(((e,t)=>{a={resolve:e,reject:t}}));let i;for(i=0;i<re.length&&!(re[i].priority<r);i++);const s=te++;return re.splice(i,0,{taskId:s,taskType:e,status:"ready",added:(new Date).getTime(),data:t,deferred:a,priority:r,transferList:n}),le(),{taskId:s,promise:o}},getStatistics:function(){return se.maxWebWorkers=ie.maxWebWorkers,se.numWebWorkers=ne.length,se.numTasksQueued=re.length,se},setTaskPriority:function(e,t=0){for(let r=0;r<re.length;r++)if(re[r].taskId===e){const e=re.splice(r,1)[0];for(e.priority=t,r=0;r<re.length&&!(re[r].priority<t);r++);return re.splice(r,0,e),!0}return!1},cancelTask:function(e,t){for(let r=0;r<re.length;r++)if(re[r].taskId===e){return re.splice(r,1).deferred.reject(t),!0}return!1},webWorkers:ne,terminate:function(){for(let e=0;e<ne.length;e++)ne[e].worker.terminate();ne.length=0,ie=void 0}};var me=a(578);function ge(e,t,r,n,a){const o={...n};delete o.loader,delete o.streamingData;const i=o.priority||void 0,s=o.transferPixelData?[r.buffer]:void 0;return fe.addTask("decodeTask",{imageFrame:e,transferSyntax:t,pixelData:r,options:o,decodeConfig:a},i,s).promise}window.pako={inflateRaw:me.Hq};const he=function(e,t,r,n,a={},o){switch(t){case"1.2.840.10008.1.2":case"1.2.840.10008.1.2.1":case"1.2.840.10008.1.2.2":case"1.2.840.10008.1.2.1.99":case"1.2.840.10008.1.2.5":case"1.2.840.10008.1.2.4.51":case"1.2.840.10008.1.2.4.57":case"1.2.840.10008.1.2.4.70":case"1.2.840.10008.1.2.4.80":case"1.2.840.10008.1.2.4.81":case"1.2.840.10008.1.2.4.90":case"1.2.840.10008.1.2.4.91":case"3.2.840.10008.1.2.4.96":case"1.2.840.10008.1.2.4.201":case"1.2.840.10008.1.2.4.202":case"1.2.840.10008.1.2.4.203":return ge(e,t,r,a,o);case"1.2.840.10008.1.2.4.50":return 8!==e.bitsAllocated||3!==e.samplesPerPixel&&4!==e.samplesPerPixel?ge(e,t,r,a,o):J(e,r,n)}return Promise.reject(new Error(`No decoder for transfer syntax ${t}`))};const pe=function(e){const{cornerstone:t}=xt,r=t.metaData.get("imagePixelModule",e);return{samplesPerPixel:r.samplesPerPixel,photometricInterpretation:r.photometricInterpretation,planarConfiguration:r.planarConfiguration,rows:r.rows,columns:r.columns,bitsAllocated:r.bitsAllocated,bitsStored:r.bitsStored,pixelRepresentation:r.pixelRepresentation,smallestPixelValue:r.smallestPixelValue,largestPixelValue:r.largestPixelValue,redPaletteColorLookupTableDescriptor:r.redPaletteColorLookupTableDescriptor,greenPaletteColorLookupTableDescriptor:r.greenPaletteColorLookupTableDescriptor,bluePaletteColorLookupTableDescriptor:r.bluePaletteColorLookupTableDescriptor,redPaletteColorLookupTableData:r.redPaletteColorLookupTableData,greenPaletteColorLookupTableData:r.greenPaletteColorLookupTableData,bluePaletteColorLookupTableData:r.bluePaletteColorLookupTableData,pixelData:void 0,imageId:e}};function be(e){return"RGB"===e||"PALETTE COLOR"===e||"YBR_FULL"===e||"YBR_FULL_422"===e||"YBR_PARTIAL_422"===e||"YBR_PARTIAL_420"===e||"YBR_RCT"===e||"YBR_ICT"===e}const xe={"1.2.840.10008.1.2.1":"application/octet-stream","1.2.840.10008.1.2":"application/octet-stream","1.2.840.10008.1.2.2":"application/octet-stream","1.2.840.10008.1.2.5":"image/dicom-rle"};let we="";function ye(e){const t=function(e,t){let r;return Number.isInteger(e)&&Number.isInteger(t)&&(e>=0?t<=255?r=Uint8Array:t<=65535&&(r=Uint16Array):e>=-128&&t<=127?r=Int8Array:e>=-32768&&t<=32767&&(r=Int16Array)),r||Float32Array}(e.smallestPixelValue,e.largestPixelValue);if(!t)throw new Error("Could not apply a typed array to the pixel data");{const r=new t(e.pixelData);e.pixelData=r}}const ke=function(e,t,r,n={}){const a=n.useRGBA;if(n.preScale={enabled:!(!n.preScale||void 0===n.preScale.enabled)&&n.preScale.enabled},!t?.length)return Promise.reject(new Error("The pixel data is missing"));const{cornerstone:o}=xt,{MetadataModules:i}=o.Enums,s=document.createElement("canvas"),l=pe(e);if(l.decodeLevel=n.decodeLevel,n.preScale.enabled){const t=function(e,t){const r=e.get("modalityLutModule",t)||{},n=e.get("generalSeriesModule",t)||{},{modality:a}=n,o={rescaleSlope:r.rescaleSlope,rescaleIntercept:r.rescaleIntercept,modality:a},i=e.get("scalingModule",t)||{};return{...o,..."PT"===a&&{suvbw:i.suvbw}}}(o.metaData,e);t&&(n.preScale={...n.preScale,scalingParameters:t})}n.isSharedArrayBuffer=n.targetBuffer?.arrayBuffer&&n.targetBuffer.arrayBuffer instanceof SharedArrayBuffer;const{decodeConfig:c}=F(),u=he(l,r,t,s,n,c),{use16BitDataType:d}=c,f=be(l.photometricInterpretation);return new Promise(((t,l)=>{u.then((function(l){if(n.skipCreateImage)return t(l);let c=!1;if(n.targetBuffer&&n.targetBuffer.type&&!f){const{arrayBuffer:e,type:t,offset:r=0,length:a}=n.targetBuffer,o=l.pixelDataLength,i=r,s=null!=a?a:o-i,u={Uint8Array,Uint16Array:d?Uint16Array:void 0,Int16Array:d?Int16Array:void 0,Float32Array};if(s!==l.pixelDataLength)throw new Error(`target array for image does not have the same length (${s}) as the decoded image length (${l.pixelDataLength}).`);const f=u[t],m=e?new f(e,i,s):new f(l.pixelData);if(s!==l.pixelDataLength)throw new Error("target array for image does not have the same length as the decoded image length.");l.pixelData=m,c=!0}c||ye(l);const u=o.metaData.get(i.IMAGE_PLANE,e)||{},m=o.metaData.get(i.VOI_LUT,e)||{},g=o.metaData.get(i.MODALITY_LUT,e)||{},h=o.metaData.get(i.SOP_COMMON,e)||{},p=o.metaData.get(i.CALIBRATION,e)||{};if(f){const{rows:e,columns:t}=l;if(xe[r]){s.height=l.rows,s.width=l.columns;const e=s.getContext("2d").createImageData(l.columns,l.rows);X(l,e.data,a),l.imageData=e,l.pixelData=e.data,l.pixelDataLength=e.data.length}else if(!a&&l.pixelDataLength===4*e*t){const e=new Uint8Array(l.pixelData.length/4*3);l.pixelData=function(e,t){const r=e.length/4;let n=0,a=0;for(let o=0;o<r;o++)t[a++]=e[n++],t[a++]=e[n++],t[a++]=e[n++],n++;return t}(l.pixelData,e),l.pixelDataLength=l.pixelData.length}const n=H(l.pixelData);l.smallestPixelValue=n.min,l.largestPixelValue=n.max}const b={imageId:e,color:f,calibration:p,columnPixelSpacing:u.columnPixelSpacing,columns:l.columns,height:l.rows,preScale:l.preScale,intercept:g.rescaleIntercept?g.rescaleIntercept:0,slope:g.rescaleSlope?g.rescaleSlope:1,invert:"MONOCHROME1"===l.photometricInterpretation,minPixelValue:l.smallestPixelValue,maxPixelValue:l.largestPixelValue,rowPixelSpacing:u.rowPixelSpacing,rows:l.rows,sizeInBytes:l.pixelData.byteLength,width:l.columns,windowCenter:m.windowCenter?m.windowCenter[0]:void 0,windowWidth:m.windowWidth?m.windowWidth[0]:void 0,voiLUTFunction:m.voiLUTFunction?m.voiLUTFunction:void 0,decodeTimeInMS:l.decodeTimeInMS,floatPixelData:void 0,imageFrame:l,rgba:f&&a,getPixelData:()=>l.pixelData,getCanvas:void 0,numComps:void 0};var x;if(b.color&&(b.getCanvas=function(){if(we===e)return s;const t=b.columns,r=b.rows;s.height=r,s.width=t;const n=s.getContext("2d"),a=n.createImageData(t,r),o=l.pixelData;if(o.length===t*r*4)for(let e=0;e<o.length;e++)a.data[e]=o[e];else if(o.length===t*r*3){let e=0;for(let t=0;t<o.length;t+=3)a.data[e++]=o[t],a.data[e++]=o[t+1],a.data[e++]=o[t+2],a.data[e++]=255}return l.pixelData=a.data,l.pixelDataLength=a.data.length,l.imageData=a,n.putImageData(l.imageData,0,0),we=e,s}),g.modalityLUTSequence&&g.modalityLUTSequence.length>0&&("1.2.840.10008.5.1.4.1.1.12.1"!==(x=h.sopClassUID)&&"1.2.840.10008.5.1.4.1.1.12.2.1"!==x)&&(b.modalityLUT=g.modalityLUTSequence[0]),m.voiLUTSequence&&m.voiLUTSequence.length>0&&(b.voiLUT=m.voiLUTSequence[0]),b.color&&(b.windowWidth=256,b.windowCenter=128),void 0===b.windowCenter||void 0===b.windowWidth){const e=b.imageFrame.minAfterScale,t=b.imageFrame.maxAfterScale;b.windowWidth=t-e,b.windowCenter=(t+e)/2}t(b)}),l)}))},{ProgressiveIterator:Se}=N.utilities,{ImageQualityStatus:De}=N.Enums,ve=new Set(["3.2.840.10008.1.2.4.96","1.2.840.10008.1.2.4.202","1.2.840.10008.1.2.4.203"]);function Te(e){const t="1.2.840.10008.1.2";if(!e)return t;const r=e.split(";"),n={};r.forEach((e=>{const t=e.split("=");if(2!==t.length)return;const r=t[1].trim().replace(/"/g,"");n[t[0].trim()]=r}));const a={"image/jpeg":"1.2.840.10008.1.2.4.50","image/x-dicom-rle":"1.2.840.10008.1.2.5","image/x-jls":"1.2.840.10008.1.2.4.80","image/jls":"1.2.840.10008.1.2.4.80","image/jll":"1.2.840.10008.1.2.4.70","image/jp2":"1.2.840.10008.1.2.4.90","image/jpx":"1.2.840.10008.1.2.4.92","image/jphc":"3.2.840.10008.1.2.4.96","image/jxl":"1.2.840.10008.1.2.4.140"};return n["transfer-syntax"]?n["transfer-syntax"]:e&&!Object.keys(n).length&&a[e]?a[e]:n.type&&a[n.type]?a[n.type]:a[e]?a[e]:t}function Pe(e,t=4){const r=e/100-.02;return r>1/4?Math.min(t,0):r>1/16?Math.min(t,1):r>1/64?Math.min(t,2):Math.min(t,3)}const Ie=function(e,t={}){const r=xt.cornerstone.imageRetrievalPoolManager,n=(new Date).getTime(),a=new Se("decompress"),o=t.requestType||"interaction",i=t.additionalDetails||{imageId:e},s=void 0===t.priority?5:t.priority,l=t.addToBeginning||!1,c=e.substring(7);return r.addRequest(async function(e,r,o){a.generate((async a=>{const i=Se.as(Y(e,r,o,t));let s=10;for await(const e of i){const{pixelData:o,imageQualityStatus:i=De.FULL_RESOLUTION,percentComplete:l,done:c=!0,extractDone:u=!0}=e,d=Te(e.contentType);if(!u&&!ve.has(d))continue;const f=e.decodeLevel??(i===De.FULL_RESOLUTION?0:Pe(l,t.retrieveOptions?.decodeLevel));if(c||!(s<=f))try{const e={...t,decodeLevel:f},l=await ke(r,o,d,e),u=(new Date).getTime();l.loadTimeInMS=u-n,l.transferSyntaxUID=d,l.imageQualityStatus=i,a.add(l,c),s=f}catch(e){if(u)throw console.warn("Couldn't decode",e),e}}}))}.bind(this,c,e,"multipart/related; type=application/octet-stream; transfer-syntax=*"),o,i,s,l),{promise:a.getDonePromise(),cancelFn:void 0}};const Ce={metaData:{getNumberString:s,getNumberValue:l,getNumberValues:c,getValue:i,metaDataProvider:A},findIndexOfString:M,getPixelData:Y,loadImage:Ie,metaDataManager:x,register:function(e){e.registerImageLoader("wadors",Ie),e.metaData.addProvider(A)}};function Le(e,t){if(e.elements[t]&&6===e.elements[t].length)return[e.uint16(t,0),e.uint16(t,1),e.uint16(t,2)]}function _e(e,t,r){const n=[],a=e.elements[t];for(let o=0;o<r[0];o++)16===r[2]?n[o]=e.uint16(t,o):n[o]=e.byteArray[o+a.dataOffset];return n}const Ae=function(e){const t={samplesPerPixel:e.uint16("x00280002"),photometricInterpretation:e.string("x00280004"),rows:e.uint16("x00280010"),columns:e.uint16("x00280011"),bitsAllocated:e.uint16("x00280100"),bitsStored:e.uint16("x00280101"),highBit:e.uint16("x00280102"),pixelRepresentation:e.uint16("x00280103"),planarConfiguration:e.uint16("x00280006"),pixelAspectRatio:e.string("x00280034")};return function(e,t){0===e.uint16("x00280103")?(t.smallestPixelValue=e.uint16("x00280106"),t.largestPixelValue=e.uint16("x00280107")):(t.smallestPixelValue=e.int16("x00280106"),t.largestPixelValue=e.int16("x00280107"))}(e,t),"PALETTE COLOR"===t.photometricInterpretation&&e.elements.x00281101&&function(e,t){t.redPaletteColorLookupTableDescriptor=Le(e,"x00281101"),t.greenPaletteColorLookupTableDescriptor=Le(e,"x00281102"),t.bluePaletteColorLookupTableDescriptor=Le(e,"x00281103"),0===t.redPaletteColorLookupTableDescriptor[0]&&(t.redPaletteColorLookupTableDescriptor[0]=65536,t.greenPaletteColorLookupTableDescriptor[0]=65536,t.bluePaletteColorLookupTableDescriptor[0]=65536);const r=t.redPaletteColorLookupTableDescriptor[0],n=e.elements.x00281201.length===r?8:16;t.redPaletteColorLookupTableDescriptor[2]!==n&&(t.redPaletteColorLookupTableDescriptor[2]=n,t.greenPaletteColorLookupTableDescriptor[2]=n,t.bluePaletteColorLookupTableDescriptor[2]=n),t.redPaletteColorLookupTableData=_e(e,"x00281201",t.redPaletteColorLookupTableDescriptor),t.greenPaletteColorLookupTableData=_e(e,"x00281202",t.greenPaletteColorLookupTableDescriptor),t.bluePaletteColorLookupTableData=_e(e,"x00281203",t.bluePaletteColorLookupTableDescriptor)}(e,t),t};function Ee(e,t){let r=t.uint16("x00283002",0);0===r&&(r=65535);let n=0;n=0===e?t.uint16("x00283002",1):t.int16("x00283002",1);const a={id:"1",firstValueMapped:n,numBitsPerEntry:t.uint16("x00283002",2),lut:[]};for(let n=0;n<r;n++)a.lut[n]=0===e?t.uint16("x00283006",n):t.int16("x00283006",n);return a}const Me=function(e,t){if(!t||!t.items||!t.items.length)return;const r=[];for(let n=0;n<t.items.length;n++){const a=Ee(e,t.items[n].dataSet);a&&r.push(a)}return r};const Oe=function(e){const t=e.string("x00080016");if("1.2.840.10008.5.1.4.1.1.2"===t||"1.2.840.10008.5.1.4.1.1.2.1"===t)return 1;const r=e.floatString("x00281052"),n=e.floatString("x00281053");if(void 0!==r&&void 0!==n){const t=function(e){const t=e.uint16("x00280103"),r=e.uint16("x00280101");return 0===t?0:-1<<r-1}(e);return t*n+r<0?1:0}return e.elements.x00283000&&e.elements.x00283000.length>0?0:e.uint16("x00280103")};const Re=function(e,t,r){const n=[],a=e.string(t);if(!a)return;const o=a.split("\\");if(!(r&&o.length<r)){for(let e=0;e<o.length;e++)n.push(parseFloat(o[e]));return n}};const Fe=function(e){const t=e.indexOf(":");let r=e.substring(t+1);const n=r.indexOf("frame=");let a;if(-1!==n){const e=r.substring(n+6);a=parseInt(e,10),r=r.substring(0,n-1)}return{scheme:e.substring(0,t),url:r,frame:a,pixelDataFrame:void 0!==a?a-1:void 0}};function Be(e){const{dicomParser:t}=xt;let r,n=t.parseDicom(e,{untilTag:"x7fe00010"});n.elements.x7fe00010||console.warn("Pixel data not found!");try{r=t.parseDicom(e)}catch(e){console.error(e),console.log("pixel data dataset:",e.dataSet),r=e.dataSet}return n.elements.x7fe00010=r.elements.x7fe00010,n=function(e){const t=e.elements.x7fe00010.fragments,r=e.byteArray.length;for(const e of t){const{position:t,length:n}=e;n>r-t&&(console.log(`Truncated fragment, changing fragment length from ${e.length} to ${r-t}`),e.length=r-t)}return e}(n),n}async function Ue(e,t,r){const n=Be(e),{uri:a,imageId:o,fileTotalLength:i}=r;return n.fetchMore=async function(s){const l=Object.assign({uri:a,imageId:o,fetchedLength:e.length,lengthToFetch:i-e.length},s),{fetchedLength:c,lengthToFetch:u}=l,{arrayBuffer:d}=await t(a,o,{byteRange:`${c}-${c+u}`}),f=new Uint8Array(d),m=new Uint8Array(n.byteArray.length+f.length);return m.set(n.byteArray),m.set(f,n.byteArray.length),Ue(m,t,r)},n}function Ne(e,t,r){const n={};(t?Object.values(t.items[0].dataSet.elements):[]).map((e=>n[e.tag]=e));const a={};return(e?Object.values(e.items[r-1].dataSet.elements):[]).map((e=>a[e.tag]=e)),{shared:n,perFrame:a}}function je(e){if(!e)return;const{elements:t,...r}=e,{x52009230:n,x52009229:a,...o}=t;return{NumberOfFrames:e.intString("x00280008"),PerFrameFunctionalGroupsSequence:n,SharedFunctionalGroupsSequence:a,otherElements:o,otherAttributtes:r}}function $e(e){if(Ge[e])return Ge[e]}function Ve(e){if(!e)return!1;const t=e.intString("x00280008");return t&&t>1}const We={_get:$e,generateMultiframeWADOURIs:function(e){const t=[],r=$e(e);if(Ve(r)){const n=r.intString("x00280008");for(let r=1;r<=n;r++)t.push(`${e}&frame=${r}`)}else t.push(e);return t},retrieveMultiframeDataset:function(e){const t=function(e){return e.indexOf("&frame=")}(e),r=-1===t?e:e.slice(0,t),n=parseInt(e.slice(t+7),10)||1;let a;return a=Ge[r]?Ge[r].dataSet:void 0,{dataSet:a,frame:n}},isMultiframeDataset:function(e){return Ve($e(e))}};let qe=0,Ge={},Ze={};function ze(){return{cacheSizeInBytes:qe,numberOfDataSetsCached:Object.keys(Ge).length}}const Ye={isLoaded:function(e){return void 0!==Ge[e]},load:function(e,t=B,r){const{cornerstone:n,dicomParser:a}=xt;if(Ge[e])return new Promise((t=>{Ge[e].cacheCount++,t(Ge[e].dataSet)}));if(Ze[e])return Ze[e].cacheCount++,Ze[e];const o=t(e,r),i=new Promise(((s,l)=>{o.then((async function(o){const c={isPartialContent:!1,fileTotalLength:null};if(!(o instanceof ArrayBuffer)){if(!o.arrayBuffer)return l(new Error("If not returning ArrayBuffer, must return object with `arrayBuffer` parameter"));c.isPartialContent=o.flags.isPartialContent,c.fileTotalLength=o.flags.fileTotalLength,o=o.arrayBuffer}const u=new Uint8Array(o);let d;try{d=c.isPartialContent?await Ue(u,t,{uri:e,imageId:r,fileTotalLength:c.fileTotalLength}):a.parseDicom(u)}catch(e){return l(e)}Ge[e]={dataSet:d,cacheCount:i.cacheCount},qe+=d.byteArray.length,s(d),n.triggerEvent(n.events,"datasetscachechanged",{uri:e,action:"loaded",cacheInfo:ze()})}),l).then((()=>{delete Ze[e]}),(()=>{delete Ze[e]}))}));return i.cacheCount=1,Ze[e]=i,i},unload:function(e){const{cornerstone:t}=xt;Ge[e]&&(Ge[e].cacheCount--,0===Ge[e].cacheCount&&(qe-=Ge[e].dataSet.byteArray.length,delete Ge[e],t.triggerEvent(t.events,"datasetscachechanged",{uri:e,action:"unloaded",cacheInfo:ze()})))},getInfo:ze,purge:function(){Ge={},Ze={},qe=0},get:function(e){let t;if(e.includes("&frame=")){const{frame:r,dataSet:n}=We.retrieveMultiframeDataset(e);t=function(e,t){if(!t)return;const{NumberOfFrames:r,PerFrameFunctionalGroupsSequence:n,SharedFunctionalGroupsSequence:a,otherElements:o}=je(t);if(n||r>1){const{shared:r,perFrame:i}=Ne(n,a,e),s={elements:{...o,...r,...i}},l=Object.create(t);return Object.assign(l,s)}return t}(r,n)}else Ge[e]&&(t=Ge[e].dataSet);return t},update:function(e,t){const r=Ge[e];r?(qe-=r.dataSet.byteArray.length,r.dataSet=t,qe+=t.byteArray.length,xt.cornerstone.triggerEvent(xt.cornerstone.events,"datasetscachechanged",{uri:e,action:"updated",cacheInfo:ze()})):console.error(`No loaded dataSet for uri ${e}`)}};function He(e,t){const r=e.string("x00080008");if(r){const e=r.split("\\");if(e.length>t)return e[t]}}function Qe(e){let t=Re(e,"x00200037",6);return!t&&e.elements.x00209116&&(t=Re(e.elements.x00209116.items[0].dataSet,"x00200037",6)),t||(t=function(e){let t;if(e.string("x00080060").includes("NM")){const r=He(e,2);r&&w(r)&&e.elements.x00540022&&(t=Re(e.elements.x00540022.items[0].dataSet,"x00200037",6))}return t}(e)),t}function Xe(e){let t=Re(e,"x00200032",3);return!t&&e.elements.x00209113&&(t=Re(e.elements.x00209113.items[0].dataSet,"x00200032",3)),t||(t=function(e){let t;if(e.string("x00080060").includes("NM")){const r=He(e,2);r&&w(r)&&e.elements.x00540022&&(t=Re(e.elements.x00540022.items[0].dataSet,"x00200032",3))}return t}(e)),t}function Ke(e){let t=Re(e,"x00280030",2);return!t&&e.elements.x00289110&&(t=Re(e.elements.x00289110.items[0].dataSet,"x00280030",2)),t}function Je(e){let t;return e.elements.x00180050?t=e.floatString("x00180050"):e.elements.x00289110&&e.elements.x00289110.items.length&&e.elements.x00289110.items[0].dataSet.elements.x00180050&&(t=e.elements.x00289110.items[0].dataSet.floatString("x00180050")),t}const et=function e(t,r){const{dicomParser:n}=xt;if(Array.isArray(r))return;const a=Fe(r);if("multiframeModule"===t){const e=We.retrieveMultiframeDataset(a.url);if(!e.dataSet)return;const t=function(e,t){if(!e)return;const{NumberOfFrames:r,PerFrameFunctionalGroupsSequence:n,SharedFunctionalGroupsSequence:a}=je(e);if(n||r>1){const{shared:e,perFrame:o}=Ne(n,a,t);return{NumberOfFrames:r,PerFrameFunctionalInformation:o,SharedFunctionalInformation:e}}return{NumberOfFrames:r}}(e.dataSet,e.frame);return t}let o=a.url;a.frame&&(o=`${o}&frame=${a.frame}`);const i=Ye.get(o);if(i){if("generalSeriesModule"===t)return{modality:i.string("x00080060"),seriesInstanceUID:i.string("x0020000e"),seriesNumber:i.intString("x00200011"),studyInstanceUID:i.string("x0020000d"),seriesDate:n.parseDA(i.string("x00080021")),seriesTime:n.parseTM(i.string("x00080031")||""),acquisitionDate:n.parseDA(i.string("x00080022")||""),acquisitionTime:n.parseTM(i.string("x00080032")||"")};if("patientStudyModule"===t)return{patientAge:i.intString("x00101010"),patientSize:i.floatString("x00101020"),patientWeight:i.floatString("x00101030")};if("imagePlaneModule"===t){const e=Qe(i),t=Xe(i),r=Ke(i);let n;i.elements.x00200052&&(n=i.string("x00200052"));const a=Je(i);let o;i.elements.x00201041&&(o=i.floatString("x00201041"));let s=null,l=null;r&&(l=r[0],s=r[1]);let c=null,u=null;return e&&(c=[parseFloat(e[0]),parseFloat(e[1]),parseFloat(e[2])],u=[parseFloat(e[3]),parseFloat(e[4]),parseFloat(e[5])]),{frameOfReferenceUID:n,rows:i.uint16("x00280010"),columns:i.uint16("x00280011"),imageOrientationPatient:e,rowCosines:c,columnCosines:u,imagePositionPatient:t,sliceThickness:a,sliceLocation:o,pixelSpacing:r,rowPixelSpacing:l,columnPixelSpacing:s}}if("nmMultiframeGeometryModule"===t){const e=i.string("x00080060"),t=He(i,2);return{modality:e,imageType:i.string("x00080008"),imageSubType:t,imageOrientationPatient:Qe(i),imagePositionPatient:Xe(i),sliceThickness:Je(i),pixelSpacing:Ke(i),numberOfFrames:i.uint16("x00280008"),isNMReconstructable:w(t)&&e.includes("NM")}}if("imagePixelModule"===t)return Ae(i);if("modalityLutModule"===t)return{rescaleIntercept:i.floatString("x00281052"),rescaleSlope:i.floatString("x00281053"),rescaleType:i.string("x00281054"),modalityLUTSequence:Me(i.uint16("x00280103"),i.elements.x00283000)};if("voiLutModule"===t){const e=Oe(i);return{windowCenter:Re(i,"x00281050",1),windowWidth:Re(i,"x00281051",1),voiLUTSequence:Me(e,i.elements.x00283010)}}if("sopCommonModule"===t)return{sopClassUID:i.string("x00080016"),sopInstanceUID:i.string("x00080018")};if("petIsotopeModule"===t){const e=i.elements.x00540016;if(void 0===e)return;const t=e.items[0].dataSet;return{radiopharmaceuticalInfo:{radiopharmaceuticalStartTime:n.parseTM(t.string("x00181072")||""),radionuclideTotalDose:t.floatString("x00181074"),radionuclideHalfLife:t.floatString("x00181075")}}}return"overlayPlaneModule"===t?function(e){const t=[];for(let r=0;r<=30;r+=2){let n=`x60${r.toString(16)}`;4===n.length&&(n=`x600${r.toString(16)}`);const a=e.elements[`${n}3000`];if(!a)continue;const o=[];for(let t=0;t<a.length;t++)for(let r=0;r<8;r++){const n=e.byteArray[a.dataOffset+t];o[8*t+r]=n>>r&1}t.push({rows:e.uint16(`${n}0010`),columns:e.uint16(`${n}0011`),type:e.string(`${n}0040`),x:e.int16(`${n}0050`,1)-1,y:e.int16(`${n}0050`,0)-1,pixelData:o,description:e.string(`${n}0022`),label:e.string(`${n}1500`),roiArea:e.string(`${n}1301`),roiMean:e.string(`${n}1302`),roiStandardDeviation:e.string(`${n}1303`)})}return{overlays:t}}(i):"transferSyntax"===t?{transferSyntaxUID:i.string("x00020010")}:"petSeriesModule"===t?{correctedImage:i.string("x00280051"),units:i.string("x00541001"),decayCorrection:i.string("x00541102")}:"petImageModule"===t?{frameReferenceTime:i.floatString(i.string("x00541300")||""),actualFrameDuration:i.intString(i.string("x00181242"))}:"instance"===t?v(r,e,P):void 0}};let tt=[];const rt={add:function(e){return"dicomfile:"+(tt.push(e)-1)},get:function(e){return tt[e]},remove:function(e){tt[e]=void 0},purge:function(){tt=[]}};var nt=a(713);function at(e,t){const{dicomParser:r}=xt;if(e.elements.x7fe00010&&e.elements.x7fe00010.basicOffsetTable.length)return r.readEncapsulatedImageFrame(e,e.elements.x7fe00010,t);if(function(e){return e.intString("x00280008")!==e.elements.x7fe00010.fragments.length}(e)){const n=r.createJPEGBasicOffsetTable(e,e.elements.x7fe00010);return r.readEncapsulatedImageFrame(e,e.elements.x7fe00010,t,n)}const n=e.elements.x7fe00010.fragments,a=new nt.ByteStream(e.byteArrayParser,e.byteArray,e.elements.x7fe00010.dataOffset),o=(0,nt.readSequenceItem)(a);if("xfffee000"!==o.tag)throw"dicomParser.readEncapsulatedPixelData: missing basic offset table xfffee000";a.seek(o.length);const i=a.position;if(t+1>n.length)throw"dicomParser.readEncapsulatedPixelData: frame exceeds number of fragments";const s=i+n[t].offset+8,l=n[t].length;return new Uint8Array(a.byteArray.buffer.slice(a.byteArray.byteOffset+s,a.byteArray.byteOffset+s+l))}function ot(e,t){return e&1<<t}const it=function(e,t,r){const n=new Uint8Array(r);for(let a=0;a<r;a++){const r=e[Math.floor(a/8)+t],o=a%8;n[a]=ot(r,o)?1:0}return n};const st=function(e,t){const r=e.elements.x7fe00010||e.elements.x7fe00008,n=e.uint16("x00280100"),a=e.uint16("x00280010"),o=e.uint16("x00280011");let i=e.uint16("x00280002");"YBR_FULL_422"===e.string("x00280004")&&(i=2,console.warn("Using SamplesPerPixel of 2 for YBR_FULL_422 photometric interpretation.\n See http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.7.6.3.html for more information."));const s=r.dataOffset,l=a*o*i;let c;if(8===n){if(c=s+t*l,c>=e.byteArray.length)throw new Error("frame exceeds size of pixelData");return new Uint8Array(e.byteArray.buffer.slice(c,c+l))}if(16===n){if(c=s+t*l*2,c>=e.byteArray.length)throw new Error("frame exceeds size of pixelData");return new Uint8Array(e.byteArray.buffer.slice(c,c+2*l))}if(1===n){if(c=s+t*l*.125,c>=e.byteArray.length)throw new Error("frame exceeds size of pixelData");return it(e.byteArray,c,l)}if(32===n){if(c=s+t*l*4,c>=e.byteArray.length)throw new Error("frame exceeds size of pixelData");return new Uint8Array(e.byteArray.buffer.slice(c,c+4*l))}throw new Error("unsupported pixel format")};const lt=function(e){const t=Fe(e),r=parseInt(t.url,10),n=rt.get(r);return new Promise(((e,t)=>{const r=new FileReader;r.onload=t=>{const r=t.target.result;e(r)},r.onerror=t,r.readAsArrayBuffer(n)}))};const ct=function(e,t=0){const r=e.elements.x7fe00010||e.elements.x7fe00008;return r?r.encapsulatedPixelData?at(e,t):st(e,t):null};function ut(e,t,r=0,n,a,o){const i=(new Date).getTime(),s={cancelFn:void 0,promise:void 0};return s.promise=new Promise(((l,c)=>{e.then((e=>{const u=ct(e,r),d=e.string("x00020010"),f=(new Date).getTime(),m=ke(t,u,d,a);!function(e,t){e.decache=function(){const e=Fe(t);Ye.unload(e.url)}}(s,t),m.then((t=>{t.data=e,t.sharedCacheKey=n;const r=(new Date).getTime();t.loadTimeInMS=f-i,t.totalTimeInMS=r-i,void 0!==o&&void 0!==o.imageDoneCallback&&o.imageDoneCallback(t),l(t)}),(function(t){c({error:t,dataSet:e})}))}),(function(e){c({error:e})}))})),s}function dt(e){return"dicomweb"===e||"wadouri"===e?B:"dicomfile"===e?lt:void 0}function ft(e,t={}){const r=Fe(e);delete(t=Object.assign({},t)).loader;const n=dt(r.scheme);if(Ye.isLoaded(r.url)){return function(e,t,r=0,n,a){const o=(new Date).getTime();return{promise:new Promise(((i,s)=>{const l=(new Date).getTime();let c;try{const n=ct(e,r),o=e.string("x00020010");c=ke(t,n,o,a)}catch(t){return void s({error:t,dataSet:e})}c.then((t=>{t.data=e,t.sharedCacheKey=n;const r=(new Date).getTime();t.loadTimeInMS=l-o,t.totalTimeInMS=r-o,i(t)}),s)})),cancelFn:void 0}}(Ye.get(r.url,n,e),e,r.pixelDataFrame,r.url,t)}return ut(Ye.load(r.url,n,e),e,r.frame,r.url,t)}const mt={metaData:{getImagePixelModule:Ae,getLUTs:Me,getModalityLUTOutputPixelRepresentation:Oe,getNumberValues:Re,metaDataProvider:et},dataSetCacheManager:Ye,fileManager:rt,getEncapsulatedImageFrame:at,getUncompressedImageFrame:st,loadFileRequest:lt,loadImageFromPromise:ut,getLoaderForScheme:dt,loadImage:ft,parseImageId:Fe,unpackBinaryFrame:it,register:function(e){e.registerImageLoader("dicomweb",ft),e.registerImageLoader("wadouri",ft),e.registerImageLoader("dicomfile",ft),e.metaData.addProvider(et)}};const gt=function(e){Ce.register(e),mt.register(e)};let ht,pt;const bt={set cornerstone(e){ht=e,gt(ht)},get cornerstone(){if(!ht){if(ht=window&&window.cornerstone,!ht)throw new Error("cornerstoneDICOMImageLoader requires a copy of Cornerstone to work properly. Please add cornerstoneDICOMImageLoader.external.cornerstone = cornerstone; to your application.");gt(ht)}return ht},set dicomParser(e){pt=e},get dicomParser(){if(!pt){if(!window||!window.dicomParser)throw new Error("cornerstoneDICOMImageLoader requires a copy of dicomParser to work properly. Please add cornerstoneDICOMImageLoader.external.dicomParser = dicomParser; to your application.");pt=window.dicomParser}return pt}},xt=bt;function wt(e,t){const r=e.length,n=new Uint8ClampedArray(r);for(let a=0;a<r;++a)n[a]=e[a]>>t;return n}function yt(e,t,r){const n=e.columns*e.rows,a=e.pixelData;let o=e.redPaletteColorLookupTableData;o||(o=xt.cornerstone.metaData.get("imagePixelModule",e.imageId)?.redPaletteColorLookupTableData);let i=e.greenPaletteColorLookupTableData;i||(i=xt.cornerstone.metaData.get("imagePixelModule",e.imageId)?.greenPaletteColorLookupTableData);let s=e.bluePaletteColorLookupTableData;if(s||(s=xt.cornerstone.metaData.get("imagePixelModule",e.imageId)?.bluePaletteColorLookupTableData),!o||!i||!s)throw new Error("The image does not have a complete color palette. R, G, and B palette data are required.");const l=e.redPaletteColorLookupTableData.length;let c=0,u=0;const d=e.redPaletteColorLookupTableDescriptor[1],f=8===e.redPaletteColorLookupTableDescriptor[2]?0:8,m=wt(o,f),g=wt(i,f),h=wt(s,f);if(r)for(let e=0;e<n;++e){let e=a[c++];e<d?e=0:e>d+l-1?e=l-1:e-=d,t[u++]=m[e],t[u++]=g[e],t[u++]=h[e],t[u++]=255}else for(let e=0;e<n;++e){let e=a[c++];e<d?e=0:e>d+l-1?e=l-1:e-=d,t[u++]=m[e],t[u++]=g[e],t[u++]=h[e]}}const kt=function(e){R(e)};const St=function(e,t){if(t=t||e.transferSyntax,8===e.bitsAllocated&&"1.2.840.10008.1.2.4.50"===t&&(3===e.samplesPerPixel||4===e.samplesPerPixel))return!0},Dt={convertRGBColorByPixel:e,convertRGBColorByPlane:t,convertYBRFullByPixel:r,convertYBRFullByPlane:n,convertPALETTECOLOR:yt,wadouri:mt,wadors:Ce,configure:kt,convertColorSpace:X,createImage:ke,decodeImageFrame:he,decodeJPEGBaseline8BitColor:J,getImageFrame:pe,getPixelData:Y,getMinMax:H,isColorImage:be,isJPEGBaseline8BitColor:St,webWorkerManager:fe,internal:U,external:bt}})(),o})()));
|
|
118486
118632
|
|
|
118487
118633
|
|
|
118488
118634
|
/***/ }),
|
|
@@ -119168,8 +119314,8 @@ __webpack_require__.d(synchronizers_namespaceObject, {
|
|
|
119168
119314
|
var types_namespaceObject = {};
|
|
119169
119315
|
__webpack_require__.r(types_namespaceObject);
|
|
119170
119316
|
|
|
119171
|
-
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js +
|
|
119172
|
-
var esm = __webpack_require__(
|
|
119317
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 376 modules
|
|
119318
|
+
var esm = __webpack_require__(64225);
|
|
119173
119319
|
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/enums/ToolBindings.js
|
|
119174
119320
|
var MouseBindings;
|
|
119175
119321
|
(function (MouseBindings) {
|
|
@@ -125681,7 +125827,7 @@ function filterAnnotationsForDisplay(viewport, annotations) {
|
|
|
125681
125827
|
if (Array.isArray(range)) {
|
|
125682
125828
|
return frameNumber >= range[0] && frameNumber <= range[1];
|
|
125683
125829
|
}
|
|
125684
|
-
return Math.abs(frameNumber - range)
|
|
125830
|
+
return Math.abs(frameNumber - range) < 1;
|
|
125685
125831
|
});
|
|
125686
125832
|
}
|
|
125687
125833
|
else if (viewport instanceof esm.VolumeViewport) {
|
|
@@ -126263,7 +126409,7 @@ class BaseTool {
|
|
|
126263
126409
|
return viewports[0].getImageData();
|
|
126264
126410
|
}
|
|
126265
126411
|
else if (targetId.startsWith('volumeId:')) {
|
|
126266
|
-
const volumeId = targetId.split(
|
|
126412
|
+
const volumeId = targetId.split(/volumeId:|\?/)[1];
|
|
126267
126413
|
const viewports = esm.utilities.getViewportsWithVolumeId(volumeId, renderingEngine.id);
|
|
126268
126414
|
if (!viewports || !viewports.length) {
|
|
126269
126415
|
return;
|
|
@@ -126283,18 +126429,14 @@ class BaseTool {
|
|
|
126283
126429
|
}
|
|
126284
126430
|
}
|
|
126285
126431
|
getTargetId(viewport) {
|
|
126286
|
-
|
|
126287
|
-
|
|
126432
|
+
const targetId = viewport.getTargetId?.();
|
|
126433
|
+
if (targetId) {
|
|
126434
|
+
return targetId;
|
|
126288
126435
|
}
|
|
126289
|
-
|
|
126436
|
+
if (viewport instanceof esm.BaseVolumeViewport) {
|
|
126290
126437
|
return `volumeId:${this.getTargetVolumeId(viewport)}`;
|
|
126291
126438
|
}
|
|
126292
|
-
|
|
126293
|
-
return `videoId:${viewport.getCurrentImageId()}`;
|
|
126294
|
-
}
|
|
126295
|
-
else {
|
|
126296
|
-
throw new Error('getTargetId: viewport must be a StackViewport or VolumeViewport');
|
|
126297
|
-
}
|
|
126439
|
+
throw new Error('getTargetId: viewport must have a getTargetId method');
|
|
126298
126440
|
}
|
|
126299
126441
|
}
|
|
126300
126442
|
BaseTool.toolName = 'BaseTool';
|
|
@@ -126548,7 +126690,7 @@ class AnnotationDisplayTool extends base_BaseTool {
|
|
|
126548
126690
|
referencedImageId = targetId.split('videoId:')[1];
|
|
126549
126691
|
}
|
|
126550
126692
|
else {
|
|
126551
|
-
const volumeId = targetId.split(
|
|
126693
|
+
const volumeId = targetId.split(/volumeId:|\?/)[1];
|
|
126552
126694
|
const imageVolume = esm.cache.getVolume(volumeId);
|
|
126553
126695
|
referencedImageId = esm.utilities.getClosestImageId(imageVolume, worldPos, viewPlaneNormal);
|
|
126554
126696
|
}
|
|
@@ -126656,7 +126798,7 @@ class AnnotationTool extends base_AnnotationDisplayTool {
|
|
|
126656
126798
|
}
|
|
126657
126799
|
isSuvScaled(viewport, targetId, imageId) {
|
|
126658
126800
|
if (viewport instanceof esm.BaseVolumeViewport) {
|
|
126659
|
-
const volumeId = targetId.split(
|
|
126801
|
+
const volumeId = targetId.split(/volumeId:|\?/)[1];
|
|
126660
126802
|
const volume = esm.cache.getVolume(volumeId);
|
|
126661
126803
|
return volume.scaling?.PT !== undefined;
|
|
126662
126804
|
}
|
|
@@ -126900,7 +127042,7 @@ class WindowLevelTool extends base_BaseTool {
|
|
|
126900
127042
|
const properties = viewport.getProperties();
|
|
126901
127043
|
if (viewport instanceof esm.VolumeViewport) {
|
|
126902
127044
|
const targetId = this.getTargetId(viewport);
|
|
126903
|
-
volumeId = targetId.split(
|
|
127045
|
+
volumeId = targetId.split(/volumeId:|\?/)[1];
|
|
126904
127046
|
viewportsContainingVolumeUID = esm.utilities.getViewportsWithVolumeId(volumeId, renderingEngine.id);
|
|
126905
127047
|
({ lower, upper } = properties.voiRange);
|
|
126906
127048
|
const volume = esm.cache.getVolume(volumeId);
|
|
@@ -127071,7 +127213,7 @@ class StackScrollTool extends base_BaseTool {
|
|
|
127071
127213
|
const deltaPointY = deltaPoints.canvas[1];
|
|
127072
127214
|
let volumeId;
|
|
127073
127215
|
if (viewport instanceof esm.VolumeViewport) {
|
|
127074
|
-
volumeId = targetId.split(
|
|
127216
|
+
volumeId = targetId.split(/volumeId:|\?/)[1];
|
|
127075
127217
|
}
|
|
127076
127218
|
const pixelsPerImage = this._getPixelPerImage(viewport);
|
|
127077
127219
|
const deltaY = deltaPointY + this.deltaY;
|
|
@@ -127208,7 +127350,7 @@ class StackScrollMouseWheelTool extends base_BaseTool {
|
|
|
127208
127350
|
const { viewport } = (0,esm.getEnabledElement)(element);
|
|
127209
127351
|
const delta = direction * (invert ? -1 : 1);
|
|
127210
127352
|
const targetId = this.getTargetId(viewport);
|
|
127211
|
-
const volumeId = targetId.split(
|
|
127353
|
+
const volumeId = targetId.split(/volumeId:|\?/)[1];
|
|
127212
127354
|
scroll_scroll(viewport, {
|
|
127213
127355
|
delta,
|
|
127214
127356
|
debounceLoading: this.configuration.debounceIfNotLoaded,
|
|
@@ -127514,7 +127656,7 @@ class MIPJumpToClickTool extends base_BaseTool {
|
|
|
127514
127656
|
if (!targetId.startsWith('volumeId')) {
|
|
127515
127657
|
throw new Error(`MIPJumpToClickTool: targetId is not a volumeId, you should only use MIPJumpToClickTool with a volumeId as the targetId`);
|
|
127516
127658
|
}
|
|
127517
|
-
const volumeId = targetId.split(
|
|
127659
|
+
const volumeId = targetId.split(/volumeId:|\?/)[1];
|
|
127518
127660
|
let maxIntensity = -Infinity;
|
|
127519
127661
|
const maxFn = (intensity, point) => {
|
|
127520
127662
|
if (intensity > maxIntensity) {
|
|
@@ -130863,6 +131005,9 @@ class ReferenceLines extends base_AnnotationDisplayTool {
|
|
|
130863
131005
|
if (this.configuration.showFullDimension) {
|
|
130864
131006
|
canvasCoordinates = this.handleFullDimension(targetViewport, lineStartWorld, viewPlaneNormal, viewUp, lineEndWorld, canvasCoordinates);
|
|
130865
131007
|
}
|
|
131008
|
+
if (canvasCoordinates.length < 2) {
|
|
131009
|
+
return renderStatus;
|
|
131010
|
+
}
|
|
130866
131011
|
const dataId = `${annotationUID}-line`;
|
|
130867
131012
|
const lineUID = '1';
|
|
130868
131013
|
drawLine(svgDrawingHelper, annotationUID, lineUID, canvasCoordinates[0], canvasCoordinates[1], {
|
|
@@ -133217,7 +133362,9 @@ function _handlePTModality(imageId, options) {
|
|
|
133217
133362
|
function isViewportPreScaled(viewport, targetId) {
|
|
133218
133363
|
if (viewport instanceof esm.BaseVolumeViewport) {
|
|
133219
133364
|
const targetIdTokens = targetId.split('volumeId:');
|
|
133220
|
-
const volumeId = targetIdTokens.length > 1
|
|
133365
|
+
const volumeId = targetIdTokens.length > 1
|
|
133366
|
+
? targetIdTokens[1].split('?')[0]
|
|
133367
|
+
: targetIdTokens[0];
|
|
133221
133368
|
const volume = esm.cache.getVolume(volumeId);
|
|
133222
133369
|
return !!volume?.scaling && Object.keys(volume.scaling).length > 0;
|
|
133223
133370
|
}
|
|
@@ -135056,7 +135203,6 @@ class CircleROITool extends base_AnnotationTool {
|
|
|
135056
135203
|
const eventDetail = evt.detail;
|
|
135057
135204
|
const { currentPoints, element } = eventDetail;
|
|
135058
135205
|
const worldPos = currentPoints.world;
|
|
135059
|
-
const canvasPos = currentPoints.canvas;
|
|
135060
135206
|
const enabledElement = (0,esm.getEnabledElement)(element);
|
|
135061
135207
|
const { viewport, renderingEngine } = enabledElement;
|
|
135062
135208
|
this.isDrawing = true;
|
|
@@ -135591,7 +135737,7 @@ class CircleROITool extends base_AnnotationTool {
|
|
|
135591
135737
|
}
|
|
135592
135738
|
function CircleROITool_defaultGetTextLines(data, targetId) {
|
|
135593
135739
|
const cachedVolumeStats = data.cachedStats[targetId];
|
|
135594
|
-
const { radius, radiusUnit, area, mean, stdDev, max, isEmptyArea,
|
|
135740
|
+
const { radius, radiusUnit, area, mean, stdDev, max, isEmptyArea, areaUnit, modalityUnit, } = cachedVolumeStats;
|
|
135595
135741
|
const textLines = [];
|
|
135596
135742
|
if (radius) {
|
|
135597
135743
|
const radiusLine = isEmptyArea
|
|
@@ -139343,18 +139489,6 @@ class LivewireScissors {
|
|
|
139343
139489
|
}
|
|
139344
139490
|
return new LivewireScissors(grayscalePixelData, width, height);
|
|
139345
139491
|
}
|
|
139346
|
-
static createInstanceFromRGBAPixelData(rgbaPixelData, width, height) {
|
|
139347
|
-
const numPixels = rgbaPixelData.length / 4;
|
|
139348
|
-
const grayscalePixelData = new Float32Array(numPixels);
|
|
139349
|
-
const avgMultiplier = 1 / (3 * 255);
|
|
139350
|
-
for (let i = 0, offset = 0; i < numPixels; i++, offset += 4) {
|
|
139351
|
-
const red = rgbaPixelData[offset];
|
|
139352
|
-
const green = rgbaPixelData[offset];
|
|
139353
|
-
const blue = rgbaPixelData[offset];
|
|
139354
|
-
grayscalePixelData[i] = (red + green + blue) * avgMultiplier;
|
|
139355
|
-
}
|
|
139356
|
-
return new LivewireScissors(grayscalePixelData, width, height);
|
|
139357
|
-
}
|
|
139358
139492
|
}
|
|
139359
139493
|
|
|
139360
139494
|
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/livewire/LiveWirePath.js
|
|
@@ -139687,18 +139821,14 @@ class LivewireContourTool extends ContourSegmentationBaseTool {
|
|
|
139687
139821
|
const { viewport, renderingEngine } = enabledElement;
|
|
139688
139822
|
this.isDrawing = true;
|
|
139689
139823
|
const defaultActor = viewport.getDefaultActor();
|
|
139690
|
-
if (!defaultActor || !esm.utilities.isImageActor(defaultActor)) {
|
|
139691
|
-
throw new Error('Default actor must be an image actor');
|
|
139692
|
-
}
|
|
139693
139824
|
const viewportImageData = viewport.getImageData();
|
|
139694
139825
|
const { imageData: vtkImageData } = viewportImageData;
|
|
139695
139826
|
let worldToSlice;
|
|
139696
139827
|
let sliceToWorld;
|
|
139697
|
-
let scalarData;
|
|
139828
|
+
let { scalarData } = viewportImageData;
|
|
139698
139829
|
let width;
|
|
139699
139830
|
let height;
|
|
139700
|
-
if (viewport instanceof esm.
|
|
139701
|
-
scalarData = viewportImageData.scalarData;
|
|
139831
|
+
if (!(viewport instanceof esm.VolumeViewport) && scalarData) {
|
|
139702
139832
|
width = viewportImageData.dimensions[0];
|
|
139703
139833
|
height = viewportImageData.dimensions[1];
|
|
139704
139834
|
worldToSlice = (point) => {
|
|
@@ -139726,6 +139856,7 @@ class LivewireContourTool extends ContourSegmentationBaseTool {
|
|
|
139726
139856
|
else {
|
|
139727
139857
|
throw new Error('Viewport not supported');
|
|
139728
139858
|
}
|
|
139859
|
+
scalarData = esm.utilities.convertToGrayscale(scalarData, width, height);
|
|
139729
139860
|
const { voiRange } = viewport.getProperties();
|
|
139730
139861
|
const startPos = worldToSlice(worldPos);
|
|
139731
139862
|
this.scissors = LivewireScissors.createInstanceFromRawPixelData(scalarData, width, height, voiRange);
|
|
@@ -143787,7 +143918,7 @@ class RectangleROIThresholdTool extends annotation_RectangleROITool {
|
|
|
143787
143918
|
referencedImageId = targetId.split('imageId:')[1];
|
|
143788
143919
|
}
|
|
143789
143920
|
else {
|
|
143790
|
-
volumeId = targetId.split(
|
|
143921
|
+
volumeId = targetId.split(/volumeId:|\?/)[1];
|
|
143791
143922
|
const imageVolume = esm.cache.getVolume(volumeId);
|
|
143792
143923
|
referencedImageId = esm.utilities.getClosestImageId(imageVolume, worldPos, viewPlaneNormal);
|
|
143793
143924
|
}
|
|
@@ -143941,7 +144072,7 @@ class RectangleROIStartEndThresholdTool extends annotation_RectangleROITool {
|
|
|
143941
144072
|
}
|
|
143942
144073
|
else {
|
|
143943
144074
|
const targetId = this.getTargetId(viewport);
|
|
143944
|
-
volumeId = targetId.split(
|
|
144075
|
+
volumeId = targetId.split(/volumeId:|\?/)[1];
|
|
143945
144076
|
imageVolume = esm.cache.getVolume(volumeId);
|
|
143946
144077
|
referencedImageId = esm.utilities.getClosestImageId(imageVolume, worldPos, viewPlaneNormal);
|
|
143947
144078
|
}
|
|
@@ -144112,8 +144243,8 @@ class RectangleROIStartEndThresholdTool extends annotation_RectangleROITool {
|
|
|
144112
144243
|
const data = annotation.data;
|
|
144113
144244
|
const { viewportId, renderingEngineId, viewport } = enabledElement;
|
|
144114
144245
|
const { cachedStats } = data;
|
|
144115
|
-
const
|
|
144116
|
-
const imageVolume = esm.cache.getVolume(
|
|
144246
|
+
const targetId = this.getTargetId(viewport);
|
|
144247
|
+
const imageVolume = esm.cache.getVolume(targetId.split(/volumeId:|\?/)[1]);
|
|
144117
144248
|
this._computeProjectionPoints(annotation, imageVolume);
|
|
144118
144249
|
annotation.invalidated = false;
|
|
144119
144250
|
const eventType = enums_Events.ANNOTATION_MODIFIED;
|
|
@@ -177447,16 +177578,16 @@ vtk.register = register;
|
|
|
177447
177578
|
/* harmony export */ WK: () => (/* binding */ isRouteErrorResponse),
|
|
177448
177579
|
/* harmony export */ X3: () => (/* binding */ AbortedDeferredError),
|
|
177449
177580
|
/* harmony export */ Zn: () => (/* binding */ stripBasename),
|
|
177450
|
-
/* harmony export */ Zq: () => (/* binding */ getPathContributingMatches),
|
|
177451
177581
|
/* harmony export */ aU: () => (/* binding */ Action),
|
|
177452
177582
|
/* harmony export */ cP: () => (/* binding */ parsePath),
|
|
177583
|
+
/* harmony export */ cm: () => (/* binding */ getResolveToMatches),
|
|
177453
177584
|
/* harmony export */ fp: () => (/* binding */ matchRoutes),
|
|
177454
177585
|
/* harmony export */ lX: () => (/* binding */ createBrowserHistory),
|
|
177455
177586
|
/* harmony export */ pC: () => (/* binding */ resolveTo)
|
|
177456
177587
|
/* harmony export */ });
|
|
177457
177588
|
/* unused harmony exports IDLE_BLOCKER, IDLE_FETCHER, IDLE_NAVIGATION, UNSAFE_DEFERRED_SYMBOL, UNSAFE_DeferredData, UNSAFE_ErrorResponseImpl, UNSAFE_convertRouteMatchToUiMatch, UNSAFE_convertRoutesToDataRoutes, UNSAFE_warning, createHashHistory, createMemoryHistory, createRouter, createStaticHandler, defer, generatePath, getStaticContextFromError, getToPathname, isDeferredData, json, matchPath, normalizePathname, redirect, redirectDocument, resolvePath */
|
|
177458
177589
|
/**
|
|
177459
|
-
* @remix-run/router v1.
|
|
177590
|
+
* @remix-run/router v1.14.2
|
|
177460
177591
|
*
|
|
177461
177592
|
* Copyright (c) Remix Software Inc.
|
|
177462
177593
|
*
|
|
@@ -178110,7 +178241,7 @@ function rankRouteBranches(branches) {
|
|
|
178110
178241
|
branches.sort((a, b) => a.score !== b.score ? b.score - a.score // Higher score first
|
|
178111
178242
|
: compareIndexes(a.routesMeta.map(meta => meta.childrenIndex), b.routesMeta.map(meta => meta.childrenIndex)));
|
|
178112
178243
|
}
|
|
178113
|
-
const paramRe =
|
|
178244
|
+
const paramRe = /^:[\w-]+$/;
|
|
178114
178245
|
const dynamicSegmentValue = 3;
|
|
178115
178246
|
const indexRouteValue = 2;
|
|
178116
178247
|
const emptySegmentValue = 1;
|
|
@@ -178197,7 +178328,7 @@ function generatePath(originalPath, params) {
|
|
|
178197
178328
|
// Apply the splat
|
|
178198
178329
|
return stringify(params[star]);
|
|
178199
178330
|
}
|
|
178200
|
-
const keyMatch = segment.match(/^:(\w+)(\??)$/);
|
|
178331
|
+
const keyMatch = segment.match(/^:([\w-]+)(\??)$/);
|
|
178201
178332
|
if (keyMatch) {
|
|
178202
178333
|
const [, key, optional] = keyMatch;
|
|
178203
178334
|
let param = params[key];
|
|
@@ -178269,7 +178400,7 @@ function compilePath(path, caseSensitive, end) {
|
|
|
178269
178400
|
let regexpSource = "^" + path.replace(/\/*\*?$/, "") // Ignore trailing / and /*, we'll handle it below
|
|
178270
178401
|
.replace(/^\/*/, "/") // Make sure it has a leading /
|
|
178271
178402
|
.replace(/[\\.*+^${}|()[\]]/g, "\\$&") // Escape special regex chars
|
|
178272
|
-
.replace(/\/:(\w+)(\?)?/g, (_, paramName, isOptional) => {
|
|
178403
|
+
.replace(/\/:([\w-]+)(\?)?/g, (_, paramName, isOptional) => {
|
|
178273
178404
|
params.push({
|
|
178274
178405
|
paramName,
|
|
178275
178406
|
isOptional: isOptional != null
|
|
@@ -178395,6 +178526,18 @@ function getInvalidPathError(char, field, dest, path) {
|
|
|
178395
178526
|
function getPathContributingMatches(matches) {
|
|
178396
178527
|
return matches.filter((match, index) => index === 0 || match.route.path && match.route.path.length > 0);
|
|
178397
178528
|
}
|
|
178529
|
+
// Return the array of pathnames for the current route matches - used to
|
|
178530
|
+
// generate the routePathnames input for resolveTo()
|
|
178531
|
+
function getResolveToMatches(matches, v7_relativeSplatPath) {
|
|
178532
|
+
let pathMatches = getPathContributingMatches(matches);
|
|
178533
|
+
// When v7_relativeSplatPath is enabled, use the full pathname for the leaf
|
|
178534
|
+
// match so we include splat values for "." links. See:
|
|
178535
|
+
// https://github.com/remix-run/react-router/issues/11052#issuecomment-1836589329
|
|
178536
|
+
if (v7_relativeSplatPath) {
|
|
178537
|
+
return pathMatches.map((match, idx) => idx === matches.length - 1 ? match.pathname : match.pathnameBase);
|
|
178538
|
+
}
|
|
178539
|
+
return pathMatches.map(match => match.pathnameBase);
|
|
178540
|
+
}
|
|
178398
178541
|
/**
|
|
178399
178542
|
* @private
|
|
178400
178543
|
*/
|
|
@@ -178425,34 +178568,20 @@ function resolveTo(toArg, routePathnames, locationPathname, isPathRelative) {
|
|
|
178425
178568
|
// to the current location's pathname and *not* the route pathname.
|
|
178426
178569
|
if (toPathname == null) {
|
|
178427
178570
|
from = locationPathname;
|
|
178428
|
-
} else if (isPathRelative) {
|
|
178429
|
-
let fromSegments = routePathnames[routePathnames.length - 1].replace(/^\//, "").split("/");
|
|
178430
|
-
if (toPathname.startsWith("..")) {
|
|
178431
|
-
let toSegments = toPathname.split("/");
|
|
178432
|
-
// With relative="path", each leading .. segment means "go up one URL segment"
|
|
178433
|
-
while (toSegments[0] === "..") {
|
|
178434
|
-
toSegments.shift();
|
|
178435
|
-
fromSegments.pop();
|
|
178436
|
-
}
|
|
178437
|
-
to.pathname = toSegments.join("/");
|
|
178438
|
-
}
|
|
178439
|
-
from = "/" + fromSegments.join("/");
|
|
178440
178571
|
} else {
|
|
178441
178572
|
let routePathnameIndex = routePathnames.length - 1;
|
|
178442
|
-
|
|
178573
|
+
// With relative="route" (the default), each leading .. segment means
|
|
178574
|
+
// "go up one route" instead of "go up one URL segment". This is a key
|
|
178575
|
+
// difference from how <a href> works and a major reason we call this a
|
|
178576
|
+
// "to" value instead of a "href".
|
|
178577
|
+
if (!isPathRelative && toPathname.startsWith("..")) {
|
|
178443
178578
|
let toSegments = toPathname.split("/");
|
|
178444
|
-
// With relative="route" (the default), each leading .. segment means
|
|
178445
|
-
// "go up one route" instead of "go up one URL segment". This is a key
|
|
178446
|
-
// difference from how <a href> works and a major reason we call this a
|
|
178447
|
-
// "to" value instead of a "href".
|
|
178448
178579
|
while (toSegments[0] === "..") {
|
|
178449
178580
|
toSegments.shift();
|
|
178450
178581
|
routePathnameIndex -= 1;
|
|
178451
178582
|
}
|
|
178452
178583
|
to.pathname = toSegments.join("/");
|
|
178453
178584
|
}
|
|
178454
|
-
// If there are more ".." segments than parent routes, resolve relative to
|
|
178455
|
-
// the root / URL.
|
|
178456
178585
|
from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : "/";
|
|
178457
178586
|
}
|
|
178458
178587
|
let path = resolvePath(to, from);
|
|
@@ -178787,7 +178916,9 @@ function createRouter(init) {
|
|
|
178787
178916
|
let future = _extends({
|
|
178788
178917
|
v7_fetcherPersist: false,
|
|
178789
178918
|
v7_normalizeFormMethod: false,
|
|
178790
|
-
|
|
178919
|
+
v7_partialHydration: false,
|
|
178920
|
+
v7_prependBasename: false,
|
|
178921
|
+
v7_relativeSplatPath: false
|
|
178791
178922
|
}, init.future);
|
|
178792
178923
|
// Cleanup function for history
|
|
178793
178924
|
let unlistenHistory = null;
|
|
@@ -178823,12 +178954,28 @@ function createRouter(init) {
|
|
|
178823
178954
|
[route.id]: error
|
|
178824
178955
|
};
|
|
178825
178956
|
}
|
|
178826
|
-
let initialized
|
|
178827
|
-
|
|
178828
|
-
|
|
178829
|
-
|
|
178830
|
-
|
|
178831
|
-
|
|
178957
|
+
let initialized;
|
|
178958
|
+
let hasLazyRoutes = initialMatches.some(m => m.route.lazy);
|
|
178959
|
+
let hasLoaders = initialMatches.some(m => m.route.loader);
|
|
178960
|
+
if (hasLazyRoutes) {
|
|
178961
|
+
// All initialMatches need to be loaded before we're ready. If we have lazy
|
|
178962
|
+
// functions around still then we'll need to run them in initialize()
|
|
178963
|
+
initialized = false;
|
|
178964
|
+
} else if (!hasLoaders) {
|
|
178965
|
+
// If we've got no loaders to run, then we're good to go
|
|
178966
|
+
initialized = true;
|
|
178967
|
+
} else if (future.v7_partialHydration) {
|
|
178968
|
+
// If partial hydration is enabled, we're initialized so long as we were
|
|
178969
|
+
// provided with hydrationData for every route with a loader, and no loaders
|
|
178970
|
+
// were marked for explicit hydration
|
|
178971
|
+
let loaderData = init.hydrationData ? init.hydrationData.loaderData : null;
|
|
178972
|
+
let errors = init.hydrationData ? init.hydrationData.errors : null;
|
|
178973
|
+
initialized = initialMatches.every(m => m.route.loader && m.route.loader.hydrate !== true && (loaderData && loaderData[m.route.id] !== undefined || errors && errors[m.route.id] !== undefined));
|
|
178974
|
+
} else {
|
|
178975
|
+
// Without partial hydration - we're initialized if we were provided any
|
|
178976
|
+
// hydrationData - which is expected to be complete
|
|
178977
|
+
initialized = init.hydrationData != null;
|
|
178978
|
+
}
|
|
178832
178979
|
let router;
|
|
178833
178980
|
let state = {
|
|
178834
178981
|
historyAction: init.history.action,
|
|
@@ -178972,7 +179119,9 @@ function createRouter(init) {
|
|
|
178972
179119
|
// resolved prior to router creation since we can't go into a fallbackElement
|
|
178973
179120
|
// UI for SSR'd apps
|
|
178974
179121
|
if (!state.initialized) {
|
|
178975
|
-
startNavigation(Action.Pop, state.location
|
|
179122
|
+
startNavigation(Action.Pop, state.location, {
|
|
179123
|
+
initialHydration: true
|
|
179124
|
+
});
|
|
178976
179125
|
}
|
|
178977
179126
|
return router;
|
|
178978
179127
|
}
|
|
@@ -179147,7 +179296,7 @@ function createRouter(init) {
|
|
|
179147
179296
|
init.history.go(to);
|
|
179148
179297
|
return;
|
|
179149
179298
|
}
|
|
179150
|
-
let normalizedPath = normalizeTo(state.location, state.matches, basename, future.v7_prependBasename, to, opts == null ? void 0 : opts.fromRouteId, opts == null ? void 0 : opts.relative);
|
|
179299
|
+
let normalizedPath = normalizeTo(state.location, state.matches, basename, future.v7_prependBasename, to, future.v7_relativeSplatPath, opts == null ? void 0 : opts.fromRouteId, opts == null ? void 0 : opts.relative);
|
|
179151
179300
|
let {
|
|
179152
179301
|
path,
|
|
179153
179302
|
submission,
|
|
@@ -179336,7 +179485,7 @@ function createRouter(init) {
|
|
|
179336
179485
|
shortCircuited,
|
|
179337
179486
|
loaderData,
|
|
179338
179487
|
errors
|
|
179339
|
-
} = await handleLoaders(request, location, matches, loadingNavigation, opts && opts.submission, opts && opts.fetcherSubmission, opts && opts.replace, flushSync, pendingActionData, pendingError);
|
|
179488
|
+
} = await handleLoaders(request, location, matches, loadingNavigation, opts && opts.submission, opts && opts.fetcherSubmission, opts && opts.replace, opts && opts.initialHydration === true, flushSync, pendingActionData, pendingError);
|
|
179340
179489
|
if (shortCircuited) {
|
|
179341
179490
|
return;
|
|
179342
179491
|
}
|
|
@@ -179380,7 +179529,7 @@ function createRouter(init) {
|
|
|
179380
179529
|
})
|
|
179381
179530
|
};
|
|
179382
179531
|
} else {
|
|
179383
|
-
result = await callLoaderOrAction("action", request, actionMatch, matches, manifest, mapRouteProperties, basename);
|
|
179532
|
+
result = await callLoaderOrAction("action", request, actionMatch, matches, manifest, mapRouteProperties, basename, future.v7_relativeSplatPath);
|
|
179384
179533
|
if (request.signal.aborted) {
|
|
179385
179534
|
return {
|
|
179386
179535
|
shortCircuited: true
|
|
@@ -179437,14 +179586,14 @@ function createRouter(init) {
|
|
|
179437
179586
|
}
|
|
179438
179587
|
// Call all applicable loaders for the given matches, handling redirects,
|
|
179439
179588
|
// errors, etc.
|
|
179440
|
-
async function handleLoaders(request, location, matches, overrideNavigation, submission, fetcherSubmission, replace, flushSync, pendingActionData, pendingError) {
|
|
179589
|
+
async function handleLoaders(request, location, matches, overrideNavigation, submission, fetcherSubmission, replace, initialHydration, flushSync, pendingActionData, pendingError) {
|
|
179441
179590
|
// Figure out the right navigation we want to use for data loading
|
|
179442
179591
|
let loadingNavigation = overrideNavigation || getLoadingNavigation(location, submission);
|
|
179443
179592
|
// If this was a redirect from an action we don't have a "submission" but
|
|
179444
179593
|
// we have it on the loading navigation so use that if available
|
|
179445
179594
|
let activeSubmission = submission || fetcherSubmission || getSubmissionFromNavigation(loadingNavigation);
|
|
179446
179595
|
let routesToUse = inFlightDataRoutes || dataRoutes;
|
|
179447
|
-
let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(init.history, state, matches, activeSubmission, location, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, deletedFetchers, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, pendingActionData, pendingError);
|
|
179596
|
+
let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(init.history, state, matches, activeSubmission, location, future.v7_partialHydration && initialHydration === true, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, deletedFetchers, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, pendingActionData, pendingError);
|
|
179448
179597
|
// Cancel pending deferreds for no-longer-matched routes or routes we're
|
|
179449
179598
|
// about to reload. Note that if this is an action reload we would have
|
|
179450
179599
|
// already cancelled all pending deferreds so this would be a no-op
|
|
@@ -179473,7 +179622,9 @@ function createRouter(init) {
|
|
|
179473
179622
|
// state. If not, we need to switch to our loading state and load data,
|
|
179474
179623
|
// preserving any new action data or existing action data (in the case of
|
|
179475
179624
|
// a revalidation interrupting an actionReload)
|
|
179476
|
-
|
|
179625
|
+
// If we have partialHydration enabled, then don't update the state for the
|
|
179626
|
+
// initial data load since iot's not a "navigation"
|
|
179627
|
+
if (!isUninterruptedRevalidation && (!future.v7_partialHydration || !initialHydration)) {
|
|
179477
179628
|
revalidatingFetchers.forEach(rf => {
|
|
179478
179629
|
let fetcher = state.fetchers.get(rf.key);
|
|
179479
179630
|
let revalidatingFetcher = getLoadingFetcher(undefined, fetcher ? fetcher.data : undefined);
|
|
@@ -179576,7 +179727,7 @@ function createRouter(init) {
|
|
|
179576
179727
|
if (fetchControllers.has(key)) abortFetcher(key);
|
|
179577
179728
|
let flushSync = (opts && opts.unstable_flushSync) === true;
|
|
179578
179729
|
let routesToUse = inFlightDataRoutes || dataRoutes;
|
|
179579
|
-
let normalizedPath = normalizeTo(state.location, state.matches, basename, future.v7_prependBasename, href, routeId, opts == null ? void 0 : opts.relative);
|
|
179730
|
+
let normalizedPath = normalizeTo(state.location, state.matches, basename, future.v7_prependBasename, href, future.v7_relativeSplatPath, routeId, opts == null ? void 0 : opts.relative);
|
|
179580
179731
|
let matches = matchRoutes(routesToUse, normalizedPath, basename);
|
|
179581
179732
|
if (!matches) {
|
|
179582
179733
|
setFetcherError(key, routeId, getInternalRouterError(404, {
|
|
@@ -179637,7 +179788,7 @@ function createRouter(init) {
|
|
|
179637
179788
|
let fetchRequest = createClientSideRequest(init.history, path, abortController.signal, submission);
|
|
179638
179789
|
fetchControllers.set(key, abortController);
|
|
179639
179790
|
let originatingLoadId = incrementingLoadId;
|
|
179640
|
-
let actionResult = await callLoaderOrAction("action", fetchRequest, match, requestMatches, manifest, mapRouteProperties, basename);
|
|
179791
|
+
let actionResult = await callLoaderOrAction("action", fetchRequest, match, requestMatches, manifest, mapRouteProperties, basename, future.v7_relativeSplatPath);
|
|
179641
179792
|
if (fetchRequest.signal.aborted) {
|
|
179642
179793
|
// We can delete this so long as we weren't aborted by our own fetcher
|
|
179643
179794
|
// re-submit which would have put _new_ controller is in fetchControllers
|
|
@@ -179646,31 +179797,38 @@ function createRouter(init) {
|
|
|
179646
179797
|
}
|
|
179647
179798
|
return;
|
|
179648
179799
|
}
|
|
179649
|
-
|
|
179650
|
-
|
|
179651
|
-
|
|
179652
|
-
|
|
179653
|
-
|
|
179654
|
-
fetchControllers.delete(key);
|
|
179655
|
-
if (pendingNavigationLoadId > originatingLoadId) {
|
|
179656
|
-
// A new navigation was kicked off after our action started, so that
|
|
179657
|
-
// should take precedence over this redirect navigation. We already
|
|
179658
|
-
// set isRevalidationRequired so all loaders for the new route should
|
|
179659
|
-
// fire unless opted out via shouldRevalidate
|
|
179800
|
+
// When using v7_fetcherPersist, we don't want errors bubbling up to the UI
|
|
179801
|
+
// or redirects processed for unmounted fetchers so we just revert them to
|
|
179802
|
+
// idle
|
|
179803
|
+
if (future.v7_fetcherPersist && deletedFetchers.has(key)) {
|
|
179804
|
+
if (isRedirectResult(actionResult) || isErrorResult(actionResult)) {
|
|
179660
179805
|
updateFetcherState(key, getDoneFetcher(undefined));
|
|
179661
179806
|
return;
|
|
179662
|
-
} else {
|
|
179663
|
-
fetchRedirectIds.add(key);
|
|
179664
|
-
updateFetcherState(key, getLoadingFetcher(submission));
|
|
179665
|
-
return startRedirectNavigation(state, actionResult, {
|
|
179666
|
-
fetcherSubmission: submission
|
|
179667
|
-
});
|
|
179668
179807
|
}
|
|
179669
|
-
|
|
179670
|
-
|
|
179671
|
-
|
|
179672
|
-
|
|
179673
|
-
|
|
179808
|
+
// Let SuccessResult's fall through for revalidation
|
|
179809
|
+
} else {
|
|
179810
|
+
if (isRedirectResult(actionResult)) {
|
|
179811
|
+
fetchControllers.delete(key);
|
|
179812
|
+
if (pendingNavigationLoadId > originatingLoadId) {
|
|
179813
|
+
// A new navigation was kicked off after our action started, so that
|
|
179814
|
+
// should take precedence over this redirect navigation. We already
|
|
179815
|
+
// set isRevalidationRequired so all loaders for the new route should
|
|
179816
|
+
// fire unless opted out via shouldRevalidate
|
|
179817
|
+
updateFetcherState(key, getDoneFetcher(undefined));
|
|
179818
|
+
return;
|
|
179819
|
+
} else {
|
|
179820
|
+
fetchRedirectIds.add(key);
|
|
179821
|
+
updateFetcherState(key, getLoadingFetcher(submission));
|
|
179822
|
+
return startRedirectNavigation(state, actionResult, {
|
|
179823
|
+
fetcherSubmission: submission
|
|
179824
|
+
});
|
|
179825
|
+
}
|
|
179826
|
+
}
|
|
179827
|
+
// Process any non-redirect errors thrown
|
|
179828
|
+
if (isErrorResult(actionResult)) {
|
|
179829
|
+
setFetcherError(key, routeId, actionResult.error);
|
|
179830
|
+
return;
|
|
179831
|
+
}
|
|
179674
179832
|
}
|
|
179675
179833
|
if (isDeferredResult(actionResult)) {
|
|
179676
179834
|
throw getInternalRouterError(400, {
|
|
@@ -179688,7 +179846,7 @@ function createRouter(init) {
|
|
|
179688
179846
|
fetchReloadIds.set(key, loadId);
|
|
179689
179847
|
let loadFetcher = getLoadingFetcher(submission, actionResult.data);
|
|
179690
179848
|
state.fetchers.set(key, loadFetcher);
|
|
179691
|
-
let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(init.history, state, matches, submission, nextLocation, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, deletedFetchers, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, {
|
|
179849
|
+
let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(init.history, state, matches, submission, nextLocation, false, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, deletedFetchers, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, {
|
|
179692
179850
|
[match.route.id]: actionResult.data
|
|
179693
179851
|
}, undefined // No need to send through errors since we short circuit above
|
|
179694
179852
|
);
|
|
@@ -179782,7 +179940,7 @@ function createRouter(init) {
|
|
|
179782
179940
|
let fetchRequest = createClientSideRequest(init.history, path, abortController.signal);
|
|
179783
179941
|
fetchControllers.set(key, abortController);
|
|
179784
179942
|
let originatingLoadId = incrementingLoadId;
|
|
179785
|
-
let result = await callLoaderOrAction("loader", fetchRequest, match, matches, manifest, mapRouteProperties, basename);
|
|
179943
|
+
let result = await callLoaderOrAction("loader", fetchRequest, match, matches, manifest, mapRouteProperties, basename, future.v7_relativeSplatPath);
|
|
179786
179944
|
// Deferred isn't supported for fetcher loads, await everything and treat it
|
|
179787
179945
|
// as a normal load. resolveDeferredData will return undefined if this
|
|
179788
179946
|
// fetcher gets aborted, so we just leave result untouched and short circuit
|
|
@@ -179798,6 +179956,8 @@ function createRouter(init) {
|
|
|
179798
179956
|
if (fetchRequest.signal.aborted) {
|
|
179799
179957
|
return;
|
|
179800
179958
|
}
|
|
179959
|
+
// We don't want errors bubbling up or redirects followed for unmounted
|
|
179960
|
+
// fetchers, so short circuit here if it was removed from the UI
|
|
179801
179961
|
if (deletedFetchers.has(key)) {
|
|
179802
179962
|
updateFetcherState(key, getDoneFetcher(undefined));
|
|
179803
179963
|
return;
|
|
@@ -179921,9 +180081,9 @@ function createRouter(init) {
|
|
|
179921
180081
|
// Call all navigation loaders and revalidating fetcher loaders in parallel,
|
|
179922
180082
|
// then slice off the results into separate arrays so we can handle them
|
|
179923
180083
|
// accordingly
|
|
179924
|
-
let results = await Promise.all([...matchesToLoad.map(match => callLoaderOrAction("loader", request, match, matches, manifest, mapRouteProperties, basename)), ...fetchersToLoad.map(f => {
|
|
180084
|
+
let results = await Promise.all([...matchesToLoad.map(match => callLoaderOrAction("loader", request, match, matches, manifest, mapRouteProperties, basename, future.v7_relativeSplatPath)), ...fetchersToLoad.map(f => {
|
|
179925
180085
|
if (f.matches && f.match && f.controller) {
|
|
179926
|
-
return callLoaderOrAction("loader", createClientSideRequest(init.history, f.path, f.controller.signal), f.match, f.matches, manifest, mapRouteProperties, basename);
|
|
180086
|
+
return callLoaderOrAction("loader", createClientSideRequest(init.history, f.path, f.controller.signal), f.match, f.matches, manifest, mapRouteProperties, basename, future.v7_relativeSplatPath);
|
|
179927
180087
|
} else {
|
|
179928
180088
|
let error = {
|
|
179929
180089
|
type: ResultType.error,
|
|
@@ -180192,6 +180352,9 @@ function createRouter(init) {
|
|
|
180192
180352
|
get basename() {
|
|
180193
180353
|
return basename;
|
|
180194
180354
|
},
|
|
180355
|
+
get future() {
|
|
180356
|
+
return future;
|
|
180357
|
+
},
|
|
180195
180358
|
get state() {
|
|
180196
180359
|
return state;
|
|
180197
180360
|
},
|
|
@@ -180245,6 +180408,10 @@ function createStaticHandler(routes, opts) {
|
|
|
180245
180408
|
} else {
|
|
180246
180409
|
mapRouteProperties = defaultMapRouteProperties;
|
|
180247
180410
|
}
|
|
180411
|
+
// Config driven behavior flags
|
|
180412
|
+
let future = _extends({
|
|
180413
|
+
v7_relativeSplatPath: false
|
|
180414
|
+
}, opts ? opts.future : null);
|
|
180248
180415
|
let dataRoutes = convertRoutesToDataRoutes(routes, mapRouteProperties, undefined, manifest);
|
|
180249
180416
|
/**
|
|
180250
180417
|
* The query() method is intended for document requests, in which we want to
|
|
@@ -180454,7 +180621,7 @@ function createStaticHandler(routes, opts) {
|
|
|
180454
180621
|
error
|
|
180455
180622
|
};
|
|
180456
180623
|
} else {
|
|
180457
|
-
result = await callLoaderOrAction("action", request, actionMatch, matches, manifest, mapRouteProperties, basename, {
|
|
180624
|
+
result = await callLoaderOrAction("action", request, actionMatch, matches, manifest, mapRouteProperties, basename, future.v7_relativeSplatPath, {
|
|
180458
180625
|
isStaticRequest: true,
|
|
180459
180626
|
isRouteRequest,
|
|
180460
180627
|
requestContext
|
|
@@ -180569,7 +180736,7 @@ function createStaticHandler(routes, opts) {
|
|
|
180569
180736
|
activeDeferreds: null
|
|
180570
180737
|
};
|
|
180571
180738
|
}
|
|
180572
|
-
let results = await Promise.all([...matchesToLoad.map(match => callLoaderOrAction("loader", request, match, matches, manifest, mapRouteProperties, basename, {
|
|
180739
|
+
let results = await Promise.all([...matchesToLoad.map(match => callLoaderOrAction("loader", request, match, matches, manifest, mapRouteProperties, basename, future.v7_relativeSplatPath, {
|
|
180573
180740
|
isStaticRequest: true,
|
|
180574
180741
|
isRouteRequest,
|
|
180575
180742
|
requestContext
|
|
@@ -180619,7 +180786,7 @@ function getStaticContextFromError(routes, context, error) {
|
|
|
180619
180786
|
function isSubmissionNavigation(opts) {
|
|
180620
180787
|
return opts != null && ("formData" in opts && opts.formData != null || "body" in opts && opts.body !== undefined);
|
|
180621
180788
|
}
|
|
180622
|
-
function normalizeTo(location, matches, basename, prependBasename, to, fromRouteId, relative) {
|
|
180789
|
+
function normalizeTo(location, matches, basename, prependBasename, to, v7_relativeSplatPath, fromRouteId, relative) {
|
|
180623
180790
|
let contextualMatches;
|
|
180624
180791
|
let activeRouteMatch;
|
|
180625
180792
|
if (fromRouteId) {
|
|
@@ -180638,7 +180805,7 @@ function normalizeTo(location, matches, basename, prependBasename, to, fromRoute
|
|
|
180638
180805
|
activeRouteMatch = matches[matches.length - 1];
|
|
180639
180806
|
}
|
|
180640
180807
|
// Resolve the relative path
|
|
180641
|
-
let path = resolveTo(to ? to : ".",
|
|
180808
|
+
let path = resolveTo(to ? to : ".", getResolveToMatches(contextualMatches, v7_relativeSplatPath), stripBasename(location.pathname, basename) || location.pathname, relative === "path");
|
|
180642
180809
|
// When `to` is not specified we inherit search/hash from the current
|
|
180643
180810
|
// location, unlike when to="." and we just inherit the path.
|
|
180644
180811
|
// See https://github.com/remix-run/remix/issues/927
|
|
@@ -180795,7 +180962,7 @@ function getLoaderMatchesUntilBoundary(matches, boundaryId) {
|
|
|
180795
180962
|
}
|
|
180796
180963
|
return boundaryMatches;
|
|
180797
180964
|
}
|
|
180798
|
-
function getMatchesToLoad(history, state, matches, submission, location, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, deletedFetchers, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, pendingActionData, pendingError) {
|
|
180965
|
+
function getMatchesToLoad(history, state, matches, submission, location, isInitialLoad, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, deletedFetchers, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, pendingActionData, pendingError) {
|
|
180799
180966
|
let actionResult = pendingError ? Object.values(pendingError)[0] : pendingActionData ? Object.values(pendingActionData)[0] : undefined;
|
|
180800
180967
|
let currentUrl = history.createURL(state.location);
|
|
180801
180968
|
let nextUrl = history.createURL(location);
|
|
@@ -180803,13 +180970,24 @@ function getMatchesToLoad(history, state, matches, submission, location, isReval
|
|
|
180803
180970
|
let boundaryId = pendingError ? Object.keys(pendingError)[0] : undefined;
|
|
180804
180971
|
let boundaryMatches = getLoaderMatchesUntilBoundary(matches, boundaryId);
|
|
180805
180972
|
let navigationMatches = boundaryMatches.filter((match, index) => {
|
|
180806
|
-
|
|
180973
|
+
let {
|
|
180974
|
+
route
|
|
180975
|
+
} = match;
|
|
180976
|
+
if (route.lazy) {
|
|
180807
180977
|
// We haven't loaded this route yet so we don't know if it's got a loader!
|
|
180808
180978
|
return true;
|
|
180809
180979
|
}
|
|
180810
|
-
if (
|
|
180980
|
+
if (route.loader == null) {
|
|
180811
180981
|
return false;
|
|
180812
180982
|
}
|
|
180983
|
+
if (isInitialLoad) {
|
|
180984
|
+
if (route.loader.hydrate) {
|
|
180985
|
+
return true;
|
|
180986
|
+
}
|
|
180987
|
+
return state.loaderData[route.id] === undefined && (
|
|
180988
|
+
// Don't re-run if the loader ran and threw an error
|
|
180989
|
+
!state.errors || state.errors[route.id] === undefined);
|
|
180990
|
+
}
|
|
180813
180991
|
// Always call the loader on new route instances and pending defer cancellations
|
|
180814
180992
|
if (isNewLoader(state.loaderData, state.matches[index], match) || cancelledDeferredRoutes.some(id => id === match.route.id)) {
|
|
180815
180993
|
return true;
|
|
@@ -180839,8 +181017,12 @@ function getMatchesToLoad(history, state, matches, submission, location, isReval
|
|
|
180839
181017
|
// Pick fetcher.loads that need to be revalidated
|
|
180840
181018
|
let revalidatingFetchers = [];
|
|
180841
181019
|
fetchLoadMatches.forEach((f, key) => {
|
|
180842
|
-
// Don't revalidate
|
|
180843
|
-
|
|
181020
|
+
// Don't revalidate:
|
|
181021
|
+
// - on initial load (shouldn't be any fetchers then anyway)
|
|
181022
|
+
// - if fetcher won't be present in the subsequent render
|
|
181023
|
+
// - no longer matches the URL (v7_fetcherPersist=false)
|
|
181024
|
+
// - was unmounted but persisted due to v7_fetcherPersist=true
|
|
181025
|
+
if (isInitialLoad || !matches.some(m => m.route.id === f.routeId) || deletedFetchers.has(key)) {
|
|
180844
181026
|
return;
|
|
180845
181027
|
}
|
|
180846
181028
|
let fetcherMatches = matchRoutes(routesToUse, f.path, basename);
|
|
@@ -180981,7 +181163,7 @@ async function loadLazyRouteModule(route, mapRouteProperties, manifest) {
|
|
|
180981
181163
|
lazy: undefined
|
|
180982
181164
|
}));
|
|
180983
181165
|
}
|
|
180984
|
-
async function callLoaderOrAction(type, request, match, matches, manifest, mapRouteProperties, basename, opts) {
|
|
181166
|
+
async function callLoaderOrAction(type, request, match, matches, manifest, mapRouteProperties, basename, v7_relativeSplatPath, opts) {
|
|
180985
181167
|
if (opts === void 0) {
|
|
180986
181168
|
opts = {};
|
|
180987
181169
|
}
|
|
@@ -181069,7 +181251,7 @@ async function callLoaderOrAction(type, request, match, matches, manifest, mapRo
|
|
|
181069
181251
|
invariant(location, "Redirects returned/thrown from loaders/actions must have a Location header");
|
|
181070
181252
|
// Support relative routing in internal redirects
|
|
181071
181253
|
if (!ABSOLUTE_URL_REGEX.test(location)) {
|
|
181072
|
-
location = normalizeTo(new URL(request.url), matches.slice(0, matches.indexOf(match) + 1), basename, true, location);
|
|
181254
|
+
location = normalizeTo(new URL(request.url), matches.slice(0, matches.indexOf(match) + 1), basename, true, location, v7_relativeSplatPath);
|
|
181073
181255
|
} else if (!opts.isStaticRequest) {
|
|
181074
181256
|
// Strip off the protocol+origin for same-origin + same-basename absolute
|
|
181075
181257
|
// redirects. If this is a static request, we can let it go back to the
|
|
@@ -181108,13 +181290,24 @@ async function callLoaderOrAction(type, request, match, matches, manifest, mapRo
|
|
|
181108
181290
|
throw queryRouteResponse;
|
|
181109
181291
|
}
|
|
181110
181292
|
let data;
|
|
181111
|
-
|
|
181112
|
-
|
|
181113
|
-
|
|
181114
|
-
|
|
181115
|
-
|
|
181116
|
-
|
|
181117
|
-
|
|
181293
|
+
try {
|
|
181294
|
+
let contentType = result.headers.get("Content-Type");
|
|
181295
|
+
// Check between word boundaries instead of startsWith() due to the last
|
|
181296
|
+
// paragraph of https://httpwg.org/specs/rfc9110.html#field.content-type
|
|
181297
|
+
if (contentType && /\bapplication\/json\b/.test(contentType)) {
|
|
181298
|
+
if (result.body == null) {
|
|
181299
|
+
data = null;
|
|
181300
|
+
} else {
|
|
181301
|
+
data = await result.json();
|
|
181302
|
+
}
|
|
181303
|
+
} else {
|
|
181304
|
+
data = await result.text();
|
|
181305
|
+
}
|
|
181306
|
+
} catch (e) {
|
|
181307
|
+
return {
|
|
181308
|
+
type: ResultType.error,
|
|
181309
|
+
error: e
|
|
181310
|
+
};
|
|
181118
181311
|
}
|
|
181119
181312
|
if (resultType === ResultType.error) {
|
|
181120
181313
|
return {
|
|
@@ -184117,72 +184310,6 @@ if ($defineProperty) {
|
|
|
184117
184310
|
}
|
|
184118
184311
|
|
|
184119
184312
|
|
|
184120
|
-
/***/ }),
|
|
184121
|
-
|
|
184122
|
-
/***/ 44921:
|
|
184123
|
-
/***/ ((module, exports) => {
|
|
184124
|
-
|
|
184125
|
-
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
|
|
184126
|
-
Copyright (c) 2018 Jed Watson.
|
|
184127
|
-
Licensed under the MIT License (MIT), see
|
|
184128
|
-
http://jedwatson.github.io/classnames
|
|
184129
|
-
*/
|
|
184130
|
-
/* global define */
|
|
184131
|
-
|
|
184132
|
-
(function () {
|
|
184133
|
-
'use strict';
|
|
184134
|
-
|
|
184135
|
-
var hasOwn = {}.hasOwnProperty;
|
|
184136
|
-
var nativeCodeString = '[native code]';
|
|
184137
|
-
|
|
184138
|
-
function classNames() {
|
|
184139
|
-
var classes = [];
|
|
184140
|
-
|
|
184141
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
184142
|
-
var arg = arguments[i];
|
|
184143
|
-
if (!arg) continue;
|
|
184144
|
-
|
|
184145
|
-
var argType = typeof arg;
|
|
184146
|
-
|
|
184147
|
-
if (argType === 'string' || argType === 'number') {
|
|
184148
|
-
classes.push(arg);
|
|
184149
|
-
} else if (Array.isArray(arg)) {
|
|
184150
|
-
if (arg.length) {
|
|
184151
|
-
var inner = classNames.apply(null, arg);
|
|
184152
|
-
if (inner) {
|
|
184153
|
-
classes.push(inner);
|
|
184154
|
-
}
|
|
184155
|
-
}
|
|
184156
|
-
} else if (argType === 'object') {
|
|
184157
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
184158
|
-
classes.push(arg.toString());
|
|
184159
|
-
continue;
|
|
184160
|
-
}
|
|
184161
|
-
|
|
184162
|
-
for (var key in arg) {
|
|
184163
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
184164
|
-
classes.push(key);
|
|
184165
|
-
}
|
|
184166
|
-
}
|
|
184167
|
-
}
|
|
184168
|
-
}
|
|
184169
|
-
|
|
184170
|
-
return classes.join(' ');
|
|
184171
|
-
}
|
|
184172
|
-
|
|
184173
|
-
if ( true && module.exports) {
|
|
184174
|
-
classNames.default = classNames;
|
|
184175
|
-
module.exports = classNames;
|
|
184176
|
-
} else if (true) {
|
|
184177
|
-
// register as 'classnames', consistent with npm package name
|
|
184178
|
-
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
|
|
184179
|
-
return classNames;
|
|
184180
|
-
}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
|
|
184181
|
-
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
184182
|
-
} else {}
|
|
184183
|
-
}());
|
|
184184
|
-
|
|
184185
|
-
|
|
184186
184313
|
/***/ }),
|
|
184187
184314
|
|
|
184188
184315
|
/***/ 54678:
|
|
@@ -263243,7 +263370,7 @@ var _propTypes = _interopRequireDefault(__webpack_require__(3827));
|
|
|
263243
263370
|
|
|
263244
263371
|
var _reactDom = _interopRequireDefault(__webpack_require__(14347));
|
|
263245
263372
|
|
|
263246
|
-
var _classnames = _interopRequireDefault(__webpack_require__(
|
|
263373
|
+
var _classnames = _interopRequireDefault(__webpack_require__(33901));
|
|
263247
263374
|
|
|
263248
263375
|
var _domFns = __webpack_require__(56144);
|
|
263249
263376
|
|
|
@@ -270160,8 +270287,9 @@ var runtime = (function (exports) {
|
|
|
270160
270287
|
throw arg;
|
|
270161
270288
|
}
|
|
270162
270289
|
|
|
270163
|
-
// Be forgiving, per
|
|
270164
|
-
// https://
|
|
270290
|
+
// Be forgiving, per GeneratorResume behavior specified since ES2015:
|
|
270291
|
+
// ES2015 spec, step 3: https://262.ecma-international.org/6.0/#sec-generatorresume
|
|
270292
|
+
// Latest spec, step 2: https://tc39.es/ecma262/#sec-generatorresume
|
|
270165
270293
|
return doneResult();
|
|
270166
270294
|
}
|
|
270167
270295
|
|
|
@@ -270234,7 +270362,7 @@ var runtime = (function (exports) {
|
|
|
270234
270362
|
var method = delegate.iterator[methodName];
|
|
270235
270363
|
if (method === undefined) {
|
|
270236
270364
|
// A .throw or .return when the delegate iterator has no .throw
|
|
270237
|
-
// method, or a missing .next
|
|
270365
|
+
// method, or a missing .next method, always terminate the
|
|
270238
270366
|
// yield* loop.
|
|
270239
270367
|
context.delegate = null;
|
|
270240
270368
|
|
|
@@ -270388,7 +270516,7 @@ var runtime = (function (exports) {
|
|
|
270388
270516
|
};
|
|
270389
270517
|
|
|
270390
270518
|
function values(iterable) {
|
|
270391
|
-
if (iterable
|
|
270519
|
+
if (iterable != null) {
|
|
270392
270520
|
var iteratorMethod = iterable[iteratorSymbol];
|
|
270393
270521
|
if (iteratorMethod) {
|
|
270394
270522
|
return iteratorMethod.call(iterable);
|
|
@@ -271750,6 +271878,9 @@ var gOPD = __webpack_require__(1999);
|
|
|
271750
271878
|
var $TypeError = GetIntrinsic('%TypeError%');
|
|
271751
271879
|
var $floor = GetIntrinsic('%Math.floor%');
|
|
271752
271880
|
|
|
271881
|
+
/** @typedef {(...args: unknown[]) => unknown} Func */
|
|
271882
|
+
|
|
271883
|
+
/** @type {<T extends Func = Func>(fn: T, length: number, loose?: boolean) => T} */
|
|
271753
271884
|
module.exports = function setFunctionLength(fn, length) {
|
|
271754
271885
|
if (typeof fn !== 'function') {
|
|
271755
271886
|
throw new $TypeError('`fn` is not a function');
|
|
@@ -271774,9 +271905,9 @@ module.exports = function setFunctionLength(fn, length) {
|
|
|
271774
271905
|
|
|
271775
271906
|
if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
|
|
271776
271907
|
if (hasDescriptors) {
|
|
271777
|
-
define(fn, 'length', length, true, true);
|
|
271908
|
+
define(/** @type {Parameters<define>[0]} */ (fn), 'length', length, true, true);
|
|
271778
271909
|
} else {
|
|
271779
|
-
define(fn, 'length', length);
|
|
271910
|
+
define(/** @type {Parameters<define>[0]} */ (fn), 'length', length);
|
|
271780
271911
|
}
|
|
271781
271912
|
}
|
|
271782
271913
|
return fn;
|
|
@@ -274020,7 +274151,7 @@ var react_dom__WEBPACK_IMPORTED_MODULE_1___namespace_cache;
|
|
|
274020
274151
|
/* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85066);
|
|
274021
274152
|
/* harmony import */ var _remix_run_router__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(70066);
|
|
274022
274153
|
/**
|
|
274023
|
-
* React Router DOM v6.
|
|
274154
|
+
* React Router DOM v6.21.3
|
|
274024
274155
|
*
|
|
274025
274156
|
* Copyright (c) Remix Software Inc.
|
|
274026
274157
|
*
|
|
@@ -274345,6 +274476,8 @@ const START_TRANSITION = "startTransition";
|
|
|
274345
274476
|
const startTransitionImpl = /*#__PURE__*/ (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache || (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache = __webpack_require__.t(react__WEBPACK_IMPORTED_MODULE_0__, 2)))[START_TRANSITION];
|
|
274346
274477
|
const FLUSH_SYNC = "flushSync";
|
|
274347
274478
|
const flushSyncImpl = /*#__PURE__*/ (react_dom__WEBPACK_IMPORTED_MODULE_1___namespace_cache || (react_dom__WEBPACK_IMPORTED_MODULE_1___namespace_cache = __webpack_require__.t(react_dom__WEBPACK_IMPORTED_MODULE_1__, 2)))[FLUSH_SYNC];
|
|
274479
|
+
const USE_ID = "useId";
|
|
274480
|
+
const useIdImpl = /*#__PURE__*/ (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache || (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache = __webpack_require__.t(react__WEBPACK_IMPORTED_MODULE_0__, 2)))[USE_ID];
|
|
274348
274481
|
function startTransitionSafe(cb) {
|
|
274349
274482
|
if (startTransitionImpl) {
|
|
274350
274483
|
startTransitionImpl(cb);
|
|
@@ -274538,6 +274671,11 @@ function RouterProvider(_ref) {
|
|
|
274538
274671
|
setInterruption(undefined);
|
|
274539
274672
|
}
|
|
274540
274673
|
}, [vtContext.isTransitioning, interruption]);
|
|
274674
|
+
React.useEffect(() => {
|
|
274675
|
+
false ? 0 : void 0;
|
|
274676
|
+
// Only log this once on initial mount
|
|
274677
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
274678
|
+
}, []);
|
|
274541
274679
|
let navigator = React.useMemo(() => {
|
|
274542
274680
|
return {
|
|
274543
274681
|
createHref: router.createHref,
|
|
@@ -274579,18 +274717,23 @@ function RouterProvider(_ref) {
|
|
|
274579
274717
|
basename: basename,
|
|
274580
274718
|
location: state.location,
|
|
274581
274719
|
navigationType: state.historyAction,
|
|
274582
|
-
navigator: navigator
|
|
274583
|
-
|
|
274720
|
+
navigator: navigator,
|
|
274721
|
+
future: {
|
|
274722
|
+
v7_relativeSplatPath: router.future.v7_relativeSplatPath
|
|
274723
|
+
}
|
|
274724
|
+
}, state.initialized || router.future.v7_partialHydration ? /*#__PURE__*/React.createElement(DataRoutes, {
|
|
274584
274725
|
routes: router.routes,
|
|
274726
|
+
future: router.future,
|
|
274585
274727
|
state: state
|
|
274586
274728
|
}) : fallbackElement))))), null);
|
|
274587
274729
|
}
|
|
274588
274730
|
function DataRoutes(_ref3) {
|
|
274589
274731
|
let {
|
|
274590
274732
|
routes,
|
|
274733
|
+
future,
|
|
274591
274734
|
state
|
|
274592
274735
|
} = _ref3;
|
|
274593
|
-
return UNSAFE_useRoutesImpl(routes, undefined, state);
|
|
274736
|
+
return UNSAFE_useRoutesImpl(routes, undefined, state, future);
|
|
274594
274737
|
}
|
|
274595
274738
|
/**
|
|
274596
274739
|
* A `<Router>` for use in web browsers. Provides the cleanest URLs.
|
|
@@ -274626,7 +274769,8 @@ function BrowserRouter(_ref4) {
|
|
|
274626
274769
|
children: children,
|
|
274627
274770
|
location: state.location,
|
|
274628
274771
|
navigationType: state.action,
|
|
274629
|
-
navigator: history
|
|
274772
|
+
navigator: history,
|
|
274773
|
+
future: future
|
|
274630
274774
|
});
|
|
274631
274775
|
}
|
|
274632
274776
|
/**
|
|
@@ -274664,7 +274808,8 @@ function HashRouter(_ref5) {
|
|
|
274664
274808
|
children: children,
|
|
274665
274809
|
location: state.location,
|
|
274666
274810
|
navigationType: state.action,
|
|
274667
|
-
navigator: history
|
|
274811
|
+
navigator: history,
|
|
274812
|
+
future: future
|
|
274668
274813
|
});
|
|
274669
274814
|
}
|
|
274670
274815
|
/**
|
|
@@ -274696,7 +274841,8 @@ function HistoryRouter(_ref6) {
|
|
|
274696
274841
|
children: children,
|
|
274697
274842
|
location: state.location,
|
|
274698
274843
|
navigationType: state.action,
|
|
274699
|
-
navigator: history
|
|
274844
|
+
navigator: history,
|
|
274845
|
+
future: future
|
|
274700
274846
|
});
|
|
274701
274847
|
}
|
|
274702
274848
|
if (false) {}
|
|
@@ -274796,7 +274942,8 @@ const NavLink = /*#__PURE__*/(/* unused pure expression or super */ null && (Rea
|
|
|
274796
274942
|
let location = useLocation();
|
|
274797
274943
|
let routerState = React.useContext(UNSAFE_DataRouterStateContext);
|
|
274798
274944
|
let {
|
|
274799
|
-
navigator
|
|
274945
|
+
navigator,
|
|
274946
|
+
basename
|
|
274800
274947
|
} = React.useContext(UNSAFE_NavigationContext);
|
|
274801
274948
|
let isTransitioning = routerState != null &&
|
|
274802
274949
|
// Conditional usage is OK here because the usage of a data router is static
|
|
@@ -274810,6 +274957,9 @@ const NavLink = /*#__PURE__*/(/* unused pure expression or super */ null && (Rea
|
|
|
274810
274957
|
nextLocationPathname = nextLocationPathname ? nextLocationPathname.toLowerCase() : null;
|
|
274811
274958
|
toPathname = toPathname.toLowerCase();
|
|
274812
274959
|
}
|
|
274960
|
+
if (nextLocationPathname && basename) {
|
|
274961
|
+
nextLocationPathname = stripBasename(nextLocationPathname, basename) || nextLocationPathname;
|
|
274962
|
+
}
|
|
274813
274963
|
// If the `to` has a trailing slash, look at that exact spot. Otherwise,
|
|
274814
274964
|
// we're looking for a slash _after_ what's in `to`. For example:
|
|
274815
274965
|
//
|
|
@@ -275077,10 +275227,8 @@ function useFormAction(action, _temp2) {
|
|
|
275077
275227
|
let path = _extends({}, useResolvedPath(action ? action : ".", {
|
|
275078
275228
|
relative
|
|
275079
275229
|
}));
|
|
275080
|
-
//
|
|
275081
|
-
//
|
|
275082
|
-
// the intended behavior of when "." is specifically provided as
|
|
275083
|
-
// the form action, but inconsistent w/ browsers when the action is omitted.
|
|
275230
|
+
// If no action was specified, browsers will persist current search params
|
|
275231
|
+
// when determining the path, so match that behavior
|
|
275084
275232
|
// https://github.com/remix-run/remix/issues/927
|
|
275085
275233
|
let location = useLocation();
|
|
275086
275234
|
if (action == null) {
|
|
@@ -275129,10 +275277,14 @@ function useFetcher(_temp3) {
|
|
|
275129
275277
|
!route ? false ? 0 : UNSAFE_invariant(false) : void 0;
|
|
275130
275278
|
!(routeId != null) ? false ? 0 : UNSAFE_invariant(false) : void 0;
|
|
275131
275279
|
// Fetcher key handling
|
|
275132
|
-
|
|
275280
|
+
// OK to call conditionally to feature detect `useId`
|
|
275281
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
275282
|
+
let defaultKey = useIdImpl ? useIdImpl() : "";
|
|
275283
|
+
let [fetcherKey, setFetcherKey] = React.useState(key || defaultKey);
|
|
275133
275284
|
if (key && key !== fetcherKey) {
|
|
275134
275285
|
setFetcherKey(key);
|
|
275135
275286
|
} else if (!fetcherKey) {
|
|
275287
|
+
// We will only fall through here when `useId` is not available
|
|
275136
275288
|
setFetcherKey(getUniqueFetcherId());
|
|
275137
275289
|
}
|
|
275138
275290
|
// Registration/cleanup
|
|
@@ -275433,7 +275585,7 @@ var react__WEBPACK_IMPORTED_MODULE_0___namespace_cache;
|
|
|
275433
275585
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(43001);
|
|
275434
275586
|
/* harmony import */ var _remix_run_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(70066);
|
|
275435
275587
|
/**
|
|
275436
|
-
* React Router v6.
|
|
275588
|
+
* React Router v6.21.3
|
|
275437
275589
|
*
|
|
275438
275590
|
* Copyright (c) Remix Software Inc.
|
|
275439
275591
|
*
|
|
@@ -275616,6 +275768,7 @@ function useNavigateUnstable() {
|
|
|
275616
275768
|
let dataRouterContext = react__WEBPACK_IMPORTED_MODULE_0__.useContext(DataRouterContext);
|
|
275617
275769
|
let {
|
|
275618
275770
|
basename,
|
|
275771
|
+
future,
|
|
275619
275772
|
navigator
|
|
275620
275773
|
} = react__WEBPACK_IMPORTED_MODULE_0__.useContext(NavigationContext);
|
|
275621
275774
|
let {
|
|
@@ -275624,7 +275777,7 @@ function useNavigateUnstable() {
|
|
|
275624
275777
|
let {
|
|
275625
275778
|
pathname: locationPathname
|
|
275626
275779
|
} = useLocation();
|
|
275627
|
-
let routePathnamesJson = JSON.stringify((0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .
|
|
275780
|
+
let routePathnamesJson = JSON.stringify((0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .UNSAFE_getResolveToMatches */ .cm)(matches, future.v7_relativeSplatPath));
|
|
275628
275781
|
let activeRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(false);
|
|
275629
275782
|
useIsomorphicLayoutEffect(() => {
|
|
275630
275783
|
activeRef.current = true;
|
|
@@ -275707,13 +275860,16 @@ function useResolvedPath(to, _temp2) {
|
|
|
275707
275860
|
let {
|
|
275708
275861
|
relative
|
|
275709
275862
|
} = _temp2 === void 0 ? {} : _temp2;
|
|
275863
|
+
let {
|
|
275864
|
+
future
|
|
275865
|
+
} = react__WEBPACK_IMPORTED_MODULE_0__.useContext(NavigationContext);
|
|
275710
275866
|
let {
|
|
275711
275867
|
matches
|
|
275712
275868
|
} = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext);
|
|
275713
275869
|
let {
|
|
275714
275870
|
pathname: locationPathname
|
|
275715
275871
|
} = useLocation();
|
|
275716
|
-
let routePathnamesJson = JSON.stringify((0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .
|
|
275872
|
+
let routePathnamesJson = JSON.stringify((0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .UNSAFE_getResolveToMatches */ .cm)(matches, future.v7_relativeSplatPath));
|
|
275717
275873
|
return react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .resolveTo */ .pC)(to, JSON.parse(routePathnamesJson), locationPathname, relative === "path"), [to, routePathnamesJson, locationPathname, relative]);
|
|
275718
275874
|
}
|
|
275719
275875
|
|
|
@@ -275730,7 +275886,7 @@ function useRoutes(routes, locationArg) {
|
|
|
275730
275886
|
}
|
|
275731
275887
|
|
|
275732
275888
|
// Internal implementation with accept optional param for RouterProvider usage
|
|
275733
|
-
function useRoutesImpl(routes, locationArg, dataRouterState) {
|
|
275889
|
+
function useRoutesImpl(routes, locationArg, dataRouterState, future) {
|
|
275734
275890
|
!useInRouterContext() ? false ? 0 : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .UNSAFE_invariant */ .J0)(false) : void 0;
|
|
275735
275891
|
let {
|
|
275736
275892
|
navigator
|
|
@@ -275768,7 +275924,7 @@ function useRoutesImpl(routes, locationArg, dataRouterState) {
|
|
|
275768
275924
|
pathnameBase: match.pathnameBase === "/" ? parentPathnameBase : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .joinPaths */ .RQ)([parentPathnameBase,
|
|
275769
275925
|
// Re-encode pathnames that were decoded inside matchRoutes
|
|
275770
275926
|
navigator.encodeLocation ? navigator.encodeLocation(match.pathnameBase).pathname : match.pathnameBase])
|
|
275771
|
-
})), parentMatches, dataRouterState);
|
|
275927
|
+
})), parentMatches, dataRouterState, future);
|
|
275772
275928
|
|
|
275773
275929
|
// When a user passes in a `locationArg`, the associated routes need to
|
|
275774
275930
|
// be wrapped in a new `LocationContext.Provider` in order for `useLocation`
|
|
@@ -275849,7 +276005,7 @@ class RenderErrorBoundary extends react__WEBPACK_IMPORTED_MODULE_0__.Component {
|
|
|
275849
276005
|
// this because the error provided from the app state may be cleared without
|
|
275850
276006
|
// the location changing.
|
|
275851
276007
|
return {
|
|
275852
|
-
error: props.error
|
|
276008
|
+
error: props.error !== undefined ? props.error : state.error,
|
|
275853
276009
|
location: state.location,
|
|
275854
276010
|
revalidation: props.revalidation || state.revalidation
|
|
275855
276011
|
};
|
|
@@ -275858,7 +276014,7 @@ class RenderErrorBoundary extends react__WEBPACK_IMPORTED_MODULE_0__.Component {
|
|
|
275858
276014
|
console.error("React Router caught the following error during render", error, errorInfo);
|
|
275859
276015
|
}
|
|
275860
276016
|
render() {
|
|
275861
|
-
return this.state.error ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(RouteContext.Provider, {
|
|
276017
|
+
return this.state.error !== undefined ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(RouteContext.Provider, {
|
|
275862
276018
|
value: this.props.routeContext
|
|
275863
276019
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(RouteErrorContext.Provider, {
|
|
275864
276020
|
value: this.state.error,
|
|
@@ -275883,7 +276039,7 @@ function RenderedRoute(_ref) {
|
|
|
275883
276039
|
value: routeContext
|
|
275884
276040
|
}, children);
|
|
275885
276041
|
}
|
|
275886
|
-
function _renderMatches(matches, parentMatches, dataRouterState) {
|
|
276042
|
+
function _renderMatches(matches, parentMatches, dataRouterState, future) {
|
|
275887
276043
|
var _dataRouterState2;
|
|
275888
276044
|
if (parentMatches === void 0) {
|
|
275889
276045
|
parentMatches = [];
|
|
@@ -275891,6 +276047,9 @@ function _renderMatches(matches, parentMatches, dataRouterState) {
|
|
|
275891
276047
|
if (dataRouterState === void 0) {
|
|
275892
276048
|
dataRouterState = null;
|
|
275893
276049
|
}
|
|
276050
|
+
if (future === void 0) {
|
|
276051
|
+
future = null;
|
|
276052
|
+
}
|
|
275894
276053
|
if (matches == null) {
|
|
275895
276054
|
var _dataRouterState;
|
|
275896
276055
|
if ((_dataRouterState = dataRouterState) != null && _dataRouterState.errors) {
|
|
@@ -275910,18 +276069,66 @@ function _renderMatches(matches, parentMatches, dataRouterState) {
|
|
|
275910
276069
|
!(errorIndex >= 0) ? false ? 0 : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .UNSAFE_invariant */ .J0)(false) : void 0;
|
|
275911
276070
|
renderedMatches = renderedMatches.slice(0, Math.min(renderedMatches.length, errorIndex + 1));
|
|
275912
276071
|
}
|
|
276072
|
+
|
|
276073
|
+
// If we're in a partial hydration mode, detect if we need to render down to
|
|
276074
|
+
// a given HydrateFallback while we load the rest of the hydration data
|
|
276075
|
+
let renderFallback = false;
|
|
276076
|
+
let fallbackIndex = -1;
|
|
276077
|
+
if (dataRouterState && future && future.v7_partialHydration) {
|
|
276078
|
+
for (let i = 0; i < renderedMatches.length; i++) {
|
|
276079
|
+
let match = renderedMatches[i];
|
|
276080
|
+
// Track the deepest fallback up until the first route without data
|
|
276081
|
+
if (match.route.HydrateFallback || match.route.hydrateFallbackElement) {
|
|
276082
|
+
fallbackIndex = i;
|
|
276083
|
+
}
|
|
276084
|
+
if (match.route.id) {
|
|
276085
|
+
let {
|
|
276086
|
+
loaderData,
|
|
276087
|
+
errors
|
|
276088
|
+
} = dataRouterState;
|
|
276089
|
+
let needsToRunLoader = match.route.loader && loaderData[match.route.id] === undefined && (!errors || errors[match.route.id] === undefined);
|
|
276090
|
+
if (match.route.lazy || needsToRunLoader) {
|
|
276091
|
+
// We found the first route that's not ready to render (waiting on
|
|
276092
|
+
// lazy, or has a loader that hasn't run yet). Flag that we need to
|
|
276093
|
+
// render a fallback and render up until the appropriate fallback
|
|
276094
|
+
renderFallback = true;
|
|
276095
|
+
if (fallbackIndex >= 0) {
|
|
276096
|
+
renderedMatches = renderedMatches.slice(0, fallbackIndex + 1);
|
|
276097
|
+
} else {
|
|
276098
|
+
renderedMatches = [renderedMatches[0]];
|
|
276099
|
+
}
|
|
276100
|
+
break;
|
|
276101
|
+
}
|
|
276102
|
+
}
|
|
276103
|
+
}
|
|
276104
|
+
}
|
|
275913
276105
|
return renderedMatches.reduceRight((outlet, match, index) => {
|
|
275914
|
-
|
|
275915
|
-
|
|
276106
|
+
// Only data routers handle errors/fallbacks
|
|
276107
|
+
let error;
|
|
276108
|
+
let shouldRenderHydrateFallback = false;
|
|
275916
276109
|
let errorElement = null;
|
|
276110
|
+
let hydrateFallbackElement = null;
|
|
275917
276111
|
if (dataRouterState) {
|
|
276112
|
+
error = errors && match.route.id ? errors[match.route.id] : undefined;
|
|
275918
276113
|
errorElement = match.route.errorElement || defaultErrorElement;
|
|
276114
|
+
if (renderFallback) {
|
|
276115
|
+
if (fallbackIndex < 0 && index === 0) {
|
|
276116
|
+
warningOnce("route-fallback", false, "No `HydrateFallback` element provided to render during initial hydration");
|
|
276117
|
+
shouldRenderHydrateFallback = true;
|
|
276118
|
+
hydrateFallbackElement = null;
|
|
276119
|
+
} else if (fallbackIndex === index) {
|
|
276120
|
+
shouldRenderHydrateFallback = true;
|
|
276121
|
+
hydrateFallbackElement = match.route.hydrateFallbackElement || null;
|
|
276122
|
+
}
|
|
276123
|
+
}
|
|
275919
276124
|
}
|
|
275920
276125
|
let matches = parentMatches.concat(renderedMatches.slice(0, index + 1));
|
|
275921
276126
|
let getChildren = () => {
|
|
275922
276127
|
let children;
|
|
275923
276128
|
if (error) {
|
|
275924
276129
|
children = errorElement;
|
|
276130
|
+
} else if (shouldRenderHydrateFallback) {
|
|
276131
|
+
children = hydrateFallbackElement;
|
|
275925
276132
|
} else if (match.route.Component) {
|
|
275926
276133
|
// Note: This is a de-optimized path since React won't re-use the
|
|
275927
276134
|
// ReactElement since it's identity changes with each new
|
|
@@ -276092,7 +276299,7 @@ function useRouteError() {
|
|
|
276092
276299
|
|
|
276093
276300
|
// If this was a render error, we put it in a RouteError context inside
|
|
276094
276301
|
// of RenderErrorBoundary
|
|
276095
|
-
if (error) {
|
|
276302
|
+
if (error !== undefined) {
|
|
276096
276303
|
return error;
|
|
276097
276304
|
}
|
|
276098
276305
|
|
|
@@ -276268,6 +276475,11 @@ function RouterProvider(_ref) {
|
|
|
276268
276475
|
// Need to use a layout effect here so we are subscribed early enough to
|
|
276269
276476
|
// pick up on any render-driven redirects/navigations (useEffect/<Navigate>)
|
|
276270
276477
|
React.useLayoutEffect(() => router.subscribe(setState), [router, setState]);
|
|
276478
|
+
React.useEffect(() => {
|
|
276479
|
+
false ? 0 : void 0;
|
|
276480
|
+
// Only log this once on initial mount
|
|
276481
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
276482
|
+
}, []);
|
|
276271
276483
|
let navigator = React.useMemo(() => {
|
|
276272
276484
|
return {
|
|
276273
276485
|
createHref: router.createHref,
|
|
@@ -276306,18 +276518,23 @@ function RouterProvider(_ref) {
|
|
|
276306
276518
|
basename: basename,
|
|
276307
276519
|
location: state.location,
|
|
276308
276520
|
navigationType: state.historyAction,
|
|
276309
|
-
navigator: navigator
|
|
276310
|
-
|
|
276521
|
+
navigator: navigator,
|
|
276522
|
+
future: {
|
|
276523
|
+
v7_relativeSplatPath: router.future.v7_relativeSplatPath
|
|
276524
|
+
}
|
|
276525
|
+
}, state.initialized || router.future.v7_partialHydration ? /*#__PURE__*/React.createElement(DataRoutes, {
|
|
276311
276526
|
routes: router.routes,
|
|
276527
|
+
future: router.future,
|
|
276312
276528
|
state: state
|
|
276313
276529
|
}) : fallbackElement))), null);
|
|
276314
276530
|
}
|
|
276315
276531
|
function DataRoutes(_ref2) {
|
|
276316
276532
|
let {
|
|
276317
276533
|
routes,
|
|
276534
|
+
future,
|
|
276318
276535
|
state
|
|
276319
276536
|
} = _ref2;
|
|
276320
|
-
return useRoutesImpl(routes, undefined, state);
|
|
276537
|
+
return useRoutesImpl(routes, undefined, state, future);
|
|
276321
276538
|
}
|
|
276322
276539
|
/**
|
|
276323
276540
|
* A `<Router>` that stores all entries in memory.
|
|
@@ -276357,7 +276574,8 @@ function MemoryRouter(_ref3) {
|
|
|
276357
276574
|
children: children,
|
|
276358
276575
|
location: state.location,
|
|
276359
276576
|
navigationType: state.action,
|
|
276360
|
-
navigator: history
|
|
276577
|
+
navigator: history,
|
|
276578
|
+
future: future
|
|
276361
276579
|
});
|
|
276362
276580
|
}
|
|
276363
276581
|
/**
|
|
@@ -276377,6 +276595,10 @@ function Navigate(_ref4) {
|
|
|
276377
276595
|
relative
|
|
276378
276596
|
} = _ref4;
|
|
276379
276597
|
!useInRouterContext() ? false ? 0 : UNSAFE_invariant(false) : void 0;
|
|
276598
|
+
let {
|
|
276599
|
+
future,
|
|
276600
|
+
static: isStatic
|
|
276601
|
+
} = React.useContext(NavigationContext);
|
|
276380
276602
|
false ? 0 : void 0;
|
|
276381
276603
|
let {
|
|
276382
276604
|
matches
|
|
@@ -276388,7 +276610,7 @@ function Navigate(_ref4) {
|
|
|
276388
276610
|
|
|
276389
276611
|
// Resolve the path outside of the effect so that when effects run twice in
|
|
276390
276612
|
// StrictMode they navigate to the same place
|
|
276391
|
-
let path = resolveTo(to,
|
|
276613
|
+
let path = resolveTo(to, UNSAFE_getResolveToMatches(matches, future.v7_relativeSplatPath), locationPathname, relative === "path");
|
|
276392
276614
|
let jsonPath = JSON.stringify(path);
|
|
276393
276615
|
React.useEffect(() => navigate(JSON.parse(jsonPath), {
|
|
276394
276616
|
replace,
|
|
@@ -276429,7 +276651,8 @@ function Router(_ref5) {
|
|
|
276429
276651
|
location: locationProp,
|
|
276430
276652
|
navigationType = _remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .Action */ .aU.Pop,
|
|
276431
276653
|
navigator,
|
|
276432
|
-
static: staticProp = false
|
|
276654
|
+
static: staticProp = false,
|
|
276655
|
+
future
|
|
276433
276656
|
} = _ref5;
|
|
276434
276657
|
!!useInRouterContext() ? false ? 0 : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .UNSAFE_invariant */ .J0)(false) : void 0;
|
|
276435
276658
|
|
|
@@ -276439,8 +276662,11 @@ function Router(_ref5) {
|
|
|
276439
276662
|
let navigationContext = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => ({
|
|
276440
276663
|
basename,
|
|
276441
276664
|
navigator,
|
|
276442
|
-
static: staticProp
|
|
276443
|
-
|
|
276665
|
+
static: staticProp,
|
|
276666
|
+
future: _extends({
|
|
276667
|
+
v7_relativeSplatPath: false
|
|
276668
|
+
}, future)
|
|
276669
|
+
}), [basename, future, navigator, staticProp]);
|
|
276444
276670
|
if (typeof locationProp === "string") {
|
|
276445
276671
|
locationProp = (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .parsePath */ .cP)(locationProp);
|
|
276446
276672
|
}
|
|
@@ -276688,6 +276914,13 @@ function mapRouteProperties(route) {
|
|
|
276688
276914
|
Component: undefined
|
|
276689
276915
|
});
|
|
276690
276916
|
}
|
|
276917
|
+
if (route.HydrateFallback) {
|
|
276918
|
+
if (false) {}
|
|
276919
|
+
Object.assign(updates, {
|
|
276920
|
+
hydrateFallbackElement: /*#__PURE__*/React.createElement(route.HydrateFallback),
|
|
276921
|
+
HydrateFallback: undefined
|
|
276922
|
+
});
|
|
276923
|
+
}
|
|
276691
276924
|
if (route.ErrorBoundary) {
|
|
276692
276925
|
if (false) {}
|
|
276693
276926
|
Object.assign(updates, {
|
|
@@ -277095,6 +277328,89 @@ function _unsupportedIterableToArray(o, minLen) {
|
|
|
277095
277328
|
}
|
|
277096
277329
|
module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
277097
277330
|
|
|
277331
|
+
/***/ }),
|
|
277332
|
+
|
|
277333
|
+
/***/ 33901:
|
|
277334
|
+
/***/ ((module, exports) => {
|
|
277335
|
+
|
|
277336
|
+
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
|
|
277337
|
+
Copyright (c) 2018 Jed Watson.
|
|
277338
|
+
Licensed under the MIT License (MIT), see
|
|
277339
|
+
http://jedwatson.github.io/classnames
|
|
277340
|
+
*/
|
|
277341
|
+
/* global define */
|
|
277342
|
+
|
|
277343
|
+
(function () {
|
|
277344
|
+
'use strict';
|
|
277345
|
+
|
|
277346
|
+
var hasOwn = {}.hasOwnProperty;
|
|
277347
|
+
|
|
277348
|
+
function classNames () {
|
|
277349
|
+
var classes = '';
|
|
277350
|
+
|
|
277351
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
277352
|
+
var arg = arguments[i];
|
|
277353
|
+
if (arg) {
|
|
277354
|
+
classes = appendClass(classes, parseValue(arg));
|
|
277355
|
+
}
|
|
277356
|
+
}
|
|
277357
|
+
|
|
277358
|
+
return classes;
|
|
277359
|
+
}
|
|
277360
|
+
|
|
277361
|
+
function parseValue (arg) {
|
|
277362
|
+
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
277363
|
+
return arg;
|
|
277364
|
+
}
|
|
277365
|
+
|
|
277366
|
+
if (typeof arg !== 'object') {
|
|
277367
|
+
return '';
|
|
277368
|
+
}
|
|
277369
|
+
|
|
277370
|
+
if (Array.isArray(arg)) {
|
|
277371
|
+
return classNames.apply(null, arg);
|
|
277372
|
+
}
|
|
277373
|
+
|
|
277374
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
277375
|
+
return arg.toString();
|
|
277376
|
+
}
|
|
277377
|
+
|
|
277378
|
+
var classes = '';
|
|
277379
|
+
|
|
277380
|
+
for (var key in arg) {
|
|
277381
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
277382
|
+
classes = appendClass(classes, key);
|
|
277383
|
+
}
|
|
277384
|
+
}
|
|
277385
|
+
|
|
277386
|
+
return classes;
|
|
277387
|
+
}
|
|
277388
|
+
|
|
277389
|
+
function appendClass (value, newClass) {
|
|
277390
|
+
if (!newClass) {
|
|
277391
|
+
return value;
|
|
277392
|
+
}
|
|
277393
|
+
|
|
277394
|
+
if (value) {
|
|
277395
|
+
return value + ' ' + newClass;
|
|
277396
|
+
}
|
|
277397
|
+
|
|
277398
|
+
return value + newClass;
|
|
277399
|
+
}
|
|
277400
|
+
|
|
277401
|
+
if ( true && module.exports) {
|
|
277402
|
+
classNames.default = classNames;
|
|
277403
|
+
module.exports = classNames;
|
|
277404
|
+
} else if (true) {
|
|
277405
|
+
// register as 'classnames', consistent with npm package name
|
|
277406
|
+
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
|
|
277407
|
+
return classNames;
|
|
277408
|
+
}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
|
|
277409
|
+
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
277410
|
+
} else {}
|
|
277411
|
+
}());
|
|
277412
|
+
|
|
277413
|
+
|
|
277098
277414
|
/***/ }),
|
|
277099
277415
|
|
|
277100
277416
|
/***/ 30926:
|
|
@@ -283232,7 +283548,7 @@ var selectOrdinal = function selectOrdinal() {
|
|
|
283232
283548
|
/******/ // This function allow to reference async chunks
|
|
283233
283549
|
/******/ __webpack_require__.u = (chunkId) => {
|
|
283234
283550
|
/******/ // return url for filenames based on template
|
|
283235
|
-
/******/ return "" + (chunkId === 18 ? "dicom-microscopy-viewer" : chunkId) + ".bundle." + {"12":"
|
|
283551
|
+
/******/ return "" + (chunkId === 18 ? "dicom-microscopy-viewer" : chunkId) + ".bundle." + {"12":"aebca43849fb89e4487c","18":"a7d5060eead13771e784","19":"89cb082532a16f04ce74","23":"9d989522a6e4fdcb9c72","95":"2236101be3cc36b322e8","125":"df666cb677e5a8982157","170":"c897981826842ee375b5","181":"aff453c348111303ceac","185":"87b32cd8145a37e8d07b","199":"08204857a65f29ec5dca","202":"495cba6bbee744cf8f72","223":"d4ac6ef2cfe47a9c4afc","250":"577da106dd763c7bf9d0","281":"987f88c6aea8b8bc35e4","290":"fac1e48a4027ad949764","359":"deef89c05907539f5718","410":"0c7d688cd70a4980fdbb","417":"5c66801d23d0e98c00e6","451":"311cd3be9916e08450e9","466":"e0169e052354437a4fd0","471":"eeb78105b59e688832a6","483":"17425951eb8bd48dce01","506":"65012c25d91e5be25425","530":"f904325ef4195d69ac0e","579":"8c45043bf461a6808b54","613":"a1e84b764ea6f872169a","661":"949c984fe2f9f753b65c","686":"62c827fe4f0d054c164e","687":"72ba0b232154d01b3b5c","738":"443a3c3dd2aaa0d02a38","814":"f6d799e21bcc5b5b0ab3","822":"8b745e28bc9eb9afbc61","831":"127a3064e8844d6d2c82","886":"94a4536167d0f8cae1ae","965":"527f031a2bf5fc4202a0"}[chunkId] + ".js";
|
|
283236
283552
|
/******/ };
|
|
283237
283553
|
/******/ })();
|
|
283238
283554
|
/******/
|
|
@@ -283347,9 +283663,10 @@ var selectOrdinal = function selectOrdinal() {
|
|
|
283347
283663
|
/******/ if (event.type === 'load') {
|
|
283348
283664
|
/******/ resolve();
|
|
283349
283665
|
/******/ } else {
|
|
283350
|
-
/******/ var errorType = event &&
|
|
283666
|
+
/******/ var errorType = event && event.type;
|
|
283351
283667
|
/******/ var realHref = event && event.target && event.target.href || fullhref;
|
|
283352
|
-
/******/ var err = new Error("Loading CSS chunk " + chunkId + " failed.\n(" + realHref + ")");
|
|
283668
|
+
/******/ var err = new Error("Loading CSS chunk " + chunkId + " failed.\n(" + errorType + ": " + realHref + ")");
|
|
283669
|
+
/******/ err.name = "ChunkLoadError";
|
|
283353
283670
|
/******/ err.code = "CSS_CHUNK_LOAD_FAILED";
|
|
283354
283671
|
/******/ err.type = errorType;
|
|
283355
283672
|
/******/ err.request = realHref;
|
|
@@ -283395,7 +283712,7 @@ var selectOrdinal = function selectOrdinal() {
|
|
|
283395
283712
|
/******/ };
|
|
283396
283713
|
/******/
|
|
283397
283714
|
/******/ __webpack_require__.f.miniCss = (chunkId, promises) => {
|
|
283398
|
-
/******/ var cssChunks = {"19":1,"181":1,"250":1,"
|
|
283715
|
+
/******/ var cssChunks = {"19":1,"181":1,"250":1,"290":1,"466":1,"579":1};
|
|
283399
283716
|
/******/ if(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);
|
|
283400
283717
|
/******/ else if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {
|
|
283401
283718
|
/******/ promises.push(installedCssChunks[chunkId] = loadStylesheet(chunkId).then(() => {
|
|
@@ -283526,7 +283843,7 @@ var selectOrdinal = function selectOrdinal() {
|
|
|
283526
283843
|
/******/ "170": [
|
|
283527
283844
|
/******/ 886
|
|
283528
283845
|
/******/ ],
|
|
283529
|
-
/******/ "
|
|
283846
|
+
/******/ "290": [
|
|
283530
283847
|
/******/ 23,
|
|
283531
283848
|
/******/ 181
|
|
283532
283849
|
/******/ ],
|