@genome-spy/app 0.58.3 → 0.60.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.
- package/dist/{index-DwLfOHEk.js → index-5ajWdKly.js} +1 -1
- package/dist/{index-vgGDWUPz.js → index-B03-Om4z.js} +1 -1
- package/dist/index-Bg7C4Xat.js +2750 -0
- package/dist/{index-CalimFw3.js → index-C3QR8Lv6.js} +79 -79
- package/dist/{index-DKe9Bhvi.js → index-g8iXgW0W.js} +1 -1
- package/dist/index.es.js +9756 -8985
- package/dist/index.js +575 -370
- package/dist/{long-BviWyoZx.js → long-B-FASCSo.js} +45 -45
- package/package.json +3 -3
- package/dist/index-DS2hvLgl.js +0 -3425
package/dist/index-DS2hvLgl.js
DELETED
@@ -1,3425 +0,0 @@
|
|
1
|
-
import { b as ee } from "./index-BftNdA0O.js";
|
2
|
-
import { A as Kn, L as Gn } from "./index-CCJIjehY.js";
|
3
|
-
import { L as nr } from "./__vite-browser-external-C--ziKoh.js";
|
4
|
-
import { R as ir } from "./remoteFile-BuaqFGWk.js";
|
5
|
-
const Yn = BigInt(32);
|
6
|
-
function rr(e, n, t) {
|
7
|
-
const i = +!!t, a = +!t;
|
8
|
-
return BigInt(e.getInt32(n, t) * a + e.getInt32(n + 4, t) * i) << Yn | BigInt(e.getUint32(n, t) * i + e.getUint32(n + 4, t) * a);
|
9
|
-
}
|
10
|
-
function ar(e, n, t) {
|
11
|
-
const i = e.getUint32(n, t), a = e.getUint32(n + 4, t), r = +!!t, o = +!t;
|
12
|
-
return BigInt(i * o + a * r) << Yn | BigInt(i * r + a * o);
|
13
|
-
}
|
14
|
-
"getBigInt64" in DataView || (DataView.prototype.getBigInt64 = function(e, n) {
|
15
|
-
return rr(this, e, n);
|
16
|
-
});
|
17
|
-
"getBigUint64" in DataView || (DataView.prototype.getBigUint64 = function(e, n) {
|
18
|
-
return ar(this, e, n);
|
19
|
-
});
|
20
|
-
class be {
|
21
|
-
constructor(n) {
|
22
|
-
this.ranges = n;
|
23
|
-
}
|
24
|
-
get min() {
|
25
|
-
return this.ranges[0].min;
|
26
|
-
}
|
27
|
-
get max() {
|
28
|
-
return this.ranges.at(-1).max;
|
29
|
-
}
|
30
|
-
contains(n) {
|
31
|
-
for (const t of this.ranges)
|
32
|
-
if (t.min <= n && t.max >= n)
|
33
|
-
return !0;
|
34
|
-
return !1;
|
35
|
-
}
|
36
|
-
isContiguous() {
|
37
|
-
return this.ranges.length > 1;
|
38
|
-
}
|
39
|
-
getRanges() {
|
40
|
-
return this.ranges.map((n) => new be([{ min: n.min, max: n.max }]));
|
41
|
-
}
|
42
|
-
toString() {
|
43
|
-
return this.ranges.map((n) => `[${n.min}-${n.max}]`).join(",");
|
44
|
-
}
|
45
|
-
union(n) {
|
46
|
-
const t = [...this.getRanges(), ...n.getRanges()].sort((r, o) => r.min < o.min ? -1 : r.min > o.min ? 1 : r.max < o.max ? -1 : o.max > r.max ? 1 : 0), i = [];
|
47
|
-
let a = t[0];
|
48
|
-
for (const r of t)
|
49
|
-
r.min > a.max + 1 ? (i.push(a), a = r) : r.max > a.max && (a = new be([{ min: a.min, max: r.max }]));
|
50
|
-
return i.push(a), i.length === 1 ? i[0] : new be(i);
|
51
|
-
}
|
52
|
-
}
|
53
|
-
/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */
|
54
|
-
const or = 4, qt = 0, en = 1, lr = 2;
|
55
|
-
function ve(e) {
|
56
|
-
let n = e.length;
|
57
|
-
for (; --n >= 0; )
|
58
|
-
e[n] = 0;
|
59
|
-
}
|
60
|
-
const sr = 0, jn = 1, cr = 2, fr = 3, ur = 258, Ht = 29, He = 256, Ue = He + 1 + Ht, ge = 30, Pt = 19, Xn = 2 * Ue + 1, oe = 15, ut = 16, hr = 7, Vt = 256, Wn = 16, Jn = 17, Qn = 18, Ot = (
|
61
|
-
/* extra bits for each length code */
|
62
|
-
new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0])
|
63
|
-
), qe = (
|
64
|
-
/* extra bits for each distance code */
|
65
|
-
new Uint8Array([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13])
|
66
|
-
), dr = (
|
67
|
-
/* extra bits for each bit length code */
|
68
|
-
new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7])
|
69
|
-
), qn = new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), _r = 512, J = new Array((Ue + 2) * 2);
|
70
|
-
ve(J);
|
71
|
-
const ze = new Array(ge * 2);
|
72
|
-
ve(ze);
|
73
|
-
const Be = new Array(_r);
|
74
|
-
ve(Be);
|
75
|
-
const De = new Array(ur - fr + 1);
|
76
|
-
ve(De);
|
77
|
-
const Kt = new Array(Ht);
|
78
|
-
ve(Kt);
|
79
|
-
const et = new Array(ge);
|
80
|
-
ve(et);
|
81
|
-
function ht(e, n, t, i, a) {
|
82
|
-
this.static_tree = e, this.extra_bits = n, this.extra_base = t, this.elems = i, this.max_length = a, this.has_stree = e && e.length;
|
83
|
-
}
|
84
|
-
let ei, ti, ni;
|
85
|
-
function dt(e, n) {
|
86
|
-
this.dyn_tree = e, this.max_code = 0, this.stat_desc = n;
|
87
|
-
}
|
88
|
-
const ii = (e) => e < 256 ? Be[e] : Be[256 + (e >>> 7)], Ne = (e, n) => {
|
89
|
-
e.pending_buf[e.pending++] = n & 255, e.pending_buf[e.pending++] = n >>> 8 & 255;
|
90
|
-
}, M = (e, n, t) => {
|
91
|
-
e.bi_valid > ut - t ? (e.bi_buf |= n << e.bi_valid & 65535, Ne(e, e.bi_buf), e.bi_buf = n >> ut - e.bi_valid, e.bi_valid += t - ut) : (e.bi_buf |= n << e.bi_valid & 65535, e.bi_valid += t);
|
92
|
-
}, Y = (e, n, t) => {
|
93
|
-
M(
|
94
|
-
e,
|
95
|
-
t[n * 2],
|
96
|
-
t[n * 2 + 1]
|
97
|
-
/*.Len*/
|
98
|
-
);
|
99
|
-
}, ri = (e, n) => {
|
100
|
-
let t = 0;
|
101
|
-
do
|
102
|
-
t |= e & 1, e >>>= 1, t <<= 1;
|
103
|
-
while (--n > 0);
|
104
|
-
return t >>> 1;
|
105
|
-
}, br = (e) => {
|
106
|
-
e.bi_valid === 16 ? (Ne(e, e.bi_buf), e.bi_buf = 0, e.bi_valid = 0) : e.bi_valid >= 8 && (e.pending_buf[e.pending++] = e.bi_buf & 255, e.bi_buf >>= 8, e.bi_valid -= 8);
|
107
|
-
}, gr = (e, n) => {
|
108
|
-
const t = n.dyn_tree, i = n.max_code, a = n.stat_desc.static_tree, r = n.stat_desc.has_stree, o = n.stat_desc.extra_bits, s = n.stat_desc.extra_base, f = n.stat_desc.max_length;
|
109
|
-
let l, c, w, h, u, d, g = 0;
|
110
|
-
for (h = 0; h <= oe; h++)
|
111
|
-
e.bl_count[h] = 0;
|
112
|
-
for (t[e.heap[e.heap_max] * 2 + 1] = 0, l = e.heap_max + 1; l < Xn; l++)
|
113
|
-
c = e.heap[l], h = t[t[c * 2 + 1] * 2 + 1] + 1, h > f && (h = f, g++), t[c * 2 + 1] = h, !(c > i) && (e.bl_count[h]++, u = 0, c >= s && (u = o[c - s]), d = t[c * 2], e.opt_len += d * (h + u), r && (e.static_len += d * (a[c * 2 + 1] + u)));
|
114
|
-
if (g !== 0) {
|
115
|
-
do {
|
116
|
-
for (h = f - 1; e.bl_count[h] === 0; )
|
117
|
-
h--;
|
118
|
-
e.bl_count[h]--, e.bl_count[h + 1] += 2, e.bl_count[f]--, g -= 2;
|
119
|
-
} while (g > 0);
|
120
|
-
for (h = f; h !== 0; h--)
|
121
|
-
for (c = e.bl_count[h]; c !== 0; )
|
122
|
-
w = e.heap[--l], !(w > i) && (t[w * 2 + 1] !== h && (e.opt_len += (h - t[w * 2 + 1]) * t[w * 2], t[w * 2 + 1] = h), c--);
|
123
|
-
}
|
124
|
-
}, ai = (e, n, t) => {
|
125
|
-
const i = new Array(oe + 1);
|
126
|
-
let a = 0, r, o;
|
127
|
-
for (r = 1; r <= oe; r++)
|
128
|
-
a = a + t[r - 1] << 1, i[r] = a;
|
129
|
-
for (o = 0; o <= n; o++) {
|
130
|
-
let s = e[o * 2 + 1];
|
131
|
-
s !== 0 && (e[o * 2] = ri(i[s]++, s));
|
132
|
-
}
|
133
|
-
}, wr = () => {
|
134
|
-
let e, n, t, i, a;
|
135
|
-
const r = new Array(oe + 1);
|
136
|
-
for (t = 0, i = 0; i < Ht - 1; i++)
|
137
|
-
for (Kt[i] = t, e = 0; e < 1 << Ot[i]; e++)
|
138
|
-
De[t++] = i;
|
139
|
-
for (De[t - 1] = i, a = 0, i = 0; i < 16; i++)
|
140
|
-
for (et[i] = a, e = 0; e < 1 << qe[i]; e++)
|
141
|
-
Be[a++] = i;
|
142
|
-
for (a >>= 7; i < ge; i++)
|
143
|
-
for (et[i] = a << 7, e = 0; e < 1 << qe[i] - 7; e++)
|
144
|
-
Be[256 + a++] = i;
|
145
|
-
for (n = 0; n <= oe; n++)
|
146
|
-
r[n] = 0;
|
147
|
-
for (e = 0; e <= 143; )
|
148
|
-
J[e * 2 + 1] = 8, e++, r[8]++;
|
149
|
-
for (; e <= 255; )
|
150
|
-
J[e * 2 + 1] = 9, e++, r[9]++;
|
151
|
-
for (; e <= 279; )
|
152
|
-
J[e * 2 + 1] = 7, e++, r[7]++;
|
153
|
-
for (; e <= 287; )
|
154
|
-
J[e * 2 + 1] = 8, e++, r[8]++;
|
155
|
-
for (ai(J, Ue + 1, r), e = 0; e < ge; e++)
|
156
|
-
ze[e * 2 + 1] = 5, ze[e * 2] = ri(e, 5);
|
157
|
-
ei = new ht(J, Ot, He + 1, Ue, oe), ti = new ht(ze, qe, 0, ge, oe), ni = new ht(new Array(0), dr, 0, Pt, hr);
|
158
|
-
}, oi = (e) => {
|
159
|
-
let n;
|
160
|
-
for (n = 0; n < Ue; n++)
|
161
|
-
e.dyn_ltree[n * 2] = 0;
|
162
|
-
for (n = 0; n < ge; n++)
|
163
|
-
e.dyn_dtree[n * 2] = 0;
|
164
|
-
for (n = 0; n < Pt; n++)
|
165
|
-
e.bl_tree[n * 2] = 0;
|
166
|
-
e.dyn_ltree[Vt * 2] = 1, e.opt_len = e.static_len = 0, e.sym_next = e.matches = 0;
|
167
|
-
}, li = (e) => {
|
168
|
-
e.bi_valid > 8 ? Ne(e, e.bi_buf) : e.bi_valid > 0 && (e.pending_buf[e.pending++] = e.bi_buf), e.bi_buf = 0, e.bi_valid = 0;
|
169
|
-
}, tn = (e, n, t, i) => {
|
170
|
-
const a = n * 2, r = t * 2;
|
171
|
-
return e[a] < e[r] || e[a] === e[r] && i[n] <= i[t];
|
172
|
-
}, _t = (e, n, t) => {
|
173
|
-
const i = e.heap[t];
|
174
|
-
let a = t << 1;
|
175
|
-
for (; a <= e.heap_len && (a < e.heap_len && tn(n, e.heap[a + 1], e.heap[a], e.depth) && a++, !tn(n, i, e.heap[a], e.depth)); )
|
176
|
-
e.heap[t] = e.heap[a], t = a, a <<= 1;
|
177
|
-
e.heap[t] = i;
|
178
|
-
}, nn = (e, n, t) => {
|
179
|
-
let i, a, r = 0, o, s;
|
180
|
-
if (e.sym_next !== 0)
|
181
|
-
do
|
182
|
-
i = e.pending_buf[e.sym_buf + r++] & 255, i += (e.pending_buf[e.sym_buf + r++] & 255) << 8, a = e.pending_buf[e.sym_buf + r++], i === 0 ? Y(e, a, n) : (o = De[a], Y(e, o + He + 1, n), s = Ot[o], s !== 0 && (a -= Kt[o], M(e, a, s)), i--, o = ii(i), Y(e, o, t), s = qe[o], s !== 0 && (i -= et[o], M(e, i, s)));
|
183
|
-
while (r < e.sym_next);
|
184
|
-
Y(e, Vt, n);
|
185
|
-
}, Rt = (e, n) => {
|
186
|
-
const t = n.dyn_tree, i = n.stat_desc.static_tree, a = n.stat_desc.has_stree, r = n.stat_desc.elems;
|
187
|
-
let o, s, f = -1, l;
|
188
|
-
for (e.heap_len = 0, e.heap_max = Xn, o = 0; o < r; o++)
|
189
|
-
t[o * 2] !== 0 ? (e.heap[++e.heap_len] = f = o, e.depth[o] = 0) : t[o * 2 + 1] = 0;
|
190
|
-
for (; e.heap_len < 2; )
|
191
|
-
l = e.heap[++e.heap_len] = f < 2 ? ++f : 0, t[l * 2] = 1, e.depth[l] = 0, e.opt_len--, a && (e.static_len -= i[l * 2 + 1]);
|
192
|
-
for (n.max_code = f, o = e.heap_len >> 1; o >= 1; o--)
|
193
|
-
_t(e, t, o);
|
194
|
-
l = r;
|
195
|
-
do
|
196
|
-
o = e.heap[
|
197
|
-
1
|
198
|
-
/*SMALLEST*/
|
199
|
-
], e.heap[
|
200
|
-
1
|
201
|
-
/*SMALLEST*/
|
202
|
-
] = e.heap[e.heap_len--], _t(
|
203
|
-
e,
|
204
|
-
t,
|
205
|
-
1
|
206
|
-
/*SMALLEST*/
|
207
|
-
), s = e.heap[
|
208
|
-
1
|
209
|
-
/*SMALLEST*/
|
210
|
-
], e.heap[--e.heap_max] = o, e.heap[--e.heap_max] = s, t[l * 2] = t[o * 2] + t[s * 2], e.depth[l] = (e.depth[o] >= e.depth[s] ? e.depth[o] : e.depth[s]) + 1, t[o * 2 + 1] = t[s * 2 + 1] = l, e.heap[
|
211
|
-
1
|
212
|
-
/*SMALLEST*/
|
213
|
-
] = l++, _t(
|
214
|
-
e,
|
215
|
-
t,
|
216
|
-
1
|
217
|
-
/*SMALLEST*/
|
218
|
-
);
|
219
|
-
while (e.heap_len >= 2);
|
220
|
-
e.heap[--e.heap_max] = e.heap[
|
221
|
-
1
|
222
|
-
/*SMALLEST*/
|
223
|
-
], gr(e, n), ai(t, f, e.bl_count);
|
224
|
-
}, rn = (e, n, t) => {
|
225
|
-
let i, a = -1, r, o = n[0 * 2 + 1], s = 0, f = 7, l = 4;
|
226
|
-
for (o === 0 && (f = 138, l = 3), n[(t + 1) * 2 + 1] = 65535, i = 0; i <= t; i++)
|
227
|
-
r = o, o = n[(i + 1) * 2 + 1], !(++s < f && r === o) && (s < l ? e.bl_tree[r * 2] += s : r !== 0 ? (r !== a && e.bl_tree[r * 2]++, e.bl_tree[Wn * 2]++) : s <= 10 ? e.bl_tree[Jn * 2]++ : e.bl_tree[Qn * 2]++, s = 0, a = r, o === 0 ? (f = 138, l = 3) : r === o ? (f = 6, l = 3) : (f = 7, l = 4));
|
228
|
-
}, an = (e, n, t) => {
|
229
|
-
let i, a = -1, r, o = n[0 * 2 + 1], s = 0, f = 7, l = 4;
|
230
|
-
for (o === 0 && (f = 138, l = 3), i = 0; i <= t; i++)
|
231
|
-
if (r = o, o = n[(i + 1) * 2 + 1], !(++s < f && r === o)) {
|
232
|
-
if (s < l)
|
233
|
-
do
|
234
|
-
Y(e, r, e.bl_tree);
|
235
|
-
while (--s !== 0);
|
236
|
-
else r !== 0 ? (r !== a && (Y(e, r, e.bl_tree), s--), Y(e, Wn, e.bl_tree), M(e, s - 3, 2)) : s <= 10 ? (Y(e, Jn, e.bl_tree), M(e, s - 3, 3)) : (Y(e, Qn, e.bl_tree), M(e, s - 11, 7));
|
237
|
-
s = 0, a = r, o === 0 ? (f = 138, l = 3) : r === o ? (f = 6, l = 3) : (f = 7, l = 4);
|
238
|
-
}
|
239
|
-
}, pr = (e) => {
|
240
|
-
let n;
|
241
|
-
for (rn(e, e.dyn_ltree, e.l_desc.max_code), rn(e, e.dyn_dtree, e.d_desc.max_code), Rt(e, e.bl_desc), n = Pt - 1; n >= 3 && e.bl_tree[qn[n] * 2 + 1] === 0; n--)
|
242
|
-
;
|
243
|
-
return e.opt_len += 3 * (n + 1) + 5 + 5 + 4, n;
|
244
|
-
}, mr = (e, n, t, i) => {
|
245
|
-
let a;
|
246
|
-
for (M(e, n - 257, 5), M(e, t - 1, 5), M(e, i - 4, 4), a = 0; a < i; a++)
|
247
|
-
M(e, e.bl_tree[qn[a] * 2 + 1], 3);
|
248
|
-
an(e, e.dyn_ltree, n - 1), an(e, e.dyn_dtree, t - 1);
|
249
|
-
}, yr = (e) => {
|
250
|
-
let n = 4093624447, t;
|
251
|
-
for (t = 0; t <= 31; t++, n >>>= 1)
|
252
|
-
if (n & 1 && e.dyn_ltree[t * 2] !== 0)
|
253
|
-
return qt;
|
254
|
-
if (e.dyn_ltree[9 * 2] !== 0 || e.dyn_ltree[10 * 2] !== 0 || e.dyn_ltree[13 * 2] !== 0)
|
255
|
-
return en;
|
256
|
-
for (t = 32; t < He; t++)
|
257
|
-
if (e.dyn_ltree[t * 2] !== 0)
|
258
|
-
return en;
|
259
|
-
return qt;
|
260
|
-
};
|
261
|
-
let on = !1;
|
262
|
-
const vr = (e) => {
|
263
|
-
on || (wr(), on = !0), e.l_desc = new dt(e.dyn_ltree, ei), e.d_desc = new dt(e.dyn_dtree, ti), e.bl_desc = new dt(e.bl_tree, ni), e.bi_buf = 0, e.bi_valid = 0, oi(e);
|
264
|
-
}, si = (e, n, t, i) => {
|
265
|
-
M(e, (sr << 1) + (i ? 1 : 0), 3), li(e), Ne(e, t), Ne(e, ~t), t && e.pending_buf.set(e.window.subarray(n, n + t), e.pending), e.pending += t;
|
266
|
-
}, kr = (e) => {
|
267
|
-
M(e, jn << 1, 3), Y(e, Vt, J), br(e);
|
268
|
-
}, Er = (e, n, t, i) => {
|
269
|
-
let a, r, o = 0;
|
270
|
-
e.level > 0 ? (e.strm.data_type === lr && (e.strm.data_type = yr(e)), Rt(e, e.l_desc), Rt(e, e.d_desc), o = pr(e), a = e.opt_len + 3 + 7 >>> 3, r = e.static_len + 3 + 7 >>> 3, r <= a && (a = r)) : a = r = t + 5, t + 4 <= a && n !== -1 ? si(e, n, t, i) : e.strategy === or || r === a ? (M(e, (jn << 1) + (i ? 1 : 0), 3), nn(e, J, ze)) : (M(e, (cr << 1) + (i ? 1 : 0), 3), mr(e, e.l_desc.max_code + 1, e.d_desc.max_code + 1, o + 1), nn(e, e.dyn_ltree, e.dyn_dtree)), oi(e), i && li(e);
|
271
|
-
}, xr = (e, n, t) => (e.pending_buf[e.sym_buf + e.sym_next++] = n, e.pending_buf[e.sym_buf + e.sym_next++] = n >> 8, e.pending_buf[e.sym_buf + e.sym_next++] = t, n === 0 ? e.dyn_ltree[t * 2]++ : (e.matches++, n--, e.dyn_ltree[(De[t] + He + 1) * 2]++, e.dyn_dtree[ii(n) * 2]++), e.sym_next === e.sym_end);
|
272
|
-
var Sr = vr, Ar = si, Ir = Er, Tr = xr, zr = kr, Or = {
|
273
|
-
_tr_init: Sr,
|
274
|
-
_tr_stored_block: Ar,
|
275
|
-
_tr_flush_block: Ir,
|
276
|
-
_tr_tally: Tr,
|
277
|
-
_tr_align: zr
|
278
|
-
};
|
279
|
-
const Rr = (e, n, t, i) => {
|
280
|
-
let a = e & 65535 | 0, r = e >>> 16 & 65535 | 0, o = 0;
|
281
|
-
for (; t !== 0; ) {
|
282
|
-
o = t > 2e3 ? 2e3 : t, t -= o;
|
283
|
-
do
|
284
|
-
a = a + n[i++] | 0, r = r + a | 0;
|
285
|
-
while (--o);
|
286
|
-
a %= 65521, r %= 65521;
|
287
|
-
}
|
288
|
-
return a | r << 16 | 0;
|
289
|
-
};
|
290
|
-
var Le = Rr;
|
291
|
-
const Ur = () => {
|
292
|
-
let e, n = [];
|
293
|
-
for (var t = 0; t < 256; t++) {
|
294
|
-
e = t;
|
295
|
-
for (var i = 0; i < 8; i++)
|
296
|
-
e = e & 1 ? 3988292384 ^ e >>> 1 : e >>> 1;
|
297
|
-
n[t] = e;
|
298
|
-
}
|
299
|
-
return n;
|
300
|
-
}, Br = new Uint32Array(Ur()), Dr = (e, n, t, i) => {
|
301
|
-
const a = Br, r = i + t;
|
302
|
-
e ^= -1;
|
303
|
-
for (let o = i; o < r; o++)
|
304
|
-
e = e >>> 8 ^ a[(e ^ n[o]) & 255];
|
305
|
-
return e ^ -1;
|
306
|
-
};
|
307
|
-
var N = Dr, pe = {
|
308
|
-
2: "need dictionary",
|
309
|
-
/* Z_NEED_DICT 2 */
|
310
|
-
1: "stream end",
|
311
|
-
/* Z_STREAM_END 1 */
|
312
|
-
0: "",
|
313
|
-
/* Z_OK 0 */
|
314
|
-
"-1": "file error",
|
315
|
-
/* Z_ERRNO (-1) */
|
316
|
-
"-2": "stream error",
|
317
|
-
/* Z_STREAM_ERROR (-2) */
|
318
|
-
"-3": "data error",
|
319
|
-
/* Z_DATA_ERROR (-3) */
|
320
|
-
"-4": "insufficient memory",
|
321
|
-
/* Z_MEM_ERROR (-4) */
|
322
|
-
"-5": "buffer error",
|
323
|
-
/* Z_BUF_ERROR (-5) */
|
324
|
-
"-6": "incompatible version"
|
325
|
-
/* Z_VERSION_ERROR (-6) */
|
326
|
-
}, Pe = {
|
327
|
-
/* Allowed flush values; see deflate() and inflate() below for details */
|
328
|
-
Z_NO_FLUSH: 0,
|
329
|
-
Z_PARTIAL_FLUSH: 1,
|
330
|
-
Z_SYNC_FLUSH: 2,
|
331
|
-
Z_FULL_FLUSH: 3,
|
332
|
-
Z_FINISH: 4,
|
333
|
-
Z_BLOCK: 5,
|
334
|
-
Z_TREES: 6,
|
335
|
-
/* Return codes for the compression/decompression functions. Negative values
|
336
|
-
* are errors, positive values are used for special but normal events.
|
337
|
-
*/
|
338
|
-
Z_OK: 0,
|
339
|
-
Z_STREAM_END: 1,
|
340
|
-
Z_NEED_DICT: 2,
|
341
|
-
Z_ERRNO: -1,
|
342
|
-
Z_STREAM_ERROR: -2,
|
343
|
-
Z_DATA_ERROR: -3,
|
344
|
-
Z_MEM_ERROR: -4,
|
345
|
-
Z_BUF_ERROR: -5,
|
346
|
-
//Z_VERSION_ERROR: -6,
|
347
|
-
/* compression levels */
|
348
|
-
Z_NO_COMPRESSION: 0,
|
349
|
-
Z_BEST_SPEED: 1,
|
350
|
-
Z_BEST_COMPRESSION: 9,
|
351
|
-
Z_DEFAULT_COMPRESSION: -1,
|
352
|
-
Z_FILTERED: 1,
|
353
|
-
Z_HUFFMAN_ONLY: 2,
|
354
|
-
Z_RLE: 3,
|
355
|
-
Z_FIXED: 4,
|
356
|
-
Z_DEFAULT_STRATEGY: 0,
|
357
|
-
/* Possible values of the data_type field (though see inflate()) */
|
358
|
-
Z_BINARY: 0,
|
359
|
-
Z_TEXT: 1,
|
360
|
-
//Z_ASCII: 1, // = Z_TEXT (deprecated)
|
361
|
-
Z_UNKNOWN: 2,
|
362
|
-
/* The deflate compression method */
|
363
|
-
Z_DEFLATED: 8
|
364
|
-
//Z_NULL: null // Use -1 or null inline, depending on var type
|
365
|
-
};
|
366
|
-
const { _tr_init: Nr, _tr_stored_block: Ut, _tr_flush_block: Lr, _tr_tally: ne, _tr_align: Zr } = Or, {
|
367
|
-
Z_NO_FLUSH: ie,
|
368
|
-
Z_PARTIAL_FLUSH: Cr,
|
369
|
-
Z_FULL_FLUSH: Fr,
|
370
|
-
Z_FINISH: P,
|
371
|
-
Z_BLOCK: ln,
|
372
|
-
Z_OK: L,
|
373
|
-
Z_STREAM_END: sn,
|
374
|
-
Z_STREAM_ERROR: j,
|
375
|
-
Z_DATA_ERROR: Mr,
|
376
|
-
Z_BUF_ERROR: bt,
|
377
|
-
Z_DEFAULT_COMPRESSION: $r,
|
378
|
-
Z_FILTERED: Hr,
|
379
|
-
Z_HUFFMAN_ONLY: Ge,
|
380
|
-
Z_RLE: Pr,
|
381
|
-
Z_FIXED: Vr,
|
382
|
-
Z_DEFAULT_STRATEGY: Kr,
|
383
|
-
Z_UNKNOWN: Gr,
|
384
|
-
Z_DEFLATED: rt
|
385
|
-
} = Pe, Yr = 9, jr = 15, Xr = 8, Wr = 29, Jr = 256, Bt = Jr + 1 + Wr, Qr = 30, qr = 19, ea = 2 * Bt + 1, ta = 15, T = 3, te = 258, X = te + T + 1, na = 32, me = 42, Gt = 57, Dt = 69, Nt = 73, Lt = 91, Zt = 103, le = 113, Ie = 666, C = 1, ke = 2, fe = 3, Ee = 4, ia = 3, se = (e, n) => (e.msg = pe[n], n), cn = (e) => e * 2 - (e > 4 ? 9 : 0), q = (e) => {
|
386
|
-
let n = e.length;
|
387
|
-
for (; --n >= 0; )
|
388
|
-
e[n] = 0;
|
389
|
-
}, ra = (e) => {
|
390
|
-
let n, t, i, a = e.w_size;
|
391
|
-
n = e.hash_size, i = n;
|
392
|
-
do
|
393
|
-
t = e.head[--i], e.head[i] = t >= a ? t - a : 0;
|
394
|
-
while (--n);
|
395
|
-
n = a, i = n;
|
396
|
-
do
|
397
|
-
t = e.prev[--i], e.prev[i] = t >= a ? t - a : 0;
|
398
|
-
while (--n);
|
399
|
-
};
|
400
|
-
let aa = (e, n, t) => (n << e.hash_shift ^ t) & e.hash_mask, re = aa;
|
401
|
-
const $ = (e) => {
|
402
|
-
const n = e.state;
|
403
|
-
let t = n.pending;
|
404
|
-
t > e.avail_out && (t = e.avail_out), t !== 0 && (e.output.set(n.pending_buf.subarray(n.pending_out, n.pending_out + t), e.next_out), e.next_out += t, n.pending_out += t, e.total_out += t, e.avail_out -= t, n.pending -= t, n.pending === 0 && (n.pending_out = 0));
|
405
|
-
}, H = (e, n) => {
|
406
|
-
Lr(e, e.block_start >= 0 ? e.block_start : -1, e.strstart - e.block_start, n), e.block_start = e.strstart, $(e.strm);
|
407
|
-
}, z = (e, n) => {
|
408
|
-
e.pending_buf[e.pending++] = n;
|
409
|
-
}, Ae = (e, n) => {
|
410
|
-
e.pending_buf[e.pending++] = n >>> 8 & 255, e.pending_buf[e.pending++] = n & 255;
|
411
|
-
}, Ct = (e, n, t, i) => {
|
412
|
-
let a = e.avail_in;
|
413
|
-
return a > i && (a = i), a === 0 ? 0 : (e.avail_in -= a, n.set(e.input.subarray(e.next_in, e.next_in + a), t), e.state.wrap === 1 ? e.adler = Le(e.adler, n, a, t) : e.state.wrap === 2 && (e.adler = N(e.adler, n, a, t)), e.next_in += a, e.total_in += a, a);
|
414
|
-
}, ci = (e, n) => {
|
415
|
-
let t = e.max_chain_length, i = e.strstart, a, r, o = e.prev_length, s = e.nice_match;
|
416
|
-
const f = e.strstart > e.w_size - X ? e.strstart - (e.w_size - X) : 0, l = e.window, c = e.w_mask, w = e.prev, h = e.strstart + te;
|
417
|
-
let u = l[i + o - 1], d = l[i + o];
|
418
|
-
e.prev_length >= e.good_match && (t >>= 2), s > e.lookahead && (s = e.lookahead);
|
419
|
-
do
|
420
|
-
if (a = n, !(l[a + o] !== d || l[a + o - 1] !== u || l[a] !== l[i] || l[++a] !== l[i + 1])) {
|
421
|
-
i += 2, a++;
|
422
|
-
do
|
423
|
-
;
|
424
|
-
while (l[++i] === l[++a] && l[++i] === l[++a] && l[++i] === l[++a] && l[++i] === l[++a] && l[++i] === l[++a] && l[++i] === l[++a] && l[++i] === l[++a] && l[++i] === l[++a] && i < h);
|
425
|
-
if (r = te - (h - i), i = h - te, r > o) {
|
426
|
-
if (e.match_start = n, o = r, r >= s)
|
427
|
-
break;
|
428
|
-
u = l[i + o - 1], d = l[i + o];
|
429
|
-
}
|
430
|
-
}
|
431
|
-
while ((n = w[n & c]) > f && --t !== 0);
|
432
|
-
return o <= e.lookahead ? o : e.lookahead;
|
433
|
-
}, ye = (e) => {
|
434
|
-
const n = e.w_size;
|
435
|
-
let t, i, a;
|
436
|
-
do {
|
437
|
-
if (i = e.window_size - e.lookahead - e.strstart, e.strstart >= n + (n - X) && (e.window.set(e.window.subarray(n, n + n - i), 0), e.match_start -= n, e.strstart -= n, e.block_start -= n, e.insert > e.strstart && (e.insert = e.strstart), ra(e), i += n), e.strm.avail_in === 0)
|
438
|
-
break;
|
439
|
-
if (t = Ct(e.strm, e.window, e.strstart + e.lookahead, i), e.lookahead += t, e.lookahead + e.insert >= T)
|
440
|
-
for (a = e.strstart - e.insert, e.ins_h = e.window[a], e.ins_h = re(e, e.ins_h, e.window[a + 1]); e.insert && (e.ins_h = re(e, e.ins_h, e.window[a + T - 1]), e.prev[a & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = a, a++, e.insert--, !(e.lookahead + e.insert < T)); )
|
441
|
-
;
|
442
|
-
} while (e.lookahead < X && e.strm.avail_in !== 0);
|
443
|
-
}, fi = (e, n) => {
|
444
|
-
let t = e.pending_buf_size - 5 > e.w_size ? e.w_size : e.pending_buf_size - 5, i, a, r, o = 0, s = e.strm.avail_in;
|
445
|
-
do {
|
446
|
-
if (i = 65535, r = e.bi_valid + 42 >> 3, e.strm.avail_out < r || (r = e.strm.avail_out - r, a = e.strstart - e.block_start, i > a + e.strm.avail_in && (i = a + e.strm.avail_in), i > r && (i = r), i < t && (i === 0 && n !== P || n === ie || i !== a + e.strm.avail_in)))
|
447
|
-
break;
|
448
|
-
o = n === P && i === a + e.strm.avail_in ? 1 : 0, Ut(e, 0, 0, o), e.pending_buf[e.pending - 4] = i, e.pending_buf[e.pending - 3] = i >> 8, e.pending_buf[e.pending - 2] = ~i, e.pending_buf[e.pending - 1] = ~i >> 8, $(e.strm), a && (a > i && (a = i), e.strm.output.set(e.window.subarray(e.block_start, e.block_start + a), e.strm.next_out), e.strm.next_out += a, e.strm.avail_out -= a, e.strm.total_out += a, e.block_start += a, i -= a), i && (Ct(e.strm, e.strm.output, e.strm.next_out, i), e.strm.next_out += i, e.strm.avail_out -= i, e.strm.total_out += i);
|
449
|
-
} while (o === 0);
|
450
|
-
return s -= e.strm.avail_in, s && (s >= e.w_size ? (e.matches = 2, e.window.set(e.strm.input.subarray(e.strm.next_in - e.w_size, e.strm.next_in), 0), e.strstart = e.w_size, e.insert = e.strstart) : (e.window_size - e.strstart <= s && (e.strstart -= e.w_size, e.window.set(e.window.subarray(e.w_size, e.w_size + e.strstart), 0), e.matches < 2 && e.matches++, e.insert > e.strstart && (e.insert = e.strstart)), e.window.set(e.strm.input.subarray(e.strm.next_in - s, e.strm.next_in), e.strstart), e.strstart += s, e.insert += s > e.w_size - e.insert ? e.w_size - e.insert : s), e.block_start = e.strstart), e.high_water < e.strstart && (e.high_water = e.strstart), o ? Ee : n !== ie && n !== P && e.strm.avail_in === 0 && e.strstart === e.block_start ? ke : (r = e.window_size - e.strstart, e.strm.avail_in > r && e.block_start >= e.w_size && (e.block_start -= e.w_size, e.strstart -= e.w_size, e.window.set(e.window.subarray(e.w_size, e.w_size + e.strstart), 0), e.matches < 2 && e.matches++, r += e.w_size, e.insert > e.strstart && (e.insert = e.strstart)), r > e.strm.avail_in && (r = e.strm.avail_in), r && (Ct(e.strm, e.window, e.strstart, r), e.strstart += r, e.insert += r > e.w_size - e.insert ? e.w_size - e.insert : r), e.high_water < e.strstart && (e.high_water = e.strstart), r = e.bi_valid + 42 >> 3, r = e.pending_buf_size - r > 65535 ? 65535 : e.pending_buf_size - r, t = r > e.w_size ? e.w_size : r, a = e.strstart - e.block_start, (a >= t || (a || n === P) && n !== ie && e.strm.avail_in === 0 && a <= r) && (i = a > r ? r : a, o = n === P && e.strm.avail_in === 0 && i === a ? 1 : 0, Ut(e, e.block_start, i, o), e.block_start += i, $(e.strm)), o ? fe : C);
|
451
|
-
}, gt = (e, n) => {
|
452
|
-
let t, i;
|
453
|
-
for (; ; ) {
|
454
|
-
if (e.lookahead < X) {
|
455
|
-
if (ye(e), e.lookahead < X && n === ie)
|
456
|
-
return C;
|
457
|
-
if (e.lookahead === 0)
|
458
|
-
break;
|
459
|
-
}
|
460
|
-
if (t = 0, e.lookahead >= T && (e.ins_h = re(e, e.ins_h, e.window[e.strstart + T - 1]), t = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart), t !== 0 && e.strstart - t <= e.w_size - X && (e.match_length = ci(e, t)), e.match_length >= T)
|
461
|
-
if (i = ne(e, e.strstart - e.match_start, e.match_length - T), e.lookahead -= e.match_length, e.match_length <= e.max_lazy_match && e.lookahead >= T) {
|
462
|
-
e.match_length--;
|
463
|
-
do
|
464
|
-
e.strstart++, e.ins_h = re(e, e.ins_h, e.window[e.strstart + T - 1]), t = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart;
|
465
|
-
while (--e.match_length !== 0);
|
466
|
-
e.strstart++;
|
467
|
-
} else
|
468
|
-
e.strstart += e.match_length, e.match_length = 0, e.ins_h = e.window[e.strstart], e.ins_h = re(e, e.ins_h, e.window[e.strstart + 1]);
|
469
|
-
else
|
470
|
-
i = ne(e, 0, e.window[e.strstart]), e.lookahead--, e.strstart++;
|
471
|
-
if (i && (H(e, !1), e.strm.avail_out === 0))
|
472
|
-
return C;
|
473
|
-
}
|
474
|
-
return e.insert = e.strstart < T - 1 ? e.strstart : T - 1, n === P ? (H(e, !0), e.strm.avail_out === 0 ? fe : Ee) : e.sym_next && (H(e, !1), e.strm.avail_out === 0) ? C : ke;
|
475
|
-
}, de = (e, n) => {
|
476
|
-
let t, i, a;
|
477
|
-
for (; ; ) {
|
478
|
-
if (e.lookahead < X) {
|
479
|
-
if (ye(e), e.lookahead < X && n === ie)
|
480
|
-
return C;
|
481
|
-
if (e.lookahead === 0)
|
482
|
-
break;
|
483
|
-
}
|
484
|
-
if (t = 0, e.lookahead >= T && (e.ins_h = re(e, e.ins_h, e.window[e.strstart + T - 1]), t = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart), e.prev_length = e.match_length, e.prev_match = e.match_start, e.match_length = T - 1, t !== 0 && e.prev_length < e.max_lazy_match && e.strstart - t <= e.w_size - X && (e.match_length = ci(e, t), e.match_length <= 5 && (e.strategy === Hr || e.match_length === T && e.strstart - e.match_start > 4096) && (e.match_length = T - 1)), e.prev_length >= T && e.match_length <= e.prev_length) {
|
485
|
-
a = e.strstart + e.lookahead - T, i = ne(e, e.strstart - 1 - e.prev_match, e.prev_length - T), e.lookahead -= e.prev_length - 1, e.prev_length -= 2;
|
486
|
-
do
|
487
|
-
++e.strstart <= a && (e.ins_h = re(e, e.ins_h, e.window[e.strstart + T - 1]), t = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart);
|
488
|
-
while (--e.prev_length !== 0);
|
489
|
-
if (e.match_available = 0, e.match_length = T - 1, e.strstart++, i && (H(e, !1), e.strm.avail_out === 0))
|
490
|
-
return C;
|
491
|
-
} else if (e.match_available) {
|
492
|
-
if (i = ne(e, 0, e.window[e.strstart - 1]), i && H(e, !1), e.strstart++, e.lookahead--, e.strm.avail_out === 0)
|
493
|
-
return C;
|
494
|
-
} else
|
495
|
-
e.match_available = 1, e.strstart++, e.lookahead--;
|
496
|
-
}
|
497
|
-
return e.match_available && (i = ne(e, 0, e.window[e.strstart - 1]), e.match_available = 0), e.insert = e.strstart < T - 1 ? e.strstart : T - 1, n === P ? (H(e, !0), e.strm.avail_out === 0 ? fe : Ee) : e.sym_next && (H(e, !1), e.strm.avail_out === 0) ? C : ke;
|
498
|
-
}, oa = (e, n) => {
|
499
|
-
let t, i, a, r;
|
500
|
-
const o = e.window;
|
501
|
-
for (; ; ) {
|
502
|
-
if (e.lookahead <= te) {
|
503
|
-
if (ye(e), e.lookahead <= te && n === ie)
|
504
|
-
return C;
|
505
|
-
if (e.lookahead === 0)
|
506
|
-
break;
|
507
|
-
}
|
508
|
-
if (e.match_length = 0, e.lookahead >= T && e.strstart > 0 && (a = e.strstart - 1, i = o[a], i === o[++a] && i === o[++a] && i === o[++a])) {
|
509
|
-
r = e.strstart + te;
|
510
|
-
do
|
511
|
-
;
|
512
|
-
while (i === o[++a] && i === o[++a] && i === o[++a] && i === o[++a] && i === o[++a] && i === o[++a] && i === o[++a] && i === o[++a] && a < r);
|
513
|
-
e.match_length = te - (r - a), e.match_length > e.lookahead && (e.match_length = e.lookahead);
|
514
|
-
}
|
515
|
-
if (e.match_length >= T ? (t = ne(e, 1, e.match_length - T), e.lookahead -= e.match_length, e.strstart += e.match_length, e.match_length = 0) : (t = ne(e, 0, e.window[e.strstart]), e.lookahead--, e.strstart++), t && (H(e, !1), e.strm.avail_out === 0))
|
516
|
-
return C;
|
517
|
-
}
|
518
|
-
return e.insert = 0, n === P ? (H(e, !0), e.strm.avail_out === 0 ? fe : Ee) : e.sym_next && (H(e, !1), e.strm.avail_out === 0) ? C : ke;
|
519
|
-
}, la = (e, n) => {
|
520
|
-
let t;
|
521
|
-
for (; ; ) {
|
522
|
-
if (e.lookahead === 0 && (ye(e), e.lookahead === 0)) {
|
523
|
-
if (n === ie)
|
524
|
-
return C;
|
525
|
-
break;
|
526
|
-
}
|
527
|
-
if (e.match_length = 0, t = ne(e, 0, e.window[e.strstart]), e.lookahead--, e.strstart++, t && (H(e, !1), e.strm.avail_out === 0))
|
528
|
-
return C;
|
529
|
-
}
|
530
|
-
return e.insert = 0, n === P ? (H(e, !0), e.strm.avail_out === 0 ? fe : Ee) : e.sym_next && (H(e, !1), e.strm.avail_out === 0) ? C : ke;
|
531
|
-
};
|
532
|
-
function G(e, n, t, i, a) {
|
533
|
-
this.good_length = e, this.max_lazy = n, this.nice_length = t, this.max_chain = i, this.func = a;
|
534
|
-
}
|
535
|
-
const Te = [
|
536
|
-
/* good lazy nice chain */
|
537
|
-
new G(0, 0, 0, 0, fi),
|
538
|
-
/* 0 store only */
|
539
|
-
new G(4, 4, 8, 4, gt),
|
540
|
-
/* 1 max speed, no lazy matches */
|
541
|
-
new G(4, 5, 16, 8, gt),
|
542
|
-
/* 2 */
|
543
|
-
new G(4, 6, 32, 32, gt),
|
544
|
-
/* 3 */
|
545
|
-
new G(4, 4, 16, 16, de),
|
546
|
-
/* 4 lazy matches */
|
547
|
-
new G(8, 16, 32, 32, de),
|
548
|
-
/* 5 */
|
549
|
-
new G(8, 16, 128, 128, de),
|
550
|
-
/* 6 */
|
551
|
-
new G(8, 32, 128, 256, de),
|
552
|
-
/* 7 */
|
553
|
-
new G(32, 128, 258, 1024, de),
|
554
|
-
/* 8 */
|
555
|
-
new G(32, 258, 258, 4096, de)
|
556
|
-
/* 9 max compression */
|
557
|
-
], sa = (e) => {
|
558
|
-
e.window_size = 2 * e.w_size, q(e.head), e.max_lazy_match = Te[e.level].max_lazy, e.good_match = Te[e.level].good_length, e.nice_match = Te[e.level].nice_length, e.max_chain_length = Te[e.level].max_chain, e.strstart = 0, e.block_start = 0, e.lookahead = 0, e.insert = 0, e.match_length = e.prev_length = T - 1, e.match_available = 0, e.ins_h = 0;
|
559
|
-
};
|
560
|
-
function ca() {
|
561
|
-
this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = rt, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new Uint16Array(ea * 2), this.dyn_dtree = new Uint16Array((2 * Qr + 1) * 2), this.bl_tree = new Uint16Array((2 * qr + 1) * 2), q(this.dyn_ltree), q(this.dyn_dtree), q(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new Uint16Array(ta + 1), this.heap = new Uint16Array(2 * Bt + 1), q(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new Uint16Array(2 * Bt + 1), q(this.depth), this.sym_buf = 0, this.lit_bufsize = 0, this.sym_next = 0, this.sym_end = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;
|
562
|
-
}
|
563
|
-
const Ve = (e) => {
|
564
|
-
if (!e)
|
565
|
-
return 1;
|
566
|
-
const n = e.state;
|
567
|
-
return !n || n.strm !== e || n.status !== me && //#ifdef GZIP
|
568
|
-
n.status !== Gt && //#endif
|
569
|
-
n.status !== Dt && n.status !== Nt && n.status !== Lt && n.status !== Zt && n.status !== le && n.status !== Ie ? 1 : 0;
|
570
|
-
}, ui = (e) => {
|
571
|
-
if (Ve(e))
|
572
|
-
return se(e, j);
|
573
|
-
e.total_in = e.total_out = 0, e.data_type = Gr;
|
574
|
-
const n = e.state;
|
575
|
-
return n.pending = 0, n.pending_out = 0, n.wrap < 0 && (n.wrap = -n.wrap), n.status = //#ifdef GZIP
|
576
|
-
n.wrap === 2 ? Gt : (
|
577
|
-
//#endif
|
578
|
-
n.wrap ? me : le
|
579
|
-
), e.adler = n.wrap === 2 ? 0 : 1, n.last_flush = -2, Nr(n), L;
|
580
|
-
}, hi = (e) => {
|
581
|
-
const n = ui(e);
|
582
|
-
return n === L && sa(e.state), n;
|
583
|
-
}, fa = (e, n) => Ve(e) || e.state.wrap !== 2 ? j : (e.state.gzhead = n, L), di = (e, n, t, i, a, r) => {
|
584
|
-
if (!e)
|
585
|
-
return j;
|
586
|
-
let o = 1;
|
587
|
-
if (n === $r && (n = 6), i < 0 ? (o = 0, i = -i) : i > 15 && (o = 2, i -= 16), a < 1 || a > Yr || t !== rt || i < 8 || i > 15 || n < 0 || n > 9 || r < 0 || r > Vr || i === 8 && o !== 1)
|
588
|
-
return se(e, j);
|
589
|
-
i === 8 && (i = 9);
|
590
|
-
const s = new ca();
|
591
|
-
return e.state = s, s.strm = e, s.status = me, s.wrap = o, s.gzhead = null, s.w_bits = i, s.w_size = 1 << s.w_bits, s.w_mask = s.w_size - 1, s.hash_bits = a + 7, s.hash_size = 1 << s.hash_bits, s.hash_mask = s.hash_size - 1, s.hash_shift = ~~((s.hash_bits + T - 1) / T), s.window = new Uint8Array(s.w_size * 2), s.head = new Uint16Array(s.hash_size), s.prev = new Uint16Array(s.w_size), s.lit_bufsize = 1 << a + 6, s.pending_buf_size = s.lit_bufsize * 4, s.pending_buf = new Uint8Array(s.pending_buf_size), s.sym_buf = s.lit_bufsize, s.sym_end = (s.lit_bufsize - 1) * 3, s.level = n, s.strategy = r, s.method = t, hi(e);
|
592
|
-
}, ua = (e, n) => di(e, n, rt, jr, Xr, Kr), ha = (e, n) => {
|
593
|
-
if (Ve(e) || n > ln || n < 0)
|
594
|
-
return e ? se(e, j) : j;
|
595
|
-
const t = e.state;
|
596
|
-
if (!e.output || e.avail_in !== 0 && !e.input || t.status === Ie && n !== P)
|
597
|
-
return se(e, e.avail_out === 0 ? bt : j);
|
598
|
-
const i = t.last_flush;
|
599
|
-
if (t.last_flush = n, t.pending !== 0) {
|
600
|
-
if ($(e), e.avail_out === 0)
|
601
|
-
return t.last_flush = -1, L;
|
602
|
-
} else if (e.avail_in === 0 && cn(n) <= cn(i) && n !== P)
|
603
|
-
return se(e, bt);
|
604
|
-
if (t.status === Ie && e.avail_in !== 0)
|
605
|
-
return se(e, bt);
|
606
|
-
if (t.status === me && t.wrap === 0 && (t.status = le), t.status === me) {
|
607
|
-
let a = rt + (t.w_bits - 8 << 4) << 8, r = -1;
|
608
|
-
if (t.strategy >= Ge || t.level < 2 ? r = 0 : t.level < 6 ? r = 1 : t.level === 6 ? r = 2 : r = 3, a |= r << 6, t.strstart !== 0 && (a |= na), a += 31 - a % 31, Ae(t, a), t.strstart !== 0 && (Ae(t, e.adler >>> 16), Ae(t, e.adler & 65535)), e.adler = 1, t.status = le, $(e), t.pending !== 0)
|
609
|
-
return t.last_flush = -1, L;
|
610
|
-
}
|
611
|
-
if (t.status === Gt) {
|
612
|
-
if (e.adler = 0, z(t, 31), z(t, 139), z(t, 8), t.gzhead)
|
613
|
-
z(
|
614
|
-
t,
|
615
|
-
(t.gzhead.text ? 1 : 0) + (t.gzhead.hcrc ? 2 : 0) + (t.gzhead.extra ? 4 : 0) + (t.gzhead.name ? 8 : 0) + (t.gzhead.comment ? 16 : 0)
|
616
|
-
), z(t, t.gzhead.time & 255), z(t, t.gzhead.time >> 8 & 255), z(t, t.gzhead.time >> 16 & 255), z(t, t.gzhead.time >> 24 & 255), z(t, t.level === 9 ? 2 : t.strategy >= Ge || t.level < 2 ? 4 : 0), z(t, t.gzhead.os & 255), t.gzhead.extra && t.gzhead.extra.length && (z(t, t.gzhead.extra.length & 255), z(t, t.gzhead.extra.length >> 8 & 255)), t.gzhead.hcrc && (e.adler = N(e.adler, t.pending_buf, t.pending, 0)), t.gzindex = 0, t.status = Dt;
|
617
|
-
else if (z(t, 0), z(t, 0), z(t, 0), z(t, 0), z(t, 0), z(t, t.level === 9 ? 2 : t.strategy >= Ge || t.level < 2 ? 4 : 0), z(t, ia), t.status = le, $(e), t.pending !== 0)
|
618
|
-
return t.last_flush = -1, L;
|
619
|
-
}
|
620
|
-
if (t.status === Dt) {
|
621
|
-
if (t.gzhead.extra) {
|
622
|
-
let a = t.pending, r = (t.gzhead.extra.length & 65535) - t.gzindex;
|
623
|
-
for (; t.pending + r > t.pending_buf_size; ) {
|
624
|
-
let s = t.pending_buf_size - t.pending;
|
625
|
-
if (t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex, t.gzindex + s), t.pending), t.pending = t.pending_buf_size, t.gzhead.hcrc && t.pending > a && (e.adler = N(e.adler, t.pending_buf, t.pending - a, a)), t.gzindex += s, $(e), t.pending !== 0)
|
626
|
-
return t.last_flush = -1, L;
|
627
|
-
a = 0, r -= s;
|
628
|
-
}
|
629
|
-
let o = new Uint8Array(t.gzhead.extra);
|
630
|
-
t.pending_buf.set(o.subarray(t.gzindex, t.gzindex + r), t.pending), t.pending += r, t.gzhead.hcrc && t.pending > a && (e.adler = N(e.adler, t.pending_buf, t.pending - a, a)), t.gzindex = 0;
|
631
|
-
}
|
632
|
-
t.status = Nt;
|
633
|
-
}
|
634
|
-
if (t.status === Nt) {
|
635
|
-
if (t.gzhead.name) {
|
636
|
-
let a = t.pending, r;
|
637
|
-
do {
|
638
|
-
if (t.pending === t.pending_buf_size) {
|
639
|
-
if (t.gzhead.hcrc && t.pending > a && (e.adler = N(e.adler, t.pending_buf, t.pending - a, a)), $(e), t.pending !== 0)
|
640
|
-
return t.last_flush = -1, L;
|
641
|
-
a = 0;
|
642
|
-
}
|
643
|
-
t.gzindex < t.gzhead.name.length ? r = t.gzhead.name.charCodeAt(t.gzindex++) & 255 : r = 0, z(t, r);
|
644
|
-
} while (r !== 0);
|
645
|
-
t.gzhead.hcrc && t.pending > a && (e.adler = N(e.adler, t.pending_buf, t.pending - a, a)), t.gzindex = 0;
|
646
|
-
}
|
647
|
-
t.status = Lt;
|
648
|
-
}
|
649
|
-
if (t.status === Lt) {
|
650
|
-
if (t.gzhead.comment) {
|
651
|
-
let a = t.pending, r;
|
652
|
-
do {
|
653
|
-
if (t.pending === t.pending_buf_size) {
|
654
|
-
if (t.gzhead.hcrc && t.pending > a && (e.adler = N(e.adler, t.pending_buf, t.pending - a, a)), $(e), t.pending !== 0)
|
655
|
-
return t.last_flush = -1, L;
|
656
|
-
a = 0;
|
657
|
-
}
|
658
|
-
t.gzindex < t.gzhead.comment.length ? r = t.gzhead.comment.charCodeAt(t.gzindex++) & 255 : r = 0, z(t, r);
|
659
|
-
} while (r !== 0);
|
660
|
-
t.gzhead.hcrc && t.pending > a && (e.adler = N(e.adler, t.pending_buf, t.pending - a, a));
|
661
|
-
}
|
662
|
-
t.status = Zt;
|
663
|
-
}
|
664
|
-
if (t.status === Zt) {
|
665
|
-
if (t.gzhead.hcrc) {
|
666
|
-
if (t.pending + 2 > t.pending_buf_size && ($(e), t.pending !== 0))
|
667
|
-
return t.last_flush = -1, L;
|
668
|
-
z(t, e.adler & 255), z(t, e.adler >> 8 & 255), e.adler = 0;
|
669
|
-
}
|
670
|
-
if (t.status = le, $(e), t.pending !== 0)
|
671
|
-
return t.last_flush = -1, L;
|
672
|
-
}
|
673
|
-
if (e.avail_in !== 0 || t.lookahead !== 0 || n !== ie && t.status !== Ie) {
|
674
|
-
let a = t.level === 0 ? fi(t, n) : t.strategy === Ge ? la(t, n) : t.strategy === Pr ? oa(t, n) : Te[t.level].func(t, n);
|
675
|
-
if ((a === fe || a === Ee) && (t.status = Ie), a === C || a === fe)
|
676
|
-
return e.avail_out === 0 && (t.last_flush = -1), L;
|
677
|
-
if (a === ke && (n === Cr ? Zr(t) : n !== ln && (Ut(t, 0, 0, !1), n === Fr && (q(t.head), t.lookahead === 0 && (t.strstart = 0, t.block_start = 0, t.insert = 0))), $(e), e.avail_out === 0))
|
678
|
-
return t.last_flush = -1, L;
|
679
|
-
}
|
680
|
-
return n !== P ? L : t.wrap <= 0 ? sn : (t.wrap === 2 ? (z(t, e.adler & 255), z(t, e.adler >> 8 & 255), z(t, e.adler >> 16 & 255), z(t, e.adler >> 24 & 255), z(t, e.total_in & 255), z(t, e.total_in >> 8 & 255), z(t, e.total_in >> 16 & 255), z(t, e.total_in >> 24 & 255)) : (Ae(t, e.adler >>> 16), Ae(t, e.adler & 65535)), $(e), t.wrap > 0 && (t.wrap = -t.wrap), t.pending !== 0 ? L : sn);
|
681
|
-
}, da = (e) => {
|
682
|
-
if (Ve(e))
|
683
|
-
return j;
|
684
|
-
const n = e.state.status;
|
685
|
-
return e.state = null, n === le ? se(e, Mr) : L;
|
686
|
-
}, _a = (e, n) => {
|
687
|
-
let t = n.length;
|
688
|
-
if (Ve(e))
|
689
|
-
return j;
|
690
|
-
const i = e.state, a = i.wrap;
|
691
|
-
if (a === 2 || a === 1 && i.status !== me || i.lookahead)
|
692
|
-
return j;
|
693
|
-
if (a === 1 && (e.adler = Le(e.adler, n, t, 0)), i.wrap = 0, t >= i.w_size) {
|
694
|
-
a === 0 && (q(i.head), i.strstart = 0, i.block_start = 0, i.insert = 0);
|
695
|
-
let f = new Uint8Array(i.w_size);
|
696
|
-
f.set(n.subarray(t - i.w_size, t), 0), n = f, t = i.w_size;
|
697
|
-
}
|
698
|
-
const r = e.avail_in, o = e.next_in, s = e.input;
|
699
|
-
for (e.avail_in = t, e.next_in = 0, e.input = n, ye(i); i.lookahead >= T; ) {
|
700
|
-
let f = i.strstart, l = i.lookahead - (T - 1);
|
701
|
-
do
|
702
|
-
i.ins_h = re(i, i.ins_h, i.window[f + T - 1]), i.prev[f & i.w_mask] = i.head[i.ins_h], i.head[i.ins_h] = f, f++;
|
703
|
-
while (--l);
|
704
|
-
i.strstart = f, i.lookahead = T - 1, ye(i);
|
705
|
-
}
|
706
|
-
return i.strstart += i.lookahead, i.block_start = i.strstart, i.insert = i.lookahead, i.lookahead = 0, i.match_length = i.prev_length = T - 1, i.match_available = 0, e.next_in = o, e.input = s, e.avail_in = r, i.wrap = a, L;
|
707
|
-
};
|
708
|
-
var ba = ua, ga = di, wa = hi, pa = ui, ma = fa, ya = ha, va = da, ka = _a, Ea = "pako deflate (from Nodeca project)", Oe = {
|
709
|
-
deflateInit: ba,
|
710
|
-
deflateInit2: ga,
|
711
|
-
deflateReset: wa,
|
712
|
-
deflateResetKeep: pa,
|
713
|
-
deflateSetHeader: ma,
|
714
|
-
deflate: ya,
|
715
|
-
deflateEnd: va,
|
716
|
-
deflateSetDictionary: ka,
|
717
|
-
deflateInfo: Ea
|
718
|
-
};
|
719
|
-
const xa = (e, n) => Object.prototype.hasOwnProperty.call(e, n);
|
720
|
-
var Sa = function(e) {
|
721
|
-
const n = Array.prototype.slice.call(arguments, 1);
|
722
|
-
for (; n.length; ) {
|
723
|
-
const t = n.shift();
|
724
|
-
if (t) {
|
725
|
-
if (typeof t != "object")
|
726
|
-
throw new TypeError(t + "must be non-object");
|
727
|
-
for (const i in t)
|
728
|
-
xa(t, i) && (e[i] = t[i]);
|
729
|
-
}
|
730
|
-
}
|
731
|
-
return e;
|
732
|
-
}, Aa = (e) => {
|
733
|
-
let n = 0;
|
734
|
-
for (let i = 0, a = e.length; i < a; i++)
|
735
|
-
n += e[i].length;
|
736
|
-
const t = new Uint8Array(n);
|
737
|
-
for (let i = 0, a = 0, r = e.length; i < r; i++) {
|
738
|
-
let o = e[i];
|
739
|
-
t.set(o, a), a += o.length;
|
740
|
-
}
|
741
|
-
return t;
|
742
|
-
}, at = {
|
743
|
-
assign: Sa,
|
744
|
-
flattenChunks: Aa
|
745
|
-
};
|
746
|
-
let _i = !0;
|
747
|
-
try {
|
748
|
-
String.fromCharCode.apply(null, new Uint8Array(1));
|
749
|
-
} catch {
|
750
|
-
_i = !1;
|
751
|
-
}
|
752
|
-
const Ze = new Uint8Array(256);
|
753
|
-
for (let e = 0; e < 256; e++)
|
754
|
-
Ze[e] = e >= 252 ? 6 : e >= 248 ? 5 : e >= 240 ? 4 : e >= 224 ? 3 : e >= 192 ? 2 : 1;
|
755
|
-
Ze[254] = Ze[254] = 1;
|
756
|
-
var Ia = (e) => {
|
757
|
-
if (typeof TextEncoder == "function" && TextEncoder.prototype.encode)
|
758
|
-
return new TextEncoder().encode(e);
|
759
|
-
let n, t, i, a, r, o = e.length, s = 0;
|
760
|
-
for (a = 0; a < o; a++)
|
761
|
-
t = e.charCodeAt(a), (t & 64512) === 55296 && a + 1 < o && (i = e.charCodeAt(a + 1), (i & 64512) === 56320 && (t = 65536 + (t - 55296 << 10) + (i - 56320), a++)), s += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
|
762
|
-
for (n = new Uint8Array(s), r = 0, a = 0; r < s; a++)
|
763
|
-
t = e.charCodeAt(a), (t & 64512) === 55296 && a + 1 < o && (i = e.charCodeAt(a + 1), (i & 64512) === 56320 && (t = 65536 + (t - 55296 << 10) + (i - 56320), a++)), t < 128 ? n[r++] = t : t < 2048 ? (n[r++] = 192 | t >>> 6, n[r++] = 128 | t & 63) : t < 65536 ? (n[r++] = 224 | t >>> 12, n[r++] = 128 | t >>> 6 & 63, n[r++] = 128 | t & 63) : (n[r++] = 240 | t >>> 18, n[r++] = 128 | t >>> 12 & 63, n[r++] = 128 | t >>> 6 & 63, n[r++] = 128 | t & 63);
|
764
|
-
return n;
|
765
|
-
};
|
766
|
-
const Ta = (e, n) => {
|
767
|
-
if (n < 65534 && e.subarray && _i)
|
768
|
-
return String.fromCharCode.apply(null, e.length === n ? e : e.subarray(0, n));
|
769
|
-
let t = "";
|
770
|
-
for (let i = 0; i < n; i++)
|
771
|
-
t += String.fromCharCode(e[i]);
|
772
|
-
return t;
|
773
|
-
};
|
774
|
-
var za = (e, n) => {
|
775
|
-
const t = n || e.length;
|
776
|
-
if (typeof TextDecoder == "function" && TextDecoder.prototype.decode)
|
777
|
-
return new TextDecoder().decode(e.subarray(0, n));
|
778
|
-
let i, a;
|
779
|
-
const r = new Array(t * 2);
|
780
|
-
for (a = 0, i = 0; i < t; ) {
|
781
|
-
let o = e[i++];
|
782
|
-
if (o < 128) {
|
783
|
-
r[a++] = o;
|
784
|
-
continue;
|
785
|
-
}
|
786
|
-
let s = Ze[o];
|
787
|
-
if (s > 4) {
|
788
|
-
r[a++] = 65533, i += s - 1;
|
789
|
-
continue;
|
790
|
-
}
|
791
|
-
for (o &= s === 2 ? 31 : s === 3 ? 15 : 7; s > 1 && i < t; )
|
792
|
-
o = o << 6 | e[i++] & 63, s--;
|
793
|
-
if (s > 1) {
|
794
|
-
r[a++] = 65533;
|
795
|
-
continue;
|
796
|
-
}
|
797
|
-
o < 65536 ? r[a++] = o : (o -= 65536, r[a++] = 55296 | o >> 10 & 1023, r[a++] = 56320 | o & 1023);
|
798
|
-
}
|
799
|
-
return Ta(r, a);
|
800
|
-
}, Oa = (e, n) => {
|
801
|
-
n = n || e.length, n > e.length && (n = e.length);
|
802
|
-
let t = n - 1;
|
803
|
-
for (; t >= 0 && (e[t] & 192) === 128; )
|
804
|
-
t--;
|
805
|
-
return t < 0 || t === 0 ? n : t + Ze[e[t]] > n ? t : n;
|
806
|
-
}, Ce = {
|
807
|
-
string2buf: Ia,
|
808
|
-
buf2string: za,
|
809
|
-
utf8border: Oa
|
810
|
-
};
|
811
|
-
function Ra() {
|
812
|
-
this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0;
|
813
|
-
}
|
814
|
-
var bi = Ra;
|
815
|
-
const gi = Object.prototype.toString, {
|
816
|
-
Z_NO_FLUSH: Ua,
|
817
|
-
Z_SYNC_FLUSH: Ba,
|
818
|
-
Z_FULL_FLUSH: Da,
|
819
|
-
Z_FINISH: Na,
|
820
|
-
Z_OK: tt,
|
821
|
-
Z_STREAM_END: La,
|
822
|
-
Z_DEFAULT_COMPRESSION: Za,
|
823
|
-
Z_DEFAULT_STRATEGY: Ca,
|
824
|
-
Z_DEFLATED: Fa
|
825
|
-
} = Pe;
|
826
|
-
function Yt(e) {
|
827
|
-
this.options = at.assign({
|
828
|
-
level: Za,
|
829
|
-
method: Fa,
|
830
|
-
chunkSize: 16384,
|
831
|
-
windowBits: 15,
|
832
|
-
memLevel: 8,
|
833
|
-
strategy: Ca
|
834
|
-
}, e || {});
|
835
|
-
let n = this.options;
|
836
|
-
n.raw && n.windowBits > 0 ? n.windowBits = -n.windowBits : n.gzip && n.windowBits > 0 && n.windowBits < 16 && (n.windowBits += 16), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new bi(), this.strm.avail_out = 0;
|
837
|
-
let t = Oe.deflateInit2(
|
838
|
-
this.strm,
|
839
|
-
n.level,
|
840
|
-
n.method,
|
841
|
-
n.windowBits,
|
842
|
-
n.memLevel,
|
843
|
-
n.strategy
|
844
|
-
);
|
845
|
-
if (t !== tt)
|
846
|
-
throw new Error(pe[t]);
|
847
|
-
if (n.header && Oe.deflateSetHeader(this.strm, n.header), n.dictionary) {
|
848
|
-
let i;
|
849
|
-
if (typeof n.dictionary == "string" ? i = Ce.string2buf(n.dictionary) : gi.call(n.dictionary) === "[object ArrayBuffer]" ? i = new Uint8Array(n.dictionary) : i = n.dictionary, t = Oe.deflateSetDictionary(this.strm, i), t !== tt)
|
850
|
-
throw new Error(pe[t]);
|
851
|
-
this._dict_set = !0;
|
852
|
-
}
|
853
|
-
}
|
854
|
-
Yt.prototype.push = function(e, n) {
|
855
|
-
const t = this.strm, i = this.options.chunkSize;
|
856
|
-
let a, r;
|
857
|
-
if (this.ended)
|
858
|
-
return !1;
|
859
|
-
for (n === ~~n ? r = n : r = n === !0 ? Na : Ua, typeof e == "string" ? t.input = Ce.string2buf(e) : gi.call(e) === "[object ArrayBuffer]" ? t.input = new Uint8Array(e) : t.input = e, t.next_in = 0, t.avail_in = t.input.length; ; ) {
|
860
|
-
if (t.avail_out === 0 && (t.output = new Uint8Array(i), t.next_out = 0, t.avail_out = i), (r === Ba || r === Da) && t.avail_out <= 6) {
|
861
|
-
this.onData(t.output.subarray(0, t.next_out)), t.avail_out = 0;
|
862
|
-
continue;
|
863
|
-
}
|
864
|
-
if (a = Oe.deflate(t, r), a === La)
|
865
|
-
return t.next_out > 0 && this.onData(t.output.subarray(0, t.next_out)), a = Oe.deflateEnd(this.strm), this.onEnd(a), this.ended = !0, a === tt;
|
866
|
-
if (t.avail_out === 0) {
|
867
|
-
this.onData(t.output);
|
868
|
-
continue;
|
869
|
-
}
|
870
|
-
if (r > 0 && t.next_out > 0) {
|
871
|
-
this.onData(t.output.subarray(0, t.next_out)), t.avail_out = 0;
|
872
|
-
continue;
|
873
|
-
}
|
874
|
-
if (t.avail_in === 0) break;
|
875
|
-
}
|
876
|
-
return !0;
|
877
|
-
};
|
878
|
-
Yt.prototype.onData = function(e) {
|
879
|
-
this.chunks.push(e);
|
880
|
-
};
|
881
|
-
Yt.prototype.onEnd = function(e) {
|
882
|
-
e === tt && (this.result = at.flattenChunks(this.chunks)), this.chunks = [], this.err = e, this.msg = this.strm.msg;
|
883
|
-
};
|
884
|
-
const Ye = 16209, Ma = 16191;
|
885
|
-
var $a = function(n, t) {
|
886
|
-
let i, a, r, o, s, f, l, c, w, h, u, d, g, v, k, E, A, b, x, I, p, S, _, y;
|
887
|
-
const m = n.state;
|
888
|
-
i = n.next_in, _ = n.input, a = i + (n.avail_in - 5), r = n.next_out, y = n.output, o = r - (t - n.avail_out), s = r + (n.avail_out - 257), f = m.dmax, l = m.wsize, c = m.whave, w = m.wnext, h = m.window, u = m.hold, d = m.bits, g = m.lencode, v = m.distcode, k = (1 << m.lenbits) - 1, E = (1 << m.distbits) - 1;
|
889
|
-
e:
|
890
|
-
do {
|
891
|
-
d < 15 && (u += _[i++] << d, d += 8, u += _[i++] << d, d += 8), A = g[u & k];
|
892
|
-
t:
|
893
|
-
for (; ; ) {
|
894
|
-
if (b = A >>> 24, u >>>= b, d -= b, b = A >>> 16 & 255, b === 0)
|
895
|
-
y[r++] = A & 65535;
|
896
|
-
else if (b & 16) {
|
897
|
-
x = A & 65535, b &= 15, b && (d < b && (u += _[i++] << d, d += 8), x += u & (1 << b) - 1, u >>>= b, d -= b), d < 15 && (u += _[i++] << d, d += 8, u += _[i++] << d, d += 8), A = v[u & E];
|
898
|
-
n:
|
899
|
-
for (; ; ) {
|
900
|
-
if (b = A >>> 24, u >>>= b, d -= b, b = A >>> 16 & 255, b & 16) {
|
901
|
-
if (I = A & 65535, b &= 15, d < b && (u += _[i++] << d, d += 8, d < b && (u += _[i++] << d, d += 8)), I += u & (1 << b) - 1, I > f) {
|
902
|
-
n.msg = "invalid distance too far back", m.mode = Ye;
|
903
|
-
break e;
|
904
|
-
}
|
905
|
-
if (u >>>= b, d -= b, b = r - o, I > b) {
|
906
|
-
if (b = I - b, b > c && m.sane) {
|
907
|
-
n.msg = "invalid distance too far back", m.mode = Ye;
|
908
|
-
break e;
|
909
|
-
}
|
910
|
-
if (p = 0, S = h, w === 0) {
|
911
|
-
if (p += l - b, b < x) {
|
912
|
-
x -= b;
|
913
|
-
do
|
914
|
-
y[r++] = h[p++];
|
915
|
-
while (--b);
|
916
|
-
p = r - I, S = y;
|
917
|
-
}
|
918
|
-
} else if (w < b) {
|
919
|
-
if (p += l + w - b, b -= w, b < x) {
|
920
|
-
x -= b;
|
921
|
-
do
|
922
|
-
y[r++] = h[p++];
|
923
|
-
while (--b);
|
924
|
-
if (p = 0, w < x) {
|
925
|
-
b = w, x -= b;
|
926
|
-
do
|
927
|
-
y[r++] = h[p++];
|
928
|
-
while (--b);
|
929
|
-
p = r - I, S = y;
|
930
|
-
}
|
931
|
-
}
|
932
|
-
} else if (p += w - b, b < x) {
|
933
|
-
x -= b;
|
934
|
-
do
|
935
|
-
y[r++] = h[p++];
|
936
|
-
while (--b);
|
937
|
-
p = r - I, S = y;
|
938
|
-
}
|
939
|
-
for (; x > 2; )
|
940
|
-
y[r++] = S[p++], y[r++] = S[p++], y[r++] = S[p++], x -= 3;
|
941
|
-
x && (y[r++] = S[p++], x > 1 && (y[r++] = S[p++]));
|
942
|
-
} else {
|
943
|
-
p = r - I;
|
944
|
-
do
|
945
|
-
y[r++] = y[p++], y[r++] = y[p++], y[r++] = y[p++], x -= 3;
|
946
|
-
while (x > 2);
|
947
|
-
x && (y[r++] = y[p++], x > 1 && (y[r++] = y[p++]));
|
948
|
-
}
|
949
|
-
} else if (b & 64) {
|
950
|
-
n.msg = "invalid distance code", m.mode = Ye;
|
951
|
-
break e;
|
952
|
-
} else {
|
953
|
-
A = v[(A & 65535) + (u & (1 << b) - 1)];
|
954
|
-
continue n;
|
955
|
-
}
|
956
|
-
break;
|
957
|
-
}
|
958
|
-
} else if (b & 64)
|
959
|
-
if (b & 32) {
|
960
|
-
m.mode = Ma;
|
961
|
-
break e;
|
962
|
-
} else {
|
963
|
-
n.msg = "invalid literal/length code", m.mode = Ye;
|
964
|
-
break e;
|
965
|
-
}
|
966
|
-
else {
|
967
|
-
A = g[(A & 65535) + (u & (1 << b) - 1)];
|
968
|
-
continue t;
|
969
|
-
}
|
970
|
-
break;
|
971
|
-
}
|
972
|
-
} while (i < a && r < s);
|
973
|
-
x = d >> 3, i -= x, d -= x << 3, u &= (1 << d) - 1, n.next_in = i, n.next_out = r, n.avail_in = i < a ? 5 + (a - i) : 5 - (i - a), n.avail_out = r < s ? 257 + (s - r) : 257 - (r - s), m.hold = u, m.bits = d;
|
974
|
-
};
|
975
|
-
const _e = 15, fn = 852, un = 592, hn = 0, wt = 1, dn = 2, Ha = new Uint16Array([
|
976
|
-
/* Length codes 257..285 base */
|
977
|
-
3,
|
978
|
-
4,
|
979
|
-
5,
|
980
|
-
6,
|
981
|
-
7,
|
982
|
-
8,
|
983
|
-
9,
|
984
|
-
10,
|
985
|
-
11,
|
986
|
-
13,
|
987
|
-
15,
|
988
|
-
17,
|
989
|
-
19,
|
990
|
-
23,
|
991
|
-
27,
|
992
|
-
31,
|
993
|
-
35,
|
994
|
-
43,
|
995
|
-
51,
|
996
|
-
59,
|
997
|
-
67,
|
998
|
-
83,
|
999
|
-
99,
|
1000
|
-
115,
|
1001
|
-
131,
|
1002
|
-
163,
|
1003
|
-
195,
|
1004
|
-
227,
|
1005
|
-
258,
|
1006
|
-
0,
|
1007
|
-
0
|
1008
|
-
]), Pa = new Uint8Array([
|
1009
|
-
/* Length codes 257..285 extra */
|
1010
|
-
16,
|
1011
|
-
16,
|
1012
|
-
16,
|
1013
|
-
16,
|
1014
|
-
16,
|
1015
|
-
16,
|
1016
|
-
16,
|
1017
|
-
16,
|
1018
|
-
17,
|
1019
|
-
17,
|
1020
|
-
17,
|
1021
|
-
17,
|
1022
|
-
18,
|
1023
|
-
18,
|
1024
|
-
18,
|
1025
|
-
18,
|
1026
|
-
19,
|
1027
|
-
19,
|
1028
|
-
19,
|
1029
|
-
19,
|
1030
|
-
20,
|
1031
|
-
20,
|
1032
|
-
20,
|
1033
|
-
20,
|
1034
|
-
21,
|
1035
|
-
21,
|
1036
|
-
21,
|
1037
|
-
21,
|
1038
|
-
16,
|
1039
|
-
72,
|
1040
|
-
78
|
1041
|
-
]), Va = new Uint16Array([
|
1042
|
-
/* Distance codes 0..29 base */
|
1043
|
-
1,
|
1044
|
-
2,
|
1045
|
-
3,
|
1046
|
-
4,
|
1047
|
-
5,
|
1048
|
-
7,
|
1049
|
-
9,
|
1050
|
-
13,
|
1051
|
-
17,
|
1052
|
-
25,
|
1053
|
-
33,
|
1054
|
-
49,
|
1055
|
-
65,
|
1056
|
-
97,
|
1057
|
-
129,
|
1058
|
-
193,
|
1059
|
-
257,
|
1060
|
-
385,
|
1061
|
-
513,
|
1062
|
-
769,
|
1063
|
-
1025,
|
1064
|
-
1537,
|
1065
|
-
2049,
|
1066
|
-
3073,
|
1067
|
-
4097,
|
1068
|
-
6145,
|
1069
|
-
8193,
|
1070
|
-
12289,
|
1071
|
-
16385,
|
1072
|
-
24577,
|
1073
|
-
0,
|
1074
|
-
0
|
1075
|
-
]), Ka = new Uint8Array([
|
1076
|
-
/* Distance codes 0..29 extra */
|
1077
|
-
16,
|
1078
|
-
16,
|
1079
|
-
16,
|
1080
|
-
16,
|
1081
|
-
17,
|
1082
|
-
17,
|
1083
|
-
18,
|
1084
|
-
18,
|
1085
|
-
19,
|
1086
|
-
19,
|
1087
|
-
20,
|
1088
|
-
20,
|
1089
|
-
21,
|
1090
|
-
21,
|
1091
|
-
22,
|
1092
|
-
22,
|
1093
|
-
23,
|
1094
|
-
23,
|
1095
|
-
24,
|
1096
|
-
24,
|
1097
|
-
25,
|
1098
|
-
25,
|
1099
|
-
26,
|
1100
|
-
26,
|
1101
|
-
27,
|
1102
|
-
27,
|
1103
|
-
28,
|
1104
|
-
28,
|
1105
|
-
29,
|
1106
|
-
29,
|
1107
|
-
64,
|
1108
|
-
64
|
1109
|
-
]), Ga = (e, n, t, i, a, r, o, s) => {
|
1110
|
-
const f = s.bits;
|
1111
|
-
let l = 0, c = 0, w = 0, h = 0, u = 0, d = 0, g = 0, v = 0, k = 0, E = 0, A, b, x, I, p, S = null, _;
|
1112
|
-
const y = new Uint16Array(_e + 1), m = new Uint16Array(_e + 1);
|
1113
|
-
let U = null, Z, B, O;
|
1114
|
-
for (l = 0; l <= _e; l++)
|
1115
|
-
y[l] = 0;
|
1116
|
-
for (c = 0; c < i; c++)
|
1117
|
-
y[n[t + c]]++;
|
1118
|
-
for (u = f, h = _e; h >= 1 && y[h] === 0; h--)
|
1119
|
-
;
|
1120
|
-
if (u > h && (u = h), h === 0)
|
1121
|
-
return a[r++] = 1 << 24 | 64 << 16 | 0, a[r++] = 1 << 24 | 64 << 16 | 0, s.bits = 1, 0;
|
1122
|
-
for (w = 1; w < h && y[w] === 0; w++)
|
1123
|
-
;
|
1124
|
-
for (u < w && (u = w), v = 1, l = 1; l <= _e; l++)
|
1125
|
-
if (v <<= 1, v -= y[l], v < 0)
|
1126
|
-
return -1;
|
1127
|
-
if (v > 0 && (e === hn || h !== 1))
|
1128
|
-
return -1;
|
1129
|
-
for (m[1] = 0, l = 1; l < _e; l++)
|
1130
|
-
m[l + 1] = m[l] + y[l];
|
1131
|
-
for (c = 0; c < i; c++)
|
1132
|
-
n[t + c] !== 0 && (o[m[n[t + c]]++] = c);
|
1133
|
-
if (e === hn ? (S = U = o, _ = 20) : e === wt ? (S = Ha, U = Pa, _ = 257) : (S = Va, U = Ka, _ = 0), E = 0, c = 0, l = w, p = r, d = u, g = 0, x = -1, k = 1 << u, I = k - 1, e === wt && k > fn || e === dn && k > un)
|
1134
|
-
return 1;
|
1135
|
-
for (; ; ) {
|
1136
|
-
Z = l - g, o[c] + 1 < _ ? (B = 0, O = o[c]) : o[c] >= _ ? (B = U[o[c] - _], O = S[o[c] - _]) : (B = 96, O = 0), A = 1 << l - g, b = 1 << d, w = b;
|
1137
|
-
do
|
1138
|
-
b -= A, a[p + (E >> g) + b] = Z << 24 | B << 16 | O | 0;
|
1139
|
-
while (b !== 0);
|
1140
|
-
for (A = 1 << l - 1; E & A; )
|
1141
|
-
A >>= 1;
|
1142
|
-
if (A !== 0 ? (E &= A - 1, E += A) : E = 0, c++, --y[l] === 0) {
|
1143
|
-
if (l === h)
|
1144
|
-
break;
|
1145
|
-
l = n[t + o[c]];
|
1146
|
-
}
|
1147
|
-
if (l > u && (E & I) !== x) {
|
1148
|
-
for (g === 0 && (g = u), p += w, d = l - g, v = 1 << d; d + g < h && (v -= y[d + g], !(v <= 0)); )
|
1149
|
-
d++, v <<= 1;
|
1150
|
-
if (k += 1 << d, e === wt && k > fn || e === dn && k > un)
|
1151
|
-
return 1;
|
1152
|
-
x = E & I, a[x] = u << 24 | d << 16 | p - r | 0;
|
1153
|
-
}
|
1154
|
-
}
|
1155
|
-
return E !== 0 && (a[p + E] = l - g << 24 | 64 << 16 | 0), s.bits = u, 0;
|
1156
|
-
};
|
1157
|
-
var Re = Ga;
|
1158
|
-
const Ya = 0, wi = 1, pi = 2, {
|
1159
|
-
Z_FINISH: _n,
|
1160
|
-
Z_BLOCK: ja,
|
1161
|
-
Z_TREES: je,
|
1162
|
-
Z_OK: ue,
|
1163
|
-
Z_STREAM_END: Xa,
|
1164
|
-
Z_NEED_DICT: Wa,
|
1165
|
-
Z_STREAM_ERROR: V,
|
1166
|
-
Z_DATA_ERROR: mi,
|
1167
|
-
Z_MEM_ERROR: yi,
|
1168
|
-
Z_BUF_ERROR: Ja,
|
1169
|
-
Z_DEFLATED: bn
|
1170
|
-
} = Pe, ot = 16180, gn = 16181, wn = 16182, pn = 16183, mn = 16184, yn = 16185, vn = 16186, kn = 16187, En = 16188, xn = 16189, nt = 16190, W = 16191, pt = 16192, Sn = 16193, mt = 16194, An = 16195, In = 16196, Tn = 16197, zn = 16198, Xe = 16199, We = 16200, On = 16201, Rn = 16202, Un = 16203, Bn = 16204, Dn = 16205, yt = 16206, Nn = 16207, Ln = 16208, R = 16209, vi = 16210, ki = 16211, Qa = 852, qa = 592, eo = 15, to = eo, Zn = (e) => (e >>> 24 & 255) + (e >>> 8 & 65280) + ((e & 65280) << 8) + ((e & 255) << 24);
|
1171
|
-
function no() {
|
1172
|
-
this.strm = null, this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new Uint16Array(320), this.work = new Uint16Array(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;
|
1173
|
-
}
|
1174
|
-
const he = (e) => {
|
1175
|
-
if (!e)
|
1176
|
-
return 1;
|
1177
|
-
const n = e.state;
|
1178
|
-
return !n || n.strm !== e || n.mode < ot || n.mode > ki ? 1 : 0;
|
1179
|
-
}, Ei = (e) => {
|
1180
|
-
if (he(e))
|
1181
|
-
return V;
|
1182
|
-
const n = e.state;
|
1183
|
-
return e.total_in = e.total_out = n.total = 0, e.msg = "", n.wrap && (e.adler = n.wrap & 1), n.mode = ot, n.last = 0, n.havedict = 0, n.flags = -1, n.dmax = 32768, n.head = null, n.hold = 0, n.bits = 0, n.lencode = n.lendyn = new Int32Array(Qa), n.distcode = n.distdyn = new Int32Array(qa), n.sane = 1, n.back = -1, ue;
|
1184
|
-
}, xi = (e) => {
|
1185
|
-
if (he(e))
|
1186
|
-
return V;
|
1187
|
-
const n = e.state;
|
1188
|
-
return n.wsize = 0, n.whave = 0, n.wnext = 0, Ei(e);
|
1189
|
-
}, Si = (e, n) => {
|
1190
|
-
let t;
|
1191
|
-
if (he(e))
|
1192
|
-
return V;
|
1193
|
-
const i = e.state;
|
1194
|
-
return n < 0 ? (t = 0, n = -n) : (t = (n >> 4) + 5, n < 48 && (n &= 15)), n && (n < 8 || n > 15) ? V : (i.window !== null && i.wbits !== n && (i.window = null), i.wrap = t, i.wbits = n, xi(e));
|
1195
|
-
}, Ai = (e, n) => {
|
1196
|
-
if (!e)
|
1197
|
-
return V;
|
1198
|
-
const t = new no();
|
1199
|
-
e.state = t, t.strm = e, t.window = null, t.mode = ot;
|
1200
|
-
const i = Si(e, n);
|
1201
|
-
return i !== ue && (e.state = null), i;
|
1202
|
-
}, io = (e) => Ai(e, to);
|
1203
|
-
let Cn = !0, vt, kt;
|
1204
|
-
const ro = (e) => {
|
1205
|
-
if (Cn) {
|
1206
|
-
vt = new Int32Array(512), kt = new Int32Array(32);
|
1207
|
-
let n = 0;
|
1208
|
-
for (; n < 144; )
|
1209
|
-
e.lens[n++] = 8;
|
1210
|
-
for (; n < 256; )
|
1211
|
-
e.lens[n++] = 9;
|
1212
|
-
for (; n < 280; )
|
1213
|
-
e.lens[n++] = 7;
|
1214
|
-
for (; n < 288; )
|
1215
|
-
e.lens[n++] = 8;
|
1216
|
-
for (Re(wi, e.lens, 0, 288, vt, 0, e.work, { bits: 9 }), n = 0; n < 32; )
|
1217
|
-
e.lens[n++] = 5;
|
1218
|
-
Re(pi, e.lens, 0, 32, kt, 0, e.work, { bits: 5 }), Cn = !1;
|
1219
|
-
}
|
1220
|
-
e.lencode = vt, e.lenbits = 9, e.distcode = kt, e.distbits = 5;
|
1221
|
-
}, Ii = (e, n, t, i) => {
|
1222
|
-
let a;
|
1223
|
-
const r = e.state;
|
1224
|
-
return r.window === null && (r.wsize = 1 << r.wbits, r.wnext = 0, r.whave = 0, r.window = new Uint8Array(r.wsize)), i >= r.wsize ? (r.window.set(n.subarray(t - r.wsize, t), 0), r.wnext = 0, r.whave = r.wsize) : (a = r.wsize - r.wnext, a > i && (a = i), r.window.set(n.subarray(t - i, t - i + a), r.wnext), i -= a, i ? (r.window.set(n.subarray(t - i, t), 0), r.wnext = i, r.whave = r.wsize) : (r.wnext += a, r.wnext === r.wsize && (r.wnext = 0), r.whave < r.wsize && (r.whave += a))), 0;
|
1225
|
-
}, ao = (e, n) => {
|
1226
|
-
let t, i, a, r, o, s, f, l, c, w, h, u, d, g, v = 0, k, E, A, b, x, I, p, S;
|
1227
|
-
const _ = new Uint8Array(4);
|
1228
|
-
let y, m;
|
1229
|
-
const U = (
|
1230
|
-
/* permutation of code lengths */
|
1231
|
-
new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15])
|
1232
|
-
);
|
1233
|
-
if (he(e) || !e.output || !e.input && e.avail_in !== 0)
|
1234
|
-
return V;
|
1235
|
-
t = e.state, t.mode === W && (t.mode = pt), o = e.next_out, a = e.output, f = e.avail_out, r = e.next_in, i = e.input, s = e.avail_in, l = t.hold, c = t.bits, w = s, h = f, S = ue;
|
1236
|
-
e:
|
1237
|
-
for (; ; )
|
1238
|
-
switch (t.mode) {
|
1239
|
-
case ot:
|
1240
|
-
if (t.wrap === 0) {
|
1241
|
-
t.mode = pt;
|
1242
|
-
break;
|
1243
|
-
}
|
1244
|
-
for (; c < 16; ) {
|
1245
|
-
if (s === 0)
|
1246
|
-
break e;
|
1247
|
-
s--, l += i[r++] << c, c += 8;
|
1248
|
-
}
|
1249
|
-
if (t.wrap & 2 && l === 35615) {
|
1250
|
-
t.wbits === 0 && (t.wbits = 15), t.check = 0, _[0] = l & 255, _[1] = l >>> 8 & 255, t.check = N(t.check, _, 2, 0), l = 0, c = 0, t.mode = gn;
|
1251
|
-
break;
|
1252
|
-
}
|
1253
|
-
if (t.head && (t.head.done = !1), !(t.wrap & 1) || /* check if zlib header allowed */
|
1254
|
-
(((l & 255) << 8) + (l >> 8)) % 31) {
|
1255
|
-
e.msg = "incorrect header check", t.mode = R;
|
1256
|
-
break;
|
1257
|
-
}
|
1258
|
-
if ((l & 15) !== bn) {
|
1259
|
-
e.msg = "unknown compression method", t.mode = R;
|
1260
|
-
break;
|
1261
|
-
}
|
1262
|
-
if (l >>>= 4, c -= 4, p = (l & 15) + 8, t.wbits === 0 && (t.wbits = p), p > 15 || p > t.wbits) {
|
1263
|
-
e.msg = "invalid window size", t.mode = R;
|
1264
|
-
break;
|
1265
|
-
}
|
1266
|
-
t.dmax = 1 << t.wbits, t.flags = 0, e.adler = t.check = 1, t.mode = l & 512 ? xn : W, l = 0, c = 0;
|
1267
|
-
break;
|
1268
|
-
case gn:
|
1269
|
-
for (; c < 16; ) {
|
1270
|
-
if (s === 0)
|
1271
|
-
break e;
|
1272
|
-
s--, l += i[r++] << c, c += 8;
|
1273
|
-
}
|
1274
|
-
if (t.flags = l, (t.flags & 255) !== bn) {
|
1275
|
-
e.msg = "unknown compression method", t.mode = R;
|
1276
|
-
break;
|
1277
|
-
}
|
1278
|
-
if (t.flags & 57344) {
|
1279
|
-
e.msg = "unknown header flags set", t.mode = R;
|
1280
|
-
break;
|
1281
|
-
}
|
1282
|
-
t.head && (t.head.text = l >> 8 & 1), t.flags & 512 && t.wrap & 4 && (_[0] = l & 255, _[1] = l >>> 8 & 255, t.check = N(t.check, _, 2, 0)), l = 0, c = 0, t.mode = wn;
|
1283
|
-
/* falls through */
|
1284
|
-
case wn:
|
1285
|
-
for (; c < 32; ) {
|
1286
|
-
if (s === 0)
|
1287
|
-
break e;
|
1288
|
-
s--, l += i[r++] << c, c += 8;
|
1289
|
-
}
|
1290
|
-
t.head && (t.head.time = l), t.flags & 512 && t.wrap & 4 && (_[0] = l & 255, _[1] = l >>> 8 & 255, _[2] = l >>> 16 & 255, _[3] = l >>> 24 & 255, t.check = N(t.check, _, 4, 0)), l = 0, c = 0, t.mode = pn;
|
1291
|
-
/* falls through */
|
1292
|
-
case pn:
|
1293
|
-
for (; c < 16; ) {
|
1294
|
-
if (s === 0)
|
1295
|
-
break e;
|
1296
|
-
s--, l += i[r++] << c, c += 8;
|
1297
|
-
}
|
1298
|
-
t.head && (t.head.xflags = l & 255, t.head.os = l >> 8), t.flags & 512 && t.wrap & 4 && (_[0] = l & 255, _[1] = l >>> 8 & 255, t.check = N(t.check, _, 2, 0)), l = 0, c = 0, t.mode = mn;
|
1299
|
-
/* falls through */
|
1300
|
-
case mn:
|
1301
|
-
if (t.flags & 1024) {
|
1302
|
-
for (; c < 16; ) {
|
1303
|
-
if (s === 0)
|
1304
|
-
break e;
|
1305
|
-
s--, l += i[r++] << c, c += 8;
|
1306
|
-
}
|
1307
|
-
t.length = l, t.head && (t.head.extra_len = l), t.flags & 512 && t.wrap & 4 && (_[0] = l & 255, _[1] = l >>> 8 & 255, t.check = N(t.check, _, 2, 0)), l = 0, c = 0;
|
1308
|
-
} else t.head && (t.head.extra = null);
|
1309
|
-
t.mode = yn;
|
1310
|
-
/* falls through */
|
1311
|
-
case yn:
|
1312
|
-
if (t.flags & 1024 && (u = t.length, u > s && (u = s), u && (t.head && (p = t.head.extra_len - t.length, t.head.extra || (t.head.extra = new Uint8Array(t.head.extra_len)), t.head.extra.set(
|
1313
|
-
i.subarray(
|
1314
|
-
r,
|
1315
|
-
// extra field is limited to 65536 bytes
|
1316
|
-
// - no need for additional size check
|
1317
|
-
r + u
|
1318
|
-
),
|
1319
|
-
/*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
|
1320
|
-
p
|
1321
|
-
)), t.flags & 512 && t.wrap & 4 && (t.check = N(t.check, i, u, r)), s -= u, r += u, t.length -= u), t.length))
|
1322
|
-
break e;
|
1323
|
-
t.length = 0, t.mode = vn;
|
1324
|
-
/* falls through */
|
1325
|
-
case vn:
|
1326
|
-
if (t.flags & 2048) {
|
1327
|
-
if (s === 0)
|
1328
|
-
break e;
|
1329
|
-
u = 0;
|
1330
|
-
do
|
1331
|
-
p = i[r + u++], t.head && p && t.length < 65536 && (t.head.name += String.fromCharCode(p));
|
1332
|
-
while (p && u < s);
|
1333
|
-
if (t.flags & 512 && t.wrap & 4 && (t.check = N(t.check, i, u, r)), s -= u, r += u, p)
|
1334
|
-
break e;
|
1335
|
-
} else t.head && (t.head.name = null);
|
1336
|
-
t.length = 0, t.mode = kn;
|
1337
|
-
/* falls through */
|
1338
|
-
case kn:
|
1339
|
-
if (t.flags & 4096) {
|
1340
|
-
if (s === 0)
|
1341
|
-
break e;
|
1342
|
-
u = 0;
|
1343
|
-
do
|
1344
|
-
p = i[r + u++], t.head && p && t.length < 65536 && (t.head.comment += String.fromCharCode(p));
|
1345
|
-
while (p && u < s);
|
1346
|
-
if (t.flags & 512 && t.wrap & 4 && (t.check = N(t.check, i, u, r)), s -= u, r += u, p)
|
1347
|
-
break e;
|
1348
|
-
} else t.head && (t.head.comment = null);
|
1349
|
-
t.mode = En;
|
1350
|
-
/* falls through */
|
1351
|
-
case En:
|
1352
|
-
if (t.flags & 512) {
|
1353
|
-
for (; c < 16; ) {
|
1354
|
-
if (s === 0)
|
1355
|
-
break e;
|
1356
|
-
s--, l += i[r++] << c, c += 8;
|
1357
|
-
}
|
1358
|
-
if (t.wrap & 4 && l !== (t.check & 65535)) {
|
1359
|
-
e.msg = "header crc mismatch", t.mode = R;
|
1360
|
-
break;
|
1361
|
-
}
|
1362
|
-
l = 0, c = 0;
|
1363
|
-
}
|
1364
|
-
t.head && (t.head.hcrc = t.flags >> 9 & 1, t.head.done = !0), e.adler = t.check = 0, t.mode = W;
|
1365
|
-
break;
|
1366
|
-
case xn:
|
1367
|
-
for (; c < 32; ) {
|
1368
|
-
if (s === 0)
|
1369
|
-
break e;
|
1370
|
-
s--, l += i[r++] << c, c += 8;
|
1371
|
-
}
|
1372
|
-
e.adler = t.check = Zn(l), l = 0, c = 0, t.mode = nt;
|
1373
|
-
/* falls through */
|
1374
|
-
case nt:
|
1375
|
-
if (t.havedict === 0)
|
1376
|
-
return e.next_out = o, e.avail_out = f, e.next_in = r, e.avail_in = s, t.hold = l, t.bits = c, Wa;
|
1377
|
-
e.adler = t.check = 1, t.mode = W;
|
1378
|
-
/* falls through */
|
1379
|
-
case W:
|
1380
|
-
if (n === ja || n === je)
|
1381
|
-
break e;
|
1382
|
-
/* falls through */
|
1383
|
-
case pt:
|
1384
|
-
if (t.last) {
|
1385
|
-
l >>>= c & 7, c -= c & 7, t.mode = yt;
|
1386
|
-
break;
|
1387
|
-
}
|
1388
|
-
for (; c < 3; ) {
|
1389
|
-
if (s === 0)
|
1390
|
-
break e;
|
1391
|
-
s--, l += i[r++] << c, c += 8;
|
1392
|
-
}
|
1393
|
-
switch (t.last = l & 1, l >>>= 1, c -= 1, l & 3) {
|
1394
|
-
case 0:
|
1395
|
-
t.mode = Sn;
|
1396
|
-
break;
|
1397
|
-
case 1:
|
1398
|
-
if (ro(t), t.mode = Xe, n === je) {
|
1399
|
-
l >>>= 2, c -= 2;
|
1400
|
-
break e;
|
1401
|
-
}
|
1402
|
-
break;
|
1403
|
-
case 2:
|
1404
|
-
t.mode = In;
|
1405
|
-
break;
|
1406
|
-
case 3:
|
1407
|
-
e.msg = "invalid block type", t.mode = R;
|
1408
|
-
}
|
1409
|
-
l >>>= 2, c -= 2;
|
1410
|
-
break;
|
1411
|
-
case Sn:
|
1412
|
-
for (l >>>= c & 7, c -= c & 7; c < 32; ) {
|
1413
|
-
if (s === 0)
|
1414
|
-
break e;
|
1415
|
-
s--, l += i[r++] << c, c += 8;
|
1416
|
-
}
|
1417
|
-
if ((l & 65535) !== (l >>> 16 ^ 65535)) {
|
1418
|
-
e.msg = "invalid stored block lengths", t.mode = R;
|
1419
|
-
break;
|
1420
|
-
}
|
1421
|
-
if (t.length = l & 65535, l = 0, c = 0, t.mode = mt, n === je)
|
1422
|
-
break e;
|
1423
|
-
/* falls through */
|
1424
|
-
case mt:
|
1425
|
-
t.mode = An;
|
1426
|
-
/* falls through */
|
1427
|
-
case An:
|
1428
|
-
if (u = t.length, u) {
|
1429
|
-
if (u > s && (u = s), u > f && (u = f), u === 0)
|
1430
|
-
break e;
|
1431
|
-
a.set(i.subarray(r, r + u), o), s -= u, r += u, f -= u, o += u, t.length -= u;
|
1432
|
-
break;
|
1433
|
-
}
|
1434
|
-
t.mode = W;
|
1435
|
-
break;
|
1436
|
-
case In:
|
1437
|
-
for (; c < 14; ) {
|
1438
|
-
if (s === 0)
|
1439
|
-
break e;
|
1440
|
-
s--, l += i[r++] << c, c += 8;
|
1441
|
-
}
|
1442
|
-
if (t.nlen = (l & 31) + 257, l >>>= 5, c -= 5, t.ndist = (l & 31) + 1, l >>>= 5, c -= 5, t.ncode = (l & 15) + 4, l >>>= 4, c -= 4, t.nlen > 286 || t.ndist > 30) {
|
1443
|
-
e.msg = "too many length or distance symbols", t.mode = R;
|
1444
|
-
break;
|
1445
|
-
}
|
1446
|
-
t.have = 0, t.mode = Tn;
|
1447
|
-
/* falls through */
|
1448
|
-
case Tn:
|
1449
|
-
for (; t.have < t.ncode; ) {
|
1450
|
-
for (; c < 3; ) {
|
1451
|
-
if (s === 0)
|
1452
|
-
break e;
|
1453
|
-
s--, l += i[r++] << c, c += 8;
|
1454
|
-
}
|
1455
|
-
t.lens[U[t.have++]] = l & 7, l >>>= 3, c -= 3;
|
1456
|
-
}
|
1457
|
-
for (; t.have < 19; )
|
1458
|
-
t.lens[U[t.have++]] = 0;
|
1459
|
-
if (t.lencode = t.lendyn, t.lenbits = 7, y = { bits: t.lenbits }, S = Re(Ya, t.lens, 0, 19, t.lencode, 0, t.work, y), t.lenbits = y.bits, S) {
|
1460
|
-
e.msg = "invalid code lengths set", t.mode = R;
|
1461
|
-
break;
|
1462
|
-
}
|
1463
|
-
t.have = 0, t.mode = zn;
|
1464
|
-
/* falls through */
|
1465
|
-
case zn:
|
1466
|
-
for (; t.have < t.nlen + t.ndist; ) {
|
1467
|
-
for (; v = t.lencode[l & (1 << t.lenbits) - 1], k = v >>> 24, E = v >>> 16 & 255, A = v & 65535, !(k <= c); ) {
|
1468
|
-
if (s === 0)
|
1469
|
-
break e;
|
1470
|
-
s--, l += i[r++] << c, c += 8;
|
1471
|
-
}
|
1472
|
-
if (A < 16)
|
1473
|
-
l >>>= k, c -= k, t.lens[t.have++] = A;
|
1474
|
-
else {
|
1475
|
-
if (A === 16) {
|
1476
|
-
for (m = k + 2; c < m; ) {
|
1477
|
-
if (s === 0)
|
1478
|
-
break e;
|
1479
|
-
s--, l += i[r++] << c, c += 8;
|
1480
|
-
}
|
1481
|
-
if (l >>>= k, c -= k, t.have === 0) {
|
1482
|
-
e.msg = "invalid bit length repeat", t.mode = R;
|
1483
|
-
break;
|
1484
|
-
}
|
1485
|
-
p = t.lens[t.have - 1], u = 3 + (l & 3), l >>>= 2, c -= 2;
|
1486
|
-
} else if (A === 17) {
|
1487
|
-
for (m = k + 3; c < m; ) {
|
1488
|
-
if (s === 0)
|
1489
|
-
break e;
|
1490
|
-
s--, l += i[r++] << c, c += 8;
|
1491
|
-
}
|
1492
|
-
l >>>= k, c -= k, p = 0, u = 3 + (l & 7), l >>>= 3, c -= 3;
|
1493
|
-
} else {
|
1494
|
-
for (m = k + 7; c < m; ) {
|
1495
|
-
if (s === 0)
|
1496
|
-
break e;
|
1497
|
-
s--, l += i[r++] << c, c += 8;
|
1498
|
-
}
|
1499
|
-
l >>>= k, c -= k, p = 0, u = 11 + (l & 127), l >>>= 7, c -= 7;
|
1500
|
-
}
|
1501
|
-
if (t.have + u > t.nlen + t.ndist) {
|
1502
|
-
e.msg = "invalid bit length repeat", t.mode = R;
|
1503
|
-
break;
|
1504
|
-
}
|
1505
|
-
for (; u--; )
|
1506
|
-
t.lens[t.have++] = p;
|
1507
|
-
}
|
1508
|
-
}
|
1509
|
-
if (t.mode === R)
|
1510
|
-
break;
|
1511
|
-
if (t.lens[256] === 0) {
|
1512
|
-
e.msg = "invalid code -- missing end-of-block", t.mode = R;
|
1513
|
-
break;
|
1514
|
-
}
|
1515
|
-
if (t.lenbits = 9, y = { bits: t.lenbits }, S = Re(wi, t.lens, 0, t.nlen, t.lencode, 0, t.work, y), t.lenbits = y.bits, S) {
|
1516
|
-
e.msg = "invalid literal/lengths set", t.mode = R;
|
1517
|
-
break;
|
1518
|
-
}
|
1519
|
-
if (t.distbits = 6, t.distcode = t.distdyn, y = { bits: t.distbits }, S = Re(pi, t.lens, t.nlen, t.ndist, t.distcode, 0, t.work, y), t.distbits = y.bits, S) {
|
1520
|
-
e.msg = "invalid distances set", t.mode = R;
|
1521
|
-
break;
|
1522
|
-
}
|
1523
|
-
if (t.mode = Xe, n === je)
|
1524
|
-
break e;
|
1525
|
-
/* falls through */
|
1526
|
-
case Xe:
|
1527
|
-
t.mode = We;
|
1528
|
-
/* falls through */
|
1529
|
-
case We:
|
1530
|
-
if (s >= 6 && f >= 258) {
|
1531
|
-
e.next_out = o, e.avail_out = f, e.next_in = r, e.avail_in = s, t.hold = l, t.bits = c, $a(e, h), o = e.next_out, a = e.output, f = e.avail_out, r = e.next_in, i = e.input, s = e.avail_in, l = t.hold, c = t.bits, t.mode === W && (t.back = -1);
|
1532
|
-
break;
|
1533
|
-
}
|
1534
|
-
for (t.back = 0; v = t.lencode[l & (1 << t.lenbits) - 1], k = v >>> 24, E = v >>> 16 & 255, A = v & 65535, !(k <= c); ) {
|
1535
|
-
if (s === 0)
|
1536
|
-
break e;
|
1537
|
-
s--, l += i[r++] << c, c += 8;
|
1538
|
-
}
|
1539
|
-
if (E && !(E & 240)) {
|
1540
|
-
for (b = k, x = E, I = A; v = t.lencode[I + ((l & (1 << b + x) - 1) >> b)], k = v >>> 24, E = v >>> 16 & 255, A = v & 65535, !(b + k <= c); ) {
|
1541
|
-
if (s === 0)
|
1542
|
-
break e;
|
1543
|
-
s--, l += i[r++] << c, c += 8;
|
1544
|
-
}
|
1545
|
-
l >>>= b, c -= b, t.back += b;
|
1546
|
-
}
|
1547
|
-
if (l >>>= k, c -= k, t.back += k, t.length = A, E === 0) {
|
1548
|
-
t.mode = Dn;
|
1549
|
-
break;
|
1550
|
-
}
|
1551
|
-
if (E & 32) {
|
1552
|
-
t.back = -1, t.mode = W;
|
1553
|
-
break;
|
1554
|
-
}
|
1555
|
-
if (E & 64) {
|
1556
|
-
e.msg = "invalid literal/length code", t.mode = R;
|
1557
|
-
break;
|
1558
|
-
}
|
1559
|
-
t.extra = E & 15, t.mode = On;
|
1560
|
-
/* falls through */
|
1561
|
-
case On:
|
1562
|
-
if (t.extra) {
|
1563
|
-
for (m = t.extra; c < m; ) {
|
1564
|
-
if (s === 0)
|
1565
|
-
break e;
|
1566
|
-
s--, l += i[r++] << c, c += 8;
|
1567
|
-
}
|
1568
|
-
t.length += l & (1 << t.extra) - 1, l >>>= t.extra, c -= t.extra, t.back += t.extra;
|
1569
|
-
}
|
1570
|
-
t.was = t.length, t.mode = Rn;
|
1571
|
-
/* falls through */
|
1572
|
-
case Rn:
|
1573
|
-
for (; v = t.distcode[l & (1 << t.distbits) - 1], k = v >>> 24, E = v >>> 16 & 255, A = v & 65535, !(k <= c); ) {
|
1574
|
-
if (s === 0)
|
1575
|
-
break e;
|
1576
|
-
s--, l += i[r++] << c, c += 8;
|
1577
|
-
}
|
1578
|
-
if (!(E & 240)) {
|
1579
|
-
for (b = k, x = E, I = A; v = t.distcode[I + ((l & (1 << b + x) - 1) >> b)], k = v >>> 24, E = v >>> 16 & 255, A = v & 65535, !(b + k <= c); ) {
|
1580
|
-
if (s === 0)
|
1581
|
-
break e;
|
1582
|
-
s--, l += i[r++] << c, c += 8;
|
1583
|
-
}
|
1584
|
-
l >>>= b, c -= b, t.back += b;
|
1585
|
-
}
|
1586
|
-
if (l >>>= k, c -= k, t.back += k, E & 64) {
|
1587
|
-
e.msg = "invalid distance code", t.mode = R;
|
1588
|
-
break;
|
1589
|
-
}
|
1590
|
-
t.offset = A, t.extra = E & 15, t.mode = Un;
|
1591
|
-
/* falls through */
|
1592
|
-
case Un:
|
1593
|
-
if (t.extra) {
|
1594
|
-
for (m = t.extra; c < m; ) {
|
1595
|
-
if (s === 0)
|
1596
|
-
break e;
|
1597
|
-
s--, l += i[r++] << c, c += 8;
|
1598
|
-
}
|
1599
|
-
t.offset += l & (1 << t.extra) - 1, l >>>= t.extra, c -= t.extra, t.back += t.extra;
|
1600
|
-
}
|
1601
|
-
if (t.offset > t.dmax) {
|
1602
|
-
e.msg = "invalid distance too far back", t.mode = R;
|
1603
|
-
break;
|
1604
|
-
}
|
1605
|
-
t.mode = Bn;
|
1606
|
-
/* falls through */
|
1607
|
-
case Bn:
|
1608
|
-
if (f === 0)
|
1609
|
-
break e;
|
1610
|
-
if (u = h - f, t.offset > u) {
|
1611
|
-
if (u = t.offset - u, u > t.whave && t.sane) {
|
1612
|
-
e.msg = "invalid distance too far back", t.mode = R;
|
1613
|
-
break;
|
1614
|
-
}
|
1615
|
-
u > t.wnext ? (u -= t.wnext, d = t.wsize - u) : d = t.wnext - u, u > t.length && (u = t.length), g = t.window;
|
1616
|
-
} else
|
1617
|
-
g = a, d = o - t.offset, u = t.length;
|
1618
|
-
u > f && (u = f), f -= u, t.length -= u;
|
1619
|
-
do
|
1620
|
-
a[o++] = g[d++];
|
1621
|
-
while (--u);
|
1622
|
-
t.length === 0 && (t.mode = We);
|
1623
|
-
break;
|
1624
|
-
case Dn:
|
1625
|
-
if (f === 0)
|
1626
|
-
break e;
|
1627
|
-
a[o++] = t.length, f--, t.mode = We;
|
1628
|
-
break;
|
1629
|
-
case yt:
|
1630
|
-
if (t.wrap) {
|
1631
|
-
for (; c < 32; ) {
|
1632
|
-
if (s === 0)
|
1633
|
-
break e;
|
1634
|
-
s--, l |= i[r++] << c, c += 8;
|
1635
|
-
}
|
1636
|
-
if (h -= f, e.total_out += h, t.total += h, t.wrap & 4 && h && (e.adler = t.check = /*UPDATE_CHECK(state.check, put - _out, _out);*/
|
1637
|
-
t.flags ? N(t.check, a, h, o - h) : Le(t.check, a, h, o - h)), h = f, t.wrap & 4 && (t.flags ? l : Zn(l)) !== t.check) {
|
1638
|
-
e.msg = "incorrect data check", t.mode = R;
|
1639
|
-
break;
|
1640
|
-
}
|
1641
|
-
l = 0, c = 0;
|
1642
|
-
}
|
1643
|
-
t.mode = Nn;
|
1644
|
-
/* falls through */
|
1645
|
-
case Nn:
|
1646
|
-
if (t.wrap && t.flags) {
|
1647
|
-
for (; c < 32; ) {
|
1648
|
-
if (s === 0)
|
1649
|
-
break e;
|
1650
|
-
s--, l += i[r++] << c, c += 8;
|
1651
|
-
}
|
1652
|
-
if (t.wrap & 4 && l !== (t.total & 4294967295)) {
|
1653
|
-
e.msg = "incorrect length check", t.mode = R;
|
1654
|
-
break;
|
1655
|
-
}
|
1656
|
-
l = 0, c = 0;
|
1657
|
-
}
|
1658
|
-
t.mode = Ln;
|
1659
|
-
/* falls through */
|
1660
|
-
case Ln:
|
1661
|
-
S = Xa;
|
1662
|
-
break e;
|
1663
|
-
case R:
|
1664
|
-
S = mi;
|
1665
|
-
break e;
|
1666
|
-
case vi:
|
1667
|
-
return yi;
|
1668
|
-
case ki:
|
1669
|
-
/* falls through */
|
1670
|
-
default:
|
1671
|
-
return V;
|
1672
|
-
}
|
1673
|
-
return e.next_out = o, e.avail_out = f, e.next_in = r, e.avail_in = s, t.hold = l, t.bits = c, (t.wsize || h !== e.avail_out && t.mode < R && (t.mode < yt || n !== _n)) && Ii(e, e.output, e.next_out, h - e.avail_out), w -= e.avail_in, h -= e.avail_out, e.total_in += w, e.total_out += h, t.total += h, t.wrap & 4 && h && (e.adler = t.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/
|
1674
|
-
t.flags ? N(t.check, a, h, e.next_out - h) : Le(t.check, a, h, e.next_out - h)), e.data_type = t.bits + (t.last ? 64 : 0) + (t.mode === W ? 128 : 0) + (t.mode === Xe || t.mode === mt ? 256 : 0), (w === 0 && h === 0 || n === _n) && S === ue && (S = Ja), S;
|
1675
|
-
}, oo = (e) => {
|
1676
|
-
if (he(e))
|
1677
|
-
return V;
|
1678
|
-
let n = e.state;
|
1679
|
-
return n.window && (n.window = null), e.state = null, ue;
|
1680
|
-
}, lo = (e, n) => {
|
1681
|
-
if (he(e))
|
1682
|
-
return V;
|
1683
|
-
const t = e.state;
|
1684
|
-
return t.wrap & 2 ? (t.head = n, n.done = !1, ue) : V;
|
1685
|
-
}, so = (e, n) => {
|
1686
|
-
const t = n.length;
|
1687
|
-
let i, a, r;
|
1688
|
-
return he(e) || (i = e.state, i.wrap !== 0 && i.mode !== nt) ? V : i.mode === nt && (a = 1, a = Le(a, n, t, 0), a !== i.check) ? mi : (r = Ii(e, n, t, t), r ? (i.mode = vi, yi) : (i.havedict = 1, ue));
|
1689
|
-
};
|
1690
|
-
var co = xi, fo = Si, uo = Ei, ho = io, _o = Ai, bo = ao, go = oo, wo = lo, po = so, mo = "pako inflate (from Nodeca project)", Q = {
|
1691
|
-
inflateReset: co,
|
1692
|
-
inflateReset2: fo,
|
1693
|
-
inflateResetKeep: uo,
|
1694
|
-
inflateInit: ho,
|
1695
|
-
inflateInit2: _o,
|
1696
|
-
inflate: bo,
|
1697
|
-
inflateEnd: go,
|
1698
|
-
inflateGetHeader: wo,
|
1699
|
-
inflateSetDictionary: po,
|
1700
|
-
inflateInfo: mo
|
1701
|
-
};
|
1702
|
-
function yo() {
|
1703
|
-
this.text = 0, this.time = 0, this.xflags = 0, this.os = 0, this.extra = null, this.extra_len = 0, this.name = "", this.comment = "", this.hcrc = 0, this.done = !1;
|
1704
|
-
}
|
1705
|
-
var vo = yo;
|
1706
|
-
const Ti = Object.prototype.toString, {
|
1707
|
-
Z_NO_FLUSH: ko,
|
1708
|
-
Z_FINISH: Eo,
|
1709
|
-
Z_OK: Fe,
|
1710
|
-
Z_STREAM_END: Et,
|
1711
|
-
Z_NEED_DICT: xt,
|
1712
|
-
Z_STREAM_ERROR: xo,
|
1713
|
-
Z_DATA_ERROR: Fn,
|
1714
|
-
Z_MEM_ERROR: So
|
1715
|
-
} = Pe;
|
1716
|
-
function Ke(e) {
|
1717
|
-
this.options = at.assign({
|
1718
|
-
chunkSize: 1024 * 64,
|
1719
|
-
windowBits: 15,
|
1720
|
-
to: ""
|
1721
|
-
}, e || {});
|
1722
|
-
const n = this.options;
|
1723
|
-
n.raw && n.windowBits >= 0 && n.windowBits < 16 && (n.windowBits = -n.windowBits, n.windowBits === 0 && (n.windowBits = -15)), n.windowBits >= 0 && n.windowBits < 16 && !(e && e.windowBits) && (n.windowBits += 32), n.windowBits > 15 && n.windowBits < 48 && (n.windowBits & 15 || (n.windowBits |= 15)), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new bi(), this.strm.avail_out = 0;
|
1724
|
-
let t = Q.inflateInit2(
|
1725
|
-
this.strm,
|
1726
|
-
n.windowBits
|
1727
|
-
);
|
1728
|
-
if (t !== Fe)
|
1729
|
-
throw new Error(pe[t]);
|
1730
|
-
if (this.header = new vo(), Q.inflateGetHeader(this.strm, this.header), n.dictionary && (typeof n.dictionary == "string" ? n.dictionary = Ce.string2buf(n.dictionary) : Ti.call(n.dictionary) === "[object ArrayBuffer]" && (n.dictionary = new Uint8Array(n.dictionary)), n.raw && (t = Q.inflateSetDictionary(this.strm, n.dictionary), t !== Fe)))
|
1731
|
-
throw new Error(pe[t]);
|
1732
|
-
}
|
1733
|
-
Ke.prototype.push = function(e, n) {
|
1734
|
-
const t = this.strm, i = this.options.chunkSize, a = this.options.dictionary;
|
1735
|
-
let r, o, s;
|
1736
|
-
if (this.ended) return !1;
|
1737
|
-
for (n === ~~n ? o = n : o = n === !0 ? Eo : ko, Ti.call(e) === "[object ArrayBuffer]" ? t.input = new Uint8Array(e) : t.input = e, t.next_in = 0, t.avail_in = t.input.length; ; ) {
|
1738
|
-
for (t.avail_out === 0 && (t.output = new Uint8Array(i), t.next_out = 0, t.avail_out = i), r = Q.inflate(t, o), r === xt && a && (r = Q.inflateSetDictionary(t, a), r === Fe ? r = Q.inflate(t, o) : r === Fn && (r = xt)); t.avail_in > 0 && r === Et && t.state.wrap > 0 && e[t.next_in] !== 0; )
|
1739
|
-
Q.inflateReset(t), r = Q.inflate(t, o);
|
1740
|
-
switch (r) {
|
1741
|
-
case xo:
|
1742
|
-
case Fn:
|
1743
|
-
case xt:
|
1744
|
-
case So:
|
1745
|
-
return this.onEnd(r), this.ended = !0, !1;
|
1746
|
-
}
|
1747
|
-
if (s = t.avail_out, t.next_out && (t.avail_out === 0 || r === Et))
|
1748
|
-
if (this.options.to === "string") {
|
1749
|
-
let f = Ce.utf8border(t.output, t.next_out), l = t.next_out - f, c = Ce.buf2string(t.output, f);
|
1750
|
-
t.next_out = l, t.avail_out = i - l, l && t.output.set(t.output.subarray(f, f + l), 0), this.onData(c);
|
1751
|
-
} else
|
1752
|
-
this.onData(t.output.length === t.next_out ? t.output : t.output.subarray(0, t.next_out));
|
1753
|
-
if (!(r === Fe && s === 0)) {
|
1754
|
-
if (r === Et)
|
1755
|
-
return r = Q.inflateEnd(this.strm), this.onEnd(r), this.ended = !0, !0;
|
1756
|
-
if (t.avail_in === 0) break;
|
1757
|
-
}
|
1758
|
-
}
|
1759
|
-
return !0;
|
1760
|
-
};
|
1761
|
-
Ke.prototype.onData = function(e) {
|
1762
|
-
this.chunks.push(e);
|
1763
|
-
};
|
1764
|
-
Ke.prototype.onEnd = function(e) {
|
1765
|
-
e === Fe && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = at.flattenChunks(this.chunks)), this.chunks = [], this.err = e, this.msg = this.strm.msg;
|
1766
|
-
};
|
1767
|
-
function jt(e, n) {
|
1768
|
-
const t = new Ke(n);
|
1769
|
-
if (t.push(e), t.err) throw t.msg || pe[t.err];
|
1770
|
-
return t.result;
|
1771
|
-
}
|
1772
|
-
function Ao(e, n) {
|
1773
|
-
return n = n || {}, n.raw = !0, jt(e, n);
|
1774
|
-
}
|
1775
|
-
var Io = Ke, To = jt, zo = Ao, Oo = jt, Ro = Pe, Uo = {
|
1776
|
-
Inflate: Io,
|
1777
|
-
inflate: To,
|
1778
|
-
inflateRaw: zo,
|
1779
|
-
ungzip: Oo,
|
1780
|
-
constants: Ro
|
1781
|
-
};
|
1782
|
-
const { Inflate: Il, inflate: Tl, inflateRaw: Bo, ungzip: zl } = Uo;
|
1783
|
-
var Do = Bo;
|
1784
|
-
function No(e) {
|
1785
|
-
return Do(e.subarray(2));
|
1786
|
-
}
|
1787
|
-
class Lo extends Error {
|
1788
|
-
constructor(n) {
|
1789
|
-
super(n), this.code = "ERR_ABORTED";
|
1790
|
-
}
|
1791
|
-
}
|
1792
|
-
function Zo(e) {
|
1793
|
-
e.sort((a, r) => a.offset - r.offset);
|
1794
|
-
const n = [];
|
1795
|
-
let t, i;
|
1796
|
-
for (const a of e)
|
1797
|
-
t && i && a.offset - i <= 2e3 ? (t.length = t.length + a.length - i + a.offset, t.blocks.push(a)) : n.push(t = {
|
1798
|
-
blocks: [a],
|
1799
|
-
length: a.length,
|
1800
|
-
offset: a.offset
|
1801
|
-
}), i = t.offset + t.length;
|
1802
|
-
return n;
|
1803
|
-
}
|
1804
|
-
function Je(e) {
|
1805
|
-
if (e && e.aborted)
|
1806
|
-
if (typeof DOMException > "u") {
|
1807
|
-
const n = new Lo("aborted");
|
1808
|
-
throw n.code = "ERR_ABORTED", n;
|
1809
|
-
} else
|
1810
|
-
throw new DOMException("aborted", "AbortError");
|
1811
|
-
}
|
1812
|
-
const St = typeof TextDecoder < "u" ? new TextDecoder("utf8") : void 0;
|
1813
|
-
function At(e, n, t, i) {
|
1814
|
-
return e < i && n >= t;
|
1815
|
-
}
|
1816
|
-
class zi {
|
1817
|
-
constructor(n, t, i, a, r, o) {
|
1818
|
-
if (this.bbi = n, this.refsByName = t, this.cirTreeOffset = i, this.isBigEndian = a, this.isCompressed = r, this.blockType = o, this.featureCache = new Kn({
|
1819
|
-
cache: new Gn({ maxSize: 1e3 }),
|
1820
|
-
fill: async (s, f) => {
|
1821
|
-
const l = s.length, c = s.offset, { buffer: w } = await this.bbi.read(ee.Buffer.alloc(l), 0, l, c, {
|
1822
|
-
signal: f
|
1823
|
-
});
|
1824
|
-
return w;
|
1825
|
-
}
|
1826
|
-
}), !(i >= 0))
|
1827
|
-
throw new Error("invalid cirTreeOffset!");
|
1828
|
-
}
|
1829
|
-
async readWigData(n, t, i, a, r) {
|
1830
|
-
try {
|
1831
|
-
const { refsByName: o, bbi: s, cirTreeOffset: f, isBigEndian: l } = this, c = o[n];
|
1832
|
-
c === void 0 && a.complete();
|
1833
|
-
const w = { chrId: c, start: t, end: i };
|
1834
|
-
this.cirTreePromise || (this.cirTreePromise = s.read(ee.Buffer.alloc(48), 0, 48, f, r));
|
1835
|
-
const { buffer: h } = await this.cirTreePromise, u = l ? h.readUInt32BE(4) : h.readUInt32LE(4);
|
1836
|
-
let d = [], g = 0;
|
1837
|
-
const v = !0, k = (x, I, p) => {
|
1838
|
-
try {
|
1839
|
-
const _ = x.subarray(I), y = new DataView(_.buffer, _.byteOffset, _.length);
|
1840
|
-
let m = 0;
|
1841
|
-
const U = y.getUint8(m);
|
1842
|
-
m += 2;
|
1843
|
-
const Z = y.getUint16(m, v);
|
1844
|
-
if (m += 2, U === 1) {
|
1845
|
-
const B = [];
|
1846
|
-
for (let O = 0; O < Z; O++) {
|
1847
|
-
const F = y.getUint32(m, v);
|
1848
|
-
m += 4;
|
1849
|
-
const ae = y.getUint32(m, v);
|
1850
|
-
m += 4;
|
1851
|
-
const lt = y.getUint32(m, v);
|
1852
|
-
m += 4;
|
1853
|
-
const st = y.getUint32(m, v);
|
1854
|
-
m += 4;
|
1855
|
-
const ct = Number(y.getBigUint64(m, v));
|
1856
|
-
m += 8;
|
1857
|
-
const ft = Number(y.getBigUint64(m, v));
|
1858
|
-
m += 8, B.push({
|
1859
|
-
startChrom: F,
|
1860
|
-
startBase: ae,
|
1861
|
-
endBase: st,
|
1862
|
-
endChrom: lt,
|
1863
|
-
blockOffset: ct,
|
1864
|
-
blockSize: ft,
|
1865
|
-
offset: m
|
1866
|
-
});
|
1867
|
-
}
|
1868
|
-
d = d.concat(B.filter((O) => E(O)).map((O) => ({
|
1869
|
-
offset: O.blockOffset,
|
1870
|
-
length: O.blockSize
|
1871
|
-
})));
|
1872
|
-
} else if (U === 0) {
|
1873
|
-
const B = [];
|
1874
|
-
for (let F = 0; F < Z; F++) {
|
1875
|
-
const ae = y.getUint32(m, v);
|
1876
|
-
m += 4;
|
1877
|
-
const lt = y.getUint32(m, v);
|
1878
|
-
m += 4;
|
1879
|
-
const st = y.getUint32(m, v);
|
1880
|
-
m += 4;
|
1881
|
-
const ct = y.getUint32(m, v);
|
1882
|
-
m += 4;
|
1883
|
-
const ft = Number(y.getBigUint64(m, v));
|
1884
|
-
m += 8, B.push({
|
1885
|
-
startChrom: ae,
|
1886
|
-
startBase: lt,
|
1887
|
-
endChrom: st,
|
1888
|
-
endBase: ct,
|
1889
|
-
blockOffset: ft,
|
1890
|
-
offset: m
|
1891
|
-
});
|
1892
|
-
}
|
1893
|
-
const O = B.filter((F) => E(F)).map((F) => F.blockOffset);
|
1894
|
-
O.length > 0 && b(O, p + 1);
|
1895
|
-
}
|
1896
|
-
} catch (S) {
|
1897
|
-
a.error(S);
|
1898
|
-
}
|
1899
|
-
}, E = (x) => {
|
1900
|
-
const { startChrom: I, startBase: p, endChrom: S, endBase: _ } = x;
|
1901
|
-
return (I < c || I === c && p <= i) && (S > c || S === c && _ >= t);
|
1902
|
-
}, A = async (x, I, p) => {
|
1903
|
-
try {
|
1904
|
-
const S = I.max - I.min, _ = I.min, y = await this.featureCache.get(`${S}_${_}`, { length: S, offset: _ }, r == null ? void 0 : r.signal);
|
1905
|
-
for (const m of x)
|
1906
|
-
I.contains(m) && (k(y, m - _, p), g -= 1, g === 0 && this.readFeatures(a, d, {
|
1907
|
-
...r,
|
1908
|
-
request: w
|
1909
|
-
}).catch((U) => {
|
1910
|
-
a.error(U);
|
1911
|
-
}));
|
1912
|
-
} catch (S) {
|
1913
|
-
a.error(S);
|
1914
|
-
}
|
1915
|
-
}, b = (x, I) => {
|
1916
|
-
try {
|
1917
|
-
g += x.length;
|
1918
|
-
const p = 4 + u * 32;
|
1919
|
-
let S = new be([
|
1920
|
-
{
|
1921
|
-
min: x[0],
|
1922
|
-
max: x[0] + p
|
1923
|
-
}
|
1924
|
-
]);
|
1925
|
-
for (let _ = 1; _ < x.length; _ += 1) {
|
1926
|
-
const y = new be([
|
1927
|
-
{
|
1928
|
-
min: x[_],
|
1929
|
-
max: x[_] + p
|
1930
|
-
}
|
1931
|
-
]);
|
1932
|
-
S = S.union(y);
|
1933
|
-
}
|
1934
|
-
S.getRanges().map((_) => A(x, _, I));
|
1935
|
-
} catch (p) {
|
1936
|
-
a.error(p);
|
1937
|
-
}
|
1938
|
-
};
|
1939
|
-
b([Number(f) + 48], 1);
|
1940
|
-
return;
|
1941
|
-
} catch (o) {
|
1942
|
-
a.error(o);
|
1943
|
-
}
|
1944
|
-
}
|
1945
|
-
parseSummaryBlock(n, t, i) {
|
1946
|
-
const a = [];
|
1947
|
-
let r = t;
|
1948
|
-
const o = new DataView(n.buffer, n.byteOffset, n.length);
|
1949
|
-
for (; r < n.byteLength; ) {
|
1950
|
-
const s = o.getUint32(r, !0);
|
1951
|
-
r += 4;
|
1952
|
-
const f = o.getUint32(r, !0);
|
1953
|
-
r += 4;
|
1954
|
-
const l = o.getUint32(r, !0);
|
1955
|
-
r += 4;
|
1956
|
-
const c = o.getUint32(r, !0);
|
1957
|
-
r += 4;
|
1958
|
-
const w = o.getFloat32(r, !0);
|
1959
|
-
r += 4;
|
1960
|
-
const h = o.getFloat32(r, !0);
|
1961
|
-
r += 4;
|
1962
|
-
const u = o.getFloat32(r, !0);
|
1963
|
-
r += 4, r += 4, (!i || s === i.chrId && At(f, l, i.start, i.end)) && a.push({
|
1964
|
-
start: f,
|
1965
|
-
end: l,
|
1966
|
-
maxScore: h,
|
1967
|
-
minScore: w,
|
1968
|
-
summary: !0,
|
1969
|
-
score: u / (c || 1)
|
1970
|
-
});
|
1971
|
-
}
|
1972
|
-
return a;
|
1973
|
-
}
|
1974
|
-
parseBigBedBlock(n, t, i, a) {
|
1975
|
-
var r;
|
1976
|
-
const o = [];
|
1977
|
-
let s = t;
|
1978
|
-
const f = !0, l = n, c = new DataView(l.buffer, l.byteOffset, l.length);
|
1979
|
-
for (; s < n.byteLength; ) {
|
1980
|
-
const w = s, h = c.getUint32(s, f);
|
1981
|
-
s += 4;
|
1982
|
-
const u = c.getInt32(s, f);
|
1983
|
-
s += 4;
|
1984
|
-
const d = c.getInt32(s, f);
|
1985
|
-
s += 4;
|
1986
|
-
let g = s;
|
1987
|
-
for (; g < n.length && n[g] !== 0; g++)
|
1988
|
-
;
|
1989
|
-
const v = n.subarray(s, g), k = (r = St == null ? void 0 : St.decode(v)) !== null && r !== void 0 ? r : v.toString();
|
1990
|
-
s = g + 1, o.push({
|
1991
|
-
chromId: h,
|
1992
|
-
start: u,
|
1993
|
-
end: d,
|
1994
|
-
rest: k,
|
1995
|
-
uniqueId: `bb-${i + w}`
|
1996
|
-
});
|
1997
|
-
}
|
1998
|
-
return a ? o.filter((w) => At(w.start, w.end, a.start, a.end)) : o;
|
1999
|
-
}
|
2000
|
-
parseBigWigBlock(n, t, i) {
|
2001
|
-
const a = n.subarray(t), r = new DataView(a.buffer, a.byteOffset, a.length);
|
2002
|
-
let o = 0;
|
2003
|
-
o += 4;
|
2004
|
-
const s = r.getInt32(o, !0);
|
2005
|
-
o += 8;
|
2006
|
-
const f = r.getUint32(o, !0);
|
2007
|
-
o += 4;
|
2008
|
-
const l = r.getUint32(o, !0);
|
2009
|
-
o += 4;
|
2010
|
-
const c = r.getUint8(o);
|
2011
|
-
o += 2;
|
2012
|
-
const w = r.getUint16(o, !0);
|
2013
|
-
o += 2;
|
2014
|
-
const h = new Array(w);
|
2015
|
-
switch (c) {
|
2016
|
-
case 1: {
|
2017
|
-
for (let u = 0; u < w; u++) {
|
2018
|
-
const d = r.getInt32(o, !0);
|
2019
|
-
o += 4;
|
2020
|
-
const g = r.getInt32(o, !0);
|
2021
|
-
o += 4;
|
2022
|
-
const v = r.getFloat32(o, !0);
|
2023
|
-
o += 4, h[u] = {
|
2024
|
-
start: d,
|
2025
|
-
end: g,
|
2026
|
-
score: v
|
2027
|
-
};
|
2028
|
-
}
|
2029
|
-
break;
|
2030
|
-
}
|
2031
|
-
case 2: {
|
2032
|
-
for (let u = 0; u < w; u++) {
|
2033
|
-
const d = r.getInt32(o, !0);
|
2034
|
-
o += 4;
|
2035
|
-
const g = r.getFloat32(o, !0);
|
2036
|
-
o += 4, h[u] = {
|
2037
|
-
score: g,
|
2038
|
-
start: d,
|
2039
|
-
end: d + l
|
2040
|
-
};
|
2041
|
-
}
|
2042
|
-
break;
|
2043
|
-
}
|
2044
|
-
case 3: {
|
2045
|
-
for (let u = 0; u < w; u++) {
|
2046
|
-
const d = r.getFloat32(o, !0);
|
2047
|
-
o += 4;
|
2048
|
-
const g = s + u * f;
|
2049
|
-
h[u] = {
|
2050
|
-
score: d,
|
2051
|
-
start: g,
|
2052
|
-
end: g + l
|
2053
|
-
};
|
2054
|
-
}
|
2055
|
-
break;
|
2056
|
-
}
|
2057
|
-
}
|
2058
|
-
return i ? h.filter((u) => At(u.start, u.end, i.start, i.end)) : h;
|
2059
|
-
}
|
2060
|
-
async readFeatures(n, t, i = {}) {
|
2061
|
-
try {
|
2062
|
-
const { blockType: a, isCompressed: r } = this, { signal: o, request: s } = i, f = Zo(t);
|
2063
|
-
Je(o), await Promise.all(f.map(async (l) => {
|
2064
|
-
Je(o);
|
2065
|
-
const { length: c, offset: w } = l, h = await this.featureCache.get(`${c}_${w}`, l, o);
|
2066
|
-
for (const u of l.blocks) {
|
2067
|
-
Je(o);
|
2068
|
-
let d = Number(u.offset) - Number(l.offset), g = h;
|
2069
|
-
switch (r && (g = No(h.subarray(d)), d = 0), Je(o), a) {
|
2070
|
-
case "summary": {
|
2071
|
-
n.next(this.parseSummaryBlock(g, d, s));
|
2072
|
-
break;
|
2073
|
-
}
|
2074
|
-
case "bigwig": {
|
2075
|
-
n.next(this.parseBigWigBlock(g, d, s));
|
2076
|
-
break;
|
2077
|
-
}
|
2078
|
-
case "bigbed": {
|
2079
|
-
n.next(this.parseBigBedBlock(g, d, Number(u.offset) * 256, s));
|
2080
|
-
break;
|
2081
|
-
}
|
2082
|
-
default:
|
2083
|
-
console.warn(`Don't know what to do with ${a}`);
|
2084
|
-
}
|
2085
|
-
}
|
2086
|
-
})), n.complete();
|
2087
|
-
} catch (a) {
|
2088
|
-
n.error(a);
|
2089
|
-
}
|
2090
|
-
}
|
2091
|
-
}
|
2092
|
-
var Ft = function(e, n) {
|
2093
|
-
return Ft = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, i) {
|
2094
|
-
t.__proto__ = i;
|
2095
|
-
} || function(t, i) {
|
2096
|
-
for (var a in i) Object.prototype.hasOwnProperty.call(i, a) && (t[a] = i[a]);
|
2097
|
-
}, Ft(e, n);
|
2098
|
-
};
|
2099
|
-
function Xt(e, n) {
|
2100
|
-
if (typeof n != "function" && n !== null)
|
2101
|
-
throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");
|
2102
|
-
Ft(e, n);
|
2103
|
-
function t() {
|
2104
|
-
this.constructor = e;
|
2105
|
-
}
|
2106
|
-
e.prototype = n === null ? Object.create(n) : (t.prototype = n.prototype, new t());
|
2107
|
-
}
|
2108
|
-
function Co(e, n, t, i) {
|
2109
|
-
function a(r) {
|
2110
|
-
return r instanceof t ? r : new t(function(o) {
|
2111
|
-
o(r);
|
2112
|
-
});
|
2113
|
-
}
|
2114
|
-
return new (t || (t = Promise))(function(r, o) {
|
2115
|
-
function s(c) {
|
2116
|
-
try {
|
2117
|
-
l(i.next(c));
|
2118
|
-
} catch (w) {
|
2119
|
-
o(w);
|
2120
|
-
}
|
2121
|
-
}
|
2122
|
-
function f(c) {
|
2123
|
-
try {
|
2124
|
-
l(i.throw(c));
|
2125
|
-
} catch (w) {
|
2126
|
-
o(w);
|
2127
|
-
}
|
2128
|
-
}
|
2129
|
-
function l(c) {
|
2130
|
-
c.done ? r(c.value) : a(c.value).then(s, f);
|
2131
|
-
}
|
2132
|
-
l((i = i.apply(e, n || [])).next());
|
2133
|
-
});
|
2134
|
-
}
|
2135
|
-
function Oi(e, n) {
|
2136
|
-
var t = { label: 0, sent: function() {
|
2137
|
-
if (r[0] & 1) throw r[1];
|
2138
|
-
return r[1];
|
2139
|
-
}, trys: [], ops: [] }, i, a, r, o = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
|
2140
|
-
return o.next = s(0), o.throw = s(1), o.return = s(2), typeof Symbol == "function" && (o[Symbol.iterator] = function() {
|
2141
|
-
return this;
|
2142
|
-
}), o;
|
2143
|
-
function s(l) {
|
2144
|
-
return function(c) {
|
2145
|
-
return f([l, c]);
|
2146
|
-
};
|
2147
|
-
}
|
2148
|
-
function f(l) {
|
2149
|
-
if (i) throw new TypeError("Generator is already executing.");
|
2150
|
-
for (; o && (o = 0, l[0] && (t = 0)), t; ) try {
|
2151
|
-
if (i = 1, a && (r = l[0] & 2 ? a.return : l[0] ? a.throw || ((r = a.return) && r.call(a), 0) : a.next) && !(r = r.call(a, l[1])).done) return r;
|
2152
|
-
switch (a = 0, r && (l = [l[0] & 2, r.value]), l[0]) {
|
2153
|
-
case 0:
|
2154
|
-
case 1:
|
2155
|
-
r = l;
|
2156
|
-
break;
|
2157
|
-
case 4:
|
2158
|
-
return t.label++, { value: l[1], done: !1 };
|
2159
|
-
case 5:
|
2160
|
-
t.label++, a = l[1], l = [0];
|
2161
|
-
continue;
|
2162
|
-
case 7:
|
2163
|
-
l = t.ops.pop(), t.trys.pop();
|
2164
|
-
continue;
|
2165
|
-
default:
|
2166
|
-
if (r = t.trys, !(r = r.length > 0 && r[r.length - 1]) && (l[0] === 6 || l[0] === 2)) {
|
2167
|
-
t = 0;
|
2168
|
-
continue;
|
2169
|
-
}
|
2170
|
-
if (l[0] === 3 && (!r || l[1] > r[0] && l[1] < r[3])) {
|
2171
|
-
t.label = l[1];
|
2172
|
-
break;
|
2173
|
-
}
|
2174
|
-
if (l[0] === 6 && t.label < r[1]) {
|
2175
|
-
t.label = r[1], r = l;
|
2176
|
-
break;
|
2177
|
-
}
|
2178
|
-
if (r && t.label < r[2]) {
|
2179
|
-
t.label = r[2], t.ops.push(l);
|
2180
|
-
break;
|
2181
|
-
}
|
2182
|
-
r[2] && t.ops.pop(), t.trys.pop();
|
2183
|
-
continue;
|
2184
|
-
}
|
2185
|
-
l = n.call(e, t);
|
2186
|
-
} catch (c) {
|
2187
|
-
l = [6, c], a = 0;
|
2188
|
-
} finally {
|
2189
|
-
i = r = 0;
|
2190
|
-
}
|
2191
|
-
if (l[0] & 5) throw l[1];
|
2192
|
-
return { value: l[0] ? l[1] : void 0, done: !0 };
|
2193
|
-
}
|
2194
|
-
}
|
2195
|
-
function Me(e) {
|
2196
|
-
var n = typeof Symbol == "function" && Symbol.iterator, t = n && e[n], i = 0;
|
2197
|
-
if (t) return t.call(e);
|
2198
|
-
if (e && typeof e.length == "number") return {
|
2199
|
-
next: function() {
|
2200
|
-
return e && i >= e.length && (e = void 0), { value: e && e[i++], done: !e };
|
2201
|
-
}
|
2202
|
-
};
|
2203
|
-
throw new TypeError(n ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
2204
|
-
}
|
2205
|
-
function Mt(e, n) {
|
2206
|
-
var t = typeof Symbol == "function" && e[Symbol.iterator];
|
2207
|
-
if (!t) return e;
|
2208
|
-
var i = t.call(e), a, r = [], o;
|
2209
|
-
try {
|
2210
|
-
for (; (n === void 0 || n-- > 0) && !(a = i.next()).done; ) r.push(a.value);
|
2211
|
-
} catch (s) {
|
2212
|
-
o = { error: s };
|
2213
|
-
} finally {
|
2214
|
-
try {
|
2215
|
-
a && !a.done && (t = i.return) && t.call(i);
|
2216
|
-
} finally {
|
2217
|
-
if (o) throw o.error;
|
2218
|
-
}
|
2219
|
-
}
|
2220
|
-
return r;
|
2221
|
-
}
|
2222
|
-
function $t(e, n, t) {
|
2223
|
-
if (t || arguments.length === 2) for (var i = 0, a = n.length, r; i < a; i++)
|
2224
|
-
(r || !(i in n)) && (r || (r = Array.prototype.slice.call(n, 0, i)), r[i] = n[i]);
|
2225
|
-
return e.concat(r || Array.prototype.slice.call(n));
|
2226
|
-
}
|
2227
|
-
function we(e) {
|
2228
|
-
return this instanceof we ? (this.v = e, this) : new we(e);
|
2229
|
-
}
|
2230
|
-
function Fo(e, n, t) {
|
2231
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
2232
|
-
var i = t.apply(e, n || []), a, r = [];
|
2233
|
-
return a = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), s("next"), s("throw"), s("return", o), a[Symbol.asyncIterator] = function() {
|
2234
|
-
return this;
|
2235
|
-
}, a;
|
2236
|
-
function o(u) {
|
2237
|
-
return function(d) {
|
2238
|
-
return Promise.resolve(d).then(u, w);
|
2239
|
-
};
|
2240
|
-
}
|
2241
|
-
function s(u, d) {
|
2242
|
-
i[u] && (a[u] = function(g) {
|
2243
|
-
return new Promise(function(v, k) {
|
2244
|
-
r.push([u, g, v, k]) > 1 || f(u, g);
|
2245
|
-
});
|
2246
|
-
}, d && (a[u] = d(a[u])));
|
2247
|
-
}
|
2248
|
-
function f(u, d) {
|
2249
|
-
try {
|
2250
|
-
l(i[u](d));
|
2251
|
-
} catch (g) {
|
2252
|
-
h(r[0][3], g);
|
2253
|
-
}
|
2254
|
-
}
|
2255
|
-
function l(u) {
|
2256
|
-
u.value instanceof we ? Promise.resolve(u.value.v).then(c, w) : h(r[0][2], u);
|
2257
|
-
}
|
2258
|
-
function c(u) {
|
2259
|
-
f("next", u);
|
2260
|
-
}
|
2261
|
-
function w(u) {
|
2262
|
-
f("throw", u);
|
2263
|
-
}
|
2264
|
-
function h(u, d) {
|
2265
|
-
u(d), r.shift(), r.length && f(r[0][0], r[0][1]);
|
2266
|
-
}
|
2267
|
-
}
|
2268
|
-
function Mo(e) {
|
2269
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
2270
|
-
var n = e[Symbol.asyncIterator], t;
|
2271
|
-
return n ? n.call(e) : (e = typeof Me == "function" ? Me(e) : e[Symbol.iterator](), t = {}, i("next"), i("throw"), i("return"), t[Symbol.asyncIterator] = function() {
|
2272
|
-
return this;
|
2273
|
-
}, t);
|
2274
|
-
function i(r) {
|
2275
|
-
t[r] = e[r] && function(o) {
|
2276
|
-
return new Promise(function(s, f) {
|
2277
|
-
o = e[r](o), a(s, f, o.done, o.value);
|
2278
|
-
});
|
2279
|
-
};
|
2280
|
-
}
|
2281
|
-
function a(r, o, s, f) {
|
2282
|
-
Promise.resolve(f).then(function(l) {
|
2283
|
-
r({ value: l, done: s });
|
2284
|
-
}, o);
|
2285
|
-
}
|
2286
|
-
}
|
2287
|
-
function D(e) {
|
2288
|
-
return typeof e == "function";
|
2289
|
-
}
|
2290
|
-
function Ri(e) {
|
2291
|
-
var n = function(i) {
|
2292
|
-
Error.call(i), i.stack = new Error().stack;
|
2293
|
-
}, t = e(n);
|
2294
|
-
return t.prototype = Object.create(Error.prototype), t.prototype.constructor = t, t;
|
2295
|
-
}
|
2296
|
-
var It = Ri(function(e) {
|
2297
|
-
return function(t) {
|
2298
|
-
e(this), this.message = t ? t.length + ` errors occurred during unsubscription:
|
2299
|
-
` + t.map(function(i, a) {
|
2300
|
-
return a + 1 + ") " + i.toString();
|
2301
|
-
}).join(`
|
2302
|
-
`) : "", this.name = "UnsubscriptionError", this.errors = t;
|
2303
|
-
};
|
2304
|
-
});
|
2305
|
-
function Mn(e, n) {
|
2306
|
-
if (e) {
|
2307
|
-
var t = e.indexOf(n);
|
2308
|
-
0 <= t && e.splice(t, 1);
|
2309
|
-
}
|
2310
|
-
}
|
2311
|
-
var Wt = function() {
|
2312
|
-
function e(n) {
|
2313
|
-
this.initialTeardown = n, this.closed = !1, this._parentage = null, this._finalizers = null;
|
2314
|
-
}
|
2315
|
-
return e.prototype.unsubscribe = function() {
|
2316
|
-
var n, t, i, a, r;
|
2317
|
-
if (!this.closed) {
|
2318
|
-
this.closed = !0;
|
2319
|
-
var o = this._parentage;
|
2320
|
-
if (o)
|
2321
|
-
if (this._parentage = null, Array.isArray(o))
|
2322
|
-
try {
|
2323
|
-
for (var s = Me(o), f = s.next(); !f.done; f = s.next()) {
|
2324
|
-
var l = f.value;
|
2325
|
-
l.remove(this);
|
2326
|
-
}
|
2327
|
-
} catch (g) {
|
2328
|
-
n = { error: g };
|
2329
|
-
} finally {
|
2330
|
-
try {
|
2331
|
-
f && !f.done && (t = s.return) && t.call(s);
|
2332
|
-
} finally {
|
2333
|
-
if (n) throw n.error;
|
2334
|
-
}
|
2335
|
-
}
|
2336
|
-
else
|
2337
|
-
o.remove(this);
|
2338
|
-
var c = this.initialTeardown;
|
2339
|
-
if (D(c))
|
2340
|
-
try {
|
2341
|
-
c();
|
2342
|
-
} catch (g) {
|
2343
|
-
r = g instanceof It ? g.errors : [g];
|
2344
|
-
}
|
2345
|
-
var w = this._finalizers;
|
2346
|
-
if (w) {
|
2347
|
-
this._finalizers = null;
|
2348
|
-
try {
|
2349
|
-
for (var h = Me(w), u = h.next(); !u.done; u = h.next()) {
|
2350
|
-
var d = u.value;
|
2351
|
-
try {
|
2352
|
-
$n(d);
|
2353
|
-
} catch (g) {
|
2354
|
-
r = r ?? [], g instanceof It ? r = $t($t([], Mt(r)), Mt(g.errors)) : r.push(g);
|
2355
|
-
}
|
2356
|
-
}
|
2357
|
-
} catch (g) {
|
2358
|
-
i = { error: g };
|
2359
|
-
} finally {
|
2360
|
-
try {
|
2361
|
-
u && !u.done && (a = h.return) && a.call(h);
|
2362
|
-
} finally {
|
2363
|
-
if (i) throw i.error;
|
2364
|
-
}
|
2365
|
-
}
|
2366
|
-
}
|
2367
|
-
if (r)
|
2368
|
-
throw new It(r);
|
2369
|
-
}
|
2370
|
-
}, e.prototype.add = function(n) {
|
2371
|
-
var t;
|
2372
|
-
if (n && n !== this)
|
2373
|
-
if (this.closed)
|
2374
|
-
$n(n);
|
2375
|
-
else {
|
2376
|
-
if (n instanceof e) {
|
2377
|
-
if (n.closed || n._hasParent(this))
|
2378
|
-
return;
|
2379
|
-
n._addParent(this);
|
2380
|
-
}
|
2381
|
-
(this._finalizers = (t = this._finalizers) !== null && t !== void 0 ? t : []).push(n);
|
2382
|
-
}
|
2383
|
-
}, e.prototype._hasParent = function(n) {
|
2384
|
-
var t = this._parentage;
|
2385
|
-
return t === n || Array.isArray(t) && t.includes(n);
|
2386
|
-
}, e.prototype._addParent = function(n) {
|
2387
|
-
var t = this._parentage;
|
2388
|
-
this._parentage = Array.isArray(t) ? (t.push(n), t) : t ? [t, n] : n;
|
2389
|
-
}, e.prototype._removeParent = function(n) {
|
2390
|
-
var t = this._parentage;
|
2391
|
-
t === n ? this._parentage = null : Array.isArray(t) && Mn(t, n);
|
2392
|
-
}, e.prototype.remove = function(n) {
|
2393
|
-
var t = this._finalizers;
|
2394
|
-
t && Mn(t, n), n instanceof e && n._removeParent(this);
|
2395
|
-
}, e.EMPTY = function() {
|
2396
|
-
var n = new e();
|
2397
|
-
return n.closed = !0, n;
|
2398
|
-
}(), e;
|
2399
|
-
}();
|
2400
|
-
Wt.EMPTY;
|
2401
|
-
function Ui(e) {
|
2402
|
-
return e instanceof Wt || e && "closed" in e && D(e.remove) && D(e.add) && D(e.unsubscribe);
|
2403
|
-
}
|
2404
|
-
function $n(e) {
|
2405
|
-
D(e) ? e() : e.unsubscribe();
|
2406
|
-
}
|
2407
|
-
var Bi = {
|
2408
|
-
onUnhandledError: null,
|
2409
|
-
onStoppedNotification: null,
|
2410
|
-
Promise: void 0,
|
2411
|
-
useDeprecatedSynchronousErrorHandling: !1,
|
2412
|
-
useDeprecatedNextContext: !1
|
2413
|
-
}, Di = {
|
2414
|
-
setTimeout: function(e, n) {
|
2415
|
-
for (var t = [], i = 2; i < arguments.length; i++)
|
2416
|
-
t[i - 2] = arguments[i];
|
2417
|
-
return setTimeout.apply(void 0, $t([e, n], Mt(t)));
|
2418
|
-
},
|
2419
|
-
clearTimeout: function(e) {
|
2420
|
-
var n = Di.delegate;
|
2421
|
-
return ((n == null ? void 0 : n.clearTimeout) || clearTimeout)(e);
|
2422
|
-
},
|
2423
|
-
delegate: void 0
|
2424
|
-
};
|
2425
|
-
function Ni(e) {
|
2426
|
-
Di.setTimeout(function() {
|
2427
|
-
throw e;
|
2428
|
-
});
|
2429
|
-
}
|
2430
|
-
function Hn() {
|
2431
|
-
}
|
2432
|
-
function $o(e) {
|
2433
|
-
e();
|
2434
|
-
}
|
2435
|
-
var Jt = function(e) {
|
2436
|
-
Xt(n, e);
|
2437
|
-
function n(t) {
|
2438
|
-
var i = e.call(this) || this;
|
2439
|
-
return i.isStopped = !1, t ? (i.destination = t, Ui(t) && t.add(i)) : i.destination = Ko, i;
|
2440
|
-
}
|
2441
|
-
return n.create = function(t, i, a) {
|
2442
|
-
return new it(t, i, a);
|
2443
|
-
}, n.prototype.next = function(t) {
|
2444
|
-
this.isStopped || this._next(t);
|
2445
|
-
}, n.prototype.error = function(t) {
|
2446
|
-
this.isStopped || (this.isStopped = !0, this._error(t));
|
2447
|
-
}, n.prototype.complete = function() {
|
2448
|
-
this.isStopped || (this.isStopped = !0, this._complete());
|
2449
|
-
}, n.prototype.unsubscribe = function() {
|
2450
|
-
this.closed || (this.isStopped = !0, e.prototype.unsubscribe.call(this), this.destination = null);
|
2451
|
-
}, n.prototype._next = function(t) {
|
2452
|
-
this.destination.next(t);
|
2453
|
-
}, n.prototype._error = function(t) {
|
2454
|
-
try {
|
2455
|
-
this.destination.error(t);
|
2456
|
-
} finally {
|
2457
|
-
this.unsubscribe();
|
2458
|
-
}
|
2459
|
-
}, n.prototype._complete = function() {
|
2460
|
-
try {
|
2461
|
-
this.destination.complete();
|
2462
|
-
} finally {
|
2463
|
-
this.unsubscribe();
|
2464
|
-
}
|
2465
|
-
}, n;
|
2466
|
-
}(Wt), Ho = Function.prototype.bind;
|
2467
|
-
function Tt(e, n) {
|
2468
|
-
return Ho.call(e, n);
|
2469
|
-
}
|
2470
|
-
var Po = function() {
|
2471
|
-
function e(n) {
|
2472
|
-
this.partialObserver = n;
|
2473
|
-
}
|
2474
|
-
return e.prototype.next = function(n) {
|
2475
|
-
var t = this.partialObserver;
|
2476
|
-
if (t.next)
|
2477
|
-
try {
|
2478
|
-
t.next(n);
|
2479
|
-
} catch (i) {
|
2480
|
-
Qe(i);
|
2481
|
-
}
|
2482
|
-
}, e.prototype.error = function(n) {
|
2483
|
-
var t = this.partialObserver;
|
2484
|
-
if (t.error)
|
2485
|
-
try {
|
2486
|
-
t.error(n);
|
2487
|
-
} catch (i) {
|
2488
|
-
Qe(i);
|
2489
|
-
}
|
2490
|
-
else
|
2491
|
-
Qe(n);
|
2492
|
-
}, e.prototype.complete = function() {
|
2493
|
-
var n = this.partialObserver;
|
2494
|
-
if (n.complete)
|
2495
|
-
try {
|
2496
|
-
n.complete();
|
2497
|
-
} catch (t) {
|
2498
|
-
Qe(t);
|
2499
|
-
}
|
2500
|
-
}, e;
|
2501
|
-
}(), it = function(e) {
|
2502
|
-
Xt(n, e);
|
2503
|
-
function n(t, i, a) {
|
2504
|
-
var r = e.call(this) || this, o;
|
2505
|
-
if (D(t) || !t)
|
2506
|
-
o = {
|
2507
|
-
next: t ?? void 0,
|
2508
|
-
error: i ?? void 0,
|
2509
|
-
complete: a ?? void 0
|
2510
|
-
};
|
2511
|
-
else {
|
2512
|
-
var s;
|
2513
|
-
r && Bi.useDeprecatedNextContext ? (s = Object.create(t), s.unsubscribe = function() {
|
2514
|
-
return r.unsubscribe();
|
2515
|
-
}, o = {
|
2516
|
-
next: t.next && Tt(t.next, s),
|
2517
|
-
error: t.error && Tt(t.error, s),
|
2518
|
-
complete: t.complete && Tt(t.complete, s)
|
2519
|
-
}) : o = t;
|
2520
|
-
}
|
2521
|
-
return r.destination = new Po(o), r;
|
2522
|
-
}
|
2523
|
-
return n;
|
2524
|
-
}(Jt);
|
2525
|
-
function Qe(e) {
|
2526
|
-
Ni(e);
|
2527
|
-
}
|
2528
|
-
function Vo(e) {
|
2529
|
-
throw e;
|
2530
|
-
}
|
2531
|
-
var Ko = {
|
2532
|
-
closed: !0,
|
2533
|
-
next: Hn,
|
2534
|
-
error: Vo,
|
2535
|
-
complete: Hn
|
2536
|
-
}, Qt = function() {
|
2537
|
-
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
2538
|
-
}();
|
2539
|
-
function Li(e) {
|
2540
|
-
return e;
|
2541
|
-
}
|
2542
|
-
function Go(e) {
|
2543
|
-
return e.length === 0 ? Li : e.length === 1 ? e[0] : function(t) {
|
2544
|
-
return e.reduce(function(i, a) {
|
2545
|
-
return a(i);
|
2546
|
-
}, t);
|
2547
|
-
};
|
2548
|
-
}
|
2549
|
-
var K = function() {
|
2550
|
-
function e(n) {
|
2551
|
-
n && (this._subscribe = n);
|
2552
|
-
}
|
2553
|
-
return e.prototype.lift = function(n) {
|
2554
|
-
var t = new e();
|
2555
|
-
return t.source = this, t.operator = n, t;
|
2556
|
-
}, e.prototype.subscribe = function(n, t, i) {
|
2557
|
-
var a = this, r = jo(n) ? n : new it(n, t, i);
|
2558
|
-
return $o(function() {
|
2559
|
-
var o = a, s = o.operator, f = o.source;
|
2560
|
-
r.add(s ? s.call(r, f) : f ? a._subscribe(r) : a._trySubscribe(r));
|
2561
|
-
}), r;
|
2562
|
-
}, e.prototype._trySubscribe = function(n) {
|
2563
|
-
try {
|
2564
|
-
return this._subscribe(n);
|
2565
|
-
} catch (t) {
|
2566
|
-
n.error(t);
|
2567
|
-
}
|
2568
|
-
}, e.prototype.forEach = function(n, t) {
|
2569
|
-
var i = this;
|
2570
|
-
return t = Pn(t), new t(function(a, r) {
|
2571
|
-
var o = new it({
|
2572
|
-
next: function(s) {
|
2573
|
-
try {
|
2574
|
-
n(s);
|
2575
|
-
} catch (f) {
|
2576
|
-
r(f), o.unsubscribe();
|
2577
|
-
}
|
2578
|
-
},
|
2579
|
-
error: r,
|
2580
|
-
complete: a
|
2581
|
-
});
|
2582
|
-
i.subscribe(o);
|
2583
|
-
});
|
2584
|
-
}, e.prototype._subscribe = function(n) {
|
2585
|
-
var t;
|
2586
|
-
return (t = this.source) === null || t === void 0 ? void 0 : t.subscribe(n);
|
2587
|
-
}, e.prototype[Qt] = function() {
|
2588
|
-
return this;
|
2589
|
-
}, e.prototype.pipe = function() {
|
2590
|
-
for (var n = [], t = 0; t < arguments.length; t++)
|
2591
|
-
n[t] = arguments[t];
|
2592
|
-
return Go(n)(this);
|
2593
|
-
}, e.prototype.toPromise = function(n) {
|
2594
|
-
var t = this;
|
2595
|
-
return n = Pn(n), new n(function(i, a) {
|
2596
|
-
var r;
|
2597
|
-
t.subscribe(function(o) {
|
2598
|
-
return r = o;
|
2599
|
-
}, function(o) {
|
2600
|
-
return a(o);
|
2601
|
-
}, function() {
|
2602
|
-
return i(r);
|
2603
|
-
});
|
2604
|
-
});
|
2605
|
-
}, e.create = function(n) {
|
2606
|
-
return new e(n);
|
2607
|
-
}, e;
|
2608
|
-
}();
|
2609
|
-
function Pn(e) {
|
2610
|
-
var n;
|
2611
|
-
return (n = e ?? Bi.Promise) !== null && n !== void 0 ? n : Promise;
|
2612
|
-
}
|
2613
|
-
function Yo(e) {
|
2614
|
-
return e && D(e.next) && D(e.error) && D(e.complete);
|
2615
|
-
}
|
2616
|
-
function jo(e) {
|
2617
|
-
return e && e instanceof Jt || Yo(e) && Ui(e);
|
2618
|
-
}
|
2619
|
-
function Xo(e) {
|
2620
|
-
return D(e == null ? void 0 : e.lift);
|
2621
|
-
}
|
2622
|
-
function xe(e) {
|
2623
|
-
return function(n) {
|
2624
|
-
if (Xo(n))
|
2625
|
-
return n.lift(function(t) {
|
2626
|
-
try {
|
2627
|
-
return e(t, this);
|
2628
|
-
} catch (i) {
|
2629
|
-
this.error(i);
|
2630
|
-
}
|
2631
|
-
});
|
2632
|
-
throw new TypeError("Unable to lift unknown Observable type");
|
2633
|
-
};
|
2634
|
-
}
|
2635
|
-
function $e(e, n, t, i, a) {
|
2636
|
-
return new Wo(e, n, t, i, a);
|
2637
|
-
}
|
2638
|
-
var Wo = function(e) {
|
2639
|
-
Xt(n, e);
|
2640
|
-
function n(t, i, a, r, o, s) {
|
2641
|
-
var f = e.call(this, t) || this;
|
2642
|
-
return f.onFinalize = o, f.shouldUnsubscribe = s, f._next = i ? function(l) {
|
2643
|
-
try {
|
2644
|
-
i(l);
|
2645
|
-
} catch (c) {
|
2646
|
-
t.error(c);
|
2647
|
-
}
|
2648
|
-
} : e.prototype._next, f._error = r ? function(l) {
|
2649
|
-
try {
|
2650
|
-
r(l);
|
2651
|
-
} catch (c) {
|
2652
|
-
t.error(c);
|
2653
|
-
} finally {
|
2654
|
-
this.unsubscribe();
|
2655
|
-
}
|
2656
|
-
} : e.prototype._error, f._complete = a ? function() {
|
2657
|
-
try {
|
2658
|
-
a();
|
2659
|
-
} catch (l) {
|
2660
|
-
t.error(l);
|
2661
|
-
} finally {
|
2662
|
-
this.unsubscribe();
|
2663
|
-
}
|
2664
|
-
} : e.prototype._complete, f;
|
2665
|
-
}
|
2666
|
-
return n.prototype.unsubscribe = function() {
|
2667
|
-
var t;
|
2668
|
-
if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
|
2669
|
-
var i = this.closed;
|
2670
|
-
e.prototype.unsubscribe.call(this), !i && ((t = this.onFinalize) === null || t === void 0 || t.call(this));
|
2671
|
-
}
|
2672
|
-
}, n;
|
2673
|
-
}(Jt), Jo = new K(function(e) {
|
2674
|
-
return e.complete();
|
2675
|
-
});
|
2676
|
-
function Qo(e) {
|
2677
|
-
return e && D(e.schedule);
|
2678
|
-
}
|
2679
|
-
function Zi(e) {
|
2680
|
-
return e[e.length - 1];
|
2681
|
-
}
|
2682
|
-
function qo(e) {
|
2683
|
-
return Qo(Zi(e)) ? e.pop() : void 0;
|
2684
|
-
}
|
2685
|
-
function el(e, n) {
|
2686
|
-
return typeof Zi(e) == "number" ? e.pop() : n;
|
2687
|
-
}
|
2688
|
-
var Ci = function(e) {
|
2689
|
-
return e && typeof e.length == "number" && typeof e != "function";
|
2690
|
-
};
|
2691
|
-
function Fi(e) {
|
2692
|
-
return D(e == null ? void 0 : e.then);
|
2693
|
-
}
|
2694
|
-
function Mi(e) {
|
2695
|
-
return D(e[Qt]);
|
2696
|
-
}
|
2697
|
-
function $i(e) {
|
2698
|
-
return Symbol.asyncIterator && D(e == null ? void 0 : e[Symbol.asyncIterator]);
|
2699
|
-
}
|
2700
|
-
function Hi(e) {
|
2701
|
-
return new TypeError("You provided " + (e !== null && typeof e == "object" ? "an invalid object" : "'" + e + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
|
2702
|
-
}
|
2703
|
-
function tl() {
|
2704
|
-
return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator;
|
2705
|
-
}
|
2706
|
-
var Pi = tl();
|
2707
|
-
function Vi(e) {
|
2708
|
-
return D(e == null ? void 0 : e[Pi]);
|
2709
|
-
}
|
2710
|
-
function Ki(e) {
|
2711
|
-
return Fo(this, arguments, function() {
|
2712
|
-
var t, i, a, r;
|
2713
|
-
return Oi(this, function(o) {
|
2714
|
-
switch (o.label) {
|
2715
|
-
case 0:
|
2716
|
-
t = e.getReader(), o.label = 1;
|
2717
|
-
case 1:
|
2718
|
-
o.trys.push([1, , 9, 10]), o.label = 2;
|
2719
|
-
case 2:
|
2720
|
-
return [4, we(t.read())];
|
2721
|
-
case 3:
|
2722
|
-
return i = o.sent(), a = i.value, r = i.done, r ? [4, we(void 0)] : [3, 5];
|
2723
|
-
case 4:
|
2724
|
-
return [2, o.sent()];
|
2725
|
-
case 5:
|
2726
|
-
return [4, we(a)];
|
2727
|
-
case 6:
|
2728
|
-
return [4, o.sent()];
|
2729
|
-
case 7:
|
2730
|
-
return o.sent(), [3, 2];
|
2731
|
-
case 8:
|
2732
|
-
return [3, 10];
|
2733
|
-
case 9:
|
2734
|
-
return t.releaseLock(), [7];
|
2735
|
-
case 10:
|
2736
|
-
return [2];
|
2737
|
-
}
|
2738
|
-
});
|
2739
|
-
});
|
2740
|
-
}
|
2741
|
-
function Gi(e) {
|
2742
|
-
return D(e == null ? void 0 : e.getReader);
|
2743
|
-
}
|
2744
|
-
function Se(e) {
|
2745
|
-
if (e instanceof K)
|
2746
|
-
return e;
|
2747
|
-
if (e != null) {
|
2748
|
-
if (Mi(e))
|
2749
|
-
return nl(e);
|
2750
|
-
if (Ci(e))
|
2751
|
-
return il(e);
|
2752
|
-
if (Fi(e))
|
2753
|
-
return rl(e);
|
2754
|
-
if ($i(e))
|
2755
|
-
return Yi(e);
|
2756
|
-
if (Vi(e))
|
2757
|
-
return al(e);
|
2758
|
-
if (Gi(e))
|
2759
|
-
return ol(e);
|
2760
|
-
}
|
2761
|
-
throw Hi(e);
|
2762
|
-
}
|
2763
|
-
function nl(e) {
|
2764
|
-
return new K(function(n) {
|
2765
|
-
var t = e[Qt]();
|
2766
|
-
if (D(t.subscribe))
|
2767
|
-
return t.subscribe(n);
|
2768
|
-
throw new TypeError("Provided object does not correctly implement Symbol.observable");
|
2769
|
-
});
|
2770
|
-
}
|
2771
|
-
function il(e) {
|
2772
|
-
return new K(function(n) {
|
2773
|
-
for (var t = 0; t < e.length && !n.closed; t++)
|
2774
|
-
n.next(e[t]);
|
2775
|
-
n.complete();
|
2776
|
-
});
|
2777
|
-
}
|
2778
|
-
function rl(e) {
|
2779
|
-
return new K(function(n) {
|
2780
|
-
e.then(function(t) {
|
2781
|
-
n.closed || (n.next(t), n.complete());
|
2782
|
-
}, function(t) {
|
2783
|
-
return n.error(t);
|
2784
|
-
}).then(null, Ni);
|
2785
|
-
});
|
2786
|
-
}
|
2787
|
-
function al(e) {
|
2788
|
-
return new K(function(n) {
|
2789
|
-
var t, i;
|
2790
|
-
try {
|
2791
|
-
for (var a = Me(e), r = a.next(); !r.done; r = a.next()) {
|
2792
|
-
var o = r.value;
|
2793
|
-
if (n.next(o), n.closed)
|
2794
|
-
return;
|
2795
|
-
}
|
2796
|
-
} catch (s) {
|
2797
|
-
t = { error: s };
|
2798
|
-
} finally {
|
2799
|
-
try {
|
2800
|
-
r && !r.done && (i = a.return) && i.call(a);
|
2801
|
-
} finally {
|
2802
|
-
if (t) throw t.error;
|
2803
|
-
}
|
2804
|
-
}
|
2805
|
-
n.complete();
|
2806
|
-
});
|
2807
|
-
}
|
2808
|
-
function Yi(e) {
|
2809
|
-
return new K(function(n) {
|
2810
|
-
ll(e, n).catch(function(t) {
|
2811
|
-
return n.error(t);
|
2812
|
-
});
|
2813
|
-
});
|
2814
|
-
}
|
2815
|
-
function ol(e) {
|
2816
|
-
return Yi(Ki(e));
|
2817
|
-
}
|
2818
|
-
function ll(e, n) {
|
2819
|
-
var t, i, a, r;
|
2820
|
-
return Co(this, void 0, void 0, function() {
|
2821
|
-
var o, s;
|
2822
|
-
return Oi(this, function(f) {
|
2823
|
-
switch (f.label) {
|
2824
|
-
case 0:
|
2825
|
-
f.trys.push([0, 5, 6, 11]), t = Mo(e), f.label = 1;
|
2826
|
-
case 1:
|
2827
|
-
return [4, t.next()];
|
2828
|
-
case 2:
|
2829
|
-
if (i = f.sent(), !!i.done) return [3, 4];
|
2830
|
-
if (o = i.value, n.next(o), n.closed)
|
2831
|
-
return [2];
|
2832
|
-
f.label = 3;
|
2833
|
-
case 3:
|
2834
|
-
return [3, 1];
|
2835
|
-
case 4:
|
2836
|
-
return [3, 11];
|
2837
|
-
case 5:
|
2838
|
-
return s = f.sent(), a = { error: s }, [3, 11];
|
2839
|
-
case 6:
|
2840
|
-
return f.trys.push([6, , 9, 10]), i && !i.done && (r = t.return) ? [4, r.call(t)] : [3, 8];
|
2841
|
-
case 7:
|
2842
|
-
f.sent(), f.label = 8;
|
2843
|
-
case 8:
|
2844
|
-
return [3, 10];
|
2845
|
-
case 9:
|
2846
|
-
if (a) throw a.error;
|
2847
|
-
return [7];
|
2848
|
-
case 10:
|
2849
|
-
return [7];
|
2850
|
-
case 11:
|
2851
|
-
return n.complete(), [2];
|
2852
|
-
}
|
2853
|
-
});
|
2854
|
-
});
|
2855
|
-
}
|
2856
|
-
function ce(e, n, t, i, a) {
|
2857
|
-
i === void 0 && (i = 0), a === void 0 && (a = !1);
|
2858
|
-
var r = n.schedule(function() {
|
2859
|
-
t(), a ? e.add(this.schedule(null, i)) : this.unsubscribe();
|
2860
|
-
}, i);
|
2861
|
-
if (e.add(r), !a)
|
2862
|
-
return r;
|
2863
|
-
}
|
2864
|
-
function ji(e, n) {
|
2865
|
-
return n === void 0 && (n = 0), xe(function(t, i) {
|
2866
|
-
t.subscribe($e(i, function(a) {
|
2867
|
-
return ce(i, e, function() {
|
2868
|
-
return i.next(a);
|
2869
|
-
}, n);
|
2870
|
-
}, function() {
|
2871
|
-
return ce(i, e, function() {
|
2872
|
-
return i.complete();
|
2873
|
-
}, n);
|
2874
|
-
}, function(a) {
|
2875
|
-
return ce(i, e, function() {
|
2876
|
-
return i.error(a);
|
2877
|
-
}, n);
|
2878
|
-
}));
|
2879
|
-
});
|
2880
|
-
}
|
2881
|
-
function Xi(e, n) {
|
2882
|
-
return n === void 0 && (n = 0), xe(function(t, i) {
|
2883
|
-
i.add(e.schedule(function() {
|
2884
|
-
return t.subscribe(i);
|
2885
|
-
}, n));
|
2886
|
-
});
|
2887
|
-
}
|
2888
|
-
function sl(e, n) {
|
2889
|
-
return Se(e).pipe(Xi(n), ji(n));
|
2890
|
-
}
|
2891
|
-
function cl(e, n) {
|
2892
|
-
return Se(e).pipe(Xi(n), ji(n));
|
2893
|
-
}
|
2894
|
-
function fl(e, n) {
|
2895
|
-
return new K(function(t) {
|
2896
|
-
var i = 0;
|
2897
|
-
return n.schedule(function() {
|
2898
|
-
i === e.length ? t.complete() : (t.next(e[i++]), t.closed || this.schedule());
|
2899
|
-
});
|
2900
|
-
});
|
2901
|
-
}
|
2902
|
-
function ul(e, n) {
|
2903
|
-
return new K(function(t) {
|
2904
|
-
var i;
|
2905
|
-
return ce(t, n, function() {
|
2906
|
-
i = e[Pi](), ce(t, n, function() {
|
2907
|
-
var a, r, o;
|
2908
|
-
try {
|
2909
|
-
a = i.next(), r = a.value, o = a.done;
|
2910
|
-
} catch (s) {
|
2911
|
-
t.error(s);
|
2912
|
-
return;
|
2913
|
-
}
|
2914
|
-
o ? t.complete() : t.next(r);
|
2915
|
-
}, 0, !0);
|
2916
|
-
}), function() {
|
2917
|
-
return D(i == null ? void 0 : i.return) && i.return();
|
2918
|
-
};
|
2919
|
-
});
|
2920
|
-
}
|
2921
|
-
function Wi(e, n) {
|
2922
|
-
if (!e)
|
2923
|
-
throw new Error("Iterable cannot be null");
|
2924
|
-
return new K(function(t) {
|
2925
|
-
ce(t, n, function() {
|
2926
|
-
var i = e[Symbol.asyncIterator]();
|
2927
|
-
ce(t, n, function() {
|
2928
|
-
i.next().then(function(a) {
|
2929
|
-
a.done ? t.complete() : t.next(a.value);
|
2930
|
-
});
|
2931
|
-
}, 0, !0);
|
2932
|
-
});
|
2933
|
-
});
|
2934
|
-
}
|
2935
|
-
function hl(e, n) {
|
2936
|
-
return Wi(Ki(e), n);
|
2937
|
-
}
|
2938
|
-
function dl(e, n) {
|
2939
|
-
if (e != null) {
|
2940
|
-
if (Mi(e))
|
2941
|
-
return sl(e, n);
|
2942
|
-
if (Ci(e))
|
2943
|
-
return fl(e, n);
|
2944
|
-
if (Fi(e))
|
2945
|
-
return cl(e, n);
|
2946
|
-
if ($i(e))
|
2947
|
-
return Wi(e, n);
|
2948
|
-
if (Vi(e))
|
2949
|
-
return ul(e, n);
|
2950
|
-
if (Gi(e))
|
2951
|
-
return hl(e, n);
|
2952
|
-
}
|
2953
|
-
throw Hi(e);
|
2954
|
-
}
|
2955
|
-
function _l(e, n) {
|
2956
|
-
return n ? dl(e, n) : Se(e);
|
2957
|
-
}
|
2958
|
-
var bl = Ri(function(e) {
|
2959
|
-
return function() {
|
2960
|
-
e(this), this.name = "EmptyError", this.message = "no elements in sequence";
|
2961
|
-
};
|
2962
|
-
});
|
2963
|
-
function Ji(e, n) {
|
2964
|
-
return new Promise(function(t, i) {
|
2965
|
-
var a = new it({
|
2966
|
-
next: function(r) {
|
2967
|
-
t(r), a.unsubscribe();
|
2968
|
-
},
|
2969
|
-
error: i,
|
2970
|
-
complete: function() {
|
2971
|
-
i(new bl());
|
2972
|
-
}
|
2973
|
-
});
|
2974
|
-
e.subscribe(a);
|
2975
|
-
});
|
2976
|
-
}
|
2977
|
-
function Qi(e, n) {
|
2978
|
-
return xe(function(t, i) {
|
2979
|
-
var a = 0;
|
2980
|
-
t.subscribe($e(i, function(r) {
|
2981
|
-
i.next(e.call(n, r, a++));
|
2982
|
-
}));
|
2983
|
-
});
|
2984
|
-
}
|
2985
|
-
function gl(e, n, t, i, a, r, o, s) {
|
2986
|
-
var f = [], l = 0, c = 0, w = !1, h = function() {
|
2987
|
-
w && !f.length && !l && n.complete();
|
2988
|
-
}, u = function(g) {
|
2989
|
-
return l < i ? d(g) : f.push(g);
|
2990
|
-
}, d = function(g) {
|
2991
|
-
l++;
|
2992
|
-
var v = !1;
|
2993
|
-
Se(t(g, c++)).subscribe($e(n, function(k) {
|
2994
|
-
n.next(k);
|
2995
|
-
}, function() {
|
2996
|
-
v = !0;
|
2997
|
-
}, void 0, function() {
|
2998
|
-
if (v)
|
2999
|
-
try {
|
3000
|
-
l--;
|
3001
|
-
for (var k = function() {
|
3002
|
-
var E = f.shift();
|
3003
|
-
o || d(E);
|
3004
|
-
}; f.length && l < i; )
|
3005
|
-
k();
|
3006
|
-
h();
|
3007
|
-
} catch (E) {
|
3008
|
-
n.error(E);
|
3009
|
-
}
|
3010
|
-
}));
|
3011
|
-
};
|
3012
|
-
return e.subscribe($e(n, u, function() {
|
3013
|
-
w = !0, h();
|
3014
|
-
})), function() {
|
3015
|
-
};
|
3016
|
-
}
|
3017
|
-
function qi(e, n, t) {
|
3018
|
-
return t === void 0 && (t = 1 / 0), D(n) ? qi(function(i, a) {
|
3019
|
-
return Qi(function(r, o) {
|
3020
|
-
return n(i, r, a, o);
|
3021
|
-
})(Se(e(i, a)));
|
3022
|
-
}, t) : (typeof n == "number" && (t = n), xe(function(i, a) {
|
3023
|
-
return gl(i, a, e, t);
|
3024
|
-
}));
|
3025
|
-
}
|
3026
|
-
function wl(e) {
|
3027
|
-
return e === void 0 && (e = 1 / 0), qi(Li, e);
|
3028
|
-
}
|
3029
|
-
function pl() {
|
3030
|
-
for (var e = [], n = 0; n < arguments.length; n++)
|
3031
|
-
e[n] = arguments[n];
|
3032
|
-
var t = qo(e), i = el(e, 1 / 0), a = e;
|
3033
|
-
return a.length ? a.length === 1 ? Se(a[0]) : wl(i)(_l(a, t)) : Jo;
|
3034
|
-
}
|
3035
|
-
function ml(e, n, t, i, a) {
|
3036
|
-
return function(r, o) {
|
3037
|
-
var s = t, f = n, l = 0;
|
3038
|
-
r.subscribe($e(o, function(c) {
|
3039
|
-
var w = l++;
|
3040
|
-
f = s ? e(f, c, w) : (s = !0, c);
|
3041
|
-
}, function() {
|
3042
|
-
s && o.next(f), o.complete();
|
3043
|
-
}));
|
3044
|
-
};
|
3045
|
-
}
|
3046
|
-
function er(e, n) {
|
3047
|
-
return xe(ml(e, n, arguments.length >= 2, !1, !0));
|
3048
|
-
}
|
3049
|
-
var yl = function(e, n) {
|
3050
|
-
return e.push(n), e;
|
3051
|
-
};
|
3052
|
-
function vl() {
|
3053
|
-
return xe(function(e, n) {
|
3054
|
-
er(yl, [])(e).subscribe(n);
|
3055
|
-
});
|
3056
|
-
}
|
3057
|
-
const Vn = -2003829722, zt = -2021002517;
|
3058
|
-
class tr {
|
3059
|
-
getHeader(n) {
|
3060
|
-
return this.headerP || (this.headerP = this._getHeader(n).catch((t) => {
|
3061
|
-
throw this.headerP = void 0, t;
|
3062
|
-
})), this.headerP;
|
3063
|
-
}
|
3064
|
-
/*
|
3065
|
-
* @param filehandle - a filehandle from generic-filehandle or implementing
|
3066
|
-
* something similar to the node10 fs.promises API
|
3067
|
-
*
|
3068
|
-
* @param path - a Local file path as a string
|
3069
|
-
*
|
3070
|
-
* @param url - a URL string
|
3071
|
-
*
|
3072
|
-
* @param renameRefSeqs - an optional method to rename the internal reference
|
3073
|
-
* sequences using a mapping function
|
3074
|
-
*/
|
3075
|
-
constructor(n) {
|
3076
|
-
const { filehandle: t, renameRefSeqs: i = (o) => o, path: a, url: r } = n;
|
3077
|
-
if (this.renameRefSeqs = i, t)
|
3078
|
-
this.bbi = t;
|
3079
|
-
else if (r)
|
3080
|
-
this.bbi = new ir(r);
|
3081
|
-
else if (a)
|
3082
|
-
this.bbi = new nr(a);
|
3083
|
-
else
|
3084
|
-
throw new Error("no file given");
|
3085
|
-
}
|
3086
|
-
async _getHeader(n) {
|
3087
|
-
const t = await this._getMainHeader(n), i = await this._readChromTree(t, n);
|
3088
|
-
return { ...t, ...i };
|
3089
|
-
}
|
3090
|
-
async _getMainHeader(n, t = 2e3) {
|
3091
|
-
const { buffer: a } = await this.bbi.read(ee.Buffer.alloc(t), 0, t, 0, n), r = this._isBigEndian(a), o = a, s = new DataView(o.buffer, o.byteOffset, o.length);
|
3092
|
-
let f = 0;
|
3093
|
-
const l = s.getInt32(f, !0);
|
3094
|
-
f += 4;
|
3095
|
-
const c = s.getUint16(f, !0);
|
3096
|
-
f += 2;
|
3097
|
-
const w = s.getUint16(f, !0);
|
3098
|
-
f += 2;
|
3099
|
-
const h = Number(s.getBigUint64(f, !0));
|
3100
|
-
f += 8;
|
3101
|
-
const u = Number(s.getBigUint64(f, !0));
|
3102
|
-
f += 8;
|
3103
|
-
const d = Number(s.getBigUint64(f, !0));
|
3104
|
-
f += 8;
|
3105
|
-
const g = s.getUint16(f, !0);
|
3106
|
-
f += 2;
|
3107
|
-
const v = s.getUint16(f, !0);
|
3108
|
-
f += 2;
|
3109
|
-
const k = Number(s.getBigUint64(f, !0));
|
3110
|
-
f += 8;
|
3111
|
-
const E = Number(s.getBigUint64(f, !0));
|
3112
|
-
f += 8;
|
3113
|
-
const A = s.getUint32(f, !0);
|
3114
|
-
f += 4;
|
3115
|
-
const b = Number(s.getBigUint64(f, !0));
|
3116
|
-
f += 8;
|
3117
|
-
const x = [];
|
3118
|
-
for (let S = 0; S < w; S++) {
|
3119
|
-
const _ = s.getUint32(f, !0);
|
3120
|
-
f += 4;
|
3121
|
-
const y = s.getUint32(f, !0);
|
3122
|
-
f += 4;
|
3123
|
-
const m = Number(s.getBigUint64(f, !0));
|
3124
|
-
f += 8;
|
3125
|
-
const U = Number(s.getBigUint64(f, !0));
|
3126
|
-
f += 8, x.push({ reductionLevel: _, reserved: y, dataOffset: m, indexOffset: U });
|
3127
|
-
}
|
3128
|
-
const I = l === zt ? "bigbed" : "bigwig";
|
3129
|
-
if (k > t || E > t - 8 * 5)
|
3130
|
-
return this._getMainHeader(n, t * 2);
|
3131
|
-
let p;
|
3132
|
-
if (E) {
|
3133
|
-
const S = a.subarray(Number(E));
|
3134
|
-
let _ = 0;
|
3135
|
-
const y = new DataView(S.buffer, S.byteOffset, S.length), m = Number(y.getBigUint64(_, !0));
|
3136
|
-
_ += 8;
|
3137
|
-
const U = y.getFloat64(_, !0);
|
3138
|
-
_ += 8;
|
3139
|
-
const Z = y.getFloat64(_, !0);
|
3140
|
-
_ += 8;
|
3141
|
-
const B = y.getFloat64(_, !0);
|
3142
|
-
_ += 8;
|
3143
|
-
const O = y.getFloat64(_, !0);
|
3144
|
-
_ += 8, p = {
|
3145
|
-
scoreMin: U,
|
3146
|
-
scoreMax: Z,
|
3147
|
-
scoreSum: B,
|
3148
|
-
scoreSumSquares: O,
|
3149
|
-
basesCovered: m
|
3150
|
-
};
|
3151
|
-
} else
|
3152
|
-
throw new Error("no stats");
|
3153
|
-
return {
|
3154
|
-
zoomLevels: x,
|
3155
|
-
magic: l,
|
3156
|
-
extHeaderOffset: b,
|
3157
|
-
numZoomLevels: w,
|
3158
|
-
fieldCount: g,
|
3159
|
-
totalSummary: p,
|
3160
|
-
definedFieldCount: v,
|
3161
|
-
uncompressBufSize: A,
|
3162
|
-
asOffset: k,
|
3163
|
-
chromTreeOffset: h,
|
3164
|
-
totalSummaryOffset: E,
|
3165
|
-
unzoomedDataOffset: u,
|
3166
|
-
unzoomedIndexOffset: d,
|
3167
|
-
fileType: I,
|
3168
|
-
version: c,
|
3169
|
-
isBigEndian: r,
|
3170
|
-
autoSql: k ? a.subarray(k, a.indexOf(0, k)).toString() : ""
|
3171
|
-
};
|
3172
|
-
}
|
3173
|
-
_isBigEndian(n) {
|
3174
|
-
let t = n.readInt32LE(0);
|
3175
|
-
if (t === Vn || t === zt)
|
3176
|
-
return !1;
|
3177
|
-
if (t = n.readInt32BE(0), t === Vn || t === zt)
|
3178
|
-
return !0;
|
3179
|
-
throw new Error("not a BigWig/BigBed file");
|
3180
|
-
}
|
3181
|
-
// todo: add progress if long running
|
3182
|
-
async _readChromTree(n, t) {
|
3183
|
-
const a = !n.isBigEndian, r = [], o = {};
|
3184
|
-
let s = n.unzoomedDataOffset;
|
3185
|
-
const f = n.chromTreeOffset;
|
3186
|
-
for (; s % 4 !== 0; )
|
3187
|
-
s += 1;
|
3188
|
-
const l = s - f, { buffer: c } = await this.bbi.read(ee.Buffer.alloc(l), 0, l, Number(f), t), w = c, h = new DataView(w.buffer, w.byteOffset, w.length);
|
3189
|
-
let u = 0;
|
3190
|
-
u += 4, u += 4;
|
3191
|
-
const d = h.getUint32(u, a);
|
3192
|
-
u += 4, u += 4, u += 8;
|
3193
|
-
const g = 32, v = async (k) => {
|
3194
|
-
let E = k;
|
3195
|
-
if (E >= c.length)
|
3196
|
-
throw new Error("reading beyond end of buffer");
|
3197
|
-
const A = h.getUint8(E);
|
3198
|
-
E += 2;
|
3199
|
-
const b = h.getUint16(E, a);
|
3200
|
-
if (E += 2, A)
|
3201
|
-
for (let x = 0; x < b; x++) {
|
3202
|
-
const I = c.subarray(E, E + d).toString().replaceAll("\0", "");
|
3203
|
-
E += d;
|
3204
|
-
const p = h.getUint32(E, a);
|
3205
|
-
E += 4;
|
3206
|
-
const S = h.getUint32(E, a);
|
3207
|
-
E += 4;
|
3208
|
-
const _ = { name: I, id: p, length: S };
|
3209
|
-
o[this.renameRefSeqs(I)] = p, r[p] = _;
|
3210
|
-
}
|
3211
|
-
else {
|
3212
|
-
const x = [];
|
3213
|
-
for (let I = 0; I < b; I++) {
|
3214
|
-
E += d;
|
3215
|
-
const p = Number(h.getBigUint64(E, a));
|
3216
|
-
E += 8, x.push(v(Number(p) - Number(f)));
|
3217
|
-
}
|
3218
|
-
await Promise.all(x);
|
3219
|
-
}
|
3220
|
-
};
|
3221
|
-
return await v(g), {
|
3222
|
-
refsByName: o,
|
3223
|
-
refsByNumber: r
|
3224
|
-
};
|
3225
|
-
}
|
3226
|
-
/*
|
3227
|
-
* fetches the "unzoomed" view of the bigwig data. this is the default for bigbed
|
3228
|
-
* @param abortSignal - a signal to optionally abort this operation
|
3229
|
-
*/
|
3230
|
-
async getUnzoomedView(n) {
|
3231
|
-
const { unzoomedIndexOffset: t, refsByName: i, uncompressBufSize: a, isBigEndian: r, fileType: o } = await this.getHeader(n);
|
3232
|
-
return new zi(this.bbi, i, t, r, a > 0, o);
|
3233
|
-
}
|
3234
|
-
/**
|
3235
|
-
* Gets features from a BigWig file
|
3236
|
-
*
|
3237
|
-
* @param refName - The chromosome name
|
3238
|
-
* @param start - The start of a region
|
3239
|
-
* @param end - The end of a region
|
3240
|
-
* @param opts - An object containing basesPerSpan (e.g. pixels per basepair) or scale used to infer the zoomLevel to use
|
3241
|
-
*/
|
3242
|
-
async getFeatureStream(n, t, i, a) {
|
3243
|
-
await this.getHeader(a);
|
3244
|
-
const r = this.renameRefSeqs(n);
|
3245
|
-
let o;
|
3246
|
-
const { basesPerSpan: s, scale: f } = a || {};
|
3247
|
-
return s ? o = await this.getView(1 / s, a) : f ? o = await this.getView(f, a) : o = await this.getView(1, a), new K((l) => {
|
3248
|
-
o.readWigData(r, t, i, l, a).catch((c) => {
|
3249
|
-
l.error(c);
|
3250
|
-
});
|
3251
|
-
});
|
3252
|
-
}
|
3253
|
-
async getFeatures(n, t, i, a) {
|
3254
|
-
const r = await this.getFeatureStream(n, t, i, a);
|
3255
|
-
return (await Ji(r.pipe(vl()))).flat();
|
3256
|
-
}
|
3257
|
-
}
|
3258
|
-
class Ol extends tr {
|
3259
|
-
/**
|
3260
|
-
* Retrieves a BlockView of a specific zoomLevel
|
3261
|
-
*
|
3262
|
-
* @param scale - number
|
3263
|
-
*
|
3264
|
-
* @param opts - An object containing basesPerSpan (e.g. pixels per basepair)
|
3265
|
-
* or scale used to infer the zoomLevel to use
|
3266
|
-
*/
|
3267
|
-
async getView(n, t) {
|
3268
|
-
const { zoomLevels: i, refsByName: a, isBigEndian: r, uncompressBufSize: o } = await this.getHeader(t), s = 1 / n, f = i.length - 1;
|
3269
|
-
for (let l = f; l >= 0; l -= 1) {
|
3270
|
-
const c = i[l];
|
3271
|
-
if (c && c.reductionLevel <= 2 * s)
|
3272
|
-
return new zi(this.bbi, a, c.indexOffset, r, o > 0, "summary");
|
3273
|
-
}
|
3274
|
-
return this.getUnzoomedView(t);
|
3275
|
-
}
|
3276
|
-
}
|
3277
|
-
function kl(e) {
|
3278
|
-
return e.filter((n) => !!n);
|
3279
|
-
}
|
3280
|
-
class Rl extends tr {
|
3281
|
-
constructor() {
|
3282
|
-
super(...arguments), this.readIndicesCache = new Kn({
|
3283
|
-
cache: new Gn({ maxSize: 1 }),
|
3284
|
-
fill: (n, t) => this._readIndices({ ...n, signal: t })
|
3285
|
-
});
|
3286
|
-
}
|
3287
|
-
readIndices(n = {}) {
|
3288
|
-
const { signal: t, ...i } = n;
|
3289
|
-
return this.readIndicesCache.get(JSON.stringify(i), n, t);
|
3290
|
-
}
|
3291
|
-
/*
|
3292
|
-
* retrieve unzoomed view for any scale
|
3293
|
-
*/
|
3294
|
-
async getView(n, t) {
|
3295
|
-
return this.getUnzoomedView(t);
|
3296
|
-
}
|
3297
|
-
/*
|
3298
|
-
* parse the bigbed extraIndex fields
|
3299
|
-
*
|
3300
|
-
*
|
3301
|
-
* @return a Promise for an array of Index data structure since there can be
|
3302
|
-
* multiple extraIndexes in a bigbed, see bedToBigBed documentation
|
3303
|
-
*/
|
3304
|
-
async _readIndices(n) {
|
3305
|
-
const { extHeaderOffset: t, isBigEndian: i } = await this.getHeader(n), { buffer: a } = await this.bbi.read(ee.Buffer.alloc(64), 0, 64, Number(t)), r = !i, o = a, s = new DataView(o.buffer, o.byteOffset, o.length);
|
3306
|
-
let f = 0;
|
3307
|
-
f += 2;
|
3308
|
-
const l = s.getUint16(f, r);
|
3309
|
-
f += 2;
|
3310
|
-
const c = Number(s.getBigUint64(f, r));
|
3311
|
-
if (f += 8, l === 0)
|
3312
|
-
return [];
|
3313
|
-
const w = 20, h = w * l, { buffer: u } = await this.bbi.read(ee.Buffer.alloc(h), 0, h, Number(c)), d = [];
|
3314
|
-
for (let g = 0; g < l; g += 1) {
|
3315
|
-
const v = u.subarray(g * w), k = new DataView(v.buffer, v.byteOffset, v.length);
|
3316
|
-
let E = 0;
|
3317
|
-
const A = k.getInt16(E, r);
|
3318
|
-
E += 2;
|
3319
|
-
const b = k.getInt16(E, r);
|
3320
|
-
E += 2;
|
3321
|
-
const x = Number(k.getBigUint64(E, r));
|
3322
|
-
E += 12;
|
3323
|
-
const I = k.getInt16(E, r);
|
3324
|
-
d.push({ type: A, fieldcount: b, offset: Number(x), field: I });
|
3325
|
-
}
|
3326
|
-
return d;
|
3327
|
-
}
|
3328
|
-
/*
|
3329
|
-
* perform a search in the bigbed extraIndex to find which blocks in the
|
3330
|
-
* bigbed data to look for the actual feature data
|
3331
|
-
*
|
3332
|
-
* @param name - the name to search for
|
3333
|
-
* @param opts - a SearchOptions argument with optional signal
|
3334
|
-
* @return a Promise for an array of bigbed block Loc entries
|
3335
|
-
*/
|
3336
|
-
async searchExtraIndexBlocks(n, t = {}) {
|
3337
|
-
const { isBigEndian: i } = await this.getHeader(t), a = await this.readIndices(t);
|
3338
|
-
if (a.length === 0)
|
3339
|
-
return [];
|
3340
|
-
const r = a.map(async (o) => {
|
3341
|
-
const { offset: s, field: f } = o, { buffer: l } = await this.bbi.read(ee.Buffer.alloc(32), 0, 32, s, t), c = !i, w = l, h = new DataView(w.buffer, w.byteOffset, w.length);
|
3342
|
-
let u = 0;
|
3343
|
-
u += 4;
|
3344
|
-
const d = h.getInt32(u, c);
|
3345
|
-
u += 4;
|
3346
|
-
const g = h.getInt32(u, c);
|
3347
|
-
u += 4;
|
3348
|
-
const v = h.getInt32(u, c);
|
3349
|
-
u += 4, u += 8;
|
3350
|
-
const k = async (A) => {
|
3351
|
-
const b = Number(A), x = 4 + d * (g + v), { buffer: I } = await this.bbi.read(ee.Buffer.alloc(x), 0, x, b, t), p = I, S = new DataView(p.buffer, p.byteOffset, p.length);
|
3352
|
-
let _ = 0;
|
3353
|
-
const y = S.getInt8(_);
|
3354
|
-
_ += 2;
|
3355
|
-
const m = S.getInt16(_, c);
|
3356
|
-
_ += 2;
|
3357
|
-
const U = [];
|
3358
|
-
if (y === 0) {
|
3359
|
-
const Z = [];
|
3360
|
-
for (let O = 0; O < m; O++) {
|
3361
|
-
const F = p.subarray(_, _ + g).toString().replaceAll("\0", "");
|
3362
|
-
_ += g;
|
3363
|
-
const ae = Number(S.getBigUint64(_, c));
|
3364
|
-
_ += 8, Z.push({ key: F, offset: ae });
|
3365
|
-
}
|
3366
|
-
let B = 0;
|
3367
|
-
for (const { key: O, offset: F } of Z) {
|
3368
|
-
if (n.localeCompare(O) < 0 && B)
|
3369
|
-
return k(B);
|
3370
|
-
B = F;
|
3371
|
-
}
|
3372
|
-
return k(B);
|
3373
|
-
} else if (y === 1) {
|
3374
|
-
for (let Z = 0; Z < m; Z++) {
|
3375
|
-
const B = p.subarray(_, _ + g).toString().replaceAll("\0", "");
|
3376
|
-
_ += g;
|
3377
|
-
const O = Number(S.getBigUint64(_, c));
|
3378
|
-
_ += 8;
|
3379
|
-
const F = S.getUint32(_, c);
|
3380
|
-
_ += 4;
|
3381
|
-
const ae = S.getUint32(_, c);
|
3382
|
-
_ += 4, U.push({ key: B, offset: O, length: F, reserved: ae });
|
3383
|
-
}
|
3384
|
-
for (const Z of U)
|
3385
|
-
if (Z.key === n)
|
3386
|
-
return { ...Z, field: f };
|
3387
|
-
return;
|
3388
|
-
}
|
3389
|
-
};
|
3390
|
-
return k(s + 32);
|
3391
|
-
});
|
3392
|
-
return kl(await Promise.all(r));
|
3393
|
-
}
|
3394
|
-
/*
|
3395
|
-
* retrieve the features from the bigbed data that were found through the
|
3396
|
-
* lookup of the extraIndex note that there can be multiple extraIndex, see
|
3397
|
-
* the BigBed specification and the -extraIndex argument to bedToBigBed
|
3398
|
-
*
|
3399
|
-
* @param name - the name to search for
|
3400
|
-
* @param opts - a SearchOptions argument with optional signal
|
3401
|
-
* @return a Promise for an array of Feature
|
3402
|
-
*/
|
3403
|
-
async searchExtraIndex(n, t = {}) {
|
3404
|
-
const i = await this.searchExtraIndexBlocks(n, t);
|
3405
|
-
if (i.length === 0)
|
3406
|
-
return [];
|
3407
|
-
const a = await this.getUnzoomedView(t), r = i.map((s) => new K((f) => {
|
3408
|
-
a.readFeatures(f, [s], t).catch((l) => {
|
3409
|
-
f.error(l);
|
3410
|
-
});
|
3411
|
-
}).pipe(er((f, l) => f.concat(l)), Qi((f) => {
|
3412
|
-
for (const l of f)
|
3413
|
-
l.field = s.field;
|
3414
|
-
return f;
|
3415
|
-
})));
|
3416
|
-
return (await Ji(pl(...r))).filter((s) => {
|
3417
|
-
var f;
|
3418
|
-
return ((f = s.rest) === null || f === void 0 ? void 0 : f.split(" ")[(s.field || 0) - 3]) === n;
|
3419
|
-
});
|
3420
|
-
}
|
3421
|
-
}
|
3422
|
-
export {
|
3423
|
-
Rl as BigBed,
|
3424
|
-
Ol as BigWig
|
3425
|
-
};
|