@vitessce/dev 3.3.5 → 3.3.7
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/blosc-039d2f27.js +888 -0
- package/dist/browser-122c4c35.js +786 -0
- package/dist/chunk-INHXZS53-bee20a28.js +19 -0
- package/dist/{deflate-8218a543.js → deflate-ce341fc9.js} +1 -1
- package/dist/gzip-6a24f0fe.js +30 -0
- package/dist/{hglib-72788bd6.js → hglib-63947de6.js} +1 -1
- package/dist/{index-83a4804b.js → index-e8f9fff3.js} +1393 -216
- package/dist/index.js +2 -1
- package/dist/{jpeg-f123c798.js → jpeg-f8f11856.js} +1 -1
- package/dist/{lerc-67ebd803.js → lerc-07a5c2dc.js} +1 -1
- package/dist/lz4-e899c949.js +805 -0
- package/dist/{lzw-e233027b.js → lzw-c15ba7a3.js} +1 -1
- package/dist/{packbits-f39e1d65.js → packbits-4d4e9377.js} +1 -1
- package/dist/{raw-1a6dda8f.js → raw-dc6571a4.js} +1 -1
- package/dist/{webimage-0404b132.js → webimage-b407d15a.js} +1 -1
- package/dist/zlib-175cd38d.js +30 -0
- package/dist/zstd-9aabb3ce.js +805 -0
- package/package.json +5 -5
- package/dist/blosc-0acfcf7e.js +0 -975
- package/dist/gzip-dd5ab7c8.js +0 -28
- package/dist/lz4-abb4416a.js +0 -919
- package/dist/pako.esm-856454b6-c5c8cd15.js +0 -4066
- package/dist/zlib-cd823c38.js +0 -28
- package/dist/zstd-4072ca78.js +0 -919
|
@@ -26,7 +26,7 @@ var __privateMethod = (obj, member, method2) => {
|
|
|
26
26
|
__accessCheck(obj, member, "access private method");
|
|
27
27
|
return method2;
|
|
28
28
|
};
|
|
29
|
-
var _bytes, _encoder, _encode_buffer, _strides, _TypedArray, _BYTES_PER_ELEMENT, _shape, _endian, _shape2, _strides2, _metadata, _a2, _metadata2, _b, _c, _overrides, _use_suffix_request, _merge_init, merge_init_fn;
|
|
29
|
+
var _bytes, _encoder, _data, _encode_buffer, _strides, _TypedArray, _BYTES_PER_ELEMENT, _shape, _endian, _shape2, _strides2, _encoder_config, _decoder_config, _metadata, _a2, _metadata2, _b, _c, _overrides, _use_suffix_request, _merge_init, merge_init_fn, _overrides2;
|
|
30
30
|
import * as React$6 from "react";
|
|
31
31
|
import React__default, { Children, isValidElement, cloneElement as cloneElement$1, useReducer, useRef, useDebugValue, useEffect, useLayoutEffect as useLayoutEffect$1, createContext as createContext$1, createElement, useContext, useMemo, useCallback, useState, forwardRef, useImperativeHandle, PureComponent, Component as Component$1, Suspense } from "react";
|
|
32
32
|
import * as ReactDOM from "react-dom";
|
|
@@ -79,11 +79,14 @@ const DataType$3 = {
|
|
|
79
79
|
GENOMIC_PROFILES: "genomic-profiles",
|
|
80
80
|
OBS_SPOTS: "obsSpots",
|
|
81
81
|
OBS_POINTS: "obsPoints",
|
|
82
|
-
OBS_LOCATIONS: "obsLocations"
|
|
82
|
+
OBS_LOCATIONS: "obsLocations",
|
|
83
|
+
SAMPLE_SETS: "sampleSets",
|
|
84
|
+
SAMPLE_EDGES: "sampleEdges"
|
|
83
85
|
};
|
|
84
86
|
const FileType$2 = {
|
|
85
87
|
// Joint file types
|
|
86
88
|
ANNDATA_ZARR: "anndata.zarr",
|
|
89
|
+
ANNDATA_ZARR_ZIP: "anndata.zarr.zip",
|
|
87
90
|
SPATIALDATA_ZARR: "spatialdata.zarr",
|
|
88
91
|
// Atomic file types
|
|
89
92
|
OBS_EMBEDDING_CSV: "obsEmbedding.csv",
|
|
@@ -96,6 +99,7 @@ const FileType$2 = {
|
|
|
96
99
|
OBS_SEGMENTATIONS_JSON: "obsSegmentations.json",
|
|
97
100
|
OBS_SETS_CSV: "obsSets.csv",
|
|
98
101
|
OBS_SETS_JSON: "obsSets.json",
|
|
102
|
+
SAMPLE_SETS_CSV: "sampleSets.csv",
|
|
99
103
|
// OME-Zarr
|
|
100
104
|
IMAGE_OME_ZARR: "image.ome-zarr",
|
|
101
105
|
OBS_SEGMENTATIONS_OME_ZARR: "obsSegmentations.ome-zarr",
|
|
@@ -110,6 +114,19 @@ const FileType$2 = {
|
|
|
110
114
|
OBS_SEGMENTATIONS_ANNDATA_ZARR: "obsSegmentations.anndata.zarr",
|
|
111
115
|
OBS_LABELS_ANNDATA_ZARR: "obsLabels.anndata.zarr",
|
|
112
116
|
FEATURE_LABELS_ANNDATA_ZARR: "featureLabels.anndata.zarr",
|
|
117
|
+
SAMPLE_EDGES_ANNDATA_ZARR: "sampleEdges.anndata.zarr",
|
|
118
|
+
// AnnData - zipped
|
|
119
|
+
OBS_FEATURE_MATRIX_ANNDATA_ZARR_ZIP: "obsFeatureMatrix.anndata.zarr.zip",
|
|
120
|
+
OBS_FEATURE_COLUMNS_ANNDATA_ZARR_ZIP: "obsFeatureColumns.anndata.zarr.zip",
|
|
121
|
+
OBS_SETS_ANNDATA_ZARR_ZIP: "obsSets.anndata.zarr.zip",
|
|
122
|
+
OBS_EMBEDDING_ANNDATA_ZARR_ZIP: "obsEmbedding.anndata.zarr.zip",
|
|
123
|
+
OBS_SPOTS_ANNDATA_ZARR_ZIP: "obsSpots.anndata.zarr.zip",
|
|
124
|
+
OBS_POINTS_ANNDATA_ZARR_ZIP: "obsPoints.anndata.zarr.zip",
|
|
125
|
+
OBS_LOCATIONS_ANNDATA_ZARR_ZIP: "obsLocations.anndata.zarr.zip",
|
|
126
|
+
OBS_SEGMENTATIONS_ANNDATA_ZARR_ZIP: "obsSegmentations.anndata.zarr.zip",
|
|
127
|
+
OBS_LABELS_ANNDATA_ZARR_ZIP: "obsLabels.anndata.zarr.zip",
|
|
128
|
+
FEATURE_LABELS_ANNDATA_ZARR_ZIP: "featureLabels.anndata.zarr.zip",
|
|
129
|
+
SAMPLE_EDGES_ANNDATA_ZARR_ZIP: "sampleEdges.anndata.zarr.zip",
|
|
113
130
|
// SpatialData
|
|
114
131
|
IMAGE_SPATIALDATA_ZARR: "image.spatialdata.zarr",
|
|
115
132
|
LABELS_SPATIALDATA_ZARR: "labels.spatialdata.zarr",
|
|
@@ -117,6 +134,7 @@ const FileType$2 = {
|
|
|
117
134
|
OBS_FEATURE_MATRIX_SPATIALDATA_ZARR: "obsFeatureMatrix.spatialdata.zarr",
|
|
118
135
|
OBS_SETS_SPATIALDATA_ZARR: "obsSets.spatialdata.zarr",
|
|
119
136
|
OBS_SPOTS_SPATIALDATA_ZARR: "obsSpots.spatialdata.zarr",
|
|
137
|
+
FEATURE_LABELS_SPATIALDATA_ZARR: "featureLabels.spatialdata.zarr",
|
|
120
138
|
// TODO:
|
|
121
139
|
// OBS_POINTS_SPATIALDATA_ZARR: 'obsPoints.spatialdata.zarr',
|
|
122
140
|
// OBS_LOCATIONS_SPATIALDATA_ZARR: 'obsLocations.spatialdata.zarr',
|
|
@@ -273,7 +291,10 @@ const CoordinationType$2 = {
|
|
|
273
291
|
LEGEND_VISIBLE: "legendVisible",
|
|
274
292
|
SPATIAL_CHANNEL_LABELS_VISIBLE: "spatialChannelLabelsVisible",
|
|
275
293
|
SPATIAL_CHANNEL_LABELS_ORIENTATION: "spatialChannelLabelsOrientation",
|
|
276
|
-
SPATIAL_CHANNEL_LABEL_SIZE: "spatialChannelLabelSize"
|
|
294
|
+
SPATIAL_CHANNEL_LABEL_SIZE: "spatialChannelLabelSize",
|
|
295
|
+
// Multi-sample / comparative
|
|
296
|
+
SAMPLE_TYPE: "sampleType",
|
|
297
|
+
SAMPLE_SET_SELECTION: "sampleSetSelection"
|
|
277
298
|
};
|
|
278
299
|
const STATUS$1 = {
|
|
279
300
|
LOADING: "loading",
|
|
@@ -317,7 +338,49 @@ const DATA_TYPE_COORDINATION_VALUE_USAGE = {
|
|
|
317
338
|
[DataType$3.IMAGE]: [
|
|
318
339
|
CoordinationType$2.FILE_UID
|
|
319
340
|
],
|
|
320
|
-
[DataType$3.NEIGHBORHOODS]: []
|
|
341
|
+
[DataType$3.NEIGHBORHOODS]: [],
|
|
342
|
+
[DataType$3.SAMPLE_SETS]: [
|
|
343
|
+
CoordinationType$2.SAMPLE_TYPE
|
|
344
|
+
],
|
|
345
|
+
[DataType$3.SAMPLE_EDGES]: [
|
|
346
|
+
CoordinationType$2.OBS_TYPE,
|
|
347
|
+
CoordinationType$2.SAMPLE_TYPE
|
|
348
|
+
]
|
|
349
|
+
};
|
|
350
|
+
const ALT_ZARR_STORE_TYPES = {
|
|
351
|
+
[FileType$2.OBS_FEATURE_MATRIX_ANNDATA_ZARR]: {
|
|
352
|
+
zip: FileType$2.OBS_FEATURE_MATRIX_ANNDATA_ZARR_ZIP
|
|
353
|
+
},
|
|
354
|
+
[FileType$2.OBS_FEATURE_COLUMNS_ANNDATA_ZARR]: {
|
|
355
|
+
zip: FileType$2.OBS_FEATURE_COLUMNS_ANNDATA_ZARR_ZIP
|
|
356
|
+
},
|
|
357
|
+
[FileType$2.OBS_SETS_ANNDATA_ZARR]: {
|
|
358
|
+
zip: FileType$2.OBS_SETS_ANNDATA_ZARR_ZIP
|
|
359
|
+
},
|
|
360
|
+
[FileType$2.OBS_EMBEDDING_ANNDATA_ZARR]: {
|
|
361
|
+
zip: FileType$2.OBS_EMBEDDING_ANNDATA_ZARR_ZIP
|
|
362
|
+
},
|
|
363
|
+
[FileType$2.OBS_SPOTS_ANNDATA_ZARR]: {
|
|
364
|
+
zip: FileType$2.OBS_SPOTS_ANNDATA_ZARR_ZIP
|
|
365
|
+
},
|
|
366
|
+
[FileType$2.OBS_POINTS_ANNDATA_ZARR]: {
|
|
367
|
+
zip: FileType$2.OBS_POINTS_ANNDATA_ZARR_ZIP
|
|
368
|
+
},
|
|
369
|
+
[FileType$2.OBS_LOCATIONS_ANNDATA_ZARR]: {
|
|
370
|
+
zip: FileType$2.OBS_LOCATIONS_ANNDATA_ZARR_ZIP
|
|
371
|
+
},
|
|
372
|
+
[FileType$2.OBS_SEGMENTATIONS_ANNDATA_ZARR]: {
|
|
373
|
+
zip: FileType$2.OBS_SEGMENTATIONS_ANNDATA_ZARR_ZIP
|
|
374
|
+
},
|
|
375
|
+
[FileType$2.OBS_LABELS_ANNDATA_ZARR]: {
|
|
376
|
+
zip: FileType$2.OBS_LABELS_ANNDATA_ZARR_ZIP
|
|
377
|
+
},
|
|
378
|
+
[FileType$2.FEATURE_LABELS_ANNDATA_ZARR]: {
|
|
379
|
+
zip: FileType$2.FEATURE_LABELS_ANNDATA_ZARR_ZIP
|
|
380
|
+
},
|
|
381
|
+
[FileType$2.SAMPLE_EDGES_ANNDATA_ZARR]: {
|
|
382
|
+
zip: FileType$2.SAMPLE_EDGES_ANNDATA_ZARR_ZIP
|
|
383
|
+
}
|
|
321
384
|
};
|
|
322
385
|
const AUTO_INDEPENDENT_COORDINATION_TYPES = [
|
|
323
386
|
CoordinationType$2.HEATMAP_ZOOM_X,
|
|
@@ -580,7 +643,9 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
|
580
643
|
CoordinationType$2.OBS_SET_SELECTION,
|
|
581
644
|
CoordinationType$2.OBS_SET_HIGHLIGHT,
|
|
582
645
|
CoordinationType$2.OBS_SET_COLOR,
|
|
583
|
-
CoordinationType$2.ADDITIONAL_OBS_SETS
|
|
646
|
+
CoordinationType$2.ADDITIONAL_OBS_SETS,
|
|
647
|
+
CoordinationType$2.SAMPLE_TYPE,
|
|
648
|
+
CoordinationType$2.SAMPLE_SET_SELECTION
|
|
584
649
|
],
|
|
585
650
|
[ViewType$2.FEATURE_VALUE_HISTOGRAM]: [
|
|
586
651
|
CoordinationType$2.DATASET,
|
|
@@ -705,10 +770,10 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
|
705
770
|
]
|
|
706
771
|
};
|
|
707
772
|
const note = "This file is autogenerated by .changeset/post-changelog.mjs.";
|
|
708
|
-
const version$6 = "3.3.
|
|
709
|
-
const date$5 = "2024-
|
|
773
|
+
const version$6 = "3.3.7";
|
|
774
|
+
const date$5 = "2024-03-04";
|
|
710
775
|
const branch = "changeset-release/main";
|
|
711
|
-
const hash$1 = "
|
|
776
|
+
const hash$1 = "c82b4395";
|
|
712
777
|
const META_VERSION = {
|
|
713
778
|
note,
|
|
714
779
|
version: version$6,
|
|
@@ -1347,8 +1412,9 @@ function getInitialCoordinationScopeName(datasetUid, dataType, i2 = null) {
|
|
|
1347
1412
|
}
|
|
1348
1413
|
const DEFAULT_DARK_COLOR = [50, 50, 50];
|
|
1349
1414
|
const DEFAULT_LIGHT_COLOR$3 = [200, 200, 200];
|
|
1415
|
+
const DEFAULT_LIGHT2_COLOR = [235, 235, 235];
|
|
1350
1416
|
function getDefaultColor(theme) {
|
|
1351
|
-
return theme === "dark" ? DEFAULT_DARK_COLOR : DEFAULT_LIGHT_COLOR$3;
|
|
1417
|
+
return theme === "dark" ? DEFAULT_DARK_COLOR : theme === "light" ? DEFAULT_LIGHT_COLOR$3 : DEFAULT_LIGHT2_COLOR;
|
|
1352
1418
|
}
|
|
1353
1419
|
const PALETTE = [
|
|
1354
1420
|
[68, 119, 170],
|
|
@@ -10169,7 +10235,7 @@ function useIsFocusVisible() {
|
|
|
10169
10235
|
function _toArray(arr) {
|
|
10170
10236
|
return _arrayWithHoles$9(arr) || _iterableToArray$k(arr) || _unsupportedIterableToArray$o(arr) || _nonIterableRest$9();
|
|
10171
10237
|
}
|
|
10172
|
-
const config$
|
|
10238
|
+
const config$4 = {
|
|
10173
10239
|
disabled: false
|
|
10174
10240
|
};
|
|
10175
10241
|
var timeoutsShape = _pt.oneOfType([_pt.number, _pt.shape({
|
|
@@ -10303,7 +10369,7 @@ var Transition$1 = /* @__PURE__ */ function(_React$Component) {
|
|
|
10303
10369
|
var _ref22 = this.props.nodeRef ? [appearing] : [ReactDOM__default.findDOMNode(this), appearing], maybeNode = _ref22[0], maybeAppearing = _ref22[1];
|
|
10304
10370
|
var timeouts = this.getTimeouts();
|
|
10305
10371
|
var enterTimeout = appearing ? timeouts.appear : timeouts.enter;
|
|
10306
|
-
if (!mounting && !enter || config$
|
|
10372
|
+
if (!mounting && !enter || config$4.disabled) {
|
|
10307
10373
|
this.safeSetState({
|
|
10308
10374
|
status: ENTERED
|
|
10309
10375
|
}, function() {
|
|
@@ -10330,7 +10396,7 @@ var Transition$1 = /* @__PURE__ */ function(_React$Component) {
|
|
|
10330
10396
|
var exit = this.props.exit;
|
|
10331
10397
|
var timeouts = this.getTimeouts();
|
|
10332
10398
|
var maybeNode = this.props.nodeRef ? void 0 : ReactDOM__default.findDOMNode(this);
|
|
10333
|
-
if (!exit || config$
|
|
10399
|
+
if (!exit || config$4.disabled) {
|
|
10334
10400
|
this.safeSetState({
|
|
10335
10401
|
status: EXITED
|
|
10336
10402
|
}, function() {
|
|
@@ -35143,6 +35209,7 @@ const annDataConvenienceObsEmbeddingItem = z.object({
|
|
|
35143
35209
|
});
|
|
35144
35210
|
const annDataObsLabels = annDataObs;
|
|
35145
35211
|
const annDataFeatureLabels = annDataObs;
|
|
35212
|
+
const annDataSampleEdges = annDataObs;
|
|
35146
35213
|
const annDataObsFeatureMatrix = z.object({
|
|
35147
35214
|
path: z.string(),
|
|
35148
35215
|
featureFilterPath: z.string().optional().describe("If the feature index should be filtered, put a boolean column here (analogous to the previous geneFilter option). e.g., var/in_obsm_X_small_matrix"),
|
|
@@ -35224,6 +35291,7 @@ const obsFeatureMatrixAnndataSchema = annDataObsFeatureMatrix;
|
|
|
35224
35291
|
const obsLabelsAnndataSchema = annDataObsLabels;
|
|
35225
35292
|
const featureLabelsAnndataSchema = annDataFeatureLabels;
|
|
35226
35293
|
const obsFeatureColumnsAnndataSchema = annDataObsFeatureColumns;
|
|
35294
|
+
const sampleEdgesAnndataSchema = annDataSampleEdges;
|
|
35227
35295
|
const obsEmbeddingCsvSchema = z.object({
|
|
35228
35296
|
obsIndex: z.string(),
|
|
35229
35297
|
obsEmbedding: z.array(z.string()).length(2)
|
|
@@ -35262,6 +35330,17 @@ const obsSetsCsvSchema = z.object({
|
|
|
35262
35330
|
scoreColumn: z.string().optional()
|
|
35263
35331
|
}))
|
|
35264
35332
|
});
|
|
35333
|
+
const sampleSetsCsvSchema = z.object({
|
|
35334
|
+
sampleIndex: z.string(),
|
|
35335
|
+
sampleSets: z.array(z.object({
|
|
35336
|
+
name: z.string(),
|
|
35337
|
+
column: z.union([
|
|
35338
|
+
z.string(),
|
|
35339
|
+
z.array(z.string())
|
|
35340
|
+
]),
|
|
35341
|
+
scoreColumn: z.string().optional()
|
|
35342
|
+
}))
|
|
35343
|
+
});
|
|
35265
35344
|
const anndataZarrSchema = z.object({
|
|
35266
35345
|
obsLabels: z.union([
|
|
35267
35346
|
annDataObsLabels,
|
|
@@ -42635,6 +42714,7 @@ function createLoaders(datasets, configDescription, fileTypes, coordinationTypes
|
|
|
42635
42714
|
if (!dataSources.has(dataSourceKey)) {
|
|
42636
42715
|
dataSources.set(dataSourceKey, new DataSourceClass({
|
|
42637
42716
|
url,
|
|
42717
|
+
fileType,
|
|
42638
42718
|
requestInit: requestInit2,
|
|
42639
42719
|
// Optionally, pass a Zarrita store to the data source,
|
|
42640
42720
|
// if one was mapped to this URL.
|
|
@@ -43940,7 +44020,7 @@ function createGenerateClassName(customPrefix) {
|
|
|
43940
44020
|
};
|
|
43941
44021
|
}
|
|
43942
44022
|
function VitS(props2) {
|
|
43943
|
-
const { config: config3, stores, rowHeight, height: height2, theme, onWarn, onConfigChange, onLoaderChange, validateConfig = true, validateOnConfigChange = false, isBounded = false, uid: uid2 = null, viewTypes: viewTypesProp, fileTypes: fileTypesProp, jointFileTypes: jointFileTypesProp, coordinationTypes: coordinationTypesProp, warning: warning2 } = props2;
|
|
44023
|
+
const { config: config3, stores, rowHeight, height: height2, theme, onWarn, onConfigChange, onLoaderChange, validateConfig = true, validateOnConfigChange = false, isBounded = false, uid: uid2 = null, remountOnUidChange = true, viewTypes: viewTypesProp, fileTypes: fileTypesProp, jointFileTypes: jointFileTypesProp, coordinationTypes: coordinationTypesProp, warning: warning2 } = props2;
|
|
43944
44024
|
const viewTypes = useMemo(() => viewTypesProp || [], [viewTypesProp]);
|
|
43945
44025
|
const fileTypes = useMemo(() => fileTypesProp || [], [fileTypesProp]);
|
|
43946
44026
|
const jointFileTypes = useMemo(() => jointFileTypesProp || [], [jointFileTypesProp]);
|
|
@@ -44017,7 +44097,7 @@ function VitS(props2) {
|
|
|
44017
44097
|
}
|
|
44018
44098
|
return createViewConfigStore(null, null);
|
|
44019
44099
|
}, [success, configKey]);
|
|
44020
|
-
return success ? jsxRuntimeExports.jsx(StylesProvider, { generateClassName: generateClassName2, children: jsxRuntimeExports.jsx(ThemeProvider, { theme: muiTheme[theme], children: jsxRuntimeExports.jsx(QueryClientProvider, { client: queryClient, children: jsxRuntimeExports.jsx(ViewConfigProvider, { createStore: createViewConfigStoreClosure, children: jsxRuntimeExports.jsxs(AuxiliaryProvider, { createStore: createAuxiliaryStore, children: [jsxRuntimeExports.jsx(VitessceGrid, { success, configKey, viewTypes, fileTypes, coordinationTypes, config: configOrWarning, rowHeight, height: height2, theme, isBounded, stores }), jsxRuntimeExports.jsx(CallbackPublisher, { onWarn, onConfigChange, onLoaderChange, validateOnConfigChange, pluginSpecificConfigSchema })] }) }
|
|
44100
|
+
return success ? jsxRuntimeExports.jsx(StylesProvider, { generateClassName: generateClassName2, children: jsxRuntimeExports.jsx(ThemeProvider, { theme: muiTheme[theme], children: jsxRuntimeExports.jsx(QueryClientProvider, { client: queryClient, children: jsxRuntimeExports.jsx(ViewConfigProvider, { createStore: createViewConfigStoreClosure, ...remountOnUidChange ? { key: configKey } : {}, children: jsxRuntimeExports.jsxs(AuxiliaryProvider, { createStore: createAuxiliaryStore, children: [jsxRuntimeExports.jsx(VitessceGrid, { success, configKey, viewTypes, fileTypes, coordinationTypes, config: configOrWarning, rowHeight, height: height2, theme, isBounded, stores }), jsxRuntimeExports.jsx(CallbackPublisher, { onWarn, onConfigChange, onLoaderChange, validateOnConfigChange, pluginSpecificConfigSchema })] }) }) }) }) }) : jsxRuntimeExports.jsx(StylesProvider, { generateClassName: generateClassName2, children: jsxRuntimeExports.jsx(ThemeProvider, { theme: muiTheme[theme], children: jsxRuntimeExports.jsx(Warning, { ...configOrWarning }) }) });
|
|
44021
44101
|
}
|
|
44022
44102
|
const AddIcon = createSvgIcon(/* @__PURE__ */ React$6.createElement("path", {
|
|
44023
44103
|
d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
|
|
@@ -44394,6 +44474,12 @@ function useObsSegmentationsData(loaders, dataset, isRequired, coordinationSette
|
|
|
44394
44474
|
function useObsSetsData(loaders, dataset, isRequired, coordinationSetters, initialCoordinationValues, matchOn) {
|
|
44395
44475
|
return useDataType(DataType$3.OBS_SETS, loaders, dataset, isRequired, coordinationSetters, initialCoordinationValues, matchOn);
|
|
44396
44476
|
}
|
|
44477
|
+
function useSampleSetsData(loaders, dataset, isRequired, coordinationSetters, initialCoordinationValues, matchOn) {
|
|
44478
|
+
return useDataType(DataType$3.SAMPLE_SETS, loaders, dataset, isRequired, coordinationSetters, initialCoordinationValues, matchOn);
|
|
44479
|
+
}
|
|
44480
|
+
function useSampleEdgesData(loaders, dataset, isRequired, coordinationSetters, initialCoordinationValues, matchOn) {
|
|
44481
|
+
return useDataType(DataType$3.SAMPLE_EDGES, loaders, dataset, isRequired, coordinationSetters, initialCoordinationValues, matchOn);
|
|
44482
|
+
}
|
|
44397
44483
|
function useObsFeatureMatrixData(loaders, dataset, isRequired, coordinationSetters, initialCoordinationValues, matchOn) {
|
|
44398
44484
|
return useDataType(DataType$3.OBS_FEATURE_MATRIX, loaders, dataset, isRequired, coordinationSetters, initialCoordinationValues, matchOn);
|
|
44399
44485
|
}
|
|
@@ -44570,6 +44656,20 @@ function useSpotMultiObsSets(coordinationScopes, coordinationScopesBy, loaders,
|
|
|
44570
44656
|
const [obsSetsData, obsSetsDataStatus, obsSetsUrls] = useDataTypeMulti(DataType$3.OBS_SETS, loaders, dataset, false, {}, {}, matchOnObj);
|
|
44571
44657
|
return [obsSetsData, obsSetsDataStatus, obsSetsUrls];
|
|
44572
44658
|
}
|
|
44659
|
+
function useSpotMultiFeatureLabels(coordinationScopes, coordinationScopesBy, loaders, dataset) {
|
|
44660
|
+
const featureTypeCoordination = useComplexCoordination([
|
|
44661
|
+
CoordinationType$2.FEATURE_TYPE
|
|
44662
|
+
], coordinationScopes, coordinationScopesBy, CoordinationType$2.SPOT_LAYER);
|
|
44663
|
+
const matchOnObj = useMemo(
|
|
44664
|
+
() => featureTypeCoordination[0],
|
|
44665
|
+
// imageCoordination reference changes each render,
|
|
44666
|
+
// use coordinationScopes and coordinationScopesBy which are
|
|
44667
|
+
// indirect dependencies here.
|
|
44668
|
+
[coordinationScopes, coordinationScopesBy]
|
|
44669
|
+
);
|
|
44670
|
+
const [featureLabelsData, featureLabelsStatus, featureLabelsUrls] = useDataTypeMulti(DataType$3.FEATURE_LABELS, loaders, dataset, false, {}, {}, matchOnObj);
|
|
44671
|
+
return [featureLabelsData, featureLabelsStatus, featureLabelsUrls];
|
|
44672
|
+
}
|
|
44573
44673
|
function useMultiObsLabels(coordinationScopes, obsType, loaders, dataset) {
|
|
44574
44674
|
const obsLabelsTypes = useMultiCoordinationValues(CoordinationType$2.OBS_LABELS_TYPE, coordinationScopes);
|
|
44575
44675
|
const obsLabelsMatchOnObj = useMemo(() => Object.fromEntries(Object.entries(obsLabelsTypes).map(([scope, obsLabelsType]) => [
|
|
@@ -45113,10 +45213,10 @@ const $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c = typeof document !== "undefined
|
|
|
45113
45213
|
let $bdb11010cef70236$var$idsUpdaterMap = /* @__PURE__ */ new Map();
|
|
45114
45214
|
function $bdb11010cef70236$export$f680877a34711e37(defaultId2) {
|
|
45115
45215
|
let [value2, setValue] = useState(defaultId2);
|
|
45116
|
-
let
|
|
45216
|
+
let nextId2 = useRef(null);
|
|
45117
45217
|
let res = $b5e257d569688ac6$export$619500959fc48b26(value2);
|
|
45118
45218
|
let updateValue = useCallback((val) => {
|
|
45119
|
-
|
|
45219
|
+
nextId2.current = val;
|
|
45120
45220
|
}, []);
|
|
45121
45221
|
$bdb11010cef70236$var$idsUpdaterMap.set(res, updateValue);
|
|
45122
45222
|
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
@@ -45128,9 +45228,9 @@ function $bdb11010cef70236$export$f680877a34711e37(defaultId2) {
|
|
|
45128
45228
|
res
|
|
45129
45229
|
]);
|
|
45130
45230
|
useEffect(() => {
|
|
45131
|
-
let newId =
|
|
45231
|
+
let newId = nextId2.current;
|
|
45132
45232
|
if (newId) {
|
|
45133
|
-
|
|
45233
|
+
nextId2.current = null;
|
|
45134
45234
|
setValue(newId);
|
|
45135
45235
|
}
|
|
45136
45236
|
});
|
|
@@ -68953,7 +69053,7 @@ const isPureObject = (x2) => isObject$4(x2) && x2.constructor === {}.constructor
|
|
|
68953
69053
|
const isIterable$1 = (x2) => x2 && typeof x2[Symbol.iterator] === "function";
|
|
68954
69054
|
const isAsyncIterable$1 = (x2) => x2 && typeof x2[Symbol.asyncIterator] === "function";
|
|
68955
69055
|
const isResponse = (x2) => typeof Response !== "undefined" && x2 instanceof Response || x2 && x2.arrayBuffer && x2.text && x2.json;
|
|
68956
|
-
const isBlob = (x2) => typeof Blob !== "undefined" && x2 instanceof Blob;
|
|
69056
|
+
const isBlob$1 = (x2) => typeof Blob !== "undefined" && x2 instanceof Blob;
|
|
68957
69057
|
const isBuffer$2 = (x2) => x2 && typeof x2 === "object" && x2.isBuffer;
|
|
68958
69058
|
const isReadableDOMStream = (x2) => typeof ReadableStream !== "undefined" && x2 instanceof ReadableStream || isObject$4(x2) && isFunction$4(x2.tee) && isFunction$4(x2.cancel) && isFunction$4(x2.getReader);
|
|
68959
69059
|
const isReadableNodeStream = (x2) => isObject$4(x2) && isFunction$4(x2.read) && isFunction$4(x2.pipe) && isBoolean$4(x2.readable);
|
|
@@ -68984,7 +69084,7 @@ function getResourceUrlAndType(resource) {
|
|
|
68984
69084
|
type: parseMIMEType(contentTypeHeader) || parseMIMETypeFromURL(url)
|
|
68985
69085
|
};
|
|
68986
69086
|
}
|
|
68987
|
-
if (isBlob(resource)) {
|
|
69087
|
+
if (isBlob$1(resource)) {
|
|
68988
69088
|
return {
|
|
68989
69089
|
url: stripQueryString(resource.name || ""),
|
|
68990
69090
|
type: resource.type || ""
|
|
@@ -69005,7 +69105,7 @@ function getResourceContentLength(resource) {
|
|
|
69005
69105
|
if (isResponse(resource)) {
|
|
69006
69106
|
return resource.headers["content-length"] || -1;
|
|
69007
69107
|
}
|
|
69008
|
-
if (isBlob(resource)) {
|
|
69108
|
+
if (isBlob$1(resource)) {
|
|
69009
69109
|
return resource.size;
|
|
69010
69110
|
}
|
|
69011
69111
|
if (typeof resource === "string") {
|
|
@@ -69908,7 +70008,7 @@ async function selectLoader(data2, loaders = [], options, context2) {
|
|
|
69908
70008
|
if (loader2) {
|
|
69909
70009
|
return loader2;
|
|
69910
70010
|
}
|
|
69911
|
-
if (isBlob(data2)) {
|
|
70011
|
+
if (isBlob$1(data2)) {
|
|
69912
70012
|
data2 = await data2.slice(0, 10).arrayBuffer();
|
|
69913
70013
|
loader2 = selectLoaderSync(data2, loaders, options, context2);
|
|
69914
70014
|
}
|
|
@@ -70162,7 +70262,7 @@ function makeIterator(data2, options) {
|
|
|
70162
70262
|
if (data2 instanceof ArrayBuffer) {
|
|
70163
70263
|
return makeArrayBufferIterator(data2, options);
|
|
70164
70264
|
}
|
|
70165
|
-
if (isBlob(data2)) {
|
|
70265
|
+
if (isBlob$1(data2)) {
|
|
70166
70266
|
return makeBlobIterator(data2, options);
|
|
70167
70267
|
}
|
|
70168
70268
|
if (isReadableStream(data2)) {
|
|
@@ -70209,7 +70309,7 @@ async function getArrayBufferOrStringFromData(data2, loader2, options) {
|
|
|
70209
70309
|
if (typeof data2 === "string" || isArrayBuffer) {
|
|
70210
70310
|
return getArrayBufferOrStringFromDataSync(data2, loader2);
|
|
70211
70311
|
}
|
|
70212
|
-
if (isBlob(data2)) {
|
|
70312
|
+
if (isBlob$1(data2)) {
|
|
70213
70313
|
data2 = await makeResponse(data2);
|
|
70214
70314
|
}
|
|
70215
70315
|
if (isResponse(data2)) {
|
|
@@ -70328,7 +70428,7 @@ async function load$2(url, loaders, options, context2) {
|
|
|
70328
70428
|
if (typeof url === "string") {
|
|
70329
70429
|
data2 = await fetch2(url);
|
|
70330
70430
|
}
|
|
70331
|
-
if (isBlob(url)) {
|
|
70431
|
+
if (isBlob$1(url)) {
|
|
70332
70432
|
data2 = await fetch2(url);
|
|
70333
70433
|
}
|
|
70334
70434
|
return await parse$b(data2, loaders, options);
|
|
@@ -78553,7 +78653,7 @@ function assert$7(condition, message) {
|
|
|
78553
78653
|
}
|
|
78554
78654
|
const RADIANS_TO_DEGREES$2 = 1 / Math.PI * 180;
|
|
78555
78655
|
const DEGREES_TO_RADIANS$7 = 1 / 180 * Math.PI;
|
|
78556
|
-
const config$
|
|
78656
|
+
const config$3 = {
|
|
78557
78657
|
EPSILON: 1e-12,
|
|
78558
78658
|
debug: false,
|
|
78559
78659
|
precision: 4,
|
|
@@ -78563,13 +78663,13 @@ const config$2 = {
|
|
|
78563
78663
|
};
|
|
78564
78664
|
function configure(options) {
|
|
78565
78665
|
for (const key2 in options) {
|
|
78566
|
-
assert$7(key2 in config$
|
|
78567
|
-
config$
|
|
78666
|
+
assert$7(key2 in config$3);
|
|
78667
|
+
config$3[key2] = options[key2];
|
|
78568
78668
|
}
|
|
78569
|
-
return config$
|
|
78669
|
+
return config$3;
|
|
78570
78670
|
}
|
|
78571
78671
|
function formatValue$4(value2, {
|
|
78572
|
-
precision = config$
|
|
78672
|
+
precision = config$3.precision
|
|
78573
78673
|
} = {}) {
|
|
78574
78674
|
value2 = round$3(value2);
|
|
78575
78675
|
return "".concat(parseFloat(value2.toPrecision(precision)));
|
|
@@ -78620,9 +78720,9 @@ function lerp$7(a2, b2, t4) {
|
|
|
78620
78720
|
return t4 * b2 + (1 - t4) * a2;
|
|
78621
78721
|
}
|
|
78622
78722
|
function equals$3(a2, b2, epsilon3) {
|
|
78623
|
-
const oldEpsilon = config$
|
|
78723
|
+
const oldEpsilon = config$3.EPSILON;
|
|
78624
78724
|
if (epsilon3) {
|
|
78625
|
-
config$
|
|
78725
|
+
config$3.EPSILON = epsilon3;
|
|
78626
78726
|
}
|
|
78627
78727
|
try {
|
|
78628
78728
|
if (a2 === b2) {
|
|
@@ -78646,11 +78746,11 @@ function equals$3(a2, b2, epsilon3) {
|
|
|
78646
78746
|
return b2.equals(a2);
|
|
78647
78747
|
}
|
|
78648
78748
|
if (typeof a2 === "number" && typeof b2 === "number") {
|
|
78649
|
-
return Math.abs(a2 - b2) <= config$
|
|
78749
|
+
return Math.abs(a2 - b2) <= config$3.EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2));
|
|
78650
78750
|
}
|
|
78651
78751
|
return false;
|
|
78652
78752
|
} finally {
|
|
78653
|
-
config$
|
|
78753
|
+
config$3.EPSILON = oldEpsilon;
|
|
78654
78754
|
}
|
|
78655
78755
|
}
|
|
78656
78756
|
function exactEquals(a2, b2) {
|
|
@@ -78679,18 +78779,18 @@ function exactEquals(a2, b2) {
|
|
|
78679
78779
|
return false;
|
|
78680
78780
|
}
|
|
78681
78781
|
function withEpsilon(epsilon3, func) {
|
|
78682
|
-
const oldPrecision = config$
|
|
78683
|
-
config$
|
|
78782
|
+
const oldPrecision = config$3.EPSILON;
|
|
78783
|
+
config$3.EPSILON = epsilon3;
|
|
78684
78784
|
let value2;
|
|
78685
78785
|
try {
|
|
78686
78786
|
value2 = func();
|
|
78687
78787
|
} finally {
|
|
78688
|
-
config$
|
|
78788
|
+
config$3.EPSILON = oldPrecision;
|
|
78689
78789
|
}
|
|
78690
78790
|
return value2;
|
|
78691
78791
|
}
|
|
78692
78792
|
function round$3(value2) {
|
|
78693
|
-
return Math.round(value2 / config$
|
|
78793
|
+
return Math.round(value2 / config$3.EPSILON) * config$3.EPSILON;
|
|
78694
78794
|
}
|
|
78695
78795
|
function duplicateArray(array2) {
|
|
78696
78796
|
return array2.clone ? array2.clone() : new Array(array2.length);
|
|
@@ -78759,7 +78859,7 @@ class MathArray extends _extendableBuiltin(Array) {
|
|
|
78759
78859
|
return new Float32Array(this);
|
|
78760
78860
|
}
|
|
78761
78861
|
toString() {
|
|
78762
|
-
return this.formatString(config$
|
|
78862
|
+
return this.formatString(config$3);
|
|
78763
78863
|
}
|
|
78764
78864
|
formatString(opts2) {
|
|
78765
78865
|
let string2 = "";
|
|
@@ -78859,7 +78959,7 @@ class MathArray extends _extendableBuiltin(Array) {
|
|
|
78859
78959
|
return this.check();
|
|
78860
78960
|
}
|
|
78861
78961
|
check() {
|
|
78862
|
-
if (config$
|
|
78962
|
+
if (config$3.debug && !this.validate()) {
|
|
78863
78963
|
throw new Error("math.gl: ".concat(this.constructor.name, " some fields set to invalid numbers'"));
|
|
78864
78964
|
}
|
|
78865
78965
|
return this;
|
|
@@ -78926,7 +79026,7 @@ function checkNumber(value2) {
|
|
|
78926
79026
|
return value2;
|
|
78927
79027
|
}
|
|
78928
79028
|
function checkVector(v, length2, callerName = "") {
|
|
78929
|
-
if (config$
|
|
79029
|
+
if (config$3.debug && !validateVector(v, length2)) {
|
|
78930
79030
|
throw new Error("math.gl: ".concat(callerName, " some fields set to invalid numbers'"));
|
|
78931
79031
|
}
|
|
78932
79032
|
return v;
|
|
@@ -79184,7 +79284,7 @@ class Vector2 extends Vector {
|
|
|
79184
79284
|
if (isArray$3(x2) && arguments.length === 1) {
|
|
79185
79285
|
this.copy(x2);
|
|
79186
79286
|
} else {
|
|
79187
|
-
if (config$
|
|
79287
|
+
if (config$3.debug) {
|
|
79188
79288
|
checkNumber(x2);
|
|
79189
79289
|
checkNumber(y2);
|
|
79190
79290
|
}
|
|
@@ -79203,7 +79303,7 @@ class Vector2 extends Vector {
|
|
|
79203
79303
|
return this.check();
|
|
79204
79304
|
}
|
|
79205
79305
|
fromObject(object2) {
|
|
79206
|
-
if (config$
|
|
79306
|
+
if (config$3.debug) {
|
|
79207
79307
|
checkNumber(object2.x);
|
|
79208
79308
|
checkNumber(object2.y);
|
|
79209
79309
|
}
|
|
@@ -79456,7 +79556,7 @@ class Vector3 extends Vector {
|
|
|
79456
79556
|
if (arguments.length === 1 && isArray$3(x2)) {
|
|
79457
79557
|
this.copy(x2);
|
|
79458
79558
|
} else {
|
|
79459
|
-
if (config$
|
|
79559
|
+
if (config$3.debug) {
|
|
79460
79560
|
checkNumber(x2);
|
|
79461
79561
|
checkNumber(y2);
|
|
79462
79562
|
checkNumber(z2);
|
|
@@ -79479,7 +79579,7 @@ class Vector3 extends Vector {
|
|
|
79479
79579
|
return this.check();
|
|
79480
79580
|
}
|
|
79481
79581
|
fromObject(object2) {
|
|
79482
|
-
if (config$
|
|
79582
|
+
if (config$3.debug) {
|
|
79483
79583
|
checkNumber(object2.x);
|
|
79484
79584
|
checkNumber(object2.y);
|
|
79485
79585
|
checkNumber(object2.z);
|
|
@@ -79570,7 +79670,7 @@ class Vector4 extends Vector {
|
|
|
79570
79670
|
if (isArray$3(x2) && arguments.length === 1) {
|
|
79571
79671
|
this.copy(x2);
|
|
79572
79672
|
} else {
|
|
79573
|
-
if (config$
|
|
79673
|
+
if (config$3.debug) {
|
|
79574
79674
|
checkNumber(x2);
|
|
79575
79675
|
checkNumber(y2);
|
|
79576
79676
|
checkNumber(z2);
|
|
@@ -79597,7 +79697,7 @@ class Vector4 extends Vector {
|
|
|
79597
79697
|
return this.check();
|
|
79598
79698
|
}
|
|
79599
79699
|
fromObject(object2) {
|
|
79600
|
-
if (config$
|
|
79700
|
+
if (config$3.debug) {
|
|
79601
79701
|
checkNumber(object2.x);
|
|
79602
79702
|
checkNumber(object2.y);
|
|
79603
79703
|
checkNumber(object2.z);
|
|
@@ -79655,7 +79755,7 @@ class Vector4 extends Vector {
|
|
|
79655
79755
|
let Matrix$1 = class Matrix extends MathArray {
|
|
79656
79756
|
toString() {
|
|
79657
79757
|
let string2 = "[";
|
|
79658
|
-
if (config$
|
|
79758
|
+
if (config$3.printRowMajor) {
|
|
79659
79759
|
string2 += "row-major:";
|
|
79660
79760
|
for (let row = 0; row < this.RANK; ++row) {
|
|
79661
79761
|
for (let col = 0; col < this.RANK; ++col) {
|
|
@@ -81518,7 +81618,7 @@ class SphericalCoordinates {
|
|
|
81518
81618
|
this.check();
|
|
81519
81619
|
}
|
|
81520
81620
|
toString() {
|
|
81521
|
-
return this.formatString(config$
|
|
81621
|
+
return this.formatString(config$3);
|
|
81522
81622
|
}
|
|
81523
81623
|
formatString({
|
|
81524
81624
|
printTypes = false
|
|
@@ -125093,7 +125193,7 @@ function fromCartographic(cartographic, result = [], map2 = identity$f) {
|
|
|
125093
125193
|
return result;
|
|
125094
125194
|
}
|
|
125095
125195
|
function fromCartographicToRadians(cartographic, vector = []) {
|
|
125096
|
-
return fromCartographic(cartographic, vector, config$
|
|
125196
|
+
return fromCartographic(cartographic, vector, config$3._cartographicRadians ? identity$f : toRadians);
|
|
125097
125197
|
}
|
|
125098
125198
|
function toCartographic(vector, cartographic, map2 = identity$f) {
|
|
125099
125199
|
if ("longitude" in cartographic) {
|
|
@@ -125112,7 +125212,7 @@ function toCartographic(vector, cartographic, map2 = identity$f) {
|
|
|
125112
125212
|
return cartographic;
|
|
125113
125213
|
}
|
|
125114
125214
|
function toCartographicFromRadians(vector, cartographic) {
|
|
125115
|
-
return toCartographic(vector, cartographic, config$
|
|
125215
|
+
return toCartographic(vector, cartographic, config$3._cartographicRadians ? identity$f : toDegrees);
|
|
125116
125216
|
}
|
|
125117
125217
|
const scratchVector$4 = new Vector3();
|
|
125118
125218
|
const scaleToGeodeticSurfaceIntersection = new Vector3();
|
|
@@ -137667,14 +137767,14 @@ var jsts_min = { exports: {} };
|
|
|
137667
137767
|
return 1e-15;
|
|
137668
137768
|
}, Object.defineProperties(q, B2);
|
|
137669
137769
|
var V = function() {
|
|
137670
|
-
},
|
|
137671
|
-
|
|
137770
|
+
}, U2 = { X: { configurable: true }, Y: { configurable: true }, Z: { configurable: true }, M: { configurable: true } };
|
|
137771
|
+
U2.X.get = function() {
|
|
137672
137772
|
return 0;
|
|
137673
|
-
},
|
|
137773
|
+
}, U2.Y.get = function() {
|
|
137674
137774
|
return 1;
|
|
137675
|
-
},
|
|
137775
|
+
}, U2.Z.get = function() {
|
|
137676
137776
|
return 2;
|
|
137677
|
-
},
|
|
137777
|
+
}, U2.M.get = function() {
|
|
137678
137778
|
return 3;
|
|
137679
137779
|
}, V.prototype.setOrdinate = function(t5, e4, n4) {
|
|
137680
137780
|
}, V.prototype.size = function() {
|
|
@@ -137692,7 +137792,7 @@ var jsts_min = { exports: {} };
|
|
|
137692
137792
|
return [x2];
|
|
137693
137793
|
}, V.prototype.getClass = function() {
|
|
137694
137794
|
return V;
|
|
137695
|
-
}, Object.defineProperties(V,
|
|
137795
|
+
}, Object.defineProperties(V, U2);
|
|
137696
137796
|
var z2 = function() {
|
|
137697
137797
|
}, X3 = function(t5) {
|
|
137698
137798
|
function e4() {
|
|
@@ -166102,7 +166202,7 @@ const esm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
|
|
|
166102
166202
|
atan: atan$3,
|
|
166103
166203
|
clamp: clamp$3,
|
|
166104
166204
|
clone: clone$9,
|
|
166105
|
-
config: config$
|
|
166205
|
+
config: config$3,
|
|
166106
166206
|
configure,
|
|
166107
166207
|
cos: cos$5,
|
|
166108
166208
|
degrees: degrees$5,
|
|
@@ -170536,16 +170636,16 @@ async function getDecoder(fileDirectory) {
|
|
|
170536
170636
|
const Decoder = await importFn();
|
|
170537
170637
|
return new Decoder(fileDirectory);
|
|
170538
170638
|
}
|
|
170539
|
-
addDecoder([void 0, 1], () => import("./raw-
|
|
170540
|
-
addDecoder(5, () => import("./lzw-
|
|
170639
|
+
addDecoder([void 0, 1], () => import("./raw-dc6571a4.js").then((m2) => m2.default));
|
|
170640
|
+
addDecoder(5, () => import("./lzw-c15ba7a3.js").then((m2) => m2.default));
|
|
170541
170641
|
addDecoder(6, () => {
|
|
170542
170642
|
throw new Error("old style JPEG compression is not supported.");
|
|
170543
170643
|
});
|
|
170544
|
-
addDecoder(7, () => import("./jpeg-
|
|
170545
|
-
addDecoder([8, 32946], () => import("./deflate-
|
|
170546
|
-
addDecoder(32773, () => import("./packbits-
|
|
170547
|
-
addDecoder(34887, () => import("./lerc-
|
|
170548
|
-
addDecoder(50001, () => import("./webimage-
|
|
170644
|
+
addDecoder(7, () => import("./jpeg-f8f11856.js").then((m2) => m2.default));
|
|
170645
|
+
addDecoder([8, 32946], () => import("./deflate-ce341fc9.js").then((m2) => m2.default));
|
|
170646
|
+
addDecoder(32773, () => import("./packbits-4d4e9377.js").then((m2) => m2.default));
|
|
170647
|
+
addDecoder(34887, () => import("./lerc-07a5c2dc.js").then((m2) => m2.default));
|
|
170648
|
+
addDecoder(50001, () => import("./webimage-b407d15a.js").then((m2) => m2.default));
|
|
170549
170649
|
function copyNewSize(array2, width2, height2, samplesPerPixel = 1) {
|
|
170550
170650
|
return new (Object.getPrototypeOf(array2)).constructor(width2 * height2 * samplesPerPixel);
|
|
170551
170651
|
}
|
|
@@ -175550,14 +175650,14 @@ const makeTable = () => {
|
|
|
175550
175650
|
return table;
|
|
175551
175651
|
};
|
|
175552
175652
|
const crcTable = new Uint32Array(makeTable());
|
|
175553
|
-
const crc32 = (
|
|
175653
|
+
const crc32 = (crc2, buf, len2, pos) => {
|
|
175554
175654
|
const t4 = crcTable;
|
|
175555
175655
|
const end = pos + len2;
|
|
175556
|
-
|
|
175656
|
+
crc2 ^= -1;
|
|
175557
175657
|
for (let i2 = pos; i2 < end; i2++) {
|
|
175558
|
-
|
|
175658
|
+
crc2 = crc2 >>> 8 ^ t4[(crc2 ^ buf[i2]) & 255];
|
|
175559
175659
|
}
|
|
175560
|
-
return
|
|
175660
|
+
return crc2 ^ -1;
|
|
175561
175661
|
};
|
|
175562
175662
|
var crc32_1 = crc32;
|
|
175563
175663
|
var messages = {
|
|
@@ -177759,7 +177859,7 @@ const updatewindow = (strm, src2, end, copy2) => {
|
|
|
177759
177859
|
}
|
|
177760
177860
|
return 0;
|
|
177761
177861
|
};
|
|
177762
|
-
const inflate = (strm, flush2) => {
|
|
177862
|
+
const inflate$1 = (strm, flush2) => {
|
|
177763
177863
|
let state;
|
|
177764
177864
|
let input, output2;
|
|
177765
177865
|
let next3;
|
|
@@ -178716,7 +178816,7 @@ var inflateReset2_1 = inflateReset2;
|
|
|
178716
178816
|
var inflateResetKeep_1 = inflateResetKeep;
|
|
178717
178817
|
var inflateInit_1 = inflateInit;
|
|
178718
178818
|
var inflateInit2_1 = inflateInit2;
|
|
178719
|
-
var inflate_2 = inflate;
|
|
178819
|
+
var inflate_2 = inflate$1;
|
|
178720
178820
|
var inflateEnd_1 = inflateEnd;
|
|
178721
178821
|
var inflateGetHeader_1 = inflateGetHeader;
|
|
178722
178822
|
var inflateSetDictionary_1 = inflateSetDictionary;
|
|
@@ -178898,22 +178998,22 @@ Inflate.prototype.onEnd = function(status) {
|
|
|
178898
178998
|
this.err = status;
|
|
178899
178999
|
this.msg = this.strm.msg;
|
|
178900
179000
|
};
|
|
178901
|
-
function inflate$1(input, options) {
|
|
179001
|
+
function inflate$1$1(input, options) {
|
|
178902
179002
|
const inflator = new Inflate(options);
|
|
178903
179003
|
inflator.push(input);
|
|
178904
179004
|
if (inflator.err)
|
|
178905
179005
|
throw inflator.msg || messages[inflator.err];
|
|
178906
179006
|
return inflator.result;
|
|
178907
179007
|
}
|
|
178908
|
-
function inflateRaw(input, options) {
|
|
179008
|
+
function inflateRaw$1(input, options) {
|
|
178909
179009
|
options = options || {};
|
|
178910
179010
|
options.raw = true;
|
|
178911
|
-
return inflate$1(input, options);
|
|
179011
|
+
return inflate$1$1(input, options);
|
|
178912
179012
|
}
|
|
178913
179013
|
var Inflate_1 = Inflate;
|
|
178914
|
-
var inflate_2$1 = inflate$1;
|
|
178915
|
-
var inflateRaw_1 = inflateRaw;
|
|
178916
|
-
var ungzip = inflate$1;
|
|
179014
|
+
var inflate_2$1 = inflate$1$1;
|
|
179015
|
+
var inflateRaw_1 = inflateRaw$1;
|
|
179016
|
+
var ungzip = inflate$1$1;
|
|
178917
179017
|
var constants$2$1 = constants$3;
|
|
178918
179018
|
var inflate_1$1 = {
|
|
178919
179019
|
Inflate: Inflate_1,
|
|
@@ -178923,14 +179023,14 @@ var inflate_1$1 = {
|
|
|
178923
179023
|
constants: constants$2$1
|
|
178924
179024
|
};
|
|
178925
179025
|
const { Deflate: Deflate$1, deflate: deflate$2, deflateRaw: deflateRaw$1, gzip: gzip$1 } = deflate_1$1;
|
|
178926
|
-
const { Inflate: Inflate$1, inflate: inflate$2, inflateRaw: inflateRaw$1, ungzip: ungzip$1 } = inflate_1$1;
|
|
179026
|
+
const { Inflate: Inflate$1, inflate: inflate$2, inflateRaw: inflateRaw$1$1, ungzip: ungzip$1 } = inflate_1$1;
|
|
178927
179027
|
var Deflate_1$1 = Deflate$1;
|
|
178928
179028
|
var deflate_1$2 = deflate$2;
|
|
178929
179029
|
var deflateRaw_1$1 = deflateRaw$1;
|
|
178930
179030
|
var gzip_1$1 = gzip$1;
|
|
178931
179031
|
var Inflate_1$1 = Inflate$1;
|
|
178932
179032
|
var inflate_1$2 = inflate$2;
|
|
178933
|
-
var inflateRaw_1$1 = inflateRaw$1;
|
|
179033
|
+
var inflateRaw_1$1 = inflateRaw$1$1;
|
|
178934
179034
|
var ungzip_1 = ungzip$1;
|
|
178935
179035
|
var constants_1 = constants$3;
|
|
178936
179036
|
var pako = {
|
|
@@ -179316,7 +179416,7 @@ var blosc_codec = function() {
|
|
|
179316
179416
|
if (h2.length !== d.length)
|
|
179317
179417
|
throw new La("Mismatched type converter count");
|
|
179318
179418
|
for (var l2 = 0; l2 < d.length; ++l2)
|
|
179319
|
-
|
|
179419
|
+
U2(d[l2], h2[l2]);
|
|
179320
179420
|
}
|
|
179321
179421
|
var d = [];
|
|
179322
179422
|
d.forEach(function(h2) {
|
|
@@ -179332,7 +179432,7 @@ var blosc_codec = function() {
|
|
|
179332
179432
|
});
|
|
179333
179433
|
0 === g2.length && c2(e3);
|
|
179334
179434
|
}
|
|
179335
|
-
function
|
|
179435
|
+
function U2(a2, b2, c2) {
|
|
179336
179436
|
c2 = c2 || {};
|
|
179337
179437
|
if (!("argPackAdvance" in b2))
|
|
179338
179438
|
throw new TypeError("registerType registeredInstance requires argPackAdvance");
|
|
@@ -179527,7 +179627,7 @@ var blosc_codec = function() {
|
|
|
179527
179627
|
}, z: function(a2, b2, c2, d, e3) {
|
|
179528
179628
|
var g2 = Fa(c2);
|
|
179529
179629
|
b2 = P2(b2);
|
|
179530
|
-
|
|
179630
|
+
U2(a2, { name: b2, fromWireType: function(k) {
|
|
179531
179631
|
return !!k;
|
|
179532
179632
|
}, toWireType: function(k, h2) {
|
|
179533
179633
|
return h2 ? d : e3;
|
|
@@ -179544,7 +179644,7 @@ var blosc_codec = function() {
|
|
|
179544
179644
|
}, M: null });
|
|
179545
179645
|
}, y: function(a2, b2) {
|
|
179546
179646
|
b2 = P2(b2);
|
|
179547
|
-
|
|
179647
|
+
U2(a2, { name: b2, fromWireType: function(c2) {
|
|
179548
179648
|
var d = V[c2].value;
|
|
179549
179649
|
Qa(c2);
|
|
179550
179650
|
return d;
|
|
@@ -179554,7 +179654,7 @@ var blosc_codec = function() {
|
|
|
179554
179654
|
}, h: function(a2, b2, c2) {
|
|
179555
179655
|
c2 = Fa(c2);
|
|
179556
179656
|
b2 = P2(b2);
|
|
179557
|
-
|
|
179657
|
+
U2(a2, { name: b2, fromWireType: function(d) {
|
|
179558
179658
|
return d;
|
|
179559
179659
|
}, toWireType: function(d, e3) {
|
|
179560
179660
|
if ("number" !== typeof e3 && "boolean" !== typeof e3)
|
|
@@ -179622,7 +179722,7 @@ var blosc_codec = function() {
|
|
|
179622
179722
|
};
|
|
179623
179723
|
}
|
|
179624
179724
|
var l2 = -1 != b2.indexOf("unsigned");
|
|
179625
|
-
|
|
179725
|
+
U2(a2, { name: b2, fromWireType: g2, toWireType: function(n3, p) {
|
|
179626
179726
|
if ("number" !== typeof p && "boolean" !== typeof p)
|
|
179627
179727
|
throw new TypeError('Cannot convert "' + Ta(p) + '" to ' + this.name);
|
|
179628
179728
|
if (p < d || p > e3)
|
|
@@ -179641,11 +179741,11 @@ var blosc_codec = function() {
|
|
|
179641
179741
|
}
|
|
179642
179742
|
var e3 = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array][b2];
|
|
179643
179743
|
c2 = P2(c2);
|
|
179644
|
-
|
|
179744
|
+
U2(a2, { name: c2, fromWireType: d, argPackAdvance: 8, readValueFromPointer: d }, { U: true });
|
|
179645
179745
|
}, i: function(a2, b2) {
|
|
179646
179746
|
b2 = P2(b2);
|
|
179647
179747
|
var c2 = "std::string" === b2;
|
|
179648
|
-
|
|
179748
|
+
U2(a2, { name: b2, fromWireType: function(d) {
|
|
179649
179749
|
var e3 = G2[d >> 2];
|
|
179650
179750
|
if (c2)
|
|
179651
179751
|
for (var g2 = d + 4, k = 0; k <= e3; ++k) {
|
|
@@ -179712,7 +179812,7 @@ var blosc_codec = function() {
|
|
|
179712
179812
|
4 === b2 && (d = na, e3 = oa, g2 = pa2, k = function() {
|
|
179713
179813
|
return G2;
|
|
179714
179814
|
}, h2 = 2);
|
|
179715
|
-
|
|
179815
|
+
U2(a2, { name: c2, fromWireType: function(l2) {
|
|
179716
179816
|
for (var n3 = G2[l2 >> 2], p = k(), q, x2 = l2 + 4, B2 = 0; B2 <= n3; ++B2) {
|
|
179717
179817
|
var m2 = l2 + 4 + B2 * b2;
|
|
179718
179818
|
if (B2 == n3 || 0 == p[m2 >> h2])
|
|
@@ -179732,7 +179832,7 @@ var blosc_codec = function() {
|
|
|
179732
179832
|
} });
|
|
179733
179833
|
}, A: function(a2, b2) {
|
|
179734
179834
|
b2 = P2(b2);
|
|
179735
|
-
|
|
179835
|
+
U2(a2, {
|
|
179736
179836
|
aa: true,
|
|
179737
179837
|
name: b2,
|
|
179738
179838
|
argPackAdvance: 0,
|
|
@@ -189819,6 +189919,7 @@ function MultiLegend(props2) {
|
|
|
189819
189919
|
spotLayerScopes,
|
|
189820
189920
|
spotLayerCoordination,
|
|
189821
189921
|
spotMultiExpressionExtents,
|
|
189922
|
+
spotMultiFeatureLabels,
|
|
189822
189923
|
// Points
|
|
189823
189924
|
pointLayerScopes,
|
|
189824
189925
|
pointLayerCoordination
|
|
@@ -189857,26 +189958,8 @@ function MultiLegend(props2) {
|
|
|
189857
189958
|
const firstExpressionExtent = expressionExtents?.[0];
|
|
189858
189959
|
const isStaticColor = obsColorEncoding === "spatialLayerColor";
|
|
189859
189960
|
const height2 = isStaticColor ? 20 : 36;
|
|
189860
|
-
|
|
189861
|
-
|
|
189862
|
-
highContrast: true,
|
|
189863
|
-
showObsLabel: true,
|
|
189864
|
-
visible: spatialLayerVisible,
|
|
189865
|
-
theme,
|
|
189866
|
-
obsType,
|
|
189867
|
-
featureType,
|
|
189868
|
-
featureValueType,
|
|
189869
|
-
obsColorEncoding,
|
|
189870
|
-
spatialLayerColor,
|
|
189871
|
-
featureSelection,
|
|
189872
|
-
// featureLabelsMap={featureLabelsMap} // TODO
|
|
189873
|
-
featureValueColormap,
|
|
189874
|
-
featureValueColormapRange,
|
|
189875
|
-
extent: firstExpressionExtent,
|
|
189876
|
-
height: height2,
|
|
189877
|
-
obsSetSelection,
|
|
189878
|
-
obsSetColor
|
|
189879
|
-
}, layerScope) : null;
|
|
189961
|
+
const featureLabelsMap = spotMultiFeatureLabels?.[layerScope]?.featureLabelsMap;
|
|
189962
|
+
return spatialLayerVisible && legendVisible ? jsxRuntimeExports.jsx(Legend, { positionRelative: true, highContrast: true, showObsLabel: true, visible: spatialLayerVisible, theme, obsType, featureType, featureValueType, obsColorEncoding, spatialLayerColor, featureSelection, featureLabelsMap, featureValueColormap, featureValueColormapRange, extent: firstExpressionExtent, height: height2, obsSetSelection, obsSetColor }, layerScope) : null;
|
|
189880
189963
|
}) : null, segmentationLayerScopes ? reversedSegmentationLayerScopes.flatMap((layerScope) => {
|
|
189881
189964
|
const layerCoordination = segmentationLayerCoordination[0][layerScope];
|
|
189882
189965
|
const channelScopes = segmentationChannelScopesByLayer[layerScope];
|
|
@@ -190492,7 +190575,7 @@ function isFunctionNode(x2) {
|
|
|
190492
190575
|
function isIndexNode(x2) {
|
|
190493
190576
|
return x2 && x2.isIndexNode === true && x2.constructor.prototype.isNode === true || false;
|
|
190494
190577
|
}
|
|
190495
|
-
function isNode(x2) {
|
|
190578
|
+
function isNode$1(x2) {
|
|
190496
190579
|
return x2 && x2.isNode === true && x2.constructor.prototype.isNode === true || false;
|
|
190497
190580
|
}
|
|
190498
190581
|
function isObjectNode(x2) {
|
|
@@ -190540,7 +190623,7 @@ function typeOf(x2) {
|
|
|
190540
190623
|
return "Range";
|
|
190541
190624
|
if (isResultSet(x2))
|
|
190542
190625
|
return "ResultSet";
|
|
190543
|
-
if (isNode(x2))
|
|
190626
|
+
if (isNode$1(x2))
|
|
190544
190627
|
return x2.type;
|
|
190545
190628
|
if (isChain(x2))
|
|
190546
190629
|
return "Chain";
|
|
@@ -190642,13 +190725,13 @@ function pickShallow(object2, properties2) {
|
|
|
190642
190725
|
}
|
|
190643
190726
|
var MATRIX_OPTIONS = ["Matrix", "Array"];
|
|
190644
190727
|
var NUMBER_OPTIONS = ["number", "BigNumber", "Fraction"];
|
|
190645
|
-
var config$
|
|
190728
|
+
var config$2 = function config(options) {
|
|
190646
190729
|
if (options) {
|
|
190647
190730
|
throw new Error("The global config is readonly. \nPlease create a mathjs instance if you want to change the default configuration. \nExample:\n\n import { create, all } from 'mathjs';\n const mathjs = create(all);\n mathjs.config({ number: 'BigNumber' });\n");
|
|
190648
190731
|
}
|
|
190649
190732
|
return Object.freeze(DEFAULT_CONFIG);
|
|
190650
190733
|
};
|
|
190651
|
-
_extends$a(config$
|
|
190734
|
+
_extends$a(config$2, DEFAULT_CONFIG, {
|
|
190652
190735
|
MATRIX_OPTIONS,
|
|
190653
190736
|
NUMBER_OPTIONS
|
|
190654
190737
|
});
|
|
@@ -192414,7 +192497,7 @@ var createTyped = /* @__PURE__ */ factory("typed", dependencies$R, function crea
|
|
|
192414
192497
|
},
|
|
192415
192498
|
{
|
|
192416
192499
|
name: "Node",
|
|
192417
|
-
test: isNode
|
|
192500
|
+
test: isNode$1
|
|
192418
192501
|
},
|
|
192419
192502
|
{
|
|
192420
192503
|
name: "ObjectNode",
|
|
@@ -194591,7 +194674,7 @@ function ceil$2(x2) {
|
|
|
194591
194674
|
function clamp$1(x2, min2, max2) {
|
|
194592
194675
|
return new this(x2).clamp(min2, max2);
|
|
194593
194676
|
}
|
|
194594
|
-
function
|
|
194677
|
+
function config$1(obj) {
|
|
194595
194678
|
if (!obj || typeof obj !== "object")
|
|
194596
194679
|
throw Error(decimalError + "Object expected");
|
|
194597
194680
|
var i2, p, v, useDefaults = obj.defaults === true, ps = [
|
|
@@ -194743,7 +194826,7 @@ function clone$1(obj) {
|
|
|
194743
194826
|
Decimal2.ROUND_HALF_CEIL = 7;
|
|
194744
194827
|
Decimal2.ROUND_HALF_FLOOR = 8;
|
|
194745
194828
|
Decimal2.EUCLID = 9;
|
|
194746
|
-
Decimal2.config = Decimal2.set =
|
|
194829
|
+
Decimal2.config = Decimal2.set = config$1;
|
|
194747
194830
|
Decimal2.clone = clone$1;
|
|
194748
194831
|
Decimal2.isDecimal = isDecimalInstance;
|
|
194749
194832
|
Decimal2.abs = abs$4;
|
|
@@ -205144,7 +205227,7 @@ var createDivide = /* @__PURE__ */ factory(name$2, dependencies$1, (_ref3) => {
|
|
|
205144
205227
|
});
|
|
205145
205228
|
var Complex = /* @__PURE__ */ createComplexClass({});
|
|
205146
205229
|
var BigNumber = /* @__PURE__ */ createBigNumberClass({
|
|
205147
|
-
config: config$
|
|
205230
|
+
config: config$2
|
|
205148
205231
|
});
|
|
205149
205232
|
var Matrix2 = /* @__PURE__ */ createMatrixClass({});
|
|
205150
205233
|
var Fraction = /* @__PURE__ */ createFractionClass({});
|
|
@@ -205161,7 +205244,7 @@ var isNumeric$1 = /* @__PURE__ */ createIsNumeric({
|
|
|
205161
205244
|
typed
|
|
205162
205245
|
});
|
|
205163
205246
|
var equalScalar = /* @__PURE__ */ createEqualScalar({
|
|
205164
|
-
config: config$
|
|
205247
|
+
config: config$2,
|
|
205165
205248
|
typed
|
|
205166
205249
|
});
|
|
205167
205250
|
var number$9 = /* @__PURE__ */ createNumber({
|
|
@@ -205204,18 +205287,18 @@ var identity$8 = /* @__PURE__ */ createIdentity({
|
|
|
205204
205287
|
BigNumber,
|
|
205205
205288
|
DenseMatrix,
|
|
205206
205289
|
SparseMatrix,
|
|
205207
|
-
config: config$
|
|
205290
|
+
config: config$2,
|
|
205208
205291
|
matrix,
|
|
205209
205292
|
typed
|
|
205210
205293
|
});
|
|
205211
205294
|
var size$1 = /* @__PURE__ */ createSize({
|
|
205212
205295
|
matrix,
|
|
205213
|
-
config: config$
|
|
205296
|
+
config: config$2,
|
|
205214
205297
|
typed
|
|
205215
205298
|
});
|
|
205216
205299
|
var zeros = /* @__PURE__ */ createZeros({
|
|
205217
205300
|
BigNumber,
|
|
205218
|
-
config: config$
|
|
205301
|
+
config: config$2,
|
|
205219
205302
|
matrix,
|
|
205220
205303
|
typed
|
|
205221
205304
|
});
|
|
@@ -205231,20 +205314,20 @@ var compare$a = /* @__PURE__ */ createCompare({
|
|
|
205231
205314
|
BigNumber,
|
|
205232
205315
|
DenseMatrix,
|
|
205233
205316
|
Fraction,
|
|
205234
|
-
config: config$
|
|
205317
|
+
config: config$2,
|
|
205235
205318
|
equalScalar,
|
|
205236
205319
|
matrix,
|
|
205237
205320
|
typed
|
|
205238
205321
|
});
|
|
205239
205322
|
var smaller = /* @__PURE__ */ createSmaller({
|
|
205240
205323
|
DenseMatrix,
|
|
205241
|
-
config: config$
|
|
205324
|
+
config: config$2,
|
|
205242
205325
|
matrix,
|
|
205243
205326
|
typed
|
|
205244
205327
|
});
|
|
205245
205328
|
var larger = /* @__PURE__ */ createLarger({
|
|
205246
205329
|
DenseMatrix,
|
|
205247
|
-
config: config$
|
|
205330
|
+
config: config$2,
|
|
205248
205331
|
matrix,
|
|
205249
205332
|
typed
|
|
205250
205333
|
});
|
|
@@ -205260,7 +205343,7 @@ var dot = /* @__PURE__ */ createDot({
|
|
|
205260
205343
|
typed
|
|
205261
205344
|
});
|
|
205262
205345
|
var floor$1 = /* @__PURE__ */ createFloor({
|
|
205263
|
-
config: config$
|
|
205346
|
+
config: config$2,
|
|
205264
205347
|
equalScalar,
|
|
205265
205348
|
matrix,
|
|
205266
205349
|
round: round$1,
|
|
@@ -205276,7 +205359,7 @@ var multiply = /* @__PURE__ */ createMultiply({
|
|
|
205276
205359
|
});
|
|
205277
205360
|
var pow$5 = /* @__PURE__ */ createPow({
|
|
205278
205361
|
Complex,
|
|
205279
|
-
config: config$
|
|
205362
|
+
config: config$2,
|
|
205280
205363
|
fraction,
|
|
205281
205364
|
identity: identity$8,
|
|
205282
205365
|
matrix,
|
|
@@ -205308,7 +205391,7 @@ var equal$1 = /* @__PURE__ */ createEqual({
|
|
|
205308
205391
|
typed
|
|
205309
205392
|
});
|
|
205310
205393
|
var ceil$1 = /* @__PURE__ */ createCeil({
|
|
205311
|
-
config: config$
|
|
205394
|
+
config: config$2,
|
|
205312
205395
|
equalScalar,
|
|
205313
205396
|
matrix,
|
|
205314
205397
|
round: round$1,
|
|
@@ -205378,7 +205461,7 @@ var Unit = /* @__PURE__ */ createUnitClass({
|
|
|
205378
205461
|
Fraction,
|
|
205379
205462
|
abs: abs$3,
|
|
205380
205463
|
addScalar,
|
|
205381
|
-
config: config$
|
|
205464
|
+
config: config$2,
|
|
205382
205465
|
divideScalar,
|
|
205383
205466
|
equal: equal$1,
|
|
205384
205467
|
fix,
|
|
@@ -205836,14 +205919,14 @@ function normalizeCoordinateTransformations(coordinateTransformations, datasets)
|
|
|
205836
205919
|
return result;
|
|
205837
205920
|
}
|
|
205838
205921
|
class NodeNotFoundError extends Error {
|
|
205839
|
-
constructor(
|
|
205840
|
-
super(
|
|
205922
|
+
constructor(context2, options = {}) {
|
|
205923
|
+
super(`Node not found: ${context2}`, options);
|
|
205841
205924
|
this.name = "NodeNotFoundError";
|
|
205842
205925
|
}
|
|
205843
205926
|
}
|
|
205844
205927
|
class KeyError extends Error {
|
|
205845
|
-
constructor(
|
|
205846
|
-
super(
|
|
205928
|
+
constructor(path2) {
|
|
205929
|
+
super(`Missing key: ${path2}`);
|
|
205847
205930
|
this.name = "KeyError";
|
|
205848
205931
|
}
|
|
205849
205932
|
}
|
|
@@ -205954,56 +206037,56 @@ class ByteStringArray {
|
|
|
205954
206037
|
_encoder = new WeakMap();
|
|
205955
206038
|
const _UnicodeStringArray = class {
|
|
205956
206039
|
constructor(chars, x2, byteOffset, length2) {
|
|
205957
|
-
|
|
206040
|
+
__privateAdd(this, _data, void 0);
|
|
205958
206041
|
__publicField(this, "chars");
|
|
205959
206042
|
__privateAdd(this, _encode_buffer, void 0);
|
|
205960
206043
|
this.chars = chars;
|
|
205961
206044
|
if (typeof x2 === "number") {
|
|
205962
|
-
this
|
|
206045
|
+
__privateSet(this, _data, new Int32Array(x2 * chars));
|
|
205963
206046
|
} else if (x2 instanceof ArrayBuffer) {
|
|
205964
206047
|
if (length2)
|
|
205965
206048
|
length2 *= chars;
|
|
205966
|
-
this
|
|
206049
|
+
__privateSet(this, _data, new Int32Array(x2, byteOffset, length2));
|
|
205967
206050
|
} else {
|
|
205968
206051
|
const values3 = x2;
|
|
205969
206052
|
const d = new _UnicodeStringArray(chars, 1);
|
|
205970
|
-
this
|
|
206053
|
+
__privateSet(this, _data, new Int32Array(function* () {
|
|
205971
206054
|
for (let str of values3) {
|
|
205972
206055
|
d.set(0, str);
|
|
205973
|
-
yield* d
|
|
206056
|
+
yield* __privateGet(d, _data);
|
|
205974
206057
|
}
|
|
205975
|
-
}());
|
|
206058
|
+
}()));
|
|
205976
206059
|
}
|
|
205977
206060
|
__privateSet(this, _encode_buffer, new Int32Array(chars));
|
|
205978
206061
|
}
|
|
205979
206062
|
get BYTES_PER_ELEMENT() {
|
|
205980
|
-
return this
|
|
206063
|
+
return __privateGet(this, _data).BYTES_PER_ELEMENT * this.chars;
|
|
205981
206064
|
}
|
|
205982
206065
|
get byteLength() {
|
|
205983
|
-
return this
|
|
206066
|
+
return __privateGet(this, _data).byteLength;
|
|
205984
206067
|
}
|
|
205985
206068
|
get byteOffset() {
|
|
205986
|
-
return this
|
|
206069
|
+
return __privateGet(this, _data).byteOffset;
|
|
205987
206070
|
}
|
|
205988
206071
|
/** @type {ArrayBuffer} */
|
|
205989
206072
|
get buffer() {
|
|
205990
|
-
return this
|
|
206073
|
+
return __privateGet(this, _data).buffer;
|
|
205991
206074
|
}
|
|
205992
206075
|
/** @type {number} */
|
|
205993
206076
|
get length() {
|
|
205994
|
-
return this
|
|
206077
|
+
return __privateGet(this, _data).length / this.chars;
|
|
205995
206078
|
}
|
|
205996
206079
|
get(idx) {
|
|
205997
206080
|
const offset6 = this.chars * idx;
|
|
205998
206081
|
let result = "";
|
|
205999
206082
|
for (let i2 = 0; i2 < this.chars; i2++) {
|
|
206000
|
-
result += String.fromCodePoint(this
|
|
206083
|
+
result += String.fromCodePoint(__privateGet(this, _data)[offset6 + i2]);
|
|
206001
206084
|
}
|
|
206002
206085
|
return result.replace(/\u0000/g, "");
|
|
206003
206086
|
}
|
|
206004
206087
|
set(idx, value2) {
|
|
206005
206088
|
const offset6 = this.chars * idx;
|
|
206006
|
-
const view = this
|
|
206089
|
+
const view = __privateGet(this, _data).subarray(offset6, offset6 + this.chars);
|
|
206007
206090
|
view.fill(0);
|
|
206008
206091
|
for (let i2 = 0; i2 < this.chars; i2++) {
|
|
206009
206092
|
view[i2] = value2.codePointAt(i2) ?? 0;
|
|
@@ -206011,9 +206094,9 @@ const _UnicodeStringArray = class {
|
|
|
206011
206094
|
}
|
|
206012
206095
|
fill(value2) {
|
|
206013
206096
|
this.set(0, value2);
|
|
206014
|
-
let encoded = this
|
|
206097
|
+
let encoded = __privateGet(this, _data).subarray(0, this.chars);
|
|
206015
206098
|
for (let i2 = 1; i2 < this.length; i2++) {
|
|
206016
|
-
this
|
|
206099
|
+
__privateGet(this, _data).set(encoded, i2 * this.chars);
|
|
206017
206100
|
}
|
|
206018
206101
|
}
|
|
206019
206102
|
*[Symbol.iterator]() {
|
|
@@ -206023,6 +206106,7 @@ const _UnicodeStringArray = class {
|
|
|
206023
206106
|
}
|
|
206024
206107
|
};
|
|
206025
206108
|
let UnicodeStringArray = _UnicodeStringArray;
|
|
206109
|
+
_data = new WeakMap();
|
|
206026
206110
|
_encode_buffer = new WeakMap();
|
|
206027
206111
|
function json_decode_object(bytes) {
|
|
206028
206112
|
const str = new TextDecoder().decode(bytes);
|
|
@@ -206387,8 +206471,115 @@ const _VLenUTF8 = class {
|
|
|
206387
206471
|
let VLenUTF8 = _VLenUTF8;
|
|
206388
206472
|
_shape2 = new WeakMap();
|
|
206389
206473
|
_strides2 = new WeakMap();
|
|
206474
|
+
function throw_on_nan_replacer(_key, value2) {
|
|
206475
|
+
if (value2 !== value2) {
|
|
206476
|
+
throw new Error("JsonCodec allow_nan is false but NaN was encountered during encoding.");
|
|
206477
|
+
}
|
|
206478
|
+
if (value2 === Infinity) {
|
|
206479
|
+
throw new Error("JsonCodec allow_nan is false but Infinity was encountered during encoding.");
|
|
206480
|
+
}
|
|
206481
|
+
if (value2 === -Infinity) {
|
|
206482
|
+
throw new Error("JsonCodec allow_nan is false but -Infinity was encountered during encoding.");
|
|
206483
|
+
}
|
|
206484
|
+
return value2;
|
|
206485
|
+
}
|
|
206486
|
+
function sort_keys_replacer(_key, value2) {
|
|
206487
|
+
return value2 instanceof Object && !(value2 instanceof Array) ? Object.keys(value2).sort().reduce((sorted, key2) => {
|
|
206488
|
+
sorted[key2] = value2[key2];
|
|
206489
|
+
return sorted;
|
|
206490
|
+
}, {}) : value2;
|
|
206491
|
+
}
|
|
206492
|
+
const _JsonCodec = class {
|
|
206493
|
+
constructor(configuration) {
|
|
206494
|
+
__publicField(this, "configuration");
|
|
206495
|
+
__publicField(this, "kind", "array_to_bytes");
|
|
206496
|
+
__privateAdd(this, _encoder_config, void 0);
|
|
206497
|
+
__privateAdd(this, _decoder_config, void 0);
|
|
206498
|
+
this.configuration = configuration;
|
|
206499
|
+
const { encoding = "utf-8", skipkeys = false, ensure_ascii = true, check_circular = true, allow_nan = true, sort_keys = true, indent, strict = true } = configuration;
|
|
206500
|
+
let separators = configuration.separators;
|
|
206501
|
+
if (!separators) {
|
|
206502
|
+
if (!indent) {
|
|
206503
|
+
separators = [",", ":"];
|
|
206504
|
+
} else {
|
|
206505
|
+
separators = [", ", ": "];
|
|
206506
|
+
}
|
|
206507
|
+
}
|
|
206508
|
+
__privateSet(this, _encoder_config, {
|
|
206509
|
+
encoding,
|
|
206510
|
+
skipkeys,
|
|
206511
|
+
ensure_ascii,
|
|
206512
|
+
check_circular,
|
|
206513
|
+
allow_nan,
|
|
206514
|
+
indent,
|
|
206515
|
+
separators,
|
|
206516
|
+
sort_keys
|
|
206517
|
+
});
|
|
206518
|
+
__privateSet(this, _decoder_config, { strict });
|
|
206519
|
+
}
|
|
206520
|
+
static fromConfig(configuration) {
|
|
206521
|
+
return new _JsonCodec(configuration);
|
|
206522
|
+
}
|
|
206523
|
+
encode(buf) {
|
|
206524
|
+
const { indent, encoding, ensure_ascii, check_circular, allow_nan, sort_keys } = __privateGet(this, _encoder_config);
|
|
206525
|
+
if (encoding !== "utf-8") {
|
|
206526
|
+
throw new Error("JsonCodec does not yet support non-utf-8 encoding.");
|
|
206527
|
+
}
|
|
206528
|
+
const replacer_functions = [];
|
|
206529
|
+
if (!check_circular) {
|
|
206530
|
+
throw new Error("JsonCodec does not yet support skipping the check for circular references during encoding.");
|
|
206531
|
+
}
|
|
206532
|
+
if (!allow_nan) {
|
|
206533
|
+
replacer_functions.push(throw_on_nan_replacer);
|
|
206534
|
+
}
|
|
206535
|
+
if (sort_keys) {
|
|
206536
|
+
replacer_functions.push(sort_keys_replacer);
|
|
206537
|
+
}
|
|
206538
|
+
const items = Array.from(buf.data);
|
|
206539
|
+
items.push("|O");
|
|
206540
|
+
items.push(buf.shape);
|
|
206541
|
+
let replacer2 = void 0;
|
|
206542
|
+
if (replacer_functions.length) {
|
|
206543
|
+
replacer2 = function(key2, value2) {
|
|
206544
|
+
let new_value = value2;
|
|
206545
|
+
replacer_functions.forEach((sub_replacer) => {
|
|
206546
|
+
new_value = sub_replacer(key2, new_value);
|
|
206547
|
+
});
|
|
206548
|
+
return new_value;
|
|
206549
|
+
};
|
|
206550
|
+
}
|
|
206551
|
+
let json_str = JSON.stringify(items, replacer2, indent);
|
|
206552
|
+
if (ensure_ascii) {
|
|
206553
|
+
json_str = json_str.replace(/[\u007F-\uFFFF]/g, function(chr) {
|
|
206554
|
+
const full_str = "0000" + chr.charCodeAt(0).toString(16);
|
|
206555
|
+
const sub_str = full_str.substring(full_str.length - 4);
|
|
206556
|
+
return "\\u" + sub_str;
|
|
206557
|
+
});
|
|
206558
|
+
}
|
|
206559
|
+
return new TextEncoder().encode(json_str);
|
|
206560
|
+
}
|
|
206561
|
+
decode(bytes) {
|
|
206562
|
+
const { strict } = __privateGet(this, _decoder_config);
|
|
206563
|
+
if (!strict) {
|
|
206564
|
+
throw new Error("JsonCodec does not yet support non-strict decoding.");
|
|
206565
|
+
}
|
|
206566
|
+
const items = json_decode_object(bytes);
|
|
206567
|
+
const shape2 = items.pop();
|
|
206568
|
+
items.pop();
|
|
206569
|
+
if (!shape2) {
|
|
206570
|
+
throw new Error("0D not implemented for JsonCodec.");
|
|
206571
|
+
} else {
|
|
206572
|
+
const stride = get_strides(shape2, "C");
|
|
206573
|
+
const data2 = items;
|
|
206574
|
+
return { data: data2, shape: shape2, stride };
|
|
206575
|
+
}
|
|
206576
|
+
}
|
|
206577
|
+
};
|
|
206578
|
+
let JsonCodec = _JsonCodec;
|
|
206579
|
+
_encoder_config = new WeakMap();
|
|
206580
|
+
_decoder_config = new WeakMap();
|
|
206390
206581
|
function create_default_registry() {
|
|
206391
|
-
return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-
|
|
206582
|
+
return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-039d2f27.js").then((m2) => m2.default)).set("gzip", () => import("./gzip-6a24f0fe.js").then((m2) => m2.default)).set("lz4", () => import("./lz4-e899c949.js").then((m2) => m2.default)).set("zlib", () => import("./zlib-175cd38d.js").then((m2) => m2.default)).set("zstd", () => import("./zstd-9aabb3ce.js").then((m2) => m2.default)).set("transpose", () => TransposeCodec).set("bytes", () => BytesCodec).set("crc32c", () => Crc32cCodec).set("vlen-utf8", () => VLenUTF8).set("json2", () => JsonCodec);
|
|
206392
206583
|
}
|
|
206393
206584
|
const registry = create_default_registry();
|
|
206394
206585
|
function create_codec_pipeline(chunk_metadata) {
|
|
@@ -206632,6 +206823,7 @@ let Array$1 = (_c = class extends Location {
|
|
|
206632
206823
|
return is_dtype(this.dtype, query);
|
|
206633
206824
|
}
|
|
206634
206825
|
}, _b = CONTEXT_MARKER, _metadata2 = new WeakMap(), _c);
|
|
206826
|
+
let VERSION_COUNTER = create_version_counter();
|
|
206635
206827
|
function create_version_counter() {
|
|
206636
206828
|
let version_counts = /* @__PURE__ */ new WeakMap();
|
|
206637
206829
|
function get_counts(store2) {
|
|
@@ -206649,7 +206841,6 @@ function create_version_counter() {
|
|
|
206649
206841
|
}
|
|
206650
206842
|
};
|
|
206651
206843
|
}
|
|
206652
|
-
let VERSION_COUNTER = create_version_counter();
|
|
206653
206844
|
async function load_attrs(location) {
|
|
206654
206845
|
let meta_bytes = await location.store.get(location.resolve(".zattrs").path);
|
|
206655
206846
|
if (!meta_bytes)
|
|
@@ -206675,7 +206866,9 @@ async function open_array_v2(location, attrs) {
|
|
|
206675
206866
|
let { path: path2 } = location.resolve(".zarray");
|
|
206676
206867
|
let meta2 = await location.store.get(path2);
|
|
206677
206868
|
if (!meta2) {
|
|
206678
|
-
throw new NodeNotFoundError(
|
|
206869
|
+
throw new NodeNotFoundError("v2 array", {
|
|
206870
|
+
cause: new KeyError(path2)
|
|
206871
|
+
});
|
|
206679
206872
|
}
|
|
206680
206873
|
VERSION_COUNTER.increment(location.store, "v2");
|
|
206681
206874
|
return new Array$1(location.store, location.path, v2_to_v3_array_metadata(json_decode_object(meta2), attrs));
|
|
@@ -206684,7 +206877,9 @@ async function open_group_v2(location, attrs) {
|
|
|
206684
206877
|
let { path: path2 } = location.resolve(".zgroup");
|
|
206685
206878
|
let meta2 = await location.store.get(path2);
|
|
206686
206879
|
if (!meta2) {
|
|
206687
|
-
throw new NodeNotFoundError(
|
|
206880
|
+
throw new NodeNotFoundError("v2 group", {
|
|
206881
|
+
cause: new KeyError(path2)
|
|
206882
|
+
});
|
|
206688
206883
|
}
|
|
206689
206884
|
VERSION_COUNTER.increment(location.store, "v2");
|
|
206690
206885
|
return new Group$1(location.store, location.path, v2_to_v3_group_metadata(json_decode_object(meta2), attrs));
|
|
@@ -206693,7 +206888,9 @@ async function _open_v3(location) {
|
|
|
206693
206888
|
let { store: store2, path: path2 } = location.resolve("zarr.json");
|
|
206694
206889
|
let meta2 = await location.store.get(path2);
|
|
206695
206890
|
if (!meta2) {
|
|
206696
|
-
throw new NodeNotFoundError(
|
|
206891
|
+
throw new NodeNotFoundError("v3 array or group", {
|
|
206892
|
+
cause: new KeyError(path2)
|
|
206893
|
+
});
|
|
206697
206894
|
}
|
|
206698
206895
|
let meta_doc = json_decode_object(meta2);
|
|
206699
206896
|
if (meta_doc.node_type === "array" && (meta_doc.data_type === "uint64" || meta_doc.data_type === "int64") && meta_doc.fill_value != void 0) {
|
|
@@ -206715,8 +206912,8 @@ async function open_v3(location, options = {}) {
|
|
|
206715
206912
|
throw new Error(`Expected node of kind ${options.kind}, found ${kind}.`);
|
|
206716
206913
|
}
|
|
206717
206914
|
async function open(location, options = {}) {
|
|
206718
|
-
|
|
206719
|
-
|
|
206915
|
+
let store2 = "store" in location ? location.store : location;
|
|
206916
|
+
let version_max = VERSION_COUNTER.version_max(store2);
|
|
206720
206917
|
let open_primary = version_max === "v2" ? open.v2 : open.v3;
|
|
206721
206918
|
let open_secondary = version_max === "v2" ? open.v3 : open.v2;
|
|
206722
206919
|
return open_primary(location, options).catch((err2) => {
|
|
@@ -206760,7 +206957,7 @@ function* product(...iterables) {
|
|
|
206760
206957
|
results[i2] = iterators[i2].next();
|
|
206761
206958
|
}
|
|
206762
206959
|
}
|
|
206763
|
-
function slice_indices(start, stop3, step2, length2) {
|
|
206960
|
+
function slice_indices({ start, stop: stop3, step: step2 }, length2) {
|
|
206764
206961
|
if (step2 === 0) {
|
|
206765
206962
|
throw new Error("slice step cannot be zero");
|
|
206766
206963
|
}
|
|
@@ -206801,10 +206998,7 @@ function slice$4(start, stop3, step2 = null) {
|
|
|
206801
206998
|
return {
|
|
206802
206999
|
start,
|
|
206803
207000
|
stop: stop3,
|
|
206804
|
-
step: step2
|
|
206805
|
-
indices(length2) {
|
|
206806
|
-
return slice_indices(this.start, this.stop, this.step, length2);
|
|
206807
|
-
}
|
|
207001
|
+
step: step2
|
|
206808
207002
|
};
|
|
206809
207003
|
}
|
|
206810
207004
|
function create_queue() {
|
|
@@ -206872,7 +207066,7 @@ class SliceDimIndexer {
|
|
|
206872
207066
|
__publicField(this, "dim_chunk_len");
|
|
206873
207067
|
__publicField(this, "nitems");
|
|
206874
207068
|
__publicField(this, "nchunks");
|
|
206875
|
-
const [start, stop3, step2] = dim_sel
|
|
207069
|
+
const [start, stop3, step2] = slice_indices(dim_sel, dim_len);
|
|
206876
207070
|
this.start = start;
|
|
206877
207071
|
this.stop = stop3;
|
|
206878
207072
|
this.step = step2;
|
|
@@ -206957,25 +207151,20 @@ function unwrap(arr, idx) {
|
|
|
206957
207151
|
return "get" in arr ? arr.get(idx) : arr[idx];
|
|
206958
207152
|
}
|
|
206959
207153
|
async function get$7(arr, selection, opts2, setter2) {
|
|
206960
|
-
|
|
206961
|
-
|
|
207154
|
+
let context2 = get_context(arr);
|
|
207155
|
+
let indexer = new BasicIndexer({
|
|
206962
207156
|
selection,
|
|
206963
207157
|
shape: arr.shape,
|
|
206964
207158
|
chunk_shape: arr.chunks
|
|
206965
207159
|
});
|
|
206966
|
-
|
|
206967
|
-
|
|
207160
|
+
let out = setter2.prepare(new context2.TypedArray(indexer.shape.reduce((a2, b2) => a2 * b2, 1)), indexer.shape, context2.get_strides(indexer.shape, opts2.order));
|
|
207161
|
+
let queue = opts2.create_queue?.() ?? create_queue();
|
|
206968
207162
|
for (const { chunk_coords, mapping } of indexer) {
|
|
206969
|
-
queue.add(
|
|
206970
|
-
|
|
207163
|
+
queue.add(async () => {
|
|
207164
|
+
let { data: data2, shape: shape2, stride } = await arr.getChunk(chunk_coords, opts2.opts);
|
|
207165
|
+
let chunk = setter2.prepare(data2, shape2, stride);
|
|
206971
207166
|
setter2.set_from_chunk(out, chunk, mapping);
|
|
206972
|
-
})
|
|
206973
|
-
if (!(err2 instanceof KeyError))
|
|
206974
|
-
throw err2;
|
|
206975
|
-
if (context2.fill_value) {
|
|
206976
|
-
setter2.set_scalar(out, mapping.map((m2) => m2.to).filter((s2) => s2 !== null), context2.fill_value);
|
|
206977
|
-
}
|
|
206978
|
-
}));
|
|
207167
|
+
});
|
|
206979
207168
|
}
|
|
206980
207169
|
await queue.onIdle();
|
|
206981
207170
|
return indexer.shape.length === 0 ? unwrap(out.data, 0) : out;
|
|
@@ -207128,6 +207317,9 @@ function set_from_chunk_binary(dest, src2, bytes_per_element2, projections2) {
|
|
|
207128
207317
|
}, bytes_per_element2, projs);
|
|
207129
207318
|
}
|
|
207130
207319
|
}
|
|
207320
|
+
function strip_prefix(path2) {
|
|
207321
|
+
return path2.slice(1);
|
|
207322
|
+
}
|
|
207131
207323
|
function fetch_range(url, offset6, length2, opts2 = {}) {
|
|
207132
207324
|
if (offset6 !== void 0 && length2 !== void 0) {
|
|
207133
207325
|
opts2 = {
|
|
@@ -207140,6 +207332,16 @@ function fetch_range(url, offset6, length2, opts2 = {}) {
|
|
|
207140
207332
|
}
|
|
207141
207333
|
return fetch(url, opts2);
|
|
207142
207334
|
}
|
|
207335
|
+
function merge_init(storeOverrides, requestOverrides) {
|
|
207336
|
+
return {
|
|
207337
|
+
...storeOverrides,
|
|
207338
|
+
...requestOverrides,
|
|
207339
|
+
headers: {
|
|
207340
|
+
...storeOverrides.headers,
|
|
207341
|
+
...requestOverrides.headers
|
|
207342
|
+
}
|
|
207343
|
+
};
|
|
207344
|
+
}
|
|
207143
207345
|
function resolve$1(root2, path2) {
|
|
207144
207346
|
const base2 = typeof root2 === "string" ? new URL(root2) : root2;
|
|
207145
207347
|
if (!base2.pathname.endsWith("/")) {
|
|
@@ -207204,14 +207406,7 @@ _overrides = new WeakMap();
|
|
|
207204
207406
|
_use_suffix_request = new WeakMap();
|
|
207205
207407
|
_merge_init = new WeakSet();
|
|
207206
207408
|
merge_init_fn = function(overrides) {
|
|
207207
|
-
return
|
|
207208
|
-
...__privateGet(this, _overrides),
|
|
207209
|
-
...overrides,
|
|
207210
|
-
headers: {
|
|
207211
|
-
...__privateGet(this, _overrides).headers,
|
|
207212
|
-
...overrides.headers
|
|
207213
|
-
}
|
|
207214
|
-
};
|
|
207409
|
+
return merge_init(__privateGet(this, _overrides), overrides);
|
|
207215
207410
|
};
|
|
207216
207411
|
const FetchStore$1 = FetchStore;
|
|
207217
207412
|
function getV2DataType(dtype) {
|
|
@@ -207253,8 +207448,896 @@ function createZarrArrayAdapter(arr) {
|
|
|
207253
207448
|
}
|
|
207254
207449
|
});
|
|
207255
207450
|
}
|
|
207256
|
-
function
|
|
207257
|
-
|
|
207451
|
+
function readBlobAsArrayBuffer(blob) {
|
|
207452
|
+
if (blob.arrayBuffer) {
|
|
207453
|
+
return blob.arrayBuffer();
|
|
207454
|
+
}
|
|
207455
|
+
return new Promise((resolve2, reject) => {
|
|
207456
|
+
const reader = new FileReader();
|
|
207457
|
+
reader.addEventListener("loadend", () => {
|
|
207458
|
+
resolve2(reader.result);
|
|
207459
|
+
});
|
|
207460
|
+
reader.addEventListener("error", reject);
|
|
207461
|
+
reader.readAsArrayBuffer(blob);
|
|
207462
|
+
});
|
|
207463
|
+
}
|
|
207464
|
+
async function readBlobAsUint8Array(blob) {
|
|
207465
|
+
const arrayBuffer2 = await readBlobAsArrayBuffer(blob);
|
|
207466
|
+
return new Uint8Array(arrayBuffer2);
|
|
207467
|
+
}
|
|
207468
|
+
function isBlob(v) {
|
|
207469
|
+
return typeof Blob !== "undefined" && v instanceof Blob;
|
|
207470
|
+
}
|
|
207471
|
+
function isSharedArrayBuffer(b2) {
|
|
207472
|
+
return typeof SharedArrayBuffer !== "undefined" && b2 instanceof SharedArrayBuffer;
|
|
207473
|
+
}
|
|
207474
|
+
const isNode = typeof process !== "undefined" && process.versions && typeof process.versions.node !== "undefined" && typeof process.versions.electron === "undefined";
|
|
207475
|
+
function isTypedArraySameAsArrayBuffer(typedArray) {
|
|
207476
|
+
return typedArray.byteOffset === 0 && typedArray.byteLength === typedArray.buffer.byteLength;
|
|
207477
|
+
}
|
|
207478
|
+
class ArrayBufferReader {
|
|
207479
|
+
constructor(arrayBufferOrView) {
|
|
207480
|
+
this.typedArray = arrayBufferOrView instanceof ArrayBuffer || isSharedArrayBuffer(arrayBufferOrView) ? new Uint8Array(arrayBufferOrView) : new Uint8Array(arrayBufferOrView.buffer, arrayBufferOrView.byteOffset, arrayBufferOrView.byteLength);
|
|
207481
|
+
}
|
|
207482
|
+
async getLength() {
|
|
207483
|
+
return this.typedArray.byteLength;
|
|
207484
|
+
}
|
|
207485
|
+
async read(offset6, length2) {
|
|
207486
|
+
return new Uint8Array(this.typedArray.buffer, this.typedArray.byteOffset + offset6, length2);
|
|
207487
|
+
}
|
|
207488
|
+
}
|
|
207489
|
+
let BlobReader$1 = class BlobReader {
|
|
207490
|
+
constructor(blob) {
|
|
207491
|
+
this.blob = blob;
|
|
207492
|
+
}
|
|
207493
|
+
async getLength() {
|
|
207494
|
+
return this.blob.size;
|
|
207495
|
+
}
|
|
207496
|
+
async read(offset6, length2) {
|
|
207497
|
+
const blob = this.blob.slice(offset6, offset6 + length2);
|
|
207498
|
+
const arrayBuffer2 = await readBlobAsArrayBuffer(blob);
|
|
207499
|
+
return new Uint8Array(arrayBuffer2);
|
|
207500
|
+
}
|
|
207501
|
+
async sliceAsBlob(offset6, length2, type3 = "") {
|
|
207502
|
+
return this.blob.slice(offset6, offset6 + length2, type3);
|
|
207503
|
+
}
|
|
207504
|
+
};
|
|
207505
|
+
function inflate(data2, buf) {
|
|
207506
|
+
var u8 = Uint8Array;
|
|
207507
|
+
if (data2[0] == 3 && data2[1] == 0)
|
|
207508
|
+
return buf ? buf : new u8(0);
|
|
207509
|
+
var bitsF = _bitsF, bitsE = _bitsE, decodeTiny = _decodeTiny, get17 = _get17;
|
|
207510
|
+
var noBuf = buf == null;
|
|
207511
|
+
if (noBuf)
|
|
207512
|
+
buf = new u8(data2.length >>> 2 << 3);
|
|
207513
|
+
var BFINAL = 0, BTYPE = 0, HLIT = 0, HDIST = 0, HCLEN = 0, ML = 0, MD = 0;
|
|
207514
|
+
var off = 0, pos = 0;
|
|
207515
|
+
var lmap, dmap;
|
|
207516
|
+
while (BFINAL == 0) {
|
|
207517
|
+
BFINAL = bitsF(data2, pos, 1);
|
|
207518
|
+
BTYPE = bitsF(data2, pos + 1, 2);
|
|
207519
|
+
pos += 3;
|
|
207520
|
+
if (BTYPE == 0) {
|
|
207521
|
+
if ((pos & 7) != 0)
|
|
207522
|
+
pos += 8 - (pos & 7);
|
|
207523
|
+
var p8 = (pos >>> 3) + 4, len2 = data2[p8 - 4] | data2[p8 - 3] << 8;
|
|
207524
|
+
if (noBuf)
|
|
207525
|
+
buf = _check(buf, off + len2);
|
|
207526
|
+
buf.set(new u8(data2.buffer, data2.byteOffset + p8, len2), off);
|
|
207527
|
+
pos = p8 + len2 << 3;
|
|
207528
|
+
off += len2;
|
|
207529
|
+
continue;
|
|
207530
|
+
}
|
|
207531
|
+
if (noBuf)
|
|
207532
|
+
buf = _check(buf, off + (1 << 17));
|
|
207533
|
+
if (BTYPE == 1) {
|
|
207534
|
+
lmap = U.flmap;
|
|
207535
|
+
dmap = U.fdmap;
|
|
207536
|
+
ML = (1 << 9) - 1;
|
|
207537
|
+
MD = (1 << 5) - 1;
|
|
207538
|
+
}
|
|
207539
|
+
if (BTYPE == 2) {
|
|
207540
|
+
HLIT = bitsE(data2, pos, 5) + 257;
|
|
207541
|
+
HDIST = bitsE(data2, pos + 5, 5) + 1;
|
|
207542
|
+
HCLEN = bitsE(data2, pos + 10, 4) + 4;
|
|
207543
|
+
pos += 14;
|
|
207544
|
+
for (var i2 = 0; i2 < 38; i2 += 2) {
|
|
207545
|
+
U.itree[i2] = 0;
|
|
207546
|
+
U.itree[i2 + 1] = 0;
|
|
207547
|
+
}
|
|
207548
|
+
var tl2 = 1;
|
|
207549
|
+
for (var i2 = 0; i2 < HCLEN; i2++) {
|
|
207550
|
+
var l2 = bitsE(data2, pos + i2 * 3, 3);
|
|
207551
|
+
U.itree[(U.ordr[i2] << 1) + 1] = l2;
|
|
207552
|
+
if (l2 > tl2)
|
|
207553
|
+
tl2 = l2;
|
|
207554
|
+
}
|
|
207555
|
+
pos += 3 * HCLEN;
|
|
207556
|
+
makeCodes(U.itree, tl2);
|
|
207557
|
+
codes2map(U.itree, tl2, U.imap);
|
|
207558
|
+
lmap = U.lmap;
|
|
207559
|
+
dmap = U.dmap;
|
|
207560
|
+
pos = decodeTiny(U.imap, (1 << tl2) - 1, HLIT + HDIST, data2, pos, U.ttree);
|
|
207561
|
+
var mx0 = _copyOut(U.ttree, 0, HLIT, U.ltree);
|
|
207562
|
+
ML = (1 << mx0) - 1;
|
|
207563
|
+
var mx1 = _copyOut(U.ttree, HLIT, HDIST, U.dtree);
|
|
207564
|
+
MD = (1 << mx1) - 1;
|
|
207565
|
+
makeCodes(U.ltree, mx0);
|
|
207566
|
+
codes2map(U.ltree, mx0, lmap);
|
|
207567
|
+
makeCodes(U.dtree, mx1);
|
|
207568
|
+
codes2map(U.dtree, mx1, dmap);
|
|
207569
|
+
}
|
|
207570
|
+
while (true) {
|
|
207571
|
+
var code = lmap[get17(data2, pos) & ML];
|
|
207572
|
+
pos += code & 15;
|
|
207573
|
+
var lit = code >>> 4;
|
|
207574
|
+
if (lit >>> 8 == 0) {
|
|
207575
|
+
buf[off++] = lit;
|
|
207576
|
+
} else if (lit == 256) {
|
|
207577
|
+
break;
|
|
207578
|
+
} else {
|
|
207579
|
+
var end = off + lit - 254;
|
|
207580
|
+
if (lit > 264) {
|
|
207581
|
+
var ebs = U.ldef[lit - 257];
|
|
207582
|
+
end = off + (ebs >>> 3) + bitsE(data2, pos, ebs & 7);
|
|
207583
|
+
pos += ebs & 7;
|
|
207584
|
+
}
|
|
207585
|
+
var dcode = dmap[get17(data2, pos) & MD];
|
|
207586
|
+
pos += dcode & 15;
|
|
207587
|
+
var dlit = dcode >>> 4;
|
|
207588
|
+
var dbs = U.ddef[dlit], dst = (dbs >>> 4) + bitsF(data2, pos, dbs & 15);
|
|
207589
|
+
pos += dbs & 15;
|
|
207590
|
+
if (noBuf)
|
|
207591
|
+
buf = _check(buf, off + (1 << 17));
|
|
207592
|
+
while (off < end) {
|
|
207593
|
+
buf[off] = buf[off++ - dst];
|
|
207594
|
+
buf[off] = buf[off++ - dst];
|
|
207595
|
+
buf[off] = buf[off++ - dst];
|
|
207596
|
+
buf[off] = buf[off++ - dst];
|
|
207597
|
+
}
|
|
207598
|
+
off = end;
|
|
207599
|
+
}
|
|
207600
|
+
}
|
|
207601
|
+
}
|
|
207602
|
+
return buf.length == off ? buf : buf.slice(0, off);
|
|
207603
|
+
}
|
|
207604
|
+
function _check(buf, len2) {
|
|
207605
|
+
var bl2 = buf.length;
|
|
207606
|
+
if (len2 <= bl2)
|
|
207607
|
+
return buf;
|
|
207608
|
+
var nbuf = new Uint8Array(Math.max(bl2 << 1, len2));
|
|
207609
|
+
nbuf.set(buf, 0);
|
|
207610
|
+
return nbuf;
|
|
207611
|
+
}
|
|
207612
|
+
function _decodeTiny(lmap, LL, len2, data2, pos, tree2) {
|
|
207613
|
+
var bitsE = _bitsE, get17 = _get17;
|
|
207614
|
+
var i2 = 0;
|
|
207615
|
+
while (i2 < len2) {
|
|
207616
|
+
var code = lmap[get17(data2, pos) & LL];
|
|
207617
|
+
pos += code & 15;
|
|
207618
|
+
var lit = code >>> 4;
|
|
207619
|
+
if (lit <= 15) {
|
|
207620
|
+
tree2[i2] = lit;
|
|
207621
|
+
i2++;
|
|
207622
|
+
} else {
|
|
207623
|
+
var ll = 0, n3 = 0;
|
|
207624
|
+
if (lit == 16) {
|
|
207625
|
+
n3 = 3 + bitsE(data2, pos, 2);
|
|
207626
|
+
pos += 2;
|
|
207627
|
+
ll = tree2[i2 - 1];
|
|
207628
|
+
} else if (lit == 17) {
|
|
207629
|
+
n3 = 3 + bitsE(data2, pos, 3);
|
|
207630
|
+
pos += 3;
|
|
207631
|
+
} else if (lit == 18) {
|
|
207632
|
+
n3 = 11 + bitsE(data2, pos, 7);
|
|
207633
|
+
pos += 7;
|
|
207634
|
+
}
|
|
207635
|
+
var ni = i2 + n3;
|
|
207636
|
+
while (i2 < ni) {
|
|
207637
|
+
tree2[i2] = ll;
|
|
207638
|
+
i2++;
|
|
207639
|
+
}
|
|
207640
|
+
}
|
|
207641
|
+
}
|
|
207642
|
+
return pos;
|
|
207643
|
+
}
|
|
207644
|
+
function _copyOut(src2, off, len2, tree2) {
|
|
207645
|
+
var mx = 0, i2 = 0, tl2 = tree2.length >>> 1;
|
|
207646
|
+
while (i2 < len2) {
|
|
207647
|
+
var v = src2[i2 + off];
|
|
207648
|
+
tree2[i2 << 1] = 0;
|
|
207649
|
+
tree2[(i2 << 1) + 1] = v;
|
|
207650
|
+
if (v > mx)
|
|
207651
|
+
mx = v;
|
|
207652
|
+
i2++;
|
|
207653
|
+
}
|
|
207654
|
+
while (i2 < tl2) {
|
|
207655
|
+
tree2[i2 << 1] = 0;
|
|
207656
|
+
tree2[(i2 << 1) + 1] = 0;
|
|
207657
|
+
i2++;
|
|
207658
|
+
}
|
|
207659
|
+
return mx;
|
|
207660
|
+
}
|
|
207661
|
+
function makeCodes(tree2, MAX_BITS2) {
|
|
207662
|
+
var max_code = tree2.length;
|
|
207663
|
+
var code, bits, n3, i2, len2;
|
|
207664
|
+
var bl_count = U.bl_count;
|
|
207665
|
+
for (var i2 = 0; i2 <= MAX_BITS2; i2++)
|
|
207666
|
+
bl_count[i2] = 0;
|
|
207667
|
+
for (i2 = 1; i2 < max_code; i2 += 2)
|
|
207668
|
+
bl_count[tree2[i2]]++;
|
|
207669
|
+
var next_code = U.next_code;
|
|
207670
|
+
code = 0;
|
|
207671
|
+
bl_count[0] = 0;
|
|
207672
|
+
for (bits = 1; bits <= MAX_BITS2; bits++) {
|
|
207673
|
+
code = code + bl_count[bits - 1] << 1;
|
|
207674
|
+
next_code[bits] = code;
|
|
207675
|
+
}
|
|
207676
|
+
for (n3 = 0; n3 < max_code; n3 += 2) {
|
|
207677
|
+
len2 = tree2[n3 + 1];
|
|
207678
|
+
if (len2 != 0) {
|
|
207679
|
+
tree2[n3] = next_code[len2];
|
|
207680
|
+
next_code[len2]++;
|
|
207681
|
+
}
|
|
207682
|
+
}
|
|
207683
|
+
}
|
|
207684
|
+
function codes2map(tree2, MAX_BITS2, map2) {
|
|
207685
|
+
var max_code = tree2.length;
|
|
207686
|
+
var r15 = U.rev15;
|
|
207687
|
+
for (var i2 = 0; i2 < max_code; i2 += 2)
|
|
207688
|
+
if (tree2[i2 + 1] != 0) {
|
|
207689
|
+
var lit = i2 >> 1;
|
|
207690
|
+
var cl = tree2[i2 + 1], val = lit << 4 | cl;
|
|
207691
|
+
var rest = MAX_BITS2 - cl, i0 = tree2[i2] << rest, i1 = i0 + (1 << rest);
|
|
207692
|
+
while (i0 != i1) {
|
|
207693
|
+
var p02 = r15[i0] >>> 15 - MAX_BITS2;
|
|
207694
|
+
map2[p02] = val;
|
|
207695
|
+
i0++;
|
|
207696
|
+
}
|
|
207697
|
+
}
|
|
207698
|
+
}
|
|
207699
|
+
function revCodes(tree2, MAX_BITS2) {
|
|
207700
|
+
var r15 = U.rev15, imb = 15 - MAX_BITS2;
|
|
207701
|
+
for (var i2 = 0; i2 < tree2.length; i2 += 2) {
|
|
207702
|
+
var i0 = tree2[i2] << MAX_BITS2 - tree2[i2 + 1];
|
|
207703
|
+
tree2[i2] = r15[i0] >>> imb;
|
|
207704
|
+
}
|
|
207705
|
+
}
|
|
207706
|
+
function _bitsE(dt, pos, length2) {
|
|
207707
|
+
return (dt[pos >>> 3] | dt[(pos >>> 3) + 1] << 8) >>> (pos & 7) & (1 << length2) - 1;
|
|
207708
|
+
}
|
|
207709
|
+
function _bitsF(dt, pos, length2) {
|
|
207710
|
+
return (dt[pos >>> 3] | dt[(pos >>> 3) + 1] << 8 | dt[(pos >>> 3) + 2] << 16) >>> (pos & 7) & (1 << length2) - 1;
|
|
207711
|
+
}
|
|
207712
|
+
function _get17(dt, pos) {
|
|
207713
|
+
return (dt[pos >>> 3] | dt[(pos >>> 3) + 1] << 8 | dt[(pos >>> 3) + 2] << 16) >>> (pos & 7);
|
|
207714
|
+
}
|
|
207715
|
+
const U = function() {
|
|
207716
|
+
var u16 = Uint16Array, u32 = Uint32Array;
|
|
207717
|
+
return {
|
|
207718
|
+
next_code: new u16(16),
|
|
207719
|
+
bl_count: new u16(16),
|
|
207720
|
+
ordr: [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15],
|
|
207721
|
+
of0: [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, 999, 999, 999],
|
|
207722
|
+
exb: [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0],
|
|
207723
|
+
ldef: new u16(32),
|
|
207724
|
+
df0: [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, 65535, 65535],
|
|
207725
|
+
dxb: [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0],
|
|
207726
|
+
ddef: new u32(32),
|
|
207727
|
+
flmap: new u16(512),
|
|
207728
|
+
fltree: [],
|
|
207729
|
+
fdmap: new u16(32),
|
|
207730
|
+
fdtree: [],
|
|
207731
|
+
lmap: new u16(32768),
|
|
207732
|
+
ltree: [],
|
|
207733
|
+
ttree: [],
|
|
207734
|
+
dmap: new u16(32768),
|
|
207735
|
+
dtree: [],
|
|
207736
|
+
imap: new u16(512),
|
|
207737
|
+
itree: [],
|
|
207738
|
+
//rev9 : new u16( 512)
|
|
207739
|
+
rev15: new u16(1 << 15),
|
|
207740
|
+
lhst: new u32(286),
|
|
207741
|
+
dhst: new u32(30),
|
|
207742
|
+
ihst: new u32(19),
|
|
207743
|
+
lits: new u32(15e3),
|
|
207744
|
+
strt: new u16(1 << 16),
|
|
207745
|
+
prev: new u16(1 << 15)
|
|
207746
|
+
};
|
|
207747
|
+
}();
|
|
207748
|
+
(function() {
|
|
207749
|
+
var len2 = 1 << 15;
|
|
207750
|
+
for (var i2 = 0; i2 < len2; i2++) {
|
|
207751
|
+
var x2 = i2;
|
|
207752
|
+
x2 = (x2 & 2863311530) >>> 1 | (x2 & 1431655765) << 1;
|
|
207753
|
+
x2 = (x2 & 3435973836) >>> 2 | (x2 & 858993459) << 2;
|
|
207754
|
+
x2 = (x2 & 4042322160) >>> 4 | (x2 & 252645135) << 4;
|
|
207755
|
+
x2 = (x2 & 4278255360) >>> 8 | (x2 & 16711935) << 8;
|
|
207756
|
+
U.rev15[i2] = (x2 >>> 16 | x2 << 16) >>> 17;
|
|
207757
|
+
}
|
|
207758
|
+
function pushV(tgt, n3, sv) {
|
|
207759
|
+
while (n3-- != 0)
|
|
207760
|
+
tgt.push(0, sv);
|
|
207761
|
+
}
|
|
207762
|
+
for (var i2 = 0; i2 < 32; i2++) {
|
|
207763
|
+
U.ldef[i2] = U.of0[i2] << 3 | U.exb[i2];
|
|
207764
|
+
U.ddef[i2] = U.df0[i2] << 4 | U.dxb[i2];
|
|
207765
|
+
}
|
|
207766
|
+
pushV(U.fltree, 144, 8);
|
|
207767
|
+
pushV(U.fltree, 255 - 143, 9);
|
|
207768
|
+
pushV(U.fltree, 279 - 255, 7);
|
|
207769
|
+
pushV(U.fltree, 287 - 279, 8);
|
|
207770
|
+
makeCodes(U.fltree, 9);
|
|
207771
|
+
codes2map(U.fltree, 9, U.flmap);
|
|
207772
|
+
revCodes(U.fltree, 9);
|
|
207773
|
+
pushV(U.fdtree, 32, 5);
|
|
207774
|
+
makeCodes(U.fdtree, 5);
|
|
207775
|
+
codes2map(U.fdtree, 5, U.fdmap);
|
|
207776
|
+
revCodes(U.fdtree, 5);
|
|
207777
|
+
pushV(U.itree, 19, 0);
|
|
207778
|
+
pushV(U.ltree, 286, 0);
|
|
207779
|
+
pushV(U.dtree, 30, 0);
|
|
207780
|
+
pushV(U.ttree, 320, 0);
|
|
207781
|
+
})();
|
|
207782
|
+
const crc = {
|
|
207783
|
+
table: function() {
|
|
207784
|
+
var tab = new Uint32Array(256);
|
|
207785
|
+
for (var n3 = 0; n3 < 256; n3++) {
|
|
207786
|
+
var c2 = n3;
|
|
207787
|
+
for (var k = 0; k < 8; k++) {
|
|
207788
|
+
if (c2 & 1)
|
|
207789
|
+
c2 = 3988292384 ^ c2 >>> 1;
|
|
207790
|
+
else
|
|
207791
|
+
c2 = c2 >>> 1;
|
|
207792
|
+
}
|
|
207793
|
+
tab[n3] = c2;
|
|
207794
|
+
}
|
|
207795
|
+
return tab;
|
|
207796
|
+
}(),
|
|
207797
|
+
update: function(c2, buf, off, len2) {
|
|
207798
|
+
for (var i2 = 0; i2 < len2; i2++)
|
|
207799
|
+
c2 = crc.table[(c2 ^ buf[off + i2]) & 255] ^ c2 >>> 8;
|
|
207800
|
+
return c2;
|
|
207801
|
+
},
|
|
207802
|
+
crc: function(b2, o2, l2) {
|
|
207803
|
+
return crc.update(4294967295, b2, o2, l2) ^ 4294967295;
|
|
207804
|
+
}
|
|
207805
|
+
};
|
|
207806
|
+
function inflateRaw(file, buf) {
|
|
207807
|
+
return inflate(file, buf);
|
|
207808
|
+
}
|
|
207809
|
+
const config2 = {
|
|
207810
|
+
numWorkers: 1,
|
|
207811
|
+
workerURL: "",
|
|
207812
|
+
useWorkers: false
|
|
207813
|
+
};
|
|
207814
|
+
let nextId = 0;
|
|
207815
|
+
const waitingForWorkerQueue = [];
|
|
207816
|
+
function startWorker(url) {
|
|
207817
|
+
return new Promise((resolve2, reject) => {
|
|
207818
|
+
const worker = new Worker(url);
|
|
207819
|
+
worker.onmessage = (e3) => {
|
|
207820
|
+
if (e3.data === "start") {
|
|
207821
|
+
worker.onerror = void 0;
|
|
207822
|
+
worker.onmessage = void 0;
|
|
207823
|
+
resolve2(worker);
|
|
207824
|
+
} else {
|
|
207825
|
+
reject(new Error(`unexpected message: ${e3.data}`));
|
|
207826
|
+
}
|
|
207827
|
+
};
|
|
207828
|
+
worker.onerror = reject;
|
|
207829
|
+
});
|
|
207830
|
+
}
|
|
207831
|
+
function dynamicRequire(mod2, request2) {
|
|
207832
|
+
return mod2.require ? mod2.require(request2) : {};
|
|
207833
|
+
}
|
|
207834
|
+
(function() {
|
|
207835
|
+
if (isNode) {
|
|
207836
|
+
const { Worker: Worker3 } = dynamicRequire(module, "worker_threads");
|
|
207837
|
+
return {
|
|
207838
|
+
async createWorker(url) {
|
|
207839
|
+
return new Worker3(url);
|
|
207840
|
+
},
|
|
207841
|
+
addEventListener(worker, fn) {
|
|
207842
|
+
worker.on("message", (data2) => {
|
|
207843
|
+
fn({ target: worker, data: data2 });
|
|
207844
|
+
});
|
|
207845
|
+
},
|
|
207846
|
+
async terminate(worker) {
|
|
207847
|
+
await worker.terminate();
|
|
207848
|
+
}
|
|
207849
|
+
};
|
|
207850
|
+
} else {
|
|
207851
|
+
return {
|
|
207852
|
+
async createWorker(url) {
|
|
207853
|
+
try {
|
|
207854
|
+
const worker = await startWorker(url);
|
|
207855
|
+
return worker;
|
|
207856
|
+
} catch (e3) {
|
|
207857
|
+
console.warn("could not load worker:", url);
|
|
207858
|
+
}
|
|
207859
|
+
let text2;
|
|
207860
|
+
try {
|
|
207861
|
+
const req = await fetch(url, { mode: "cors" });
|
|
207862
|
+
if (!req.ok) {
|
|
207863
|
+
throw new Error(`could not load: ${url}`);
|
|
207864
|
+
}
|
|
207865
|
+
text2 = await req.text();
|
|
207866
|
+
url = URL.createObjectURL(new Blob([text2], { type: "application/javascript" }));
|
|
207867
|
+
const worker = await startWorker(url);
|
|
207868
|
+
config2.workerURL = url;
|
|
207869
|
+
return worker;
|
|
207870
|
+
} catch (e3) {
|
|
207871
|
+
console.warn("could not load worker via fetch:", url);
|
|
207872
|
+
}
|
|
207873
|
+
if (text2 !== void 0) {
|
|
207874
|
+
try {
|
|
207875
|
+
url = `data:application/javascript;base64,${btoa(text2)}`;
|
|
207876
|
+
const worker = await startWorker(url);
|
|
207877
|
+
config2.workerURL = url;
|
|
207878
|
+
return worker;
|
|
207879
|
+
} catch (e3) {
|
|
207880
|
+
console.warn("could not load worker via dataURI");
|
|
207881
|
+
}
|
|
207882
|
+
}
|
|
207883
|
+
console.warn("workers will not be used");
|
|
207884
|
+
throw new Error("can not start workers");
|
|
207885
|
+
},
|
|
207886
|
+
addEventListener(worker, fn) {
|
|
207887
|
+
worker.addEventListener("message", fn);
|
|
207888
|
+
},
|
|
207889
|
+
async terminate(worker) {
|
|
207890
|
+
worker.terminate();
|
|
207891
|
+
}
|
|
207892
|
+
};
|
|
207893
|
+
}
|
|
207894
|
+
})();
|
|
207895
|
+
function inflateRawLocal(src2, uncompressedSize, type3, resolve2) {
|
|
207896
|
+
const dst = new Uint8Array(uncompressedSize);
|
|
207897
|
+
inflateRaw(src2, dst);
|
|
207898
|
+
resolve2(type3 ? new Blob([dst], { type: type3 }) : dst.buffer);
|
|
207899
|
+
}
|
|
207900
|
+
async function processWaitingForWorkerQueue() {
|
|
207901
|
+
if (waitingForWorkerQueue.length === 0) {
|
|
207902
|
+
return;
|
|
207903
|
+
}
|
|
207904
|
+
while (waitingForWorkerQueue.length) {
|
|
207905
|
+
const { src: src2, uncompressedSize, type: type3, resolve: resolve2 } = waitingForWorkerQueue.shift();
|
|
207906
|
+
let data2 = src2;
|
|
207907
|
+
if (isBlob(src2)) {
|
|
207908
|
+
data2 = await readBlobAsUint8Array(src2);
|
|
207909
|
+
}
|
|
207910
|
+
inflateRawLocal(data2, uncompressedSize, type3, resolve2);
|
|
207911
|
+
}
|
|
207912
|
+
}
|
|
207913
|
+
function inflateRawAsync(src2, uncompressedSize, type3) {
|
|
207914
|
+
return new Promise((resolve2, reject) => {
|
|
207915
|
+
waitingForWorkerQueue.push({ src: src2, uncompressedSize, type: type3, resolve: resolve2, reject, id: nextId++ });
|
|
207916
|
+
processWaitingForWorkerQueue();
|
|
207917
|
+
});
|
|
207918
|
+
}
|
|
207919
|
+
function dosDateTimeToDate(date2, time2) {
|
|
207920
|
+
const day2 = date2 & 31;
|
|
207921
|
+
const month2 = (date2 >> 5 & 15) - 1;
|
|
207922
|
+
const year2 = (date2 >> 9 & 127) + 1980;
|
|
207923
|
+
const millisecond2 = 0;
|
|
207924
|
+
const second2 = (time2 & 31) * 2;
|
|
207925
|
+
const minute2 = time2 >> 5 & 63;
|
|
207926
|
+
const hour2 = time2 >> 11 & 31;
|
|
207927
|
+
return new Date(year2, month2, day2, hour2, minute2, second2, millisecond2);
|
|
207928
|
+
}
|
|
207929
|
+
class ZipEntry {
|
|
207930
|
+
constructor(reader, rawEntry) {
|
|
207931
|
+
this._reader = reader;
|
|
207932
|
+
this._rawEntry = rawEntry;
|
|
207933
|
+
this.name = rawEntry.name;
|
|
207934
|
+
this.nameBytes = rawEntry.nameBytes;
|
|
207935
|
+
this.size = rawEntry.uncompressedSize;
|
|
207936
|
+
this.compressedSize = rawEntry.compressedSize;
|
|
207937
|
+
this.comment = rawEntry.comment;
|
|
207938
|
+
this.commentBytes = rawEntry.commentBytes;
|
|
207939
|
+
this.compressionMethod = rawEntry.compressionMethod;
|
|
207940
|
+
this.lastModDate = dosDateTimeToDate(rawEntry.lastModFileDate, rawEntry.lastModFileTime);
|
|
207941
|
+
this.isDirectory = rawEntry.uncompressedSize === 0 && rawEntry.name.endsWith("/");
|
|
207942
|
+
this.encrypted = !!(rawEntry.generalPurposeBitFlag & 1);
|
|
207943
|
+
this.externalFileAttributes = rawEntry.externalFileAttributes;
|
|
207944
|
+
this.versionMadeBy = rawEntry.versionMadeBy;
|
|
207945
|
+
}
|
|
207946
|
+
// returns a promise that returns a Blob for this entry
|
|
207947
|
+
async blob(type3 = "application/octet-stream") {
|
|
207948
|
+
return await readEntryDataAsBlob(this._reader, this._rawEntry, type3);
|
|
207949
|
+
}
|
|
207950
|
+
// returns a promise that returns an ArrayBuffer for this entry
|
|
207951
|
+
async arrayBuffer() {
|
|
207952
|
+
return await readEntryDataAsArrayBuffer(this._reader, this._rawEntry);
|
|
207953
|
+
}
|
|
207954
|
+
// returns text, assumes the text is valid utf8. If you want more options decode arrayBuffer yourself
|
|
207955
|
+
async text() {
|
|
207956
|
+
const buffer2 = await this.arrayBuffer();
|
|
207957
|
+
return decodeBuffer(new Uint8Array(buffer2));
|
|
207958
|
+
}
|
|
207959
|
+
// returns text with JSON.parse called on it. If you want more options decode arrayBuffer yourself
|
|
207960
|
+
async json() {
|
|
207961
|
+
const text2 = await this.text();
|
|
207962
|
+
return JSON.parse(text2);
|
|
207963
|
+
}
|
|
207964
|
+
}
|
|
207965
|
+
const EOCDR_WITHOUT_COMMENT_SIZE = 22;
|
|
207966
|
+
const MAX_COMMENT_SIZE = 65535;
|
|
207967
|
+
const EOCDR_SIGNATURE = 101010256;
|
|
207968
|
+
const ZIP64_EOCDR_SIGNATURE = 101075792;
|
|
207969
|
+
async function readAs(reader, offset6, length2) {
|
|
207970
|
+
return await reader.read(offset6, length2);
|
|
207971
|
+
}
|
|
207972
|
+
async function readAsBlobOrTypedArray(reader, offset6, length2, type3) {
|
|
207973
|
+
if (reader.sliceAsBlob) {
|
|
207974
|
+
return await reader.sliceAsBlob(offset6, length2, type3);
|
|
207975
|
+
}
|
|
207976
|
+
return await reader.read(offset6, length2);
|
|
207977
|
+
}
|
|
207978
|
+
const crc$1 = {
|
|
207979
|
+
unsigned() {
|
|
207980
|
+
return 0;
|
|
207981
|
+
}
|
|
207982
|
+
};
|
|
207983
|
+
function getUint16LE(uint8View, offset6) {
|
|
207984
|
+
return uint8View[offset6] + uint8View[offset6 + 1] * 256;
|
|
207985
|
+
}
|
|
207986
|
+
function getUint32LE(uint8View, offset6) {
|
|
207987
|
+
return uint8View[offset6] + uint8View[offset6 + 1] * 256 + uint8View[offset6 + 2] * 65536 + uint8View[offset6 + 3] * 16777216;
|
|
207988
|
+
}
|
|
207989
|
+
function getUint64LE(uint8View, offset6) {
|
|
207990
|
+
return getUint32LE(uint8View, offset6) + getUint32LE(uint8View, offset6 + 4) * 4294967296;
|
|
207991
|
+
}
|
|
207992
|
+
const utf8Decoder = new TextDecoder();
|
|
207993
|
+
function decodeBuffer(uint8View, isUTF8) {
|
|
207994
|
+
if (isSharedArrayBuffer(uint8View.buffer)) {
|
|
207995
|
+
uint8View = new Uint8Array(uint8View);
|
|
207996
|
+
}
|
|
207997
|
+
return utf8Decoder.decode(uint8View);
|
|
207998
|
+
}
|
|
207999
|
+
async function findEndOfCentralDirector(reader, totalLength) {
|
|
208000
|
+
const size2 = Math.min(EOCDR_WITHOUT_COMMENT_SIZE + MAX_COMMENT_SIZE, totalLength);
|
|
208001
|
+
const readStart = totalLength - size2;
|
|
208002
|
+
const data2 = await readAs(reader, readStart, size2);
|
|
208003
|
+
for (let i2 = size2 - EOCDR_WITHOUT_COMMENT_SIZE; i2 >= 0; --i2) {
|
|
208004
|
+
if (getUint32LE(data2, i2) !== EOCDR_SIGNATURE) {
|
|
208005
|
+
continue;
|
|
208006
|
+
}
|
|
208007
|
+
const eocdr = new Uint8Array(data2.buffer, data2.byteOffset + i2, data2.byteLength - i2);
|
|
208008
|
+
const diskNumber = getUint16LE(eocdr, 4);
|
|
208009
|
+
if (diskNumber !== 0) {
|
|
208010
|
+
throw new Error(`multi-volume zip files are not supported. This is volume: ${diskNumber}`);
|
|
208011
|
+
}
|
|
208012
|
+
const entryCount = getUint16LE(eocdr, 10);
|
|
208013
|
+
const centralDirectorySize = getUint32LE(eocdr, 12);
|
|
208014
|
+
const centralDirectoryOffset = getUint32LE(eocdr, 16);
|
|
208015
|
+
const commentLength = getUint16LE(eocdr, 20);
|
|
208016
|
+
const expectedCommentLength = eocdr.length - EOCDR_WITHOUT_COMMENT_SIZE;
|
|
208017
|
+
if (commentLength !== expectedCommentLength) {
|
|
208018
|
+
throw new Error(`invalid comment length. expected: ${expectedCommentLength}, actual: ${commentLength}`);
|
|
208019
|
+
}
|
|
208020
|
+
const commentBytes = new Uint8Array(eocdr.buffer, eocdr.byteOffset + 22, commentLength);
|
|
208021
|
+
const comment = decodeBuffer(commentBytes);
|
|
208022
|
+
if (entryCount === 65535 || centralDirectoryOffset === 4294967295) {
|
|
208023
|
+
return await readZip64CentralDirectory(reader, readStart + i2, comment, commentBytes);
|
|
208024
|
+
} else {
|
|
208025
|
+
return await readEntries(reader, centralDirectoryOffset, centralDirectorySize, entryCount, comment, commentBytes);
|
|
208026
|
+
}
|
|
208027
|
+
}
|
|
208028
|
+
throw new Error("could not find end of central directory. maybe not zip file");
|
|
208029
|
+
}
|
|
208030
|
+
const END_OF_CENTRAL_DIRECTORY_LOCATOR_SIGNATURE = 117853008;
|
|
208031
|
+
async function readZip64CentralDirectory(reader, offset6, comment, commentBytes) {
|
|
208032
|
+
const zip64EocdlOffset = offset6 - 20;
|
|
208033
|
+
const eocdl = await readAs(reader, zip64EocdlOffset, 20);
|
|
208034
|
+
if (getUint32LE(eocdl, 0) !== END_OF_CENTRAL_DIRECTORY_LOCATOR_SIGNATURE) {
|
|
208035
|
+
throw new Error("invalid zip64 end of central directory locator signature");
|
|
208036
|
+
}
|
|
208037
|
+
const zip64EocdrOffset = getUint64LE(eocdl, 8);
|
|
208038
|
+
const zip64Eocdr = await readAs(reader, zip64EocdrOffset, 56);
|
|
208039
|
+
if (getUint32LE(zip64Eocdr, 0) !== ZIP64_EOCDR_SIGNATURE) {
|
|
208040
|
+
throw new Error("invalid zip64 end of central directory record signature");
|
|
208041
|
+
}
|
|
208042
|
+
const entryCount = getUint64LE(zip64Eocdr, 32);
|
|
208043
|
+
const centralDirectorySize = getUint64LE(zip64Eocdr, 40);
|
|
208044
|
+
const centralDirectoryOffset = getUint64LE(zip64Eocdr, 48);
|
|
208045
|
+
return readEntries(reader, centralDirectoryOffset, centralDirectorySize, entryCount, comment, commentBytes);
|
|
208046
|
+
}
|
|
208047
|
+
const CENTRAL_DIRECTORY_FILE_HEADER_SIGNATURE = 33639248;
|
|
208048
|
+
async function readEntries(reader, centralDirectoryOffset, centralDirectorySize, rawEntryCount, comment, commentBytes) {
|
|
208049
|
+
let readEntryCursor = 0;
|
|
208050
|
+
const allEntriesBuffer = await readAs(reader, centralDirectoryOffset, centralDirectorySize);
|
|
208051
|
+
const rawEntries = [];
|
|
208052
|
+
for (let e3 = 0; e3 < rawEntryCount; ++e3) {
|
|
208053
|
+
const buffer2 = allEntriesBuffer.subarray(readEntryCursor, readEntryCursor + 46);
|
|
208054
|
+
const signature = getUint32LE(buffer2, 0);
|
|
208055
|
+
if (signature !== CENTRAL_DIRECTORY_FILE_HEADER_SIGNATURE) {
|
|
208056
|
+
throw new Error(`invalid central directory file header signature: 0x${signature.toString(16)}`);
|
|
208057
|
+
}
|
|
208058
|
+
const rawEntry = {
|
|
208059
|
+
// 4 - Version made by
|
|
208060
|
+
versionMadeBy: getUint16LE(buffer2, 4),
|
|
208061
|
+
// 6 - Version needed to extract (minimum)
|
|
208062
|
+
versionNeededToExtract: getUint16LE(buffer2, 6),
|
|
208063
|
+
// 8 - General purpose bit flag
|
|
208064
|
+
generalPurposeBitFlag: getUint16LE(buffer2, 8),
|
|
208065
|
+
// 10 - Compression method
|
|
208066
|
+
compressionMethod: getUint16LE(buffer2, 10),
|
|
208067
|
+
// 12 - File last modification time
|
|
208068
|
+
lastModFileTime: getUint16LE(buffer2, 12),
|
|
208069
|
+
// 14 - File last modification date
|
|
208070
|
+
lastModFileDate: getUint16LE(buffer2, 14),
|
|
208071
|
+
// 16 - CRC-32
|
|
208072
|
+
crc32: getUint32LE(buffer2, 16),
|
|
208073
|
+
// 20 - Compressed size
|
|
208074
|
+
compressedSize: getUint32LE(buffer2, 20),
|
|
208075
|
+
// 24 - Uncompressed size
|
|
208076
|
+
uncompressedSize: getUint32LE(buffer2, 24),
|
|
208077
|
+
// 28 - File name length (n)
|
|
208078
|
+
fileNameLength: getUint16LE(buffer2, 28),
|
|
208079
|
+
// 30 - Extra field length (m)
|
|
208080
|
+
extraFieldLength: getUint16LE(buffer2, 30),
|
|
208081
|
+
// 32 - File comment length (k)
|
|
208082
|
+
fileCommentLength: getUint16LE(buffer2, 32),
|
|
208083
|
+
// 34 - Disk number where file starts
|
|
208084
|
+
// 36 - Internal file attributes
|
|
208085
|
+
internalFileAttributes: getUint16LE(buffer2, 36),
|
|
208086
|
+
// 38 - External file attributes
|
|
208087
|
+
externalFileAttributes: getUint32LE(buffer2, 38),
|
|
208088
|
+
// 42 - Relative offset of local file header
|
|
208089
|
+
relativeOffsetOfLocalHeader: getUint32LE(buffer2, 42)
|
|
208090
|
+
};
|
|
208091
|
+
if (rawEntry.generalPurposeBitFlag & 64) {
|
|
208092
|
+
throw new Error("strong encryption is not supported");
|
|
208093
|
+
}
|
|
208094
|
+
readEntryCursor += 46;
|
|
208095
|
+
const data2 = allEntriesBuffer.subarray(readEntryCursor, readEntryCursor + rawEntry.fileNameLength + rawEntry.extraFieldLength + rawEntry.fileCommentLength);
|
|
208096
|
+
rawEntry.nameBytes = data2.slice(0, rawEntry.fileNameLength);
|
|
208097
|
+
rawEntry.name = decodeBuffer(rawEntry.nameBytes);
|
|
208098
|
+
const fileCommentStart = rawEntry.fileNameLength + rawEntry.extraFieldLength;
|
|
208099
|
+
const extraFieldBuffer = data2.slice(rawEntry.fileNameLength, fileCommentStart);
|
|
208100
|
+
rawEntry.extraFields = [];
|
|
208101
|
+
let i2 = 0;
|
|
208102
|
+
while (i2 < extraFieldBuffer.length - 3) {
|
|
208103
|
+
const headerId = getUint16LE(extraFieldBuffer, i2 + 0);
|
|
208104
|
+
const dataSize = getUint16LE(extraFieldBuffer, i2 + 2);
|
|
208105
|
+
const dataStart = i2 + 4;
|
|
208106
|
+
const dataEnd = dataStart + dataSize;
|
|
208107
|
+
if (dataEnd > extraFieldBuffer.length) {
|
|
208108
|
+
throw new Error("extra field length exceeds extra field buffer size");
|
|
208109
|
+
}
|
|
208110
|
+
rawEntry.extraFields.push({
|
|
208111
|
+
id: headerId,
|
|
208112
|
+
data: extraFieldBuffer.slice(dataStart, dataEnd)
|
|
208113
|
+
});
|
|
208114
|
+
i2 = dataEnd;
|
|
208115
|
+
}
|
|
208116
|
+
rawEntry.commentBytes = data2.slice(fileCommentStart, fileCommentStart + rawEntry.fileCommentLength);
|
|
208117
|
+
rawEntry.comment = decodeBuffer(rawEntry.commentBytes);
|
|
208118
|
+
readEntryCursor += data2.length;
|
|
208119
|
+
if (rawEntry.uncompressedSize === 4294967295 || rawEntry.compressedSize === 4294967295 || rawEntry.relativeOffsetOfLocalHeader === 4294967295) {
|
|
208120
|
+
const zip64ExtraField = rawEntry.extraFields.find((e4) => e4.id === 1);
|
|
208121
|
+
if (!zip64ExtraField) {
|
|
208122
|
+
throw new Error("expected zip64 extended information extra field");
|
|
208123
|
+
}
|
|
208124
|
+
const zip64EiefBuffer = zip64ExtraField.data;
|
|
208125
|
+
let index2 = 0;
|
|
208126
|
+
if (rawEntry.uncompressedSize === 4294967295) {
|
|
208127
|
+
if (index2 + 8 > zip64EiefBuffer.length) {
|
|
208128
|
+
throw new Error("zip64 extended information extra field does not include uncompressed size");
|
|
208129
|
+
}
|
|
208130
|
+
rawEntry.uncompressedSize = getUint64LE(zip64EiefBuffer, index2);
|
|
208131
|
+
index2 += 8;
|
|
208132
|
+
}
|
|
208133
|
+
if (rawEntry.compressedSize === 4294967295) {
|
|
208134
|
+
if (index2 + 8 > zip64EiefBuffer.length) {
|
|
208135
|
+
throw new Error("zip64 extended information extra field does not include compressed size");
|
|
208136
|
+
}
|
|
208137
|
+
rawEntry.compressedSize = getUint64LE(zip64EiefBuffer, index2);
|
|
208138
|
+
index2 += 8;
|
|
208139
|
+
}
|
|
208140
|
+
if (rawEntry.relativeOffsetOfLocalHeader === 4294967295) {
|
|
208141
|
+
if (index2 + 8 > zip64EiefBuffer.length) {
|
|
208142
|
+
throw new Error("zip64 extended information extra field does not include relative header offset");
|
|
208143
|
+
}
|
|
208144
|
+
rawEntry.relativeOffsetOfLocalHeader = getUint64LE(zip64EiefBuffer, index2);
|
|
208145
|
+
index2 += 8;
|
|
208146
|
+
}
|
|
208147
|
+
}
|
|
208148
|
+
const nameField = rawEntry.extraFields.find((e4) => e4.id === 28789 && e4.data.length >= 6 && // too short to be meaningful
|
|
208149
|
+
e4.data[0] === 1 && // Version 1 byte version of this extra field, currently 1
|
|
208150
|
+
getUint32LE(e4.data, 1), crc$1.unsigned(rawEntry.nameBytes));
|
|
208151
|
+
if (nameField) {
|
|
208152
|
+
rawEntry.fileName = decodeBuffer(nameField.data.slice(5));
|
|
208153
|
+
}
|
|
208154
|
+
if (rawEntry.compressionMethod === 0) {
|
|
208155
|
+
let expectedCompressedSize = rawEntry.uncompressedSize;
|
|
208156
|
+
if ((rawEntry.generalPurposeBitFlag & 1) !== 0) {
|
|
208157
|
+
expectedCompressedSize += 12;
|
|
208158
|
+
}
|
|
208159
|
+
if (rawEntry.compressedSize !== expectedCompressedSize) {
|
|
208160
|
+
throw new Error(`compressed size mismatch for stored file: ${rawEntry.compressedSize} != ${expectedCompressedSize}`);
|
|
208161
|
+
}
|
|
208162
|
+
}
|
|
208163
|
+
rawEntries.push(rawEntry);
|
|
208164
|
+
}
|
|
208165
|
+
const zip2 = {
|
|
208166
|
+
comment,
|
|
208167
|
+
commentBytes
|
|
208168
|
+
};
|
|
208169
|
+
return {
|
|
208170
|
+
zip: zip2,
|
|
208171
|
+
entries: rawEntries.map((e3) => new ZipEntry(reader, e3))
|
|
208172
|
+
};
|
|
208173
|
+
}
|
|
208174
|
+
async function readEntryDataHeader(reader, rawEntry) {
|
|
208175
|
+
if (rawEntry.generalPurposeBitFlag & 1) {
|
|
208176
|
+
throw new Error("encrypted entries not supported");
|
|
208177
|
+
}
|
|
208178
|
+
const buffer2 = await readAs(reader, rawEntry.relativeOffsetOfLocalHeader, 30);
|
|
208179
|
+
const totalLength = await reader.getLength();
|
|
208180
|
+
const signature = getUint32LE(buffer2, 0);
|
|
208181
|
+
if (signature !== 67324752) {
|
|
208182
|
+
throw new Error(`invalid local file header signature: 0x${signature.toString(16)}`);
|
|
208183
|
+
}
|
|
208184
|
+
const fileNameLength = getUint16LE(buffer2, 26);
|
|
208185
|
+
const extraFieldLength = getUint16LE(buffer2, 28);
|
|
208186
|
+
const localFileHeaderEnd = rawEntry.relativeOffsetOfLocalHeader + buffer2.length + fileNameLength + extraFieldLength;
|
|
208187
|
+
let decompress;
|
|
208188
|
+
if (rawEntry.compressionMethod === 0) {
|
|
208189
|
+
decompress = false;
|
|
208190
|
+
} else if (rawEntry.compressionMethod === 8) {
|
|
208191
|
+
decompress = true;
|
|
208192
|
+
} else {
|
|
208193
|
+
throw new Error(`unsupported compression method: ${rawEntry.compressionMethod}`);
|
|
208194
|
+
}
|
|
208195
|
+
const fileDataStart = localFileHeaderEnd;
|
|
208196
|
+
const fileDataEnd = fileDataStart + rawEntry.compressedSize;
|
|
208197
|
+
if (rawEntry.compressedSize !== 0) {
|
|
208198
|
+
if (fileDataEnd > totalLength) {
|
|
208199
|
+
throw new Error(`file data overflows file bounds: ${fileDataStart} + ${rawEntry.compressedSize} > ${totalLength}`);
|
|
208200
|
+
}
|
|
208201
|
+
}
|
|
208202
|
+
return {
|
|
208203
|
+
decompress,
|
|
208204
|
+
fileDataStart
|
|
208205
|
+
};
|
|
208206
|
+
}
|
|
208207
|
+
async function readEntryDataAsArrayBuffer(reader, rawEntry) {
|
|
208208
|
+
const { decompress, fileDataStart } = await readEntryDataHeader(reader, rawEntry);
|
|
208209
|
+
if (!decompress) {
|
|
208210
|
+
const dataView = await readAs(reader, fileDataStart, rawEntry.compressedSize);
|
|
208211
|
+
return isTypedArraySameAsArrayBuffer(dataView) ? dataView.buffer : dataView.slice().buffer;
|
|
208212
|
+
}
|
|
208213
|
+
const typedArrayOrBlob = await readAsBlobOrTypedArray(reader, fileDataStart, rawEntry.compressedSize);
|
|
208214
|
+
const result = await inflateRawAsync(typedArrayOrBlob, rawEntry.uncompressedSize);
|
|
208215
|
+
return result;
|
|
208216
|
+
}
|
|
208217
|
+
async function readEntryDataAsBlob(reader, rawEntry, type3) {
|
|
208218
|
+
const { decompress, fileDataStart } = await readEntryDataHeader(reader, rawEntry);
|
|
208219
|
+
if (!decompress) {
|
|
208220
|
+
const typedArrayOrBlob2 = await readAsBlobOrTypedArray(reader, fileDataStart, rawEntry.compressedSize, type3);
|
|
208221
|
+
if (isBlob(typedArrayOrBlob2)) {
|
|
208222
|
+
return typedArrayOrBlob2;
|
|
208223
|
+
}
|
|
208224
|
+
return new Blob([isSharedArrayBuffer(typedArrayOrBlob2.buffer) ? new Uint8Array(typedArrayOrBlob2) : typedArrayOrBlob2], { type: type3 });
|
|
208225
|
+
}
|
|
208226
|
+
const typedArrayOrBlob = await readAsBlobOrTypedArray(reader, fileDataStart, rawEntry.compressedSize);
|
|
208227
|
+
const result = await inflateRawAsync(typedArrayOrBlob, rawEntry.uncompressedSize, type3);
|
|
208228
|
+
return result;
|
|
208229
|
+
}
|
|
208230
|
+
async function unzipRaw(source2) {
|
|
208231
|
+
let reader;
|
|
208232
|
+
if (typeof Blob !== "undefined" && source2 instanceof Blob) {
|
|
208233
|
+
reader = new BlobReader$1(source2);
|
|
208234
|
+
} else if (source2 instanceof ArrayBuffer || source2 && source2.buffer && source2.buffer instanceof ArrayBuffer) {
|
|
208235
|
+
reader = new ArrayBufferReader(source2);
|
|
208236
|
+
} else if (isSharedArrayBuffer(source2) || isSharedArrayBuffer(source2.buffer)) {
|
|
208237
|
+
reader = new ArrayBufferReader(source2);
|
|
208238
|
+
} else if (typeof source2 === "string") {
|
|
208239
|
+
const req = await fetch(source2);
|
|
208240
|
+
if (!req.ok) {
|
|
208241
|
+
throw new Error(`failed http request ${source2}, status: ${req.status}: ${req.statusText}`);
|
|
208242
|
+
}
|
|
208243
|
+
const blob = await req.blob();
|
|
208244
|
+
reader = new BlobReader$1(blob);
|
|
208245
|
+
} else if (typeof source2.getLength === "function" && typeof source2.read === "function") {
|
|
208246
|
+
reader = source2;
|
|
208247
|
+
} else {
|
|
208248
|
+
throw new Error("unsupported source type");
|
|
208249
|
+
}
|
|
208250
|
+
const totalLength = await reader.getLength();
|
|
208251
|
+
if (totalLength > Number.MAX_SAFE_INTEGER) {
|
|
208252
|
+
throw new Error(`file too large. size: ${totalLength}. Only file sizes up 4503599627370496 bytes are supported`);
|
|
208253
|
+
}
|
|
208254
|
+
return await findEndOfCentralDirector(reader, totalLength);
|
|
208255
|
+
}
|
|
208256
|
+
async function unzip(source2) {
|
|
208257
|
+
const { zip: zip2, entries: entries2 } = await unzipRaw(source2);
|
|
208258
|
+
return {
|
|
208259
|
+
zip: zip2,
|
|
208260
|
+
entries: Object.fromEntries(entries2.map((v) => [v.name, v]))
|
|
208261
|
+
};
|
|
208262
|
+
}
|
|
208263
|
+
class BlobReader2 {
|
|
208264
|
+
constructor(blob) {
|
|
208265
|
+
__publicField(this, "blob");
|
|
208266
|
+
this.blob = blob;
|
|
208267
|
+
}
|
|
208268
|
+
async getLength() {
|
|
208269
|
+
return this.blob.size;
|
|
208270
|
+
}
|
|
208271
|
+
async read(offset6, length2) {
|
|
208272
|
+
const blob = this.blob.slice(offset6, offset6 + length2);
|
|
208273
|
+
return new Uint8Array(await blob.arrayBuffer());
|
|
208274
|
+
}
|
|
208275
|
+
}
|
|
208276
|
+
class HTTPRangeReader {
|
|
208277
|
+
constructor(url, opts2 = {}) {
|
|
208278
|
+
__publicField(this, "url");
|
|
208279
|
+
__publicField(this, "length");
|
|
208280
|
+
__privateAdd(this, _overrides2, void 0);
|
|
208281
|
+
this.url = url;
|
|
208282
|
+
__privateSet(this, _overrides2, opts2.overrides ?? {});
|
|
208283
|
+
}
|
|
208284
|
+
async getLength() {
|
|
208285
|
+
if (this.length === void 0) {
|
|
208286
|
+
const req = await fetch(this.url, {
|
|
208287
|
+
...__privateGet(this, _overrides2),
|
|
208288
|
+
method: "HEAD"
|
|
208289
|
+
});
|
|
208290
|
+
if (!req.ok) {
|
|
208291
|
+
throw new Error(`failed http request ${this.url}, status: ${req.status}: ${req.statusText}`);
|
|
208292
|
+
}
|
|
208293
|
+
this.length = parseInt(req.headers.get("content-length"));
|
|
208294
|
+
if (Number.isNaN(this.length)) {
|
|
208295
|
+
throw Error("could not get length");
|
|
208296
|
+
}
|
|
208297
|
+
}
|
|
208298
|
+
return this.length;
|
|
208299
|
+
}
|
|
208300
|
+
async read(offset6, size2) {
|
|
208301
|
+
if (size2 === 0) {
|
|
208302
|
+
return new Uint8Array(0);
|
|
208303
|
+
}
|
|
208304
|
+
const req = await fetch_range(this.url, offset6, size2, __privateGet(this, _overrides2));
|
|
208305
|
+
if (!req.ok) {
|
|
208306
|
+
throw new Error(`failed http request ${this.url}, status: ${req.status} offset: ${offset6} size: ${size2}: ${req.statusText}`);
|
|
208307
|
+
}
|
|
208308
|
+
return new Uint8Array(await req.arrayBuffer());
|
|
208309
|
+
}
|
|
208310
|
+
}
|
|
208311
|
+
_overrides2 = new WeakMap();
|
|
208312
|
+
class ZipFileStore {
|
|
208313
|
+
constructor(reader) {
|
|
208314
|
+
__publicField(this, "info");
|
|
208315
|
+
this.info = unzip(reader);
|
|
208316
|
+
}
|
|
208317
|
+
async get(key2) {
|
|
208318
|
+
let entry2 = (await this.info).entries[strip_prefix(key2)];
|
|
208319
|
+
if (!entry2)
|
|
208320
|
+
return;
|
|
208321
|
+
return new Uint8Array(await entry2.arrayBuffer());
|
|
208322
|
+
}
|
|
208323
|
+
async has(key2) {
|
|
208324
|
+
return strip_prefix(key2) in (await this.info).entries;
|
|
208325
|
+
}
|
|
208326
|
+
static fromUrl(href2, opts2 = {}) {
|
|
208327
|
+
return new ZipFileStore(new HTTPRangeReader(href2, opts2));
|
|
208328
|
+
}
|
|
208329
|
+
static fromBlob(blob) {
|
|
208330
|
+
return new ZipFileStore(new BlobReader2(blob));
|
|
208331
|
+
}
|
|
208332
|
+
}
|
|
208333
|
+
const ZipFileStore$1 = ZipFileStore;
|
|
208334
|
+
function zarrOpenRoot(url, fileType, requestInit2) {
|
|
208335
|
+
let store2;
|
|
208336
|
+
if (fileType && fileType.endsWith(".zip")) {
|
|
208337
|
+
store2 = ZipFileStore$1.fromUrl(url, { overrides: requestInit2 });
|
|
208338
|
+
} else {
|
|
208339
|
+
store2 = new FetchStore$1(url, { overrides: requestInit2 });
|
|
208340
|
+
}
|
|
207258
208341
|
return root(store2);
|
|
207259
208342
|
}
|
|
207260
208343
|
function prevPowerOf2(x2) {
|
|
@@ -209856,6 +210939,7 @@ function SpatialSubscriber(props2) {
|
|
|
209856
210939
|
const [pointMultiObsLabelsData, pointMultiObsLabelsDataStatus] = usePointMultiObsLabels(coordinationScopes, coordinationScopesBy, loaders, dataset);
|
|
209857
210940
|
const [obsSpotsData, obsSpotsDataStatus, obsSpotsUrls] = useMultiObsSpots(coordinationScopes, coordinationScopesBy, loaders, dataset, mergeCoordination, uuid);
|
|
209858
210941
|
const [obsSpotsSetsData, obsSpotsSetsDataStatus] = useSpotMultiObsSets(coordinationScopes, coordinationScopesBy, loaders, dataset);
|
|
210942
|
+
const [obsSpotsFeatureLabelsData, obsSpotsFeatureLabelsDataStatus] = useSpotMultiFeatureLabels(coordinationScopes, coordinationScopesBy, loaders, dataset);
|
|
209859
210943
|
const [spotMultiExpressionData, spotMultiLoadedFeatureSelection, spotMultiExpressionExtents, spotMultiExpressionNormData, spotMultiFeatureSelectionStatus] = useSpotMultiFeatureSelection(coordinationScopes, coordinationScopesBy, loaders, dataset);
|
|
209860
210944
|
const [spotMultiIndicesData, spotMultiIndicesDataStatus] = useSpotMultiObsFeatureMatrixIndices(coordinationScopes, coordinationScopesBy, loaders, dataset);
|
|
209861
210945
|
const [obsSegmentationsLocationsData, obsSegmentationsLocationsDataStatus] = useSegmentationMultiObsLocations(coordinationScopes, coordinationScopesBy, loaders, dataset);
|
|
@@ -210176,6 +211260,7 @@ function SpatialSubscriber(props2) {
|
|
|
210176
211260
|
spotLayerScopes,
|
|
210177
211261
|
spotLayerCoordination,
|
|
210178
211262
|
spotMultiExpressionExtents,
|
|
211263
|
+
spotMultiFeatureLabels: obsSpotsFeatureLabelsData,
|
|
210179
211264
|
// Points
|
|
210180
211265
|
pointLayerScopes,
|
|
210181
211266
|
pointLayerCoordination
|
|
@@ -217562,7 +218647,7 @@ const HIGLASS_BUNDLE_VERSION = "1.11.13";
|
|
|
217562
218647
|
const HIGLASS_CSS_URL = `https://unpkg.com/${HIGLASS_PKG_NAME}@${HIGLASS_BUNDLE_VERSION}/dist/hglib.css`;
|
|
217563
218648
|
register({ dataFetcher: ZarrMultivecDataFetcher_default, config: ZarrMultivecDataFetcher_default.config }, { pluginType: "dataFetcher" });
|
|
217564
218649
|
const LazyHiGlassComponent = React__default.lazy(async () => {
|
|
217565
|
-
const { HiGlassComponent } = await import("./hglib-
|
|
218650
|
+
const { HiGlassComponent } = await import("./hglib-63947de6.js").then((n3) => n3.h);
|
|
217566
218651
|
return { default: HiGlassComponent };
|
|
217567
218652
|
});
|
|
217568
218653
|
const HG_SIZE = 800;
|
|
@@ -222669,23 +223754,29 @@ function CellSetExpressionPlotSubscriber(props2) {
|
|
|
222669
223754
|
const { coordinationScopes, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, jitter: jitter2 = false, yMin = null, yUnits = null } = props2;
|
|
222670
223755
|
const classes = useStyles$1();
|
|
222671
223756
|
const loaders = useLoaders();
|
|
222672
|
-
const [{ dataset, obsType, featureType, featureValueType, featureSelection: geneSelection, featureValueTransform, featureValueTransformCoefficient, obsSetSelection: cellSetSelection, obsSetColor: cellSetColor, additionalObsSets: additionalCellSets }, { setFeatureValueTransform, setFeatureValueTransformCoefficient }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$2.OBS_SET_FEATURE_VALUE_DISTRIBUTION], coordinationScopes);
|
|
223757
|
+
const [{ dataset, obsType, featureType, featureValueType, featureSelection: geneSelection, featureValueTransform, featureValueTransformCoefficient, obsSetSelection: cellSetSelection, obsSetColor: cellSetColor, additionalObsSets: additionalCellSets, sampleType }, { setFeatureValueTransform, setFeatureValueTransformCoefficient }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$2.OBS_SET_FEATURE_VALUE_DISTRIBUTION], coordinationScopes);
|
|
222673
223758
|
const [width2, height2, containerRef] = useGridItemSize();
|
|
222674
223759
|
const transformOptions = VALUE_TRANSFORM_OPTIONS;
|
|
222675
223760
|
const [expressionData, loadedFeatureSelection, featureSelectionStatus] = useFeatureSelection(loaders, dataset, false, geneSelection, { obsType, featureType, featureValueType });
|
|
222676
223761
|
const [{ featureLabelsMap }, featureLabelsStatus, featureLabelsUrls] = useFeatureLabelsData(loaders, dataset, false, {}, {}, { featureType });
|
|
222677
223762
|
const [{ obsIndex }, matrixIndicesStatus, matrixIndicesUrls] = useObsFeatureMatrixIndices(loaders, dataset, false, { obsType, featureType, featureValueType });
|
|
222678
223763
|
const [{ obsSets: cellSets }, obsSetsStatus, obsSetsUrls] = useObsSetsData(loaders, dataset, true, {}, {}, { obsType });
|
|
223764
|
+
const [{ sampleSets }, sampleSetsStatus, sampleSetsUrls] = useSampleSetsData(loaders, dataset, false, {}, {}, { sampleType });
|
|
223765
|
+
const [{ sampleEdges }, sampleEdgesStatus, sampleEdgesUrls] = useSampleEdgesData(loaders, dataset, false, {}, {}, { obsType, sampleType });
|
|
222679
223766
|
const isReady = useReady([
|
|
222680
223767
|
featureSelectionStatus,
|
|
222681
223768
|
matrixIndicesStatus,
|
|
222682
223769
|
obsSetsStatus,
|
|
222683
|
-
featureLabelsStatus
|
|
223770
|
+
featureLabelsStatus,
|
|
223771
|
+
sampleSetsStatus,
|
|
223772
|
+
sampleEdgesStatus
|
|
222684
223773
|
]);
|
|
222685
223774
|
const urls2 = useUrls([
|
|
222686
223775
|
featureLabelsUrls,
|
|
222687
223776
|
matrixIndicesUrls,
|
|
222688
|
-
obsSetsUrls
|
|
223777
|
+
obsSetsUrls,
|
|
223778
|
+
sampleSetsUrls,
|
|
223779
|
+
sampleEdgesUrls
|
|
222689
223780
|
]);
|
|
222690
223781
|
const [expressionArr, setArr] = useExpressionByCellSet(expressionData, obsIndex, cellSets, additionalCellSets, geneSelection, cellSetSelection, cellSetColor, featureValueTransform, featureValueTransformCoefficient, theme);
|
|
222691
223782
|
const firstGeneSelected = geneSelection && geneSelection.length >= 1 ? featureLabelsMap?.get(geneSelection[0]) || geneSelection[0] : null;
|
|
@@ -275819,6 +276910,40 @@ class ObsSetsCsvLoader extends CsvLoader {
|
|
|
275819
276910
|
}, url, coordinationValues));
|
|
275820
276911
|
}
|
|
275821
276912
|
}
|
|
276913
|
+
class SampleSetsCsvLoader extends CsvLoader {
|
|
276914
|
+
loadFromCache(data2) {
|
|
276915
|
+
if (this.cachedResult) {
|
|
276916
|
+
return this.cachedResult;
|
|
276917
|
+
}
|
|
276918
|
+
const { sampleIndex: indexCol, sampleSets: setsArr } = this.options;
|
|
276919
|
+
const obsIndex = data2.map((d) => String(d[indexCol]));
|
|
276920
|
+
const setsCols = setsArr.map(({ column }) => column);
|
|
276921
|
+
const cellSetIds = setsCols.map((setCol) => Array.isArray(setCol) ? setCol.map((subCol) => data2.map((d) => d[subCol])) : data2.map((d) => d[setCol]));
|
|
276922
|
+
const scoresCols = setsArr.map((option) => option.scorePath || void 0);
|
|
276923
|
+
const cellSetScores = scoresCols.map((scoreCol) => scoreCol ? data2.map((d) => d[scoreCol]) : void 0);
|
|
276924
|
+
const obsIndices = cellSetIds.map(() => obsIndex);
|
|
276925
|
+
const cellSetsTree = dataToCellSetsTree([
|
|
276926
|
+
obsIndices,
|
|
276927
|
+
cellSetIds,
|
|
276928
|
+
cellSetScores
|
|
276929
|
+
], setsArr);
|
|
276930
|
+
const obsSetsMembership = treeToMembershipMap(cellSetsTree);
|
|
276931
|
+
return [obsIndex, cellSetsTree, obsSetsMembership];
|
|
276932
|
+
}
|
|
276933
|
+
async load() {
|
|
276934
|
+
const payload = await this.getSourceData().catch((reason) => Promise.resolve(reason));
|
|
276935
|
+
if (payload instanceof AbstractLoaderError) {
|
|
276936
|
+
return Promise.reject(payload);
|
|
276937
|
+
}
|
|
276938
|
+
const { data: data2, url } = payload;
|
|
276939
|
+
const [obsIndex, cellSetsTree, obsSetsMembership] = this.loadFromCache(data2);
|
|
276940
|
+
return Promise.resolve(new LoaderResult({
|
|
276941
|
+
sampleIndex: obsIndex,
|
|
276942
|
+
sampleSets: cellSetsTree,
|
|
276943
|
+
sampleSetsMembership: obsSetsMembership
|
|
276944
|
+
}, url));
|
|
276945
|
+
}
|
|
276946
|
+
}
|
|
275822
276947
|
class JsonSource {
|
|
275823
276948
|
constructor({ url, requestInit: requestInit2 }) {
|
|
275824
276949
|
this.url = url;
|
|
@@ -276272,7 +277397,7 @@ async function initLoader(imageData) {
|
|
|
276272
277397
|
const { dimensions, isPyramid, transform: transform4 } = metadata2 || {};
|
|
276273
277398
|
const labels2 = dimensions.map((d) => d.field);
|
|
276274
277399
|
let source2;
|
|
276275
|
-
const root2 = await zarrOpenRoot(url, requestInit2);
|
|
277400
|
+
const root2 = await zarrOpenRoot(url, null, requestInit2);
|
|
276276
277401
|
if (isPyramid) {
|
|
276277
277402
|
const metadataUrl = `${url}${url.slice(-1) === "/" ? "" : "/"}.zmetadata`;
|
|
276278
277403
|
const response = await fetch(metadataUrl);
|
|
@@ -276310,7 +277435,7 @@ async function initLoader(imageData) {
|
|
|
276310
277435
|
}
|
|
276311
277436
|
case "ome-zarr": {
|
|
276312
277437
|
const { coordinateTransformations: coordinateTransformationsFromOptions } = metadata2 || {};
|
|
276313
|
-
const root2 = await zarrOpenRoot(url, requestInit2);
|
|
277438
|
+
const root2 = await zarrOpenRoot(url, null, requestInit2);
|
|
276314
277439
|
const loader2 = await loadOmeZarr(root2);
|
|
276315
277440
|
const { metadata: loaderMetadata } = loader2;
|
|
276316
277441
|
const { omero, multiscales } = loaderMetadata;
|
|
@@ -276436,11 +277561,11 @@ class RasterJsonAsObsSegmentationsLoader extends RasterLoader {
|
|
|
276436
277561
|
}
|
|
276437
277562
|
}
|
|
276438
277563
|
class ZarrDataSource {
|
|
276439
|
-
constructor({ url, requestInit: requestInit2, store: store2 }) {
|
|
277564
|
+
constructor({ url, requestInit: requestInit2, store: store2, fileType }) {
|
|
276440
277565
|
if (store2) {
|
|
276441
277566
|
this.storeRoot = root(store2);
|
|
276442
277567
|
} else {
|
|
276443
|
-
this.storeRoot = zarrOpenRoot(url, requestInit2);
|
|
277568
|
+
this.storeRoot = zarrOpenRoot(url, fileType, requestInit2);
|
|
276444
277569
|
}
|
|
276445
277570
|
}
|
|
276446
277571
|
getStoreRoot(path2) {
|
|
@@ -277609,6 +278734,35 @@ class ObsFeatureColumnsAnndataLoader extends AbstractTwoStepLoader {
|
|
|
277609
278734
|
]).then(([{ obsIndex, obsFeatureMatrix, featureIndex }]) => Promise.resolve(new LoaderResult({ obsIndex, obsFeatureMatrix, featureIndex }, null)));
|
|
277610
278735
|
}
|
|
277611
278736
|
}
|
|
278737
|
+
class SampleEdgesAnndataLoader extends AbstractTwoStepLoader {
|
|
278738
|
+
/**
|
|
278739
|
+
* Class method for loading observation string labels.
|
|
278740
|
+
* @returns {Promise} A promise for the array.
|
|
278741
|
+
*/
|
|
278742
|
+
loadLabels() {
|
|
278743
|
+
const { path: path2 } = this.options;
|
|
278744
|
+
if (this.labels) {
|
|
278745
|
+
return this.labels;
|
|
278746
|
+
}
|
|
278747
|
+
if (!this.labels) {
|
|
278748
|
+
this.labels = this.dataSource._loadColumn(path2);
|
|
278749
|
+
return this.labels;
|
|
278750
|
+
}
|
|
278751
|
+
this.labels = Promise.resolve(null);
|
|
278752
|
+
return this.labels;
|
|
278753
|
+
}
|
|
278754
|
+
async load() {
|
|
278755
|
+
const { path: path2 } = this.options;
|
|
278756
|
+
const superResult = await super.load().catch((reason) => Promise.resolve(reason));
|
|
278757
|
+
if (superResult instanceof AbstractLoaderError) {
|
|
278758
|
+
return Promise.reject(superResult);
|
|
278759
|
+
}
|
|
278760
|
+
return Promise.all([
|
|
278761
|
+
this.dataSource.loadObsIndex(path2),
|
|
278762
|
+
this.loadLabels()
|
|
278763
|
+
]).then(([obsIndex, sampleIds]) => Promise.resolve(new LoaderResult({ obsIndex, sampleIds }, null)));
|
|
278764
|
+
}
|
|
278765
|
+
}
|
|
277612
278766
|
class ImageWrapper {
|
|
277613
278767
|
constructor(vivLoader, options) {
|
|
277614
278768
|
__publicField(this, "vivLoader");
|
|
@@ -278059,7 +279213,7 @@ class SpatialDataLabelsLoader extends SpatialDataImageLoader {
|
|
|
278059
279213
|
};
|
|
278060
279214
|
const imageWrapper = result.data.obsSegmentations.instance;
|
|
278061
279215
|
const channelObjects = imageWrapper.getChannelObjects();
|
|
278062
|
-
const channelCoordination = channelObjects.slice(0,
|
|
279216
|
+
const channelCoordination = channelObjects.slice(0, 7).map((channelObj, i2) => ({
|
|
278063
279217
|
spatialTargetC: i2,
|
|
278064
279218
|
// obsType: channelObj.name,
|
|
278065
279219
|
spatialChannelColor: (channelObj.defaultColor || channelObj.autoDefaultColor).slice(0, 3),
|
|
@@ -278361,7 +279515,16 @@ const expectedCoordinationTypes = [
|
|
|
278361
279515
|
"obsLabelsType",
|
|
278362
279516
|
"embeddingType"
|
|
278363
279517
|
];
|
|
279518
|
+
function createGetFileType(jointFileType) {
|
|
279519
|
+
return (fileType) => {
|
|
279520
|
+
if (jointFileType.endsWith(".zip") && ALT_ZARR_STORE_TYPES[fileType]?.zip) {
|
|
279521
|
+
return ALT_ZARR_STORE_TYPES[fileType].zip;
|
|
279522
|
+
}
|
|
279523
|
+
return fileType;
|
|
279524
|
+
};
|
|
279525
|
+
}
|
|
278364
279526
|
function expandAnndataZarr(fileDef) {
|
|
279527
|
+
const getFileType2 = createGetFileType(fileDef.fileType);
|
|
278365
279528
|
const baseFileDef = {
|
|
278366
279529
|
url: fileDef.url,
|
|
278367
279530
|
requestInit: fileDef.requestInit,
|
|
@@ -278383,7 +279546,7 @@ function expandAnndataZarr(fileDef) {
|
|
|
278383
279546
|
// obsFeatureMatrix
|
|
278384
279547
|
...options.obsFeatureMatrix ? [{
|
|
278385
279548
|
...baseFileDef,
|
|
278386
|
-
fileType: FileType$2.OBS_FEATURE_MATRIX_ANNDATA_ZARR,
|
|
279549
|
+
fileType: getFileType2(FileType$2.OBS_FEATURE_MATRIX_ANNDATA_ZARR),
|
|
278387
279550
|
options: options.obsFeatureMatrix,
|
|
278388
279551
|
coordinationValues: {
|
|
278389
279552
|
...extraCoordinationValues,
|
|
@@ -278395,7 +279558,7 @@ function expandAnndataZarr(fileDef) {
|
|
|
278395
279558
|
// obsSets
|
|
278396
279559
|
...options.obsSets ? [{
|
|
278397
279560
|
...baseFileDef,
|
|
278398
|
-
fileType: FileType$2.OBS_SETS_ANNDATA_ZARR,
|
|
279561
|
+
fileType: getFileType2(FileType$2.OBS_SETS_ANNDATA_ZARR),
|
|
278399
279562
|
options: options.obsSets,
|
|
278400
279563
|
coordinationValues: {
|
|
278401
279564
|
...extraCoordinationValues,
|
|
@@ -278405,7 +279568,7 @@ function expandAnndataZarr(fileDef) {
|
|
|
278405
279568
|
// obsSpots
|
|
278406
279569
|
...options.obsSpots ? [{
|
|
278407
279570
|
...baseFileDef,
|
|
278408
|
-
fileType: FileType$2.OBS_SPOTS_ANNDATA_ZARR,
|
|
279571
|
+
fileType: getFileType2(FileType$2.OBS_SPOTS_ANNDATA_ZARR),
|
|
278409
279572
|
options: options.obsSpots,
|
|
278410
279573
|
coordinationValues: {
|
|
278411
279574
|
...extraCoordinationValues,
|
|
@@ -278415,7 +279578,7 @@ function expandAnndataZarr(fileDef) {
|
|
|
278415
279578
|
// obsPoints
|
|
278416
279579
|
...options.obsPoints ? [{
|
|
278417
279580
|
...baseFileDef,
|
|
278418
|
-
fileType: FileType$2.OBS_POINTS_ANNDATA_ZARR,
|
|
279581
|
+
fileType: getFileType2(FileType$2.OBS_POINTS_ANNDATA_ZARR),
|
|
278419
279582
|
options: options.obsPoints,
|
|
278420
279583
|
coordinationValues: {
|
|
278421
279584
|
...extraCoordinationValues,
|
|
@@ -278425,7 +279588,7 @@ function expandAnndataZarr(fileDef) {
|
|
|
278425
279588
|
// obsLocations
|
|
278426
279589
|
...options.obsLocations ? [{
|
|
278427
279590
|
...baseFileDef,
|
|
278428
|
-
fileType: FileType$2.OBS_LOCATIONS_ANNDATA_ZARR,
|
|
279591
|
+
fileType: getFileType2(FileType$2.OBS_LOCATIONS_ANNDATA_ZARR),
|
|
278429
279592
|
options: options.obsLocations,
|
|
278430
279593
|
coordinationValues: {
|
|
278431
279594
|
...extraCoordinationValues,
|
|
@@ -278435,7 +279598,7 @@ function expandAnndataZarr(fileDef) {
|
|
|
278435
279598
|
// obsSegmentations
|
|
278436
279599
|
...options.obsSegmentations ? [{
|
|
278437
279600
|
...baseFileDef,
|
|
278438
|
-
fileType: FileType$2.OBS_SEGMENTATIONS_ANNDATA_ZARR,
|
|
279601
|
+
fileType: getFileType2(FileType$2.OBS_SEGMENTATIONS_ANNDATA_ZARR),
|
|
278439
279602
|
options: options.obsSegmentations,
|
|
278440
279603
|
coordinationValues: {
|
|
278441
279604
|
...extraCoordinationValues,
|
|
@@ -278447,7 +279610,7 @@ function expandAnndataZarr(fileDef) {
|
|
|
278447
279610
|
...options.obsEmbedding ? Array.isArray(options.obsEmbedding) ? options.obsEmbedding.map((oe) => ({
|
|
278448
279611
|
// obsEmbedding was an array, process each element.
|
|
278449
279612
|
...baseFileDef,
|
|
278450
|
-
fileType: FileType$2.OBS_EMBEDDING_ANNDATA_ZARR,
|
|
279613
|
+
fileType: getFileType2(FileType$2.OBS_EMBEDDING_ANNDATA_ZARR),
|
|
278451
279614
|
options: {
|
|
278452
279615
|
path: oe.path,
|
|
278453
279616
|
dims: oe.dims
|
|
@@ -278461,7 +279624,7 @@ function expandAnndataZarr(fileDef) {
|
|
|
278461
279624
|
})) : [{
|
|
278462
279625
|
// obsEmbedding was an object.
|
|
278463
279626
|
...baseFileDef,
|
|
278464
|
-
fileType: FileType$2.OBS_EMBEDDING_ANNDATA_ZARR,
|
|
279627
|
+
fileType: getFileType2(FileType$2.OBS_EMBEDDING_ANNDATA_ZARR),
|
|
278465
279628
|
options: options.obsEmbedding,
|
|
278466
279629
|
coordinationValues: {
|
|
278467
279630
|
...extraCoordinationValues,
|
|
@@ -278474,7 +279637,7 @@ function expandAnndataZarr(fileDef) {
|
|
|
278474
279637
|
...options.obsLabels ? Array.isArray(options.obsLabels) ? options.obsLabels.map((ol) => ({
|
|
278475
279638
|
// obsLabels was an array, process each element.
|
|
278476
279639
|
...baseFileDef,
|
|
278477
|
-
fileType: FileType$2.OBS_LABELS_ANNDATA_ZARR,
|
|
279640
|
+
fileType: getFileType2(FileType$2.OBS_LABELS_ANNDATA_ZARR),
|
|
278478
279641
|
options: {
|
|
278479
279642
|
path: ol.path
|
|
278480
279643
|
},
|
|
@@ -278487,7 +279650,7 @@ function expandAnndataZarr(fileDef) {
|
|
|
278487
279650
|
})) : [{
|
|
278488
279651
|
// obsLabels was an object.
|
|
278489
279652
|
...baseFileDef,
|
|
278490
|
-
fileType: FileType$2.OBS_LABELS_ANNDATA_ZARR,
|
|
279653
|
+
fileType: getFileType2(FileType$2.OBS_LABELS_ANNDATA_ZARR),
|
|
278491
279654
|
options: options.obsLabels,
|
|
278492
279655
|
coordinationValues: {
|
|
278493
279656
|
...extraCoordinationValues,
|
|
@@ -278500,7 +279663,7 @@ function expandAnndataZarr(fileDef) {
|
|
|
278500
279663
|
...options.featureLabels ? Array.isArray(options.featureLabels) ? options.featureLabels.map((fl) => ({
|
|
278501
279664
|
// featureLabels was an array, process each element.
|
|
278502
279665
|
...baseFileDef,
|
|
278503
|
-
fileType: FileType$2.FEATURE_LABELS_ANNDATA_ZARR,
|
|
279666
|
+
fileType: getFileType2(FileType$2.FEATURE_LABELS_ANNDATA_ZARR),
|
|
278504
279667
|
options: {
|
|
278505
279668
|
path: fl.path
|
|
278506
279669
|
},
|
|
@@ -278513,7 +279676,7 @@ function expandAnndataZarr(fileDef) {
|
|
|
278513
279676
|
})) : [{
|
|
278514
279677
|
// featureLabels was an object.
|
|
278515
279678
|
...baseFileDef,
|
|
278516
|
-
fileType: FileType$2.FEATURE_LABELS_ANNDATA_ZARR,
|
|
279679
|
+
fileType: getFileType2(FileType$2.FEATURE_LABELS_ANNDATA_ZARR),
|
|
278517
279680
|
options: options.featureLabels,
|
|
278518
279681
|
coordinationValues: {
|
|
278519
279682
|
...extraCoordinationValues,
|
|
@@ -278870,6 +280033,13 @@ function makeViewType(name2, component) {
|
|
|
278870
280033
|
function makeFileType(name2, dataType, dataLoaderClass, dataSourceClass, optionsSchema) {
|
|
278871
280034
|
return new PluginFileType(name2, dataType, dataLoaderClass, dataSourceClass, optionsSchema);
|
|
278872
280035
|
}
|
|
280036
|
+
function makeZarrFileTypes(name2, dataType, dataLoaderClass, dataSourceClass, optionsSchema) {
|
|
280037
|
+
const altFileTypes = Object.values(ALT_ZARR_STORE_TYPES[name2]);
|
|
280038
|
+
return [
|
|
280039
|
+
new PluginFileType(name2, dataType, dataLoaderClass, dataSourceClass, optionsSchema),
|
|
280040
|
+
...altFileTypes.map((n3) => new PluginFileType(n3, dataType, dataLoaderClass, dataSourceClass, optionsSchema))
|
|
280041
|
+
];
|
|
280042
|
+
}
|
|
278873
280043
|
const baseViewTypes = [
|
|
278874
280044
|
makeViewType(ViewType$2.DESCRIPTION, DescriptionSubscriber),
|
|
278875
280045
|
makeViewType(ViewType$2.OBS_SETS, ObsSetsManagerSubscriber),
|
|
@@ -278898,20 +280068,22 @@ const baseFileTypes = [
|
|
|
278898
280068
|
makeFileType(FileType$2.OBS_LABELS_CSV, DataType$3.OBS_LABELS, ObsLabelsCsvLoader, CsvSource, obsLabelsCsvSchema),
|
|
278899
280069
|
makeFileType(FileType$2.OBS_FEATURE_MATRIX_CSV, DataType$3.OBS_FEATURE_MATRIX, ObsFeatureMatrixCsvLoader, CsvSource, z.null()),
|
|
278900
280070
|
makeFileType(FileType$2.FEATURE_LABELS_CSV, DataType$3.FEATURE_LABELS, FeatureLabelsCsvLoader, CsvSource, featureLabelsCsvSchema),
|
|
280071
|
+
makeFileType(FileType$2.SAMPLE_SETS_CSV, DataType$3.SAMPLE_SETS, SampleSetsCsvLoader, CsvSource, sampleSetsCsvSchema),
|
|
278901
280072
|
// All JSON file types
|
|
278902
280073
|
makeFileType(FileType$2.OBS_SEGMENTATIONS_JSON, DataType$3.OBS_SEGMENTATIONS, ObsSegmentationsJsonLoader, JsonSource, z.null()),
|
|
278903
280074
|
makeFileType(FileType$2.OBS_SETS_JSON, DataType$3.OBS_SETS, ObsSetsJsonLoader, JsonSource, z.null()),
|
|
278904
280075
|
// All AnnData file types
|
|
278905
|
-
|
|
278906
|
-
|
|
278907
|
-
|
|
278908
|
-
|
|
278909
|
-
|
|
278910
|
-
|
|
278911
|
-
|
|
278912
|
-
|
|
278913
|
-
|
|
278914
|
-
|
|
280076
|
+
...makeZarrFileTypes(FileType$2.OBS_SETS_ANNDATA_ZARR, DataType$3.OBS_SETS, ObsSetsAnndataLoader, AnnDataSource, obsSetsAnndataSchema),
|
|
280077
|
+
...makeZarrFileTypes(FileType$2.OBS_EMBEDDING_ANNDATA_ZARR, DataType$3.OBS_EMBEDDING, ObsEmbeddingAnndataLoader, AnnDataSource, obsEmbeddingAnndataSchema),
|
|
280078
|
+
...makeZarrFileTypes(FileType$2.OBS_SPOTS_ANNDATA_ZARR, DataType$3.OBS_SPOTS, ObsSpotsAnndataLoader, AnnDataSource, obsSpotsAnndataSchema),
|
|
280079
|
+
...makeZarrFileTypes(FileType$2.OBS_POINTS_ANNDATA_ZARR, DataType$3.OBS_POINTS, ObsPointsAnndataLoader, AnnDataSource, obsPointsAnndataSchema),
|
|
280080
|
+
...makeZarrFileTypes(FileType$2.OBS_LOCATIONS_ANNDATA_ZARR, DataType$3.OBS_LOCATIONS, ObsLocationsAnndataLoader, AnnDataSource, obsLocationsAnndataSchema),
|
|
280081
|
+
...makeZarrFileTypes(FileType$2.OBS_LABELS_ANNDATA_ZARR, DataType$3.OBS_LABELS, ObsLabelsAnndataLoader, AnnDataSource, obsLabelsAnndataSchema),
|
|
280082
|
+
...makeZarrFileTypes(FileType$2.OBS_FEATURE_MATRIX_ANNDATA_ZARR, DataType$3.OBS_FEATURE_MATRIX, ObsFeatureMatrixAnndataLoader, AnnDataSource, obsFeatureMatrixAnndataSchema),
|
|
280083
|
+
...makeZarrFileTypes(FileType$2.OBS_FEATURE_COLUMNS_ANNDATA_ZARR, DataType$3.OBS_FEATURE_MATRIX, ObsFeatureColumnsAnndataLoader, AnnDataSource, obsFeatureColumnsAnndataSchema),
|
|
280084
|
+
...makeZarrFileTypes(FileType$2.OBS_SEGMENTATIONS_ANNDATA_ZARR, DataType$3.OBS_SEGMENTATIONS, ObsSegmentationsAnndataLoader, AnnDataSource, obsSegmentationsAnndataSchema),
|
|
280085
|
+
...makeZarrFileTypes(FileType$2.FEATURE_LABELS_ANNDATA_ZARR, DataType$3.FEATURE_LABELS, FeatureLabelsAnndataLoader, AnnDataSource, featureLabelsAnndataSchema),
|
|
280086
|
+
...makeZarrFileTypes(FileType$2.SAMPLE_EDGES_ANNDATA_ZARR, DataType$3.SAMPLE_EDGES, SampleEdgesAnndataLoader, AnnDataSource, sampleEdgesAnndataSchema),
|
|
278915
280087
|
// All MuData file types
|
|
278916
280088
|
makeFileType(FileType$2.OBS_SETS_MUDATA_ZARR, DataType$3.OBS_SETS, ObsSetsAnndataLoader, MuDataSource, obsSetsAnndataSchema),
|
|
278917
280089
|
makeFileType(FileType$2.OBS_EMBEDDING_MUDATA_ZARR, DataType$3.OBS_EMBEDDING, ObsEmbeddingAnndataLoader, MuDataSource, obsEmbeddingAnndataSchema),
|
|
@@ -278937,6 +280109,7 @@ const baseFileTypes = [
|
|
|
278937
280109
|
makeFileType(FileType$2.OBS_SPOTS_SPATIALDATA_ZARR, DataType$3.OBS_SPOTS, SpatialDataObsSpotsLoader, SpatialDataShapesSource, obsSpotsSpatialdataSchema),
|
|
278938
280110
|
makeFileType(FileType$2.OBS_FEATURE_MATRIX_SPATIALDATA_ZARR, DataType$3.OBS_FEATURE_MATRIX, ObsFeatureMatrixAnndataLoader, SpatialDataTableSource, obsFeatureMatrixSpatialdataSchema),
|
|
278939
280111
|
makeFileType(FileType$2.OBS_SETS_SPATIALDATA_ZARR, DataType$3.OBS_SETS, SpatialDataObsSetsLoader, SpatialDataTableSource, obsSetsSpatialdataSchema),
|
|
280112
|
+
makeFileType(FileType$2.FEATURE_LABELS_SPATIALDATA_ZARR, DataType$3.FEATURE_LABELS, FeatureLabelsAnndataLoader, SpatialDataTableSource, featureLabelsAnndataSchema),
|
|
278940
280113
|
// All legacy file types
|
|
278941
280114
|
makeFileType(FileType$2.OBS_FEATURE_MATRIX_EXPRESSION_MATRIX_ZARR, DataType$3.OBS_FEATURE_MATRIX, MatrixZarrAsObsFeatureMatrixLoader, ZarrDataSource, z.null()),
|
|
278942
280115
|
makeFileType(FileType$2.IMAGE_RASTER_JSON, DataType$3.IMAGE, RasterJsonAsImageLoader, JsonSource, rasterJsonSchema),
|
|
@@ -278955,6 +280128,7 @@ const baseFileTypes = [
|
|
|
278955
280128
|
];
|
|
278956
280129
|
const baseJointFileTypes = [
|
|
278957
280130
|
new PluginJointFileType(FileType$2.ANNDATA_ZARR, expandAnndataZarr, anndataZarrSchema),
|
|
280131
|
+
new PluginJointFileType(FileType$2.ANNDATA_ZARR_ZIP, expandAnndataZarr, anndataZarrSchema),
|
|
278958
280132
|
new PluginJointFileType(FileType$2.SPATIALDATA_ZARR, expandSpatialdataZarr, spatialdataZarrSchema),
|
|
278959
280133
|
// For legacy file types:
|
|
278960
280134
|
new PluginJointFileType(FileType$2.ANNDATA_CELLS_ZARR, expandAnndataCellsZarr, anndataCellsZarrSchema),
|
|
@@ -279076,10 +280250,12 @@ const baseCoordinationTypes = [
|
|
|
279076
280250
|
new PluginCoordinationType(CoordinationType$2.LEGEND_VISIBLE, true, z.boolean()),
|
|
279077
280251
|
new PluginCoordinationType(CoordinationType$2.SPATIAL_CHANNEL_LABELS_VISIBLE, true, z.boolean()),
|
|
279078
280252
|
new PluginCoordinationType(CoordinationType$2.SPATIAL_CHANNEL_LABELS_ORIENTATION, "vertical", z.enum(["vertical", "horizontal"])),
|
|
279079
|
-
new PluginCoordinationType(CoordinationType$2.SPATIAL_CHANNEL_LABEL_SIZE, 14, z.number())
|
|
280253
|
+
new PluginCoordinationType(CoordinationType$2.SPATIAL_CHANNEL_LABEL_SIZE, 14, z.number()),
|
|
280254
|
+
new PluginCoordinationType(CoordinationType$2.SAMPLE_TYPE, null, z.string().nullable()),
|
|
280255
|
+
new PluginCoordinationType(CoordinationType$2.SAMPLE_SET_SELECTION, null, z.array(z.string()).nullable())
|
|
279080
280256
|
];
|
|
279081
280257
|
function Vitessce(props2) {
|
|
279082
|
-
const { config: config3, onConfigUpgrade, pluginViewTypes: pluginViewTypesProp, pluginFileTypes: pluginFileTypesProp, pluginCoordinationTypes: pluginCoordinationTypesProp, pluginJointFileTypes: pluginJointFileTypesProp
|
|
280258
|
+
const { config: config3, onConfigUpgrade, pluginViewTypes: pluginViewTypesProp, pluginFileTypes: pluginFileTypesProp, pluginCoordinationTypes: pluginCoordinationTypesProp, pluginJointFileTypes: pluginJointFileTypesProp } = props2;
|
|
279083
280259
|
const configKey = config3?.uid || config3;
|
|
279084
280260
|
const configVersion = config3?.version;
|
|
279085
280261
|
const [configOrWarning, success] = useMemo(() => {
|
|
@@ -281598,5 +282774,6 @@ export {
|
|
|
281598
282774
|
PluginCoordinationType as u,
|
|
281599
282775
|
vconcat as v,
|
|
281600
282776
|
PluginJointFileType as w,
|
|
282777
|
+
useCoordination as x,
|
|
281601
282778
|
z
|
|
281602
282779
|
};
|