@genome-spy/app 1.1.1 → 1.3.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.
Files changed (96) hide show
  1. package/dist/{SharedReadCache-Ey5QIiPM.js → SharedReadCache-9sT2aIxW.js} +6 -12
  2. package/dist/__vite-browser-external-Dgu_Ldik.js +7 -0
  3. package/dist/{agentApi-sPuuT0KS.js → agentApi-BclFF9zB.js} +9981 -8914
  4. package/dist/agentApi.es.js +6783 -5135
  5. package/dist/agentShared.es.js +433 -460
  6. package/dist/arrayUtils-Bm7QnzhN.js +1306 -0
  7. package/dist/{blosc-JROzDOnd.js → blosc-C-W97QwH.js} +3 -3
  8. package/dist/{canvas2d-iDK4BC5j.js → canvas2d-8MSf70d4.js} +141 -134
  9. package/dist/{canvas2d-MXaFeZnP.js → canvas2d-BwGNI_Rx.js} +147 -141
  10. package/dist/clipOptions-SrrxeAEU.js +4316 -0
  11. package/dist/clipOptions-clBEbkjv.js +4326 -0
  12. package/dist/{layoutResult-D50MSHXR.js → color-jETn8xK_.js} +29 -10
  13. package/dist/color-uTRRsy8i.js +116 -0
  14. package/dist/{componentStyles-DGtQXvwc.js → componentStyles-C7FbjS-a.js} +1 -1
  15. package/dist/{viewIdentityRegistry-BIYd4TE0.js → containerView-BItRtKqu.js} +28 -31
  16. package/dist/{viewIdentityRegistry-BDKkEjXl.js → containerView-CWa6ZIJW.js} +28 -31
  17. package/dist/{debug-DbigmdrK.js → debug-23s-jja_.js} +10 -9
  18. package/dist/{debug-BlqDxTw3.js → debug-CWRxvAss.js} +9 -10
  19. package/dist/dialog.es.js +1 -1
  20. package/dist/dist-CmY6iewb.js +1501 -0
  21. package/dist/dist-D6xbz5Ks.js +1501 -0
  22. package/dist/{esm-CjkeZi__.js → esm-BFwBAnbO.js} +25 -25
  23. package/dist/esm-BUkWqSr2.js +299 -0
  24. package/dist/{esm-C-6g-SkZ.js → esm-C0xXMLsR.js} +37 -41
  25. package/dist/{esm-CJeszW-t.js → esm-C2xhhXs0.js} +7 -7
  26. package/dist/esm-C6erfjPM.js +252 -0
  27. package/dist/{esm-DFHFX1sH.js → esm-CVjC7qA4.js} +34 -38
  28. package/dist/esm-CqY5ezGz.js +1249 -0
  29. package/dist/esm-DfMIJ_N2.js +1522 -0
  30. package/dist/esm-Dls41IbZ.js +787 -0
  31. package/dist/{esm-Bv7Frz7C.js → esm-DzQDfrsZ.js} +7 -10
  32. package/dist/esm-aGLCvYRP.js +238 -0
  33. package/dist/{esm-VFJeyk9i.js → esm-nzwgJFGz.js} +40 -36
  34. package/dist/figWigMetadataSourceAdapter-8Kf_vZRf.js +36 -0
  35. package/dist/figWigMetadataSourceAdapter-DdDMZpYO.js +36 -0
  36. package/dist/flowNode-BSjy0Wz3.js +1306 -0
  37. package/dist/flowOutput-D5qpxWe0.js +183 -0
  38. package/dist/index.es.js +4766 -5522
  39. package/dist/index.js +1089 -685
  40. package/dist/inflate-BdC5KvHn.js +886 -0
  41. package/dist/{lz4-CUYSbVey.js → lz4-BLPgBOlE.js} +1 -1
  42. package/dist/markUtils-RaatLEa-.js +78 -0
  43. package/dist/{metadataChannels-DV62inJh.js → metadataChannels-DLSmx7kU.js} +6 -3
  44. package/dist/metadataUtils-DxEPe0vj.js +879 -0
  45. package/dist/order-BnKzKjt4.js +1151 -0
  46. package/dist/order-BpJnq_nV.js +1150 -0
  47. package/dist/{parquetRead-0hFIa3Cc.js → parquetRead-D-yY8njE.js} +3 -11
  48. package/dist/{rasterExport-B62RmAK1.js → rasterExport-B-WrX1pa.js} +5 -5
  49. package/dist/{rasterExport-DQH3hVg_.js → rasterExport-C_vx4Jwd.js} +4 -4
  50. package/dist/{rasterization-B05bDo5e.js → rasterization-QktH8Sn2.js} +26 -19
  51. package/dist/rectangle-BAdoDPXu.js +194 -0
  52. package/dist/{rectangle-DE98gIxF.js → rectangle-DZTR6NFQ.js} +10 -1
  53. package/dist/renderCanvas2D-CsRO78Pq.js +291 -0
  54. package/dist/{renderCanvas2D-Bdv-B4wj.js → renderCanvas2D-Y7pkRzbC.js} +98 -92
  55. package/dist/{rolldown-runtime-DF993M8W.js → rolldown-runtime-DeIk2rA4.js} +1 -1
  56. package/dist/{indexer-DbFTKGlm.js → scaleNull-CVzag4z8.js} +2 -12
  57. package/dist/{indexer-En7gpvLN.js → scaleNull-Pbz7QGnl.js} +2 -12
  58. package/dist/{scalePosition-ByvlXaML.js → scalePosition-CRXa0rCC.js} +8 -1
  59. package/dist/schema.json +33403 -16929
  60. package/dist/style.css +1 -1
  61. package/dist/{svg-N3tj05-e.js → svg-BBMtLgtM.js} +445 -362
  62. package/dist/{svg-DHsq1RpV.js → svg-JjWL6U-T.js} +464 -381
  63. package/dist/{svgRasterizer-CYVDlt5z.js → svgRasterizer-6OcftuoI.js} +3 -3
  64. package/dist/{svgRasterizer-CvCBlxLj.js → svgRasterizer-DkNRaCPs.js} +4 -4
  65. package/dist/tableMetadataSourceAdapter-CUNwLsdi.js +291 -0
  66. package/dist/tableMetadataSourceAdapter-DQrEXCo6.js +1283 -0
  67. package/dist/url-DeOdSRrv.js +183 -0
  68. package/dist/viewError-B0TMfOpB.js +33 -0
  69. package/dist/viewError-D9aO90cI.js +33 -0
  70. package/dist/{viewSelectors-DDLW-byr.js → viewSelectors-DkFvo33d.js} +914 -752
  71. package/dist/{viewSelectors-j-F9XwsE.js → viewSelectors-lM93fHAq.js} +942 -780
  72. package/dist/viewUtils-0SJOewM6.js +6195 -0
  73. package/dist/webgl-CXIO3OQz.js +5782 -0
  74. package/dist/webgl-Pdvfhio5.js +5783 -0
  75. package/package.json +7 -5
  76. package/src/agentApi/index.d.ts +3 -2
  77. package/src/agentShared/index.d.ts +2 -0
  78. package/src/appTypes.d.ts +1 -6
  79. package/src/embedTypes.d.ts +36 -1
  80. package/src/index.d.ts +6 -0
  81. package/src/spec/sampleView.d.ts +68 -13
  82. package/src/spec/view.d.ts +44 -5
  83. package/src/state/paramProvenanceTypes.d.ts +25 -2
  84. package/src/state.d.ts +14 -52
  85. package/dist/clipOptions-B5PibDq3.js +0 -2923
  86. package/dist/clipOptions-Cba4I0AO.js +0 -2903
  87. package/dist/esm-Dndm-NaA.js +0 -1193
  88. package/dist/order-B4uR9Q04.js +0 -1062
  89. package/dist/order-BSPy5DI8.js +0 -1062
  90. package/dist/renderCanvas2D-ChdoHGrU.js +0 -285
  91. package/dist/vega-scale-Byaw1K8O.js +0 -2446
  92. package/dist/vega-scale-Ctz_wa3z.js +0 -2443
  93. package/dist/viewError-BiR9VCgL.js +0 -29
  94. package/dist/viewUtils-JX6CMEYH.js +0 -6664
  95. package/dist/webgl-DdmOwEH0.js +0 -5544
  96. package/dist/webgl-Dw8xqZpX.js +0 -5544
