@genome-spy/app 0.69.0 → 0.70.0

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,71 +1,68 @@
1
- var Ne = Object.defineProperty;
2
- var Le = (t, r, e) => r in t ? Ne(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
3
- var E = (t, r, e) => Le(t, typeof r != "symbol" ? r + "" : r, e);
4
- import { RemoteFile as Me, LocalFile as He } from "./browser-BRemItdO.js";
5
- import { A as le } from "./AbortablePromiseCache-CcuMrnn7.js";
6
- import { i as $e } from "./inflate-GtwLkvSP.js";
7
- function je(t) {
1
+ import { RemoteFile as Re, LocalFile as De } from "./browser-0iNU5Wit.js";
2
+ import { A as ue } from "./AbortablePromiseCache-Dj0vzLnp.js";
3
+ import { i as Ne } from "./inflate-GtwLkvSP.js";
4
+ function Le(t) {
8
5
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
9
6
  }
10
- const he = BigInt(32);
11
- function Ge(t, r, e) {
7
+ const fe = BigInt(32);
8
+ function Me(t, r, e) {
12
9
  const n = +!!e, i = +!e;
13
- return BigInt(t.getInt32(r, e) * i + t.getInt32(r + 4, e) * n) << he | BigInt(t.getUint32(r, e) * n + t.getUint32(r + 4, e) * i);
10
+ return BigInt(t.getInt32(r, e) * i + t.getInt32(r + 4, e) * n) << fe | BigInt(t.getUint32(r, e) * n + t.getUint32(r + 4, e) * i);
14
11
  }
15
- function We(t, r, e) {
12
+ function He(t, r, e) {
16
13
  const n = t.getUint32(r, e), i = t.getUint32(r + 4, e), o = +!!e, s = +!e;
17
- return BigInt(n * s + i * o) << he | BigInt(n * o + i * s);
14
+ return BigInt(n * s + i * o) << fe | BigInt(n * o + i * s);
18
15
  }
19
16
  "getBigInt64" in DataView || (DataView.prototype.getBigInt64 = function(t, r) {
20
- return Ge(this, t, r);
17
+ return Me(this, t, r);
21
18
  });
22
19
  "getBigUint64" in DataView || (DataView.prototype.getBigUint64 = function(t, r) {
23
- return We(this, t, r);
20
+ return He(this, t, r);
24
21
  });
25
- var K = function(t, r) {
26
- return K = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) {
22
+ var J = function(t, r) {
23
+ return J = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) {
27
24
  e.__proto__ = n;
28
25
  } || function(e, n) {
29
26
  for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
30
- }, K(t, r);
27
+ }, J(t, r);
31
28
  };
32
- function te(t, r) {
29
+ function X(t, r) {
33
30
  if (typeof r != "function" && r !== null)
34
31
  throw new TypeError("Class extends value " + String(r) + " is not a constructor or null");
35
- K(t, r);
32
+ J(t, r);
36
33
  function e() {
37
34
  this.constructor = t;
38
35
  }
39
36
  t.prototype = r === null ? Object.create(r) : (e.prototype = r.prototype, new e());
40
37
  }
41
- function qe(t, r, e, n) {
38
+ function $e(t, r, e, n) {
42
39
  function i(o) {
43
40
  return o instanceof e ? o : new e(function(s) {
44
41
  s(o);
45
42
  });
46
43
  }
47
44
  return new (e || (e = Promise))(function(o, s) {
48
- function u(d) {
45
+ function u(h) {
49
46
  try {
50
- c(n.next(d));
51
- } catch (y) {
52
- s(y);
47
+ c(n.next(h));
48
+ } catch (d) {
49
+ s(d);
53
50
  }
54
51
  }
55
- function a(d) {
52
+ function a(h) {
56
53
  try {
57
- c(n.throw(d));
58
- } catch (y) {
59
- s(y);
54
+ c(n.throw(h));
55
+ } catch (d) {
56
+ s(d);
60
57
  }
61
58
  }
62
- function c(d) {
63
- d.done ? o(d.value) : i(d.value).then(u, a);
59
+ function c(h) {
60
+ h.done ? o(h.value) : i(h.value).then(u, a);
64
61
  }
65
62
  c((n = n.apply(t, r || [])).next());
66
63
  });
67
64
  }
68
- function de(t, r) {
65
+ function le(t, r) {
69
66
  var e = { label: 0, sent: function() {
70
67
  if (o[0] & 1) throw o[1];
71
68
  return o[1];
@@ -74,8 +71,8 @@ function de(t, r) {
74
71
  return this;
75
72
  }), s;
76
73
  function u(c) {
77
- return function(d) {
78
- return a([c, d]);
74
+ return function(h) {
75
+ return a([c, h]);
79
76
  };
80
77
  }
81
78
  function a(c) {
@@ -116,8 +113,8 @@ function de(t, r) {
116
113
  continue;
117
114
  }
118
115
  c = r.call(t, e);
119
- } catch (d) {
120
- c = [6, d], i = 0;
116
+ } catch (h) {
117
+ c = [6, h], i = 0;
121
118
  } finally {
122
119
  n = o = 0;
123
120
  }
@@ -125,7 +122,7 @@ function de(t, r) {
125
122
  return { value: c[0] ? c[1] : void 0, done: !0 };
126
123
  }
127
124
  }
128
- function M(t) {
125
+ function N(t) {
129
126
  var r = typeof Symbol == "function" && Symbol.iterator, e = r && t[r], n = 0;
130
127
  if (e) return e.call(t);
131
128
  if (t && typeof t.length == "number") return {
@@ -135,7 +132,7 @@ function M(t) {
135
132
  };
136
133
  throw new TypeError(r ? "Object is not iterable." : "Symbol.iterator is not defined.");
137
134
  }
138
- function X(t, r) {
135
+ function Z(t, r) {
139
136
  var e = typeof Symbol == "function" && t[Symbol.iterator];
140
137
  if (!e) return t;
141
138
  var n = e.call(t), i, o = [], s;
@@ -152,15 +149,15 @@ function X(t, r) {
152
149
  }
153
150
  return o;
154
151
  }
155
- function ee(t, r, e) {
152
+ function K(t, r, e) {
156
153
  if (e || arguments.length === 2) for (var n = 0, i = r.length, o; n < i; n++)
157
154
  (o || !(n in r)) && (o || (o = Array.prototype.slice.call(r, 0, n)), o[n] = r[n]);
158
155
  return t.concat(o || Array.prototype.slice.call(r));
159
156
  }
160
- function R(t) {
161
- return this instanceof R ? (this.v = t, this) : new R(t);
157
+ function z(t) {
158
+ return this instanceof z ? (this.v = t, this) : new z(t);
162
159
  }
163
- function Ye(t, r, e) {
160
+ function je(t, r, e) {
164
161
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
165
162
  var n = e.apply(t, r || []), i, o = [];
166
163
  return i = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), u("next"), u("throw"), u("return", s), i[Symbol.asyncIterator] = function() {
@@ -168,13 +165,13 @@ function Ye(t, r, e) {
168
165
  }, i;
169
166
  function s(f) {
170
167
  return function(m) {
171
- return Promise.resolve(m).then(f, y);
168
+ return Promise.resolve(m).then(f, d);
172
169
  };
173
170
  }
174
171
  function u(f, m) {
175
172
  n[f] && (i[f] = function(l) {
176
- return new Promise(function(v, b) {
177
- o.push([f, l, v, b]) > 1 || a(f, l);
173
+ return new Promise(function(B, w) {
174
+ o.push([f, l, B, w]) > 1 || a(f, l);
178
175
  });
179
176
  }, m && (i[f] = m(i[f])));
180
177
  }
@@ -182,26 +179,26 @@ function Ye(t, r, e) {
182
179
  try {
183
180
  c(n[f](m));
184
181
  } catch (l) {
185
- g(o[0][3], l);
182
+ b(o[0][3], l);
186
183
  }
187
184
  }
188
185
  function c(f) {
189
- f.value instanceof R ? Promise.resolve(f.value.v).then(d, y) : g(o[0][2], f);
186
+ f.value instanceof z ? Promise.resolve(f.value.v).then(h, d) : b(o[0][2], f);
190
187
  }
191
- function d(f) {
188
+ function h(f) {
192
189
  a("next", f);
193
190
  }
194
- function y(f) {
191
+ function d(f) {
195
192
  a("throw", f);
196
193
  }
197
- function g(f, m) {
194
+ function b(f, m) {
198
195
  f(m), o.shift(), o.length && a(o[0][0], o[0][1]);
199
196
  }
200
197
  }
201
- function Qe(t) {
198
+ function Ge(t) {
202
199
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
203
200
  var r = t[Symbol.asyncIterator], e;
204
- return r ? r.call(t) : (t = typeof M == "function" ? M(t) : t[Symbol.iterator](), e = {}, n("next"), n("throw"), n("return"), e[Symbol.asyncIterator] = function() {
201
+ return r ? r.call(t) : (t = typeof N == "function" ? N(t) : t[Symbol.iterator](), e = {}, n("next"), n("throw"), n("return"), e[Symbol.asyncIterator] = function() {
205
202
  return this;
206
203
  }, e);
207
204
  function n(o) {
@@ -220,13 +217,13 @@ function Qe(t) {
220
217
  function O(t) {
221
218
  return typeof t == "function";
222
219
  }
223
- function me(t) {
220
+ function he(t) {
224
221
  var r = function(n) {
225
222
  Error.call(n), n.stack = new Error().stack;
226
223
  }, e = t(r);
227
224
  return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
228
225
  }
229
- var Y = me(function(t) {
226
+ var q = he(function(t) {
230
227
  return function(e) {
231
228
  t(this), this.message = e ? e.length + ` errors occurred during unsubscription:
232
229
  ` + e.map(function(n, i) {
@@ -235,13 +232,13 @@ var Y = me(function(t) {
235
232
  `) : "", this.name = "UnsubscriptionError", this.errors = e;
236
233
  };
237
234
  });
238
- function oe(t, r) {
235
+ function ne(t, r) {
239
236
  if (t) {
240
237
  var e = t.indexOf(r);
241
238
  0 <= e && t.splice(e, 1);
242
239
  }
243
240
  }
244
- var re = (function() {
241
+ var ee = (function() {
245
242
  function t(r) {
246
243
  this.initialTeardown = r, this.closed = !1, this._parentage = null, this._finalizers = null;
247
244
  }
@@ -253,7 +250,7 @@ var re = (function() {
253
250
  if (s)
254
251
  if (this._parentage = null, Array.isArray(s))
255
252
  try {
256
- for (var u = M(s), a = u.next(); !a.done; a = u.next()) {
253
+ for (var u = N(s), a = u.next(); !a.done; a = u.next()) {
257
254
  var c = a.value;
258
255
  c.remove(this);
259
256
  }
@@ -268,43 +265,43 @@ var re = (function() {
268
265
  }
269
266
  else
270
267
  s.remove(this);
271
- var d = this.initialTeardown;
272
- if (O(d))
268
+ var h = this.initialTeardown;
269
+ if (O(h))
273
270
  try {
274
- d();
271
+ h();
275
272
  } catch (l) {
276
- o = l instanceof Y ? l.errors : [l];
273
+ o = l instanceof q ? l.errors : [l];
277
274
  }
278
- var y = this._finalizers;
279
- if (y) {
275
+ var d = this._finalizers;
276
+ if (d) {
280
277
  this._finalizers = null;
281
278
  try {
282
- for (var g = M(y), f = g.next(); !f.done; f = g.next()) {
279
+ for (var b = N(d), f = b.next(); !f.done; f = b.next()) {
283
280
  var m = f.value;
284
281
  try {
285
- se(m);
282
+ ie(m);
286
283
  } catch (l) {
287
- o = o ?? [], l instanceof Y ? o = ee(ee([], X(o)), X(l.errors)) : o.push(l);
284
+ o = o ?? [], l instanceof q ? o = K(K([], Z(o)), Z(l.errors)) : o.push(l);
288
285
  }
289
286
  }
290
287
  } catch (l) {
291
288
  n = { error: l };
292
289
  } finally {
293
290
  try {
294
- f && !f.done && (i = g.return) && i.call(g);
291
+ f && !f.done && (i = b.return) && i.call(b);
295
292
  } finally {
296
293
  if (n) throw n.error;
297
294
  }
298
295
  }
299
296
  }
300
297
  if (o)
301
- throw new Y(o);
298
+ throw new q(o);
302
299
  }
303
300
  }, t.prototype.add = function(r) {
304
301
  var e;
305
302
  if (r && r !== this)
306
303
  if (this.closed)
307
- se(r);
304
+ ie(r);
308
305
  else {
309
306
  if (r instanceof t) {
310
307
  if (r.closed || r._hasParent(this))
@@ -321,53 +318,53 @@ var re = (function() {
321
318
  this._parentage = Array.isArray(e) ? (e.push(r), e) : e ? [e, r] : r;
322
319
  }, t.prototype._removeParent = function(r) {
323
320
  var e = this._parentage;
324
- e === r ? this._parentage = null : Array.isArray(e) && oe(e, r);
321
+ e === r ? this._parentage = null : Array.isArray(e) && ne(e, r);
325
322
  }, t.prototype.remove = function(r) {
326
323
  var e = this._finalizers;
327
- e && oe(e, r), r instanceof t && r._removeParent(this);
324
+ e && ne(e, r), r instanceof t && r._removeParent(this);
328
325
  }, t.EMPTY = (function() {
329
326
  var r = new t();
330
327
  return r.closed = !0, r;
331
328
  })(), t;
332
329
  })();
333
- re.EMPTY;
334
- function ge(t) {
335
- return t instanceof re || t && "closed" in t && O(t.remove) && O(t.add) && O(t.unsubscribe);
330
+ ee.EMPTY;
331
+ function de(t) {
332
+ return t instanceof ee || t && "closed" in t && O(t.remove) && O(t.add) && O(t.unsubscribe);
336
333
  }
337
- function se(t) {
334
+ function ie(t) {
338
335
  O(t) ? t() : t.unsubscribe();
339
336
  }
340
- var Je = {
337
+ var We = {
341
338
  Promise: void 0
342
- }, Ze = {
339
+ }, qe = {
343
340
  setTimeout: function(t, r) {
344
341
  for (var e = [], n = 2; n < arguments.length; n++)
345
342
  e[n - 2] = arguments[n];
346
- return setTimeout.apply(void 0, ee([t, r], X(e)));
343
+ return setTimeout.apply(void 0, K([t, r], Z(e)));
347
344
  },
348
345
  clearTimeout: function(t) {
349
346
  return clearTimeout(t);
350
347
  },
351
348
  delegate: void 0
352
349
  };
353
- function ye(t) {
354
- Ze.setTimeout(function() {
350
+ function me(t) {
351
+ qe.setTimeout(function() {
355
352
  throw t;
356
353
  });
357
354
  }
358
- function ce() {
355
+ function oe() {
359
356
  }
360
- function Ke(t) {
357
+ function Ye(t) {
361
358
  t();
362
359
  }
363
- var ne = (function(t) {
364
- te(r, t);
360
+ var te = (function(t) {
361
+ X(r, t);
365
362
  function r(e) {
366
363
  var n = t.call(this) || this;
367
- return n.isStopped = !1, e ? (n.destination = e, ge(e) && e.add(n)) : n.destination = tt, n;
364
+ return n.isStopped = !1, e ? (n.destination = e, de(e) && e.add(n)) : n.destination = Ze, n;
368
365
  }
369
366
  return r.create = function(e, n, i) {
370
- return new G(e, n, i);
367
+ return new $(e, n, i);
371
368
  }, r.prototype.next = function(e) {
372
369
  this.isStopped || this._next(e);
373
370
  }, r.prototype.error = function(e) {
@@ -391,7 +388,7 @@ var ne = (function(t) {
391
388
  this.unsubscribe();
392
389
  }
393
390
  }, r;
394
- })(re), Xe = (function() {
391
+ })(ee), Qe = (function() {
395
392
  function t(r) {
396
393
  this.partialObserver = r;
397
394
  }
@@ -401,7 +398,7 @@ var ne = (function(t) {
401
398
  try {
402
399
  e.next(r);
403
400
  } catch (n) {
404
- $(n);
401
+ M(n);
405
402
  }
406
403
  }, t.prototype.error = function(r) {
407
404
  var e = this.partialObserver;
@@ -409,56 +406,56 @@ var ne = (function(t) {
409
406
  try {
410
407
  e.error(r);
411
408
  } catch (n) {
412
- $(n);
409
+ M(n);
413
410
  }
414
411
  else
415
- $(r);
412
+ M(r);
416
413
  }, t.prototype.complete = function() {
417
414
  var r = this.partialObserver;
418
415
  if (r.complete)
419
416
  try {
420
417
  r.complete();
421
418
  } catch (e) {
422
- $(e);
419
+ M(e);
423
420
  }
424
421
  }, t;
425
- })(), G = (function(t) {
426
- te(r, t);
422
+ })(), $ = (function(t) {
423
+ X(r, t);
427
424
  function r(e, n, i) {
428
425
  var o = t.call(this) || this, s;
429
426
  return O(e) || !e ? s = {
430
427
  next: e ?? void 0,
431
428
  error: n ?? void 0,
432
429
  complete: i ?? void 0
433
- } : s = e, o.destination = new Xe(s), o;
430
+ } : s = e, o.destination = new Qe(s), o;
434
431
  }
435
432
  return r;
436
- })(ne);
437
- function $(t) {
438
- ye(t);
433
+ })(te);
434
+ function M(t) {
435
+ me(t);
439
436
  }
440
- function et(t) {
437
+ function Je(t) {
441
438
  throw t;
442
439
  }
443
- var tt = {
440
+ var Ze = {
444
441
  closed: !0,
445
- next: ce,
446
- error: et,
447
- complete: ce
448
- }, ie = (function() {
442
+ next: oe,
443
+ error: Je,
444
+ complete: oe
445
+ }, re = (function() {
449
446
  return typeof Symbol == "function" && Symbol.observable || "@@observable";
450
447
  })();
451
- function be(t) {
448
+ function ge(t) {
452
449
  return t;
453
450
  }
454
- function rt(t) {
455
- return t.length === 0 ? be : t.length === 1 ? t[0] : function(e) {
451
+ function Ke(t) {
452
+ return t.length === 0 ? ge : t.length === 1 ? t[0] : function(e) {
456
453
  return t.reduce(function(n, i) {
457
454
  return i(n);
458
455
  }, e);
459
456
  };
460
457
  }
461
- var P = (function() {
458
+ var _ = (function() {
462
459
  function t(r) {
463
460
  r && (this._subscribe = r);
464
461
  }
@@ -466,8 +463,8 @@ var P = (function() {
466
463
  var e = new t();
467
464
  return e.source = this, e.operator = r, e;
468
465
  }, t.prototype.subscribe = function(r, e, n) {
469
- var i = this, o = it(r) ? r : new G(r, e, n);
470
- return Ke(function() {
466
+ var i = this, o = et(r) ? r : new $(r, e, n);
467
+ return Ye(function() {
471
468
  var s = i, u = s.operator, a = s.source;
472
469
  o.add(u ? u.call(o, a) : a ? i._subscribe(o) : i._trySubscribe(o));
473
470
  }), o;
@@ -479,8 +476,8 @@ var P = (function() {
479
476
  }
480
477
  }, t.prototype.forEach = function(r, e) {
481
478
  var n = this;
482
- return e = ae(e), new e(function(i, o) {
483
- var s = new G({
479
+ return e = se(e), new e(function(i, o) {
480
+ var s = new $({
484
481
  next: function(u) {
485
482
  try {
486
483
  r(u);
@@ -496,15 +493,15 @@ var P = (function() {
496
493
  }, t.prototype._subscribe = function(r) {
497
494
  var e;
498
495
  return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(r);
499
- }, t.prototype[ie] = function() {
496
+ }, t.prototype[re] = function() {
500
497
  return this;
501
498
  }, t.prototype.pipe = function() {
502
499
  for (var r = [], e = 0; e < arguments.length; e++)
503
500
  r[e] = arguments[e];
504
- return rt(r)(this);
501
+ return Ke(r)(this);
505
502
  }, t.prototype.toPromise = function(r) {
506
503
  var e = this;
507
- return r = ae(r), new r(function(n, i) {
504
+ return r = se(r), new r(function(n, i) {
508
505
  var o;
509
506
  e.subscribe(function(s) {
510
507
  return o = s;
@@ -518,22 +515,22 @@ var P = (function() {
518
515
  return new t(r);
519
516
  }, t;
520
517
  })();
521
- function ae(t) {
518
+ function se(t) {
522
519
  var r;
523
- return (r = t ?? Je.Promise) !== null && r !== void 0 ? r : Promise;
520
+ return (r = t ?? We.Promise) !== null && r !== void 0 ? r : Promise;
524
521
  }
525
- function nt(t) {
522
+ function Xe(t) {
526
523
  return t && O(t.next) && O(t.error) && O(t.complete);
527
524
  }
528
- function it(t) {
529
- return t && t instanceof ne || nt(t) && ge(t);
525
+ function et(t) {
526
+ return t && t instanceof te || Xe(t) && de(t);
530
527
  }
531
- function ot(t) {
532
- return O(t == null ? void 0 : t.lift);
528
+ function tt(t) {
529
+ return O(t?.lift);
533
530
  }
534
- function N(t) {
531
+ function R(t) {
535
532
  return function(r) {
536
- if (ot(r))
533
+ if (tt(r))
537
534
  return r.lift(function(e) {
538
535
  try {
539
536
  return t(e, this);
@@ -544,24 +541,24 @@ function N(t) {
544
541
  throw new TypeError("Unable to lift unknown Observable type");
545
542
  };
546
543
  }
547
- function H(t, r, e, n, i) {
548
- return new st(t, r, e, n, i);
544
+ function L(t, r, e, n, i) {
545
+ return new rt(t, r, e, n, i);
549
546
  }
550
- var st = (function(t) {
551
- te(r, t);
547
+ var rt = (function(t) {
548
+ X(r, t);
552
549
  function r(e, n, i, o, s, u) {
553
550
  var a = t.call(this, e) || this;
554
551
  return a.onFinalize = s, a.shouldUnsubscribe = u, a._next = n ? function(c) {
555
552
  try {
556
553
  n(c);
557
- } catch (d) {
558
- e.error(d);
554
+ } catch (h) {
555
+ e.error(h);
559
556
  }
560
557
  } : t.prototype._next, a._error = o ? function(c) {
561
558
  try {
562
559
  o(c);
563
- } catch (d) {
564
- e.error(d);
560
+ } catch (h) {
561
+ e.error(h);
565
562
  } finally {
566
563
  this.unsubscribe();
567
564
  }
@@ -582,60 +579,60 @@ var st = (function(t) {
582
579
  t.prototype.unsubscribe.call(this), !n && ((e = this.onFinalize) === null || e === void 0 || e.call(this));
583
580
  }
584
581
  }, r;
585
- })(ne), ct = new P(function(t) {
582
+ })(te), nt = new _(function(t) {
586
583
  return t.complete();
587
584
  });
588
- function at(t) {
585
+ function it(t) {
589
586
  return t && O(t.schedule);
590
587
  }
591
- function pe(t) {
588
+ function ye(t) {
592
589
  return t[t.length - 1];
593
590
  }
594
- function ut(t) {
595
- return at(pe(t)) ? t.pop() : void 0;
591
+ function ot(t) {
592
+ return it(ye(t)) ? t.pop() : void 0;
596
593
  }
597
- function ft(t, r) {
598
- return typeof pe(t) == "number" ? t.pop() : r;
594
+ function st(t, r) {
595
+ return typeof ye(t) == "number" ? t.pop() : r;
599
596
  }
600
- var we = (function(t) {
597
+ var be = (function(t) {
601
598
  return t && typeof t.length == "number" && typeof t != "function";
602
599
  });
603
- function ve(t) {
604
- return O(t == null ? void 0 : t.then);
600
+ function pe(t) {
601
+ return O(t?.then);
605
602
  }
606
- function Se(t) {
607
- return O(t[ie]);
603
+ function we(t) {
604
+ return O(t[re]);
608
605
  }
609
- function xe(t) {
610
- return Symbol.asyncIterator && O(t == null ? void 0 : t[Symbol.asyncIterator]);
606
+ function ve(t) {
607
+ return Symbol.asyncIterator && O(t?.[Symbol.asyncIterator]);
611
608
  }
612
- function Ie(t) {
609
+ function Se(t) {
613
610
  return new TypeError("You provided " + (t !== null && typeof t == "object" ? "an invalid object" : "'" + t + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
614
611
  }
615
- function lt() {
612
+ function ct() {
616
613
  return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator;
617
614
  }
618
- var Be = lt();
619
- function Ue(t) {
620
- return O(t == null ? void 0 : t[Be]);
615
+ var xe = ct();
616
+ function Ie(t) {
617
+ return O(t?.[xe]);
621
618
  }
622
- function Oe(t) {
623
- return Ye(this, arguments, function() {
619
+ function Be(t) {
620
+ return je(this, arguments, function() {
624
621
  var e, n, i, o;
625
- return de(this, function(s) {
622
+ return le(this, function(s) {
626
623
  switch (s.label) {
627
624
  case 0:
628
625
  e = t.getReader(), s.label = 1;
629
626
  case 1:
630
627
  s.trys.push([1, , 9, 10]), s.label = 2;
631
628
  case 2:
632
- return [4, R(e.read())];
629
+ return [4, z(e.read())];
633
630
  case 3:
634
- return n = s.sent(), i = n.value, o = n.done, o ? [4, R(void 0)] : [3, 5];
631
+ return n = s.sent(), i = n.value, o = n.done, o ? [4, z(void 0)] : [3, 5];
635
632
  case 4:
636
633
  return [2, s.sent()];
637
634
  case 5:
638
- return [4, R(i)];
635
+ return [4, z(i)];
639
636
  case 6:
640
637
  return [4, s.sent()];
641
638
  case 7:
@@ -650,57 +647,57 @@ function Oe(t) {
650
647
  });
651
648
  });
652
649
  }
653
- function ke(t) {
654
- return O(t == null ? void 0 : t.getReader);
650
+ function Ue(t) {
651
+ return O(t?.getReader);
655
652
  }
656
- function L(t) {
657
- if (t instanceof P)
653
+ function D(t) {
654
+ if (t instanceof _)
658
655
  return t;
659
656
  if (t != null) {
660
- if (Se(t))
661
- return ht(t);
662
657
  if (we(t))
663
- return dt(t);
658
+ return at(t);
659
+ if (be(t))
660
+ return ut(t);
661
+ if (pe(t))
662
+ return ft(t);
664
663
  if (ve(t))
665
- return mt(t);
666
- if (xe(t))
667
- return Ee(t);
664
+ return Oe(t);
665
+ if (Ie(t))
666
+ return lt(t);
668
667
  if (Ue(t))
669
- return gt(t);
670
- if (ke(t))
671
- return yt(t);
668
+ return ht(t);
672
669
  }
673
- throw Ie(t);
670
+ throw Se(t);
674
671
  }
675
- function ht(t) {
676
- return new P(function(r) {
677
- var e = t[ie]();
672
+ function at(t) {
673
+ return new _(function(r) {
674
+ var e = t[re]();
678
675
  if (O(e.subscribe))
679
676
  return e.subscribe(r);
680
677
  throw new TypeError("Provided object does not correctly implement Symbol.observable");
681
678
  });
682
679
  }
683
- function dt(t) {
684
- return new P(function(r) {
680
+ function ut(t) {
681
+ return new _(function(r) {
685
682
  for (var e = 0; e < t.length && !r.closed; e++)
686
683
  r.next(t[e]);
687
684
  r.complete();
688
685
  });
689
686
  }
690
- function mt(t) {
691
- return new P(function(r) {
687
+ function ft(t) {
688
+ return new _(function(r) {
692
689
  t.then(function(e) {
693
690
  r.closed || (r.next(e), r.complete());
694
691
  }, function(e) {
695
692
  return r.error(e);
696
- }).then(null, ye);
693
+ }).then(null, me);
697
694
  });
698
695
  }
699
- function gt(t) {
700
- return new P(function(r) {
696
+ function lt(t) {
697
+ return new _(function(r) {
701
698
  var e, n;
702
699
  try {
703
- for (var i = M(t), o = i.next(); !o.done; o = i.next()) {
700
+ for (var i = N(t), o = i.next(); !o.done; o = i.next()) {
704
701
  var s = o.value;
705
702
  if (r.next(s), r.closed)
706
703
  return;
@@ -717,24 +714,24 @@ function gt(t) {
717
714
  r.complete();
718
715
  });
719
716
  }
720
- function Ee(t) {
721
- return new P(function(r) {
722
- bt(t, r).catch(function(e) {
717
+ function Oe(t) {
718
+ return new _(function(r) {
719
+ dt(t, r).catch(function(e) {
723
720
  return r.error(e);
724
721
  });
725
722
  });
726
723
  }
727
- function yt(t) {
728
- return Ee(Oe(t));
724
+ function ht(t) {
725
+ return Oe(Be(t));
729
726
  }
730
- function bt(t, r) {
727
+ function dt(t, r) {
731
728
  var e, n, i, o;
732
- return qe(this, void 0, void 0, function() {
729
+ return $e(this, void 0, void 0, function() {
733
730
  var s, u;
734
- return de(this, function(a) {
731
+ return le(this, function(a) {
735
732
  switch (a.label) {
736
733
  case 0:
737
- a.trys.push([0, 5, 6, 11]), e = Qe(t), a.label = 1;
734
+ a.trys.push([0, 5, 6, 11]), e = Ge(t), a.label = 1;
738
735
  case 1:
739
736
  return [4, e.next()];
740
737
  case 2:
@@ -765,7 +762,7 @@ function bt(t, r) {
765
762
  });
766
763
  });
767
764
  }
768
- function z(t, r, e, n, i) {
765
+ function V(t, r, e, n, i) {
769
766
  n === void 0 && (n = 0), i === void 0 && (i = !1);
770
767
  var o = r.schedule(function() {
771
768
  e(), i ? t.add(this.schedule(null, n)) : this.unsubscribe();
@@ -773,49 +770,49 @@ function z(t, r, e, n, i) {
773
770
  if (t.add(o), !i)
774
771
  return o;
775
772
  }
776
- function Te(t, r) {
777
- return r === void 0 && (r = 0), N(function(e, n) {
778
- e.subscribe(H(n, function(i) {
779
- return z(n, t, function() {
773
+ function ke(t, r) {
774
+ return r === void 0 && (r = 0), R(function(e, n) {
775
+ e.subscribe(L(n, function(i) {
776
+ return V(n, t, function() {
780
777
  return n.next(i);
781
778
  }, r);
782
779
  }, function() {
783
- return z(n, t, function() {
780
+ return V(n, t, function() {
784
781
  return n.complete();
785
782
  }, r);
786
783
  }, function(i) {
787
- return z(n, t, function() {
784
+ return V(n, t, function() {
788
785
  return n.error(i);
789
786
  }, r);
790
787
  }));
791
788
  });
792
789
  }
793
- function _e(t, r) {
794
- return r === void 0 && (r = 0), N(function(e, n) {
790
+ function Ee(t, r) {
791
+ return r === void 0 && (r = 0), R(function(e, n) {
795
792
  n.add(t.schedule(function() {
796
793
  return e.subscribe(n);
797
794
  }, r));
798
795
  });
799
796
  }
800
- function pt(t, r) {
801
- return L(t).pipe(_e(r), Te(r));
797
+ function mt(t, r) {
798
+ return D(t).pipe(Ee(r), ke(r));
802
799
  }
803
- function wt(t, r) {
804
- return L(t).pipe(_e(r), Te(r));
800
+ function gt(t, r) {
801
+ return D(t).pipe(Ee(r), ke(r));
805
802
  }
806
- function vt(t, r) {
807
- return new P(function(e) {
803
+ function yt(t, r) {
804
+ return new _(function(e) {
808
805
  var n = 0;
809
806
  return r.schedule(function() {
810
807
  n === t.length ? e.complete() : (e.next(t[n++]), e.closed || this.schedule());
811
808
  });
812
809
  });
813
810
  }
814
- function St(t, r) {
815
- return new P(function(e) {
811
+ function bt(t, r) {
812
+ return new _(function(e) {
816
813
  var n;
817
- return z(e, r, function() {
818
- n = t[Be](), z(e, r, function() {
814
+ return V(e, r, function() {
815
+ n = t[xe](), V(e, r, function() {
819
816
  var i, o, s;
820
817
  try {
821
818
  i = n.next(), o = i.value, s = i.done;
@@ -826,17 +823,17 @@ function St(t, r) {
826
823
  s ? e.complete() : e.next(o);
827
824
  }, 0, !0);
828
825
  }), function() {
829
- return O(n == null ? void 0 : n.return) && n.return();
826
+ return O(n?.return) && n.return();
830
827
  };
831
828
  });
832
829
  }
833
- function Ce(t, r) {
830
+ function Te(t, r) {
834
831
  if (!t)
835
832
  throw new Error("Iterable cannot be null");
836
- return new P(function(e) {
837
- z(e, r, function() {
833
+ return new _(function(e) {
834
+ V(e, r, function() {
838
835
  var n = t[Symbol.asyncIterator]();
839
- z(e, r, function() {
836
+ V(e, r, function() {
840
837
  n.next().then(function(i) {
841
838
  i.done ? e.complete() : e.next(i.value);
842
839
  });
@@ -844,132 +841,132 @@ function Ce(t, r) {
844
841
  });
845
842
  });
846
843
  }
847
- function xt(t, r) {
848
- return Ce(Oe(t), r);
844
+ function pt(t, r) {
845
+ return Te(Be(t), r);
849
846
  }
850
- function It(t, r) {
847
+ function wt(t, r) {
851
848
  if (t != null) {
852
- if (Se(t))
853
- return pt(t, r);
854
849
  if (we(t))
855
- return vt(t, r);
850
+ return mt(t, r);
851
+ if (be(t))
852
+ return yt(t, r);
853
+ if (pe(t))
854
+ return gt(t, r);
856
855
  if (ve(t))
857
- return wt(t, r);
858
- if (xe(t))
859
- return Ce(t, r);
856
+ return Te(t, r);
857
+ if (Ie(t))
858
+ return bt(t, r);
860
859
  if (Ue(t))
861
- return St(t, r);
862
- if (ke(t))
863
- return xt(t, r);
860
+ return pt(t, r);
864
861
  }
865
- throw Ie(t);
862
+ throw Se(t);
866
863
  }
867
- function Bt(t, r) {
868
- return r ? It(t, r) : L(t);
864
+ function vt(t, r) {
865
+ return r ? wt(t, r) : D(t);
869
866
  }
870
- var Ut = me(function(t) {
867
+ var St = he(function(t) {
871
868
  return function() {
872
869
  t(this), this.name = "EmptyError", this.message = "no elements in sequence";
873
870
  };
874
871
  });
875
- function Pe(t, r) {
872
+ function _e(t, r) {
876
873
  return new Promise(function(e, n) {
877
- var i = new G({
874
+ var i = new $({
878
875
  next: function(o) {
879
876
  e(o), i.unsubscribe();
880
877
  },
881
878
  error: n,
882
879
  complete: function() {
883
- n(new Ut());
880
+ n(new St());
884
881
  }
885
882
  });
886
883
  t.subscribe(i);
887
884
  });
888
885
  }
889
- function Ve(t, r) {
890
- return N(function(e, n) {
886
+ function Ce(t, r) {
887
+ return R(function(e, n) {
891
888
  var i = 0;
892
- e.subscribe(H(n, function(o) {
889
+ e.subscribe(L(n, function(o) {
893
890
  n.next(t.call(r, o, i++));
894
891
  }));
895
892
  });
896
893
  }
897
- function Ot(t, r, e, n, i, o, s, u) {
898
- var a = [], c = 0, d = 0, y = !1, g = function() {
899
- y && !a.length && !c && r.complete();
894
+ function xt(t, r, e, n, i, o, s, u) {
895
+ var a = [], c = 0, h = 0, d = !1, b = function() {
896
+ d && !a.length && !c && r.complete();
900
897
  }, f = function(l) {
901
898
  return c < n ? m(l) : a.push(l);
902
899
  }, m = function(l) {
903
900
  c++;
904
- var v = !1;
905
- L(e(l, d++)).subscribe(H(r, function(b) {
906
- r.next(b);
901
+ var B = !1;
902
+ D(e(l, h++)).subscribe(L(r, function(w) {
903
+ r.next(w);
907
904
  }, function() {
908
- v = !0;
905
+ B = !0;
909
906
  }, void 0, function() {
910
- if (v)
907
+ if (B)
911
908
  try {
912
909
  c--;
913
- for (var b = function() {
910
+ for (var w = function() {
914
911
  var S = a.shift();
915
912
  s || m(S);
916
913
  }; a.length && c < n; )
917
- b();
918
- g();
914
+ w();
915
+ b();
919
916
  } catch (S) {
920
917
  r.error(S);
921
918
  }
922
919
  }));
923
920
  };
924
- return t.subscribe(H(r, f, function() {
925
- y = !0, g();
921
+ return t.subscribe(L(r, f, function() {
922
+ d = !0, b();
926
923
  })), function() {
927
924
  };
928
925
  }
929
- function Ae(t, r, e) {
930
- return e === void 0 && (e = 1 / 0), O(r) ? Ae(function(n, i) {
931
- return Ve(function(o, s) {
926
+ function Pe(t, r, e) {
927
+ return e === void 0 && (e = 1 / 0), O(r) ? Pe(function(n, i) {
928
+ return Ce(function(o, s) {
932
929
  return r(n, o, i, s);
933
- })(L(t(n, i)));
934
- }, e) : (typeof r == "number" && (e = r), N(function(n, i) {
935
- return Ot(n, i, t, e);
930
+ })(D(t(n, i)));
931
+ }, e) : (typeof r == "number" && (e = r), R(function(n, i) {
932
+ return xt(n, i, t, e);
936
933
  }));
937
934
  }
938
- function kt(t) {
939
- return t === void 0 && (t = 1 / 0), Ae(be, t);
935
+ function It(t) {
936
+ return t === void 0 && (t = 1 / 0), Pe(ge, t);
940
937
  }
941
- function Et() {
938
+ function Bt() {
942
939
  for (var t = [], r = 0; r < arguments.length; r++)
943
940
  t[r] = arguments[r];
944
- var e = ut(t), n = ft(t, 1 / 0), i = t;
945
- return i.length ? i.length === 1 ? L(i[0]) : kt(n)(Bt(i, e)) : ct;
941
+ var e = ot(t), n = st(t, 1 / 0), i = t;
942
+ return i.length ? i.length === 1 ? D(i[0]) : It(n)(vt(i, e)) : nt;
946
943
  }
947
- function Tt(t, r, e, n, i) {
944
+ function Ut(t, r, e, n, i) {
948
945
  return function(o, s) {
949
946
  var u = e, a = r, c = 0;
950
- o.subscribe(H(s, function(d) {
951
- var y = c++;
952
- a = u ? t(a, d, y) : (u = !0, d);
947
+ o.subscribe(L(s, function(h) {
948
+ var d = c++;
949
+ a = u ? t(a, h, d) : (u = !0, h);
953
950
  }, (function() {
954
951
  u && s.next(a), s.complete();
955
952
  })));
956
953
  };
957
954
  }
958
- function ze(t, r) {
959
- return N(Tt(t, r, arguments.length >= 2, !1, !0));
955
+ function Ve(t, r) {
956
+ return R(Ut(t, r, arguments.length >= 2, !1, !0));
960
957
  }
961
- var _t = function(t, r) {
958
+ var Ot = function(t, r) {
962
959
  return t.push(r), t;
963
960
  };
964
- function Ct() {
965
- return N(function(t, r) {
966
- ze(_t, [])(t).subscribe(r);
961
+ function kt() {
962
+ return R(function(t, r) {
963
+ Ve(Ot, [])(t).subscribe(r);
967
964
  });
968
965
  }
969
- var Q, ue;
970
- function Pt() {
971
- if (ue) return Q;
972
- ue = 1;
966
+ var Y, ce;
967
+ function Et() {
968
+ if (ce) return Y;
969
+ ce = 1;
973
970
  class t {
974
971
  constructor(e = {}) {
975
972
  if (!(e.maxSize && e.maxSize > 0))
@@ -1029,13 +1026,13 @@ function Pt() {
1029
1026
  return this._size + e;
1030
1027
  }
1031
1028
  }
1032
- return Q = t, Q;
1029
+ return Y = t, Y;
1033
1030
  }
1034
- var Vt = Pt();
1035
- const Fe = /* @__PURE__ */ je(Vt);
1036
- class D {
1031
+ var Tt = Et();
1032
+ const Ae = /* @__PURE__ */ Le(Tt);
1033
+ class F {
1034
+ ranges;
1037
1035
  constructor(r) {
1038
- E(this, "ranges");
1039
1036
  this.ranges = r;
1040
1037
  }
1041
1038
  get min() {
@@ -1054,7 +1051,7 @@ class D {
1054
1051
  return this.ranges.length > 1;
1055
1052
  }
1056
1053
  getRanges() {
1057
- return this.ranges.map((r) => new D([{ min: r.min, max: r.max }]));
1054
+ return this.ranges.map((r) => new F([{ min: r.min, max: r.max }]));
1058
1055
  }
1059
1056
  toString() {
1060
1057
  return this.ranges.map((r) => `[${r.min}-${r.max}]`).join(",");
@@ -1063,21 +1060,20 @@ class D {
1063
1060
  const e = [...this.getRanges(), ...r.getRanges()].sort((o, s) => o.min < s.min ? -1 : o.min > s.min ? 1 : o.max < s.max ? -1 : s.max > o.max ? 1 : 0), n = [];
1064
1061
  let i = e[0];
1065
1062
  for (const o of e)
1066
- o.min > i.max + 1 ? (n.push(i), i = o) : o.max > i.max && (i = new D([{ min: i.min, max: o.max }]));
1067
- return n.push(i), n.length === 1 ? n[0] : new D(n);
1063
+ o.min > i.max + 1 ? (n.push(i), i = o) : o.max > i.max && (i = new F([{ min: i.min, max: o.max }]));
1064
+ return n.push(i), n.length === 1 ? n[0] : new F(n);
1068
1065
  }
1069
1066
  }
1070
- function At(t) {
1071
- return $e(t.subarray(2), void 0);
1067
+ function _t(t) {
1068
+ return Ne(t.subarray(2), void 0);
1072
1069
  }
1073
- class zt extends Error {
1074
- constructor(e) {
1075
- super(e);
1076
- E(this, "code");
1077
- this.code = "ERR_ABORTED";
1070
+ class Ct extends Error {
1071
+ code;
1072
+ constructor(r) {
1073
+ super(r), this.code = "ERR_ABORTED";
1078
1074
  }
1079
1075
  }
1080
- function Ft(t) {
1076
+ function Pt(t) {
1081
1077
  t.sort((i, o) => i.offset - o.offset);
1082
1078
  const r = [];
1083
1079
  let e, n;
@@ -1089,30 +1085,30 @@ function Ft(t) {
1089
1085
  }), n = e.offset + e.length;
1090
1086
  return r;
1091
1087
  }
1092
- function j(t) {
1088
+ function H(t) {
1093
1089
  if (t && t.aborted)
1094
1090
  if (typeof DOMException > "u") {
1095
- const r = new zt("aborted");
1091
+ const r = new Ct("aborted");
1096
1092
  throw r.code = "ERR_ABORTED", r;
1097
1093
  } else
1098
1094
  throw new DOMException("aborted", "AbortError");
1099
1095
  }
1100
- const J = typeof TextDecoder < "u" ? new TextDecoder("utf8") : void 0;
1101
- function Z(t, r, e, n) {
1096
+ const Vt = typeof TextDecoder < "u" ? new TextDecoder("utf8") : void 0;
1097
+ function Q(t, r, e, n) {
1102
1098
  return t < n && r >= e;
1103
1099
  }
1104
- class Re {
1100
+ class ze {
1101
+ bbi;
1102
+ refsByName;
1103
+ cirTreeOffset;
1104
+ isCompressed;
1105
+ blockType;
1106
+ cirTreePromise;
1107
+ featureCache = new ue({
1108
+ cache: new Ae({ maxSize: 1e3 }),
1109
+ fill: async ({ length: r, offset: e }, n) => this.bbi.read(r, e, { signal: n })
1110
+ });
1105
1111
  constructor(r, e, n, i, o) {
1106
- E(this, "bbi");
1107
- E(this, "refsByName");
1108
- E(this, "cirTreeOffset");
1109
- E(this, "isCompressed");
1110
- E(this, "blockType");
1111
- E(this, "cirTreePromise");
1112
- E(this, "featureCache", new le({
1113
- cache: new Fe({ maxSize: 1e3 }),
1114
- fill: async ({ length: r, offset: e }, n) => this.bbi.read(r, e, { signal: n })
1115
- }));
1116
1112
  if (this.bbi = r, this.refsByName = e, this.cirTreeOffset = n, this.isCompressed = i, this.blockType = o, !(n >= 0))
1117
1113
  throw new Error("invalid cirTreeOffset!");
1118
1114
  }
@@ -1122,111 +1118,111 @@ class Re {
1122
1118
  s === void 0 && i.complete();
1123
1119
  const u = { chrId: s, start: e, end: n };
1124
1120
  this.cirTreePromise || (this.cirTreePromise = this.bbi.read(48, this.cirTreeOffset, o));
1125
- const a = await this.cirTreePromise, d = new DataView(a.buffer).getUint32(4, !0);
1126
- let y = [], g = 0;
1127
- const f = (b, S, B) => {
1121
+ const a = await this.cirTreePromise, h = new DataView(a.buffer).getUint32(4, !0);
1122
+ let d = [], b = 0;
1123
+ const f = (w, S, x) => {
1128
1124
  try {
1129
- const p = b.subarray(S), w = new DataView(p.buffer, p.byteOffset, p.length);
1130
- let h = 0;
1131
- const U = w.getUint8(h);
1132
- h += 2;
1133
- const T = w.getUint16(h, !0);
1134
- if (h += 2, U === 1) {
1135
- const _ = [];
1125
+ const p = w.subarray(S), g = new DataView(p.buffer, p.byteOffset, p.length);
1126
+ let y = 0;
1127
+ const U = g.getUint8(y);
1128
+ y += 2;
1129
+ const T = g.getUint16(y, !0);
1130
+ if (y += 2, U === 1) {
1131
+ const k = [];
1136
1132
  for (let I = 0; I < T; I++) {
1137
- const k = w.getUint32(h, !0);
1138
- h += 4;
1139
- const C = w.getUint32(h, !0);
1140
- h += 4;
1141
- const V = w.getUint32(h, !0);
1142
- h += 4;
1143
- const A = w.getUint32(h, !0);
1144
- h += 4;
1145
- const W = Number(w.getBigUint64(h, !0));
1146
- h += 8;
1147
- const q = Number(w.getBigUint64(h, !0));
1148
- h += 8, _.push({
1149
- startChrom: k,
1133
+ const E = g.getUint32(y, !0);
1134
+ y += 4;
1135
+ const C = g.getUint32(y, !0);
1136
+ y += 4;
1137
+ const P = g.getUint32(y, !0);
1138
+ y += 4;
1139
+ const j = g.getUint32(y, !0);
1140
+ y += 4;
1141
+ const G = Number(g.getBigUint64(y, !0));
1142
+ y += 8;
1143
+ const W = Number(g.getBigUint64(y, !0));
1144
+ y += 8, k.push({
1145
+ startChrom: E,
1150
1146
  startBase: C,
1151
- endBase: A,
1152
- endChrom: V,
1153
- blockOffset: W,
1154
- blockSize: q,
1155
- offset: h
1147
+ endBase: j,
1148
+ endChrom: P,
1149
+ blockOffset: G,
1150
+ blockSize: W,
1151
+ offset: y
1156
1152
  });
1157
1153
  }
1158
- y = y.concat(_.filter((I) => m(I)).map((I) => ({
1154
+ d = d.concat(k.filter((I) => m(I)).map((I) => ({
1159
1155
  offset: I.blockOffset,
1160
1156
  length: I.blockSize
1161
1157
  })));
1162
1158
  } else if (U === 0) {
1163
- const _ = [];
1164
- for (let k = 0; k < T; k++) {
1165
- const C = w.getUint32(h, !0);
1166
- h += 4;
1167
- const V = w.getUint32(h, !0);
1168
- h += 4;
1169
- const A = w.getUint32(h, !0);
1170
- h += 4;
1171
- const W = w.getUint32(h, !0);
1172
- h += 4;
1173
- const q = Number(w.getBigUint64(h, !0));
1174
- h += 8, _.push({
1159
+ const k = [];
1160
+ for (let E = 0; E < T; E++) {
1161
+ const C = g.getUint32(y, !0);
1162
+ y += 4;
1163
+ const P = g.getUint32(y, !0);
1164
+ y += 4;
1165
+ const j = g.getUint32(y, !0);
1166
+ y += 4;
1167
+ const G = g.getUint32(y, !0);
1168
+ y += 4;
1169
+ const W = Number(g.getBigUint64(y, !0));
1170
+ y += 8, k.push({
1175
1171
  startChrom: C,
1176
- startBase: V,
1177
- endChrom: A,
1178
- endBase: W,
1179
- blockOffset: q,
1180
- offset: h
1172
+ startBase: P,
1173
+ endChrom: j,
1174
+ endBase: G,
1175
+ blockOffset: W,
1176
+ offset: y
1181
1177
  });
1182
1178
  }
1183
- const I = _.filter((k) => m(k)).map((k) => k.blockOffset);
1184
- I.length > 0 && v(I, B + 1);
1179
+ const I = k.filter((E) => m(E)).map((E) => E.blockOffset);
1180
+ I.length > 0 && B(I, x + 1);
1185
1181
  }
1186
- } catch (x) {
1187
- i.error(x);
1182
+ } catch (v) {
1183
+ i.error(v);
1188
1184
  }
1189
- }, m = (b) => {
1190
- const { startChrom: S, startBase: B, endChrom: x, endBase: p } = b;
1191
- return (S < s || S === s && B <= n) && (x > s || x === s && p >= e);
1192
- }, l = async (b, S, B) => {
1185
+ }, m = (w) => {
1186
+ const { startChrom: S, startBase: x, endChrom: v, endBase: p } = w;
1187
+ return (S < s || S === s && x <= n) && (v > s || v === s && p >= e);
1188
+ }, l = async (w, S, x) => {
1193
1189
  try {
1194
- const x = S.max - S.min, p = S.min, w = await this.featureCache.get(`${x}_${p}`, { length: x, offset: p }, o == null ? void 0 : o.signal);
1195
- for (const h of b)
1196
- S.contains(h) && (f(w, h - p, B), g -= 1, g === 0 && this.readFeatures(i, y, {
1190
+ const v = S.max - S.min, p = S.min, g = await this.featureCache.get(`${v}_${p}`, { length: v, offset: p }, o?.signal);
1191
+ for (const y of w)
1192
+ S.contains(y) && (f(g, y - p, x), b -= 1, b === 0 && this.readFeatures(i, d, {
1197
1193
  ...o,
1198
1194
  request: u
1199
1195
  }).catch((U) => {
1200
1196
  i.error(U);
1201
1197
  }));
1202
- } catch (x) {
1203
- i.error(x);
1198
+ } catch (v) {
1199
+ i.error(v);
1204
1200
  }
1205
- }, v = (b, S) => {
1201
+ }, B = (w, S) => {
1206
1202
  try {
1207
- g += b.length;
1208
- const B = 4 + d * 32;
1209
- let x = new D([
1203
+ b += w.length;
1204
+ const x = 4 + h * 32;
1205
+ let v = new F([
1210
1206
  {
1211
- min: b[0],
1212
- max: b[0] + B
1207
+ min: w[0],
1208
+ max: w[0] + x
1213
1209
  }
1214
1210
  ]);
1215
- for (let p = 1; p < b.length; p += 1) {
1216
- const w = new D([
1211
+ for (let p = 1; p < w.length; p += 1) {
1212
+ const g = new F([
1217
1213
  {
1218
- min: b[p],
1219
- max: b[p] + B
1214
+ min: w[p],
1215
+ max: w[p] + x
1220
1216
  }
1221
1217
  ]);
1222
- x = x.union(w);
1218
+ v = v.union(g);
1223
1219
  }
1224
- x.getRanges().map((p) => l(b, p, S));
1225
- } catch (B) {
1226
- i.error(B);
1220
+ v.getRanges().map((p) => l(w, p, S));
1221
+ } catch (x) {
1222
+ i.error(x);
1227
1223
  }
1228
1224
  };
1229
- v([this.cirTreeOffset + 48], 1);
1225
+ B([this.cirTreeOffset + 48], 1);
1230
1226
  return;
1231
1227
  } catch (s) {
1232
1228
  i.error(s);
@@ -1243,20 +1239,20 @@ class Re {
1243
1239
  o += 4;
1244
1240
  const c = s.getUint32(o, !0);
1245
1241
  o += 4;
1246
- const d = s.getUint32(o, !0);
1242
+ const h = s.getUint32(o, !0);
1247
1243
  o += 4;
1248
- const y = s.getFloat32(o, !0);
1244
+ const d = s.getFloat32(o, !0);
1249
1245
  o += 4;
1250
- const g = s.getFloat32(o, !0);
1246
+ const b = s.getFloat32(o, !0);
1251
1247
  o += 4;
1252
1248
  const f = s.getFloat32(o, !0);
1253
- o += 4, o += 4, (!n || u === n.chrId && Z(a, c, n.start, n.end)) && i.push({
1249
+ o += 4, o += 4, (!n || u === n.chrId && Q(a, c, n.start, n.end)) && i.push({
1254
1250
  start: a,
1255
1251
  end: c,
1256
- maxScore: g,
1257
- minScore: y,
1252
+ maxScore: b,
1253
+ minScore: d,
1258
1254
  summary: !0,
1259
- score: f / (d || 1)
1255
+ score: f / (h || 1)
1260
1256
  });
1261
1257
  }
1262
1258
  return i;
@@ -1266,25 +1262,25 @@ class Re {
1266
1262
  let s = e;
1267
1263
  const u = r, a = new DataView(u.buffer, u.byteOffset, u.length);
1268
1264
  for (; s < r.byteLength; ) {
1269
- const c = s, d = a.getUint32(s, !0);
1265
+ const c = s, h = a.getUint32(s, !0);
1270
1266
  s += 4;
1271
- const y = a.getInt32(s, !0);
1267
+ const d = a.getInt32(s, !0);
1272
1268
  s += 4;
1273
- const g = a.getInt32(s, !0);
1269
+ const b = a.getInt32(s, !0);
1274
1270
  s += 4;
1275
1271
  let f = s;
1276
1272
  for (; f < r.length && r[f] !== 0; f++)
1277
1273
  ;
1278
- const m = r.subarray(s, f), l = (J == null ? void 0 : J.decode(m)) ?? m.toString();
1274
+ const m = r.subarray(s, f), l = Vt?.decode(m) ?? m.toString();
1279
1275
  s = f + 1, o.push({
1280
- chromId: d,
1281
- start: y,
1282
- end: g,
1276
+ chromId: h,
1277
+ start: d,
1278
+ end: b,
1283
1279
  rest: l,
1284
1280
  uniqueId: `bb-${n + c}`
1285
1281
  });
1286
1282
  }
1287
- return i ? o.filter((c) => Z(c.start, c.end, i.start, i.end)) : o;
1283
+ return i ? o.filter((c) => Q(c.start, c.end, i.start, i.end)) : o;
1288
1284
  }
1289
1285
  parseBigWigBlock(r, e, n) {
1290
1286
  const i = r.subarray(e), o = new DataView(i.buffer, i.byteOffset, i.length);
@@ -1296,33 +1292,33 @@ class Re {
1296
1292
  s += 4;
1297
1293
  const c = o.getUint32(s, !0);
1298
1294
  s += 4;
1299
- const d = o.getUint8(s);
1295
+ const h = o.getUint8(s);
1300
1296
  s += 2;
1301
- const y = o.getUint16(s, !0);
1297
+ const d = o.getUint16(s, !0);
1302
1298
  s += 2;
1303
- const g = new Array(y);
1304
- switch (d) {
1299
+ const b = new Array(d);
1300
+ switch (h) {
1305
1301
  case 1: {
1306
- for (let f = 0; f < y; f++) {
1302
+ for (let f = 0; f < d; f++) {
1307
1303
  const m = o.getInt32(s, !0);
1308
1304
  s += 4;
1309
1305
  const l = o.getInt32(s, !0);
1310
1306
  s += 4;
1311
- const v = o.getFloat32(s, !0);
1312
- s += 4, g[f] = {
1307
+ const B = o.getFloat32(s, !0);
1308
+ s += 4, b[f] = {
1313
1309
  start: m,
1314
1310
  end: l,
1315
- score: v
1311
+ score: B
1316
1312
  };
1317
1313
  }
1318
1314
  break;
1319
1315
  }
1320
1316
  case 2: {
1321
- for (let f = 0; f < y; f++) {
1317
+ for (let f = 0; f < d; f++) {
1322
1318
  const m = o.getInt32(s, !0);
1323
1319
  s += 4;
1324
1320
  const l = o.getFloat32(s, !0);
1325
- s += 4, g[f] = {
1321
+ s += 4, b[f] = {
1326
1322
  score: l,
1327
1323
  start: m,
1328
1324
  end: m + c
@@ -1331,11 +1327,11 @@ class Re {
1331
1327
  break;
1332
1328
  }
1333
1329
  case 3: {
1334
- for (let f = 0; f < y; f++) {
1330
+ for (let f = 0; f < d; f++) {
1335
1331
  const m = o.getFloat32(s, !0);
1336
1332
  s += 4;
1337
1333
  const l = u + f * a;
1338
- g[f] = {
1334
+ b[f] = {
1339
1335
  score: m,
1340
1336
  start: l,
1341
1337
  end: l + c
@@ -1344,18 +1340,18 @@ class Re {
1344
1340
  break;
1345
1341
  }
1346
1342
  }
1347
- return n ? g.filter((f) => Z(f.start, f.end, n.start, n.end)) : g;
1343
+ return n ? b.filter((f) => Q(f.start, f.end, n.start, n.end)) : b;
1348
1344
  }
1349
1345
  async readFeatures(r, e, n = {}) {
1350
1346
  try {
1351
- const { blockType: i, isCompressed: o } = this, { signal: s, request: u } = n, a = Ft(e);
1352
- j(s), await Promise.all(a.map(async (c) => {
1353
- j(s);
1354
- const { length: d, offset: y } = c, g = await this.featureCache.get(`${d}_${y}`, c, s);
1347
+ const { blockType: i, isCompressed: o } = this, { signal: s, request: u } = n, a = Pt(e);
1348
+ H(s), await Promise.all(a.map(async (c) => {
1349
+ H(s);
1350
+ const { length: h, offset: d } = c, b = await this.featureCache.get(`${h}_${d}`, c, s);
1355
1351
  for (const f of c.blocks) {
1356
- j(s);
1357
- let m = g.subarray(f.offset - c.offset);
1358
- switch (o && (m = At(m)), j(s), i) {
1352
+ H(s);
1353
+ let m = b.subarray(f.offset - c.offset);
1354
+ switch (o && (m = _t(m)), H(s), i) {
1359
1355
  case "summary": {
1360
1356
  r.next(this.parseSummaryBlock(m, 0, u));
1361
1357
  break;
@@ -1378,11 +1374,19 @@ class Re {
1378
1374
  }
1379
1375
  }
1380
1376
  }
1381
- const Rt = -2003829722, fe = -2021002517;
1382
- function F(t) {
1377
+ const At = -2003829722, ae = -2021002517;
1378
+ function A(t) {
1383
1379
  return new DataView(t.buffer, t.byteOffset, t.length);
1384
1380
  }
1385
- class De {
1381
+ class Fe {
1382
+ bbi;
1383
+ headerP;
1384
+ renameRefSeqs;
1385
+ getHeader(r) {
1386
+ return this.headerP || (this.headerP = this._getHeader(r).catch((e) => {
1387
+ throw this.headerP = void 0, e;
1388
+ })), this.headerP;
1389
+ }
1386
1390
  /*
1387
1391
  * @param filehandle - a filehandle from generic-filehandle2
1388
1392
  *
@@ -1394,24 +1398,16 @@ class De {
1394
1398
  * sequences using a mapping function
1395
1399
  */
1396
1400
  constructor(r) {
1397
- E(this, "bbi");
1398
- E(this, "headerP");
1399
- E(this, "renameRefSeqs");
1400
1401
  const { filehandle: e, renameRefSeqs: n = (s) => s, path: i, url: o } = r;
1401
1402
  if (this.renameRefSeqs = n, e)
1402
1403
  this.bbi = e;
1403
1404
  else if (o)
1404
- this.bbi = new Me(o);
1405
+ this.bbi = new Re(o);
1405
1406
  else if (i)
1406
- this.bbi = new He(i);
1407
+ this.bbi = new De(i);
1407
1408
  else
1408
1409
  throw new Error("no file given");
1409
1410
  }
1410
- getHeader(r) {
1411
- return this.headerP || (this.headerP = this._getHeader(r).catch((e) => {
1412
- throw this.headerP = void 0, e;
1413
- })), this.headerP;
1414
- }
1415
1411
  async _getHeader(r) {
1416
1412
  const e = await this._getMainHeader(r), n = await this._readChromTree(e, r);
1417
1413
  return {
@@ -1420,8 +1416,8 @@ class De {
1420
1416
  };
1421
1417
  }
1422
1418
  async _getMainHeader(r, e = 2e3) {
1423
- const n = await this.bbi.read(e, 0, r), i = F(n), o = i.getInt32(0, !0);
1424
- if (o !== Rt && o !== fe)
1419
+ const n = await this.bbi.read(e, 0, r), i = A(n), o = i.getInt32(0, !0);
1420
+ if (o !== At && o !== ae)
1425
1421
  throw new Error("not a BigWig/BigBed file");
1426
1422
  let s = 0;
1427
1423
  const u = i.getInt32(s, !0);
@@ -1430,11 +1426,11 @@ class De {
1430
1426
  s += 2;
1431
1427
  const c = i.getUint16(s, !0);
1432
1428
  s += 2;
1433
- const d = Number(i.getBigUint64(s, !0));
1429
+ const h = Number(i.getBigUint64(s, !0));
1434
1430
  s += 8;
1435
- const y = Number(i.getBigUint64(s, !0));
1431
+ const d = Number(i.getBigUint64(s, !0));
1436
1432
  s += 8;
1437
- const g = Number(i.getBigUint64(s, !0));
1433
+ const b = Number(i.getBigUint64(s, !0));
1438
1434
  s += 8;
1439
1435
  const f = i.getUint16(s, !0);
1440
1436
  s += 2;
@@ -1442,114 +1438,114 @@ class De {
1442
1438
  s += 2;
1443
1439
  const l = Number(i.getBigUint64(s, !0));
1444
1440
  s += 8;
1445
- const v = Number(i.getBigUint64(s, !0));
1441
+ const B = Number(i.getBigUint64(s, !0));
1446
1442
  s += 8;
1447
- const b = i.getUint32(s, !0);
1443
+ const w = i.getUint32(s, !0);
1448
1444
  s += 4;
1449
1445
  const S = Number(i.getBigUint64(s, !0));
1450
1446
  s += 8;
1451
- const B = [];
1452
- for (let h = 0; h < c; h++) {
1447
+ const x = [];
1448
+ for (let y = 0; y < c; y++) {
1453
1449
  const U = i.getUint32(s, !0);
1454
1450
  s += 4;
1455
1451
  const T = i.getUint32(s, !0);
1456
1452
  s += 4;
1457
- const _ = Number(i.getBigUint64(s, !0));
1453
+ const k = Number(i.getBigUint64(s, !0));
1458
1454
  s += 8;
1459
1455
  const I = Number(i.getBigUint64(s, !0));
1460
- s += 8, B.push({
1456
+ s += 8, x.push({
1461
1457
  reductionLevel: U,
1462
1458
  reserved: T,
1463
- dataOffset: _,
1459
+ dataOffset: k,
1464
1460
  indexOffset: I
1465
1461
  });
1466
1462
  }
1467
- const x = u === fe ? "bigbed" : "bigwig";
1468
- if (l > e || v > e - 40)
1463
+ const v = u === ae ? "bigbed" : "bigwig";
1464
+ if (l > e || B > e - 40)
1469
1465
  return this._getMainHeader(r, e * 2);
1470
1466
  let p;
1471
- if (v) {
1472
- const h = n.subarray(v);
1467
+ if (B) {
1468
+ const y = n.subarray(B);
1473
1469
  let U = 0;
1474
- const T = F(h), _ = Number(T.getBigUint64(U, !0));
1470
+ const T = A(y), k = Number(T.getBigUint64(U, !0));
1475
1471
  U += 8;
1476
1472
  const I = T.getFloat64(U, !0);
1477
1473
  U += 8;
1478
- const k = T.getFloat64(U, !0);
1474
+ const E = T.getFloat64(U, !0);
1479
1475
  U += 8;
1480
1476
  const C = T.getFloat64(U, !0);
1481
1477
  U += 8;
1482
- const V = T.getFloat64(U, !0);
1478
+ const P = T.getFloat64(U, !0);
1483
1479
  U += 8, p = {
1484
1480
  scoreMin: I,
1485
- scoreMax: k,
1481
+ scoreMax: E,
1486
1482
  scoreSum: C,
1487
- scoreSumSquares: V,
1488
- basesCovered: _
1483
+ scoreSumSquares: P,
1484
+ basesCovered: k
1489
1485
  };
1490
1486
  } else
1491
1487
  throw new Error("no stats");
1492
- const w = new TextDecoder("utf8");
1488
+ const g = new TextDecoder("utf8");
1493
1489
  return {
1494
- zoomLevels: B,
1490
+ zoomLevels: x,
1495
1491
  magic: u,
1496
1492
  extHeaderOffset: S,
1497
1493
  numZoomLevels: c,
1498
1494
  fieldCount: f,
1499
1495
  totalSummary: p,
1500
1496
  definedFieldCount: m,
1501
- uncompressBufSize: b,
1497
+ uncompressBufSize: w,
1502
1498
  asOffset: l,
1503
- chromTreeOffset: d,
1504
- totalSummaryOffset: v,
1505
- unzoomedDataOffset: y,
1506
- unzoomedIndexOffset: g,
1507
- fileType: x,
1499
+ chromTreeOffset: h,
1500
+ totalSummaryOffset: B,
1501
+ unzoomedDataOffset: d,
1502
+ unzoomedIndexOffset: b,
1503
+ fileType: v,
1508
1504
  version: a,
1509
- autoSql: l ? w.decode(n.subarray(l, n.indexOf(0, l))) : ""
1505
+ autoSql: l ? g.decode(n.subarray(l, n.indexOf(0, l))) : ""
1510
1506
  };
1511
1507
  }
1512
1508
  async _readChromTree(r, e) {
1513
- const n = [], i = {}, o = r.chromTreeOffset, s = F(await this.bbi.read(32, o, e));
1509
+ const n = [], i = {}, o = r.chromTreeOffset, s = A(await this.bbi.read(32, o, e));
1514
1510
  let u = 0;
1515
1511
  u += 4, u += 4;
1516
1512
  const a = s.getUint32(u, !0);
1517
1513
  u += 4;
1518
1514
  const c = s.getUint32(u, !0);
1519
1515
  u += 4, u += 8;
1520
- const d = new TextDecoder("utf8"), y = async (g) => {
1521
- const f = await this.bbi.read(4, g), m = F(f);
1516
+ const h = new TextDecoder("utf8"), d = async (b) => {
1517
+ const f = await this.bbi.read(4, b), m = A(f);
1522
1518
  let l = 0;
1523
- const v = m.getUint8(l);
1519
+ const B = m.getUint8(l);
1524
1520
  l += 1, l += 1;
1525
- const b = m.getUint16(l, !0);
1526
- if (l += 2, v) {
1527
- const S = await this.bbi.read(b * (a + c), g + l), B = F(S);
1521
+ const w = m.getUint16(l, !0);
1522
+ if (l += 2, B) {
1523
+ const S = await this.bbi.read(w * (a + c), b + l), x = A(S);
1528
1524
  l = 0;
1529
- for (let x = 0; x < b; x++) {
1530
- const p = d.decode(S.subarray(l, l + a)).replaceAll("\0", "");
1525
+ for (let v = 0; v < w; v++) {
1526
+ const p = h.decode(S.subarray(l, l + a)).replaceAll("\0", "");
1531
1527
  l += a;
1532
- const w = B.getUint32(l, !0);
1528
+ const g = x.getUint32(l, !0);
1533
1529
  l += 4;
1534
- const h = B.getUint32(l, !0);
1535
- l += 4, i[this.renameRefSeqs(p)] = w, n[w] = {
1530
+ const y = x.getUint32(l, !0);
1531
+ l += 4, i[this.renameRefSeqs(p)] = g, n[g] = {
1536
1532
  name: p,
1537
- id: w,
1538
- length: h
1533
+ id: g,
1534
+ length: y
1539
1535
  };
1540
1536
  }
1541
1537
  } else {
1542
- const S = [], B = F(await this.bbi.read(b * (a + 8), g + l));
1538
+ const S = [], x = A(await this.bbi.read(w * (a + 8), b + l));
1543
1539
  l = 0;
1544
- for (let x = 0; x < b; x++) {
1540
+ for (let v = 0; v < w; v++) {
1545
1541
  l += a;
1546
- const p = Number(B.getBigUint64(l, !0));
1547
- l += 8, S.push(y(p));
1542
+ const p = Number(x.getBigUint64(l, !0));
1543
+ l += 8, S.push(d(p));
1548
1544
  }
1549
1545
  await Promise.all(S);
1550
1546
  }
1551
1547
  };
1552
- return await y(o + 32), {
1548
+ return await d(o + 32), {
1553
1549
  refsByName: i,
1554
1550
  refsByNumber: n
1555
1551
  };
@@ -1560,7 +1556,7 @@ class De {
1560
1556
  */
1561
1557
  async getUnzoomedView(r) {
1562
1558
  const { unzoomedIndexOffset: e, refsByName: n, uncompressBufSize: i, fileType: o } = await this.getHeader(r);
1563
- return new Re(this.bbi, n, e, i > 0, o);
1559
+ return new ze(this.bbi, n, e, i > 0, o);
1564
1560
  }
1565
1561
  /**
1566
1562
  * Gets features from a BigWig file
@@ -1579,18 +1575,18 @@ class De {
1579
1575
  const o = this.renameRefSeqs(r);
1580
1576
  let s;
1581
1577
  const { basesPerSpan: u, scale: a } = i || {};
1582
- return u ? s = await this.getView(1 / u, i) : a ? s = await this.getView(a, i) : s = await this.getView(1, i), new P((c) => {
1583
- s.readWigData(o, e, n, c, i).catch((d) => {
1584
- c.error(d);
1578
+ return u ? s = await this.getView(1 / u, i) : a ? s = await this.getView(a, i) : s = await this.getView(1, i), new _((c) => {
1579
+ s.readWigData(o, e, n, c, i).catch((h) => {
1580
+ c.error(h);
1585
1581
  });
1586
1582
  });
1587
1583
  }
1588
1584
  async getFeatures(r, e, n, i) {
1589
1585
  const o = await this.getFeatureStream(r, e, n, i);
1590
- return (await Pe(o.pipe(Ct()))).flat();
1586
+ return (await _e(o.pipe(kt()))).flat();
1591
1587
  }
1592
1588
  }
1593
- class $t extends De {
1589
+ class Nt extends Fe {
1594
1590
  /**
1595
1591
  * Retrieves a BlockView of a specific zoomLevel
1596
1592
  *
@@ -1604,31 +1600,28 @@ class $t extends De {
1604
1600
  for (let a = u; a >= 0; a -= 1) {
1605
1601
  const c = n[a];
1606
1602
  if (c && c.reductionLevel <= 2 * s)
1607
- return new Re(this.bbi, i, c.indexOffset, o > 0, "summary");
1603
+ return new ze(this.bbi, i, c.indexOffset, o > 0, "summary");
1608
1604
  }
1609
1605
  return this.getUnzoomedView(e);
1610
1606
  }
1611
1607
  }
1612
- function Dt(t) {
1608
+ function zt(t) {
1613
1609
  return t.filter((r) => !!r);
1614
1610
  }
1615
- class jt extends De {
1616
- constructor() {
1617
- super(...arguments);
1618
- E(this, "readIndicesCache", new le({
1619
- cache: new Fe({ maxSize: 1 }),
1620
- fill: (e, n) => this._readIndices({ ...e, signal: n })
1621
- }));
1622
- }
1623
- readIndices(e = {}) {
1624
- const { signal: n, ...i } = e;
1625
- return this.readIndicesCache.get(JSON.stringify(i), e, n);
1611
+ class Lt extends Fe {
1612
+ readIndicesCache = new ue({
1613
+ cache: new Ae({ maxSize: 1 }),
1614
+ fill: (r, e) => this._readIndices({ ...r, signal: e })
1615
+ });
1616
+ readIndices(r = {}) {
1617
+ const { signal: e, ...n } = r;
1618
+ return this.readIndicesCache.get(JSON.stringify(n), r, e);
1626
1619
  }
1627
1620
  /*
1628
1621
  * retrieve unzoomed view for any scale
1629
1622
  */
1630
- async getView(e, n) {
1631
- return this.getUnzoomedView(n);
1623
+ async getView(r, e) {
1624
+ return this.getUnzoomedView(e);
1632
1625
  }
1633
1626
  /*
1634
1627
  * parse the bigbed extraIndex fields
@@ -1637,34 +1630,34 @@ class jt extends De {
1637
1630
  * @return a Promise for an array of Index data structure since there can be
1638
1631
  * multiple extraIndexes in a bigbed, see bedToBigBed documentation
1639
1632
  */
1640
- async _readIndices(e) {
1641
- const { extHeaderOffset: n } = await this.getHeader(e), i = await this.bbi.read(64, n), o = new DataView(i.buffer, i.byteOffset, i.length);
1642
- let s = 0;
1643
- s += 2;
1644
- const u = o.getUint16(s, !0);
1645
- s += 2;
1646
- const a = Number(o.getBigUint64(s, !0));
1647
- if (s += 8, u === 0)
1633
+ async _readIndices(r) {
1634
+ const { extHeaderOffset: e } = await this.getHeader(r), n = await this.bbi.read(64, e), i = new DataView(n.buffer, n.byteOffset, n.length);
1635
+ let o = 0;
1636
+ o += 2;
1637
+ const s = i.getUint16(o, !0);
1638
+ o += 2;
1639
+ const u = Number(i.getBigUint64(o, !0));
1640
+ if (o += 8, s === 0)
1648
1641
  return [];
1649
- const c = 20, d = c * u, y = await this.bbi.read(d, a), g = [];
1650
- for (let f = 0; f < u; f += 1) {
1651
- const m = y.subarray(f * c), l = new DataView(m.buffer, m.byteOffset, m.length);
1652
- let v = 0;
1653
- const b = l.getInt16(v, !0);
1654
- v += 2;
1655
- const S = l.getInt16(v, !0);
1656
- v += 2;
1657
- const B = Number(l.getBigUint64(v, !0));
1658
- v += 12;
1659
- const x = l.getInt16(v, !0);
1660
- g.push({
1661
- type: b,
1662
- fieldcount: S,
1663
- offset: B,
1642
+ const a = 20, c = a * s, h = await this.bbi.read(c, u), d = [];
1643
+ for (let b = 0; b < s; b += 1) {
1644
+ const f = h.subarray(b * a), m = new DataView(f.buffer, f.byteOffset, f.length);
1645
+ let l = 0;
1646
+ const B = m.getInt16(l, !0);
1647
+ l += 2;
1648
+ const w = m.getInt16(l, !0);
1649
+ l += 2;
1650
+ const S = Number(m.getBigUint64(l, !0));
1651
+ l += 12;
1652
+ const x = m.getInt16(l, !0);
1653
+ d.push({
1654
+ type: B,
1655
+ fieldcount: w,
1656
+ offset: S,
1664
1657
  field: x
1665
1658
  });
1666
1659
  }
1667
- return g;
1660
+ return d;
1668
1661
  }
1669
1662
  /*
1670
1663
  * perform a search in the bigbed extraIndex to find which blocks in the
@@ -1676,74 +1669,74 @@ class jt extends De {
1676
1669
  *
1677
1670
  * @return a Promise for an array of bigbed block Loc entries
1678
1671
  */
1679
- async searchExtraIndexBlocks(e, n = {}) {
1680
- const i = await this.readIndices(n);
1681
- if (i.length === 0)
1672
+ async searchExtraIndexBlocks(r, e = {}) {
1673
+ const n = await this.readIndices(e);
1674
+ if (n.length === 0)
1682
1675
  return [];
1683
- const o = new TextDecoder("utf8"), s = i.map(async (u) => {
1684
- const { offset: a, field: c } = u, d = await this.bbi.read(32, a, n), y = new DataView(d.buffer, d.byteOffset, d.length);
1685
- let g = 0;
1686
- g += 4;
1687
- const f = y.getInt32(g, !0);
1688
- g += 4;
1689
- const m = y.getInt32(g, !0);
1690
- g += 4;
1691
- const l = y.getInt32(g, !0);
1692
- g += 4, g += 8;
1693
- const v = async (b) => {
1694
- const S = b, B = 4 + f * (m + l), p = await this.bbi.read(B, S, n), w = new DataView(p.buffer, p.byteOffset, p.length);
1695
- let h = 0;
1696
- const U = w.getInt8(h);
1697
- h += 2;
1698
- const T = w.getInt16(h, !0);
1699
- h += 2;
1700
- const _ = [];
1701
- if (U === 0) {
1702
- const I = [];
1703
- for (let C = 0; C < T; C++) {
1704
- const V = o.decode(p.subarray(h, h + m)).replaceAll("\0", "");
1705
- h += m;
1706
- const A = Number(w.getBigUint64(h, !0));
1707
- h += 8, I.push({
1708
- key: V,
1709
- offset: A
1676
+ const i = new TextDecoder("utf8"), o = n.map(async (s) => {
1677
+ const { offset: u, field: a } = s, c = await this.bbi.read(32, u, e), h = new DataView(c.buffer, c.byteOffset, c.length);
1678
+ let d = 0;
1679
+ d += 4;
1680
+ const b = h.getInt32(d, !0);
1681
+ d += 4;
1682
+ const f = h.getInt32(d, !0);
1683
+ d += 4;
1684
+ const m = h.getInt32(d, !0);
1685
+ d += 4, d += 8;
1686
+ const l = async (B) => {
1687
+ const w = B, S = 4 + b * (f + m), v = await this.bbi.read(S, w, e), p = new DataView(v.buffer, v.byteOffset, v.length);
1688
+ let g = 0;
1689
+ const y = p.getInt8(g);
1690
+ g += 2;
1691
+ const U = p.getInt16(g, !0);
1692
+ g += 2;
1693
+ const T = [];
1694
+ if (y === 0) {
1695
+ const k = [];
1696
+ for (let E = 0; E < U; E++) {
1697
+ const C = i.decode(v.subarray(g, g + f)).replaceAll("\0", "");
1698
+ g += f;
1699
+ const P = Number(p.getBigUint64(g, !0));
1700
+ g += 8, k.push({
1701
+ key: C,
1702
+ offset: P
1710
1703
  });
1711
1704
  }
1712
- let k = 0;
1713
- for (const { key: C, offset: V } of I) {
1714
- if (e.localeCompare(C) < 0 && k)
1715
- return v(k);
1716
- k = V;
1705
+ let I = 0;
1706
+ for (const { key: E, offset: C } of k) {
1707
+ if (r.localeCompare(E) < 0 && I)
1708
+ return l(I);
1709
+ I = C;
1717
1710
  }
1718
- return v(k);
1719
- } else if (U === 1) {
1720
- for (let I = 0; I < T; I++) {
1721
- const k = o.decode(p.subarray(h, h + m)).replaceAll("\0", "");
1722
- h += m;
1723
- const C = Number(w.getBigUint64(h, !0));
1724
- h += 8;
1725
- const V = w.getUint32(h, !0);
1726
- h += 4;
1727
- const A = w.getUint32(h, !0);
1728
- h += 4, _.push({
1729
- key: k,
1730
- offset: C,
1731
- length: V,
1732
- reserved: A
1711
+ return l(I);
1712
+ } else if (y === 1) {
1713
+ for (let k = 0; k < U; k++) {
1714
+ const I = i.decode(v.subarray(g, g + f)).replaceAll("\0", "");
1715
+ g += f;
1716
+ const E = Number(p.getBigUint64(g, !0));
1717
+ g += 8;
1718
+ const C = p.getUint32(g, !0);
1719
+ g += 4;
1720
+ const P = p.getUint32(g, !0);
1721
+ g += 4, T.push({
1722
+ key: I,
1723
+ offset: E,
1724
+ length: C,
1725
+ reserved: P
1733
1726
  });
1734
1727
  }
1735
- for (const I of _)
1736
- if (I.key === e)
1728
+ for (const k of T)
1729
+ if (k.key === r)
1737
1730
  return {
1738
- ...I,
1739
- field: c
1731
+ ...k,
1732
+ field: a
1740
1733
  };
1741
1734
  return;
1742
1735
  }
1743
1736
  };
1744
- return v(a + 32);
1737
+ return l(u + 32);
1745
1738
  });
1746
- return Dt(await Promise.all(s));
1739
+ return zt(await Promise.all(o));
1747
1740
  }
1748
1741
  /*
1749
1742
  * retrieve the features from the bigbed data that were found through the
@@ -1756,26 +1749,23 @@ class jt extends De {
1756
1749
  *
1757
1750
  * @return array of Feature
1758
1751
  */
1759
- async searchExtraIndex(e, n = {}) {
1760
- const i = await this.searchExtraIndexBlocks(e, n);
1761
- if (i.length === 0)
1752
+ async searchExtraIndex(r, e = {}) {
1753
+ const n = await this.searchExtraIndexBlocks(r, e);
1754
+ if (n.length === 0)
1762
1755
  return [];
1763
- const o = await this.getUnzoomedView(n), s = i.map((a) => new P((c) => {
1764
- o.readFeatures(c, [a], n).catch((d) => {
1765
- c.error(d);
1756
+ const i = await this.getUnzoomedView(e), o = n.map((u) => new _((a) => {
1757
+ i.readFeatures(a, [u], e).catch((c) => {
1758
+ a.error(c);
1766
1759
  });
1767
- }).pipe(ze((c, d) => c.concat(d)), Ve((c) => {
1768
- for (const d of c)
1769
- d.field = a.field;
1770
- return c;
1760
+ }).pipe(Ve((a, c) => a.concat(c)), Ce((a) => {
1761
+ for (const c of a)
1762
+ c.field = u.field;
1763
+ return a;
1771
1764
  })));
1772
- return (await Pe(Et(...s))).filter((a) => {
1773
- var c;
1774
- return ((c = a.rest) == null ? void 0 : c.split(" ")[(a.field || 0) - 3]) === e;
1775
- });
1765
+ return (await _e(Bt(...o))).filter((u) => u.rest?.split(" ")[(u.field || 0) - 3] === r);
1776
1766
  }
1777
1767
  }
1778
1768
  export {
1779
- jt as BigBed,
1780
- $t as BigWig
1769
+ Lt as BigBed,
1770
+ Nt as BigWig
1781
1771
  };