@vitessce/json 4.2.0 → 4.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-SxljTded.js";
2
- import { B as BaseDecoder } from "./index-Diedaj-4.js";
2
+ import { B as BaseDecoder } from "./index-C7Fh1DhY.js";
3
3
  class DeflateDecoder extends BaseDecoder {
4
4
  decodeBlock(buffer) {
5
5
  return inflate_1(new Uint8Array(buffer)).buffer;
@@ -10304,7 +10304,7 @@ const anndataZarrSchema = z.object({
10304
10304
  sampleEdges: annDataSampleEdges
10305
10305
  }).partial();
10306
10306
  anndataZarrSchema.extend({
10307
- refSpecUrl: z.string()
10307
+ refSpecUrl: z.string().optional()
10308
10308
  });
10309
10309
  z.object({
10310
10310
  // TODO: should `image` be a special schema
@@ -12466,6 +12466,140 @@ open.v3 = openV3;
12466
12466
  function extendStore(store, ...extensions) {
12467
12467
  return applyExtensions(store, extensions);
12468
12468
  }
12469
+ function assertRangeCapable(store) {
12470
+ if (!store.getRange) {
12471
+ throw new UnsupportedError("`zarr.withRangeCoalescing` requires a store with getRange");
12472
+ }
12473
+ }
12474
+ function mergeSignals(signals) {
12475
+ let present = [];
12476
+ for (let s2 of signals)
12477
+ if (s2)
12478
+ present.push(s2);
12479
+ if (present.length === 0)
12480
+ return void 0;
12481
+ if (present.length === 1)
12482
+ return present[0];
12483
+ return AbortSignal.any(present);
12484
+ }
12485
+ const DEFAULT_COALESCE_SIZE = 32768;
12486
+ function groupRequests(sorted, coalesceSize) {
12487
+ if (sorted.length === 0)
12488
+ return [];
12489
+ let groups = [];
12490
+ let current = [sorted[0]];
12491
+ let groupStart = sorted[0].offset;
12492
+ let groupEnd = sorted[0].offset + sorted[0].length;
12493
+ for (let i2 = 1; i2 < sorted.length; i2++) {
12494
+ let req = sorted[i2];
12495
+ let reqEnd = req.offset + req.length;
12496
+ if (req.offset <= groupEnd + coalesceSize) {
12497
+ current.push(req);
12498
+ groupEnd = Math.max(groupEnd, reqEnd);
12499
+ } else {
12500
+ groups.push({
12501
+ offset: groupStart,
12502
+ length: groupEnd - groupStart,
12503
+ requests: current
12504
+ });
12505
+ current = [req];
12506
+ groupStart = req.offset;
12507
+ groupEnd = reqEnd;
12508
+ }
12509
+ }
12510
+ groups.push({
12511
+ offset: groupStart,
12512
+ length: groupEnd - groupStart,
12513
+ requests: current
12514
+ });
12515
+ return groups;
12516
+ }
12517
+ function emitFlush(onFlush, report) {
12518
+ if (!onFlush)
12519
+ return;
12520
+ try {
12521
+ onFlush(report);
12522
+ } catch (err2) {
12523
+ console.warn("withRangeCoalescing: onFlush threw, swallowing:", err2);
12524
+ }
12525
+ }
12526
+ const withRangeCoalescing = defineStoreExtension((_store, opts = {}) => {
12527
+ assertRangeCapable(_store);
12528
+ let store = _store;
12529
+ let boundGetRange = store.getRange.bind(store);
12530
+ let coalesceSize = opts.coalesceSize ?? DEFAULT_COALESCE_SIZE;
12531
+ let onFlush = opts.onFlush;
12532
+ let pending = /* @__PURE__ */ new Map();
12533
+ let scheduled = false;
12534
+ async function flush() {
12535
+ let work = new Map(pending);
12536
+ pending.clear();
12537
+ scheduled = false;
12538
+ let pathPromises = [];
12539
+ for (let [path, requests] of work) {
12540
+ requests.sort((a2, b) => a2.offset - b.offset);
12541
+ let groups = groupRequests(requests, coalesceSize);
12542
+ emitFlush(onFlush, {
12543
+ path,
12544
+ groupCount: groups.length,
12545
+ requestCount: requests.length,
12546
+ bytesFetched: groups.reduce((sum2, g2) => sum2 + g2.length, 0)
12547
+ });
12548
+ pathPromises.push(fetchGroups(path, groups));
12549
+ }
12550
+ await Promise.all(pathPromises);
12551
+ }
12552
+ async function fetchGroups(path, groups) {
12553
+ await Promise.all(groups.map(async (group) => {
12554
+ let signal = mergeSignals(group.requests.map((r2) => r2.signal));
12555
+ try {
12556
+ let data = await boundGetRange(path, { offset: group.offset, length: group.length }, { signal });
12557
+ if (data && data.length < group.length) {
12558
+ throw new Error(`Short read: expected ${group.length} bytes but received ${data.length}`);
12559
+ }
12560
+ for (let req of group.requests) {
12561
+ if (!data) {
12562
+ req.resolve(void 0);
12563
+ continue;
12564
+ }
12565
+ let start = req.offset - group.offset;
12566
+ let slice2 = data.slice(start, start + req.length);
12567
+ req.resolve(slice2);
12568
+ }
12569
+ } catch (err2) {
12570
+ for (let req of group.requests) {
12571
+ req.reject(err2);
12572
+ }
12573
+ }
12574
+ }));
12575
+ }
12576
+ return {
12577
+ getRange(key, range2, options) {
12578
+ if ("suffixLength" in range2) {
12579
+ return boundGetRange(key, range2, options);
12580
+ }
12581
+ let { offset: offset2, length: length2 } = range2;
12582
+ return new Promise((resolve2, reject) => {
12583
+ let reqs = pending.get(key);
12584
+ if (!reqs) {
12585
+ reqs = [];
12586
+ pending.set(key, reqs);
12587
+ }
12588
+ reqs.push({
12589
+ offset: offset2,
12590
+ length: length2,
12591
+ signal: options?.signal,
12592
+ resolve: resolve2,
12593
+ reject
12594
+ });
12595
+ if (!scheduled) {
12596
+ scheduled = true;
12597
+ queueMicrotask(() => flush());
12598
+ }
12599
+ });
12600
+ }
12601
+ };
12602
+ });
12469
12603
  function* range$3(start, stop, step = 1) {
12470
12604
  if (stop === void 0) {
12471
12605
  stop = start;
@@ -12936,6 +13070,354 @@ function createZarrArrayAdapter(arr) {
12936
13070
  }
12937
13071
  });
12938
13072
  }
13073
+ const alphabet = "abcdefghijklmnopqrstuvwxyz";
13074
+ const numbers = "01234569789";
13075
+ const expr = "()*/+-";
13076
+ const space = " ";
13077
+ new Set(
13078
+ alphabet + alphabet.toUpperCase() + numbers + expr + space
13079
+ );
13080
+ (() => {
13081
+ var table2 = new Uint8Array(128);
13082
+ for (var i2 = 0; i2 < 64; i2++) {
13083
+ table2[i2 < 26 ? i2 + 65 : i2 < 52 ? i2 + 71 : i2 < 62 ? i2 - 4 : i2 * 4 - 205] = i2;
13084
+ }
13085
+ return (base64) => {
13086
+ var n3 = base64.length;
13087
+ var bytes = new Uint8Array(
13088
+ // @ts-expect-error
13089
+ (n3 - (base64[n3 - 1] == "=") - (base64[n3 - 2] == "=")) * 3 / 4 | 0
13090
+ );
13091
+ for (var i22 = 0, j = 0; i22 < n3; ) {
13092
+ var c0 = table2[base64.charCodeAt(i22++)], c1 = table2[base64.charCodeAt(i22++)];
13093
+ var c2 = table2[base64.charCodeAt(i22++)], c3 = table2[base64.charCodeAt(i22++)];
13094
+ bytes[j++] = c0 << 2 | c1 >> 4;
13095
+ bytes[j++] = c1 << 4 | c2 >> 2;
13096
+ bytes[j++] = c2 << 6 | c3;
13097
+ }
13098
+ return bytes;
13099
+ };
13100
+ })();
13101
+ new TextEncoder();
13102
+ function _structure_size(structure) {
13103
+ const fmt = "<" + Array.from(structure.values()).join("");
13104
+ return struct.calcsize(fmt);
13105
+ }
13106
+ function isBigEndian() {
13107
+ const array = new Uint8Array(4);
13108
+ const view = new Uint32Array(array.buffer);
13109
+ return !((view[0] = 1) & array[0]);
13110
+ }
13111
+ function decodeFloat16(low, high) {
13112
+ const sign2 = (high & 128) >> 7;
13113
+ const exponent = (high & 124) >> 2;
13114
+ const fraction2 = ((high & 3) << 8) + low;
13115
+ let magnitude;
13116
+ if (exponent === 31) {
13117
+ magnitude = fraction2 === 0 ? Infinity : NaN;
13118
+ } else if (exponent === 0) {
13119
+ magnitude = 2 ** -14 * (fraction2 / 1024);
13120
+ } else {
13121
+ magnitude = 2 ** (exponent - 15) * (1 + fraction2 / 1024);
13122
+ }
13123
+ return sign2 ? -magnitude : magnitude;
13124
+ }
13125
+ let DataView64$1 = class DataView64 extends DataView {
13126
+ getFloat16(byteOffset, littleEndian) {
13127
+ const bytes = [this.getUint8(byteOffset), this.getUint8(byteOffset + 1)];
13128
+ if (!littleEndian)
13129
+ bytes.reverse();
13130
+ return decodeFloat16(bytes[0], bytes[1]);
13131
+ }
13132
+ getUint64(byteOffset, littleEndian) {
13133
+ const left = BigInt(this.getUint32(byteOffset, littleEndian));
13134
+ const right = BigInt(this.getUint32(byteOffset + 4, littleEndian));
13135
+ const combined = littleEndian ? left + (right << 32n) : (left << 32n) + right;
13136
+ return Number(combined);
13137
+ }
13138
+ getInt64(byteOffset, littleEndian) {
13139
+ let low, high;
13140
+ if (littleEndian) {
13141
+ low = this.getUint32(byteOffset, true);
13142
+ high = this.getInt32(byteOffset + 4, true);
13143
+ } else {
13144
+ high = this.getInt32(byteOffset, false);
13145
+ low = this.getUint32(byteOffset + 4, false);
13146
+ }
13147
+ const combined = BigInt(low) + (BigInt(high) << 32n);
13148
+ return Number(combined);
13149
+ }
13150
+ getString(byteOffset, _littleEndian, length2) {
13151
+ const str_buffer = this.buffer.slice(byteOffset, byteOffset + length2);
13152
+ return new TextDecoder().decode(str_buffer);
13153
+ }
13154
+ getVLENStruct(byteOffset, littleEndian, _length) {
13155
+ const item_size = this.getUint32(byteOffset, littleEndian);
13156
+ const collection_address = this.getUint64(byteOffset + 4, littleEndian);
13157
+ const object_index = this.getUint32(byteOffset + 12, littleEndian);
13158
+ return [item_size, collection_address, object_index];
13159
+ }
13160
+ };
13161
+ class Struct {
13162
+ big_endian;
13163
+ getters;
13164
+ byte_lengths;
13165
+ fmt_size_regex;
13166
+ constructor() {
13167
+ this.big_endian = isBigEndian();
13168
+ this.getters = {
13169
+ s: "getUint8",
13170
+ b: "getInt8",
13171
+ B: "getUint8",
13172
+ h: "getInt16",
13173
+ H: "getUint16",
13174
+ i: "getInt32",
13175
+ I: "getUint32",
13176
+ l: "getInt32",
13177
+ L: "getUint32",
13178
+ q: "getInt64",
13179
+ Q: "getUint64",
13180
+ e: "getFloat16",
13181
+ f: "getFloat32",
13182
+ d: "getFloat64"
13183
+ };
13184
+ this.byte_lengths = {
13185
+ s: 1,
13186
+ b: 1,
13187
+ B: 1,
13188
+ h: 2,
13189
+ H: 2,
13190
+ i: 4,
13191
+ I: 4,
13192
+ l: 4,
13193
+ L: 4,
13194
+ q: 8,
13195
+ Q: 8,
13196
+ e: 2,
13197
+ f: 4,
13198
+ d: 8
13199
+ };
13200
+ const all_formats = Object.keys(this.byte_lengths).join("");
13201
+ this.fmt_size_regex = "(\\d*)([" + all_formats + "])";
13202
+ }
13203
+ calcsize(fmt) {
13204
+ let size2 = 0;
13205
+ const regex = new RegExp(this.fmt_size_regex, "g");
13206
+ let match2;
13207
+ while ((match2 = regex.exec(fmt)) !== null) {
13208
+ const n3 = parseInt(match2[1] || "1", 10);
13209
+ const f2 = match2[2];
13210
+ size2 += n3 * this.byte_lengths[f2];
13211
+ }
13212
+ return size2;
13213
+ }
13214
+ _is_big_endian(fmt) {
13215
+ if (/^</.test(fmt))
13216
+ return false;
13217
+ if (/^(!|>)/.test(fmt))
13218
+ return true;
13219
+ return this.big_endian;
13220
+ }
13221
+ unpack_from(fmt, buffer2, offset2) {
13222
+ offset2 = Number(offset2 || 0);
13223
+ const view = new DataView64$1(buffer2, 0);
13224
+ const output = [];
13225
+ const big_endian = this._is_big_endian(fmt);
13226
+ const regex = new RegExp(this.fmt_size_regex, "g");
13227
+ let match2;
13228
+ while ((match2 = regex.exec(fmt)) !== null) {
13229
+ const n3 = parseInt(match2[1] || "1", 10);
13230
+ const f2 = match2[2];
13231
+ const getter = this.getters[f2];
13232
+ const size2 = this.byte_lengths[f2];
13233
+ if (f2 === "s") {
13234
+ output.push(new TextDecoder().decode(buffer2.slice(offset2, offset2 + n3)));
13235
+ offset2 += n3;
13236
+ } else {
13237
+ for (let i2 = 0; i2 < n3; i2++) {
13238
+ output.push(view[getter](offset2, !big_endian));
13239
+ offset2 += size2;
13240
+ }
13241
+ }
13242
+ }
13243
+ return output;
13244
+ }
13245
+ }
13246
+ const struct = new Struct();
13247
+ const DATATYPE_MSG = /* @__PURE__ */ new Map([
13248
+ ["class_and_version", "B"],
13249
+ ["class_bit_field_0", "B"],
13250
+ ["class_bit_field_1", "B"],
13251
+ ["class_bit_field_2", "B"],
13252
+ ["size", "I"]
13253
+ ]);
13254
+ _structure_size(DATATYPE_MSG);
13255
+ const B_LINK_NODE_V1 = /* @__PURE__ */ new Map([
13256
+ ["signature", "4s"],
13257
+ ["node_type", "B"],
13258
+ ["node_level", "B"],
13259
+ ["entries_used", "H"],
13260
+ ["left_sibling", "Q"],
13261
+ ["right_sibling", "Q"]
13262
+ ]);
13263
+ _structure_size(B_LINK_NODE_V1);
13264
+ const B_LINK_NODE_V2 = /* @__PURE__ */ new Map([
13265
+ ["signature", "4s"],
13266
+ ["version", "B"],
13267
+ ["node_type", "B"]
13268
+ ]);
13269
+ _structure_size(B_LINK_NODE_V2);
13270
+ struct.unpack_from("8s", new Uint8Array([137, 72, 68, 70, 13, 10, 26, 10]).buffer)[0];
13271
+ struct.unpack_from("<Q", new Uint8Array([255, 255, 255, 255, 255, 255, 255, 255]).buffer)[0];
13272
+ const SUPERBLOCK_V0 = /* @__PURE__ */ new Map([
13273
+ ["format_signature", "8s"],
13274
+ ["superblock_version", "B"],
13275
+ ["free_storage_version", "B"],
13276
+ ["root_group_version", "B"],
13277
+ ["reserved_0", "B"],
13278
+ ["shared_header_version", "B"],
13279
+ ["offset_size", "B"],
13280
+ ["length_size", "B"],
13281
+ ["reserved_1", "B"],
13282
+ ["group_leaf_node_k", "H"],
13283
+ ["group_internal_node_k", "H"],
13284
+ ["file_consistency_flags", "L"],
13285
+ ["base_address_lower", "Q"],
13286
+ ["free_space_address", "Q"],
13287
+ ["end_of_file_address", "Q"],
13288
+ ["driver_information_address", "Q"]
13289
+ ]);
13290
+ _structure_size(SUPERBLOCK_V0);
13291
+ const SUPERBLOCK_V2_V3 = /* @__PURE__ */ new Map([
13292
+ ["format_signature", "8s"],
13293
+ ["superblock_version", "B"],
13294
+ ["offset_size", "B"],
13295
+ ["length_size", "B"],
13296
+ ["file_consistency_flags", "B"],
13297
+ ["base_address", "Q"],
13298
+ ["superblock_extension_address", "Q"],
13299
+ ["end_of_file_address", "Q"],
13300
+ ["root_group_address", "Q"],
13301
+ ["superblock_checksum", "I"]
13302
+ ]);
13303
+ _structure_size(SUPERBLOCK_V2_V3);
13304
+ const SYMBOL_TABLE_ENTRY = /* @__PURE__ */ new Map([
13305
+ ["link_name_offset", "Q"],
13306
+ ["object_header_address", "Q"],
13307
+ ["cache_type", "I"],
13308
+ ["reserved", "I"],
13309
+ ["scratch", "16s"]
13310
+ ]);
13311
+ _structure_size(SYMBOL_TABLE_ENTRY);
13312
+ const SYMBOL_TABLE_NODE = /* @__PURE__ */ new Map([
13313
+ ["signature", "4s"],
13314
+ ["version", "B"],
13315
+ ["reserved_0", "B"],
13316
+ ["symbols", "H"]
13317
+ ]);
13318
+ _structure_size(SYMBOL_TABLE_NODE);
13319
+ const GLOBAL_HEAP_HEADER = /* @__PURE__ */ new Map([
13320
+ ["signature", "4s"],
13321
+ ["version", "B"],
13322
+ ["reserved", "3s"],
13323
+ ["collection_size", "Q"]
13324
+ ]);
13325
+ _structure_size(GLOBAL_HEAP_HEADER);
13326
+ const GLOBAL_HEAP_OBJECT = /* @__PURE__ */ new Map([
13327
+ ["object_index", "H"],
13328
+ ["reference_count", "H"],
13329
+ ["reserved", "I"],
13330
+ ["object_size", "Q"]
13331
+ ]);
13332
+ _structure_size(GLOBAL_HEAP_OBJECT);
13333
+ const OBJECT_HEADER_V1 = /* @__PURE__ */ new Map([
13334
+ ["version", "B"],
13335
+ ["reserved", "B"],
13336
+ ["total_header_messages", "H"],
13337
+ ["object_reference_count", "I"],
13338
+ ["object_header_size", "I"],
13339
+ ["padding", "I"]
13340
+ ]);
13341
+ _structure_size(OBJECT_HEADER_V1);
13342
+ const OBJECT_HEADER_V2 = /* @__PURE__ */ new Map([
13343
+ ["signature", "4s"],
13344
+ ["version", "B"],
13345
+ ["flags", "B"]
13346
+ ]);
13347
+ _structure_size(OBJECT_HEADER_V2);
13348
+ const HEADER_MSG_INFO_V1 = /* @__PURE__ */ new Map([
13349
+ ["type", "H"],
13350
+ ["size", "H"],
13351
+ ["flags", "B"],
13352
+ ["reserved", "3s"]
13353
+ ]);
13354
+ _structure_size(HEADER_MSG_INFO_V1);
13355
+ const HEADER_MSG_INFO_V2 = /* @__PURE__ */ new Map([
13356
+ ["type", "B"],
13357
+ ["size", "H"],
13358
+ ["flags", "B"]
13359
+ ]);
13360
+ _structure_size(HEADER_MSG_INFO_V2);
13361
+ const ATTR_MSG_HEADER_V1 = /* @__PURE__ */ new Map([
13362
+ ["version", "B"],
13363
+ ["reserved", "B"],
13364
+ ["name_size", "H"],
13365
+ ["datatype_size", "H"],
13366
+ ["dataspace_size", "H"]
13367
+ ]);
13368
+ _structure_size(ATTR_MSG_HEADER_V1);
13369
+ const ATTR_MSG_HEADER_V3 = /* @__PURE__ */ new Map([
13370
+ ["version", "B"],
13371
+ ["flags", "B"],
13372
+ ["name_size", "H"],
13373
+ ["datatype_size", "H"],
13374
+ ["dataspace_size", "H"],
13375
+ ["character_set_encoding", "B"]
13376
+ ]);
13377
+ _structure_size(ATTR_MSG_HEADER_V3);
13378
+ const DATASPACE_MSG_HEADER_V1 = /* @__PURE__ */ new Map([
13379
+ ["version", "B"],
13380
+ ["dimensionality", "B"],
13381
+ ["flags", "B"],
13382
+ ["reserved_0", "B"],
13383
+ ["reserved_1", "I"]
13384
+ ]);
13385
+ _structure_size(DATASPACE_MSG_HEADER_V1);
13386
+ const DATASPACE_MSG_HEADER_V2 = /* @__PURE__ */ new Map([
13387
+ ["version", "B"],
13388
+ ["dimensionality", "B"],
13389
+ ["flags", "B"],
13390
+ ["type", "B"]
13391
+ ]);
13392
+ _structure_size(DATASPACE_MSG_HEADER_V2);
13393
+ const FILLVAL_MSG_V1V2 = /* @__PURE__ */ new Map([
13394
+ ["version", "B"],
13395
+ ["space_allocation_time", "B"],
13396
+ ["fillvalue_write_time", "B"],
13397
+ ["fillvalue_defined", "B"]
13398
+ ]);
13399
+ _structure_size(FILLVAL_MSG_V1V2);
13400
+ const FILLVAL_MSG_V3 = /* @__PURE__ */ new Map([
13401
+ ["version", "B"],
13402
+ ["flags", "B"]
13403
+ ]);
13404
+ _structure_size(FILLVAL_MSG_V3);
13405
+ const FILTER_PIPELINE_DESCR_V1 = /* @__PURE__ */ new Map([
13406
+ ["filter_id", "H"],
13407
+ ["name_length", "H"],
13408
+ ["flags", "H"],
13409
+ ["client_data_values", "H"]
13410
+ ]);
13411
+ _structure_size(FILTER_PIPELINE_DESCR_V1);
13412
+ const GLOBAL_HEAP_ID = /* @__PURE__ */ new Map([
13413
+ ["collection_address", "Q"],
13414
+ ["object_index", "I"]
13415
+ ]);
13416
+ _structure_size(GLOBAL_HEAP_ID);
13417
+ let table = new Uint8Array(128);
13418
+ for (let i2 = 0; i2 < 64; i2++) {
13419
+ table[i2 < 26 ? i2 + 65 : i2 < 52 ? i2 + 71 : i2 < 62 ? i2 - 4 : i2 * 4 - 205] = i2;
13420
+ }
12939
13421
  const withGetRange = defineStoreExtension((innerStore) => ({
12940
13422
  async getRange(...args) {
12941
13423
  const [key, range2, opts] = args;
@@ -12957,6 +13439,56 @@ const withGetRange = defineStoreExtension((innerStore) => ({
12957
13439
  throw new Error("Invalid rangeQuery value.");
12958
13440
  }
12959
13441
  }));
13442
+ function isAbortError(error2) {
13443
+ return error2?.name === "AbortError";
13444
+ }
13445
+ function raceAbortSignal(promise, signal) {
13446
+ if (!signal)
13447
+ return promise;
13448
+ if (signal.aborted)
13449
+ return Promise.reject(signal.reason);
13450
+ return new Promise((resolve2, reject) => {
13451
+ const onAbort = () => reject(signal.reason);
13452
+ signal.addEventListener("abort", onAbort, { once: true });
13453
+ promise.then((value) => {
13454
+ signal.removeEventListener("abort", onAbort);
13455
+ resolve2(value);
13456
+ }, (error2) => {
13457
+ signal.removeEventListener("abort", onAbort);
13458
+ reject(error2);
13459
+ });
13460
+ });
13461
+ }
13462
+ function createSharedAbort(onAbort) {
13463
+ const controller = new AbortController();
13464
+ let activeCallers = 0;
13465
+ const cleanups = [];
13466
+ function attach(callerSignal) {
13467
+ if (controller.signal.aborted)
13468
+ return;
13469
+ activeCallers += 1;
13470
+ if (!callerSignal)
13471
+ return;
13472
+ const onCallerAbort = () => {
13473
+ activeCallers -= 1;
13474
+ if (activeCallers === 0) {
13475
+ controller.abort(callerSignal.reason);
13476
+ onAbort?.();
13477
+ }
13478
+ };
13479
+ if (callerSignal.aborted) {
13480
+ onCallerAbort();
13481
+ return;
13482
+ }
13483
+ callerSignal.addEventListener("abort", onCallerAbort, { once: true });
13484
+ cleanups.push(() => callerSignal.removeEventListener("abort", onCallerAbort));
13485
+ }
13486
+ function release() {
13487
+ cleanups.forEach((cleanup) => cleanup());
13488
+ cleanups.length = 0;
13489
+ }
13490
+ return { signal: controller.signal, attach, release };
13491
+ }
12960
13492
  async function relaxedFetch(...args) {
12961
13493
  const response = await fetch(...args);
12962
13494
  if (response.status === 403) {
@@ -12966,6 +13498,7 @@ async function relaxedFetch(...args) {
12966
13498
  }
12967
13499
  const CHUNK_GC_TIME = 3e4;
12968
13500
  const UNDEFINED_SENTINEL = null;
13501
+ const MAX_ABORT_RETRIES = 2;
12969
13502
  const UNCACHED_READ = "vitessceUncachedRead";
12970
13503
  function splitReadOptions(opts) {
12971
13504
  if (!opts || !opts[UNCACHED_READ]) {
@@ -12976,30 +13509,59 @@ function splitReadOptions(opts) {
12976
13509
  return [true, rest];
12977
13510
  }
12978
13511
  function makeCacheFetch(queryClient) {
12979
- if (queryClient) {
12980
- return async (cacheKey, fn) => {
13512
+ const inflight = /* @__PURE__ */ new Map();
13513
+ function read(cacheKey, fn) {
13514
+ if (!queryClient) {
13515
+ return (signal) => Promise.resolve(fn(signal));
13516
+ }
13517
+ return async (signal) => {
12981
13518
  const result = await queryClient.fetchQuery({
12982
13519
  queryKey: cacheKey,
12983
- queryFn: async () => await fn() ?? UNDEFINED_SENTINEL,
13520
+ queryFn: async () => await fn(signal) ?? UNDEFINED_SENTINEL,
12984
13521
  staleTime: Infinity,
12985
13522
  gcTime: CHUNK_GC_TIME
12986
13523
  });
12987
13524
  return result === UNDEFINED_SENTINEL ? void 0 : result;
12988
13525
  };
12989
13526
  }
12990
- const inflight = /* @__PURE__ */ new Map();
12991
- return (cacheKey, fn) => {
13527
+ function readShared(cacheKey, fn, signal) {
12992
13528
  const key = JSON.stringify(cacheKey);
12993
- let promise = inflight.get(key);
12994
- if (!promise) {
12995
- promise = Promise.resolve(fn()).finally(() => {
12996
- inflight.delete(key);
12997
- });
12998
- inflight.set(key, promise);
13529
+ let entry = inflight.get(key);
13530
+ if (!entry) {
13531
+ const forget = () => {
13532
+ if (inflight.get(key) === entry)
13533
+ inflight.delete(key);
13534
+ };
13535
+ const shared = createSharedAbort(forget);
13536
+ const newEntry = {
13537
+ shared,
13538
+ promise: read(cacheKey, fn)(shared.signal).finally(() => {
13539
+ shared.release();
13540
+ forget();
13541
+ })
13542
+ };
13543
+ entry = newEntry;
13544
+ inflight.set(key, newEntry);
13545
+ }
13546
+ entry.shared.attach(signal);
13547
+ return raceAbortSignal(entry.promise, signal);
13548
+ }
13549
+ return async (cacheKey, fn, signal) => {
13550
+ for (let attempt = 0; ; attempt++) {
13551
+ try {
13552
+ return await readShared(cacheKey, fn, signal);
13553
+ } catch (error2) {
13554
+ if (signal?.aborted || !isAbortError(error2) || attempt >= MAX_ABORT_RETRIES) {
13555
+ throw error2;
13556
+ }
13557
+ }
12999
13558
  }
13000
- return promise;
13001
13559
  };
13002
13560
  }
13561
+ function splitSignal(opts) {
13562
+ const { signal, ...init2 } = opts ?? {};
13563
+ return [signal ?? void 0, init2];
13564
+ }
13003
13565
  const withQueryClientCache = defineStoreExtension((innerStore, extOpts) => {
13004
13566
  const { cacheKeyPrefix, queryClient } = extOpts;
13005
13567
  const cacheFetch = makeCacheFetch(queryClient);
@@ -13010,7 +13572,8 @@ const withQueryClientCache = defineStoreExtension((innerStore, extOpts) => {
13010
13572
  if (uncached) {
13011
13573
  return innerStore.get(key, rest);
13012
13574
  }
13013
- return cacheFetch(["zarrStore", cacheKeyPrefix, key], () => innerStore.get(key, rest));
13575
+ const [signal, init2] = splitSignal(rest);
13576
+ return cacheFetch(["zarrStore", cacheKeyPrefix, key], (sharedSignal) => innerStore.get(key, { ...init2, signal: sharedSignal }), signal);
13014
13577
  },
13015
13578
  async getRange(...args) {
13016
13579
  const [key, range2, opts] = args;
@@ -13021,19 +13584,24 @@ const withQueryClientCache = defineStoreExtension((innerStore, extOpts) => {
13021
13584
  if (uncached) {
13022
13585
  return innerStore.getRange(key, range2, rest);
13023
13586
  }
13024
- return cacheFetch(["zarrStore", cacheKeyPrefix, key, range2], () => {
13587
+ const [signal, init2] = splitSignal(rest);
13588
+ return cacheFetch(["zarrStore", cacheKeyPrefix, key, range2], (sharedSignal) => {
13025
13589
  if (typeof innerStore.getRange !== "function") {
13026
13590
  throw new Error("innerStore does not implement getRange");
13027
13591
  }
13028
- return innerStore.getRange(key, range2, rest);
13029
- });
13592
+ return innerStore.getRange(key, range2, { ...init2, signal: sharedSignal });
13593
+ }, signal);
13030
13594
  }
13031
13595
  };
13032
13596
  });
13033
13597
  function applyStoreExtensions(store, url, queryClient) {
13034
13598
  return extendStore(
13035
13599
  store,
13600
+ // Ensure getRange is implemented (required by withRangeCoalescing).
13036
13601
  withGetRange,
13602
+ // Concurrent getRange calls for the same key (e.g. sharded chunks)
13603
+ // within a single microtask are merged into fewer, larger range requests.
13604
+ (s2) => withRangeCoalescing(s2),
13037
13605
  // Wrap remote stores in a read-through cache, so that concurrent reads of the
13038
13606
  // same chunk (e.g. multiple embedding dims within one chunk column-block) share
13039
13607
  // one request instead of downloading it once per reader.
@@ -35223,16 +35791,16 @@ class Stats {
35223
35791
  }
35224
35792
  }
35225
35793
  getTable() {
35226
- const table = {};
35794
+ const table2 = {};
35227
35795
  this.forEach((stat) => {
35228
- table[stat.name] = {
35796
+ table2[stat.name] = {
35229
35797
  time: stat.time || 0,
35230
35798
  count: stat.count || 0,
35231
35799
  average: stat.getAverageTime() || 0,
35232
35800
  hz: stat.getHz() || 0
35233
35801
  };
35234
35802
  });
35235
- return table;
35803
+ return table2;
35236
35804
  }
35237
35805
  _initializeStats() {
35238
35806
  let stats = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
@@ -35890,10 +36458,10 @@ class Log {
35890
36458
  }
35891
36459
  return this._getLogFunction(logLevel, message, originalConsole.debug || originalConsole.info, arguments, ONCE);
35892
36460
  }
35893
- table(logLevel, table, columns) {
35894
- if (table) {
35895
- return this._getLogFunction(logLevel, table, console.table || noop$4, columns && [columns], {
35896
- tag: getTableHeader(table)
36461
+ table(logLevel, table2, columns) {
36462
+ if (table2) {
36463
+ return this._getLogFunction(logLevel, table2, console.table || noop$4, columns && [columns], {
36464
+ tag: getTableHeader(table2)
35897
36465
  });
35898
36466
  }
35899
36467
  return noop$4;
@@ -36093,9 +36661,9 @@ function logImageInBrowser(_ref3) {
36093
36661
  }
36094
36662
  return noop$4;
36095
36663
  }
36096
- function getTableHeader(table) {
36097
- for (const key in table) {
36098
- for (const title in table[key]) {
36664
+ function getTableHeader(table2) {
36665
+ for (const key in table2) {
36666
+ for (const title in table2[key]) {
36099
36667
  return title || "untitled";
36100
36668
  }
36101
36669
  }
@@ -43539,13 +44107,13 @@ function getDebugTableForUniforms(_ref) {
43539
44107
  const SHADER_MODULE_UNIFORM_REGEXP = ".*_.*";
43540
44108
  const PROJECT_MODULE_UNIFORM_REGEXP = ".*Matrix";
43541
44109
  const uniformLocations = program._uniformSetters;
43542
- const table = {};
44110
+ const table2 = {};
43543
44111
  const uniformNames = Object.keys(uniformLocations).sort();
43544
44112
  let count2 = 0;
43545
44113
  for (const uniformName of uniformNames) {
43546
44114
  if (!uniformName.match(SHADER_MODULE_UNIFORM_REGEXP) && !uniformName.match(PROJECT_MODULE_UNIFORM_REGEXP)) {
43547
44115
  if (addUniformToTable({
43548
- table,
44116
+ table: table2,
43549
44117
  header,
43550
44118
  uniforms,
43551
44119
  uniformName,
@@ -43558,7 +44126,7 @@ function getDebugTableForUniforms(_ref) {
43558
44126
  for (const uniformName of uniformNames) {
43559
44127
  if (uniformName.match(PROJECT_MODULE_UNIFORM_REGEXP)) {
43560
44128
  if (addUniformToTable({
43561
- table,
44129
+ table: table2,
43562
44130
  header,
43563
44131
  uniforms,
43564
44132
  uniformName,
@@ -43569,9 +44137,9 @@ function getDebugTableForUniforms(_ref) {
43569
44137
  }
43570
44138
  }
43571
44139
  for (const uniformName of uniformNames) {
43572
- if (!table[uniformName]) {
44140
+ if (!table2[uniformName]) {
43573
44141
  if (addUniformToTable({
43574
- table,
44142
+ table: table2,
43575
44143
  header,
43576
44144
  uniforms,
43577
44145
  uniformName,
@@ -43586,7 +44154,7 @@ function getDebugTableForUniforms(_ref) {
43586
44154
  if (!undefinedOnly) {
43587
44155
  for (const uniformName in uniforms) {
43588
44156
  const uniform = uniforms[uniformName];
43589
- if (!table[uniformName]) {
44157
+ if (!table2[uniformName]) {
43590
44158
  unusedCount++;
43591
44159
  unusedTable[uniformName] = {
43592
44160
  Type: "NOT USED: ".concat(uniform),
@@ -43596,7 +44164,7 @@ function getDebugTableForUniforms(_ref) {
43596
44164
  }
43597
44165
  }
43598
44166
  return {
43599
- table,
44167
+ table: table2,
43600
44168
  count: count2,
43601
44169
  unusedTable,
43602
44170
  unusedCount
@@ -43604,7 +44172,7 @@ function getDebugTableForUniforms(_ref) {
43604
44172
  }
43605
44173
  function addUniformToTable(_ref2) {
43606
44174
  let {
43607
- table,
44175
+ table: table2,
43608
44176
  header,
43609
44177
  uniforms,
43610
44178
  uniformName,
@@ -43613,7 +44181,7 @@ function addUniformToTable(_ref2) {
43613
44181
  const value = uniforms[uniformName];
43614
44182
  const isDefined = isUniformDefined(value);
43615
44183
  if (!undefinedOnly || !isDefined) {
43616
- table[uniformName] = {
44184
+ table2[uniformName] = {
43617
44185
  [header]: isDefined ? formatValue(value) : "N/A",
43618
44186
  "Uniform Type": isDefined ? value : "NOT PROVIDED"
43619
44187
  };
@@ -43632,9 +44200,9 @@ function getDebugTableForVertexArray(_ref) {
43632
44200
  if (!vertexArray.configuration) {
43633
44201
  return {};
43634
44202
  }
43635
- const table = {};
44203
+ const table2 = {};
43636
44204
  if (vertexArray.elements) {
43637
- table.ELEMENT_ARRAY_BUFFER = getDebugTableRow(vertexArray, vertexArray.elements, null, header);
44205
+ table2.ELEMENT_ARRAY_BUFFER = getDebugTableRow(vertexArray, vertexArray.elements, null, header);
43638
44206
  }
43639
44207
  const attributes = vertexArray.values;
43640
44208
  for (const attributeLocation in attributes) {
@@ -43645,10 +44213,10 @@ function getDebugTableForVertexArray(_ref) {
43645
44213
  if (accessor) {
43646
44214
  rowHeader = "".concat(attributeLocation, ": ").concat(getGLSLDeclaration$1(info.name, accessor));
43647
44215
  }
43648
- table[rowHeader] = getDebugTableRow(vertexArray, attributes[attributeLocation], accessor, header);
44216
+ table2[rowHeader] = getDebugTableRow(vertexArray, attributes[attributeLocation], accessor, header);
43649
44217
  }
43650
44218
  }
43651
- return table;
44219
+ return table2;
43652
44220
  }
43653
44221
  function getDebugTableRow(vertexArray, attribute, accessor, header) {
43654
44222
  const {
@@ -43720,12 +44288,12 @@ function getGLSLDeclaration$1(name2, accessor) {
43720
44288
  return typeAndName ? "".concat(name2, " (").concat(typeAndName.name, ")") : name2;
43721
44289
  }
43722
44290
  function getDebugTableForProgramConfiguration(config3) {
43723
- const table = {};
44291
+ const table2 = {};
43724
44292
  const header = "Accessors for ".concat(config3.id);
43725
44293
  for (const attributeInfo of config3.attributeInfos) {
43726
44294
  if (attributeInfo) {
43727
44295
  const glslDeclaration = getGLSLDeclaration(attributeInfo);
43728
- table["in ".concat(glslDeclaration)] = {
44296
+ table2["in ".concat(glslDeclaration)] = {
43729
44297
  [header]: JSON.stringify(attributeInfo.accessor)
43730
44298
  };
43731
44299
  }
@@ -43733,12 +44301,12 @@ function getDebugTableForProgramConfiguration(config3) {
43733
44301
  for (const varyingInfo of config3.varyingInfos) {
43734
44302
  if (varyingInfo) {
43735
44303
  const glslDeclaration = getGLSLDeclaration(varyingInfo);
43736
- table["out ".concat(glslDeclaration)] = {
44304
+ table2["out ".concat(glslDeclaration)] = {
43737
44305
  [header]: JSON.stringify(varyingInfo.accessor)
43738
44306
  };
43739
44307
  }
43740
44308
  }
43741
- return table;
44309
+ return table2;
43742
44310
  }
43743
44311
  function getGLSLDeclaration(attributeInfo) {
43744
44312
  const {
@@ -112696,7 +113264,7 @@ function requireBignumber() {
112696
113264
  suffix: ""
112697
113265
  }, ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz", alphabetHasNormalDecimalDigits = true;
112698
113266
  function BigNumber3(v, b) {
112699
- var alphabet, c, caseChanged, e2, i2, isNum, len2, str, x = this;
113267
+ var alphabet2, c, caseChanged, e2, i2, isNum, len2, str, x = this;
112700
113268
  if (!(x instanceof BigNumber3)) return new BigNumber3(v, b);
112701
113269
  if (b == null) {
112702
113270
  if (v && v._isBigNumber === true) {
@@ -112752,10 +113320,10 @@ function requireBignumber() {
112752
113320
  } else {
112753
113321
  x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;
112754
113322
  }
112755
- alphabet = ALPHABET.slice(0, b);
113323
+ alphabet2 = ALPHABET.slice(0, b);
112756
113324
  e2 = i2 = 0;
112757
113325
  for (len2 = str.length; i2 < len2; i2++) {
112758
- if (alphabet.indexOf(c = str.charAt(i2)) < 0) {
113326
+ if (alphabet2.indexOf(c = str.charAt(i2)) < 0) {
112759
113327
  if (c == ".") {
112760
113328
  if (i2 > e2) {
112761
113329
  e2 = len2;
@@ -113026,11 +113594,11 @@ function requireBignumber() {
113026
113594
  };
113027
113595
  convertBase2 = /* @__PURE__ */ function() {
113028
113596
  var decimal = "0123456789";
113029
- function toBaseOut(str, baseIn, baseOut, alphabet) {
113597
+ function toBaseOut(str, baseIn, baseOut, alphabet2) {
113030
113598
  var j, arr = [0], arrL, i2 = 0, len2 = str.length;
113031
113599
  for (; i2 < len2; ) {
113032
113600
  for (arrL = arr.length; arrL--; arr[arrL] *= baseIn) ;
113033
- arr[0] += alphabet.indexOf(str.charAt(i2++));
113601
+ arr[0] += alphabet2.indexOf(str.charAt(i2++));
113034
113602
  for (j = 0; j < arr.length; j++) {
113035
113603
  if (arr[j] > baseOut - 1) {
113036
113604
  if (arr[j + 1] == null) arr[j + 1] = 0;
@@ -113042,7 +113610,7 @@ function requireBignumber() {
113042
113610
  return arr.reverse();
113043
113611
  }
113044
113612
  return function(str, baseIn, baseOut, sign2, callerIsToString) {
113045
- var alphabet, d, e2, k, r2, x, xc, y, i2 = str.indexOf("."), dp = DECIMAL_PLACES, rm = ROUNDING_MODE;
113613
+ var alphabet2, d, e2, k, r2, x, xc, y, i2 = str.indexOf("."), dp = DECIMAL_PLACES, rm = ROUNDING_MODE;
113046
113614
  if (i2 >= 0) {
113047
113615
  k = POW_PRECISION;
113048
113616
  POW_PRECISION = 0;
@@ -113058,10 +113626,10 @@ function requireBignumber() {
113058
113626
  );
113059
113627
  y.e = y.c.length;
113060
113628
  }
113061
- xc = toBaseOut(str, baseIn, baseOut, callerIsToString ? (alphabet = ALPHABET, decimal) : (alphabet = decimal, ALPHABET));
113629
+ xc = toBaseOut(str, baseIn, baseOut, callerIsToString ? (alphabet2 = ALPHABET, decimal) : (alphabet2 = decimal, ALPHABET));
113062
113630
  e2 = k = xc.length;
113063
113631
  for (; xc[--k] == 0; xc.pop()) ;
113064
- if (!xc[0]) return alphabet.charAt(0);
113632
+ if (!xc[0]) return alphabet2.charAt(0);
113065
113633
  if (i2 < 0) {
113066
113634
  --e2;
113067
113635
  } else {
@@ -113079,7 +113647,7 @@ function requireBignumber() {
113079
113647
  r2 = r2 || d < 0 || xc[d + 1] != null;
113080
113648
  r2 = rm < 4 ? (i2 != null || r2) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : i2 > k || i2 == k && (rm == 4 || r2 || rm == 6 && xc[d - 1] & 1 || rm == (x.s < 0 ? 8 : 7));
113081
113649
  if (d < 1 || !xc[0]) {
113082
- str = r2 ? toFixedPoint2(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0);
113650
+ str = r2 ? toFixedPoint2(alphabet2.charAt(1), -dp, alphabet2.charAt(0)) : alphabet2.charAt(0);
113083
113651
  } else {
113084
113652
  xc.length = d;
113085
113653
  if (r2) {
@@ -113092,8 +113660,8 @@ function requireBignumber() {
113092
113660
  }
113093
113661
  }
113094
113662
  for (k = xc.length; !xc[--k]; ) ;
113095
- for (i2 = 0, str = ""; i2 <= k; str += alphabet.charAt(xc[i2++])) ;
113096
- str = toFixedPoint2(str, e2, alphabet.charAt(0));
113663
+ for (i2 = 0, str = ""; i2 <= k; str += alphabet2.charAt(xc[i2++])) ;
113664
+ str = toFixedPoint2(str, e2, alphabet2.charAt(0));
113097
113665
  }
113098
113666
  return str;
113099
113667
  };
@@ -133784,22 +134352,22 @@ async function getDecoder(fileDirectory) {
133784
134352
  const Decoder = await importFn();
133785
134353
  return new Decoder(fileDirectory);
133786
134354
  }
133787
- addDecoder([void 0, 1], () => import("./raw-BK-gyR3b.js").then((m) => m.default));
133788
- addDecoder(5, () => import("./lzw-wmtKf48V.js").then((m) => m.default));
134355
+ addDecoder([void 0, 1], () => import("./raw-BRA6fCQh.js").then((m) => m.default));
134356
+ addDecoder(5, () => import("./lzw-j3x3gmJ8.js").then((m) => m.default));
133789
134357
  addDecoder(6, () => {
133790
134358
  throw new Error("old style JPEG compression is not supported.");
133791
134359
  });
133792
- addDecoder(7, () => import("./jpeg-CeIJFaqQ.js").then((m) => m.default));
133793
- addDecoder([8, 32946], () => import("./deflate-Bed2-MDi.js").then((m) => m.default));
133794
- addDecoder(32773, () => import("./packbits-Cu457F8q.js").then((m) => m.default));
134360
+ addDecoder(7, () => import("./jpeg-I9GgK6x5.js").then((m) => m.default));
134361
+ addDecoder([8, 32946], () => import("./deflate-D3UTqEHD.js").then((m) => m.default));
134362
+ addDecoder(32773, () => import("./packbits-CvMH_RJX.js").then((m) => m.default));
133795
134363
  addDecoder(
133796
134364
  34887,
133797
- () => import("./lerc-RWTv8dA7.js").then(async (m) => {
134365
+ () => import("./lerc-fTImAOhU.js").then(async (m) => {
133798
134366
  await m.zstd.init();
133799
134367
  return m;
133800
134368
  }).then((m) => m.default)
133801
134369
  );
133802
- addDecoder(50001, () => import("./webimage-w0XMF58C.js").then((m) => m.default));
134370
+ addDecoder(50001, () => import("./webimage-CY5EKEDb.js").then((m) => m.default));
133803
134371
  function copyNewSize(array, width2, height2, samplesPerPixel = 1) {
133804
134372
  return new (Object.getPrototypeOf(array)).constructor(width2 * height2 * samplesPerPixel);
133805
134373
  }
@@ -134733,7 +135301,7 @@ class GeoTIFFImage {
134733
135301
  }
134734
135302
  }
134735
135303
  }
134736
- class DataView64 {
135304
+ class DataView642 {
134737
135305
  constructor(arrayBuffer2) {
134738
135306
  this._dataView = new DataView(arrayBuffer2);
134739
135307
  }
@@ -135440,13 +136008,13 @@ class BlockedSource extends BaseSource {
135440
136008
  fetchBlocks(signal) {
135441
136009
  if (this.blockIdsToFetch.size > 0) {
135442
136010
  const groups = this.groupBlocks(this.blockIdsToFetch);
135443
- const groupRequests = this.source.fetch(groups, signal);
136011
+ const groupRequests2 = this.source.fetch(groups, signal);
135444
136012
  for (let groupIndex = 0; groupIndex < groups.length; ++groupIndex) {
135445
136013
  const group = groups[groupIndex];
135446
136014
  for (const blockId of group.blockIds) {
135447
136015
  this.blockRequests.set(blockId, (async () => {
135448
136016
  try {
135449
- const response = (await groupRequests)[groupIndex];
136017
+ const response = (await groupRequests2)[groupIndex];
135450
136018
  const blockOffset = blockId * this.blockSize;
135451
136019
  const o2 = blockOffset - response.offset;
135452
136020
  const t = Math.min(o2 + this.blockSize, response.data.byteLength);
@@ -136497,7 +137065,7 @@ class GeoTIFF extends GeoTIFFBase {
136497
137065
  */
136498
137066
  static async fromSource(source, options, signal) {
136499
137067
  const headerData = (await source.fetch([{ offset: 0, length: 1024 }], signal))[0];
136500
- const dataView = new DataView64(headerData);
137068
+ const dataView = new DataView642(headerData);
136501
137069
  const BOM = dataView.getUint16(0, 0);
136502
137070
  let littleEndian;
136503
137071
  if (BOM === 18761) {
@@ -137483,15 +138051,15 @@ const adler32 = (adler, buf, len2, pos) => {
137483
138051
  };
137484
138052
  var adler32_1 = adler32;
137485
138053
  const makeTable = () => {
137486
- let c, table = [];
138054
+ let c, table2 = [];
137487
138055
  for (var n3 = 0; n3 < 256; n3++) {
137488
138056
  c = n3;
137489
138057
  for (var k = 0; k < 8; k++) {
137490
138058
  c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
137491
138059
  }
137492
- table[n3] = c;
138060
+ table2[n3] = c;
137493
138061
  }
137494
- return table;
138062
+ return table2;
137495
138063
  };
137496
138064
  const crcTable = new Uint32Array(makeTable());
137497
138065
  const crc32 = (crc, buf, len2, pos) => {
@@ -139299,7 +139867,7 @@ const dext = new Uint8Array([
139299
139867
  64,
139300
139868
  64
139301
139869
  ]);
139302
- const inflate_table = (type, lens2, lens_index, codes, table, table_index, work, opts) => {
139870
+ const inflate_table = (type, lens2, lens_index, codes, table2, table_index, work, opts) => {
139303
139871
  const bits = opts.bits;
139304
139872
  let len2 = 0;
139305
139873
  let sym = 0;
@@ -139339,8 +139907,8 @@ const inflate_table = (type, lens2, lens_index, codes, table, table_index, work,
139339
139907
  root2 = max2;
139340
139908
  }
139341
139909
  if (max2 === 0) {
139342
- table[table_index++] = 1 << 24 | 64 << 16 | 0;
139343
- table[table_index++] = 1 << 24 | 64 << 16 | 0;
139910
+ table2[table_index++] = 1 << 24 | 64 << 16 | 0;
139911
+ table2[table_index++] = 1 << 24 | 64 << 16 | 0;
139344
139912
  opts.bits = 1;
139345
139913
  return 0;
139346
139914
  }
@@ -139415,7 +139983,7 @@ const inflate_table = (type, lens2, lens_index, codes, table, table_index, work,
139415
139983
  min2 = fill;
139416
139984
  do {
139417
139985
  fill -= incr;
139418
- table[next4 + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0;
139986
+ table2[next4 + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0;
139419
139987
  } while (fill !== 0);
139420
139988
  incr = 1 << len2 - 1;
139421
139989
  while (huff & incr) {
@@ -139454,11 +140022,11 @@ const inflate_table = (type, lens2, lens_index, codes, table, table_index, work,
139454
140022
  return 1;
139455
140023
  }
139456
140024
  low = huff & mask;
139457
- table[low] = root2 << 24 | curr << 16 | next4 - table_index | 0;
140025
+ table2[low] = root2 << 24 | curr << 16 | next4 - table_index | 0;
139458
140026
  }
139459
140027
  }
139460
140028
  if (huff !== 0) {
139461
- table[next4 + huff] = len2 - drop << 24 | 64 << 16 | 0;
140029
+ table2[next4 + huff] = len2 - drop << 24 | 64 << 16 | 0;
139462
140030
  }
139463
140031
  opts.bits = root2;
139464
140032
  return 0;
@@ -141845,13 +142413,13 @@ var blosc_codec = function() {
141845
142413
  }();
141846
142414
  var __isNode = typeof process !== "undefined" && process.versions != null && process.versions.node != null;
141847
142415
  var __toBinary = __isNode ? (base64) => new Uint8Array(Buffer.from(base64, "base64")) : /* @__PURE__ */ (() => {
141848
- var table = new Uint8Array(128);
141849
- for (var i2 = 0; i2 < 64; i2++) table[i2 < 26 ? i2 + 65 : i2 < 52 ? i2 + 71 : i2 < 62 ? i2 - 4 : i2 * 4 - 205] = i2;
142416
+ var table2 = new Uint8Array(128);
142417
+ for (var i2 = 0; i2 < 64; i2++) table2[i2 < 26 ? i2 + 65 : i2 < 52 ? i2 + 71 : i2 < 62 ? i2 - 4 : i2 * 4 - 205] = i2;
141850
142418
  return (base64) => {
141851
142419
  var n3 = base64.length, bytes = new Uint8Array((n3 - (base64[n3 - 1] == "=") - (base64[n3 - 2] == "=")) * 3 / 4 | 0);
141852
142420
  for (var i3 = 0, j = 0; i3 < n3; ) {
141853
- var c0 = table[base64.charCodeAt(i3++)], c1 = table[base64.charCodeAt(i3++)];
141854
- var c2 = table[base64.charCodeAt(i3++)], c3 = table[base64.charCodeAt(i3++)];
142421
+ var c0 = table2[base64.charCodeAt(i3++)], c1 = table2[base64.charCodeAt(i3++)];
142422
+ var c2 = table2[base64.charCodeAt(i3++)], c3 = table2[base64.charCodeAt(i3++)];
141855
142423
  bytes[j++] = c0 << 2 | c1 >> 4;
141856
142424
  bytes[j++] = c1 << 4 | c2 >> 2;
141857
142425
  bytes[j++] = c2 << 6 | c3;
@@ -147476,7 +148044,7 @@ function clone$1(configObject) {
147476
148044
  suffix: ""
147477
148045
  }, ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz", alphabetHasNormalDecimalDigits = true;
147478
148046
  function BigNumber2(v, b) {
147479
- var alphabet, c, caseChanged, e2, i2, isNum, len2, str, x = this;
148047
+ var alphabet2, c, caseChanged, e2, i2, isNum, len2, str, x = this;
147480
148048
  if (!(x instanceof BigNumber2)) return new BigNumber2(v, b);
147481
148049
  if (b == null) {
147482
148050
  if (v && v._isBigNumber === true) {
@@ -147532,10 +148100,10 @@ function clone$1(configObject) {
147532
148100
  } else {
147533
148101
  x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;
147534
148102
  }
147535
- alphabet = ALPHABET.slice(0, b);
148103
+ alphabet2 = ALPHABET.slice(0, b);
147536
148104
  e2 = i2 = 0;
147537
148105
  for (len2 = str.length; i2 < len2; i2++) {
147538
- if (alphabet.indexOf(c = str.charAt(i2)) < 0) {
148106
+ if (alphabet2.indexOf(c = str.charAt(i2)) < 0) {
147539
148107
  if (c == ".") {
147540
148108
  if (i2 > e2) {
147541
148109
  e2 = len2;
@@ -147806,11 +148374,11 @@ function clone$1(configObject) {
147806
148374
  };
147807
148375
  convertBase2 = /* @__PURE__ */ function() {
147808
148376
  var decimal = "0123456789";
147809
- function toBaseOut(str, baseIn, baseOut, alphabet) {
148377
+ function toBaseOut(str, baseIn, baseOut, alphabet2) {
147810
148378
  var j, arr = [0], arrL, i2 = 0, len2 = str.length;
147811
148379
  for (; i2 < len2; ) {
147812
148380
  for (arrL = arr.length; arrL--; arr[arrL] *= baseIn) ;
147813
- arr[0] += alphabet.indexOf(str.charAt(i2++));
148381
+ arr[0] += alphabet2.indexOf(str.charAt(i2++));
147814
148382
  for (j = 0; j < arr.length; j++) {
147815
148383
  if (arr[j] > baseOut - 1) {
147816
148384
  if (arr[j + 1] == null) arr[j + 1] = 0;
@@ -147822,7 +148390,7 @@ function clone$1(configObject) {
147822
148390
  return arr.reverse();
147823
148391
  }
147824
148392
  return function(str, baseIn, baseOut, sign2, callerIsToString) {
147825
- var alphabet, d, e2, k, r2, x, xc, y, i2 = str.indexOf("."), dp = DECIMAL_PLACES, rm = ROUNDING_MODE;
148393
+ var alphabet2, d, e2, k, r2, x, xc, y, i2 = str.indexOf("."), dp = DECIMAL_PLACES, rm = ROUNDING_MODE;
147826
148394
  if (i2 >= 0) {
147827
148395
  k = POW_PRECISION;
147828
148396
  POW_PRECISION = 0;
@@ -147838,10 +148406,10 @@ function clone$1(configObject) {
147838
148406
  );
147839
148407
  y.e = y.c.length;
147840
148408
  }
147841
- xc = toBaseOut(str, baseIn, baseOut, callerIsToString ? (alphabet = ALPHABET, decimal) : (alphabet = decimal, ALPHABET));
148409
+ xc = toBaseOut(str, baseIn, baseOut, callerIsToString ? (alphabet2 = ALPHABET, decimal) : (alphabet2 = decimal, ALPHABET));
147842
148410
  e2 = k = xc.length;
147843
148411
  for (; xc[--k] == 0; xc.pop()) ;
147844
- if (!xc[0]) return alphabet.charAt(0);
148412
+ if (!xc[0]) return alphabet2.charAt(0);
147845
148413
  if (i2 < 0) {
147846
148414
  --e2;
147847
148415
  } else {
@@ -147859,7 +148427,7 @@ function clone$1(configObject) {
147859
148427
  r2 = r2 || d < 0 || xc[d + 1] != null;
147860
148428
  r2 = rm < 4 ? (i2 != null || r2) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : i2 > k || i2 == k && (rm == 4 || r2 || rm == 6 && xc[d - 1] & 1 || rm == (x.s < 0 ? 8 : 7));
147861
148429
  if (d < 1 || !xc[0]) {
147862
- str = r2 ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0);
148430
+ str = r2 ? toFixedPoint(alphabet2.charAt(1), -dp, alphabet2.charAt(0)) : alphabet2.charAt(0);
147863
148431
  } else {
147864
148432
  xc.length = d;
147865
148433
  if (r2) {
@@ -147872,8 +148440,8 @@ function clone$1(configObject) {
147872
148440
  }
147873
148441
  }
147874
148442
  for (k = xc.length; !xc[--k]; ) ;
147875
- for (i2 = 0, str = ""; i2 <= k; str += alphabet.charAt(xc[i2++])) ;
147876
- str = toFixedPoint(str, e2, alphabet.charAt(0));
148443
+ for (i2 = 0, str = ""; i2 <= k; str += alphabet2.charAt(xc[i2++])) ;
148444
+ str = toFixedPoint(str, e2, alphabet2.charAt(0));
147877
148445
  }
147878
148446
  return str;
147879
148447
  };
@@ -157681,13 +158249,13 @@ const parseAddition = (str) => {
157681
158249
  if (!Number.isNaN(+str)) {
157682
158250
  return +str;
157683
158251
  }
157684
- const numbers = str.match(/\d*\.?\d+/g);
157685
- if (!numbers) {
158252
+ const numbers2 = str.match(/\d*\.?\d+/g);
158253
+ if (!numbers2) {
157686
158254
  return 0;
157687
158255
  }
157688
158256
  let sum2 = 0;
157689
- for (let i2 = 0; i2 < numbers.length; i2 += 1) {
157690
- sum2 += +numbers[i2];
158257
+ for (let i2 = 0; i2 < numbers2.length; i2 += 1) {
158258
+ sum2 += +numbers2[i2];
157691
158259
  }
157692
158260
  return sum2;
157693
158261
  };
@@ -161587,6 +162155,24 @@ function guessTileSize(arr) {
161587
162155
  function isAxis(axisOrLabel) {
161588
162156
  return typeof axisOrLabel[0] !== "string";
161589
162157
  }
162158
+ function lowercaseAxisNames(rootAttrs) {
162159
+ if (!Array.isArray(rootAttrs?.multiscales))
162160
+ return rootAttrs;
162161
+ const multiscales = rootAttrs.multiscales.map((multiscale) => {
162162
+ const { axes } = multiscale;
162163
+ if (!Array.isArray(axes))
162164
+ return multiscale;
162165
+ const names = axes.map((axis) => typeof axis === "string" ? axis : axis.name);
162166
+ const lowerNames = names.map((name2) => typeof name2 === "string" ? name2.toLowerCase() : name2);
162167
+ if (new Set(lowerNames).size !== new Set(names).size)
162168
+ return multiscale;
162169
+ return {
162170
+ ...multiscale,
162171
+ axes: axes.map((axis, i2) => typeof axis === "string" ? lowerNames[i2] : { ...axis, name: lowerNames[i2] })
162172
+ };
162173
+ });
162174
+ return { ...rootAttrs, multiscales };
162175
+ }
161590
162176
  async function loadMultiscales(root2) {
161591
162177
  let rootAttrs;
161592
162178
  try {
@@ -161597,7 +162183,7 @@ async function loadMultiscales(root2) {
161597
162183
  }
161598
162184
  throw e2;
161599
162185
  }
161600
- rootAttrs = flattenOmeAttrs(rootAttrs);
162186
+ rootAttrs = lowercaseAxisNames(flattenOmeAttrs(rootAttrs));
161601
162187
  let paths = ["0"];
161602
162188
  let labels = ["t", "c", "z", "y", "x"];
161603
162189
  if ("multiscales" in rootAttrs) {
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A, C, d, e, f, h, G, b, J, M, i, O, c, R, j } from "./index-Diedaj-4.js";
1
+ import { A, C, d, e, f, h, G, b, J, M, i, O, c, R, j } from "./index-C7Fh1DhY.js";
2
2
  export {
3
3
  A as AnnotationStoryJsonLoader,
4
4
  C as CellsJsonAsObsEmbeddingLoader,
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-Diedaj-4.js";
1
+ import { B as BaseDecoder } from "./index-C7Fh1DhY.js";
2
2
  const dctZigZag = new Int32Array([
3
3
  0,
4
4
  1,
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-SxljTded.js";
2
- import { g as getDefaultExportFromCjs, B as BaseDecoder, L as LercParameters, a as LercAddCompression } from "./index-Diedaj-4.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder, L as LercParameters, a as LercAddCompression } from "./index-C7Fh1DhY.js";
3
3
  var LercDecode = { exports: {} };
4
4
  var hasRequiredLercDecode;
5
5
  function requireLercDecode() {
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-Diedaj-4.js";
1
+ import { B as BaseDecoder } from "./index-C7Fh1DhY.js";
2
2
  const MIN_BITS = 9;
3
3
  const CLEAR_CODE = 256;
4
4
  const EOI_CODE = 257;
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-Diedaj-4.js";
1
+ import { B as BaseDecoder } from "./index-C7Fh1DhY.js";
2
2
  class PackbitsDecoder extends BaseDecoder {
3
3
  decodeBlock(buffer) {
4
4
  const dataView = new DataView(buffer);
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-Diedaj-4.js";
1
+ import { B as BaseDecoder } from "./index-C7Fh1DhY.js";
2
2
  class RawDecoder extends BaseDecoder {
3
3
  decodeBlock(buffer) {
4
4
  return buffer;
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-Diedaj-4.js";
1
+ import { B as BaseDecoder } from "./index-C7Fh1DhY.js";
2
2
  class WebImageDecoder extends BaseDecoder {
3
3
  constructor() {
4
4
  super();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/json",
3
- "version": "4.2.0",
3
+ "version": "4.2.1",
4
4
  "author": "HIDIVE Lab at HMS",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -20,17 +20,17 @@
20
20
  "lodash-es": "^4.17.21",
21
21
  "zarrita": "0.7.5",
22
22
  "zod": "^3.21.4",
23
- "@vitessce/constants-internal": "4.2.0",
24
- "@vitessce/gl": "4.2.0",
25
- "@vitessce/sets-utils": "4.2.0",
26
- "@vitessce/spatial-utils": "4.2.0",
27
- "@vitessce/schemas": "4.2.0",
28
- "@vitessce/utils": "4.2.0",
29
- "@vitessce/abstract": "4.2.0",
30
- "@vitessce/error": "4.2.0",
31
- "@vitessce/config": "4.2.0",
32
- "@vitessce/globals": "4.2.0",
33
- "@vitessce/zarr-utils": "4.2.0"
23
+ "@vitessce/gl": "4.2.1",
24
+ "@vitessce/globals": "4.2.1",
25
+ "@vitessce/schemas": "4.2.1",
26
+ "@vitessce/sets-utils": "4.2.1",
27
+ "@vitessce/spatial-utils": "4.2.1",
28
+ "@vitessce/utils": "4.2.1",
29
+ "@vitessce/abstract": "4.2.1",
30
+ "@vitessce/zarr-utils": "4.2.1",
31
+ "@vitessce/config": "4.2.1",
32
+ "@vitessce/constants-internal": "4.2.1",
33
+ "@vitessce/error": "4.2.1"
34
34
  },
35
35
  "scripts": {
36
36
  "bundle": "pnpm exec vite build -c ../../../scripts/vite.config.mjs",