@@ -0,0 +1,252 @@
1
+ import { n as e } from "./rolldown-runtime-DeIk2rA4.js";
2
+ import { t } from "./__vite-browser-external-Dgu_Ldik.js";
3
+ //#region ../../node_modules/generic-filehandle2/esm/util.js
4
+ async function n(e) {
5
+ return e.bytes ? e.bytes() : new Uint8Array(await e.arrayBuffer());
6
+ }
7
+ async function r(e, t, r) {
8
+ if (t === "utf8" || t === "utf-8") return e.text();
9
+ if (t) throw Error(`unsupported encoding: ${t}`);
10
+ return r && "body" in e ? c(e, r) : n(e);
11
+ }
12
+ function i(e) {
13
+ return typeof e == "string" ? {
14
+ encoding: e,
15
+ opts: {}
16
+ } : {
17
+ encoding: e?.encoding,
18
+ opts: e ?? {}
19
+ };
20
+ }
21
+ function a(e) {
22
+ let t = /\/(\d+)$/.exec(e ?? "")?.[1];
23
+ return t === void 0 ? void 0 : parseInt(t, 10);
24
+ }
25
+ function o(e) {
26
+ let t = e.headers.get("content-length"), n = t === null ? NaN : Number(t);
27
+ return Number.isSafeInteger(n) && n >= 0 ? n : void 0;
28
+ }
29
+ var s = 50;
30
+ async function c(e, t) {
31
+ let r = o(e), i = e.body;
32
+ if (!i || r === void 0) {
33
+ let i = await n(e);
34
+ return t(i.byteLength, r ?? i.byteLength), i;
35
+ }
36
+ let a = i.getReader(), c = new Uint8Array(r), l = 0, u = Date.now();
37
+ t(0, r);
38
+ for (let e = await a.read(); !e.done; e = await a.read()) {
39
+ if (l + e.value.byteLength > c.length) {
40
+ let t = new Uint8Array(Math.max(l + e.value.byteLength, c.length * 2));
41
+ t.set(c.subarray(0, l)), c = t;
42
+ }
43
+ c.set(e.value, l), l += e.value.byteLength;
44
+ let n = Date.now();
45
+ n - u >= s && (u = n, t(l, r));
46
+ }
47
+ return t(l, r), l === c.length ? c : c.slice(0, l);
48
+ }
49
+ //#endregion
50
+ //#region ../../node_modules/generic-filehandle2/esm/blobFile.js
51
+ var l = class {
52
+ source;
53
+ blob;
54
+ constructor(e) {
55
+ this.blob = e;
56
+ }
57
+ async read(e, t = 0, r = {}) {
58
+ if (e === 0) return /* @__PURE__ */ new Uint8Array();
59
+ r.signal?.throwIfAborted();
60
+ let i = await n(this.blob.slice(t, t + e));
61
+ return r.signal?.throwIfAborted(), i;
62
+ }
63
+ async readFile(e) {
64
+ let { encoding: t, opts: n } = i(e);
65
+ n.signal?.throwIfAborted();
66
+ let a = await r(this.blob, t);
67
+ return n.signal?.throwIfAborted(), a;
68
+ }
69
+ stat() {
70
+ return Promise.resolve({ size: this.blob.size });
71
+ }
72
+ close() {
73
+ return Promise.resolve();
74
+ }
75
+ };
76
+ //#endregion
77
+ //#region ../../node_modules/generic-filehandle2/esm/remoteFile.js
78
+ function u(...e) {
79
+ let t = /* @__PURE__ */ new Map();
80
+ for (let n of e) for (let [e, r] of Object.entries(n ?? {})) t.set(e.toLowerCase(), [e, r]);
81
+ return Object.fromEntries(t.values());
82
+ }
83
+ function d(e) {
84
+ let t = e.body;
85
+ typeof t?.cancel == "function" && t.cancel().catch(() => void 0);
86
+ }
87
+ function f(e) {
88
+ return Number.isSafeInteger(e) && e >= 0;
89
+ }
90
+ function p(e) {
91
+ return typeof e == "object" && !!e && "name" in e && e.name === "TypeError";
92
+ }
93
+ function m(e) {
94
+ return (typeof e == "object" && e && "message" in e && typeof e.message == "string" ? e.message : `${e}`).replace(/\.$/, "");
95
+ }
96
+ var h = class {
97
+ url;
98
+ get source() {
99
+ return this.url;
100
+ }
101
+ _stat;
102
+ statProbe;
103
+ fetchImplementation;
104
+ baseHeaders;
105
+ baseOverrides;
106
+ baseSignal;
107
+ constructor(e, t = {}) {
108
+ this.url = e, this.baseHeaders = t.headers ?? {}, this.baseOverrides = t.overrides ?? {}, this.baseSignal = t.signal, this.fetchImplementation = t.fetch ?? globalThis.fetch.bind(globalThis);
109
+ }
110
+ buildRequest(e, t) {
111
+ let n = e.signal ?? this.baseSignal;
112
+ return {
113
+ method: "GET",
114
+ redirect: "follow",
115
+ mode: "cors",
116
+ ...this.baseOverrides,
117
+ ...e.overrides,
118
+ headers: u(this.baseHeaders, e.headers, t),
119
+ ...n ? { signal: n } : {}
120
+ };
121
+ }
122
+ async fetch(e, t) {
123
+ let n = (n) => p(n) && !t?.signal?.aborted ? Error(`${m(n)} fetching ${e}`, { cause: n }) : n, r;
124
+ try {
125
+ r = await this.fetchImplementation(e, t);
126
+ } catch (i) {
127
+ if (`${i}`.includes("Failed to fetch")) {
128
+ console.warn(`generic-filehandle: refetching ${e} to attempt to work around chrome CORS header caching bug`);
129
+ try {
130
+ r = await this.fetchImplementation(e, {
131
+ ...t,
132
+ cache: "reload"
133
+ });
134
+ } catch (e) {
135
+ throw n(e);
136
+ }
137
+ } else throw n(i);
138
+ }
139
+ return r;
140
+ }
141
+ async read(e, t, n = {}) {
142
+ if (!f(e) || !f(t)) throw TypeError(`read() called with an invalid length or position (length=${e}, position=${t}). The index file may be corrupt.`);
143
+ return e === 0 ? /* @__PURE__ */ new Uint8Array() : this.fetchBytes(e, t, n);
144
+ }
145
+ async fetchBytes(e, t, r) {
146
+ let i = await this.fetch(this.url, this.buildRequest(r, { range: `bytes=${t}-${t + e - 1}` }));
147
+ if (i.status === 416) return d(i), /* @__PURE__ */ new Uint8Array();
148
+ if (this.checkOk(i), i.status === 200 && t === 0 || i.status === 206) {
149
+ let t = a(i.headers.get("content-range"));
150
+ t !== void 0 && (this._stat = { size: t });
151
+ let o = r.onProgress ? await c(i, r.onProgress) : await n(i);
152
+ return !this._stat && i.status === 200 && (this._stat = { size: o.byteLength }), o.byteLength <= e ? o : o.slice(0, e);
153
+ }
154
+ throw d(i), Error(i.status === 200 ? `${this.url} fetch returned status 200, expected 206` : `HTTP ${i.status} fetching ${this.url}`);
155
+ }
156
+ checkOk(e) {
157
+ if (!e.ok) throw d(e), Error(`HTTP ${e.status} fetching ${this.url}`);
158
+ }
159
+ async readFile(e) {
160
+ let { encoding: t, opts: n } = i(e), r = await this.fetch(this.url, this.buildRequest(n));
161
+ this.checkOk(r);
162
+ let a = await this.readFileBody(r, t, n.onProgress);
163
+ return r.status === 200 && typeof a != "string" && (this._stat = { size: a.byteLength }), a;
164
+ }
165
+ readFileBody(e, t, n) {
166
+ return r(e, t, n);
167
+ }
168
+ async stat() {
169
+ return this._stat || (this.statProbe ??= this.read(10, 0).finally(() => {
170
+ this.statProbe = void 0;
171
+ }), await this.statProbe), this._stat ?? { size: 0 };
172
+ }
173
+ close() {
174
+ return Promise.resolve();
175
+ }
176
+ }, g = t();
177
+ function _(e) {
178
+ return typeof e == "object" && !!e && "unref" in e && typeof e.unref == "function";
179
+ }
180
+ var v = class {
181
+ filename;
182
+ get source() {
183
+ return this.filename;
184
+ }
185
+ cacheFd;
186
+ fdIdleTimeoutMs;
187
+ fh;
188
+ opening;
189
+ idleTimer;
190
+ constructor(e, t = {}) {
191
+ this.filename = e, this.cacheFd = t.cacheFd ?? !0, this.fdIdleTimeoutMs = t.fdIdleTimeoutMs ?? 3e4;
192
+ }
193
+ touch() {
194
+ this.fdIdleTimeoutMs <= 0 || (this.idleTimer !== void 0 && clearTimeout(this.idleTimer), this.idleTimer = setTimeout(() => {
195
+ this.idleTimer = void 0, this.dropHandle();
196
+ }, this.fdIdleTimeoutMs), _(this.idleTimer) && this.idleTimer.unref());
197
+ }
198
+ async handle() {
199
+ return this.fh ? this.fh : (this.opening ??= (0, g.open)(this.filename, "r").then((e) => (this.fh = e, this.opening = void 0, e), (e) => {
200
+ throw this.opening = void 0, e;
201
+ }), this.opening);
202
+ }
203
+ async dropHandle() {
204
+ this.idleTimer !== void 0 && (clearTimeout(this.idleTimer), this.idleTimer = void 0);
205
+ let e = this.fh ?? await this.opening?.catch(() => void 0);
206
+ if (this.fh = void 0, e) try {
207
+ await e.close();
208
+ } catch {}
209
+ }
210
+ async read(e, t = 0, n = {}) {
211
+ if (e === 0) return /* @__PURE__ */ new Uint8Array();
212
+ if (n.signal?.throwIfAborted(), !this.cacheFd) return this.readWithOwnHandle(e, t, n);
213
+ for (let r = 0;; r++) {
214
+ let i = await this.handle();
215
+ try {
216
+ let r = await this.readFrom(i, e, t, n);
217
+ return this.touch(), r;
218
+ } catch (e) {
219
+ if (await this.dropHandle(), r > 0 || n.signal?.aborted) throw e;
220
+ }
221
+ }
222
+ }
223
+ async readFrom(e, t, n, r) {
224
+ let i = new Uint8Array(t), a = await e.read(i, 0, t, n);
225
+ return r.signal?.throwIfAborted(), a.buffer.subarray(0, a.bytesRead);
226
+ }
227
+ async readWithOwnHandle(e, t, n) {
228
+ let r;
229
+ try {
230
+ return r = await (0, g.open)(this.filename, "r"), await this.readFrom(r, e, t, n);
231
+ } finally {
232
+ if (r) try {
233
+ await r.close();
234
+ } catch {}
235
+ }
236
+ }
237
+ async readFile(e) {
238
+ return (0, g.readFile)(this.filename, e);
239
+ }
240
+ async stat() {
241
+ return (0, g.stat)(this.filename);
242
+ }
243
+ async close() {
244
+ await this.dropHandle();
245
+ }
246
+ }, y = /* @__PURE__ */ e({
247
+ BlobFile: () => l,
248
+ LocalFile: () => v,
249
+ RemoteFile: () => h
250
+ });
251
+ //#endregion
252
+ export { v as n, h as r, y as t };
@@ -1,6 +1,6 @@
1
- import { t as e } from "./esm-C3A-AuRi.js";
2
- import { n as t, r as n } from "./esm-Dndm-NaA.js";
3
- import { n as r, r as i } from "./esm-VFJeyk9i.js";
1
+ import { n as e, r as t } from "./esm-nzwgJFGz.js";
2
+ import { t as n } from "./esm-C3A-AuRi.js";
3
+ import { n as r, r as i } from "./esm-BUkWqSr2.js";
4
4
  //#region ../../node_modules/@gmod/bam/esm/chunk.js
