@dpuse/dpuse-tool-file-previewer 1.0.108 → 1.0.112
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/README.md +42 -39
- package/dist/dpuse-tool-file-previewer.es.js +946 -758
- package/dist/dpuse-tool-file-previewer.es.js.map +1 -1
- package/dist/shipped-packages.json +5 -5
- package/package.json +14 -13
|
@@ -26,9 +26,9 @@ d({}, {
|
|
|
26
26
|
EncodingEra: () => w,
|
|
27
27
|
LanguageFilter: () => ee,
|
|
28
28
|
MINIMUM_THRESHOLD: () => C,
|
|
29
|
-
UniversalDetector: () =>
|
|
30
|
-
detect: () =>
|
|
31
|
-
detectAll: () =>
|
|
29
|
+
UniversalDetector: () => wa,
|
|
30
|
+
detect: () => Ta,
|
|
31
|
+
detectAll: () => Ea
|
|
32
32
|
});
|
|
33
33
|
var p = !1;
|
|
34
34
|
function m() {
|
|
@@ -4363,7 +4363,7 @@ function _i(e, t) {
|
|
|
4363
4363
|
if (n === -1) return t;
|
|
4364
4364
|
for (let r = 0; r < e.length; r++) {
|
|
4365
4365
|
let i = e[r];
|
|
4366
|
-
if (i > 127 && fi.has(i)) return
|
|
4366
|
+
if (i > 127 && fi.has(i)) return P(t, n);
|
|
4367
4367
|
}
|
|
4368
4368
|
return t;
|
|
4369
4369
|
}
|
|
@@ -4405,13 +4405,13 @@ function Ti(e, t) {
|
|
|
4405
4405
|
o < i && (i = o, r = e);
|
|
4406
4406
|
}
|
|
4407
4407
|
if (r === 0) return t;
|
|
4408
|
-
if (!wi(e, n.encoding, n.language)) return
|
|
4408
|
+
if (!wi(e, n.encoding, n.language)) return P(t, r);
|
|
4409
4409
|
let a = t[r].encoding ?? "", o = /* @__PURE__ */ new Set();
|
|
4410
4410
|
n.language !== null && o.add(n.language), t[r].language !== null && o.add(t[r].language);
|
|
4411
4411
|
let s = Xr(n.encoding, a, o);
|
|
4412
|
-
return ri(e, n.encoding, a, ti(n.encoding, a), s, s) === a ?
|
|
4412
|
+
return ri(e, n.encoding, a, ti(n.encoding, a), s, s) === a ? P(t, r) : t;
|
|
4413
4413
|
}
|
|
4414
|
-
function
|
|
4414
|
+
function P(e, t) {
|
|
4415
4415
|
let n = e[t];
|
|
4416
4416
|
return [{
|
|
4417
4417
|
encoding: n.encoding,
|
|
@@ -4420,7 +4420,7 @@ function Ei(e, t) {
|
|
|
4420
4420
|
mimeType: n.mimeType
|
|
4421
4421
|
}, ...e.filter((e, n) => n !== t)];
|
|
4422
4422
|
}
|
|
4423
|
-
function
|
|
4423
|
+
function Ei(e, t) {
|
|
4424
4424
|
let n = t.length > 0 ? t[0] : null;
|
|
4425
4425
|
if (n === null || n.encoding === null || t.length < 2) return t;
|
|
4426
4426
|
let r = vi[n.encoding];
|
|
@@ -4428,22 +4428,22 @@ function Di(e, t) {
|
|
|
4428
4428
|
for (let i = 1; i < t.length; i++) {
|
|
4429
4429
|
let a = t[i];
|
|
4430
4430
|
if (n.confidence - a.confidence > pi) break;
|
|
4431
|
-
if (a.encoding === r && ze(r, e)) return
|
|
4431
|
+
if (a.encoding === r && ze(r, e)) return P(t, i);
|
|
4432
4432
|
}
|
|
4433
4433
|
return t;
|
|
4434
4434
|
}
|
|
4435
|
-
var
|
|
4436
|
-
function
|
|
4435
|
+
var Di = .02, Oi = .15;
|
|
4436
|
+
function ki(e) {
|
|
4437
4437
|
let t = e.length > 0 ? e[0] : null;
|
|
4438
|
-
if (t === null || t.encoding === null || t.language === null || !j.has(t.language) || t.confidence >=
|
|
4438
|
+
if (t === null || t.encoding === null || t.language === null || !j.has(t.language) || t.confidence >= Oi || e.length < 2) return e;
|
|
4439
4439
|
for (let n = 1; n < e.length; n++) {
|
|
4440
4440
|
let r = e[n];
|
|
4441
|
-
if (t.confidence - r.confidence >
|
|
4442
|
-
if (r.encoding !== null && r.language !== null && !j.has(r.language)) return
|
|
4441
|
+
if (t.confidence - r.confidence > Di) break;
|
|
4442
|
+
if (r.encoding !== null && r.language !== null && !j.has(r.language)) return P(e, n);
|
|
4443
4443
|
}
|
|
4444
4444
|
return e;
|
|
4445
4445
|
}
|
|
4446
|
-
function
|
|
4446
|
+
function Ai(e, t) {
|
|
4447
4447
|
let n = t.length > 0 ? t[0] : null;
|
|
4448
4448
|
if (n === null || n.encoding === null || t.length < 2 || Ci(n.encoding) === xi || n.language === M || e.indexOf(10) >= 0) return t;
|
|
4449
4449
|
let r = 0;
|
|
@@ -4454,18 +4454,18 @@ function ji(e, t) {
|
|
|
4454
4454
|
if (n.confidence - i.confidence > yi) break;
|
|
4455
4455
|
if (i.encoding !== null && Ci(i.encoding) === xi) {
|
|
4456
4456
|
let a = /* @__PURE__ */ new Set();
|
|
4457
|
-
if (n.language !== null && a.add(n.language), i.language !== null && a.add(i.language),
|
|
4458
|
-
return
|
|
4457
|
+
if (n.language !== null && a.add(n.language), i.language !== null && a.add(i.language), F.confusionPairWinner(e, n.encoding, i.encoding, a) === n.encoding) break;
|
|
4458
|
+
return P(t, r);
|
|
4459
4459
|
}
|
|
4460
4460
|
}
|
|
4461
4461
|
return t;
|
|
4462
4462
|
}
|
|
4463
|
-
function
|
|
4463
|
+
function ji(e, t) {
|
|
4464
4464
|
if (!Be(t, e)) return !1;
|
|
4465
4465
|
let n = qe[t];
|
|
4466
4466
|
return n === void 0 || Be(D(n) ?? n, e);
|
|
4467
4467
|
}
|
|
4468
|
-
function
|
|
4468
|
+
function Mi(e, t, n) {
|
|
4469
4469
|
let r = t.length > 0 ? t[0] : null;
|
|
4470
4470
|
if (n || r === null || r.encoding === null || t.length < 2) return t;
|
|
4471
4471
|
let i = !1;
|
|
@@ -4476,26 +4476,26 @@ function Ni(e, t, n) {
|
|
|
4476
4476
|
if (!i || !Ve(r.encoding, e)) return t;
|
|
4477
4477
|
for (let n = 1; n < t.length; n++) {
|
|
4478
4478
|
let r = t[n];
|
|
4479
|
-
if (r.encoding !== null &&
|
|
4479
|
+
if (r.encoding !== null && ji(e, r.encoding)) return P(t, n);
|
|
4480
4480
|
}
|
|
4481
4481
|
return t;
|
|
4482
4482
|
}
|
|
4483
|
-
|
|
4484
|
-
function
|
|
4485
|
-
return t =
|
|
4483
|
+
Di + 2 * oi;
|
|
4484
|
+
function Ni(e, t, { inputTruncated: n = !1 } = {}) {
|
|
4485
|
+
return t = F._promoteSupersetOnDeadHeat(e, t), t = F._preferPrevalentOnDeadHeat(e, t), t = F._arbitrateRareLanguage(t), t = F.resolveConfusionGroups(e, t), t = F._demoteNicheLatin(e, t), t = F._promoteKoi8t(e, t), t = F._promoteMacOnCrLineEndings(e, t), F._preferDecodableOnTie(e, t, n);
|
|
4486
4486
|
}
|
|
4487
|
-
var
|
|
4488
|
-
_promoteSupersetOnDeadHeat:
|
|
4487
|
+
var F = {
|
|
4488
|
+
_promoteSupersetOnDeadHeat: Ei,
|
|
4489
4489
|
_preferPrevalentOnDeadHeat: Ti,
|
|
4490
|
-
_arbitrateRareLanguage:
|
|
4490
|
+
_arbitrateRareLanguage: ki,
|
|
4491
4491
|
resolveConfusionGroups: li,
|
|
4492
4492
|
_demoteNicheLatin: gi,
|
|
4493
4493
|
_promoteKoi8t: _i,
|
|
4494
|
-
_promoteMacOnCrLineEndings:
|
|
4495
|
-
_preferDecodableOnTie:
|
|
4494
|
+
_promoteMacOnCrLineEndings: Ai,
|
|
4495
|
+
_preferDecodableOnTie: Mi,
|
|
4496
4496
|
confusionPairWinner: qr
|
|
4497
4497
|
};
|
|
4498
|
-
function
|
|
4498
|
+
function Pi(e, t) {
|
|
4499
4499
|
if (e.length === 0 || t.length === 0) return [];
|
|
4500
4500
|
let n = new Tt(e), r = [];
|
|
4501
4501
|
for (let i of t) {
|
|
@@ -4513,8 +4513,8 @@ function Fi(e, t) {
|
|
|
4513
4513
|
mimeType: null
|
|
4514
4514
|
}));
|
|
4515
4515
|
}
|
|
4516
|
-
var
|
|
4517
|
-
function
|
|
4516
|
+
var Fi = .8, Ii = .99, Li = 6;
|
|
4517
|
+
function Ri(e) {
|
|
4518
4518
|
if (e.length === 0) return [!0, null];
|
|
4519
4519
|
let t = 0, n = e.length, r = 0, i = 0;
|
|
4520
4520
|
for (; t < n;) {
|
|
@@ -4536,34 +4536,34 @@ function zi(e) {
|
|
|
4536
4536
|
r++, i += o, t += o;
|
|
4537
4537
|
}
|
|
4538
4538
|
if (r === 0) return [!0, null];
|
|
4539
|
-
let a = i / n, o =
|
|
4539
|
+
let a = i / n, o = Ii - Fi;
|
|
4540
4540
|
return [!0, {
|
|
4541
4541
|
encoding: "utf-8",
|
|
4542
|
-
confidence: Math.min(
|
|
4542
|
+
confidence: Math.min(Ii, Fi + o * Math.min(a * Li, 1)),
|
|
4543
4543
|
language: null,
|
|
4544
4544
|
mimeType: null
|
|
4545
4545
|
}];
|
|
4546
4546
|
}
|
|
4547
|
-
var
|
|
4548
|
-
function
|
|
4549
|
-
if (t >=
|
|
4550
|
-
for (let t of e) if (!
|
|
4547
|
+
var zi = 4096, Bi = 16, Vi = 10, Hi = .03, Ui = .5, Wi = .05, Gi = .7, Ki = .15, qi = /* @__PURE__ */ new Set([0, ...jt]), Ji = /^\p{L}$/u, Yi = /^\p{M}$/u, Xi = /^\p{Zs}$/u, Zi = /^\p{C}$/u;
|
|
4548
|
+
function Qi(e, t) {
|
|
4549
|
+
if (t >= Ki) return !1;
|
|
4550
|
+
for (let t of e) if (!qi.has(t)) return !1;
|
|
4551
4551
|
return !0;
|
|
4552
4552
|
}
|
|
4553
|
-
function
|
|
4554
|
-
let t = e.subarray(0,
|
|
4555
|
-
if (t.length <
|
|
4556
|
-
let n =
|
|
4557
|
-
return n === null ?
|
|
4553
|
+
function $i(e) {
|
|
4554
|
+
let t = e.subarray(0, zi);
|
|
4555
|
+
if (t.length < Vi) return null;
|
|
4556
|
+
let n = ea(t);
|
|
4557
|
+
return n === null ? ta(t) : n;
|
|
4558
4558
|
}
|
|
4559
|
-
function
|
|
4559
|
+
function ea(e) {
|
|
4560
4560
|
let t = e.length - e.length % 4;
|
|
4561
|
-
if (t <
|
|
4561
|
+
if (t < Bi) return null;
|
|
4562
4562
|
let n = e.subarray(0, t), r = t / 4, i = 0, a = 0;
|
|
4563
4563
|
for (let e = 0; e < n.length; e += 4) n[e] === 0 && i++, n[e + 1] === 0 && a++;
|
|
4564
4564
|
if (i === r && a / r > .5) try {
|
|
4565
|
-
let e =
|
|
4566
|
-
if (e !== null &&
|
|
4565
|
+
let e = aa(n);
|
|
4566
|
+
if (e !== null && ra(e)) return {
|
|
4567
4567
|
encoding: "utf-32-be",
|
|
4568
4568
|
confidence: .95,
|
|
4569
4569
|
language: null,
|
|
@@ -4573,8 +4573,8 @@ function ta(e) {
|
|
|
4573
4573
|
let o = 0, s = 0;
|
|
4574
4574
|
for (let e = 0; e < n.length; e += 4) n[e + 3] === 0 && o++, n[e + 2] === 0 && s++;
|
|
4575
4575
|
if (o === r && s / r > .5) try {
|
|
4576
|
-
let e =
|
|
4577
|
-
if (e !== null &&
|
|
4576
|
+
let e = oa(n);
|
|
4577
|
+
if (e !== null && ra(e)) return {
|
|
4578
4578
|
encoding: "utf-32-le",
|
|
4579
4579
|
confidence: .95,
|
|
4580
4580
|
language: null,
|
|
@@ -4583,12 +4583,12 @@ function ta(e) {
|
|
|
4583
4583
|
} catch {}
|
|
4584
4584
|
return null;
|
|
4585
4585
|
}
|
|
4586
|
-
function
|
|
4587
|
-
let t = Math.min(e.length,
|
|
4588
|
-
if (t -= t % 2, t <
|
|
4586
|
+
function ta(e) {
|
|
4587
|
+
let t = Math.min(e.length, zi);
|
|
4588
|
+
if (t -= t % 2, t < Vi) return null;
|
|
4589
4589
|
let n = t / 2, r = 0, i = 0;
|
|
4590
4590
|
for (let n = 0; n < t; n += 2) e[n] === 0 && r++, e[n + 1] === 0 && i++;
|
|
4591
|
-
let a = r / n, o = i / n, s = o >=
|
|
4591
|
+
let a = r / n, o = i / n, s = o >= Hi && !Qi(e.subarray(0, t), o), c = a >= Hi && !Qi(e.subarray(0, t), a);
|
|
4592
4592
|
if (!s && !c) return null;
|
|
4593
4593
|
let l = [{
|
|
4594
4594
|
name: "utf-16-le",
|
|
@@ -4603,22 +4603,22 @@ function na(e) {
|
|
|
4603
4603
|
let u = null, d = -2, f = !1, p = 0, m = !1;
|
|
4604
4604
|
for (let { name: n, qualified: r } of l) {
|
|
4605
4605
|
let i = Ue(n, e.subarray(0, t));
|
|
4606
|
-
if (i === null || (r && (m = !0), !
|
|
4606
|
+
if (i === null || (r && (m = !0), !ra(i))) continue;
|
|
4607
4607
|
p++;
|
|
4608
|
-
let a =
|
|
4609
|
-
a > d + (p > 1 ?
|
|
4608
|
+
let a = ia(i);
|
|
4609
|
+
a > d + (p > 1 ? Wi : 0) && (d = a, u = n, f = r);
|
|
4610
4610
|
}
|
|
4611
4611
|
if (u === null) return null;
|
|
4612
4612
|
let h;
|
|
4613
|
-
return h = f ? p === 1 || d >=
|
|
4613
|
+
return h = f ? p === 1 || d >= Ui : m && d >= Ui, h ? {
|
|
4614
4614
|
encoding: u,
|
|
4615
4615
|
confidence: .95,
|
|
4616
4616
|
language: null,
|
|
4617
4617
|
mimeType: null
|
|
4618
4618
|
} : null;
|
|
4619
4619
|
}
|
|
4620
|
-
var
|
|
4621
|
-
function
|
|
4620
|
+
var na = /^[\p{C}\p{Z}]$/u;
|
|
4621
|
+
function ra(e) {
|
|
4622
4622
|
if (!e) return !1;
|
|
4623
4623
|
let t = 0, n = 0;
|
|
4624
4624
|
for (let r of e) {
|
|
@@ -4627,21 +4627,21 @@ function ia(e) {
|
|
|
4627
4627
|
n++;
|
|
4628
4628
|
continue;
|
|
4629
4629
|
}
|
|
4630
|
-
|
|
4630
|
+
na.test(r) || n++;
|
|
4631
4631
|
}
|
|
4632
|
-
return n / t >
|
|
4632
|
+
return n / t > Gi;
|
|
4633
4633
|
}
|
|
4634
|
-
function
|
|
4634
|
+
function ia(e, t = 500) {
|
|
4635
4635
|
let n = 0, r = 0, i = 0, a = 0, o = 0, s = 0;
|
|
4636
4636
|
for (let c of e) {
|
|
4637
4637
|
if (n === t) break;
|
|
4638
|
-
n++,
|
|
4638
|
+
n++, Ji.test(c) ? (r++, c.charCodeAt(0) < 128 && s++) : Yi.test(c) ? i++ : Xi.test(c) || c === "\n" || c === "\r" || c === " " ? a++ : Zi.test(c) && o++;
|
|
4639
4639
|
}
|
|
4640
4640
|
if (n === 0 || o / n > .1 || i / n > .2) return -1;
|
|
4641
4641
|
let c = r / n;
|
|
4642
4642
|
return c += s / n * .5, n > 20 && a > 0 && (c += .1), c;
|
|
4643
4643
|
}
|
|
4644
|
-
function
|
|
4644
|
+
function aa(e) {
|
|
4645
4645
|
let t = "";
|
|
4646
4646
|
for (let n = 0; n < e.length; n += 4) {
|
|
4647
4647
|
let r = (e[n] << 24 | e[n + 1] << 16 | e[n + 2] << 8 | e[n + 3]) >>> 0;
|
|
@@ -4650,7 +4650,7 @@ function oa(e) {
|
|
|
4650
4650
|
}
|
|
4651
4651
|
return t;
|
|
4652
4652
|
}
|
|
4653
|
-
function
|
|
4653
|
+
function oa(e) {
|
|
4654
4654
|
let t = "";
|
|
4655
4655
|
for (let n = 0; n < e.length; n += 4) {
|
|
4656
4656
|
let r = (e[n] | e[n + 1] << 8 | e[n + 2] << 16 | e[n + 3] << 24) >>> 0;
|
|
@@ -4659,19 +4659,19 @@ function sa(e) {
|
|
|
4659
4659
|
}
|
|
4660
4660
|
return t;
|
|
4661
4661
|
}
|
|
4662
|
-
function
|
|
4662
|
+
function sa(e, t) {
|
|
4663
4663
|
if (e.length === 0) return t;
|
|
4664
4664
|
let n = [];
|
|
4665
4665
|
for (let r of t) ze(r.name, e) && n.push(r);
|
|
4666
4666
|
return n;
|
|
4667
4667
|
}
|
|
4668
|
-
var
|
|
4668
|
+
var ca = Object.freeze({
|
|
4669
4669
|
encoding: null,
|
|
4670
4670
|
confidence: .95,
|
|
4671
4671
|
language: null,
|
|
4672
4672
|
mimeType: "application/octet-stream"
|
|
4673
|
-
}),
|
|
4674
|
-
function
|
|
4673
|
+
}), la = .85, ua = 16384;
|
|
4674
|
+
function da(e, t, n) {
|
|
4675
4675
|
return t.has(e) ? [{
|
|
4676
4676
|
encoding: e,
|
|
4677
4677
|
confidence: .1,
|
|
@@ -4679,35 +4679,35 @@ function fa(e, t, n) {
|
|
|
4679
4679
|
mimeType: null
|
|
4680
4680
|
}] : (g(`${n} '${e}' is excluded by include_encodings/exclude_encodings; returning encoding=None`), [{ ...Mt }]);
|
|
4681
4681
|
}
|
|
4682
|
-
function
|
|
4682
|
+
function fa(e, t, n, r, i) {
|
|
4683
4683
|
if (e.length <= t.length) return n;
|
|
4684
4684
|
for (let t = 0; t < n.length; t++) {
|
|
4685
4685
|
let r = n[t].encoding;
|
|
4686
4686
|
if (r !== null && ze(r, e)) return t === 0 ? n : n.slice(t);
|
|
4687
4687
|
}
|
|
4688
|
-
return
|
|
4688
|
+
return da(i, r, "no_match_encoding");
|
|
4689
4689
|
}
|
|
4690
|
-
var
|
|
4691
|
-
function
|
|
4690
|
+
var pa = .05, ma = 2, ha = .35, ga = 4, _a = 16;
|
|
4691
|
+
function va(e, t, n) {
|
|
4692
4692
|
let r = [];
|
|
4693
4693
|
for (let i of t) {
|
|
4694
4694
|
if (i.isMultibyte) {
|
|
4695
4695
|
let t = ar(e, i, n);
|
|
4696
|
-
if (n.mbScores.set(i.name, t), t <
|
|
4696
|
+
if (n.mbScores.set(i.name, t), t < pa) continue;
|
|
4697
4697
|
if (n.nonAsciiCount === null) {
|
|
4698
4698
|
let t = 0;
|
|
4699
4699
|
for (let n = 0; n < e.length; n++) e[n] > 127 && t++;
|
|
4700
4700
|
n.nonAsciiCount = t;
|
|
4701
4701
|
}
|
|
4702
|
-
if (n.nonAsciiCount <
|
|
4702
|
+
if (n.nonAsciiCount < ma) continue;
|
|
4703
4703
|
let r = or(e, i, n, n.nonAsciiCount);
|
|
4704
|
-
if (n.mbCoverage.set(i.name, r), r <
|
|
4704
|
+
if (n.mbCoverage.set(i.name, r), r < ha || n.nonAsciiCount >= _a && sr(e, i, n) < ga) continue;
|
|
4705
4705
|
}
|
|
4706
4706
|
r.push(i);
|
|
4707
4707
|
}
|
|
4708
4708
|
return r;
|
|
4709
4709
|
}
|
|
4710
|
-
function
|
|
4710
|
+
function ya(e, t, n, r) {
|
|
4711
4711
|
let i = /* @__PURE__ */ new Map();
|
|
4712
4712
|
for (let e of n) e.isMultibyte && i.set(e.name, e);
|
|
4713
4713
|
let a = [];
|
|
@@ -4715,7 +4715,7 @@ function ba(e, t, n, r) {
|
|
|
4715
4715
|
let t = i.get(e);
|
|
4716
4716
|
t !== void 0 && a.push(t);
|
|
4717
4717
|
}
|
|
4718
|
-
let o = n.filter((e) => !e.isMultibyte), s =
|
|
4718
|
+
let o = n.filter((e) => !e.isMultibyte), s = Pi(e.subarray(0, ua), [...a, ...o]), c = [];
|
|
4719
4719
|
for (let e of s) {
|
|
4720
4720
|
let t = e.encoding ? r.mbCoverage.get(e.encoding) ?? 0 : 0;
|
|
4721
4721
|
t >= .95 ? c.push({
|
|
@@ -4727,7 +4727,7 @@ function ba(e, t, n, r) {
|
|
|
4727
4727
|
}
|
|
4728
4728
|
return c.sort((e, t) => t.confidence - e.confidence), c;
|
|
4729
4729
|
}
|
|
4730
|
-
function
|
|
4730
|
+
function ba(e) {
|
|
4731
4731
|
if (e.mimeType !== null) return e;
|
|
4732
4732
|
let t = e.encoding === null ? "application/octet-stream" : "text/plain";
|
|
4733
4733
|
return {
|
|
@@ -4737,52 +4737,52 @@ function xa(e) {
|
|
|
4737
4737
|
mimeType: t
|
|
4738
4738
|
};
|
|
4739
4739
|
}
|
|
4740
|
-
function
|
|
4740
|
+
function xa(e, t, n, r, i, a, o, s) {
|
|
4741
4741
|
let c = new Nt();
|
|
4742
4742
|
s ||= e.length > n, e = e.subarray(0, n);
|
|
4743
4743
|
let l = Ce(t, r ?? void 0, i ?? void 0), u = new Set(l.map((e) => e.name));
|
|
4744
|
-
if (e.length === 0) return
|
|
4744
|
+
if (e.length === 0) return da(o, u, "empty_input_encoding");
|
|
4745
4745
|
let d = Xt(e);
|
|
4746
4746
|
if (d !== null && d.encoding !== null && u.has(d.encoding)) return [d];
|
|
4747
|
-
let f =
|
|
4747
|
+
let f = $i(e);
|
|
4748
4748
|
if (f !== null && f.encoding !== null && u.has(f.encoding)) return [f];
|
|
4749
4749
|
let p = vn(e);
|
|
4750
4750
|
if (p !== null && p.encoding !== null && u.has(p.encoding)) return [p];
|
|
4751
4751
|
let m = Jn(e);
|
|
4752
4752
|
if (m !== null) return [m];
|
|
4753
|
-
let [h, g] =
|
|
4754
|
-
if (g === null && _ === null && Vt(e, n)) return [{ ...
|
|
4753
|
+
let [h, g] = Ri(e), _ = Ft(e);
|
|
4754
|
+
if (g === null && _ === null && Vt(e, n)) return [{ ...ca }];
|
|
4755
4755
|
let y = xr(e);
|
|
4756
4756
|
if (y !== null && y.encoding !== null && u.has(y.encoding)) return g !== null && g.encoding !== null && g.encoding !== y.encoding && u.has(g.encoding) ? [{
|
|
4757
4757
|
encoding: g.encoding,
|
|
4758
4758
|
confidence: g.confidence,
|
|
4759
4759
|
language: g.language,
|
|
4760
4760
|
mimeType: y.mimeType
|
|
4761
|
-
}] : (y =
|
|
4761
|
+
}] : (y = Ca.promoteMarkupSuperset(e, y, u), [y]);
|
|
4762
4762
|
if (_ !== null && _.encoding !== null && u.has(_.encoding)) return [_];
|
|
4763
4763
|
if (g !== null && g.encoding !== null && u.has(g.encoding)) return [g];
|
|
4764
|
-
let b = e.subarray(0, v), x = s || e.length > b.length, S =
|
|
4765
|
-
if (!h && e.length > b.length && (S = S.filter((e) => e.name !== "utf-8")), S.length === 0 || (S =
|
|
4764
|
+
let b = e.subarray(0, v), x = s || e.length > b.length, S = Ca.filterByValidity(b, l);
|
|
4765
|
+
if (!h && e.length > b.length && (S = S.filter((e) => e.name !== "utf-8")), S.length === 0 || (S = Ca._gateCjkCandidates(b, S, c), S.length === 0)) return da(a, u, "no_match_encoding");
|
|
4766
4766
|
let C = [];
|
|
4767
4767
|
for (let e of S) if (e.isMultibyte) {
|
|
4768
4768
|
let t = c.mbScores.get(e.name);
|
|
4769
4769
|
t === void 0 && (t = ar(b, e, c)), t > 0 && C.push([e.name, t]);
|
|
4770
4770
|
}
|
|
4771
|
-
if (C.length > 0 && (C.sort((e, t) => t[1] - e[1]), C[0][1] >=
|
|
4772
|
-
let t =
|
|
4773
|
-
if (t.length > 0) return t =
|
|
4771
|
+
if (C.length > 0 && (C.sort((e, t) => t[1] - e[1]), C[0][1] >= la)) {
|
|
4772
|
+
let t = ya(b, C, S, c);
|
|
4773
|
+
if (t.length > 0) return t = Ca.postprocessResults(b, t, { inputTruncated: x }), fa(e, b, t, u, a);
|
|
4774
4774
|
}
|
|
4775
|
-
let w =
|
|
4776
|
-
return w.length === 0 ?
|
|
4775
|
+
let w = Pi(b.subarray(0, ua), S);
|
|
4776
|
+
return w.length === 0 ? da(a, u, "no_match_encoding") : (w = Ca.postprocessResults(b, w, { inputTruncated: x }), fa(e, b, w, u, a));
|
|
4777
4777
|
}
|
|
4778
|
-
function
|
|
4779
|
-
let r = n?.maxBytes ?? _, i =
|
|
4780
|
-
if (i =
|
|
4778
|
+
function Sa(e, t, n) {
|
|
4779
|
+
let r = n?.maxBytes ?? _, i = xa(e, t, r, n?.includeEncodings ?? null, n?.excludeEncodings ?? null, n?.noMatchEncoding ?? "cp1252", n?.emptyInputEncoding ?? "utf-8", n?.inputTruncated ?? !1);
|
|
4780
|
+
if (i = Ca.fillLanguages(e.subarray(0, r), i), i = i.map((e) => e.language === M ? {
|
|
4781
4781
|
encoding: e.encoding,
|
|
4782
4782
|
confidence: e.confidence,
|
|
4783
4783
|
language: null,
|
|
4784
4784
|
mimeType: e.mimeType
|
|
4785
|
-
} : e), i = i.map(
|
|
4785
|
+
} : e), i = i.map(ba), i.length === 0) throw Error("pipeline must always return at least one result");
|
|
4786
4786
|
return i.map((e) => e.confidence > 1 ? {
|
|
4787
4787
|
encoding: e.encoding,
|
|
4788
4788
|
confidence: 1,
|
|
@@ -4790,16 +4790,16 @@ function Ca(e, t, n) {
|
|
|
4790
4790
|
mimeType: e.mimeType
|
|
4791
4791
|
} : e);
|
|
4792
4792
|
}
|
|
4793
|
-
var
|
|
4794
|
-
filterByValidity:
|
|
4793
|
+
var Ca = {
|
|
4794
|
+
filterByValidity: sa,
|
|
4795
4795
|
promoteMarkupSuperset: Cr,
|
|
4796
|
-
_makeFallbackOrNone:
|
|
4797
|
-
_gateCjkCandidates:
|
|
4798
|
-
_scoreStructuralCandidates:
|
|
4799
|
-
postprocessResults:
|
|
4796
|
+
_makeFallbackOrNone: da,
|
|
4797
|
+
_gateCjkCandidates: va,
|
|
4798
|
+
_scoreStructuralCandidates: ya,
|
|
4799
|
+
postprocessResults: Ni,
|
|
4800
4800
|
fillLanguages: xn,
|
|
4801
|
-
_runPipelineCore:
|
|
4802
|
-
},
|
|
4801
|
+
_runPipelineCore: xa
|
|
4802
|
+
}, wa = class {
|
|
4803
4803
|
constructor(e = {}) {
|
|
4804
4804
|
f(this, "_preferSuperset"), f(this, "_compatNames"), f(this, "_encodingEra"), f(this, "_maxBytes"), f(this, "_includeEncodings"), f(this, "_excludeEncodings"), f(this, "_noMatchEncoding"), f(this, "_emptyInputEncoding"), f(this, "_chunks", []), f(this, "_bufferLength", 0), f(this, "_inputTruncated", !1), f(this, "_done", !1), f(this, "_closed", !1), f(this, "_detection", null), f(this, "_buffer", null), e.langFilter ?? ee.ALL;
|
|
4805
4805
|
let t = e.shouldRenameLegacy ?? !1, n = e.encodingEra ?? w.ALL, r = e.maxBytes ?? _, i = e.preferSuperset ?? !1, a = e.compatNames ?? !0, o = e.includeEncodings ?? null, s = e.excludeEncodings ?? null, c = e.noMatchEncoding ?? "cp1252", l = e.emptyInputEncoding ?? "utf-8";
|
|
@@ -4824,7 +4824,7 @@ var wa = {
|
|
|
4824
4824
|
let e = new Uint8Array(this._bufferLength), t = 0;
|
|
4825
4825
|
for (let n of this._chunks) e.set(n, t), t += n.length;
|
|
4826
4826
|
this._buffer = e;
|
|
4827
|
-
let n =
|
|
4827
|
+
let n = Sa(e, this._encodingEra, {
|
|
4828
4828
|
maxBytes: this._maxBytes,
|
|
4829
4829
|
inputTruncated: this._inputTruncated,
|
|
4830
4830
|
includeEncodings: this._includeEncodings,
|
|
@@ -4848,13 +4848,13 @@ var wa = {
|
|
|
4848
4848
|
return this._preferSuperset && Ke(e, this._buffer ?? void 0), this._compatNames && Je(e), e;
|
|
4849
4849
|
}
|
|
4850
4850
|
};
|
|
4851
|
-
f(
|
|
4852
|
-
function
|
|
4851
|
+
f(wa, "MINIMUM_THRESHOLD", C), f(wa, "LEGACY_MAP", We);
|
|
4852
|
+
function Ta(e, t = {}) {
|
|
4853
4853
|
let n = t.shouldRenameLegacy ?? !1, r = t.encodingEra ?? w.ALL;
|
|
4854
4854
|
t.chunkSize;
|
|
4855
4855
|
let i = t.maxBytes ?? _, a = t.preferSuperset ?? !1, o = t.compatNames ?? !0, s = t.includeEncodings ?? null, c = t.excludeEncodings ?? null, l = t.noMatchEncoding ?? "cp1252", u = t.emptyInputEncoding ?? "utf-8";
|
|
4856
4856
|
y(i);
|
|
4857
|
-
let d = b(n, a), f = { ...
|
|
4857
|
+
let d = b(n, a), f = { ...Sa(e, r, {
|
|
4858
4858
|
maxBytes: i,
|
|
4859
4859
|
includeEncodings: De(s, "include_encodings"),
|
|
4860
4860
|
excludeEncodings: De(c, "exclude_encodings"),
|
|
@@ -4863,12 +4863,12 @@ function Ea(e, t = {}) {
|
|
|
4863
4863
|
})[0] };
|
|
4864
4864
|
return d && Ke(f, e.subarray(0, i)), o && Je(f), f;
|
|
4865
4865
|
}
|
|
4866
|
-
function
|
|
4866
|
+
function Ea(e, t = {}) {
|
|
4867
4867
|
let n = t.ignoreThreshold ?? !1, r = t.shouldRenameLegacy ?? !1, i = t.encodingEra ?? w.ALL;
|
|
4868
4868
|
t.chunkSize;
|
|
4869
4869
|
let a = t.maxBytes ?? _, o = t.preferSuperset ?? !1, s = t.compatNames ?? !0, c = t.includeEncodings ?? null, l = t.excludeEncodings ?? null, u = t.noMatchEncoding ?? "cp1252", d = t.emptyInputEncoding ?? "utf-8";
|
|
4870
4870
|
y(a);
|
|
4871
|
-
let f = b(r, o), p =
|
|
4871
|
+
let f = b(r, o), p = Sa(e, i, {
|
|
4872
4872
|
maxBytes: a,
|
|
4873
4873
|
includeEncodings: De(c, "include_encodings"),
|
|
4874
4874
|
excludeEncodings: De(l, "exclude_encodings"),
|
|
@@ -4883,7 +4883,7 @@ function Da(e, t = {}) {
|
|
|
4883
4883
|
for (let e of p) f && Ke(e, m), s && Je(e);
|
|
4884
4884
|
return p.sort((e, t) => t.confidence - e.confidence), p;
|
|
4885
4885
|
}
|
|
4886
|
-
function
|
|
4886
|
+
function Da(e) {
|
|
4887
4887
|
if (typeof e == "string") {
|
|
4888
4888
|
let t = new Uint8Array(e.length);
|
|
4889
4889
|
for (let n = 0; n < e.length; n++) t[n] = e.charCodeAt(n) & 255;
|
|
@@ -4891,11 +4891,11 @@ function Oa(e) {
|
|
|
4891
4891
|
}
|
|
4892
4892
|
return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
|
|
4893
4893
|
}
|
|
4894
|
-
function
|
|
4895
|
-
let n =
|
|
4894
|
+
function Oa(e, t = {}) {
|
|
4895
|
+
let n = Da(e), r = {
|
|
4896
4896
|
includeEncodings: t.detectEncodings ?? null,
|
|
4897
4897
|
excludeEncodings: t.excludeEncodings ?? null
|
|
4898
|
-
}, i = t.minimumThreshold !== void 0, a = t.minimumThreshold ?? C, o = m() || i, s =
|
|
4898
|
+
}, i = t.minimumThreshold !== void 0, a = t.minimumThreshold ?? C, o = m() || i, s = Ea(n, {
|
|
4899
4899
|
...r,
|
|
4900
4900
|
ignoreThreshold: o
|
|
4901
4901
|
});
|
|
@@ -4905,7 +4905,7 @@ function ka(e, t = {}) {
|
|
|
4905
4905
|
}
|
|
4906
4906
|
//#endregion
|
|
4907
4907
|
//#region node_modules/@borewit/text-codec/lib/index.js
|
|
4908
|
-
var
|
|
4908
|
+
var ka = {
|
|
4909
4909
|
128: "€",
|
|
4910
4910
|
130: "‚",
|
|
4911
4911
|
131: "ƒ",
|
|
@@ -4933,215 +4933,235 @@ var Aa = {
|
|
|
4933
4933
|
156: "œ",
|
|
4934
4934
|
158: "ž",
|
|
4935
4935
|
159: "Ÿ"
|
|
4936
|
-
},
|
|
4937
|
-
for (let [e, t] of Object.entries(
|
|
4938
|
-
var
|
|
4939
|
-
function
|
|
4940
|
-
if (globalThis.TextDecoder !== void 0) return
|
|
4941
|
-
}
|
|
4942
|
-
var
|
|
4943
|
-
function
|
|
4936
|
+
}, Aa = {};
|
|
4937
|
+
for (let [e, t] of Object.entries(ka)) Aa[t] = Number.parseInt(e, 10);
|
|
4938
|
+
var ja;
|
|
4939
|
+
function Ma() {
|
|
4940
|
+
if (globalThis.TextDecoder !== void 0) return ja ??= new globalThis.TextDecoder("utf-8");
|
|
4941
|
+
}
|
|
4942
|
+
var Na = 32768, I = 65533;
|
|
4943
|
+
function Pa(e, t = "utf-8") {
|
|
4944
4944
|
switch (t.toLowerCase()) {
|
|
4945
4945
|
case "utf-8":
|
|
4946
4946
|
case "utf8": {
|
|
4947
|
-
let t =
|
|
4948
|
-
return t ? t.decode(e) :
|
|
4947
|
+
let t = Ma();
|
|
4948
|
+
return t ? t.decode(e) : La(e);
|
|
4949
4949
|
}
|
|
4950
|
-
case "utf-16le": return
|
|
4950
|
+
case "utf-16le": return Ra(e);
|
|
4951
4951
|
case "us-ascii":
|
|
4952
|
-
case "ascii": return
|
|
4952
|
+
case "ascii": return za(e);
|
|
4953
4953
|
case "latin1":
|
|
4954
|
-
case "iso-8859-1": return
|
|
4955
|
-
case "windows-1252": return
|
|
4954
|
+
case "iso-8859-1": return Ba(e);
|
|
4955
|
+
case "windows-1252": return Va(e);
|
|
4956
4956
|
default: throw RangeError(`Encoding '${t}' not supported`);
|
|
4957
4957
|
}
|
|
4958
4958
|
}
|
|
4959
|
-
function
|
|
4959
|
+
function Fa(e, t) {
|
|
4960
4960
|
t.length !== 0 && (e.push(String.fromCharCode.apply(null, t)), t.length = 0);
|
|
4961
4961
|
}
|
|
4962
|
-
function
|
|
4963
|
-
t.push(n), t.length >=
|
|
4962
|
+
function L(e, t, n) {
|
|
4963
|
+
t.push(n), t.length >= Na && Fa(e, t);
|
|
4964
4964
|
}
|
|
4965
|
-
function
|
|
4965
|
+
function Ia(e, t, n) {
|
|
4966
4966
|
if (n <= 65535) {
|
|
4967
|
-
|
|
4967
|
+
L(e, t, n);
|
|
4968
4968
|
return;
|
|
4969
4969
|
}
|
|
4970
|
-
n -= 65536,
|
|
4970
|
+
n -= 65536, L(e, t, 55296 + (n >> 10)), L(e, t, 56320 + (n & 1023));
|
|
4971
4971
|
}
|
|
4972
|
-
function
|
|
4972
|
+
function La(e) {
|
|
4973
4973
|
let t = [], n = [], r = 0;
|
|
4974
4974
|
for (e.length >= 3 && e[0] === 239 && e[1] === 187 && e[2] === 191 && (r = 3); r < e.length;) {
|
|
4975
4975
|
let i = e[r];
|
|
4976
4976
|
if (i <= 127) {
|
|
4977
|
-
|
|
4977
|
+
L(t, n, i), r++;
|
|
4978
4978
|
continue;
|
|
4979
4979
|
}
|
|
4980
4980
|
if (i < 194 || i > 244) {
|
|
4981
|
-
|
|
4981
|
+
L(t, n, I), r++;
|
|
4982
4982
|
continue;
|
|
4983
4983
|
}
|
|
4984
4984
|
if (i <= 223) {
|
|
4985
4985
|
if (r + 1 >= e.length) {
|
|
4986
|
-
|
|
4986
|
+
L(t, n, I), r++;
|
|
4987
4987
|
continue;
|
|
4988
4988
|
}
|
|
4989
4989
|
let a = e[r + 1];
|
|
4990
4990
|
if ((a & 192) != 128) {
|
|
4991
|
-
|
|
4991
|
+
L(t, n, I), r++;
|
|
4992
4992
|
continue;
|
|
4993
4993
|
}
|
|
4994
|
-
|
|
4994
|
+
L(t, n, (i & 31) << 6 | a & 63), r += 2;
|
|
4995
4995
|
continue;
|
|
4996
4996
|
}
|
|
4997
4997
|
if (i <= 239) {
|
|
4998
4998
|
if (r + 2 >= e.length) {
|
|
4999
|
-
|
|
4999
|
+
L(t, n, I), r++;
|
|
5000
5000
|
continue;
|
|
5001
5001
|
}
|
|
5002
5002
|
let a = e[r + 1], o = e[r + 2];
|
|
5003
5003
|
if ((a & 192) != 128 || (o & 192) != 128 || i === 224 && a < 160 || i === 237 && a >= 160) {
|
|
5004
|
-
|
|
5004
|
+
L(t, n, I), r++;
|
|
5005
5005
|
continue;
|
|
5006
5006
|
}
|
|
5007
|
-
|
|
5007
|
+
L(t, n, (i & 15) << 12 | (a & 63) << 6 | o & 63), r += 3;
|
|
5008
5008
|
continue;
|
|
5009
5009
|
}
|
|
5010
5010
|
if (r + 3 >= e.length) {
|
|
5011
|
-
|
|
5011
|
+
L(t, n, I), r++;
|
|
5012
5012
|
continue;
|
|
5013
5013
|
}
|
|
5014
5014
|
let a = e[r + 1], o = e[r + 2], s = e[r + 3];
|
|
5015
5015
|
if ((a & 192) != 128 || (o & 192) != 128 || (s & 192) != 128 || i === 240 && a < 144 || i === 244 && a > 143) {
|
|
5016
|
-
|
|
5016
|
+
L(t, n, I), r++;
|
|
5017
5017
|
continue;
|
|
5018
5018
|
}
|
|
5019
|
-
|
|
5019
|
+
Ia(t, n, (i & 7) << 18 | (a & 63) << 12 | (o & 63) << 6 | s & 63), r += 4;
|
|
5020
5020
|
}
|
|
5021
|
-
return
|
|
5021
|
+
return Fa(t, n), t.join("");
|
|
5022
5022
|
}
|
|
5023
|
-
function
|
|
5023
|
+
function Ra(e) {
|
|
5024
5024
|
let t = [], n = [], r = e.length, i = 0;
|
|
5025
5025
|
for (; i + 1 < r;) {
|
|
5026
5026
|
let a = e[i] | e[i + 1] << 8;
|
|
5027
5027
|
if (i += 2, a >= 55296 && a <= 56319) {
|
|
5028
5028
|
if (i + 1 < r) {
|
|
5029
5029
|
let r = e[i] | e[i + 1] << 8;
|
|
5030
|
-
r >= 56320 && r <= 57343 ? (
|
|
5031
|
-
} else
|
|
5030
|
+
r >= 56320 && r <= 57343 ? (L(t, n, a), L(t, n, r), i += 2) : L(t, n, I);
|
|
5031
|
+
} else L(t, n, I);
|
|
5032
5032
|
continue;
|
|
5033
5033
|
}
|
|
5034
5034
|
if (a >= 56320 && a <= 57343) {
|
|
5035
|
-
|
|
5035
|
+
L(t, n, I);
|
|
5036
5036
|
continue;
|
|
5037
5037
|
}
|
|
5038
|
-
|
|
5038
|
+
L(t, n, a);
|
|
5039
5039
|
}
|
|
5040
|
-
return i < r &&
|
|
5040
|
+
return i < r && L(t, n, I), Fa(t, n), t.join("");
|
|
5041
5041
|
}
|
|
5042
|
-
function
|
|
5042
|
+
function za(e) {
|
|
5043
5043
|
let t = [];
|
|
5044
|
-
for (let n = 0; n < e.length; n +=
|
|
5045
|
-
let r = Math.min(e.length, n +
|
|
5044
|
+
for (let n = 0; n < e.length; n += Na) {
|
|
5045
|
+
let r = Math.min(e.length, n + Na), i = Array(r - n);
|
|
5046
5046
|
for (let t = n, a = 0; t < r; t++, a++) i[a] = e[t] & 127;
|
|
5047
5047
|
t.push(String.fromCharCode.apply(null, i));
|
|
5048
5048
|
}
|
|
5049
5049
|
return t.join("");
|
|
5050
5050
|
}
|
|
5051
|
-
function
|
|
5051
|
+
function Ba(e) {
|
|
5052
5052
|
let t = [];
|
|
5053
|
-
for (let n = 0; n < e.length; n +=
|
|
5054
|
-
let r = Math.min(e.length, n +
|
|
5053
|
+
for (let n = 0; n < e.length; n += Na) {
|
|
5054
|
+
let r = Math.min(e.length, n + Na), i = Array(r - n);
|
|
5055
5055
|
for (let t = n, a = 0; t < r; t++, a++) i[a] = e[t];
|
|
5056
5056
|
t.push(String.fromCharCode.apply(null, i));
|
|
5057
5057
|
}
|
|
5058
5058
|
return t.join("");
|
|
5059
5059
|
}
|
|
5060
|
-
function
|
|
5060
|
+
function Va(e) {
|
|
5061
5061
|
let t = [], n = "";
|
|
5062
5062
|
for (let r = 0; r < e.length; r++) {
|
|
5063
|
-
let i = e[r], a = i >= 128 && i <= 159 ?
|
|
5064
|
-
n += a ?? String.fromCharCode(i), n.length >=
|
|
5063
|
+
let i = e[r], a = i >= 128 && i <= 159 ? ka[i] : void 0;
|
|
5064
|
+
n += a ?? String.fromCharCode(i), n.length >= Na && (t.push(n), n = "");
|
|
5065
5065
|
}
|
|
5066
5066
|
return n && t.push(n), t.join("");
|
|
5067
5067
|
}
|
|
5068
5068
|
//#endregion
|
|
5069
5069
|
//#region node_modules/token-types/lib/index.js
|
|
5070
|
-
function
|
|
5070
|
+
function R(e) {
|
|
5071
5071
|
return new DataView(e.buffer, e.byteOffset);
|
|
5072
5072
|
}
|
|
5073
|
-
var
|
|
5073
|
+
var Ha = {
|
|
5074
5074
|
len: 1,
|
|
5075
5075
|
get(e, t) {
|
|
5076
|
-
return
|
|
5076
|
+
return R(e).getUint8(t);
|
|
5077
5077
|
},
|
|
5078
5078
|
put(e, t, n) {
|
|
5079
|
-
return
|
|
5079
|
+
return R(e).setUint8(t, n), t + 1;
|
|
5080
5080
|
}
|
|
5081
|
-
},
|
|
5081
|
+
}, z = {
|
|
5082
5082
|
len: 2,
|
|
5083
5083
|
get(e, t) {
|
|
5084
|
-
return
|
|
5084
|
+
return R(e).getUint16(t, !0);
|
|
5085
5085
|
},
|
|
5086
5086
|
put(e, t, n) {
|
|
5087
|
-
return
|
|
5087
|
+
return R(e).setUint16(t, n, !0), t + 2;
|
|
5088
5088
|
}
|
|
5089
|
-
},
|
|
5089
|
+
}, Ua = {
|
|
5090
5090
|
len: 2,
|
|
5091
5091
|
get(e, t) {
|
|
5092
|
-
return
|
|
5092
|
+
return R(e).getUint16(t);
|
|
5093
5093
|
},
|
|
5094
5094
|
put(e, t, n) {
|
|
5095
|
-
return
|
|
5095
|
+
return R(e).setUint16(t, n), t + 2;
|
|
5096
5096
|
}
|
|
5097
|
-
},
|
|
5097
|
+
}, B = {
|
|
5098
5098
|
len: 4,
|
|
5099
5099
|
get(e, t) {
|
|
5100
|
-
return
|
|
5100
|
+
return R(e).getUint32(t, !0);
|
|
5101
5101
|
},
|
|
5102
5102
|
put(e, t, n) {
|
|
5103
|
-
return
|
|
5103
|
+
return R(e).setUint32(t, n, !0), t + 4;
|
|
5104
5104
|
}
|
|
5105
|
-
},
|
|
5105
|
+
}, Wa = {
|
|
5106
5106
|
len: 4,
|
|
5107
5107
|
get(e, t) {
|
|
5108
|
-
return
|
|
5108
|
+
return R(e).getUint32(t);
|
|
5109
5109
|
},
|
|
5110
5110
|
put(e, t, n) {
|
|
5111
|
-
return
|
|
5111
|
+
return R(e).setUint32(t, n), t + 4;
|
|
5112
5112
|
}
|
|
5113
|
-
},
|
|
5113
|
+
}, Ga = {
|
|
5114
5114
|
len: 4,
|
|
5115
5115
|
get(e, t) {
|
|
5116
|
-
return
|
|
5116
|
+
return R(e).getInt32(t);
|
|
5117
5117
|
},
|
|
5118
5118
|
put(e, t, n) {
|
|
5119
|
-
return
|
|
5119
|
+
return R(e).setInt32(t, n), t + 4;
|
|
5120
5120
|
}
|
|
5121
|
-
},
|
|
5121
|
+
}, Ka = {
|
|
5122
5122
|
len: 8,
|
|
5123
5123
|
get(e, t) {
|
|
5124
|
-
return
|
|
5124
|
+
return R(e).getBigUint64(t, !0);
|
|
5125
5125
|
},
|
|
5126
5126
|
put(e, t, n) {
|
|
5127
|
-
return
|
|
5127
|
+
return R(e).setBigUint64(t, n, !0), t + 8;
|
|
5128
5128
|
}
|
|
5129
|
-
},
|
|
5129
|
+
}, V = class {
|
|
5130
5130
|
constructor(e, t) {
|
|
5131
5131
|
this.len = e, this.encoding = t;
|
|
5132
5132
|
}
|
|
5133
5133
|
get(e, t = 0) {
|
|
5134
|
-
return
|
|
5134
|
+
return Pa(e.subarray(t, t + this.len), this.encoding);
|
|
5135
5135
|
}
|
|
5136
|
-
},
|
|
5136
|
+
}, qa = "End-Of-Stream", H = class extends Error {
|
|
5137
5137
|
constructor() {
|
|
5138
|
-
super(
|
|
5138
|
+
super(qa), this.name = "EndOfStreamError";
|
|
5139
5139
|
}
|
|
5140
|
-
},
|
|
5140
|
+
}, Ja = class extends Error {
|
|
5141
5141
|
constructor(e = "The operation was aborted") {
|
|
5142
5142
|
super(e), this.name = "AbortError";
|
|
5143
5143
|
}
|
|
5144
|
-
}
|
|
5144
|
+
};
|
|
5145
|
+
//#endregion
|
|
5146
|
+
//#region node_modules/strtok3/lib/AbortSignal.js
|
|
5147
|
+
function Ya(e) {
|
|
5148
|
+
if (e?.aborted) throw new Ja();
|
|
5149
|
+
}
|
|
5150
|
+
//#endregion
|
|
5151
|
+
//#region node_modules/strtok3/lib/BufferSizeError.js
|
|
5152
|
+
var Xa = class extends RangeError {
|
|
5153
|
+
constructor(e, t) {
|
|
5154
|
+
super(`Requested buffer size ${e} exceeds maxBufferSize ${t}`), this.requestedSize = e, this.maxBufferSize = t, this.name = "BufferSizeError";
|
|
5155
|
+
}
|
|
5156
|
+
};
|
|
5157
|
+
function Za(e) {
|
|
5158
|
+
let t = e?.maxBufferSize ?? Infinity;
|
|
5159
|
+
if (t !== Infinity && (!Number.isSafeInteger(t) || t <= 0)) throw RangeError("maxBufferSize must be a positive safe integer or Infinity");
|
|
5160
|
+
return t;
|
|
5161
|
+
}
|
|
5162
|
+
//#endregion
|
|
5163
|
+
//#region node_modules/strtok3/lib/stream/AbstractStreamReader.js
|
|
5164
|
+
var Qa = class {
|
|
5145
5165
|
constructor() {
|
|
5146
5166
|
this.endOfStream = !1, this.interrupted = !1, this.peekQueue = [];
|
|
5147
5167
|
}
|
|
@@ -5152,7 +5172,7 @@ var Ua = {
|
|
|
5152
5172
|
async read(e, t = !1) {
|
|
5153
5173
|
if (e.length === 0) return 0;
|
|
5154
5174
|
let n = this.readFromPeekBuffer(e);
|
|
5155
|
-
if (this.endOfStream || (n += await this.readRemainderFromStream(e.subarray(n), t)), n === 0 && !t) throw new
|
|
5175
|
+
if (this.endOfStream || (n += await this.readRemainderFromStream(e.subarray(n), t)), n === 0 && !t) throw new H();
|
|
5156
5176
|
return n;
|
|
5157
5177
|
}
|
|
5158
5178
|
readFromPeekBuffer(e) {
|
|
@@ -5168,15 +5188,15 @@ var Ua = {
|
|
|
5168
5188
|
async readRemainderFromStream(e, t) {
|
|
5169
5189
|
let n = 0;
|
|
5170
5190
|
for (; n < e.length && !this.endOfStream;) {
|
|
5171
|
-
if (this.interrupted) throw new
|
|
5191
|
+
if (this.interrupted) throw new Ja();
|
|
5172
5192
|
let r = await this.readFromStream(e.subarray(n), t);
|
|
5173
5193
|
if (r === 0) break;
|
|
5174
5194
|
n += r;
|
|
5175
5195
|
}
|
|
5176
|
-
if (!t && n < e.length) throw new
|
|
5196
|
+
if (!t && n < e.length) throw new H();
|
|
5177
5197
|
return n;
|
|
5178
5198
|
}
|
|
5179
|
-
},
|
|
5199
|
+
}, $a = class extends Qa {
|
|
5180
5200
|
constructor(e) {
|
|
5181
5201
|
super(), this.reader = e;
|
|
5182
5202
|
}
|
|
@@ -5186,13 +5206,13 @@ var Ua = {
|
|
|
5186
5206
|
async close() {
|
|
5187
5207
|
this.reader.releaseLock();
|
|
5188
5208
|
}
|
|
5189
|
-
},
|
|
5209
|
+
}, eo = class extends $a {
|
|
5190
5210
|
async readFromStream(e, t) {
|
|
5191
5211
|
if (e.length === 0) return 0;
|
|
5192
5212
|
let n = await this.reader.read(new Uint8Array(e.length), { min: t ? void 0 : e.length });
|
|
5193
5213
|
return n.done && (this.endOfStream = n.done), n.value ? (e.set(n.value), n.value.length) : 0;
|
|
5194
5214
|
}
|
|
5195
|
-
},
|
|
5215
|
+
}, to = class extends Qa {
|
|
5196
5216
|
constructor(e) {
|
|
5197
5217
|
super(), this.reader = e, this.buffer = null;
|
|
5198
5218
|
}
|
|
@@ -5211,131 +5231,131 @@ var Ua = {
|
|
|
5211
5231
|
}
|
|
5212
5232
|
t.value && (n += this.writeChunk(e.subarray(n), t.value));
|
|
5213
5233
|
}
|
|
5214
|
-
if (!t && n === 0 && this.endOfStream) throw new
|
|
5234
|
+
if (!t && n === 0 && this.endOfStream) throw new H();
|
|
5215
5235
|
return n;
|
|
5216
5236
|
}
|
|
5217
5237
|
abort() {
|
|
5218
5238
|
return this.interrupted = !0, this.reader.cancel();
|
|
5219
5239
|
}
|
|
5220
5240
|
async close() {
|
|
5221
|
-
|
|
5241
|
+
try {
|
|
5242
|
+
await this.abort();
|
|
5243
|
+
} finally {
|
|
5244
|
+
this.reader.releaseLock();
|
|
5245
|
+
}
|
|
5222
5246
|
}
|
|
5223
5247
|
};
|
|
5224
5248
|
//#endregion
|
|
5225
5249
|
//#region node_modules/strtok3/lib/stream/WebStreamReaderFactory.js
|
|
5226
|
-
function
|
|
5250
|
+
function no(e) {
|
|
5227
5251
|
try {
|
|
5228
5252
|
let t = e.getReader({ mode: "byob" });
|
|
5229
|
-
return t instanceof ReadableStreamDefaultReader ? new
|
|
5253
|
+
return t instanceof ReadableStreamDefaultReader ? new to(t) : new eo(t);
|
|
5230
5254
|
} catch (t) {
|
|
5231
|
-
if (t instanceof TypeError) return new
|
|
5255
|
+
if (t instanceof TypeError) return new to(e.getReader());
|
|
5232
5256
|
throw t;
|
|
5233
5257
|
}
|
|
5234
5258
|
}
|
|
5235
5259
|
//#endregion
|
|
5236
5260
|
//#region node_modules/strtok3/lib/AbstractTokenizer.js
|
|
5237
|
-
var
|
|
5261
|
+
var ro = class {
|
|
5238
5262
|
constructor(e) {
|
|
5239
|
-
this.numBuffer = /* @__PURE__ */ new Uint8Array(8), this.position = 0, this.onClose = e?.onClose, e?.abortSignal && e.abortSignal
|
|
5240
|
-
this.abort();
|
|
5263
|
+
this.numBuffer = /* @__PURE__ */ new Uint8Array(8), this.position = 0, this.maxBufferSize = Za(e), Ya(e?.abortSignal), this.onClose = e?.onClose, e?.abortSignal && this.addAbortListener(e.abortSignal, () => {
|
|
5264
|
+
this.abort().catch(() => {});
|
|
5241
5265
|
});
|
|
5242
5266
|
}
|
|
5267
|
+
addAbortListener(e, t) {
|
|
5268
|
+
this.abortSignal = e, this.abortListener = t, e.addEventListener("abort", t, { once: !0 });
|
|
5269
|
+
}
|
|
5270
|
+
removeAbortListener() {
|
|
5271
|
+
this.abortListener && this.abortSignal?.removeEventListener("abort", this.abortListener), this.abortSignal = void 0, this.abortListener = void 0;
|
|
5272
|
+
}
|
|
5243
5273
|
async readToken(e, t = this.position) {
|
|
5274
|
+
this.validateTokenRead(e.len, t);
|
|
5244
5275
|
let n = new Uint8Array(e.len);
|
|
5245
|
-
if (await this.readBuffer(n, { position: t }) < e.len) throw new
|
|
5276
|
+
if (await this.readBuffer(n, { position: t }) < e.len) throw new H();
|
|
5246
5277
|
return e.get(n, 0);
|
|
5247
5278
|
}
|
|
5248
5279
|
async peekToken(e, t = this.position) {
|
|
5249
|
-
let n =
|
|
5250
|
-
|
|
5251
|
-
|
|
5280
|
+
let n = t ?? this.position;
|
|
5281
|
+
this.validateTokenRead(e.len, n, !0);
|
|
5282
|
+
let r = new Uint8Array(e.len);
|
|
5283
|
+
if (await this.peekBuffer(r, { position: n }) < e.len) throw new H();
|
|
5284
|
+
return e.get(r, 0);
|
|
5252
5285
|
}
|
|
5253
5286
|
async readNumber(e) {
|
|
5254
|
-
if (await this.readBuffer(this.numBuffer, { length: e.len }) < e.len) throw new
|
|
5287
|
+
if (await this.readBuffer(this.numBuffer, { length: e.len }) < e.len) throw new H();
|
|
5255
5288
|
return e.get(this.numBuffer, 0);
|
|
5256
5289
|
}
|
|
5257
5290
|
async peekNumber(e) {
|
|
5258
|
-
if (await this.peekBuffer(this.numBuffer, { length: e.len }) < e.len) throw new
|
|
5291
|
+
if (await this.peekBuffer(this.numBuffer, { length: e.len }) < e.len) throw new H();
|
|
5259
5292
|
return e.get(this.numBuffer, 0);
|
|
5260
5293
|
}
|
|
5261
5294
|
async ignore(e) {
|
|
5262
5295
|
if (e < 0) throw RangeError("ignore length must be ≥ 0 bytes");
|
|
5263
|
-
if (this.fileInfo.size !== void 0) {
|
|
5296
|
+
if (this.validateLength(e, "ignore length"), this.validateLength(this.position + e, "end position"), this.fileInfo.size !== void 0) {
|
|
5264
5297
|
let t = this.fileInfo.size - this.position;
|
|
5265
5298
|
if (e > t) return this.position += t, t;
|
|
5266
5299
|
}
|
|
5267
5300
|
return this.position += e, e;
|
|
5268
5301
|
}
|
|
5269
5302
|
async close() {
|
|
5270
|
-
await this.abort(), await this.onClose?.();
|
|
5303
|
+
this.removeAbortListener(), await this.abort(), await this.onClose?.();
|
|
5304
|
+
}
|
|
5305
|
+
validateLength(e, t) {
|
|
5306
|
+
if (!Number.isSafeInteger(e) || e < 0) throw RangeError(`${t} must be a non-negative safe integer`);
|
|
5307
|
+
}
|
|
5308
|
+
validateBufferSize(e) {
|
|
5309
|
+
if (this.validateLength(e, "buffer length"), e > this.maxBufferSize) throw new Xa(e, this.maxBufferSize);
|
|
5310
|
+
}
|
|
5311
|
+
validateTokenRead(e, t, n = !1) {
|
|
5312
|
+
if (this.validateBufferSize(e), this.validateLength(t, "position"), this.validateLength(t + e, "end position"), !this.supportsRandomAccess() && t < this.position) throw Error("`options.position` must be equal or greater than `tokenizer.position`");
|
|
5313
|
+
if (n && !this.supportsRandomAccess() && this.validateBufferSize(e + t - this.position), this.fileInfo.size !== void 0 && e > this.fileInfo.size - t) throw new H();
|
|
5271
5314
|
}
|
|
5272
5315
|
normalizeOptions(e, t) {
|
|
5273
|
-
|
|
5316
|
+
let n = t?.length ?? e.length, r = t?.position ?? this.position;
|
|
5317
|
+
if (this.validateLength(n, "length"), this.validateLength(r, "position"), this.validateLength(r + n, "end position"), n > e.length) throw RangeError("length must not exceed the target buffer length");
|
|
5318
|
+
if (!this.supportsRandomAccess() && r < this.position) throw Error("`options.position` must be equal or greater than `tokenizer.position`");
|
|
5274
5319
|
return {
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
position: this.position,
|
|
5279
|
-
...t
|
|
5320
|
+
length: n,
|
|
5321
|
+
position: r,
|
|
5322
|
+
mayBeLess: t?.mayBeLess ?? !1
|
|
5280
5323
|
};
|
|
5281
5324
|
}
|
|
5282
5325
|
abort() {
|
|
5283
|
-
return Promise.resolve();
|
|
5326
|
+
return this.removeAbortListener(), Promise.resolve();
|
|
5284
5327
|
}
|
|
5285
|
-
},
|
|
5328
|
+
}, io = class extends ro {
|
|
5286
5329
|
constructor(e, t) {
|
|
5287
|
-
super(t), this.
|
|
5330
|
+
super(t), this.blob = e, this.fileInfo = {
|
|
5331
|
+
...t?.fileInfo ?? {},
|
|
5332
|
+
size: e.size,
|
|
5333
|
+
mimeType: e.type
|
|
5334
|
+
};
|
|
5288
5335
|
}
|
|
5289
5336
|
async readBuffer(e, t) {
|
|
5290
|
-
let n = this.normalizeOptions(e, t), r =
|
|
5291
|
-
|
|
5292
|
-
if (r < 0) throw Error("`options.position` must be equal or greater than `tokenizer.position`");
|
|
5293
|
-
if (n.length === 0) return 0;
|
|
5294
|
-
let i = await this.streamReader.read(e.subarray(0, n.length), n.mayBeLess);
|
|
5295
|
-
if (this.position += i, (!t || !t.mayBeLess) && i < n.length) throw new V();
|
|
5296
|
-
return i;
|
|
5337
|
+
let n = this.normalizeOptions(e, t), r = await this.peekBuffer(e, n);
|
|
5338
|
+
return this.position = n.position + r, r;
|
|
5297
5339
|
}
|
|
5298
5340
|
async peekBuffer(e, t) {
|
|
5299
|
-
let n = this.normalizeOptions(e, t), r = 0;
|
|
5300
|
-
if (n.
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
return r = await this.peekBuffer(i, { mayBeLess: n.mayBeLess }), e.set(i.subarray(t)), r - t;
|
|
5305
|
-
}
|
|
5306
|
-
if (t < 0) throw Error("Cannot peek from a negative offset in a stream");
|
|
5307
|
-
}
|
|
5308
|
-
if (n.length > 0) {
|
|
5309
|
-
try {
|
|
5310
|
-
r = await this.streamReader.peek(e.subarray(0, n.length), n.mayBeLess);
|
|
5311
|
-
} catch (e) {
|
|
5312
|
-
if (t?.mayBeLess && e instanceof V) return 0;
|
|
5313
|
-
throw e;
|
|
5314
|
-
}
|
|
5315
|
-
if (!n.mayBeLess && r < n.length) throw new V();
|
|
5316
|
-
}
|
|
5317
|
-
return r;
|
|
5318
|
-
}
|
|
5319
|
-
async ignore(e) {
|
|
5320
|
-
if (e < 0) throw RangeError("ignore length must be ≥ 0 bytes");
|
|
5321
|
-
let t = Math.min(no, e), n = new Uint8Array(t), r = 0;
|
|
5322
|
-
for (; r < e;) {
|
|
5323
|
-
let i = e - r, a = await this.readBuffer(n, { length: Math.min(t, i) });
|
|
5324
|
-
if (a < 0) return a;
|
|
5325
|
-
r += a;
|
|
5341
|
+
let n = this.normalizeOptions(e, t), r = Math.max(0, Math.min(this.blob.size - n.position, n.length));
|
|
5342
|
+
if (!n.mayBeLess && r < n.length) throw new H();
|
|
5343
|
+
for (let t = 0; t < r;) {
|
|
5344
|
+
let i = Math.min(this.maxBufferSize, r - t), a = n.position + t, o = await this.blob.slice(a, a + i).arrayBuffer();
|
|
5345
|
+
e.set(new Uint8Array(o), t), t += i;
|
|
5326
5346
|
}
|
|
5327
5347
|
return r;
|
|
5328
5348
|
}
|
|
5329
|
-
|
|
5330
|
-
return
|
|
5331
|
-
}
|
|
5332
|
-
async close() {
|
|
5333
|
-
return this.streamReader.close();
|
|
5349
|
+
close() {
|
|
5350
|
+
return super.close();
|
|
5334
5351
|
}
|
|
5335
5352
|
supportsRandomAccess() {
|
|
5336
|
-
return !
|
|
5353
|
+
return !0;
|
|
5337
5354
|
}
|
|
5338
|
-
|
|
5355
|
+
setPosition(e) {
|
|
5356
|
+
this.position = e;
|
|
5357
|
+
}
|
|
5358
|
+
}, ao = class extends ro {
|
|
5339
5359
|
constructor(e, t) {
|
|
5340
5360
|
super(t), this.uint8Array = e, this.fileInfo = {
|
|
5341
5361
|
...t?.fileInfo ?? {},
|
|
@@ -5343,13 +5363,12 @@ var to = class {
|
|
|
5343
5363
|
};
|
|
5344
5364
|
}
|
|
5345
5365
|
async readBuffer(e, t) {
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
return this.position += n, n;
|
|
5366
|
+
let n = this.normalizeOptions(e, t), r = await this.peekBuffer(e, n);
|
|
5367
|
+
return this.position = n.position + r, r;
|
|
5349
5368
|
}
|
|
5350
5369
|
async peekBuffer(e, t) {
|
|
5351
|
-
let n = this.normalizeOptions(e, t), r = Math.min(this.uint8Array.length - n.position, n.length);
|
|
5352
|
-
if (!n.mayBeLess && r < n.length) throw new
|
|
5370
|
+
let n = this.normalizeOptions(e, t), r = Math.max(0, Math.min(this.uint8Array.length - n.position, n.length));
|
|
5371
|
+
if (!n.mayBeLess && r < n.length) throw new H();
|
|
5353
5372
|
return e.set(this.uint8Array.subarray(n.position, n.position + r)), r;
|
|
5354
5373
|
}
|
|
5355
5374
|
close() {
|
|
@@ -5361,52 +5380,101 @@ var to = class {
|
|
|
5361
5380
|
setPosition(e) {
|
|
5362
5381
|
this.position = e;
|
|
5363
5382
|
}
|
|
5364
|
-
},
|
|
5383
|
+
}, oo = 256e3, so = class extends ro {
|
|
5365
5384
|
constructor(e, t) {
|
|
5366
|
-
super(t), this.
|
|
5367
|
-
...t?.fileInfo ?? {},
|
|
5368
|
-
size: e.size,
|
|
5369
|
-
mimeType: e.type
|
|
5370
|
-
};
|
|
5385
|
+
super(t), this.streamReader = e, this.fileInfo = t?.fileInfo ?? {};
|
|
5371
5386
|
}
|
|
5372
5387
|
async readBuffer(e, t) {
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5388
|
+
let n = this.normalizeOptions(e, t), r = n.position - this.position;
|
|
5389
|
+
if (r > 0) return await this.ignore(r), this.readBuffer(e, t);
|
|
5390
|
+
if (r < 0) throw Error("`options.position` must be equal or greater than `tokenizer.position`");
|
|
5391
|
+
if (n.length === 0) return 0;
|
|
5392
|
+
let i = 0;
|
|
5393
|
+
for (; i < n.length;) {
|
|
5394
|
+
let t = Math.min(this.maxBufferSize, n.length - i), r = await this.streamReader.read(e.subarray(i, i + t), !0);
|
|
5395
|
+
if (i += r, this.position += r, r < t) break;
|
|
5396
|
+
}
|
|
5397
|
+
if (!n.mayBeLess && i < n.length) throw new H();
|
|
5398
|
+
return i;
|
|
5376
5399
|
}
|
|
5377
5400
|
async peekBuffer(e, t) {
|
|
5378
|
-
let n = this.normalizeOptions(e, t)
|
|
5379
|
-
if (
|
|
5380
|
-
let
|
|
5381
|
-
|
|
5401
|
+
let n = this.normalizeOptions(e, t);
|
|
5402
|
+
if (n.length === 0) return 0;
|
|
5403
|
+
let r = n.length + n.position - this.position;
|
|
5404
|
+
this.validateBufferSize(r);
|
|
5405
|
+
let i = 0;
|
|
5406
|
+
if (n.position) {
|
|
5407
|
+
let t = n.position - this.position;
|
|
5408
|
+
if (t > 0) {
|
|
5409
|
+
let r = new Uint8Array(n.length + t);
|
|
5410
|
+
i = await this.peekBuffer(r, { mayBeLess: n.mayBeLess });
|
|
5411
|
+
let a = Math.max(0, i - t);
|
|
5412
|
+
return e.set(r.subarray(t, t + a)), a;
|
|
5413
|
+
}
|
|
5414
|
+
if (t < 0) throw Error("Cannot peek from a negative offset in a stream");
|
|
5415
|
+
}
|
|
5416
|
+
if (n.length > 0) {
|
|
5417
|
+
try {
|
|
5418
|
+
let t = new Uint8Array(n.length);
|
|
5419
|
+
i = await this.streamReader.peek(t, !0), e.set(t.subarray(0, i));
|
|
5420
|
+
} catch (e) {
|
|
5421
|
+
if (t?.mayBeLess && e instanceof H) return 0;
|
|
5422
|
+
throw e;
|
|
5423
|
+
}
|
|
5424
|
+
if (!n.mayBeLess && i < n.length) throw new H();
|
|
5425
|
+
}
|
|
5426
|
+
return i;
|
|
5382
5427
|
}
|
|
5383
|
-
|
|
5384
|
-
|
|
5428
|
+
async ignore(e) {
|
|
5429
|
+
if (e < 0) throw RangeError("ignore length must be ≥ 0 bytes");
|
|
5430
|
+
this.validateLength(e, "ignore length"), this.validateLength(this.position + e, "end position");
|
|
5431
|
+
let t = Math.min(oo, this.maxBufferSize, e), n = new Uint8Array(t), r = 0;
|
|
5432
|
+
for (; r < e;) {
|
|
5433
|
+
let i = e - r, a = await this.readBuffer(n, { length: Math.min(t, i) });
|
|
5434
|
+
if (a < 0) return a;
|
|
5435
|
+
r += a;
|
|
5436
|
+
}
|
|
5437
|
+
return r;
|
|
5385
5438
|
}
|
|
5386
|
-
|
|
5387
|
-
return
|
|
5439
|
+
abort() {
|
|
5440
|
+
return this.removeAbortListener(), this.streamReader.abort();
|
|
5388
5441
|
}
|
|
5389
|
-
|
|
5390
|
-
this.
|
|
5442
|
+
async close() {
|
|
5443
|
+
return this.removeAbortListener(), this.streamReader.close();
|
|
5444
|
+
}
|
|
5445
|
+
supportsRandomAccess() {
|
|
5446
|
+
return !1;
|
|
5391
5447
|
}
|
|
5392
5448
|
};
|
|
5393
5449
|
//#endregion
|
|
5394
5450
|
//#region node_modules/strtok3/lib/core.js
|
|
5395
|
-
function oo(e, t) {
|
|
5396
|
-
let n = eo(e), r = t ?? {}, i = r.onClose;
|
|
5397
|
-
return r.onClose = async () => {
|
|
5398
|
-
if (await n.close(), i) return i();
|
|
5399
|
-
}, new ro(n, r);
|
|
5400
|
-
}
|
|
5401
|
-
function so(e, t) {
|
|
5402
|
-
return new io(e, t);
|
|
5403
|
-
}
|
|
5404
5451
|
function co(e, t) {
|
|
5452
|
+
return Za(t), Ya(t?.abortSignal), new so(no(e), t);
|
|
5453
|
+
}
|
|
5454
|
+
function lo(e, t) {
|
|
5405
5455
|
return new ao(e, t);
|
|
5406
5456
|
}
|
|
5457
|
+
function uo(e, t) {
|
|
5458
|
+
return new io(e, t);
|
|
5459
|
+
}
|
|
5407
5460
|
//#endregion
|
|
5408
|
-
//#region node_modules/
|
|
5409
|
-
var
|
|
5461
|
+
//#region node_modules/@tokenizer/inflate/lib/GzipHandler.js
|
|
5462
|
+
var fo = class {
|
|
5463
|
+
constructor(e) {
|
|
5464
|
+
this.tokenizer = e;
|
|
5465
|
+
}
|
|
5466
|
+
inflate() {
|
|
5467
|
+
let e = this.tokenizer;
|
|
5468
|
+
return new ReadableStream({ async pull(t) {
|
|
5469
|
+
let n = /* @__PURE__ */ new Uint8Array(1024), r = await e.readBuffer(n, { mayBeLess: !0 });
|
|
5470
|
+
if (r === 0) {
|
|
5471
|
+
t.close();
|
|
5472
|
+
return;
|
|
5473
|
+
}
|
|
5474
|
+
t.enqueue(n.subarray(0, r));
|
|
5475
|
+
} }).pipeThrough(new DecompressionStream("gzip"));
|
|
5476
|
+
}
|
|
5477
|
+
}, po = /* @__PURE__ */ o(((e, t) => {
|
|
5410
5478
|
var n = 1e3, r = n * 60, i = r * 60, a = i * 24, o = a * 7, s = a * 365.25;
|
|
5411
5479
|
t.exports = function(e, t) {
|
|
5412
5480
|
t ||= {};
|
|
@@ -5469,9 +5537,9 @@ var lo = /* @__PURE__ */ o(((e, t) => {
|
|
|
5469
5537
|
var i = t >= n * 1.5;
|
|
5470
5538
|
return Math.round(e / n) + " " + r + (i ? "s" : "");
|
|
5471
5539
|
}
|
|
5472
|
-
})),
|
|
5540
|
+
})), mo = /* @__PURE__ */ o(((e, t) => {
|
|
5473
5541
|
function n(e) {
|
|
5474
|
-
n.debug = n, n.default = n, n.coerce = c, n.disable = o, n.enable = i, n.enabled = s, n.humanize =
|
|
5542
|
+
n.debug = n, n.default = n, n.coerce = c, n.disable = o, n.enable = i, n.enabled = s, n.humanize = po(), n.destroy = l, Object.keys(e).forEach((t) => {
|
|
5475
5543
|
n[t] = e[t];
|
|
5476
5544
|
}), n.names = [], n.skips = [], n.formatters = {};
|
|
5477
5545
|
function t(e) {
|
|
@@ -5542,7 +5610,7 @@ var lo = /* @__PURE__ */ o(((e, t) => {
|
|
|
5542
5610
|
return n.enable(n.load()), n;
|
|
5543
5611
|
}
|
|
5544
5612
|
t.exports = n;
|
|
5545
|
-
})),
|
|
5613
|
+
})), ho = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
5546
5614
|
e.formatArgs = r, e.save = i, e.load = a, e.useColors = n, e.storage = o(), e.destroy = (() => {
|
|
5547
5615
|
let e = !1;
|
|
5548
5616
|
return () => {
|
|
@@ -5582,7 +5650,7 @@ var lo = /* @__PURE__ */ o(((e, t) => {
|
|
|
5582
5650
|
return localStorage;
|
|
5583
5651
|
} catch {}
|
|
5584
5652
|
}
|
|
5585
|
-
t.exports =
|
|
5653
|
+
t.exports = mo()(e);
|
|
5586
5654
|
var { formatters: s } = t.exports;
|
|
5587
5655
|
s.j = function(e) {
|
|
5588
5656
|
try {
|
|
@@ -5591,64 +5659,68 @@ var lo = /* @__PURE__ */ o(((e, t) => {
|
|
|
5591
5659
|
return "[UnexpectedJSONParseError]: " + e.message;
|
|
5592
5660
|
}
|
|
5593
5661
|
};
|
|
5594
|
-
})))(), 1),
|
|
5662
|
+
})))(), 1), go = class extends RangeError {
|
|
5663
|
+
constructor(e, t, n) {
|
|
5664
|
+
super(`ZIP ${e} exceeded: ${t} bytes exceeds limit of ${n} bytes`), this.limit = e, this.requestedSize = t, this.maxSize = n, this.name = "ZipLimitError";
|
|
5665
|
+
}
|
|
5666
|
+
}, _o = {
|
|
5595
5667
|
LocalFileHeader: 67324752,
|
|
5596
5668
|
DataDescriptor: 134695760,
|
|
5597
5669
|
CentralFileHeader: 33639248,
|
|
5598
5670
|
EndOfCentralDirectory: 101010256
|
|
5599
|
-
},
|
|
5671
|
+
}, vo = {
|
|
5600
5672
|
get(e) {
|
|
5601
5673
|
return {
|
|
5602
|
-
signature:
|
|
5603
|
-
compressedSize:
|
|
5604
|
-
uncompressedSize:
|
|
5674
|
+
signature: B.get(e, 0),
|
|
5675
|
+
compressedSize: B.get(e, 8),
|
|
5676
|
+
uncompressedSize: B.get(e, 12)
|
|
5605
5677
|
};
|
|
5606
5678
|
},
|
|
5607
5679
|
len: 16
|
|
5608
|
-
},
|
|
5680
|
+
}, yo = {
|
|
5609
5681
|
get(e) {
|
|
5610
|
-
let t =
|
|
5682
|
+
let t = z.get(e, 6);
|
|
5611
5683
|
return {
|
|
5612
|
-
signature:
|
|
5613
|
-
minVersion:
|
|
5684
|
+
signature: B.get(e, 0),
|
|
5685
|
+
minVersion: z.get(e, 4),
|
|
5614
5686
|
dataDescriptor: !!(t & 8),
|
|
5615
|
-
compressedMethod:
|
|
5616
|
-
compressedSize:
|
|
5617
|
-
uncompressedSize:
|
|
5618
|
-
filenameLength:
|
|
5619
|
-
extraFieldLength:
|
|
5687
|
+
compressedMethod: z.get(e, 8),
|
|
5688
|
+
compressedSize: B.get(e, 18),
|
|
5689
|
+
uncompressedSize: B.get(e, 22),
|
|
5690
|
+
filenameLength: z.get(e, 26),
|
|
5691
|
+
extraFieldLength: z.get(e, 28),
|
|
5620
5692
|
filename: null
|
|
5621
5693
|
};
|
|
5622
5694
|
},
|
|
5623
5695
|
len: 30
|
|
5624
|
-
},
|
|
5696
|
+
}, bo = {
|
|
5625
5697
|
get(e) {
|
|
5626
5698
|
return {
|
|
5627
|
-
signature:
|
|
5628
|
-
nrOfThisDisk:
|
|
5629
|
-
nrOfThisDiskWithTheStart:
|
|
5630
|
-
nrOfEntriesOnThisDisk:
|
|
5631
|
-
nrOfEntriesOfSize:
|
|
5632
|
-
sizeOfCd:
|
|
5633
|
-
offsetOfStartOfCd:
|
|
5634
|
-
zipFileCommentLength:
|
|
5699
|
+
signature: B.get(e, 0),
|
|
5700
|
+
nrOfThisDisk: z.get(e, 4),
|
|
5701
|
+
nrOfThisDiskWithTheStart: z.get(e, 6),
|
|
5702
|
+
nrOfEntriesOnThisDisk: z.get(e, 8),
|
|
5703
|
+
nrOfEntriesOfSize: z.get(e, 10),
|
|
5704
|
+
sizeOfCd: B.get(e, 12),
|
|
5705
|
+
offsetOfStartOfCd: B.get(e, 16),
|
|
5706
|
+
zipFileCommentLength: z.get(e, 20)
|
|
5635
5707
|
};
|
|
5636
5708
|
},
|
|
5637
5709
|
len: 22
|
|
5638
|
-
},
|
|
5710
|
+
}, xo = {
|
|
5639
5711
|
get(e) {
|
|
5640
|
-
let t =
|
|
5712
|
+
let t = z.get(e, 8);
|
|
5641
5713
|
return {
|
|
5642
|
-
signature:
|
|
5643
|
-
minVersion:
|
|
5714
|
+
signature: B.get(e, 0),
|
|
5715
|
+
minVersion: z.get(e, 6),
|
|
5644
5716
|
dataDescriptor: !!(t & 8),
|
|
5645
|
-
compressedMethod:
|
|
5646
|
-
compressedSize:
|
|
5647
|
-
uncompressedSize:
|
|
5648
|
-
filenameLength:
|
|
5649
|
-
extraFieldLength:
|
|
5650
|
-
fileCommentLength:
|
|
5651
|
-
relativeOffsetOfLocalHeader:
|
|
5717
|
+
compressedMethod: z.get(e, 10),
|
|
5718
|
+
compressedSize: B.get(e, 20),
|
|
5719
|
+
uncompressedSize: B.get(e, 24),
|
|
5720
|
+
filenameLength: z.get(e, 28),
|
|
5721
|
+
extraFieldLength: z.get(e, 30),
|
|
5722
|
+
fileCommentLength: z.get(e, 32),
|
|
5723
|
+
relativeOffsetOfLocalHeader: B.get(e, 42),
|
|
5652
5724
|
filename: null
|
|
5653
5725
|
};
|
|
5654
5726
|
},
|
|
@@ -5656,41 +5728,52 @@ var lo = /* @__PURE__ */ o(((e, t) => {
|
|
|
5656
5728
|
};
|
|
5657
5729
|
//#endregion
|
|
5658
5730
|
//#region node_modules/@tokenizer/inflate/lib/ZipHandler.js
|
|
5659
|
-
function
|
|
5660
|
-
let t = new Uint8Array(
|
|
5661
|
-
return
|
|
5731
|
+
function So(e) {
|
|
5732
|
+
let t = new Uint8Array(B.len);
|
|
5733
|
+
return B.put(t, 0, e), t;
|
|
5662
5734
|
}
|
|
5663
|
-
var
|
|
5664
|
-
constructor(e) {
|
|
5665
|
-
this.tokenizer = e, this.syncBuffer = new Uint8Array(
|
|
5735
|
+
var U = (0, ho.default)("tokenizer:inflate"), Co = 262144, wo = So(_o.DataDescriptor), To = So(_o.EndOfCentralDirectory), Eo = class {
|
|
5736
|
+
constructor(e, t = {}) {
|
|
5737
|
+
this.tokenizer = e, this.syncBuffer = new Uint8Array(Co), this.limits = {
|
|
5738
|
+
maxDataDescriptorScanBytes: t.maxDataDescriptorScanBytes ?? Infinity,
|
|
5739
|
+
maxCompressedSize: t.maxCompressedSize ?? Infinity,
|
|
5740
|
+
maxUncompressedSize: t.maxUncompressedSize ?? Infinity
|
|
5741
|
+
};
|
|
5742
|
+
for (let [e, t] of Object.entries(this.limits)) if (t !== Infinity && (!Number.isSafeInteger(t) || t <= 0)) throw RangeError(`${e} must be a positive safe integer or Infinity`);
|
|
5743
|
+
}
|
|
5744
|
+
checkLimit(e, t) {
|
|
5745
|
+
if (t > this.limits[e]) throw new go(e, t, this.limits[e]);
|
|
5746
|
+
}
|
|
5747
|
+
checkEntrySize(e) {
|
|
5748
|
+
this.checkLimit("maxCompressedSize", e.compressedSize), this.checkLimit("maxUncompressedSize", e.uncompressedSize), e.compressedMethod === 0 && this.checkLimit("maxUncompressedSize", e.compressedSize);
|
|
5666
5749
|
}
|
|
5667
5750
|
async isZip() {
|
|
5668
|
-
return await this.peekSignature() ===
|
|
5751
|
+
return await this.peekSignature() === _o.LocalFileHeader;
|
|
5669
5752
|
}
|
|
5670
5753
|
peekSignature() {
|
|
5671
|
-
return this.tokenizer.peekToken(
|
|
5754
|
+
return this.tokenizer.peekToken(B);
|
|
5672
5755
|
}
|
|
5673
5756
|
async findEndOfCentralDirectoryLocator() {
|
|
5674
5757
|
let e = this.tokenizer, t = Math.min(16384, e.fileInfo.size), n = this.syncBuffer.subarray(0, t);
|
|
5675
5758
|
await this.tokenizer.readBuffer(n, { position: e.fileInfo.size - t });
|
|
5676
|
-
for (let r = n.length - 4; r >= 0; r--) if (n[r] ===
|
|
5759
|
+
for (let r = n.length - 4; r >= 0; r--) if (n[r] === To[0] && n[r + 1] === To[1] && n[r + 2] === To[2] && n[r + 3] === To[3]) return e.fileInfo.size - t + r;
|
|
5677
5760
|
return -1;
|
|
5678
5761
|
}
|
|
5679
5762
|
async readCentralDirectory() {
|
|
5680
5763
|
if (!this.tokenizer.supportsRandomAccess()) {
|
|
5681
|
-
|
|
5764
|
+
U("Cannot reading central-directory without random-read support");
|
|
5682
5765
|
return;
|
|
5683
5766
|
}
|
|
5684
|
-
|
|
5767
|
+
U("Reading central-directory...");
|
|
5685
5768
|
let e = this.tokenizer.position, t = await this.findEndOfCentralDirectoryLocator();
|
|
5686
5769
|
if (t > 0) {
|
|
5687
|
-
|
|
5688
|
-
let n = await this.tokenizer.readToken(
|
|
5770
|
+
U("Central-directory 32-bit signature found");
|
|
5771
|
+
let n = await this.tokenizer.readToken(bo, t), r = [];
|
|
5689
5772
|
this.tokenizer.setPosition(n.offsetOfStartOfCd);
|
|
5690
5773
|
for (let e = 0; e < n.nrOfEntriesOfSize; ++e) {
|
|
5691
|
-
let t = await this.tokenizer.readToken(
|
|
5692
|
-
if (t.signature !==
|
|
5693
|
-
t.filename = await this.tokenizer.readToken(new
|
|
5774
|
+
let t = await this.tokenizer.readToken(xo);
|
|
5775
|
+
if (t.signature !== _o.CentralFileHeader) throw Error("Expected Central-File-Header signature");
|
|
5776
|
+
t.filename = await this.tokenizer.readToken(new V(t.filenameLength, "utf-8")), await this.tokenizer.ignore(t.extraFieldLength), await this.tokenizer.ignore(t.fileCommentLength), r.push(t), U(`Add central-directory file-entry: n=${e + 1}/${r.length}: filename=${r[e].filename}`);
|
|
5694
5777
|
}
|
|
5695
5778
|
return this.tokenizer.setPosition(e), r;
|
|
5696
5779
|
}
|
|
@@ -5706,21 +5789,23 @@ var H = (0, fo.default)("tokenizer:inflate"), yo = 262144, bo = vo(po.DataDescri
|
|
|
5706
5789
|
let r = e(t);
|
|
5707
5790
|
n = !!r.stop;
|
|
5708
5791
|
let i;
|
|
5709
|
-
if (await this.tokenizer.ignore(t.extraFieldLength), t.dataDescriptor && t.compressedSize === 0) {
|
|
5710
|
-
let e = [], n =
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5792
|
+
if (await this.tokenizer.ignore(t.extraFieldLength), r.handler && this.checkEntrySize(t), t.dataDescriptor && t.compressedSize === 0) {
|
|
5793
|
+
let e = [], n = 0, i = Math.min(this.limits.maxDataDescriptorScanBytes, r.handler ? this.limits.maxCompressedSize : Infinity, r.handler && t.compressedMethod === 0 ? this.limits.maxUncompressedSize : Infinity);
|
|
5794
|
+
for (U("Compressed-file-size unknown, scanning for next data-descriptor-signature....");;) {
|
|
5795
|
+
let a = Math.min(Co, i - n + wo.length), o = await this.tokenizer.peekBuffer(this.syncBuffer.subarray(0, a), { mayBeLess: !0 }), s = Do(this.syncBuffer.subarray(0, o), wo);
|
|
5796
|
+
if (s < 0 && o < wo.length) throw Error("Expected data-descriptor-signature before end of input");
|
|
5797
|
+
let c = s >= 0 ? s : o - wo.length + 1;
|
|
5798
|
+
if (this.checkLimit("maxDataDescriptorScanBytes", n + c), r.handler) {
|
|
5799
|
+
if (this.checkLimit("maxCompressedSize", n + c), t.compressedMethod === 0 && this.checkLimit("maxUncompressedSize", n + c), c > 0) {
|
|
5800
|
+
let t = new Uint8Array(c);
|
|
5801
|
+
await this.tokenizer.readBuffer(t), e.push(t);
|
|
5802
|
+
}
|
|
5803
|
+
} else await this.tokenizer.ignore(c);
|
|
5804
|
+
if (n += c, s >= 0) break;
|
|
5720
5805
|
}
|
|
5721
|
-
|
|
5722
|
-
} else r.handler ? (
|
|
5723
|
-
if (
|
|
5806
|
+
U(`Found data-descriptor-signature at pos=${this.tokenizer.position}`), r.handler && (this.checkLimit("maxCompressedSize", n), await this.inflate(t, Oo(e), r.handler));
|
|
5807
|
+
} else r.handler ? (U(`Reading compressed-file-data: ${t.compressedSize} bytes`), i = new Uint8Array(t.compressedSize), await this.tokenizer.readBuffer(i), await this.inflate(t, i, r.handler)) : (U(`Ignoring compressed-file-data: ${t.compressedSize} bytes`), await this.tokenizer.ignore(t.compressedSize));
|
|
5808
|
+
if (U(`Reading data-descriptor at pos=${this.tokenizer.position}`), t.dataDescriptor && (await this.tokenizer.readToken(vo)).signature !== 134695760) throw Error(`Expected data-descriptor-signature at position ${this.tokenizer.position - vo.len}`);
|
|
5724
5809
|
} while (!n);
|
|
5725
5810
|
}
|
|
5726
5811
|
async iterateOverCentralDirectory(e, t) {
|
|
@@ -5730,7 +5815,7 @@ var H = (0, fo.default)("tokenizer:inflate"), yo = 262144, bo = vo(po.DataDescri
|
|
|
5730
5815
|
this.tokenizer.setPosition(n.relativeOffsetOfLocalHeader);
|
|
5731
5816
|
let t = await this.readLocalFileHeader();
|
|
5732
5817
|
if (t) {
|
|
5733
|
-
await this.tokenizer.ignore(t.extraFieldLength);
|
|
5818
|
+
await this.tokenizer.ignore(t.extraFieldLength), this.checkEntrySize(n), this.checkEntrySize(t);
|
|
5734
5819
|
let r = new Uint8Array(n.compressedSize);
|
|
5735
5820
|
await this.tokenizer.readBuffer(r), await this.inflate(t, r, e.handler);
|
|
5736
5821
|
}
|
|
@@ -5738,34 +5823,42 @@ var H = (0, fo.default)("tokenizer:inflate"), yo = 262144, bo = vo(po.DataDescri
|
|
|
5738
5823
|
if (e.stop) break;
|
|
5739
5824
|
}
|
|
5740
5825
|
}
|
|
5741
|
-
async inflate(t, n
|
|
5742
|
-
if (
|
|
5743
|
-
if (
|
|
5744
|
-
return
|
|
5826
|
+
async inflate(e, t, n) {
|
|
5827
|
+
if (e.compressedMethod === 0) return this.checkLimit("maxUncompressedSize", t.length), n(t);
|
|
5828
|
+
if (e.compressedMethod !== 8) throw Error(`Unsupported ZIP compression method: ${e.compressedMethod}`);
|
|
5829
|
+
return U(`Decompress filename=${e.filename}, compressed-size=${t.length}`), n(await this.decompressDeflateRaw(t));
|
|
5745
5830
|
}
|
|
5746
|
-
|
|
5831
|
+
async decompressDeflateRaw(e) {
|
|
5747
5832
|
let t = new ReadableStream({ start(t) {
|
|
5748
5833
|
t.enqueue(e), t.close();
|
|
5749
|
-
} }), n = new DecompressionStream("deflate-raw"), r = t.pipeThrough(n);
|
|
5834
|
+
} }), n = new DecompressionStream("deflate-raw"), r = t.pipeThrough(n).getReader(), i = [], a = 0;
|
|
5750
5835
|
try {
|
|
5751
|
-
|
|
5752
|
-
|
|
5836
|
+
for (;;) {
|
|
5837
|
+
let { done: e, value: t } = await r.read();
|
|
5838
|
+
if (e) break;
|
|
5839
|
+
this.checkLimit("maxUncompressedSize", a + t.length), a += t.length, i.push(t);
|
|
5840
|
+
}
|
|
5841
|
+
return this.checkLimit("maxUncompressedSize", a), Oo(i);
|
|
5753
5842
|
} catch (e) {
|
|
5843
|
+
if (await r.cancel(e).catch(() => {}), e instanceof go) throw e;
|
|
5844
|
+
if (e instanceof Error && "code" in e && e.code === "ERR_TRAILING_JUNK_AFTER_STREAM_END") return Oo(i);
|
|
5754
5845
|
let t = e instanceof Error ? `Failed to deflate ZIP entry: ${e.message}` : "Unknown decompression error in ZIP entry";
|
|
5755
5846
|
throw TypeError(t);
|
|
5847
|
+
} finally {
|
|
5848
|
+
r.releaseLock();
|
|
5756
5849
|
}
|
|
5757
5850
|
}
|
|
5758
5851
|
async readLocalFileHeader() {
|
|
5759
|
-
let e = await this.tokenizer.peekToken(
|
|
5760
|
-
if (e ===
|
|
5761
|
-
let e = await this.tokenizer.readToken(
|
|
5762
|
-
return e.filename = await this.tokenizer.readToken(new
|
|
5852
|
+
let e = await this.tokenizer.peekToken(B);
|
|
5853
|
+
if (e === _o.LocalFileHeader) {
|
|
5854
|
+
let e = await this.tokenizer.readToken(yo);
|
|
5855
|
+
return e.filename = await this.tokenizer.readToken(new V(e.filenameLength, "utf-8")), e;
|
|
5763
5856
|
}
|
|
5764
|
-
if (e ===
|
|
5857
|
+
if (e === _o.CentralFileHeader) return !1;
|
|
5765
5858
|
throw Error(e === 3759263696 ? "Encrypted ZIP" : "Unexpected signature");
|
|
5766
5859
|
}
|
|
5767
5860
|
};
|
|
5768
|
-
function
|
|
5861
|
+
function Do(e, t) {
|
|
5769
5862
|
let n = e.length, r = t.length;
|
|
5770
5863
|
if (r > n) return -1;
|
|
5771
5864
|
for (let i = 0; i <= n - r; i++) {
|
|
@@ -5778,47 +5871,41 @@ function Co(e, t) {
|
|
|
5778
5871
|
}
|
|
5779
5872
|
return -1;
|
|
5780
5873
|
}
|
|
5781
|
-
function
|
|
5874
|
+
function Oo(e) {
|
|
5782
5875
|
let t = e.reduce((e, t) => e + t.length, 0), n = new Uint8Array(t), r = 0;
|
|
5783
5876
|
for (let t of e) n.set(t, r), r += t.length;
|
|
5784
5877
|
return n;
|
|
5785
5878
|
}
|
|
5786
5879
|
//#endregion
|
|
5787
|
-
//#region node_modules
|
|
5788
|
-
var
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
t.close();
|
|
5798
|
-
return;
|
|
5799
|
-
}
|
|
5800
|
-
t.enqueue(n.subarray(0, r));
|
|
5801
|
-
} }).pipeThrough(new DecompressionStream("gzip"));
|
|
5802
|
-
}
|
|
5803
|
-
}, Eo = Object.prototype.toString, Do = "[object Uint8Array]";
|
|
5804
|
-
function Oo(e, t, n) {
|
|
5805
|
-
return e ? e.constructor === t || Eo.call(e) === n : !1;
|
|
5880
|
+
//#region node_modules/uint8array-extras/index.js
|
|
5881
|
+
var ko = Object.prototype.toString, Ao = "[object Uint8Array]", jo = "[object ArrayBuffer]";
|
|
5882
|
+
function Mo(e, t, n) {
|
|
5883
|
+
return e ? e.constructor === t || ko.call(e) === n : !1;
|
|
5884
|
+
}
|
|
5885
|
+
function No(e) {
|
|
5886
|
+
return Mo(e, Uint8Array, Ao);
|
|
5887
|
+
}
|
|
5888
|
+
function Po(e) {
|
|
5889
|
+
return Mo(e, ArrayBuffer, jo);
|
|
5806
5890
|
}
|
|
5807
|
-
function
|
|
5808
|
-
return
|
|
5891
|
+
function Fo(e) {
|
|
5892
|
+
return No(e) || Po(e);
|
|
5809
5893
|
}
|
|
5810
|
-
function
|
|
5811
|
-
|
|
5894
|
+
function Io(e) {
|
|
5895
|
+
return Po(e) ? new Uint8Array(e) : e;
|
|
5812
5896
|
}
|
|
5813
|
-
function
|
|
5897
|
+
function Lo(e) {
|
|
5898
|
+
if (!Fo(e)) throw TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``);
|
|
5899
|
+
}
|
|
5900
|
+
function Ro(e, t) {
|
|
5814
5901
|
if (e.length === 0) return /* @__PURE__ */ new Uint8Array();
|
|
5815
|
-
t ??= e.reduce((e, t) => e + t.
|
|
5902
|
+
t ??= e.reduce((e, t) => e + t.byteLength, 0);
|
|
5816
5903
|
let n = new Uint8Array(t), r = 0;
|
|
5817
|
-
for (let t of e)
|
|
5904
|
+
for (let t of e) Lo(t), t = Io(t), n.set(t, r), r += t.length;
|
|
5818
5905
|
return n;
|
|
5819
5906
|
}
|
|
5820
5907
|
new globalThis.TextDecoder("utf8"), new globalThis.TextEncoder(), Array.from({ length: 256 }, (e, t) => t.toString(16).padStart(2, "0"));
|
|
5821
|
-
function
|
|
5908
|
+
function zo(e) {
|
|
5822
5909
|
let { byteLength: t } = e;
|
|
5823
5910
|
if (t === 6) return e.getUint16(0) * 2 ** 32 + e.getUint32(2);
|
|
5824
5911
|
if (t === 5) return e.getUint8(0) * 2 ** 32 + e.getUint32(1);
|
|
@@ -5829,7 +5916,7 @@ function Mo(e) {
|
|
|
5829
5916
|
}
|
|
5830
5917
|
//#endregion
|
|
5831
5918
|
//#region node_modules/file-type/source/tokens.js
|
|
5832
|
-
function
|
|
5919
|
+
function Bo(e, t) {
|
|
5833
5920
|
if (t === "utf-16le") {
|
|
5834
5921
|
let t = [];
|
|
5835
5922
|
for (let n = 0; n < e.length; n++) {
|
|
@@ -5848,34 +5935,34 @@ function No(e, t) {
|
|
|
5848
5935
|
}
|
|
5849
5936
|
return [...e].map((e) => e.charCodeAt(0));
|
|
5850
5937
|
}
|
|
5851
|
-
function
|
|
5852
|
-
let n = Number.parseInt(new
|
|
5938
|
+
function Vo(e, t = 0) {
|
|
5939
|
+
let n = Number.parseInt(new V(6).get(e, 148), 8);
|
|
5853
5940
|
if (Number.isNaN(n)) return !1;
|
|
5854
5941
|
let r = 256;
|
|
5855
5942
|
for (let n = t; n < t + 148; n++) r += e[n];
|
|
5856
5943
|
for (let n = t + 156; n < t + 512; n++) r += e[n];
|
|
5857
5944
|
return n === r;
|
|
5858
5945
|
}
|
|
5859
|
-
var
|
|
5946
|
+
var Ho = {
|
|
5860
5947
|
get: (e, t) => e[t + 3] & 127 | (e[t + 2] & 127) << 7 | (e[t + 1] & 127) << 14 | (e[t] & 127) << 21,
|
|
5861
5948
|
len: 4
|
|
5862
|
-
},
|
|
5863
|
-
function
|
|
5864
|
-
if (!Number.isFinite(e) || e < 0 || e > t) throw new
|
|
5949
|
+
}, Uo = /* @__PURE__ */ "jpg,png,apng,gif,webp,flif,xcf,cr2,cr3,orf,arw,dng,nef,rw2,raf,tif,bmp,icns,jxr,psd,indd,zip,tar,rar,gz,bz2,7z,dmg,mp4,mid,mkv,webm,mov,avi,mpg,mp2,mp3,m4a,oga,ogg,ogv,opus,flac,wav,spx,amr,pdf,epub,elf,macho,exe,swf,rtf,wasm,woff,woff2,eot,ttf,otf,ttc,ico,flv,ps,xz,sqlite,nes,crx,xpi,cab,deb,ar,rpm,Z,lz,cfb,mxf,mts,blend,bpg,docx,pptx,xlsx,3gp,3g2,j2c,jp2,jpm,jpx,mj2,aif,caf,qcp,odt,ods,odp,xml,mobi,heic,cur,ktx,ape,wv,dcm,ics,glb,pcap,dsf,dff,lnk,alias,voc,ac3,m4v,m4p,m4b,f4v,f4p,f4b,f4a,mie,asf,ogm,ogx,mpc,arrow,shp,aac,mp1,it,s3m,xm,skp,avif,eps,lzh,pgp,asar,stl,chm,3mf,zst,jxl,vcf,jls,pst,dwg,parquet,class,arj,cpio,ace,avro,icc,fbx,vsdx,vtt,apk,drc,lz4,potx,xltx,dotx,xltm,ott,ots,otp,odg,otg,xlsm,docm,dotm,potm,pptm,jar,jmp,rm,sav,ppsm,ppsx,tar.gz,reg,dat,key,numbers,pages,iso".split(","), Wo = /* @__PURE__ */ "image/jpeg,image/png,image/gif,image/webp,image/flif,image/x-xcf,image/x-canon-cr2,image/x-canon-cr3,image/tiff,image/bmp,image/vnd.ms-photo,image/vnd.adobe.photoshop,application/x-indesign,application/epub+zip,application/x-xpinstall,application/vnd.ms-powerpoint.slideshow.macroenabled.12,application/vnd.oasis.opendocument.text,application/vnd.oasis.opendocument.spreadsheet,application/vnd.oasis.opendocument.presentation,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.presentationml.slideshow,application/zip,application/x-tar,application/x-rar-compressed,application/gzip,application/x-bzip2,application/x-7z-compressed,application/x-apple-diskimage,application/vnd.apache.arrow.file,video/mp4,audio/midi,video/matroska,video/webm,video/quicktime,video/vnd.avi,audio/wav,audio/qcelp,audio/x-ms-asf,video/x-ms-asf,application/vnd.ms-asf,video/mpeg,video/3gpp,audio/mpeg,audio/mp4,video/ogg,audio/ogg,audio/ogg; codecs=opus,application/ogg,audio/flac,audio/ape,audio/wavpack,audio/amr,application/pdf,application/x-elf,application/x-mach-binary,application/x-msdownload,application/x-shockwave-flash,application/rtf,application/wasm,font/woff,font/woff2,application/vnd.ms-fontobject,font/ttf,font/otf,font/collection,image/x-icon,video/x-flv,application/postscript,application/eps,application/x-xz,application/x-sqlite3,application/x-nintendo-nes-rom,application/x-google-chrome-extension,application/vnd.ms-cab-compressed,application/x-deb,application/x-unix-archive,application/x-rpm,application/x-compress,application/lzip,application/x-cfb,application/x-mie,application/mxf,video/mp2t,application/x-blender,image/bpg,image/j2c,image/jp2,image/jpx,image/jpm,image/mj2,audio/aiff,audio/x-caf,application/xml,application/x-mobipocket-ebook,image/heif,image/heif-sequence,image/heic,image/heic-sequence,image/icns,image/ktx,application/dicom,audio/x-musepack,text/calendar,text/vcard,text/vtt,model/gltf-binary,application/vnd.tcpdump.pcap,audio/x-dsf,audio/x-dff,application/x-ms-shortcut,application/x-ft-apple.alias,audio/x-voc,audio/vnd.dolby.dd-raw,audio/x-m4a,image/apng,image/x-olympus-orf,image/x-sony-arw,image/x-adobe-dng,image/x-nikon-nef,image/x-panasonic-rw2,image/x-fujifilm-raf,video/x-m4v,video/3gpp2,application/x-esri-shape,audio/aac,audio/x-it,audio/x-s3m,audio/x-xm,video/MP1S,video/MP2P,application/vnd.sketchup.skp,image/avif,application/x-lzh-compressed,application/pgp-encrypted,application/x-asar,model/stl,application/vnd.ms-htmlhelp,model/3mf,image/jxl,application/zstd,image/jls,application/vnd.ms-outlook,image/vnd.dwg,application/vnd.apache.parquet,application/java-vm,application/x-arj,application/x-cpio,application/x-ace-compressed,application/avro,application/vnd.iccprofile,application/x-ft-fbx,application/vnd.visio,application/vnd.android.package-archive,application/x-ft-draco,application/x-lz4,application/vnd.openxmlformats-officedocument.presentationml.template,application/vnd.openxmlformats-officedocument.spreadsheetml.template,application/vnd.openxmlformats-officedocument.wordprocessingml.template,application/vnd.ms-excel.template.macroenabled.12,application/vnd.oasis.opendocument.text-template,application/vnd.oasis.opendocument.spreadsheet-template,application/vnd.oasis.opendocument.presentation-template,application/vnd.oasis.opendocument.graphics,application/vnd.oasis.opendocument.graphics-template,application/vnd.ms-excel.sheet.macroenabled.12,application/vnd.ms-word.document.macroenabled.12,application/vnd.ms-word.template.macroenabled.12,application/vnd.ms-powerpoint.template.macroenabled.12,application/vnd.ms-powerpoint.presentation.macroenabled.12,application/java-archive,application/vnd.rn-realmedia,application/x-spss-sav,application/x-ms-regedit,application/x-ft-windows-registry-hive,application/x-jmp-data,application/vnd.apple.keynote,application/vnd.apple.numbers,application/vnd.apple.pages,application/x-iso9660-image".split(","), W = 16777216, G = class extends Error {};
|
|
5950
|
+
function Go(e, t, n) {
|
|
5951
|
+
if (!Number.isFinite(e) || e < 0 || e > t) throw new G(`${n} has invalid size ${e} (maximum ${t} bytes)`);
|
|
5865
5952
|
return e;
|
|
5866
5953
|
}
|
|
5867
|
-
async function
|
|
5868
|
-
let i =
|
|
5954
|
+
async function K(e, t, { maximumLength: n = W, reason: r = "skip" } = {}) {
|
|
5955
|
+
let i = Go(t, n, r);
|
|
5869
5956
|
await e.ignore(i);
|
|
5870
5957
|
}
|
|
5871
|
-
async function
|
|
5872
|
-
let a =
|
|
5958
|
+
async function Ko(e, t, n, { maximumLength: r = t.length, reason: i = "read" } = {}) {
|
|
5959
|
+
let a = Go(n?.length ?? t.length, r, i);
|
|
5873
5960
|
return e.readBuffer(t, {
|
|
5874
5961
|
...n,
|
|
5875
5962
|
length: a
|
|
5876
5963
|
});
|
|
5877
5964
|
}
|
|
5878
|
-
function
|
|
5965
|
+
function q(e, t, n) {
|
|
5879
5966
|
n = {
|
|
5880
5967
|
offset: 0,
|
|
5881
5968
|
...n
|
|
@@ -5885,72 +5972,52 @@ function K(e, t, n) {
|
|
|
5885
5972
|
} else if (i !== e[r + n.offset]) return !1;
|
|
5886
5973
|
return !0;
|
|
5887
5974
|
}
|
|
5888
|
-
function
|
|
5975
|
+
function J(e) {
|
|
5889
5976
|
let t = e.fileInfo.size;
|
|
5890
5977
|
return !Number.isFinite(t) || t === 2 ** 53 - 1;
|
|
5891
5978
|
}
|
|
5892
|
-
function
|
|
5893
|
-
return
|
|
5979
|
+
function qo(e, t, n) {
|
|
5980
|
+
return J(e) && e.position - t > n;
|
|
5894
5981
|
}
|
|
5895
5982
|
//#endregion
|
|
5896
5983
|
//#region node_modules/file-type/source/detectors/zip.js
|
|
5897
|
-
var
|
|
5984
|
+
var Jo = 1048576, Yo = 1024, Xo = 2 ** 31 - 1, Zo = Jo, Qo = /* @__PURE__ */ new Set([
|
|
5898
5985
|
"Unexpected signature",
|
|
5899
5986
|
"Encrypted ZIP",
|
|
5900
5987
|
"Expected Central-File-Header signature"
|
|
5901
|
-
]),
|
|
5988
|
+
]), $o = [
|
|
5902
5989
|
"ZIP entry count exceeds ",
|
|
5903
5990
|
"Unsupported ZIP compression method:",
|
|
5904
5991
|
"ZIP entry compressed data exceeds ",
|
|
5905
5992
|
"ZIP entry decompressed data exceeds ",
|
|
5906
5993
|
"Expected data-descriptor-signature at position "
|
|
5907
|
-
],
|
|
5994
|
+
], es = /* @__PURE__ */ new Set([
|
|
5908
5995
|
"Z_BUF_ERROR",
|
|
5909
5996
|
"Z_DATA_ERROR",
|
|
5910
5997
|
"ERR_INVALID_STATE"
|
|
5911
5998
|
]);
|
|
5912
|
-
|
|
5913
|
-
let n = new ReadableStream({ start(t) {
|
|
5914
|
-
t.enqueue(e), t.close();
|
|
5915
|
-
} }).pipeThrough(new DecompressionStream("deflate-raw")).getReader(), r = [], i = 0;
|
|
5916
|
-
try {
|
|
5917
|
-
for (;;) {
|
|
5918
|
-
let { done: e, value: a } = await n.read();
|
|
5919
|
-
if (e) break;
|
|
5920
|
-
if (i += a.length, i > t) throw await n.cancel().catch(() => {}), Error(`ZIP entry decompressed data exceeds ${t} bytes`);
|
|
5921
|
-
r.push(a);
|
|
5922
|
-
}
|
|
5923
|
-
} catch (e) {
|
|
5924
|
-
if (e.code !== "ERR_TRAILING_JUNK_AFTER_STREAM_END") throw e;
|
|
5925
|
-
} finally {
|
|
5926
|
-
n.releaseLock();
|
|
5927
|
-
}
|
|
5928
|
-
let a = new Uint8Array(i), o = 0;
|
|
5929
|
-
for (let e of r) a.set(e, o), o += e.length;
|
|
5930
|
-
return a;
|
|
5931
|
-
}
|
|
5932
|
-
function Jo(e, t) {
|
|
5999
|
+
function ts(e, t) {
|
|
5933
6000
|
let n = new Uint8Array(t), r = 0;
|
|
5934
6001
|
for (let t of e) n.set(t, r), r += t.length;
|
|
5935
6002
|
return n;
|
|
5936
6003
|
}
|
|
5937
|
-
function
|
|
6004
|
+
function ns(e) {
|
|
5938
6005
|
let t = e.fileInfo.size, n = Number.isFinite(t) ? Math.max(0, t - e.position) : 2 ** 53 - 1;
|
|
5939
|
-
return Math.min(n,
|
|
6006
|
+
return Math.min(n, Xo);
|
|
5940
6007
|
}
|
|
5941
|
-
function
|
|
5942
|
-
if (e instanceof
|
|
6008
|
+
function rs(e) {
|
|
6009
|
+
if (e instanceof H || e instanceof G || e instanceof go) return !0;
|
|
5943
6010
|
if (!(e instanceof Error)) return !1;
|
|
5944
|
-
if (
|
|
5945
|
-
for (let t of
|
|
6011
|
+
if (e instanceof TypeError && e.message.startsWith("Failed to deflate ZIP entry:") || Qo.has(e.message) || es.has(e.code)) return !0;
|
|
6012
|
+
for (let t of $o) if (e.message.startsWith(t)) return !0;
|
|
5946
6013
|
return !1;
|
|
5947
6014
|
}
|
|
5948
|
-
function
|
|
6015
|
+
function is(e, t = Jo) {
|
|
5949
6016
|
let n = [e.compressedSize, e.uncompressedSize];
|
|
5950
6017
|
for (let e of n) if (!Number.isFinite(e) || e < 0 || e > t) return !1;
|
|
5951
6018
|
return !0;
|
|
5952
6019
|
}
|
|
5953
|
-
function
|
|
6020
|
+
function as() {
|
|
5954
6021
|
return {
|
|
5955
6022
|
hasDocumentEntry: !1,
|
|
5956
6023
|
hasMasterSlideEntry: !1,
|
|
@@ -5958,10 +6025,10 @@ function Qo() {
|
|
|
5958
6025
|
hasCalculationEngineEntry: !1
|
|
5959
6026
|
};
|
|
5960
6027
|
}
|
|
5961
|
-
function
|
|
6028
|
+
function os(e, t) {
|
|
5962
6029
|
t === "Index/Document.iwa" && (e.hasDocumentEntry = !0), t.startsWith("Index/MasterSlide") && (e.hasMasterSlideEntry = !0), t.startsWith("Index/Tables/") && (e.hasTablesEntry = !0), t === "Index/CalculationEngine.iwa" && (e.hasCalculationEngineEntry = !0);
|
|
5963
6030
|
}
|
|
5964
|
-
function
|
|
6031
|
+
function ss(e) {
|
|
5965
6032
|
if (e.hasDocumentEntry) return e.hasMasterSlideEntry ? {
|
|
5966
6033
|
ext: "key",
|
|
5967
6034
|
mime: "application/vnd.apple.keynote"
|
|
@@ -5973,7 +6040,7 @@ function es(e) {
|
|
|
5973
6040
|
mime: "application/vnd.apple.pages"
|
|
5974
6041
|
};
|
|
5975
6042
|
}
|
|
5976
|
-
function
|
|
6043
|
+
function cs(e) {
|
|
5977
6044
|
switch (e = e.toLowerCase(), e) {
|
|
5978
6045
|
case "application/epub+zip": return {
|
|
5979
6046
|
ext: "epub",
|
|
@@ -6077,7 +6144,7 @@ function ts(e) {
|
|
|
6077
6144
|
};
|
|
6078
6145
|
}
|
|
6079
6146
|
}
|
|
6080
|
-
function
|
|
6147
|
+
function ls() {
|
|
6081
6148
|
return {
|
|
6082
6149
|
hasContentTypesEntry: !1,
|
|
6083
6150
|
hasParsedContentTypesEntry: !1,
|
|
@@ -6089,10 +6156,10 @@ function ns() {
|
|
|
6089
6156
|
hasThreeDimensionalModelEntry: !1
|
|
6090
6157
|
};
|
|
6091
6158
|
}
|
|
6092
|
-
function
|
|
6159
|
+
function us(e, t) {
|
|
6093
6160
|
t.startsWith("word/") && (e.hasWordDirectory = !0), t.startsWith("ppt/") && (e.hasPresentationDirectory = !0), t.startsWith("xl/") && (e.hasSpreadsheetDirectory = !0), t.startsWith("3D/") && t.endsWith(".model") && (e.hasThreeDimensionalModelEntry = !0);
|
|
6094
6161
|
}
|
|
6095
|
-
function
|
|
6162
|
+
function ds(e) {
|
|
6096
6163
|
if (e.hasWordDirectory) return {
|
|
6097
6164
|
ext: "docx",
|
|
6098
6165
|
mime: "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
|
@@ -6110,10 +6177,10 @@ function is(e) {
|
|
|
6110
6177
|
mime: "model/3mf"
|
|
6111
6178
|
};
|
|
6112
6179
|
}
|
|
6113
|
-
function
|
|
6114
|
-
if (!(!e.hasContentTypesEntry || e.hasUnparseableContentTypes || e.isParsingContentTypes || e.hasParsedContentTypesEntry)) return
|
|
6180
|
+
function fs(e) {
|
|
6181
|
+
if (!(!e.hasContentTypesEntry || e.hasUnparseableContentTypes || e.isParsingContentTypes || e.hasParsedContentTypesEntry)) return ds(e);
|
|
6115
6182
|
}
|
|
6116
|
-
function
|
|
6183
|
+
function ps(e) {
|
|
6117
6184
|
let t = e.indexOf(".main+xml\"");
|
|
6118
6185
|
if (t === -1) {
|
|
6119
6186
|
let t = "application/vnd.ms-package.3dmanufacturing-3dmodel+xml";
|
|
@@ -6122,78 +6189,76 @@ function os(e) {
|
|
|
6122
6189
|
let n = e.slice(0, t), r = n.lastIndexOf("\"");
|
|
6123
6190
|
return n.slice(r + 1);
|
|
6124
6191
|
}
|
|
6125
|
-
var
|
|
6126
|
-
function
|
|
6127
|
-
|
|
6128
|
-
let n = e.length -
|
|
6129
|
-
for (let r = 0; r <= n; r++) if (z.get(e, r) === ss && z.get(e, r + 8) === t + r) return r;
|
|
6192
|
+
var ms = 134695760, hs = 16, gs = 15;
|
|
6193
|
+
function _s(e, t, { allowTruncated: n = !1 } = {}) {
|
|
6194
|
+
let r = e.length - (n ? 4 : hs);
|
|
6195
|
+
for (let n = 0; n <= r; n++) if (B.get(e, n) === ms && (e.length - n < 12 || B.get(e, n + 8) === t + n)) return n;
|
|
6130
6196
|
return -1;
|
|
6131
6197
|
}
|
|
6132
|
-
async function
|
|
6198
|
+
async function vs(e, { shouldBuffer: t, maximumLength: n = Jo } = {}) {
|
|
6133
6199
|
let { syncBuffer: r } = e, { length: i } = r, a = [], o = 0;
|
|
6134
6200
|
for (;;) {
|
|
6135
|
-
let s = await e.tokenizer.peekBuffer(r, { mayBeLess: !0 }), c =
|
|
6201
|
+
let s = await e.tokenizer.peekBuffer(r, { mayBeLess: !0 }), c = _s(r.subarray(0, s), o, { allowTruncated: s < i }), l = c >= 0 ? 0 : s === i ? Math.min(gs, s - 1) : 0, u = c >= 0 ? c : s - l;
|
|
6136
6202
|
if (u === 0) break;
|
|
6137
|
-
if (o += u, o > n) throw new
|
|
6203
|
+
if (o += u, o > n) throw new G(`ZIP entry data descriptor not found within ${n} bytes`);
|
|
6138
6204
|
if (t) {
|
|
6139
6205
|
let t = new Uint8Array(u);
|
|
6140
6206
|
await e.tokenizer.readBuffer(t), a.push(t);
|
|
6141
6207
|
} else await e.tokenizer.ignore(u);
|
|
6142
6208
|
if (c >= 0) break;
|
|
6143
6209
|
}
|
|
6144
|
-
if (
|
|
6210
|
+
if (J(e.tokenizer) || (e.knownSizeDescriptorScannedBytes += o), t) return ts(a, o);
|
|
6145
6211
|
}
|
|
6146
|
-
function
|
|
6147
|
-
return
|
|
6212
|
+
function ys(e, t) {
|
|
6213
|
+
return J(e.tokenizer) ? Math.max(0, W - (e.tokenizer.position - t)) : Math.max(0, Jo - e.knownSizeDescriptorScannedBytes);
|
|
6148
6214
|
}
|
|
6149
|
-
async function
|
|
6150
|
-
if (t.dataDescriptor && t.compressedSize === 0) return
|
|
6215
|
+
async function bs(e, t, { shouldBuffer: n, maximumDescriptorLength: r = Jo } = {}) {
|
|
6216
|
+
if (t.dataDescriptor && t.compressedSize === 0) return vs(e, {
|
|
6151
6217
|
shouldBuffer: n,
|
|
6152
6218
|
maximumLength: r
|
|
6153
6219
|
});
|
|
6154
6220
|
if (!n) {
|
|
6155
|
-
await
|
|
6156
|
-
maximumLength:
|
|
6221
|
+
await K(e.tokenizer, t.compressedSize, {
|
|
6222
|
+
maximumLength: J(e.tokenizer) ? Jo : e.tokenizer.fileInfo.size,
|
|
6157
6223
|
reason: "ZIP entry compressed data"
|
|
6158
6224
|
});
|
|
6159
6225
|
return;
|
|
6160
6226
|
}
|
|
6161
|
-
|
|
6227
|
+
if (t.compressedSize > Zo) throw new go("maxCompressedSize", t.compressedSize, Zo);
|
|
6228
|
+
let i = ns(e.tokenizer);
|
|
6162
6229
|
if (!Number.isFinite(t.compressedSize) || t.compressedSize < 0 || t.compressedSize > i) throw Error(`ZIP entry compressed data exceeds ${i} bytes`);
|
|
6163
6230
|
let a = new Uint8Array(t.compressedSize);
|
|
6164
6231
|
return await e.tokenizer.readBuffer(a), a;
|
|
6165
6232
|
}
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
if (Bo(this.tokenizer, r, 16777216)) throw new W(`ZIP stream probing exceeds ${U} bytes`);
|
|
6189
|
-
} while (!t);
|
|
6233
|
+
var xs = class extends Eo {
|
|
6234
|
+
async unzip(e) {
|
|
6235
|
+
let t = !1, n = 0, r = this.tokenizer.position;
|
|
6236
|
+
this.knownSizeDescriptorScannedBytes = 0;
|
|
6237
|
+
do {
|
|
6238
|
+
if (qo(this.tokenizer, r, 16777216)) throw new G(`ZIP stream probing exceeds ${W} bytes`);
|
|
6239
|
+
let i = await this.readLocalFileHeader();
|
|
6240
|
+
if (!i) break;
|
|
6241
|
+
if (n++, n > Yo) throw Error(`ZIP entry count exceeds ${Yo}`);
|
|
6242
|
+
let a = e(i);
|
|
6243
|
+
t = !!a.stop, await this.tokenizer.ignore(i.extraFieldLength);
|
|
6244
|
+
let o = await bs(this, i, {
|
|
6245
|
+
shouldBuffer: !!a.handler,
|
|
6246
|
+
maximumDescriptorLength: Math.min(Jo, ys(this, r))
|
|
6247
|
+
});
|
|
6248
|
+
if (a.handler && await this.inflate(i, o, a.handler), i.dataDescriptor) {
|
|
6249
|
+
let e = new Uint8Array(hs);
|
|
6250
|
+
if (await this.tokenizer.readBuffer(e), B.get(e, 0) !== ms) throw Error(`Expected data-descriptor-signature at position ${this.tokenizer.position - e.length}`);
|
|
6251
|
+
}
|
|
6252
|
+
if (qo(this.tokenizer, r, 16777216)) throw new G(`ZIP stream probing exceeds ${W} bytes`);
|
|
6253
|
+
} while (!t);
|
|
6254
|
+
}
|
|
6190
6255
|
};
|
|
6191
|
-
async function
|
|
6192
|
-
let t, n =
|
|
6256
|
+
async function Ss(e) {
|
|
6257
|
+
let t, n = ls(), r = as();
|
|
6193
6258
|
try {
|
|
6194
|
-
await new
|
|
6195
|
-
if (
|
|
6196
|
-
let i = e.filename === "[Content_Types].xml", a =
|
|
6259
|
+
await new xs(e, { maxUncompressedSize: Zo }).unzip((e) => {
|
|
6260
|
+
if (us(n, e.filename), os(r, e.filename), r.hasDocumentEntry && (r.hasMasterSlideEntry || r.hasTablesEntry)) return t = ss(r), { stop: !0 };
|
|
6261
|
+
let i = e.filename === "[Content_Types].xml", a = fs(n);
|
|
6197
6262
|
if (!i && a) return t = a, { stop: !0 };
|
|
6198
6263
|
switch (e.filename) {
|
|
6199
6264
|
case "META-INF/mozilla.rsa": return t = {
|
|
@@ -6204,16 +6269,16 @@ async function ms(e) {
|
|
|
6204
6269
|
ext: "jar",
|
|
6205
6270
|
mime: "application/java-archive"
|
|
6206
6271
|
}, { stop: !0 };
|
|
6207
|
-
case "mimetype": return
|
|
6272
|
+
case "mimetype": return is(e, Zo) ? {
|
|
6208
6273
|
async handler(e) {
|
|
6209
|
-
t =
|
|
6274
|
+
t = cs(new TextDecoder("utf-8").decode(e).trim());
|
|
6210
6275
|
},
|
|
6211
6276
|
stop: !0
|
|
6212
6277
|
} : {};
|
|
6213
|
-
case "[Content_Types].xml": return n.hasContentTypesEntry = !0,
|
|
6278
|
+
case "[Content_Types].xml": return n.hasContentTypesEntry = !0, is(e, Zo) ? (n.isParsingContentTypes = !0, {
|
|
6214
6279
|
async handler(e) {
|
|
6215
|
-
let r =
|
|
6216
|
-
r && (t =
|
|
6280
|
+
let r = ps(new TextDecoder("utf-8").decode(e));
|
|
6281
|
+
r && (t = cs(r)), n.hasParsedContentTypesEntry = !0, n.isParsingContentTypes = !1;
|
|
6217
6282
|
},
|
|
6218
6283
|
stop: !0
|
|
6219
6284
|
}) : (n.hasUnparseableContentTypes = !0, {});
|
|
@@ -6224,24 +6289,24 @@ async function ms(e) {
|
|
|
6224
6289
|
}
|
|
6225
6290
|
});
|
|
6226
6291
|
} catch (e) {
|
|
6227
|
-
if (!
|
|
6228
|
-
n.isParsingContentTypes && (n.isParsingContentTypes = !1, n.hasUnparseableContentTypes = !0), !t && (e instanceof
|
|
6292
|
+
if (!rs(e)) throw e;
|
|
6293
|
+
n.isParsingContentTypes && (n.isParsingContentTypes = !1, n.hasUnparseableContentTypes = !0), !t && (e instanceof H || e instanceof G) && !n.hasContentTypesEntry && (t = ds(n));
|
|
6229
6294
|
}
|
|
6230
|
-
let i =
|
|
6231
|
-
return t ??
|
|
6295
|
+
let i = J(e) && r.hasDocumentEntry && !r.hasMasterSlideEntry && !r.hasTablesEntry && !r.hasCalculationEngineEntry ? void 0 : ss(r);
|
|
6296
|
+
return t ?? fs(n) ?? i ?? {
|
|
6232
6297
|
ext: "zip",
|
|
6233
6298
|
mime: "application/zip"
|
|
6234
6299
|
};
|
|
6235
6300
|
}
|
|
6236
6301
|
//#endregion
|
|
6237
6302
|
//#region node_modules/file-type/source/detectors/ebml.js
|
|
6238
|
-
var
|
|
6239
|
-
async function
|
|
6303
|
+
var Cs = 64, ws = 1048576, Ts = 256;
|
|
6304
|
+
async function Es(e) {
|
|
6240
6305
|
async function t() {
|
|
6241
|
-
let t = await e.peekNumber(
|
|
6242
|
-
for (; (t & n) === 0
|
|
6306
|
+
let t = await e.peekNumber(Ha), n = 128, r = 0;
|
|
6307
|
+
for (; n !== 0 && (t & n) === 0;) ++r, n >>= 1;
|
|
6243
6308
|
let i = new Uint8Array(r + 1);
|
|
6244
|
-
return await
|
|
6309
|
+
return await Ko(e, i, void 0, {
|
|
6245
6310
|
maximumLength: i.length,
|
|
6246
6311
|
reason: "EBML field"
|
|
6247
6312
|
}), i;
|
|
@@ -6251,22 +6316,22 @@ async function vs(e) {
|
|
|
6251
6316
|
n[0] ^= 128 >> n.length - 1;
|
|
6252
6317
|
let r = Math.min(6, n.length), i = new DataView(e.buffer), a = new DataView(n.buffer, n.length - r, r);
|
|
6253
6318
|
return {
|
|
6254
|
-
id:
|
|
6255
|
-
len:
|
|
6319
|
+
id: zo(i),
|
|
6320
|
+
len: zo(a)
|
|
6256
6321
|
};
|
|
6257
6322
|
}
|
|
6258
6323
|
async function r(t) {
|
|
6259
6324
|
let r = 0;
|
|
6260
6325
|
for (; t > 0;) {
|
|
6261
|
-
if (r++, r >
|
|
6326
|
+
if (r++, r > Ts || qo(e, a, 16777216)) return;
|
|
6262
6327
|
let i = e.position, o = await n();
|
|
6263
6328
|
if (o.id === 17026) {
|
|
6264
|
-
if (o.len >
|
|
6265
|
-
let t =
|
|
6266
|
-
return (await e.readToken(new
|
|
6329
|
+
if (o.len > Cs) return;
|
|
6330
|
+
let t = Go(o.len, Cs, "EBML DocType");
|
|
6331
|
+
return (await e.readToken(new V(t))).split("\0", 1)[0];
|
|
6267
6332
|
}
|
|
6268
|
-
if (
|
|
6269
|
-
maximumLength:
|
|
6333
|
+
if (J(e) && (!Number.isFinite(o.len) || o.len < 0 || o.len > ws) || (await K(e, o.len, {
|
|
6334
|
+
maximumLength: J(e) ? ws : e.fileInfo.size,
|
|
6270
6335
|
reason: "EBML payload"
|
|
6271
6336
|
}), --t, e.position <= i)) return;
|
|
6272
6337
|
}
|
|
@@ -6285,11 +6350,11 @@ async function vs(e) {
|
|
|
6285
6350
|
}
|
|
6286
6351
|
//#endregion
|
|
6287
6352
|
//#region node_modules/file-type/source/detectors/png.js
|
|
6288
|
-
var
|
|
6289
|
-
function
|
|
6353
|
+
var Ds = 512, Os = 16777216, ks = 1048576;
|
|
6354
|
+
function As(e) {
|
|
6290
6355
|
return !!(e.codePointAt(0) & 32);
|
|
6291
6356
|
}
|
|
6292
|
-
async function
|
|
6357
|
+
async function js(e) {
|
|
6293
6358
|
let t = {
|
|
6294
6359
|
ext: "png",
|
|
6295
6360
|
mime: "image/png"
|
|
@@ -6300,13 +6365,13 @@ async function Cs(e) {
|
|
|
6300
6365
|
await e.ignore(8);
|
|
6301
6366
|
async function r() {
|
|
6302
6367
|
return {
|
|
6303
|
-
length: await e.readToken(
|
|
6304
|
-
type: await e.readToken(new
|
|
6368
|
+
length: await e.readToken(Ga),
|
|
6369
|
+
type: await e.readToken(new V(4, "latin1"))
|
|
6305
6370
|
};
|
|
6306
6371
|
}
|
|
6307
|
-
let i =
|
|
6372
|
+
let i = J(e), a = e.position, o = 0, s = !1;
|
|
6308
6373
|
do {
|
|
6309
|
-
if (o++, o >
|
|
6374
|
+
if (o++, o > Ds || qo(e, a, Os)) break;
|
|
6310
6375
|
let c = e.position, l = await r();
|
|
6311
6376
|
if (l.length < 0) return;
|
|
6312
6377
|
if (l.type === "IHDR") {
|
|
@@ -6318,14 +6383,14 @@ async function Cs(e) {
|
|
|
6318
6383
|
case "acTL": return n;
|
|
6319
6384
|
default:
|
|
6320
6385
|
if (!s && l.type !== "CgBI") return;
|
|
6321
|
-
if (i && l.length >
|
|
6386
|
+
if (i && l.length > ks) return s && As(l.type) ? t : void 0;
|
|
6322
6387
|
try {
|
|
6323
|
-
await
|
|
6388
|
+
await K(e, l.length + 4, {
|
|
6324
6389
|
maximumLength: i ? 1048580 : e.fileInfo.size,
|
|
6325
6390
|
reason: "PNG chunk payload"
|
|
6326
6391
|
});
|
|
6327
6392
|
} catch (e) {
|
|
6328
|
-
if (!i && (e instanceof
|
|
6393
|
+
if (!i && (e instanceof G || e instanceof H)) return t;
|
|
6329
6394
|
throw e;
|
|
6330
6395
|
}
|
|
6331
6396
|
}
|
|
@@ -6335,32 +6400,32 @@ async function Cs(e) {
|
|
|
6335
6400
|
}
|
|
6336
6401
|
//#endregion
|
|
6337
6402
|
//#region node_modules/file-type/source/detectors/asf.js
|
|
6338
|
-
var
|
|
6339
|
-
async function
|
|
6403
|
+
var Ms = 512, Ns = 1048576;
|
|
6404
|
+
async function Ps(e) {
|
|
6340
6405
|
let t = !1;
|
|
6341
6406
|
try {
|
|
6342
6407
|
async function n() {
|
|
6343
6408
|
let t = /* @__PURE__ */ new Uint8Array(16);
|
|
6344
|
-
return await
|
|
6409
|
+
return await Ko(e, t, void 0, {
|
|
6345
6410
|
maximumLength: t.length,
|
|
6346
6411
|
reason: "ASF header GUID"
|
|
6347
6412
|
}), {
|
|
6348
6413
|
id: t,
|
|
6349
|
-
size: Number(await e.readToken(
|
|
6414
|
+
size: Number(await e.readToken(Ka))
|
|
6350
6415
|
};
|
|
6351
6416
|
}
|
|
6352
|
-
await
|
|
6417
|
+
await K(e, 30, {
|
|
6353
6418
|
maximumLength: 30,
|
|
6354
6419
|
reason: "ASF header prelude"
|
|
6355
6420
|
});
|
|
6356
|
-
let r =
|
|
6357
|
-
for (; e.position + 24 < e.fileInfo.size && (a++, !(a >
|
|
6421
|
+
let r = J(e), i = e.position, a = 0;
|
|
6422
|
+
for (; e.position + 24 < e.fileInfo.size && (a++, !(a > Ms || qo(e, i, 16777216)));) {
|
|
6358
6423
|
let i = e.position, a = await n(), o = a.size - 24;
|
|
6359
6424
|
if (!Number.isFinite(o) || o < 0) {
|
|
6360
6425
|
t = !0;
|
|
6361
6426
|
break;
|
|
6362
6427
|
}
|
|
6363
|
-
if (
|
|
6428
|
+
if (q(a.id, [
|
|
6364
6429
|
145,
|
|
6365
6430
|
7,
|
|
6366
6431
|
220,
|
|
@@ -6379,10 +6444,10 @@ async function Es(e) {
|
|
|
6379
6444
|
101
|
|
6380
6445
|
])) {
|
|
6381
6446
|
let t = /* @__PURE__ */ new Uint8Array(16);
|
|
6382
|
-
if (o -= await
|
|
6447
|
+
if (o -= await Ko(e, t, void 0, {
|
|
6383
6448
|
maximumLength: t.length,
|
|
6384
6449
|
reason: "ASF stream type GUID"
|
|
6385
|
-
}),
|
|
6450
|
+
}), q(t, [
|
|
6386
6451
|
64,
|
|
6387
6452
|
158,
|
|
6388
6453
|
105,
|
|
@@ -6403,7 +6468,7 @@ async function Es(e) {
|
|
|
6403
6468
|
ext: "asf",
|
|
6404
6469
|
mime: "audio/x-ms-asf"
|
|
6405
6470
|
};
|
|
6406
|
-
if (
|
|
6471
|
+
if (q(t, [
|
|
6407
6472
|
192,
|
|
6408
6473
|
239,
|
|
6409
6474
|
25,
|
|
@@ -6426,12 +6491,12 @@ async function Es(e) {
|
|
|
6426
6491
|
};
|
|
6427
6492
|
break;
|
|
6428
6493
|
}
|
|
6429
|
-
if (r && o >
|
|
6494
|
+
if (r && o > Ns) {
|
|
6430
6495
|
t = !0;
|
|
6431
6496
|
break;
|
|
6432
6497
|
}
|
|
6433
|
-
if (await
|
|
6434
|
-
maximumLength: r ?
|
|
6498
|
+
if (await K(e, o, {
|
|
6499
|
+
maximumLength: r ? Ns : e.fileInfo.size,
|
|
6435
6500
|
reason: "ASF header payload"
|
|
6436
6501
|
}), e.position <= i) {
|
|
6437
6502
|
t = !0;
|
|
@@ -6439,7 +6504,7 @@ async function Es(e) {
|
|
|
6439
6504
|
}
|
|
6440
6505
|
}
|
|
6441
6506
|
} catch (n) {
|
|
6442
|
-
if (n instanceof
|
|
6507
|
+
if (n instanceof H || n instanceof G) J(e) && (t = !0);
|
|
6443
6508
|
else throw n;
|
|
6444
6509
|
}
|
|
6445
6510
|
if (!t) return {
|
|
@@ -6449,34 +6514,34 @@ async function Es(e) {
|
|
|
6449
6514
|
}
|
|
6450
6515
|
//#endregion
|
|
6451
6516
|
//#region node_modules/file-type/source/index.js
|
|
6452
|
-
var
|
|
6453
|
-
function
|
|
6454
|
-
return Number.isFinite(e) ? Math.max(1, Math.trunc(e)) :
|
|
6517
|
+
var Fs = 4100, Is = 4096, Ls = W, Rs = 1, zs = 100, Bs = W, Vs = 512, Hs = 256, Us = 1048576, Ws = W;
|
|
6518
|
+
function Gs(e) {
|
|
6519
|
+
return Number.isFinite(e) ? Math.max(1, Math.trunc(e)) : Fs;
|
|
6455
6520
|
}
|
|
6456
|
-
function
|
|
6457
|
-
return Number.isFinite(e) ? Math.max(0, Math.min(
|
|
6521
|
+
function Ks(e) {
|
|
6522
|
+
return Number.isFinite(e) ? Math.max(0, Math.min(Is, Math.trunc(e))) : 0;
|
|
6458
6523
|
}
|
|
6459
|
-
function
|
|
6524
|
+
function qs(e) {
|
|
6460
6525
|
return Number.isFinite(e) ? Math.max(0, e) : 2 ** 53 - 1;
|
|
6461
6526
|
}
|
|
6462
|
-
function
|
|
6527
|
+
function Js(e) {
|
|
6463
6528
|
return import(
|
|
6464
6529
|
/* @vite-ignore */
|
|
6465
6530
|
/* webpackIgnore: true */
|
|
6466
6531
|
e
|
|
6467
6532
|
);
|
|
6468
6533
|
}
|
|
6469
|
-
function
|
|
6534
|
+
function Ys(e) {
|
|
6470
6535
|
return e.pipeThrough(new TransformStream());
|
|
6471
6536
|
}
|
|
6472
|
-
function
|
|
6537
|
+
function Xs(e, t) {
|
|
6473
6538
|
return t === void 0 ? e.read() : (t.throwIfAborted(), Promise.race([e.read(), new Promise((n, r) => {
|
|
6474
6539
|
t.addEventListener("abort", () => {
|
|
6475
6540
|
r(t.reason), e.cancel(t.reason).catch(() => {});
|
|
6476
6541
|
}, { once: !0 });
|
|
6477
6542
|
})]));
|
|
6478
6543
|
}
|
|
6479
|
-
function
|
|
6544
|
+
function Zs(e, t) {
|
|
6480
6545
|
let n = e.getReader(), r = 0, i = !1, a = !1, o = async (e) => {
|
|
6481
6546
|
i || a || (a = !0, await n.cancel(e));
|
|
6482
6547
|
};
|
|
@@ -6503,12 +6568,16 @@ function Us(e, t) {
|
|
|
6503
6568
|
}
|
|
6504
6569
|
});
|
|
6505
6570
|
}
|
|
6506
|
-
async function
|
|
6507
|
-
return new
|
|
6571
|
+
async function Qs(e, t) {
|
|
6572
|
+
return new $s(t).fromBuffer(e);
|
|
6508
6573
|
}
|
|
6509
|
-
var
|
|
6574
|
+
var $s = class e {
|
|
6575
|
+
buffer;
|
|
6576
|
+
tokenizer;
|
|
6577
|
+
detectionReentryCount;
|
|
6510
6578
|
constructor(e) {
|
|
6511
|
-
let t =
|
|
6579
|
+
let t = Ks(e?.mpegOffsetTolerance), n = e?.maxBufferSize ?? Infinity;
|
|
6580
|
+
if (n !== Infinity && (!Number.isSafeInteger(n) || n <= 0)) throw RangeError("maxBufferSize must be a positive safe integer or Infinity");
|
|
6512
6581
|
this.options = {
|
|
6513
6582
|
...e,
|
|
6514
6583
|
mpegOffsetTolerance: t
|
|
@@ -6516,19 +6585,22 @@ var Gs = class e {
|
|
|
6516
6585
|
...this.options.customDetectors ?? [],
|
|
6517
6586
|
{
|
|
6518
6587
|
id: "core",
|
|
6519
|
-
detect: this.detectConfident
|
|
6588
|
+
detect: (e) => this.detectConfident(e)
|
|
6520
6589
|
},
|
|
6521
6590
|
{
|
|
6522
6591
|
id: "core.imprecise",
|
|
6523
|
-
detect: this.detectImprecise
|
|
6592
|
+
detect: (e) => this.detectImprecise(e)
|
|
6524
6593
|
}
|
|
6525
|
-
], this.tokenizerOptions = {
|
|
6594
|
+
], this.tokenizerOptions = {
|
|
6595
|
+
abortSignal: this.options.signal,
|
|
6596
|
+
maxBufferSize: n
|
|
6597
|
+
}, this.gzipProbeDepth = 0;
|
|
6526
6598
|
}
|
|
6527
6599
|
getTokenizerOptions() {
|
|
6528
6600
|
return { ...this.tokenizerOptions };
|
|
6529
6601
|
}
|
|
6530
6602
|
createTokenizerFromWebStream(e) {
|
|
6531
|
-
return
|
|
6603
|
+
return co(Ys(e), this.getTokenizerOptions());
|
|
6532
6604
|
}
|
|
6533
6605
|
async parseTokenizer(e, t = 0) {
|
|
6534
6606
|
this.detectionReentryCount = t;
|
|
@@ -6538,7 +6610,7 @@ var Gs = class e {
|
|
|
6538
6610
|
try {
|
|
6539
6611
|
r = await t.detect(e);
|
|
6540
6612
|
} catch (e) {
|
|
6541
|
-
if (e instanceof
|
|
6613
|
+
if (e instanceof H || e instanceof G) return;
|
|
6542
6614
|
throw e;
|
|
6543
6615
|
}
|
|
6544
6616
|
if (r) return r;
|
|
@@ -6555,11 +6627,11 @@ var Gs = class e {
|
|
|
6555
6627
|
async fromBuffer(e) {
|
|
6556
6628
|
if (!(e instanceof Uint8Array || e instanceof ArrayBuffer)) throw TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``);
|
|
6557
6629
|
let t = e instanceof Uint8Array ? e : new Uint8Array(e);
|
|
6558
|
-
if (t?.length > 1) return this.fromTokenizer(
|
|
6630
|
+
if (t?.length > 1) return this.fromTokenizer(lo(t, this.getTokenizerOptions()));
|
|
6559
6631
|
}
|
|
6560
6632
|
async fromBlob(e) {
|
|
6561
6633
|
this.options.signal?.throwIfAborted();
|
|
6562
|
-
let t =
|
|
6634
|
+
let t = uo(e, this.getTokenizerOptions());
|
|
6563
6635
|
return this.fromTokenizer(t);
|
|
6564
6636
|
}
|
|
6565
6637
|
async fromStream(e) {
|
|
@@ -6569,26 +6641,24 @@ var Gs = class e {
|
|
|
6569
6641
|
}
|
|
6570
6642
|
async fromFile(e) {
|
|
6571
6643
|
this.options.signal?.throwIfAborted();
|
|
6572
|
-
let
|
|
6573
|
-
|
|
6574
|
-
await
|
|
6575
|
-
|
|
6644
|
+
let { fromFile: t, NotRegularFileError: n } = await Js("strtok3"), r;
|
|
6645
|
+
try {
|
|
6646
|
+
r = await t(e, {
|
|
6647
|
+
...this.getTokenizerOptions(),
|
|
6648
|
+
regularFileOnly: !0
|
|
6649
|
+
});
|
|
6650
|
+
} catch (e) {
|
|
6651
|
+
if (e instanceof n) return;
|
|
6652
|
+
throw e;
|
|
6576
6653
|
}
|
|
6577
|
-
|
|
6578
|
-
...this.getTokenizerOptions(),
|
|
6579
|
-
fileInfo: {
|
|
6580
|
-
path: e,
|
|
6581
|
-
size: i.size
|
|
6582
|
-
}
|
|
6583
|
-
});
|
|
6584
|
-
return this.fromTokenizer(a);
|
|
6654
|
+
return this.fromTokenizer(r);
|
|
6585
6655
|
}
|
|
6586
6656
|
async toDetectionStream(e, t) {
|
|
6587
6657
|
this.options.signal?.throwIfAborted();
|
|
6588
|
-
let n =
|
|
6658
|
+
let n = Gs(t?.sampleSize ?? 4100), r, i = !1, a = e.getReader(), o = [], s = 0;
|
|
6589
6659
|
try {
|
|
6590
6660
|
for (; s < n;) {
|
|
6591
|
-
let { value: e, done: t } = await
|
|
6661
|
+
let { value: e, done: t } = await Xs(a, this.options.signal);
|
|
6592
6662
|
if (t || !e) {
|
|
6593
6663
|
i = !0;
|
|
6594
6664
|
break;
|
|
@@ -6596,18 +6666,18 @@ var Gs = class e {
|
|
|
6596
6666
|
o.push(e), s += e.length;
|
|
6597
6667
|
}
|
|
6598
6668
|
if (!i && s === n) {
|
|
6599
|
-
let { value: e, done: t } = await
|
|
6669
|
+
let { value: e, done: t } = await Xs(a, this.options.signal);
|
|
6600
6670
|
t || !e ? i = !0 : (o.push(e), s += e.length);
|
|
6601
6671
|
}
|
|
6602
6672
|
} finally {
|
|
6603
6673
|
a.releaseLock();
|
|
6604
6674
|
}
|
|
6605
6675
|
if (s > 0) {
|
|
6606
|
-
let e = o.length === 1 ? o[0] :
|
|
6676
|
+
let e = o.length === 1 ? o[0] : Ro(o);
|
|
6607
6677
|
try {
|
|
6608
6678
|
r = await this.fromBuffer(e.subarray(0, n));
|
|
6609
6679
|
} catch (e) {
|
|
6610
|
-
if (!(e instanceof
|
|
6680
|
+
if (!(e instanceof H)) throw e;
|
|
6611
6681
|
r = void 0;
|
|
6612
6682
|
}
|
|
6613
6683
|
!i && r?.ext === "pages" && (r = {
|
|
@@ -6626,16 +6696,16 @@ var Gs = class e {
|
|
|
6626
6696
|
return l.fileType = r, l;
|
|
6627
6697
|
}
|
|
6628
6698
|
async detectGzip(t) {
|
|
6629
|
-
if (this.gzipProbeDepth >=
|
|
6699
|
+
if (this.gzipProbeDepth >= Rs) return {
|
|
6630
6700
|
ext: "gz",
|
|
6631
6701
|
mime: "application/gzip"
|
|
6632
6702
|
};
|
|
6633
|
-
let n =
|
|
6703
|
+
let n = Zs(new fo(t).inflate(), Ls), r = J(t), i, a, o, s;
|
|
6634
6704
|
if (r) {
|
|
6635
6705
|
let t = new AbortController();
|
|
6636
6706
|
i = setTimeout(() => {
|
|
6637
|
-
t.abort(new DOMException(`Operation timed out after ${
|
|
6638
|
-
},
|
|
6707
|
+
t.abort(new DOMException(`Operation timed out after ${zs} ms`, "TimeoutError"));
|
|
6708
|
+
}, zs), a = this.options.signal === void 0 ? t.signal : AbortSignal.any([this.options.signal, t.signal]), o = new e({
|
|
6639
6709
|
...this.options,
|
|
6640
6710
|
signal: a
|
|
6641
6711
|
}), o.gzipProbeDepth = this.gzipProbeDepth + 1;
|
|
@@ -6656,13 +6726,13 @@ var Gs = class e {
|
|
|
6656
6726
|
};
|
|
6657
6727
|
}
|
|
6658
6728
|
check(e, t) {
|
|
6659
|
-
return
|
|
6729
|
+
return q(this.buffer, e, t);
|
|
6660
6730
|
}
|
|
6661
6731
|
checkString(e, t) {
|
|
6662
|
-
return this.check(
|
|
6732
|
+
return this.check(Bo(e, t?.encoding), t);
|
|
6663
6733
|
}
|
|
6664
|
-
|
|
6665
|
-
if (this.buffer = new Uint8Array(
|
|
6734
|
+
async detectConfident(e) {
|
|
6735
|
+
if (this.buffer = new Uint8Array(Fs), e.fileInfo.size === void 0 && (e.fileInfo.size = 2 ** 53 - 1), this.tokenizer = e, J(e) && (await e.peekBuffer(this.buffer, {
|
|
6666
6736
|
length: 3,
|
|
6667
6737
|
mayBeLess: !0
|
|
6668
6738
|
}), this.check([
|
|
@@ -6715,7 +6785,7 @@ var Gs = class e {
|
|
|
6715
6785
|
239,
|
|
6716
6786
|
187,
|
|
6717
6787
|
191
|
|
6718
|
-
])) return this.detectionReentryCount >=
|
|
6788
|
+
])) return this.detectionReentryCount >= Hs ? void 0 : (this.detectionReentryCount++, await this.tokenizer.ignore(3), this.detectConfident(e));
|
|
6719
6789
|
if (this.check([
|
|
6720
6790
|
71,
|
|
6721
6791
|
73,
|
|
@@ -6746,26 +6816,26 @@ var Gs = class e {
|
|
|
6746
6816
|
mime: "application/x-bzip2"
|
|
6747
6817
|
};
|
|
6748
6818
|
if (this.checkString("ID3")) {
|
|
6749
|
-
await
|
|
6819
|
+
await K(e, 6, {
|
|
6750
6820
|
maximumLength: 6,
|
|
6751
6821
|
reason: "ID3 header prefix"
|
|
6752
6822
|
});
|
|
6753
|
-
let t = await e.readToken(
|
|
6754
|
-
if (!Number.isFinite(t) || t < 0 || n && (t >
|
|
6823
|
+
let t = await e.readToken(Ho), n = J(e);
|
|
6824
|
+
if (!Number.isFinite(t) || t < 0 || n && (t > Bs || e.position + t > Bs)) return;
|
|
6755
6825
|
if (e.position + t > e.fileInfo.size) return n ? void 0 : {
|
|
6756
6826
|
ext: "mp3",
|
|
6757
6827
|
mime: "audio/mpeg"
|
|
6758
6828
|
};
|
|
6759
6829
|
try {
|
|
6760
|
-
await
|
|
6761
|
-
maximumLength: n ?
|
|
6830
|
+
await K(e, t, {
|
|
6831
|
+
maximumLength: n ? Bs : e.fileInfo.size,
|
|
6762
6832
|
reason: "ID3 payload"
|
|
6763
6833
|
});
|
|
6764
6834
|
} catch (e) {
|
|
6765
|
-
if (e instanceof
|
|
6835
|
+
if (e instanceof H) return;
|
|
6766
6836
|
throw e;
|
|
6767
6837
|
}
|
|
6768
|
-
return this.detectionReentryCount >=
|
|
6838
|
+
return this.detectionReentryCount >= Hs ? void 0 : (this.detectionReentryCount++, this.parseTokenizer(e, this.detectionReentryCount));
|
|
6769
6839
|
}
|
|
6770
6840
|
if (this.checkString("MP+")) return {
|
|
6771
6841
|
ext: "mpc",
|
|
@@ -6811,6 +6881,10 @@ var Gs = class e {
|
|
|
6811
6881
|
ext: "aif",
|
|
6812
6882
|
mime: "audio/aiff"
|
|
6813
6883
|
};
|
|
6884
|
+
if (this.checkString("caff") && this.check([0, 1], { offset: 4 }) && this.checkString("desc", { offset: 8 })) return {
|
|
6885
|
+
ext: "caf",
|
|
6886
|
+
mime: "audio/x-caf"
|
|
6887
|
+
};
|
|
6814
6888
|
if (this.checkString("icns", { offset: 0 })) return {
|
|
6815
6889
|
ext: "icns",
|
|
6816
6890
|
mime: "image/icns"
|
|
@@ -6820,11 +6894,11 @@ var Gs = class e {
|
|
|
6820
6894
|
75,
|
|
6821
6895
|
3,
|
|
6822
6896
|
4
|
|
6823
|
-
])) return
|
|
6897
|
+
])) return Ss(e);
|
|
6824
6898
|
if (this.checkString("OggS")) {
|
|
6825
6899
|
await e.ignore(28);
|
|
6826
6900
|
let t = /* @__PURE__ */ new Uint8Array(8);
|
|
6827
|
-
return await e.readBuffer(t),
|
|
6901
|
+
return await e.readBuffer(t), q(t, [
|
|
6828
6902
|
79,
|
|
6829
6903
|
112,
|
|
6830
6904
|
117,
|
|
@@ -6836,7 +6910,7 @@ var Gs = class e {
|
|
|
6836
6910
|
]) ? {
|
|
6837
6911
|
ext: "opus",
|
|
6838
6912
|
mime: "audio/ogg; codecs=opus"
|
|
6839
|
-
} :
|
|
6913
|
+
} : q(t, [
|
|
6840
6914
|
128,
|
|
6841
6915
|
116,
|
|
6842
6916
|
104,
|
|
@@ -6847,7 +6921,7 @@ var Gs = class e {
|
|
|
6847
6921
|
]) ? {
|
|
6848
6922
|
ext: "ogv",
|
|
6849
6923
|
mime: "video/ogg"
|
|
6850
|
-
} :
|
|
6924
|
+
} : q(t, [
|
|
6851
6925
|
1,
|
|
6852
6926
|
118,
|
|
6853
6927
|
105,
|
|
@@ -6858,7 +6932,7 @@ var Gs = class e {
|
|
|
6858
6932
|
]) ? {
|
|
6859
6933
|
ext: "ogm",
|
|
6860
6934
|
mime: "video/ogg"
|
|
6861
|
-
} :
|
|
6935
|
+
} : q(t, [
|
|
6862
6936
|
127,
|
|
6863
6937
|
70,
|
|
6864
6938
|
76,
|
|
@@ -6867,7 +6941,7 @@ var Gs = class e {
|
|
|
6867
6941
|
]) ? {
|
|
6868
6942
|
ext: "oga",
|
|
6869
6943
|
mime: "audio/ogg"
|
|
6870
|
-
} :
|
|
6944
|
+
} : q(t, [
|
|
6871
6945
|
83,
|
|
6872
6946
|
112,
|
|
6873
6947
|
101,
|
|
@@ -6878,7 +6952,7 @@ var Gs = class e {
|
|
|
6878
6952
|
]) ? {
|
|
6879
6953
|
ext: "spx",
|
|
6880
6954
|
mime: "audio/ogg"
|
|
6881
|
-
} :
|
|
6955
|
+
} : q(t, [
|
|
6882
6956
|
1,
|
|
6883
6957
|
118,
|
|
6884
6958
|
111,
|
|
@@ -6894,7 +6968,15 @@ var Gs = class e {
|
|
|
6894
6968
|
mime: "application/ogg"
|
|
6895
6969
|
};
|
|
6896
6970
|
}
|
|
6897
|
-
if (this.check([80, 75]) &&
|
|
6971
|
+
if (this.check([80, 75]) && [
|
|
6972
|
+
3,
|
|
6973
|
+
5,
|
|
6974
|
+
7
|
|
6975
|
+
].includes(this.buffer[2]) && [
|
|
6976
|
+
4,
|
|
6977
|
+
6,
|
|
6978
|
+
8
|
|
6979
|
+
].includes(this.buffer[3])) return {
|
|
6898
6980
|
ext: "zip",
|
|
6899
6981
|
mime: "application/zip"
|
|
6900
6982
|
};
|
|
@@ -6989,7 +7071,7 @@ var Gs = class e {
|
|
|
6989
7071
|
69,
|
|
6990
7072
|
223,
|
|
6991
7073
|
163
|
|
6992
|
-
])) return
|
|
7074
|
+
])) return Es(e);
|
|
6993
7075
|
if (this.checkString("SQLi")) return {
|
|
6994
7076
|
ext: "sqlite",
|
|
6995
7077
|
mime: "application/x-sqlite3"
|
|
@@ -7171,12 +7253,12 @@ var Gs = class e {
|
|
|
7171
7253
|
186,
|
|
7172
7254
|
190
|
|
7173
7255
|
])) {
|
|
7174
|
-
let e =
|
|
7256
|
+
let e = Wa.get(this.buffer, 4);
|
|
7175
7257
|
if (e > 0 && e <= 30) return {
|
|
7176
7258
|
ext: "macho",
|
|
7177
7259
|
mime: "application/x-mach-binary"
|
|
7178
7260
|
};
|
|
7179
|
-
if (
|
|
7261
|
+
if (Ua.get(this.buffer, 6) > 30) return {
|
|
7180
7262
|
ext: "class",
|
|
7181
7263
|
mime: "application/java-vm"
|
|
7182
7264
|
};
|
|
@@ -7231,7 +7313,7 @@ var Gs = class e {
|
|
|
7231
7313
|
mime: "model/stl"
|
|
7232
7314
|
};
|
|
7233
7315
|
if (this.checkString("AC")) {
|
|
7234
|
-
let e = new
|
|
7316
|
+
let e = new V(4, "latin1").get(this.buffer, 2);
|
|
7235
7317
|
if (/^\d+$/v.test(e) && e >= 1e3 && e <= 1050) return {
|
|
7236
7318
|
ext: "dwg",
|
|
7237
7319
|
mime: "image/vnd.dwg"
|
|
@@ -7245,7 +7327,7 @@ var Gs = class e {
|
|
|
7245
7327
|
ext: "blend",
|
|
7246
7328
|
mime: "application/x-blender"
|
|
7247
7329
|
};
|
|
7248
|
-
if (this.checkString("!<arch>")) return await e.ignore(8), await e.readToken(new
|
|
7330
|
+
if (this.checkString("!<arch>")) return await e.ignore(8), await e.readToken(new V(13, "ascii")) === "debian-binary" ? {
|
|
7249
7331
|
ext: "deb",
|
|
7250
7332
|
mime: "application/x-deb"
|
|
7251
7333
|
} : {
|
|
@@ -7271,7 +7353,7 @@ var Gs = class e {
|
|
|
7271
7353
|
10,
|
|
7272
7354
|
26,
|
|
7273
7355
|
10
|
|
7274
|
-
])) return
|
|
7356
|
+
])) return js(e);
|
|
7275
7357
|
if (this.check([
|
|
7276
7358
|
65,
|
|
7277
7359
|
82,
|
|
@@ -7341,7 +7423,7 @@ var Gs = class e {
|
|
|
7341
7423
|
mime: "image/x-xcf"
|
|
7342
7424
|
};
|
|
7343
7425
|
if (this.checkString("ftyp", { offset: 4 }) && this.buffer[8] & 96) {
|
|
7344
|
-
let e = new
|
|
7426
|
+
let e = new V(4, "latin1").get(this.buffer, 8).replace("\0", " ").trim();
|
|
7345
7427
|
switch (e) {
|
|
7346
7428
|
case "avif":
|
|
7347
7429
|
case "avis": return {
|
|
@@ -7489,7 +7571,7 @@ var Gs = class e {
|
|
|
7489
7571
|
17,
|
|
7490
7572
|
166,
|
|
7491
7573
|
217
|
|
7492
|
-
])) return
|
|
7574
|
+
])) return Ps(e);
|
|
7493
7575
|
if (this.check([
|
|
7494
7576
|
171,
|
|
7495
7577
|
75,
|
|
@@ -7563,7 +7645,7 @@ var Gs = class e {
|
|
|
7563
7645
|
10,
|
|
7564
7646
|
135,
|
|
7565
7647
|
10
|
|
7566
|
-
])) switch (await e.ignore(20), await e.readToken(new
|
|
7648
|
+
])) switch (await e.ignore(20), await e.readToken(new V(4, "ascii"))) {
|
|
7567
7649
|
case "jp2 ": return {
|
|
7568
7650
|
ext: "jp2",
|
|
7569
7651
|
mime: "image/jp2"
|
|
@@ -7619,6 +7701,10 @@ var Gs = class e {
|
|
|
7619
7701
|
ext: "cfb",
|
|
7620
7702
|
mime: "application/x-cfb"
|
|
7621
7703
|
};
|
|
7704
|
+
if (this.checkString("FRM8") && this.checkString("DSD ", { offset: 12 })) return {
|
|
7705
|
+
ext: "dff",
|
|
7706
|
+
mime: "audio/x-dff"
|
|
7707
|
+
};
|
|
7622
7708
|
if (await e.peekBuffer(this.buffer, {
|
|
7623
7709
|
length: Math.min(256, e.fileInfo.size),
|
|
7624
7710
|
mayBeLess: !0
|
|
@@ -7856,7 +7942,7 @@ var Gs = class e {
|
|
|
7856
7942
|
0,
|
|
7857
7943
|
0,
|
|
7858
7944
|
0
|
|
7859
|
-
], { offset: 257 }) &&
|
|
7945
|
+
], { offset: 257 }) && Vo(this.buffer)) return {
|
|
7860
7946
|
ext: "tar",
|
|
7861
7947
|
mime: "application/x-tar"
|
|
7862
7948
|
};
|
|
@@ -7892,15 +7978,15 @@ var Gs = class e {
|
|
|
7892
7978
|
position: 32769,
|
|
7893
7979
|
length: 5,
|
|
7894
7980
|
mayBeLess: !0
|
|
7895
|
-
}),
|
|
7981
|
+
}), q(t, Bo("CD001"))) return {
|
|
7896
7982
|
ext: "iso",
|
|
7897
7983
|
mime: "application/x-iso9660-image"
|
|
7898
7984
|
};
|
|
7899
7985
|
}
|
|
7900
|
-
}
|
|
7901
|
-
|
|
7902
|
-
this.buffer = new Uint8Array(
|
|
7903
|
-
let t =
|
|
7986
|
+
}
|
|
7987
|
+
async detectImprecise(e) {
|
|
7988
|
+
this.buffer = new Uint8Array(Fs);
|
|
7989
|
+
let t = qs(e.fileInfo.size);
|
|
7904
7990
|
if (await e.peekBuffer(this.buffer, {
|
|
7905
7991
|
length: Math.min(8, t),
|
|
7906
7992
|
mayBeLess: !0
|
|
@@ -7953,9 +8039,9 @@ var Gs = class e {
|
|
|
7953
8039
|
let t = this.scanMpeg(e);
|
|
7954
8040
|
if (t) return t;
|
|
7955
8041
|
}
|
|
7956
|
-
}
|
|
8042
|
+
}
|
|
7957
8043
|
async readTiffTag(e) {
|
|
7958
|
-
let t = await this.tokenizer.readToken(e ?
|
|
8044
|
+
let t = await this.tokenizer.readToken(e ? Ua : z);
|
|
7959
8045
|
switch (await this.tokenizer.ignore(10), t) {
|
|
7960
8046
|
case 50341: return {
|
|
7961
8047
|
ext: "arw",
|
|
@@ -7968,8 +8054,8 @@ var Gs = class e {
|
|
|
7968
8054
|
}
|
|
7969
8055
|
}
|
|
7970
8056
|
async readTiffIFD(e) {
|
|
7971
|
-
let t = await this.tokenizer.readToken(e ?
|
|
7972
|
-
if (!(t >
|
|
8057
|
+
let t = await this.tokenizer.readToken(e ? Ua : z);
|
|
8058
|
+
if (!(t > Vs) && !(J(this.tokenizer) && 2 + t * 12 > Ws)) for (let n = 0; n < t; ++n) {
|
|
7973
8059
|
let t = await this.readTiffTag(e);
|
|
7974
8060
|
if (t) return t;
|
|
7975
8061
|
}
|
|
@@ -7978,7 +8064,7 @@ var Gs = class e {
|
|
|
7978
8064
|
let t = {
|
|
7979
8065
|
ext: "tif",
|
|
7980
8066
|
mime: "image/tiff"
|
|
7981
|
-
}, n = (e ?
|
|
8067
|
+
}, n = (e ? Ua : z).get(this.buffer, 2), r = (e ? Wa : B).get(this.buffer, 4);
|
|
7982
8068
|
if (n === 42) {
|
|
7983
8069
|
if (r >= 6) {
|
|
7984
8070
|
if (this.checkString("CR", { offset: 8 })) return {
|
|
@@ -7986,29 +8072,29 @@ var Gs = class e {
|
|
|
7986
8072
|
mime: "image/x-canon-cr2"
|
|
7987
8073
|
};
|
|
7988
8074
|
if (r >= 8) {
|
|
7989
|
-
let t = (e ?
|
|
8075
|
+
let t = (e ? Ua : z).get(this.buffer, 8), n = (e ? Ua : z).get(this.buffer, 10);
|
|
7990
8076
|
if (t === 28 && n === 254 || t === 31 && n === 11) return {
|
|
7991
8077
|
ext: "nef",
|
|
7992
8078
|
mime: "image/x-nikon-nef"
|
|
7993
8079
|
};
|
|
7994
8080
|
}
|
|
7995
8081
|
}
|
|
7996
|
-
if (
|
|
7997
|
-
let n =
|
|
8082
|
+
if (J(this.tokenizer) && r > Us) return t;
|
|
8083
|
+
let n = J(this.tokenizer) ? Ws : this.tokenizer.fileInfo.size;
|
|
7998
8084
|
try {
|
|
7999
|
-
await
|
|
8085
|
+
await K(this.tokenizer, r, {
|
|
8000
8086
|
maximumLength: n,
|
|
8001
8087
|
reason: "TIFF IFD offset"
|
|
8002
8088
|
});
|
|
8003
8089
|
} catch (e) {
|
|
8004
|
-
if (e instanceof
|
|
8090
|
+
if (e instanceof H) return;
|
|
8005
8091
|
throw e;
|
|
8006
8092
|
}
|
|
8007
8093
|
let i;
|
|
8008
8094
|
try {
|
|
8009
8095
|
i = await this.readTiffIFD(e);
|
|
8010
8096
|
} catch (e) {
|
|
8011
|
-
if (e instanceof
|
|
8097
|
+
if (e instanceof H) return;
|
|
8012
8098
|
throw e;
|
|
8013
8099
|
}
|
|
8014
8100
|
return i ?? t;
|
|
@@ -8061,34 +8147,34 @@ var Gs = class e {
|
|
|
8061
8147
|
}
|
|
8062
8148
|
}
|
|
8063
8149
|
};
|
|
8064
|
-
new Set(
|
|
8150
|
+
new Set(Uo), new Set(Wo);
|
|
8065
8151
|
//#endregion
|
|
8066
8152
|
//#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared.es.js
|
|
8067
8153
|
function Y(e) {
|
|
8068
8154
|
return new Map(Object.entries(e));
|
|
8069
8155
|
}
|
|
8070
|
-
var
|
|
8156
|
+
var ec = {
|
|
8071
8157
|
lang: void 0,
|
|
8072
8158
|
message: void 0,
|
|
8073
8159
|
abortEarly: void 0,
|
|
8074
8160
|
abortPipeEarly: void 0
|
|
8075
8161
|
};
|
|
8076
8162
|
/* @__NO_SIDE_EFFECTS__ */
|
|
8077
|
-
function
|
|
8163
|
+
function tc(e) {
|
|
8078
8164
|
return e ? {
|
|
8079
8165
|
lang: e?.lang ?? void 0,
|
|
8080
8166
|
message: e?.message,
|
|
8081
8167
|
abortEarly: e?.abortEarly ?? void 0,
|
|
8082
8168
|
abortPipeEarly: e?.abortPipeEarly ?? void 0
|
|
8083
|
-
} :
|
|
8169
|
+
} : ec;
|
|
8084
8170
|
}
|
|
8085
8171
|
/* @__NO_SIDE_EFFECTS__ */
|
|
8086
|
-
function
|
|
8172
|
+
function nc(e) {
|
|
8087
8173
|
let t = typeof e;
|
|
8088
8174
|
return t === "string" ? `"${e}"` : t === "number" || t === "bigint" || t === "boolean" ? `${e}` : t === "object" || t === "function" ? (e && Object.getPrototypeOf(e)?.constructor?.name) ?? "null" : t;
|
|
8089
8175
|
}
|
|
8090
8176
|
function X(e, t, n, r, i) {
|
|
8091
|
-
let a = i && "input" in i ? i.input : n.value, o = i?.expected ?? e.expects ?? null, s = i?.received ?? /* @__PURE__ */
|
|
8177
|
+
let a = i && "input" in i ? i.input : n.value, o = i?.expected ?? e.expects ?? null, s = i?.received ?? /* @__PURE__ */ nc(a), c = {
|
|
8092
8178
|
kind: e.kind,
|
|
8093
8179
|
type: e.type,
|
|
8094
8180
|
input: a,
|
|
@@ -8105,47 +8191,47 @@ function X(e, t, n, r, i) {
|
|
|
8105
8191
|
u !== void 0 && (c.message = typeof u == "function" ? u(c) : u), l && (n.typed = !1), n.issues ? n.issues.push(c) : n.issues = [c];
|
|
8106
8192
|
}
|
|
8107
8193
|
/* @__NO_SIDE_EFFECTS__ */
|
|
8108
|
-
function
|
|
8194
|
+
function rc(e, t) {
|
|
8109
8195
|
return e === t || Number.isNaN(e) && Number.isNaN(t);
|
|
8110
8196
|
}
|
|
8111
8197
|
/* @__NO_SIDE_EFFECTS__ */
|
|
8112
|
-
function
|
|
8198
|
+
function ic(e, t) {
|
|
8113
8199
|
let n = [...new Set(e)];
|
|
8114
8200
|
return n.length > 1 ? `(${n.join(` ${t} `)})` : n[0] ?? "never";
|
|
8115
8201
|
}
|
|
8116
|
-
function
|
|
8202
|
+
function ac(e) {
|
|
8117
8203
|
return e["~standard"] = {
|
|
8118
8204
|
version: 1,
|
|
8119
8205
|
vendor: "valibot",
|
|
8120
|
-
validate: (t) => e["~run"]({ value: t }, /* @__PURE__ */
|
|
8206
|
+
validate: (t) => e["~run"]({ value: t }, /* @__PURE__ */ tc())
|
|
8121
8207
|
}, e;
|
|
8122
8208
|
}
|
|
8123
8209
|
/* @__NO_SIDE_EFFECTS__ */
|
|
8124
|
-
function
|
|
8210
|
+
function oc(e, t, n) {
|
|
8125
8211
|
return typeof e.fallback == "function" ? e.fallback(t, n) : e.fallback;
|
|
8126
8212
|
}
|
|
8127
8213
|
/* @__NO_SIDE_EFFECTS__ */
|
|
8128
|
-
function
|
|
8214
|
+
function sc(e, t, n) {
|
|
8129
8215
|
return typeof e.default == "function" ? e.default(t, n) : e.default;
|
|
8130
8216
|
}
|
|
8131
8217
|
/* @__NO_SIDE_EFFECTS__ */
|
|
8132
|
-
function
|
|
8133
|
-
return
|
|
8218
|
+
function cc(e, t) {
|
|
8219
|
+
return ac({
|
|
8134
8220
|
kind: "schema",
|
|
8135
8221
|
type: "literal",
|
|
8136
|
-
reference:
|
|
8137
|
-
expects: /* @__PURE__ */
|
|
8222
|
+
reference: cc,
|
|
8223
|
+
expects: /* @__PURE__ */ nc(e),
|
|
8138
8224
|
async: !1,
|
|
8139
8225
|
literal: e,
|
|
8140
8226
|
message: t,
|
|
8141
8227
|
"~run"(e, t) {
|
|
8142
|
-
return /* @__PURE__ */
|
|
8228
|
+
return /* @__PURE__ */ rc(e.value, this.literal) ? e.typed = !0 : X(this, "type", e, t), e;
|
|
8143
8229
|
}
|
|
8144
8230
|
});
|
|
8145
8231
|
}
|
|
8146
8232
|
/* @__NO_SIDE_EFFECTS__ */
|
|
8147
8233
|
function Z(e, t) {
|
|
8148
|
-
return
|
|
8234
|
+
return ac({
|
|
8149
8235
|
kind: "schema",
|
|
8150
8236
|
type: "nullable",
|
|
8151
8237
|
reference: Z,
|
|
@@ -8154,16 +8240,16 @@ function Z(e, t) {
|
|
|
8154
8240
|
wrapped: e,
|
|
8155
8241
|
default: t,
|
|
8156
8242
|
"~run"(e, t) {
|
|
8157
|
-
return e.value === null && (this.default !== void 0 && (e.value = /* @__PURE__ */
|
|
8243
|
+
return e.value === null && (this.default !== void 0 && (e.value = /* @__PURE__ */ sc(this, e, t)), e.value === null) ? (e.typed = !0, e) : this.wrapped["~run"](e, t);
|
|
8158
8244
|
}
|
|
8159
8245
|
});
|
|
8160
8246
|
}
|
|
8161
8247
|
/* @__NO_SIDE_EFFECTS__ */
|
|
8162
|
-
function
|
|
8163
|
-
return
|
|
8248
|
+
function lc(e) {
|
|
8249
|
+
return ac({
|
|
8164
8250
|
kind: "schema",
|
|
8165
8251
|
type: "number",
|
|
8166
|
-
reference:
|
|
8252
|
+
reference: lc,
|
|
8167
8253
|
expects: "number",
|
|
8168
8254
|
async: !1,
|
|
8169
8255
|
message: e,
|
|
@@ -8173,26 +8259,26 @@ function tc(e) {
|
|
|
8173
8259
|
});
|
|
8174
8260
|
}
|
|
8175
8261
|
/* @__NO_SIDE_EFFECTS__ */
|
|
8176
|
-
function
|
|
8177
|
-
return
|
|
8262
|
+
function uc(e, t) {
|
|
8263
|
+
return ac({
|
|
8178
8264
|
kind: "schema",
|
|
8179
8265
|
type: "optional",
|
|
8180
|
-
reference:
|
|
8266
|
+
reference: uc,
|
|
8181
8267
|
expects: `(${e.expects} | undefined)`,
|
|
8182
8268
|
async: !1,
|
|
8183
8269
|
wrapped: e,
|
|
8184
8270
|
default: t,
|
|
8185
8271
|
"~run"(e, t) {
|
|
8186
|
-
return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */
|
|
8272
|
+
return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */ sc(this, e, t)), e.value === void 0) ? (e.typed = !0, e) : this.wrapped["~run"](e, t);
|
|
8187
8273
|
}
|
|
8188
8274
|
});
|
|
8189
8275
|
}
|
|
8190
8276
|
/* @__NO_SIDE_EFFECTS__ */
|
|
8191
|
-
function
|
|
8192
|
-
return
|
|
8277
|
+
function dc(e, t) {
|
|
8278
|
+
return ac({
|
|
8193
8279
|
kind: "schema",
|
|
8194
8280
|
type: "strict_object",
|
|
8195
|
-
reference:
|
|
8281
|
+
reference: dc,
|
|
8196
8282
|
expects: "Object",
|
|
8197
8283
|
async: !1,
|
|
8198
8284
|
entries: e,
|
|
@@ -8204,7 +8290,7 @@ function rc(e, t) {
|
|
|
8204
8290
|
for (let r in this.entries) {
|
|
8205
8291
|
let i = this.entries[r];
|
|
8206
8292
|
if (r in n || (i.type === "exact_optional" || i.type === "optional" || i.type === "nullish") && i.default !== void 0) {
|
|
8207
|
-
let a = r in n ? n[r] : /* @__PURE__ */
|
|
8293
|
+
let a = r in n ? n[r] : /* @__PURE__ */ sc(i), o = i["~run"]({ value: a }, t);
|
|
8208
8294
|
if (o.issues) {
|
|
8209
8295
|
let i = {
|
|
8210
8296
|
type: "object",
|
|
@@ -8220,7 +8306,7 @@ function rc(e, t) {
|
|
|
8220
8306
|
}
|
|
8221
8307
|
}
|
|
8222
8308
|
o.typed || (e.typed = !1), e.value[r] = o.value;
|
|
8223
|
-
} else if (i.fallback !== void 0) e.value[r] = /* @__PURE__ */
|
|
8309
|
+
} else if (i.fallback !== void 0) e.value[r] = /* @__PURE__ */ oc(i);
|
|
8224
8310
|
else if (i.type !== "exact_optional" && i.type !== "optional" && i.type !== "nullish" && (X(this, "key", e, t, {
|
|
8225
8311
|
input: void 0,
|
|
8226
8312
|
expected: `"${r}"`,
|
|
@@ -8256,7 +8342,7 @@ function rc(e, t) {
|
|
|
8256
8342
|
}
|
|
8257
8343
|
/* @__NO_SIDE_EFFECTS__ */
|
|
8258
8344
|
function Q(e) {
|
|
8259
|
-
return
|
|
8345
|
+
return ac({
|
|
8260
8346
|
kind: "schema",
|
|
8261
8347
|
type: "string",
|
|
8262
8348
|
reference: Q,
|
|
@@ -8269,19 +8355,19 @@ function Q(e) {
|
|
|
8269
8355
|
});
|
|
8270
8356
|
}
|
|
8271
8357
|
/* @__NO_SIDE_EFFECTS__ */
|
|
8272
|
-
function
|
|
8358
|
+
function fc(e) {
|
|
8273
8359
|
let t;
|
|
8274
8360
|
if (e) for (let n of e) if (t) for (let e of n.issues) t.push(e);
|
|
8275
8361
|
else t = n.issues;
|
|
8276
8362
|
return t;
|
|
8277
8363
|
}
|
|
8278
8364
|
/* @__NO_SIDE_EFFECTS__ */
|
|
8279
|
-
function
|
|
8280
|
-
return
|
|
8365
|
+
function pc(e, t) {
|
|
8366
|
+
return ac({
|
|
8281
8367
|
kind: "schema",
|
|
8282
8368
|
type: "union",
|
|
8283
|
-
reference:
|
|
8284
|
-
expects: /* @__PURE__ */
|
|
8369
|
+
reference: pc,
|
|
8370
|
+
expects: /* @__PURE__ */ ic(e.map((e) => e.expects), "|"),
|
|
8285
8371
|
async: !1,
|
|
8286
8372
|
options: e,
|
|
8287
8373
|
message: t,
|
|
@@ -8300,26 +8386,26 @@ function ac(e, t) {
|
|
|
8300
8386
|
if (n) return n;
|
|
8301
8387
|
if (r) {
|
|
8302
8388
|
if (r.length === 1) return r[0];
|
|
8303
|
-
X(this, "type", e, t, { issues: /* @__PURE__ */
|
|
8389
|
+
X(this, "type", e, t, { issues: /* @__PURE__ */ fc(r) }), e.typed = !0;
|
|
8304
8390
|
} else if (i?.length === 1) return i[0];
|
|
8305
|
-
else X(this, "type", e, t, { issues: /* @__PURE__ */
|
|
8391
|
+
else X(this, "type", e, t, { issues: /* @__PURE__ */ fc(i) });
|
|
8306
8392
|
return e;
|
|
8307
8393
|
}
|
|
8308
8394
|
});
|
|
8309
8395
|
}
|
|
8310
|
-
var
|
|
8396
|
+
var mc = {
|
|
8311
8397
|
id: /* @__PURE__ */ Q(),
|
|
8312
|
-
label: /* @__PURE__ */
|
|
8313
|
-
en: /* @__PURE__ */
|
|
8314
|
-
es: /* @__PURE__ */
|
|
8398
|
+
label: /* @__PURE__ */ dc({
|
|
8399
|
+
en: /* @__PURE__ */ uc(/* @__PURE__ */ Q()),
|
|
8400
|
+
es: /* @__PURE__ */ uc(/* @__PURE__ */ Q())
|
|
8315
8401
|
}),
|
|
8316
|
-
description: /* @__PURE__ */
|
|
8317
|
-
en: /* @__PURE__ */
|
|
8318
|
-
es: /* @__PURE__ */
|
|
8402
|
+
description: /* @__PURE__ */ dc({
|
|
8403
|
+
en: /* @__PURE__ */ uc(/* @__PURE__ */ Q()),
|
|
8404
|
+
es: /* @__PURE__ */ uc(/* @__PURE__ */ Q())
|
|
8319
8405
|
}),
|
|
8320
8406
|
icon: /* @__PURE__ */ Z(/* @__PURE__ */ Q()),
|
|
8321
8407
|
iconDark: /* @__PURE__ */ Z(/* @__PURE__ */ Q())
|
|
8322
|
-
}, $ = (e) => /* @__PURE__ */
|
|
8408
|
+
}, $ = (e) => /* @__PURE__ */ pc(e.map((e) => /* @__PURE__ */ cc(e))), hc = $([
|
|
8323
8409
|
"app",
|
|
8324
8410
|
"connector",
|
|
8325
8411
|
"connectorConnection",
|
|
@@ -8341,31 +8427,31 @@ var oc = {
|
|
|
8341
8427
|
"presenter",
|
|
8342
8428
|
"presenterPresentation",
|
|
8343
8429
|
"tool"
|
|
8344
|
-
]),
|
|
8430
|
+
]), gc = $([
|
|
8345
8431
|
"danger",
|
|
8346
8432
|
"success",
|
|
8347
8433
|
"warning"
|
|
8348
|
-
]),
|
|
8434
|
+
]), _c = $([
|
|
8349
8435
|
"alpha",
|
|
8350
8436
|
"beta",
|
|
8351
8437
|
"releaseCandidate",
|
|
8352
8438
|
"generalAvailability"
|
|
8353
|
-
]),
|
|
8354
|
-
color:
|
|
8439
|
+
]), vc = /* @__PURE__ */ dc({
|
|
8440
|
+
color: gc,
|
|
8355
8441
|
label: /* @__PURE__ */ Q()
|
|
8356
|
-
}),
|
|
8357
|
-
...
|
|
8358
|
-
typeId:
|
|
8442
|
+
}), yc = {
|
|
8443
|
+
...mc,
|
|
8444
|
+
typeId: hc
|
|
8359
8445
|
};
|
|
8360
|
-
({ ...
|
|
8361
|
-
var
|
|
8362
|
-
...
|
|
8363
|
-
firstCreatedAt: /* @__PURE__ */ Z(/* @__PURE__ */
|
|
8364
|
-
lastUpdatedAt: /* @__PURE__ */ Z(/* @__PURE__ */
|
|
8365
|
-
status: /* @__PURE__ */ Z(
|
|
8366
|
-
statusId: /* @__PURE__ */ Z(
|
|
8446
|
+
({ ...yc });
|
|
8447
|
+
var bc = {
|
|
8448
|
+
...yc,
|
|
8449
|
+
firstCreatedAt: /* @__PURE__ */ Z(/* @__PURE__ */ lc()),
|
|
8450
|
+
lastUpdatedAt: /* @__PURE__ */ Z(/* @__PURE__ */ lc()),
|
|
8451
|
+
status: /* @__PURE__ */ Z(vc),
|
|
8452
|
+
statusId: /* @__PURE__ */ Z(_c)
|
|
8367
8453
|
};
|
|
8368
|
-
({ ...
|
|
8454
|
+
({ ...bc }), Y({ en: "Data Positioning Events" }), Y({ en: "Delimited Text" }), Y({ en: "JSON" }), Y({ en: "Markdown" }), Y({ en: "SPSS" }), Y({ en: "Plain Text" }), Y({ en: "XLSX" }), Y({ en: "XML" }), Y({ en: "Newline" }), Y({ en: "Carriage Return" }), Y({ en: "Carriage Return/Newline" }), Y({ en: "Colon" }), Y({ en: "Comma" }), Y({ en: "Exclamation Mark" }), Y({ en: "Record Separator" }), Y({ en: "Semicolon" }), Y({ en: "Space" }), Y({ en: "Tab" }), Y({ en: "Underscore" }), Y({ en: "Unit Separator" }), Y({ en: "Vertical Bar" }), $([
|
|
8369
8455
|
"app",
|
|
8370
8456
|
"engine",
|
|
8371
8457
|
"connector",
|
|
@@ -8373,14 +8459,14 @@ var fc = {
|
|
|
8373
8459
|
"presenter",
|
|
8374
8460
|
"tool"
|
|
8375
8461
|
]);
|
|
8376
|
-
var
|
|
8377
|
-
...
|
|
8462
|
+
var xc = {
|
|
8463
|
+
...bc,
|
|
8378
8464
|
vendorAccountURL: /* @__PURE__ */ Z(/* @__PURE__ */ Q()),
|
|
8379
8465
|
vendorDocumentationURL: /* @__PURE__ */ Z(/* @__PURE__ */ Q()),
|
|
8380
8466
|
vendorHomeURL: /* @__PURE__ */ Z(/* @__PURE__ */ Q()),
|
|
8381
8467
|
version: /* @__PURE__ */ Q()
|
|
8382
8468
|
};
|
|
8383
|
-
({ ...
|
|
8469
|
+
({ ...xc }), $([
|
|
8384
8470
|
"abortOperation",
|
|
8385
8471
|
"auditObjectContent",
|
|
8386
8472
|
"createObject",
|
|
@@ -8401,6 +8487,10 @@ var pc = {
|
|
|
8401
8487
|
"curatedDataset",
|
|
8402
8488
|
"database",
|
|
8403
8489
|
"fileStore"
|
|
8490
|
+
]), $([
|
|
8491
|
+
"apiEndpoint",
|
|
8492
|
+
"file",
|
|
8493
|
+
"table"
|
|
8404
8494
|
]), $([
|
|
8405
8495
|
"bidirectional",
|
|
8406
8496
|
"destination",
|
|
@@ -8411,32 +8501,28 @@ var pc = {
|
|
|
8411
8501
|
"disabled",
|
|
8412
8502
|
"oAuth2",
|
|
8413
8503
|
"none"
|
|
8414
|
-
]), { ...
|
|
8415
|
-
|
|
8416
|
-
"render",
|
|
8417
|
-
"setColorMode"
|
|
8418
|
-
]), { ...pc };
|
|
8419
|
-
var mc = 2048, hc = class extends Error {
|
|
8504
|
+
]), { ...xc }, $(["list"]), { ...xc };
|
|
8505
|
+
var Sc = 2048, Cc = class extends Error {
|
|
8420
8506
|
data;
|
|
8421
8507
|
locator;
|
|
8422
8508
|
constructor(e, t, n, r) {
|
|
8423
8509
|
super(e, r), this.name = "DPUseError", this.data = n, this.locator = t;
|
|
8424
8510
|
}
|
|
8425
|
-
},
|
|
8511
|
+
}, wc = class extends Cc {
|
|
8426
8512
|
constructor(e, t, n, r) {
|
|
8427
8513
|
super(e, t, n, r), this.name = "FetchError";
|
|
8428
8514
|
}
|
|
8429
8515
|
};
|
|
8430
|
-
async function
|
|
8516
|
+
async function Tc(e, t, n) {
|
|
8431
8517
|
let r = ` - ${e.statusText}`, i = `${t} Response status '${String(e.status)}${e.statusText ? r : ""}' received.`, a;
|
|
8432
8518
|
try {
|
|
8433
8519
|
a = await e.text();
|
|
8434
8520
|
} catch (e) {
|
|
8435
|
-
a = `<body unavailable: ${
|
|
8521
|
+
a = `<body unavailable: ${Ec(e).message}>`;
|
|
8436
8522
|
}
|
|
8437
|
-
return new
|
|
8523
|
+
return new wc(i, n, { body: Dc(a) });
|
|
8438
8524
|
}
|
|
8439
|
-
function
|
|
8525
|
+
function Ec(e) {
|
|
8440
8526
|
if (e instanceof Error) return e;
|
|
8441
8527
|
if (typeof e == "string") return Error(e);
|
|
8442
8528
|
if (typeof e == "number" || typeof e == "boolean" || typeof e == "bigint") return Error(String(e));
|
|
@@ -8448,10 +8534,15 @@ function vc(e) {
|
|
|
8448
8534
|
}
|
|
8449
8535
|
return /* @__PURE__ */ Error("Unknown error");
|
|
8450
8536
|
}
|
|
8451
|
-
function
|
|
8452
|
-
if (e != null && e !== "") return e.length >
|
|
8537
|
+
function Dc(e) {
|
|
8538
|
+
if (e != null && e !== "") return e.length > Sc ? `${e.slice(0, Sc)}... [truncated]` : e;
|
|
8453
8539
|
}
|
|
8454
|
-
|
|
8540
|
+
$([
|
|
8541
|
+
"list",
|
|
8542
|
+
"render",
|
|
8543
|
+
"setColorMode"
|
|
8544
|
+
]), { ...xc };
|
|
8545
|
+
var Oc = {
|
|
8455
8546
|
ascii: {
|
|
8456
8547
|
id: "ascii",
|
|
8457
8548
|
groupId: null,
|
|
@@ -8883,18 +8974,114 @@ var bc = {
|
|
|
8883
8974
|
decoderId: "windows-1257"
|
|
8884
8975
|
}
|
|
8885
8976
|
};
|
|
8886
|
-
function
|
|
8887
|
-
return Object.hasOwn(
|
|
8977
|
+
function kc(e) {
|
|
8978
|
+
return Object.hasOwn(Oc, e);
|
|
8888
8979
|
}
|
|
8889
|
-
function
|
|
8890
|
-
return
|
|
8980
|
+
function Ac(e) {
|
|
8981
|
+
return kc(e) ? Oc[e].decoderId ?? e : e;
|
|
8982
|
+
}
|
|
8983
|
+
new Set(Object.values({
|
|
8984
|
+
archives: [
|
|
8985
|
+
"7z",
|
|
8986
|
+
"bz2",
|
|
8987
|
+
"gz",
|
|
8988
|
+
"rar",
|
|
8989
|
+
"tar",
|
|
8990
|
+
"tgz",
|
|
8991
|
+
"xz",
|
|
8992
|
+
"zip"
|
|
8993
|
+
],
|
|
8994
|
+
audio: [
|
|
8995
|
+
"aac",
|
|
8996
|
+
"flac",
|
|
8997
|
+
"m4a",
|
|
8998
|
+
"mp3",
|
|
8999
|
+
"ogg",
|
|
9000
|
+
"wav"
|
|
9001
|
+
],
|
|
9002
|
+
documents: [
|
|
9003
|
+
"doc",
|
|
9004
|
+
"docx",
|
|
9005
|
+
"key",
|
|
9006
|
+
"numbers",
|
|
9007
|
+
"odp",
|
|
9008
|
+
"odt",
|
|
9009
|
+
"pages",
|
|
9010
|
+
"pdf",
|
|
9011
|
+
"ppt",
|
|
9012
|
+
"pptx",
|
|
9013
|
+
"rtf"
|
|
9014
|
+
],
|
|
9015
|
+
images: [
|
|
9016
|
+
"bmp",
|
|
9017
|
+
"gif",
|
|
9018
|
+
"heic",
|
|
9019
|
+
"ico",
|
|
9020
|
+
"jpeg",
|
|
9021
|
+
"jpg",
|
|
9022
|
+
"png",
|
|
9023
|
+
"psd",
|
|
9024
|
+
"svg",
|
|
9025
|
+
"tif",
|
|
9026
|
+
"tiff",
|
|
9027
|
+
"webp"
|
|
9028
|
+
],
|
|
9029
|
+
programs: [
|
|
9030
|
+
"app",
|
|
9031
|
+
"bin",
|
|
9032
|
+
"dll",
|
|
9033
|
+
"dmg",
|
|
9034
|
+
"exe",
|
|
9035
|
+
"iso",
|
|
9036
|
+
"msi",
|
|
9037
|
+
"so"
|
|
9038
|
+
],
|
|
9039
|
+
unreadDataFormats: [
|
|
9040
|
+
"arrow",
|
|
9041
|
+
"avro",
|
|
9042
|
+
"db",
|
|
9043
|
+
"ods",
|
|
9044
|
+
"parquet",
|
|
9045
|
+
"por",
|
|
9046
|
+
"sav",
|
|
9047
|
+
"sqlite",
|
|
9048
|
+
"xls",
|
|
9049
|
+
"xlsm",
|
|
9050
|
+
"xlsx",
|
|
9051
|
+
"xltm",
|
|
9052
|
+
"xltx"
|
|
9053
|
+
],
|
|
9054
|
+
video: [
|
|
9055
|
+
"avi",
|
|
9056
|
+
"m4v",
|
|
9057
|
+
"mkv",
|
|
9058
|
+
"mov",
|
|
9059
|
+
"mp4",
|
|
9060
|
+
"webm",
|
|
9061
|
+
"wmv"
|
|
9062
|
+
]
|
|
9063
|
+
}).flat());
|
|
9064
|
+
function jc(e) {
|
|
9065
|
+
if (!e) return;
|
|
9066
|
+
let t = Mc(e);
|
|
9067
|
+
return t === void 0 ? void 0 : e.slice(t + 1);
|
|
9068
|
+
}
|
|
9069
|
+
function Mc(e) {
|
|
9070
|
+
let t = e.lastIndexOf("/") + 1, n = e.lastIndexOf(".");
|
|
9071
|
+
return n > t && n < e.length - 1 ? n : void 0;
|
|
8891
9072
|
}
|
|
8892
9073
|
//#endregion
|
|
8893
9074
|
//#region src/index.ts
|
|
8894
|
-
var
|
|
9075
|
+
var Nc = .2, Pc = {
|
|
8895
9076
|
id: "utf-8",
|
|
8896
9077
|
confidenceLevel: void 0
|
|
8897
|
-
},
|
|
9078
|
+
}, Fc = {
|
|
9079
|
+
log: "text",
|
|
9080
|
+
markdown: "markdown",
|
|
9081
|
+
md: "markdown",
|
|
9082
|
+
text: "text",
|
|
9083
|
+
txt: "text"
|
|
9084
|
+
}, Ic = {
|
|
8898
9085
|
arrow: {
|
|
8899
9086
|
label: "Columnar format for tables of data.",
|
|
8900
9087
|
isAutoDetectable: !0,
|
|
@@ -9059,17 +9246,18 @@ var Cc = .2, wc = {
|
|
|
9059
9246
|
isSupported: !1,
|
|
9060
9247
|
notes: ""
|
|
9061
9248
|
}
|
|
9062
|
-
},
|
|
9063
|
-
async previewFile(e, t, n, r =
|
|
9249
|
+
}, Lc = class {
|
|
9250
|
+
async previewFile(e, t, n, r = Nc) {
|
|
9064
9251
|
let i = await fetch(encodeURI(e), {
|
|
9065
9252
|
headers: { Range: `bytes=0-${String(n ?? 4095)}` },
|
|
9066
9253
|
signal: t
|
|
9067
9254
|
});
|
|
9068
|
-
if (!i.ok) throw await
|
|
9069
|
-
|
|
9255
|
+
if (!i.ok) throw await Tc(i, `Failed to fetch '${e}' file.`, "dpuse-tool-file-previewer.previewRemoteFile");
|
|
9256
|
+
let a = new Uint8Array(await i.arrayBuffer()), o = jc(new URL(e).pathname)?.toLowerCase();
|
|
9257
|
+
return await Rc(a, o, r);
|
|
9070
9258
|
}
|
|
9071
9259
|
};
|
|
9072
|
-
async function
|
|
9260
|
+
async function Rc(e, t, n) {
|
|
9073
9261
|
if (e.length === 0) return {
|
|
9074
9262
|
bytes: e,
|
|
9075
9263
|
dataFormatId: void 0,
|
|
@@ -9079,39 +9267,39 @@ async function Dc(e, t) {
|
|
|
9079
9267
|
fileTypeConfig: void 0,
|
|
9080
9268
|
text: void 0
|
|
9081
9269
|
};
|
|
9082
|
-
let
|
|
9083
|
-
if (
|
|
9084
|
-
let
|
|
9270
|
+
let r = await Qs(e);
|
|
9271
|
+
if (r == null) {
|
|
9272
|
+
let i = zc(e, n), a = Bc(e, i[0] ?? Pc);
|
|
9085
9273
|
return {
|
|
9086
9274
|
bytes: e,
|
|
9087
|
-
dataFormatId:
|
|
9088
|
-
encodingId:
|
|
9089
|
-
encodingConfidenceLevel:
|
|
9090
|
-
encodingCandidates:
|
|
9091
|
-
fileTypeConfig:
|
|
9092
|
-
text:
|
|
9275
|
+
dataFormatId: (t == null ? void 0 : Fc[t]) ?? (Vc(a.text) ? "json" : "dtv"),
|
|
9276
|
+
encodingId: a.encoding.id,
|
|
9277
|
+
encodingConfidenceLevel: a.encoding.confidenceLevel,
|
|
9278
|
+
encodingCandidates: i,
|
|
9279
|
+
fileTypeConfig: r,
|
|
9280
|
+
text: a.text
|
|
9093
9281
|
};
|
|
9094
9282
|
}
|
|
9095
|
-
let
|
|
9096
|
-
return
|
|
9283
|
+
let i = Ic[r.ext];
|
|
9284
|
+
return i == null ? {
|
|
9097
9285
|
bytes: e,
|
|
9098
9286
|
dataFormatId: void 0,
|
|
9099
9287
|
encodingId: void 0,
|
|
9100
9288
|
encodingConfidenceLevel: void 0,
|
|
9101
9289
|
encodingCandidates: void 0,
|
|
9102
|
-
fileTypeConfig:
|
|
9290
|
+
fileTypeConfig: r,
|
|
9103
9291
|
text: void 0
|
|
9104
9292
|
} : {
|
|
9105
9293
|
bytes: e,
|
|
9106
|
-
dataFormatId:
|
|
9294
|
+
dataFormatId: i.isSupported ? r.ext : void 0,
|
|
9107
9295
|
encodingId: void 0,
|
|
9108
9296
|
encodingConfidenceLevel: void 0,
|
|
9109
9297
|
encodingCandidates: void 0,
|
|
9110
|
-
fileTypeConfig:
|
|
9298
|
+
fileTypeConfig: r,
|
|
9111
9299
|
text: void 0
|
|
9112
9300
|
};
|
|
9113
9301
|
}
|
|
9114
|
-
function
|
|
9302
|
+
function zc(e, t) {
|
|
9115
9303
|
if (e[0] === 239 && e[1] === 187 && e[2] === 191) return [{
|
|
9116
9304
|
confidenceLevel: 1,
|
|
9117
9305
|
id: "UTF-8-SIG"
|
|
@@ -9124,27 +9312,27 @@ function Oc(e, t) {
|
|
|
9124
9312
|
confidenceLevel: 1,
|
|
9125
9313
|
id: "utf-16-le"
|
|
9126
9314
|
}];
|
|
9127
|
-
let n =
|
|
9128
|
-
for (let { confidence: e, encoding: t } of n) t != null &&
|
|
9315
|
+
let n = Oa(e, { minimumThreshold: 0 }), r = [];
|
|
9316
|
+
for (let { confidence: e, encoding: t } of n) t != null && kc(t) && r.push({
|
|
9129
9317
|
confidenceLevel: e,
|
|
9130
9318
|
id: t
|
|
9131
9319
|
});
|
|
9132
9320
|
return r.filter(({ confidenceLevel: e = 0 }, n) => n === 0 || e >= t);
|
|
9133
9321
|
}
|
|
9134
|
-
function
|
|
9322
|
+
function Bc(e, t) {
|
|
9135
9323
|
try {
|
|
9136
9324
|
return {
|
|
9137
9325
|
encoding: t,
|
|
9138
|
-
text: new TextDecoder(
|
|
9326
|
+
text: new TextDecoder(Ac(t.id)).decode(Hc(e))
|
|
9139
9327
|
};
|
|
9140
9328
|
} catch {
|
|
9141
9329
|
return {
|
|
9142
|
-
encoding:
|
|
9143
|
-
text: new TextDecoder(
|
|
9330
|
+
encoding: Pc,
|
|
9331
|
+
text: new TextDecoder(Pc.id, { fatal: !1 }).decode(Hc(e))
|
|
9144
9332
|
};
|
|
9145
9333
|
}
|
|
9146
9334
|
}
|
|
9147
|
-
function
|
|
9335
|
+
function Vc(e) {
|
|
9148
9336
|
let t = e.trimStart();
|
|
9149
9337
|
if (t.length > 2) {
|
|
9150
9338
|
let e = t[0], n = e === "{", r = e === "[", i = /"\s*:\s*/.test(t), a = /\b(?:true|false|null)\b/.test(t), o = t.includes("\"");
|
|
@@ -9152,7 +9340,7 @@ function Ac(e) {
|
|
|
9152
9340
|
}
|
|
9153
9341
|
return !1;
|
|
9154
9342
|
}
|
|
9155
|
-
function
|
|
9343
|
+
function Hc(e) {
|
|
9156
9344
|
let t = e, n = t.length;
|
|
9157
9345
|
for (let e = n - 1; e >= 0; e--) {
|
|
9158
9346
|
let n = t[e];
|
|
@@ -9168,4 +9356,4 @@ function jc(e) {
|
|
|
9168
9356
|
return t;
|
|
9169
9357
|
}
|
|
9170
9358
|
//#endregion
|
|
9171
|
-
export {
|
|
9359
|
+
export { Lc as Tool };
|