5
5
  var a = class {
6
6
  minv;
@@ -68,11 +68,7 @@ function u(e) {
68
68
  let t = [e[0]];
69
69
  for (let n = 1; n < e.length; n++) {
70
70
  let r = e[n], i = t[t.length - 1].maxv;
71
- if ((r.minv.blockPosition - i.blockPosition || r.minv.dataPosition - i.dataPosition) >= 0) {
72
- t.push(r);
73
- continue;
74
- }
75
- (r.maxv.blockPosition - i.blockPosition || r.maxv.dataPosition - i.dataPosition) > 0 && t.push(new a(i, r.maxv, r.bin, r.endPosition));
71
+ (r.minv.blockPosition - i.blockPosition || r.minv.dataPosition - i.dataPosition) >= 0 ? t.push(r) : (r.maxv.blockPosition - i.blockPosition || r.maxv.dataPosition - i.dataPosition) > 0 && t.push(new a(i, r.maxv, r.bin, r.endPosition));
76
72
  }
77
73
  return t;
78
74
  }
@@ -158,13 +154,13 @@ function v(e, t, n, r, i = []) {
158
154
  }
159
155
  //#endregion
160
156
  //#region ../../node_modules/@gmod/bam/esm/indexFile.js
161
- function y(t, n = 5) {
162
- let r = new e({ maxSize: n });
163
- return (e) => {
164
- let n = r.get(e);
157
+ function y(e, t = 5) {
158
+ let r = new n({ maxSize: t });
159
+ return (t) => {
160
+ let n = r.get(t);
165
161
  if (n !== void 0) return n;
166
- let i = t(e);
167
- return i && r.set(e, i), i;
162
+ let i = e(t);
163
+ return i && r.set(t, i), i;
168
164
  };
169
165
  }
170
166
  var b = class {
@@ -628,10 +624,10 @@ var k = class extends b {
628
624
  };
629
625
  }
630
626
  async _parse(e) {
631
- let n = await this.filehandle.readFile(e), r = await t(n), i = new DataView(r.buffer, r.byteOffset, r.byteLength), o = i.getUint32(0, !0);
627
+ let t = await this.filehandle.readFile(e), n = await r(t), i = new DataView(n.buffer, n.byteOffset, n.byteLength), o = i.getUint32(0, !0);
632
628
  if (o !== ae && o !== oe) throw Error(`Not a CSI file ${o}`);
633
629
  this.minShift = i.getInt32(4, !0), this.depth = i.getInt32(8, !0), this.maxBinNumber = ((1 << (this.depth + 1) * 3) - 1) / 7;
634
- let c = this.maxBinNumber, l = i.getInt32(12, !0), u = l >= 30 ? this.parseAuxData(r, 16) : void 0, p = i.getInt32(16 + l, !0), h = 16 + l + 4, g, _ = [];
630
+ let c = this.maxBinNumber, l = i.getInt32(12, !0), u = l >= 30 ? this.parseAuxData(n, 16) : void 0, p = i.getInt32(16 + l, !0), h = 16 + l + 4, g, _ = [];
635
631
  for (let e = 0; e < p; e++) {
636
632
  _.push(h);
637
633
  let e = i.getInt32(h, !0);
@@ -640,7 +636,7 @@ var k = class extends b {
640
636
  let e = i.getUint32(h, !0);
641
637
  if (h += 4, e > this.maxBinNumber) h += 44;
642
638
  else {
643
- g = m(r, h, 1, g), h += 8;
639
+ g = m(n, h, 1, g), h += 8;
644
640
  let e = i.getInt32(h, !0);
645
641
  h += 4 + 16 * e;
646
642
  }
@@ -649,22 +645,22 @@ var k = class extends b {
649
645
  function v(e) {
650
646
  let t = _[e];
651
647
  if (t === void 0) return;
652
- let n = i.getInt32(t, !0);
648
+ let r = i.getInt32(t, !0);
653
649
  t += 4;
654
650
  let o = {}, l;
655
- for (let e = 0; e < n; e++) {
651
+ for (let e = 0; e < r; e++) {
656
652
  let e = i.getUint32(t, !0);
657
- if (t += 4, e > c) l = d(r, t + 28), t += 44;
653
+ if (t += 4, e > c) l = d(n, t + 28), t += 44;
658
654
  else {
659
655
  t += 8;
660
- let n = i.getInt32(t, !0);
656
+ let r = i.getInt32(t, !0);
661
657
  t += 4;
662
- let c = Array(n);
663
- for (let i = 0; i < n; i += 1) {
664
- let n = s(r, t);
658
+ let c = Array(r);
659
+ for (let i = 0; i < r; i += 1) {
660
+ let r = s(n, t);
665
661
  t += 8;
666
- let o = s(r, t);
667
- t += 8, c[i] = new a(n, o, e);
662
+ let o = s(n, t);
663
+ t += 8, c[i] = new a(r, o, e);
668
664
  }
669
665
  o[e] = c;
670
666
  }
@@ -1190,8 +1186,8 @@ function ye(e) {
1190
1186
  return n;
1191
1187
  }
1192
1188
  var K = 65536, be = 33554432;
1193
- function q(e, t, n) {
1194
- return e ?? (t ? new r(t) : n ? new i(n) : void 0);
1189
+ function q(n, r, i) {
1190
+ return n ?? (r ? new e(r) : i ? new t(i) : void 0);
1195
1191
  }
1196
1192
  function J(e, t, n) {
1197
1193
  let r = e?.[0];
@@ -1266,11 +1262,11 @@ var X = 104857600, Z = 6, xe = class {
1266
1262
  }
1267
1263
  async getHeaderPre(e = {}) {
1268
1264
  if (!this.index) throw Error("no index to read a header from: use HtsgetFile for htsget sources");
1269
- let n = await this.index.parse(e), r = n.firstDataLine === void 0 ? K : n.firstDataLine.blockPosition + K, i, a;
1265
+ let t = await this.index.parse(e), n = t.firstDataLine === void 0 ? K : t.firstDataLine.blockPosition + K, i, a;
1270
1266
  do {
1271
- let n = await this.bam.read(r, 0, { signal: e.signal });
1272
- a = n.length < r, i = this.applyHeader(await t(n)), r *= 2;
1273
- } while (i === void 0 && !a && r <= be);
1267
+ let t = await this.bam.read(n, 0, { signal: e.signal });
1268
+ a = t.length < n, i = this.applyHeader(await r(t)), n *= 2;
1269
+ } while (i === void 0 && !a && n <= be);
1274
1270
  if (i === void 0) throw Error("Insufficient data for reference sequences");
1275
1271
  return i;
1276
1272
  }
@@ -1406,12 +1402,12 @@ var X = 104857600, Z = 6, xe = class {
1406
1402
  return await Promise.all(Array.from({ length: m }, () => p())), d.flat();
1407
1403
  }
1408
1404
  async _readChunkFeatures(e, t) {
1409
- let r = await this.bam.read(e.fetchedSize(), e.minv.blockPosition, { signal: t.signal });
1405
+ let n = await this.bam.read(e.fetchedSize(), e.minv.blockPosition, { signal: t.signal });
1410
1406
  c(t.signal);
1411
- let { buffer: i, cpositions: a, dpositions: o } = await n(r, e);
1407
+ let { buffer: r, cpositions: a, dpositions: o } = await i(n, e);
1412
1408
  return {
1413
- features: this.readBamFeatures(i, a, o, e),
1414
- bytes: i.byteLength
1409
+ features: this.readBamFeatures(r, a, o, e),
1410
+ bytes: r.byteLength
1415
1411
  };
1416
1412
  }
1417
1413
  readBamFeatures(e, t, n, r) {
@@ -1492,8 +1488,8 @@ async function we(e, { url: t, headers: n }, r) {
1492
1488
  });
1493
1489
  return new Uint8Array(await o.arrayBuffer());
1494
1490
  }
1495
- async function Te(e, n, r) {
1496
- return g(await Promise.all(n.map(async (n) => t(await we(e, n, r)))));
1491
+ async function Te(e, t, n) {
1492
+ return g(await Promise.all(t.map(async (t) => r(await we(e, t, n)))));
1497
1493
  }
1498
1494
  var Ee = class extends Q {
1499
1495
  baseUrl;