@datapos/datapos-tool-file-operators 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,24 +1,24 @@
1
- function F0(i) {
1
+ function S0(i) {
2
2
  return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
3
3
  }
4
- var E = {}, G = {}, c0;
4
+ var E = {}, G = {}, n0;
5
5
  function B0() {
6
- return c0 || (c0 = 1, Object.defineProperty(G, "__esModule", { value: !0 }), G.default = () => {
6
+ return n0 || (n0 = 1, Object.defineProperty(G, "__esModule", { value: !0 }), G.default = () => {
7
7
  throw new Error("File system is not available");
8
8
  }), G;
9
9
  }
10
- var R = {}, J = {}, s0;
10
+ var R = {}, J = {}, c0;
11
11
  function N() {
12
- return s0 || (s0 = 1, Object.defineProperty(J, "__esModule", { value: !0 }), J.default = (i, e, x) => ({
12
+ return c0 || (c0 = 1, Object.defineProperty(J, "__esModule", { value: !0 }), J.default = (i, e, x) => ({
13
13
  confidence: x,
14
14
  name: e.name(i),
15
15
  lang: e.language ? e.language() : void 0
16
16
  })), J;
17
17
  }
18
- var o0;
18
+ var s0;
19
19
  function I0() {
20
- if (o0) return R;
21
- o0 = 1;
20
+ if (s0) return R;
21
+ s0 = 1;
22
22
  var i = R && R.__importDefault || function(t) {
23
23
  return t && t.__esModule ? t : { default: t };
24
24
  };
@@ -29,9 +29,9 @@ function I0() {
29
29
  return "ASCII";
30
30
  }
31
31
  match(a) {
32
- const r = a.rawInput;
32
+ const n = a.rawInput;
33
33
  for (let s = 0; s < a.rawLen; s++) {
34
- const m = r[s];
34
+ const m = n[s];
35
35
  if (m < 32 || m > 126)
36
36
  return (0, e.default)(a, this, 0);
37
37
  }
@@ -40,10 +40,10 @@ function I0() {
40
40
  }
41
41
  return R.default = x, R;
42
42
  }
43
- var P = {}, f0;
43
+ var P = {}, o0;
44
44
  function O0() {
45
- if (f0) return P;
46
- f0 = 1;
45
+ if (o0) return P;
46
+ o0 = 1;
47
47
  var i = P && P.__importDefault || function(t) {
48
48
  return t && t.__esModule ? t : { default: t };
49
49
  };
@@ -54,11 +54,11 @@ function O0() {
54
54
  return "UTF-8";
55
55
  }
56
56
  match(a) {
57
- let r = !1, s = 0, m = 0, o = 0, f;
57
+ let n = !1, s = 0, m = 0, o = 0, f;
58
58
  const d = a.rawInput;
59
- a.rawLen >= 3 && (d[0] & 255) == 239 && (d[1] & 255) == 187 && (d[2] & 255) == 191 && (r = !0);
60
- for (let n = 0; n < a.rawLen; n++) {
61
- const c = d[n];
59
+ a.rawLen >= 3 && (d[0] & 255) == 239 && (d[1] & 255) == 187 && (d[2] & 255) == 191 && (n = !0);
60
+ for (let r = 0; r < a.rawLen; r++) {
61
+ const c = d[r];
62
62
  if ((c & 128) != 0) {
63
63
  if ((c & 224) == 192)
64
64
  o = 1;
@@ -71,8 +71,8 @@ function O0() {
71
71
  break;
72
72
  o = 0;
73
73
  }
74
- for (; n++, !(n >= a.rawLen); ) {
75
- if ((d[n] & 192) != 128) {
74
+ for (; r++, !(r >= a.rawLen); ) {
75
+ if ((d[r] & 192) != 128) {
76
76
  m++;
77
77
  break;
78
78
  }
@@ -83,9 +83,9 @@ function O0() {
83
83
  }
84
84
  }
85
85
  }
86
- if (f = 0, r && m == 0)
86
+ if (f = 0, n && m == 0)
87
87
  f = 100;
88
- else if (r && s > m * 10)
88
+ else if (n && s > m * 10)
89
89
  f = 80;
90
90
  else if (s > 3 && m == 0)
91
91
  f = 100;
@@ -102,10 +102,10 @@ function O0() {
102
102
  }
103
103
  return P.default = x, P;
104
104
  }
105
- var O = {}, d0;
105
+ var O = {}, f0;
106
106
  function E0() {
107
- if (d0) return O;
108
- d0 = 1;
107
+ if (f0) return O;
108
+ f0 = 1;
109
109
  var i = O && O.__importDefault || function(m) {
110
110
  return m && m.__esModule ? m : { default: m };
111
111
  };
@@ -139,19 +139,19 @@ function E0() {
139
139
  return -1;
140
140
  }
141
141
  match(o) {
142
- let f = 0, d = 0, n = !1, c = 0;
142
+ let f = 0, d = 0, r = !1, c = 0;
143
143
  const u = o.rawLen / 4 * 4, h = o.rawInput;
144
144
  if (u == 0)
145
145
  return null;
146
- this.getChar(h, 0) == 65279 && (n = !0);
146
+ this.getChar(h, 0) == 65279 && (r = !0);
147
147
  for (let g = 0; g < u; g += 4) {
148
148
  const k = this.getChar(h, g);
149
149
  k < 0 || k >= 1114111 || k >= 55296 && k <= 57343 ? d += 1 : f += 1;
150
150
  }
151
- return n && d == 0 ? c = 100 : n && f > d * 10 ? c = 80 : f > 3 && d == 0 ? c = 100 : f > 0 && d == 0 ? c = 80 : f > d * 10 && (c = 25), c == 0 ? null : (0, e.default)(o, this, c);
151
+ return r && d == 0 ? c = 100 : r && f > d * 10 ? c = 80 : f > 3 && d == 0 ? c = 100 : f > 0 && d == 0 ? c = 80 : f > d * 10 && (c = 25), c == 0 ? null : (0, e.default)(o, this, c);
152
152
  }
153
153
  }
154
- class r extends a {
154
+ class n extends a {
155
155
  name() {
156
156
  return "UTF-32BE";
157
157
  }
@@ -159,7 +159,7 @@ function E0() {
159
159
  return (o[f + 0] & 255) << 24 | (o[f + 1] & 255) << 16 | (o[f + 2] & 255) << 8 | o[f + 3] & 255;
160
160
  }
161
161
  }
162
- O.UTF_32BE = r;
162
+ O.UTF_32BE = n;
163
163
  class s extends a {
164
164
  name() {
165
165
  return "UTF-32LE";
@@ -170,23 +170,23 @@ function E0() {
170
170
  }
171
171
  return O.UTF_32LE = s, O;
172
172
  }
173
- var D = {}, l0;
173
+ var D = {}, d0;
174
174
  function L0() {
175
- if (l0) return D;
176
- l0 = 1;
177
- var i = D && D.__importDefault || function(n) {
178
- return n && n.__esModule ? n : { default: n };
175
+ if (d0) return D;
176
+ d0 = 1;
177
+ var i = D && D.__importDefault || function(r) {
178
+ return r && r.__esModule ? r : { default: r };
179
179
  };
180
180
  Object.defineProperty(D, "__esModule", { value: !0 }), D.gb_18030 = D.euc_kr = D.euc_jp = D.big5 = D.sjis = void 0;
181
181
  const e = i(N());
182
- function x(n, c) {
182
+ function x(r, c) {
183
183
  const u = (h, g, k, b) => {
184
184
  if (b < k)
185
185
  return -1;
186
186
  const l = Math.floor(k + b >>> 1);
187
187
  return g > h[l] ? u(h, g, l + 1, b) : g < h[l] ? u(h, g, k, l - 1) : l;
188
188
  };
189
- return u(n, c, 0, n.length - 1);
189
+ return u(r, c, 0, r.length - 1);
190
190
  }
191
191
  class t {
192
192
  constructor() {
@@ -241,7 +241,7 @@ function L0() {
241
241
  return !0;
242
242
  }
243
243
  };
244
- class r extends a {
244
+ class n extends a {
245
245
  constructor() {
246
246
  super(...arguments), this.commonChars = [
247
247
  33088,
@@ -320,7 +320,7 @@ function L0() {
320
320
  return g < 0 ? !1 : (c.charValue = h << 8 | g, g >= 64 && g <= 127 || g >= 128 && g <= 255 || (c.error = !0), !0);
321
321
  }
322
322
  }
323
- D.sjis = r;
323
+ D.sjis = n;
324
324
  class s extends a {
325
325
  constructor() {
326
326
  super(...arguments), this.commonChars = [
@@ -440,27 +440,27 @@ function L0() {
440
440
  }
441
441
  }
442
442
  D.big5 = s;
443
- function m(n, c) {
444
- n.index = n.nextIndex, n.error = !1;
443
+ function m(r, c) {
444
+ r.index = r.nextIndex, r.error = !1;
445
445
  let u = 0, h = 0, g = 0;
446
446
  e: {
447
- if (u = n.charValue = n.nextByte(c), u < 0) {
448
- n.done = !0;
447
+ if (u = r.charValue = r.nextByte(c), u < 0) {
448
+ r.done = !0;
449
449
  break e;
450
450
  }
451
451
  if (u <= 141)
452
452
  break e;
453
- if (h = n.nextByte(c), n.charValue = n.charValue << 8 | h, u >= 161 && u <= 254) {
454
- h < 161 && (n.error = !0);
453
+ if (h = r.nextByte(c), r.charValue = r.charValue << 8 | h, u >= 161 && u <= 254) {
454
+ h < 161 && (r.error = !0);
455
455
  break e;
456
456
  }
457
457
  if (u == 142) {
458
- h < 161 && (n.error = !0);
458
+ h < 161 && (r.error = !0);
459
459
  break e;
460
460
  }
461
- u == 143 && (g = n.nextByte(c), n.charValue = n.charValue << 8 | g, g < 161 && (n.error = !0));
461
+ u == 143 && (g = r.nextByte(c), r.charValue = r.charValue << 8 | g, g < 161 && (r.error = !0));
462
462
  }
463
- return n.done == !1;
463
+ return r.done == !1;
464
464
  }
465
465
  class o extends a {
466
466
  constructor() {
@@ -825,14 +825,14 @@ function L0() {
825
825
  }
826
826
  return D.gb_18030 = d, D;
827
827
  }
828
- var S = {}, u0;
829
- function T0() {
830
- if (u0) return S;
831
- u0 = 1;
832
- var i = S && S.__importDefault || function(b) {
828
+ var F = {}, l0;
829
+ function A0() {
830
+ if (l0) return F;
831
+ l0 = 1;
832
+ var i = F && F.__importDefault || function(b) {
833
833
  return b && b.__esModule ? b : { default: b };
834
834
  };
835
- Object.defineProperty(S, "__esModule", { value: !0 }), S.KOI8_R = S.windows_1256 = S.windows_1251 = S.ISO_8859_9 = S.ISO_8859_8 = S.ISO_8859_7 = S.ISO_8859_6 = S.ISO_8859_5 = S.ISO_8859_2 = S.ISO_8859_1 = void 0;
835
+ Object.defineProperty(F, "__esModule", { value: !0 }), F.KOI8_R = F.windows_1256 = F.windows_1251 = F.ISO_8859_9 = F.ISO_8859_8 = F.ISO_8859_7 = F.ISO_8859_6 = F.ISO_8859_5 = F.ISO_8859_2 = F.ISO_8859_1 = void 0;
836
836
  const e = i(N()), x = 16777215;
837
837
  class t {
838
838
  constructor(l, p) {
@@ -867,7 +867,7 @@ function T0() {
867
867
  this.fLang = l, this.fNGrams = p;
868
868
  }
869
869
  }
870
- const r = (b) => Array.isArray(b) && isFinite(b[0]);
870
+ const n = (b) => Array.isArray(b) && isFinite(b[0]);
871
871
  let s = class {
872
872
  constructor() {
873
873
  this.spaceChar = 32, this.nGramLang = void 0;
@@ -887,14 +887,14 @@ function T0() {
887
887
  match(l) {
888
888
  this.nGramLang = void 0;
889
889
  const p = this.ngrams();
890
- if (r(p)) {
890
+ if (n(p)) {
891
891
  const C = new t(p, this.byteMap()).parse(l, this.spaceChar);
892
892
  return C <= 0 ? null : (0, e.default)(l, this, C);
893
893
  }
894
894
  let w = -1;
895
895
  for (let y = p.length - 1; y >= 0; y--) {
896
- const C = p[y], T = new t(C.fNGrams, this.byteMap()).parse(l, this.spaceChar);
897
- T > w && (w = T, this.nGramLang = C.fLang);
896
+ const C = p[y], A = new t(C.fNGrams, this.byteMap()).parse(l, this.spaceChar);
897
+ A > w && (w = A, this.nGramLang = C.fLang);
898
898
  }
899
899
  return w <= 0 ? null : (0, e.default)(l, this, w);
900
900
  }
@@ -1828,7 +1828,7 @@ function T0() {
1828
1828
  return l && l.c1Bytes ? "windows-1252" : "ISO-8859-1";
1829
1829
  }
1830
1830
  }
1831
- S.ISO_8859_1 = m;
1831
+ F.ISO_8859_1 = m;
1832
1832
  class o extends s {
1833
1833
  byteMap() {
1834
1834
  return [
@@ -2362,7 +2362,7 @@ function T0() {
2362
2362
  return l && l.c1Bytes ? "windows-1250" : "ISO-8859-2";
2363
2363
  }
2364
2364
  }
2365
- S.ISO_8859_2 = o;
2365
+ F.ISO_8859_2 = o;
2366
2366
  class f extends s {
2367
2367
  byteMap() {
2368
2368
  return [
@@ -2699,7 +2699,7 @@ function T0() {
2699
2699
  return "ru";
2700
2700
  }
2701
2701
  }
2702
- S.ISO_8859_5 = f;
2702
+ F.ISO_8859_5 = f;
2703
2703
  class d extends s {
2704
2704
  byteMap() {
2705
2705
  return [
@@ -3036,8 +3036,8 @@ function T0() {
3036
3036
  return "ar";
3037
3037
  }
3038
3038
  }
3039
- S.ISO_8859_6 = d;
3040
- class n extends s {
3039
+ F.ISO_8859_6 = d;
3040
+ class r extends s {
3041
3041
  byteMap() {
3042
3042
  return [
3043
3043
  32,
@@ -3373,7 +3373,7 @@ function T0() {
3373
3373
  return "el";
3374
3374
  }
3375
3375
  }
3376
- S.ISO_8859_7 = n;
3376
+ F.ISO_8859_7 = r;
3377
3377
  class c extends s {
3378
3378
  byteMap() {
3379
3379
  return [
@@ -3778,7 +3778,7 @@ function T0() {
3778
3778
  return "he";
3779
3779
  }
3780
3780
  }
3781
- S.ISO_8859_8 = c;
3781
+ F.ISO_8859_8 = c;
3782
3782
  class u extends s {
3783
3783
  byteMap() {
3784
3784
  return [
@@ -4115,7 +4115,7 @@ function T0() {
4115
4115
  return "tr";
4116
4116
  }
4117
4117
  }
4118
- S.ISO_8859_9 = u;
4118
+ F.ISO_8859_9 = u;
4119
4119
  class h extends s {
4120
4120
  byteMap() {
4121
4121
  return [
@@ -4452,7 +4452,7 @@ function T0() {
4452
4452
  return "ru";
4453
4453
  }
4454
4454
  }
4455
- S.windows_1251 = h;
4455
+ F.windows_1251 = h;
4456
4456
  class g extends s {
4457
4457
  byteMap() {
4458
4458
  return [
@@ -4789,7 +4789,7 @@ function T0() {
4789
4789
  return "ar";
4790
4790
  }
4791
4791
  }
4792
- S.windows_1256 = g;
4792
+ F.windows_1256 = g;
4793
4793
  class k extends s {
4794
4794
  byteMap() {
4795
4795
  return [
@@ -5126,12 +5126,12 @@ function T0() {
5126
5126
  return "ru";
5127
5127
  }
5128
5128
  }
5129
- return S.KOI8_R = k, S;
5129
+ return F.KOI8_R = k, F;
5130
5130
  }
5131
- var L = {}, m0;
5132
- function A0() {
5133
- if (m0) return L;
5134
- m0 = 1;
5131
+ var L = {}, u0;
5132
+ function T0() {
5133
+ if (u0) return L;
5134
+ u0 = 1;
5135
5135
  var i = L && L.__importDefault || function(s) {
5136
5136
  return s && s.__esModule ? s : { default: s };
5137
5137
  };
@@ -5145,7 +5145,7 @@ function A0() {
5145
5145
  return "ISO_2022";
5146
5146
  }
5147
5147
  match(m) {
5148
- let o, f, d, n = 0, c = 0, u = 0, h;
5148
+ let o, f, d, r = 0, c = 0, u = 0, h;
5149
5149
  const g = m.inputBytes, k = m.inputLen;
5150
5150
  e: for (o = 0; o < k; o++) {
5151
5151
  if (g[o] == 27) {
@@ -5156,14 +5156,14 @@ function A0() {
5156
5156
  for (f = 1; f < b.length; f++)
5157
5157
  if (b[f] != g[o + f])
5158
5158
  continue x;
5159
- n++, o += b.length - 1;
5159
+ r++, o += b.length - 1;
5160
5160
  continue e;
5161
5161
  }
5162
5162
  c++;
5163
5163
  }
5164
5164
  (g[o] == 14 || g[o] == 15) && u++;
5165
5165
  }
5166
- return n == 0 ? null : (h = (100 * n - 100 * c) / (n + c), n + u < 5 && (h -= (5 - (n + u)) * 10), h <= 0 ? null : (0, e.default)(m, this, h));
5166
+ return r == 0 ? null : (h = (100 * r - 100 * c) / (r + c), r + u < 5 && (h -= (5 - (r + u)) * 10), h <= 0 ? null : (0, e.default)(m, this, h));
5167
5167
  }
5168
5168
  }
5169
5169
  class t extends x {
@@ -5203,7 +5203,7 @@ function A0() {
5203
5203
  }
5204
5204
  }
5205
5205
  L.ISO_2022_KR = a;
5206
- class r extends x {
5206
+ class n extends x {
5207
5207
  constructor() {
5208
5208
  super(...arguments), this.escapeSequences = [
5209
5209
  [27, 36, 41, 65],
@@ -5226,18 +5226,18 @@ function A0() {
5226
5226
  return "zh";
5227
5227
  }
5228
5228
  }
5229
- return L.ISO_2022_CN = r, L;
5229
+ return L.ISO_2022_CN = n, L;
5230
5230
  }
5231
- var H = {}, p0;
5231
+ var H = {}, m0;
5232
5232
  function M0() {
5233
- if (p0) return H;
5234
- p0 = 1, Object.defineProperty(H, "__esModule", { value: !0 }), H.isByteArray = void 0;
5233
+ if (m0) return H;
5234
+ m0 = 1, Object.defineProperty(H, "__esModule", { value: !0 }), H.isByteArray = void 0;
5235
5235
  const i = (e) => e == null || typeof e != "object" ? !1 : isFinite(e.length) && e.length >= 0;
5236
5236
  return H.isByteArray = i, H;
5237
5237
  }
5238
- var h0;
5238
+ var p0;
5239
5239
  function z0() {
5240
- return h0 || (h0 = 1, (function(i) {
5240
+ return p0 || (p0 = 1, (function(i) {
5241
5241
  var e = E && E.__createBinding || (Object.create ? (function(l, p, w, y) {
5242
5242
  y === void 0 && (y = w);
5243
5243
  var C = Object.getOwnPropertyDescriptor(p, w);
@@ -5268,7 +5268,7 @@ function z0() {
5268
5268
  return l && l.__esModule ? l : { default: l };
5269
5269
  };
5270
5270
  Object.defineProperty(i, "__esModule", { value: !0 }), i.detectFileSync = i.detectFile = i.analyse = i.detect = void 0;
5271
- const r = a(B0()), s = a(I0()), m = a(O0()), o = t(E0()), f = t(L0()), d = t(T0()), n = t(A0()), c = M0(), u = [
5271
+ const n = a(B0()), s = a(I0()), m = a(O0()), o = t(E0()), f = t(L0()), d = t(A0()), r = t(T0()), c = M0(), u = [
5272
5272
  new m.default(),
5273
5273
  new o.UTF_16BE(),
5274
5274
  new o.UTF_16LE(),
@@ -5279,9 +5279,9 @@ function z0() {
5279
5279
  new f.euc_jp(),
5280
5280
  new f.euc_kr(),
5281
5281
  new f.gb_18030(),
5282
- new n.ISO_2022_JP(),
5283
- new n.ISO_2022_KR(),
5284
- new n.ISO_2022_CN(),
5282
+ new r.ISO_2022_JP(),
5283
+ new r.ISO_2022_KR(),
5284
+ new r.ISO_2022_CN(),
5285
5285
  new d.ISO_8859_1(),
5286
5286
  new d.ISO_8859_2(),
5287
5287
  new d.ISO_8859_5(),
@@ -5320,27 +5320,27 @@ function z0() {
5320
5320
  inputBytes: l,
5321
5321
  inputLen: l.length
5322
5322
  };
5323
- return u.map((v) => v.match(y)).filter((v) => !!v).sort((v, T) => T.confidence - v.confidence);
5323
+ return u.map((v) => v.match(y)).filter((v) => !!v).sort((v, A) => A.confidence - v.confidence);
5324
5324
  };
5325
5325
  i.analyse = g;
5326
5326
  const k = (l, p = {}) => new Promise((w, y) => {
5327
5327
  let C;
5328
- const v = (0, r.default)(), T = (z, V) => {
5328
+ const v = (0, n.default)(), A = (z, V) => {
5329
5329
  C && v.closeSync(C), z ? y(z) : V ? w((0, i.detect)(V)) : y(new Error("No error and no buffer received"));
5330
5330
  }, j = p?.sampleSize || 0;
5331
5331
  if (j > 0) {
5332
5332
  C = v.openSync(l, "r");
5333
5333
  let z = Buffer.allocUnsafe(j);
5334
5334
  v.read(C, z, 0, j, p.offset, (V, r0) => {
5335
- V ? T(V, null) : (r0 < j && (z = z.subarray(0, r0)), T(null, z));
5335
+ V ? A(V, null) : (r0 < j && (z = z.subarray(0, r0)), A(null, z));
5336
5336
  });
5337
5337
  return;
5338
5338
  }
5339
- v.readFile(l, T);
5339
+ v.readFile(l, A);
5340
5340
  });
5341
5341
  i.detectFile = k;
5342
5342
  const b = (l, p = {}) => {
5343
- const w = (0, r.default)();
5343
+ const w = (0, n.default)();
5344
5344
  if (p && p.sampleSize) {
5345
5345
  const y = w.openSync(l, "r");
5346
5346
  let C = Buffer.allocUnsafe(p.sampleSize);
@@ -5358,27 +5358,27 @@ function z0() {
5358
5358
  })(E)), E;
5359
5359
  }
5360
5360
  var U0 = z0();
5361
- const j0 = /* @__PURE__ */ F0(U0);
5361
+ const j0 = /* @__PURE__ */ S0(U0);
5362
5362
  var K = {};
5363
- var b0;
5363
+ var h0;
5364
5364
  function R0() {
5365
- return b0 || (b0 = 1, K.read = function(i, e, x, t, a) {
5366
- var r, s, m = a * 8 - t - 1, o = (1 << m) - 1, f = o >> 1, d = -7, n = x ? a - 1 : 0, c = x ? -1 : 1, u = i[e + n];
5367
- for (n += c, r = u & (1 << -d) - 1, u >>= -d, d += m; d > 0; r = r * 256 + i[e + n], n += c, d -= 8)
5365
+ return h0 || (h0 = 1, K.read = function(i, e, x, t, a) {
5366
+ var n, s, m = a * 8 - t - 1, o = (1 << m) - 1, f = o >> 1, d = -7, r = x ? a - 1 : 0, c = x ? -1 : 1, u = i[e + r];
5367
+ for (r += c, n = u & (1 << -d) - 1, u >>= -d, d += m; d > 0; n = n * 256 + i[e + r], r += c, d -= 8)
5368
5368
  ;
5369
- for (s = r & (1 << -d) - 1, r >>= -d, d += t; d > 0; s = s * 256 + i[e + n], n += c, d -= 8)
5369
+ for (s = n & (1 << -d) - 1, n >>= -d, d += t; d > 0; s = s * 256 + i[e + r], r += c, d -= 8)
5370
5370
  ;
5371
- if (r === 0)
5372
- r = 1 - f;
5371
+ if (n === 0)
5372
+ n = 1 - f;
5373
5373
  else {
5374
- if (r === o)
5374
+ if (n === o)
5375
5375
  return s ? NaN : (u ? -1 : 1) * (1 / 0);
5376
- s = s + Math.pow(2, t), r = r - f;
5376
+ s = s + Math.pow(2, t), n = n - f;
5377
5377
  }
5378
- return (u ? -1 : 1) * s * Math.pow(2, r - t);
5379
- }, K.write = function(i, e, x, t, a, r) {
5380
- var s, m, o, f = r * 8 - a - 1, d = (1 << f) - 1, n = d >> 1, c = a === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, u = t ? 0 : r - 1, h = t ? 1 : -1, g = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
5381
- for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (m = isNaN(e) ? 1 : 0, s = d) : (s = Math.floor(Math.log(e) / Math.LN2), e * (o = Math.pow(2, -s)) < 1 && (s--, o *= 2), s + n >= 1 ? e += c / o : e += c * Math.pow(2, 1 - n), e * o >= 2 && (s++, o /= 2), s + n >= d ? (m = 0, s = d) : s + n >= 1 ? (m = (e * o - 1) * Math.pow(2, a), s = s + n) : (m = e * Math.pow(2, n - 1) * Math.pow(2, a), s = 0)); a >= 8; i[x + u] = m & 255, u += h, m /= 256, a -= 8)
5378
+ return (u ? -1 : 1) * s * Math.pow(2, n - t);
5379
+ }, K.write = function(i, e, x, t, a, n) {
5380
+ var s, m, o, f = n * 8 - a - 1, d = (1 << f) - 1, r = d >> 1, c = a === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, u = t ? 0 : n - 1, h = t ? 1 : -1, g = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
5381
+ for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (m = isNaN(e) ? 1 : 0, s = d) : (s = Math.floor(Math.log(e) / Math.LN2), e * (o = Math.pow(2, -s)) < 1 && (s--, o *= 2), s + r >= 1 ? e += c / o : e += c * Math.pow(2, 1 - r), e * o >= 2 && (s++, o /= 2), s + r >= d ? (m = 0, s = d) : s + r >= 1 ? (m = (e * o - 1) * Math.pow(2, a), s = s + r) : (m = e * Math.pow(2, r - 1) * Math.pow(2, a), s = 0)); a >= 8; i[x + u] = m & 255, u += h, m /= 256, a -= 8)
5382
5382
  ;
5383
5383
  for (s = s << a | m, f += a; f > 0; i[x + u] = s & 255, u += h, s /= 256, f -= 8)
5384
5384
  ;
@@ -5386,7 +5386,7 @@ function R0() {
5386
5386
  }), K;
5387
5387
  }
5388
5388
  R0();
5389
- const i0 = {
5389
+ const t0 = {
5390
5390
  128: "€",
5391
5391
  130: "‚",
5392
5392
  131: "ƒ",
@@ -5415,7 +5415,7 @@ const i0 = {
5415
5415
  158: "ž",
5416
5416
  159: "Ÿ"
5417
5417
  };
5418
- for (const [i, e] of Object.entries(i0))
5418
+ for (const [i, e] of Object.entries(t0))
5419
5419
  ;
5420
5420
  function P0(i, e = "utf-8") {
5421
5421
  switch (e.toLowerCase()) {
@@ -5445,11 +5445,11 @@ function q0(i) {
5445
5445
  const a = i[x++] & 63;
5446
5446
  e += String.fromCharCode((t & 31) << 6 | a);
5447
5447
  } else if (t < 240) {
5448
- const a = i[x++] & 63, r = i[x++] & 63;
5449
- e += String.fromCharCode((t & 15) << 12 | a << 6 | r);
5448
+ const a = i[x++] & 63, n = i[x++] & 63;
5449
+ e += String.fromCharCode((t & 15) << 12 | a << 6 | n);
5450
5450
  } else {
5451
- const a = i[x++] & 63, r = i[x++] & 63, s = i[x++] & 63;
5452
- let m = (t & 7) << 18 | a << 12 | r << 6 | s;
5451
+ const a = i[x++] & 63, n = i[x++] & 63, s = i[x++] & 63;
5452
+ let m = (t & 7) << 18 | a << 12 | n << 6 | s;
5453
5453
  m -= 65536, e += String.fromCharCode(55296 + (m >> 10 & 1023), 56320 + (m & 1023));
5454
5454
  }
5455
5455
  }
@@ -5470,7 +5470,7 @@ function H0(i) {
5470
5470
  function W0(i) {
5471
5471
  let e = "";
5472
5472
  for (const x of i)
5473
- x >= 128 && x <= 159 && i0[x] ? e += i0[x] : e += String.fromCharCode(x);
5473
+ x >= 128 && x <= 159 && t0[x] ? e += t0[x] : e += String.fromCharCode(x);
5474
5474
  return e;
5475
5475
  }
5476
5476
  function I(i) {
@@ -5484,7 +5484,7 @@ const G0 = {
5484
5484
  put(i, e, x) {
5485
5485
  return I(i).setUint8(e, x), e + 1;
5486
5486
  }
5487
- }, F = {
5487
+ }, S = {
5488
5488
  len: 2,
5489
5489
  get(i, e) {
5490
5490
  return I(i).getUint16(e, !0);
@@ -5580,8 +5580,8 @@ class _0 {
5580
5580
  const a = this.peekQueue.pop();
5581
5581
  if (!a)
5582
5582
  throw new Error("peekData should be defined");
5583
- const r = Math.min(a.length, x);
5584
- e.set(a.subarray(0, r), t), t += r, x -= r, r < a.length && this.peekQueue.push(a.subarray(r));
5583
+ const n = Math.min(a.length, x);
5584
+ e.set(a.subarray(0, n), t), t += n, x -= n, n < a.length && this.peekQueue.push(a.subarray(n));
5585
5585
  }
5586
5586
  return t;
5587
5587
  }
@@ -5625,7 +5625,7 @@ class Y0 extends X0 {
5625
5625
  return t.done && (this.endOfStream = t.done), t.value ? (e.set(t.value), t.value.length) : 0;
5626
5626
  }
5627
5627
  }
5628
- class g0 extends _0 {
5628
+ class b0 extends _0 {
5629
5629
  constructor(e) {
5630
5630
  super(), this.reader = e, this.buffer = null;
5631
5631
  }
@@ -5668,14 +5668,14 @@ class g0 extends _0 {
5668
5668
  function ee(i) {
5669
5669
  try {
5670
5670
  const e = i.getReader({ mode: "byob" });
5671
- return e instanceof ReadableStreamDefaultReader ? new g0(e) : new Y0(e);
5671
+ return e instanceof ReadableStreamDefaultReader ? new b0(e) : new Y0(e);
5672
5672
  } catch (e) {
5673
5673
  if (e instanceof TypeError)
5674
- return new g0(i.getReader());
5674
+ return new b0(i.getReader());
5675
5675
  throw e;
5676
5676
  }
5677
5677
  }
5678
- class a0 {
5678
+ class i0 {
5679
5679
  /**
5680
5680
  * Constructor
5681
5681
  * @param options Tokenizer options
@@ -5762,7 +5762,7 @@ class a0 {
5762
5762
  }
5763
5763
  }
5764
5764
  const xe = 256e3;
5765
- class te extends a0 {
5765
+ class te extends i0 {
5766
5766
  /**
5767
5767
  * Constructor
5768
5768
  * @param streamReader stream-reader to read from
@@ -5785,10 +5785,10 @@ class te extends a0 {
5785
5785
  throw new Error("`options.position` must be equal or greater than `tokenizer.position`");
5786
5786
  if (t.length === 0)
5787
5787
  return 0;
5788
- const r = await this.streamReader.read(e.subarray(0, t.length), t.mayBeLess);
5789
- if (this.position += r, (!x || !x.mayBeLess) && r < t.length)
5788
+ const n = await this.streamReader.read(e.subarray(0, t.length), t.mayBeLess);
5789
+ if (this.position += n, (!x || !x.mayBeLess) && n < t.length)
5790
5790
  throw new B();
5791
- return r;
5791
+ return n;
5792
5792
  }
5793
5793
  /**
5794
5794
  * Peek (read ahead) buffer from tokenizer
@@ -5800,21 +5800,21 @@ class te extends a0 {
5800
5800
  const t = this.normalizeOptions(e, x);
5801
5801
  let a = 0;
5802
5802
  if (t.position) {
5803
- const r = t.position - this.position;
5804
- if (r > 0) {
5805
- const s = new Uint8Array(t.length + r);
5806
- return a = await this.peekBuffer(s, { mayBeLess: t.mayBeLess }), e.set(s.subarray(r)), a - r;
5803
+ const n = t.position - this.position;
5804
+ if (n > 0) {
5805
+ const s = new Uint8Array(t.length + n);
5806
+ return a = await this.peekBuffer(s, { mayBeLess: t.mayBeLess }), e.set(s.subarray(n)), a - n;
5807
5807
  }
5808
- if (r < 0)
5808
+ if (n < 0)
5809
5809
  throw new Error("Cannot peek from a negative offset in a stream");
5810
5810
  }
5811
5811
  if (t.length > 0) {
5812
5812
  try {
5813
5813
  a = await this.streamReader.peek(e.subarray(0, t.length), t.mayBeLess);
5814
- } catch (r) {
5815
- if (x?.mayBeLess && r instanceof B)
5814
+ } catch (n) {
5815
+ if (x?.mayBeLess && n instanceof B)
5816
5816
  return 0;
5817
- throw r;
5817
+ throw n;
5818
5818
  }
5819
5819
  if (!t.mayBeLess && a < t.length)
5820
5820
  throw new B();
@@ -5825,7 +5825,7 @@ class te extends a0 {
5825
5825
  const x = Math.min(xe, e), t = new Uint8Array(x);
5826
5826
  let a = 0;
5827
5827
  for (; a < e; ) {
5828
- const r = e - a, s = await this.readBuffer(t, { length: Math.min(x, r) });
5828
+ const n = e - a, s = await this.readBuffer(t, { length: Math.min(x, n) });
5829
5829
  if (s < 0)
5830
5830
  return s;
5831
5831
  a += s;
@@ -5842,7 +5842,7 @@ class te extends a0 {
5842
5842
  return !1;
5843
5843
  }
5844
5844
  }
5845
- class ie extends a0 {
5845
+ class ie extends i0 {
5846
5846
  /**
5847
5847
  * Construct BufferTokenizer
5848
5848
  * @param uint8Array - Uint8Array to tokenize
@@ -5884,7 +5884,7 @@ class ie extends a0 {
5884
5884
  this.position = e;
5885
5885
  }
5886
5886
  }
5887
- class ae extends a0 {
5887
+ class ae extends i0 {
5888
5888
  /**
5889
5889
  * Construct BufferTokenizer
5890
5890
  * @param blob - Uint8Array to tokenize
@@ -5914,8 +5914,8 @@ class ae extends a0 {
5914
5914
  const t = this.normalizeOptions(e, x), a = Math.min(this.blob.size - t.position, t.length);
5915
5915
  if (!t.mayBeLess && a < t.length)
5916
5916
  throw new B();
5917
- const r = await this.blob.slice(t.position, t.position + a).arrayBuffer();
5918
- return e.set(new Uint8Array(r)), a;
5917
+ const n = await this.blob.slice(t.position, t.position + a).arrayBuffer();
5918
+ return e.set(new Uint8Array(n)), a;
5919
5919
  }
5920
5920
  close() {
5921
5921
  return super.close();
@@ -5927,49 +5927,49 @@ class ae extends a0 {
5927
5927
  this.position = e;
5928
5928
  }
5929
5929
  }
5930
- function ne(i, e) {
5930
+ function re(i, e) {
5931
5931
  const x = ee(i), t = e ?? {}, a = t.onClose;
5932
5932
  return t.onClose = async () => {
5933
5933
  if (await x.close(), a)
5934
5934
  return a();
5935
5935
  }, new te(x, t);
5936
5936
  }
5937
- function re(i, e) {
5937
+ function ne(i, e) {
5938
5938
  return new ie(i, e);
5939
5939
  }
5940
5940
  function ce(i, e) {
5941
5941
  return new ae(i, e);
5942
5942
  }
5943
- var Z = { exports: {} }, X, w0;
5943
+ var Z = { exports: {} }, Q, g0;
5944
5944
  function se() {
5945
- if (w0) return X;
5946
- w0 = 1;
5947
- var i = 1e3, e = i * 60, x = e * 60, t = x * 24, a = t * 7, r = t * 365.25;
5948
- X = function(d, n) {
5949
- n = n || {};
5945
+ if (g0) return Q;
5946
+ g0 = 1;
5947
+ var i = 1e3, e = i * 60, x = e * 60, t = x * 24, a = t * 7, n = t * 365.25;
5948
+ Q = function(d, r) {
5949
+ r = r || {};
5950
5950
  var c = typeof d;
5951
5951
  if (c === "string" && d.length > 0)
5952
5952
  return s(d);
5953
5953
  if (c === "number" && isFinite(d))
5954
- return n.long ? o(d) : m(d);
5954
+ return r.long ? o(d) : m(d);
5955
5955
  throw new Error(
5956
5956
  "val is not a non-empty string or a valid number. val=" + JSON.stringify(d)
5957
5957
  );
5958
5958
  };
5959
5959
  function s(d) {
5960
5960
  if (d = String(d), !(d.length > 100)) {
5961
- var n = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
5961
+ var r = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
5962
5962
  d
5963
5963
  );
5964
- if (n) {
5965
- var c = parseFloat(n[1]), u = (n[2] || "ms").toLowerCase();
5964
+ if (r) {
5965
+ var c = parseFloat(r[1]), u = (r[2] || "ms").toLowerCase();
5966
5966
  switch (u) {
5967
5967
  case "years":
5968
5968
  case "year":
5969
5969
  case "yrs":
5970
5970
  case "yr":
5971
5971
  case "y":
5972
- return c * r;
5972
+ return c * n;
5973
5973
  case "weeks":
5974
5974
  case "week":
5975
5975
  case "w":
@@ -6009,35 +6009,35 @@ function se() {
6009
6009
  }
6010
6010
  }
6011
6011
  function m(d) {
6012
- var n = Math.abs(d);
6013
- return n >= t ? Math.round(d / t) + "d" : n >= x ? Math.round(d / x) + "h" : n >= e ? Math.round(d / e) + "m" : n >= i ? Math.round(d / i) + "s" : d + "ms";
6012
+ var r = Math.abs(d);
6013
+ return r >= t ? Math.round(d / t) + "d" : r >= x ? Math.round(d / x) + "h" : r >= e ? Math.round(d / e) + "m" : r >= i ? Math.round(d / i) + "s" : d + "ms";
6014
6014
  }
6015
6015
  function o(d) {
6016
- var n = Math.abs(d);
6017
- return n >= t ? f(d, n, t, "day") : n >= x ? f(d, n, x, "hour") : n >= e ? f(d, n, e, "minute") : n >= i ? f(d, n, i, "second") : d + " ms";
6016
+ var r = Math.abs(d);
6017
+ return r >= t ? f(d, r, t, "day") : r >= x ? f(d, r, x, "hour") : r >= e ? f(d, r, e, "minute") : r >= i ? f(d, r, i, "second") : d + " ms";
6018
6018
  }
6019
- function f(d, n, c, u) {
6020
- var h = n >= c * 1.5;
6019
+ function f(d, r, c, u) {
6020
+ var h = r >= c * 1.5;
6021
6021
  return Math.round(d / c) + " " + u + (h ? "s" : "");
6022
6022
  }
6023
- return X;
6023
+ return Q;
6024
6024
  }
6025
- var Y, k0;
6025
+ var X, w0;
6026
6026
  function oe() {
6027
- if (k0) return Y;
6028
- k0 = 1;
6027
+ if (w0) return X;
6028
+ w0 = 1;
6029
6029
  function i(e) {
6030
- t.debug = t, t.default = t, t.coerce = f, t.disable = m, t.enable = r, t.enabled = o, t.humanize = se(), t.destroy = d, Object.keys(e).forEach((n) => {
6031
- t[n] = e[n];
6030
+ t.debug = t, t.default = t, t.coerce = f, t.disable = m, t.enable = n, t.enabled = o, t.humanize = se(), t.destroy = d, Object.keys(e).forEach((r) => {
6031
+ t[r] = e[r];
6032
6032
  }), t.names = [], t.skips = [], t.formatters = {};
6033
- function x(n) {
6033
+ function x(r) {
6034
6034
  let c = 0;
6035
- for (let u = 0; u < n.length; u++)
6036
- c = (c << 5) - c + n.charCodeAt(u), c |= 0;
6035
+ for (let u = 0; u < r.length; u++)
6036
+ c = (c << 5) - c + r.charCodeAt(u), c |= 0;
6037
6037
  return t.colors[Math.abs(c) % t.colors.length];
6038
6038
  }
6039
6039
  t.selectColor = x;
6040
- function t(n) {
6040
+ function t(r) {
6041
6041
  let c, u = null, h, g;
6042
6042
  function k(...b) {
6043
6043
  if (!k.enabled)
@@ -6045,11 +6045,11 @@ function oe() {
6045
6045
  const l = k, p = Number(/* @__PURE__ */ new Date()), w = p - (c || p);
6046
6046
  l.diff = w, l.prev = c, l.curr = p, c = p, b[0] = t.coerce(b[0]), typeof b[0] != "string" && b.unshift("%O");
6047
6047
  let y = 0;
6048
- b[0] = b[0].replace(/%([a-zA-Z%])/g, (v, T) => {
6048
+ b[0] = b[0].replace(/%([a-zA-Z%])/g, (v, A) => {
6049
6049
  if (v === "%%")
6050
6050
  return "%";
6051
6051
  y++;
6052
- const j = t.formatters[T];
6052
+ const j = t.formatters[A];
6053
6053
  if (typeof j == "function") {
6054
6054
  const z = b[y];
6055
6055
  v = j.call(l, z), b.splice(y, 1), y--;
@@ -6057,29 +6057,29 @@ function oe() {
6057
6057
  return v;
6058
6058
  }), t.formatArgs.call(l, b), (l.log || t.log).apply(l, b);
6059
6059
  }
6060
- return k.namespace = n, k.useColors = t.useColors(), k.color = t.selectColor(n), k.extend = a, k.destroy = t.destroy, Object.defineProperty(k, "enabled", {
6060
+ return k.namespace = r, k.useColors = t.useColors(), k.color = t.selectColor(r), k.extend = a, k.destroy = t.destroy, Object.defineProperty(k, "enabled", {
6061
6061
  enumerable: !0,
6062
6062
  configurable: !1,
6063
- get: () => u !== null ? u : (h !== t.namespaces && (h = t.namespaces, g = t.enabled(n)), g),
6063
+ get: () => u !== null ? u : (h !== t.namespaces && (h = t.namespaces, g = t.enabled(r)), g),
6064
6064
  set: (b) => {
6065
6065
  u = b;
6066
6066
  }
6067
6067
  }), typeof t.init == "function" && t.init(k), k;
6068
6068
  }
6069
- function a(n, c) {
6070
- const u = t(this.namespace + (typeof c > "u" ? ":" : c) + n);
6069
+ function a(r, c) {
6070
+ const u = t(this.namespace + (typeof c > "u" ? ":" : c) + r);
6071
6071
  return u.log = this.log, u;
6072
6072
  }
6073
- function r(n) {
6074
- t.save(n), t.namespaces = n, t.names = [], t.skips = [];
6075
- const c = (typeof n == "string" ? n : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
6073
+ function n(r) {
6074
+ t.save(r), t.namespaces = r, t.names = [], t.skips = [];
6075
+ const c = (typeof r == "string" ? r : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
6076
6076
  for (const u of c)
6077
6077
  u[0] === "-" ? t.skips.push(u.slice(1)) : t.names.push(u);
6078
6078
  }
6079
- function s(n, c) {
6079
+ function s(r, c) {
6080
6080
  let u = 0, h = 0, g = -1, k = 0;
6081
- for (; u < n.length; )
6082
- if (h < c.length && (c[h] === n[u] || c[h] === "*"))
6081
+ for (; u < r.length; )
6082
+ if (h < c.length && (c[h] === r[u] || c[h] === "*"))
6083
6083
  c[h] === "*" ? (g = h, k = u, h++) : (u++, h++);
6084
6084
  else if (g !== -1)
6085
6085
  h = g + 1, k++, u = k;
@@ -6090,35 +6090,35 @@ function oe() {
6090
6090
  return h === c.length;
6091
6091
  }
6092
6092
  function m() {
6093
- const n = [
6093
+ const r = [
6094
6094
  ...t.names,
6095
6095
  ...t.skips.map((c) => "-" + c)
6096
6096
  ].join(",");
6097
- return t.enable(""), n;
6097
+ return t.enable(""), r;
6098
6098
  }
6099
- function o(n) {
6099
+ function o(r) {
6100
6100
  for (const c of t.skips)
6101
- if (s(n, c))
6101
+ if (s(r, c))
6102
6102
  return !1;
6103
6103
  for (const c of t.names)
6104
- if (s(n, c))
6104
+ if (s(r, c))
6105
6105
  return !0;
6106
6106
  return !1;
6107
6107
  }
6108
- function f(n) {
6109
- return n instanceof Error ? n.stack || n.message : n;
6108
+ function f(r) {
6109
+ return r instanceof Error ? r.stack || r.message : r;
6110
6110
  }
6111
6111
  function d() {
6112
6112
  console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
6113
6113
  }
6114
6114
  return t.enable(t.load()), t;
6115
6115
  }
6116
- return Y = i, Y;
6116
+ return X = i, X;
6117
6117
  }
6118
- var y0;
6118
+ var k0;
6119
6119
  function fe() {
6120
- return y0 || (y0 = 1, (function(i, e) {
6121
- e.formatArgs = t, e.save = a, e.load = r, e.useColors = x, e.storage = s(), e.destroy = /* @__PURE__ */ (() => {
6120
+ return k0 || (k0 = 1, (function(i, e) {
6121
+ e.formatArgs = t, e.save = a, e.load = n, e.useColors = x, e.storage = s(), e.destroy = /* @__PURE__ */ (() => {
6122
6122
  let o = !1;
6123
6123
  return () => {
6124
6124
  o || (o = !0, console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."));
@@ -6218,10 +6218,10 @@ function fe() {
6218
6218
  return;
6219
6219
  const f = "color: " + this.color;
6220
6220
  o.splice(1, 0, f, "color: inherit");
6221
- let d = 0, n = 0;
6221
+ let d = 0, r = 0;
6222
6222
  o[0].replace(/%[a-zA-Z%]/g, (c) => {
6223
- c !== "%%" && (d++, c === "%c" && (n = d));
6224
- }), o.splice(n, 0, f);
6223
+ c !== "%%" && (d++, c === "%c" && (r = d));
6224
+ }), o.splice(r, 0, f);
6225
6225
  }
6226
6226
  e.log = console.debug || console.log || (() => {
6227
6227
  });
@@ -6231,7 +6231,7 @@ function fe() {
6231
6231
  } catch {
6232
6232
  }
6233
6233
  }
6234
- function r() {
6234
+ function n() {
6235
6235
  let o;
6236
6236
  try {
6237
6237
  o = e.storage.getItem("debug") || e.storage.getItem("DEBUG");
@@ -6257,12 +6257,12 @@ function fe() {
6257
6257
  })(Z, Z.exports)), Z.exports;
6258
6258
  }
6259
6259
  var de = fe();
6260
- const le = /* @__PURE__ */ F0(de), q = {
6260
+ const le = /* @__PURE__ */ S0(de), q = {
6261
6261
  LocalFileHeader: 67324752,
6262
6262
  DataDescriptor: 134695760,
6263
6263
  CentralFileHeader: 33639248,
6264
6264
  EndOfCentralDirectory: 101010256
6265
- }, C0 = {
6265
+ }, y0 = {
6266
6266
  get(i) {
6267
6267
  return {
6268
6268
  signature: _.get(i, 0),
@@ -6273,16 +6273,16 @@ const le = /* @__PURE__ */ F0(de), q = {
6273
6273
  len: 16
6274
6274
  }, ue = {
6275
6275
  get(i) {
6276
- const e = F.get(i, 6);
6276
+ const e = S.get(i, 6);
6277
6277
  return {
6278
6278
  signature: _.get(i, 0),
6279
- minVersion: F.get(i, 4),
6279
+ minVersion: S.get(i, 4),
6280
6280
  dataDescriptor: !!(e & 8),
6281
- compressedMethod: F.get(i, 8),
6281
+ compressedMethod: S.get(i, 8),
6282
6282
  compressedSize: _.get(i, 18),
6283
6283
  uncompressedSize: _.get(i, 22),
6284
- filenameLength: F.get(i, 26),
6285
- extraFieldLength: F.get(i, 28),
6284
+ filenameLength: S.get(i, 26),
6285
+ extraFieldLength: S.get(i, 28),
6286
6286
  filename: null
6287
6287
  };
6288
6288
  },
@@ -6291,29 +6291,29 @@ const le = /* @__PURE__ */ F0(de), q = {
6291
6291
  get(i) {
6292
6292
  return {
6293
6293
  signature: _.get(i, 0),
6294
- nrOfThisDisk: F.get(i, 4),
6295
- nrOfThisDiskWithTheStart: F.get(i, 6),
6296
- nrOfEntriesOnThisDisk: F.get(i, 8),
6297
- nrOfEntriesOfSize: F.get(i, 10),
6294
+ nrOfThisDisk: S.get(i, 4),
6295
+ nrOfThisDiskWithTheStart: S.get(i, 6),
6296
+ nrOfEntriesOnThisDisk: S.get(i, 8),
6297
+ nrOfEntriesOfSize: S.get(i, 10),
6298
6298
  sizeOfCd: _.get(i, 12),
6299
6299
  offsetOfStartOfCd: _.get(i, 16),
6300
- zipFileCommentLength: F.get(i, 20)
6300
+ zipFileCommentLength: S.get(i, 20)
6301
6301
  };
6302
6302
  },
6303
6303
  len: 22
6304
6304
  }, pe = {
6305
6305
  get(i) {
6306
- const e = F.get(i, 8);
6306
+ const e = S.get(i, 8);
6307
6307
  return {
6308
6308
  signature: _.get(i, 0),
6309
- minVersion: F.get(i, 6),
6309
+ minVersion: S.get(i, 6),
6310
6310
  dataDescriptor: !!(e & 8),
6311
- compressedMethod: F.get(i, 10),
6311
+ compressedMethod: S.get(i, 10),
6312
6312
  compressedSize: _.get(i, 20),
6313
6313
  uncompressedSize: _.get(i, 24),
6314
- filenameLength: F.get(i, 28),
6315
- extraFieldLength: F.get(i, 30),
6316
- fileCommentLength: F.get(i, 32),
6314
+ filenameLength: S.get(i, 28),
6315
+ extraFieldLength: S.get(i, 30),
6316
+ fileCommentLength: S.get(i, 32),
6317
6317
  relativeOffsetOfLocalHeader: _.get(i, 42),
6318
6318
  filename: null
6319
6319
  };
@@ -6324,10 +6324,10 @@ function D0(i) {
6324
6324
  const e = new Uint8Array(_.len);
6325
6325
  return _.put(e, 0, i), e;
6326
6326
  }
6327
- const A = le("tokenizer:inflate"), e0 = 256 * 1024, he = D0(q.DataDescriptor), $ = D0(q.EndOfCentralDirectory);
6328
- class n0 {
6327
+ const T = le("tokenizer:inflate"), Y = 256 * 1024, he = D0(q.DataDescriptor), $ = D0(q.EndOfCentralDirectory);
6328
+ class a0 {
6329
6329
  constructor(e) {
6330
- this.tokenizer = e, this.syncBuffer = new Uint8Array(e0);
6330
+ this.tokenizer = e, this.syncBuffer = new Uint8Array(Y);
6331
6331
  }
6332
6332
  async isZip() {
6333
6333
  return await this.peekSignature() === q.LocalFileHeader;
@@ -6345,20 +6345,20 @@ class n0 {
6345
6345
  }
6346
6346
  async readCentralDirectory() {
6347
6347
  if (!this.tokenizer.supportsRandomAccess()) {
6348
- A("Cannot reading central-directory without random-read support");
6348
+ T("Cannot reading central-directory without random-read support");
6349
6349
  return;
6350
6350
  }
6351
- A("Reading central-directory...");
6351
+ T("Reading central-directory...");
6352
6352
  const e = this.tokenizer.position, x = await this.findEndOfCentralDirectoryLocator();
6353
6353
  if (x > 0) {
6354
- A("Central-directory 32-bit signature found");
6354
+ T("Central-directory 32-bit signature found");
6355
6355
  const t = await this.tokenizer.readToken(me, x), a = [];
6356
6356
  this.tokenizer.setPosition(t.offsetOfStartOfCd);
6357
- for (let r = 0; r < t.nrOfEntriesOfSize; ++r) {
6357
+ for (let n = 0; n < t.nrOfEntriesOfSize; ++n) {
6358
6358
  const s = await this.tokenizer.readToken(pe);
6359
6359
  if (s.signature !== q.CentralFileHeader)
6360
6360
  throw new Error("Expected Central-File-Header signature");
6361
- s.filename = await this.tokenizer.readToken(new U(s.filenameLength, "utf-8")), await this.tokenizer.ignore(s.extraFieldLength), await this.tokenizer.ignore(s.fileCommentLength), a.push(s), A(`Add central-directory file-entry: n=${r + 1}/${a.length}: filename=${a[r].filename}`);
6361
+ s.filename = await this.tokenizer.readToken(new U(s.filenameLength, "utf-8")), await this.tokenizer.ignore(s.extraFieldLength), await this.tokenizer.ignore(s.fileCommentLength), a.push(s), T(`Add central-directory file-entry: n=${n + 1}/${a.length}: filename=${a[n].filename}`);
6362
6362
  }
6363
6363
  return this.tokenizer.setPosition(e), a;
6364
6364
  }
@@ -6373,28 +6373,28 @@ class n0 {
6373
6373
  const a = await this.readLocalFileHeader();
6374
6374
  if (!a)
6375
6375
  break;
6376
- const r = e(a);
6377
- t = !!r.stop;
6376
+ const n = e(a);
6377
+ t = !!n.stop;
6378
6378
  let s;
6379
6379
  if (await this.tokenizer.ignore(a.extraFieldLength), a.dataDescriptor && a.compressedSize === 0) {
6380
6380
  const m = [];
6381
- let o = e0;
6382
- A("Compressed-file-size unknown, scanning for next data-descriptor-signature....");
6381
+ let o = Y;
6382
+ T("Compressed-file-size unknown, scanning for next data-descriptor-signature....");
6383
6383
  let f = -1;
6384
- for (; f < 0 && o === e0; ) {
6384
+ for (; f < 0 && o === Y; ) {
6385
6385
  o = await this.tokenizer.peekBuffer(this.syncBuffer, { mayBeLess: !0 }), f = be(this.syncBuffer.subarray(0, o), he);
6386
6386
  const d = f >= 0 ? f : o;
6387
- if (r.handler) {
6388
- const n = new Uint8Array(d);
6389
- await this.tokenizer.readBuffer(n), m.push(n);
6387
+ if (n.handler) {
6388
+ const r = new Uint8Array(d);
6389
+ await this.tokenizer.readBuffer(r), m.push(r);
6390
6390
  } else
6391
6391
  await this.tokenizer.ignore(d);
6392
6392
  }
6393
- A(`Found data-descriptor-signature at pos=${this.tokenizer.position}`), r.handler && await this.inflate(a, ge(m), r.handler);
6393
+ T(`Found data-descriptor-signature at pos=${this.tokenizer.position}`), n.handler && await this.inflate(a, ge(m), n.handler);
6394
6394
  } else
6395
- r.handler ? (A(`Reading compressed-file-data: ${a.compressedSize} bytes`), s = new Uint8Array(a.compressedSize), await this.tokenizer.readBuffer(s), await this.inflate(a, s, r.handler)) : (A(`Ignoring compressed-file-data: ${a.compressedSize} bytes`), await this.tokenizer.ignore(a.compressedSize));
6396
- if (A(`Reading data-descriptor at pos=${this.tokenizer.position}`), a.dataDescriptor && (await this.tokenizer.readToken(C0)).signature !== 134695760)
6397
- throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position - C0.len}`);
6395
+ n.handler ? (T(`Reading compressed-file-data: ${a.compressedSize} bytes`), s = new Uint8Array(a.compressedSize), await this.tokenizer.readBuffer(s), await this.inflate(a, s, n.handler)) : (T(`Ignoring compressed-file-data: ${a.compressedSize} bytes`), await this.tokenizer.ignore(a.compressedSize));
6396
+ if (T(`Reading data-descriptor at pos=${this.tokenizer.position}`), a.dataDescriptor && (await this.tokenizer.readToken(y0)).signature !== 134695760)
6397
+ throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position - y0.len}`);
6398
6398
  } while (!t);
6399
6399
  }
6400
6400
  async iterateOverCentralDirectory(e, x) {
@@ -6402,11 +6402,11 @@ class n0 {
6402
6402
  const a = x(t);
6403
6403
  if (a.handler) {
6404
6404
  this.tokenizer.setPosition(t.relativeOffsetOfLocalHeader);
6405
- const r = await this.readLocalFileHeader();
6406
- if (r) {
6407
- await this.tokenizer.ignore(r.extraFieldLength);
6405
+ const n = await this.readLocalFileHeader();
6406
+ if (n) {
6407
+ await this.tokenizer.ignore(n.extraFieldLength);
6408
6408
  const s = new Uint8Array(t.compressedSize);
6409
- await this.tokenizer.readBuffer(s), await this.inflate(r, s, a.handler);
6409
+ await this.tokenizer.readBuffer(s), await this.inflate(n, s, a.handler);
6410
6410
  }
6411
6411
  }
6412
6412
  if (a.stop)
@@ -6418,21 +6418,21 @@ class n0 {
6418
6418
  return t(x);
6419
6419
  if (e.compressedMethod !== 8)
6420
6420
  throw new Error(`Unsupported ZIP compression method: ${e.compressedMethod}`);
6421
- A(`Decompress filename=${e.filename}, compressed-size=${x.length}`);
6422
- const a = await n0.decompressDeflateRaw(x);
6421
+ T(`Decompress filename=${e.filename}, compressed-size=${x.length}`);
6422
+ const a = await a0.decompressDeflateRaw(x);
6423
6423
  return t(a);
6424
6424
  }
6425
6425
  static async decompressDeflateRaw(e) {
6426
6426
  const x = new ReadableStream({
6427
- start(r) {
6428
- r.enqueue(e), r.close();
6427
+ start(n) {
6428
+ n.enqueue(e), n.close();
6429
6429
  }
6430
6430
  }), t = new DecompressionStream("deflate-raw"), a = x.pipeThrough(t);
6431
6431
  try {
6432
6432
  const s = await new Response(a).arrayBuffer();
6433
6433
  return new Uint8Array(s);
6434
- } catch (r) {
6435
- const s = r instanceof Error ? `Failed to deflate ZIP entry: ${r.message}` : "Unknown decompression error in ZIP entry";
6434
+ } catch (n) {
6435
+ const s = n instanceof Error ? `Failed to deflate ZIP entry: ${n.message}` : "Unknown decompression error in ZIP entry";
6436
6436
  throw new TypeError(s);
6437
6437
  }
6438
6438
  }
@@ -6452,19 +6452,19 @@ function be(i, e) {
6452
6452
  if (t > x)
6453
6453
  return -1;
6454
6454
  for (let a = 0; a <= x - t; a++) {
6455
- let r = !0;
6455
+ let n = !0;
6456
6456
  for (let s = 0; s < t; s++)
6457
6457
  if (i[a + s] !== e[s]) {
6458
- r = !1;
6458
+ n = !1;
6459
6459
  break;
6460
6460
  }
6461
- if (r)
6461
+ if (n)
6462
6462
  return a;
6463
6463
  }
6464
6464
  return -1;
6465
6465
  }
6466
6466
  function ge(i) {
6467
- const e = i.reduce((a, r) => a + r.length, 0), x = new Uint8Array(e);
6467
+ const e = i.reduce((a, n) => a + n.length, 0), x = new Uint8Array(e);
6468
6468
  let t = 0;
6469
6469
  for (const a of i)
6470
6470
  x.set(a, t), t += a.length;
@@ -6491,7 +6491,7 @@ class we {
6491
6491
  new globalThis.TextDecoder("utf8");
6492
6492
  new globalThis.TextEncoder();
6493
6493
  Array.from({ length: 256 }, (i, e) => e.toString(16).padStart(2, "0"));
6494
- function v0(i) {
6494
+ function C0(i) {
6495
6495
  const { byteLength: e } = i;
6496
6496
  if (e === 6)
6497
6497
  return i.getUint16(0) * 2 ** 32 + i.getUint32(2);
@@ -6720,7 +6720,7 @@ const Ce = {
6720
6720
  "tar.gz",
6721
6721
  "reg",
6722
6722
  "dat"
6723
- ], Se = [
6723
+ ], Fe = [
6724
6724
  "image/jpeg",
6725
6725
  "image/png",
6726
6726
  "image/gif",
@@ -6903,11 +6903,11 @@ const Ce = {
6903
6903
  "application/x-ms-regedit",
6904
6904
  "application/x-ft-windows-registry-hive",
6905
6905
  "application/x-jmp-data"
6906
- ], x0 = 4100;
6907
- async function Fe(i, e) {
6906
+ ], e0 = 4100;
6907
+ async function Se(i, e) {
6908
6908
  return new _e(e).fromBuffer(i);
6909
6909
  }
6910
- function t0(i) {
6910
+ function x0(i) {
6911
6911
  switch (i = i.toLowerCase(), i) {
6912
6912
  case "application/epub+zip":
6913
6913
  return {
@@ -7077,7 +7077,7 @@ class _e {
7077
7077
  throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``);
7078
7078
  const x = e instanceof Uint8Array ? e : new Uint8Array(e);
7079
7079
  if (x?.length > 1)
7080
- return this.fromTokenizer(re(x, this.tokenizerOptions));
7080
+ return this.fromTokenizer(ne(x, this.tokenizerOptions));
7081
7081
  }
7082
7082
  async fromBlob(e) {
7083
7083
  const x = ce(e, this.tokenizerOptions);
@@ -7088,7 +7088,7 @@ class _e {
7088
7088
  }
7089
7089
  }
7090
7090
  async fromStream(e) {
7091
- const x = ne(e, this.tokenizerOptions);
7091
+ const x = re(e, this.tokenizerOptions);
7092
7092
  try {
7093
7093
  return await this.fromTokenizer(x);
7094
7094
  } finally {
@@ -7096,26 +7096,26 @@ class _e {
7096
7096
  }
7097
7097
  }
7098
7098
  async toDetectionStream(e, x) {
7099
- const { sampleSize: t = x0 } = x;
7100
- let a, r;
7099
+ const { sampleSize: t = e0 } = x;
7100
+ let a, n;
7101
7101
  const s = e.getReader({ mode: "byob" });
7102
7102
  try {
7103
7103
  const { value: f, done: d } = await s.read(new Uint8Array(t));
7104
- if (r = f, !d && f)
7104
+ if (n = f, !d && f)
7105
7105
  try {
7106
7106
  a = await this.fromBuffer(f.subarray(0, t));
7107
- } catch (n) {
7108
- if (!(n instanceof B))
7109
- throw n;
7107
+ } catch (r) {
7108
+ if (!(r instanceof B))
7109
+ throw r;
7110
7110
  a = void 0;
7111
7111
  }
7112
- r = f;
7112
+ n = f;
7113
7113
  } finally {
7114
7114
  s.releaseLock();
7115
7115
  }
7116
7116
  const m = new TransformStream({
7117
7117
  async start(f) {
7118
- f.enqueue(r);
7118
+ f.enqueue(n);
7119
7119
  },
7120
7120
  transform(f, d) {
7121
7121
  d.enqueue(f);
@@ -7131,7 +7131,7 @@ class _e {
7131
7131
  }
7132
7132
  // Detections with a high degree of certainty in identifying the correct file type
7133
7133
  detectConfident = async (e) => {
7134
- if (this.buffer = new Uint8Array(x0), e.fileInfo.size === void 0 && (e.fileInfo.size = Number.MAX_SAFE_INTEGER), this.tokenizer = e, await e.peekBuffer(this.buffer, { length: 32, mayBeLess: !0 }), this.check([66, 77]))
7134
+ if (this.buffer = new Uint8Array(e0), e.fileInfo.size === void 0 && (e.fileInfo.size = Number.MAX_SAFE_INTEGER), this.tokenizer = e, await e.peekBuffer(this.buffer, { length: 32, mayBeLess: !0 }), this.check([66, 77]))
7135
7135
  return {
7136
7136
  ext: "bmp",
7137
7137
  mime: "image/bmp"
@@ -7190,13 +7190,13 @@ class _e {
7190
7190
  const t = new we(e).inflate();
7191
7191
  let a = !0;
7192
7192
  try {
7193
- let r;
7193
+ let n;
7194
7194
  try {
7195
- r = await this.fromStream(t);
7195
+ n = await this.fromStream(t);
7196
7196
  } catch {
7197
7197
  a = !1;
7198
7198
  }
7199
- if (r && r.ext === "tar")
7199
+ if (n && n.ext === "tar")
7200
7200
  return {
7201
7201
  ext: "tar.gz",
7202
7202
  mime: "application/gzip"
@@ -7272,7 +7272,7 @@ class _e {
7272
7272
  };
7273
7273
  if (this.check([80, 75, 3, 4])) {
7274
7274
  let x;
7275
- return await new n0(e).unzip((t) => {
7275
+ return await new a0(e).unzip((t) => {
7276
7276
  switch (t.filename) {
7277
7277
  case "META-INF/mozilla.rsa":
7278
7278
  return x = {
@@ -7291,23 +7291,23 @@ class _e {
7291
7291
  case "mimetype":
7292
7292
  return {
7293
7293
  async handler(a) {
7294
- const r = new TextDecoder("utf-8").decode(a).trim();
7295
- x = t0(r);
7294
+ const n = new TextDecoder("utf-8").decode(a).trim();
7295
+ x = x0(n);
7296
7296
  },
7297
7297
  stop: !0
7298
7298
  };
7299
7299
  case "[Content_Types].xml":
7300
7300
  return {
7301
7301
  async handler(a) {
7302
- let r = new TextDecoder("utf-8").decode(a);
7303
- const s = r.indexOf('.main+xml"');
7302
+ let n = new TextDecoder("utf-8").decode(a);
7303
+ const s = n.indexOf('.main+xml"');
7304
7304
  if (s === -1) {
7305
7305
  const m = "application/vnd.ms-package.3dmanufacturing-3dmodel+xml";
7306
- r.includes(`ContentType="${m}"`) && (x = t0(m));
7306
+ n.includes(`ContentType="${m}"`) && (x = x0(m));
7307
7307
  } else {
7308
- r = r.slice(0, Math.max(0, s));
7309
- const m = r.lastIndexOf('"'), o = r.slice(Math.max(0, m + 1));
7310
- x = t0(o);
7308
+ n = n.slice(0, Math.max(0, s));
7309
+ const m = n.lastIndexOf('"'), o = n.slice(Math.max(0, m + 1));
7310
+ x = x0(o);
7311
7311
  }
7312
7312
  },
7313
7313
  stop: !0
@@ -7440,10 +7440,10 @@ class _e {
7440
7440
  async function t() {
7441
7441
  const m = await x(), o = await x();
7442
7442
  o[0] ^= 128 >> o.length - 1;
7443
- const f = Math.min(6, o.length), d = new DataView(m.buffer), n = new DataView(o.buffer, o.length - f, f);
7443
+ const f = Math.min(6, o.length), d = new DataView(m.buffer), r = new DataView(o.buffer, o.length - f, f);
7444
7444
  return {
7445
- id: v0(d),
7446
- len: v0(n)
7445
+ id: C0(d),
7446
+ len: C0(r)
7447
7447
  };
7448
7448
  }
7449
7449
  async function a(m) {
@@ -7454,8 +7454,8 @@ class _e {
7454
7454
  await e.ignore(o.len), --m;
7455
7455
  }
7456
7456
  }
7457
- const r = await t();
7458
- switch (await a(r.len)) {
7457
+ const n = await t();
7458
+ switch (await a(n.len)) {
7459
7459
  case "webm":
7460
7460
  return {
7461
7461
  ext: "webm",
@@ -7813,13 +7813,13 @@ class _e {
7813
7813
  const t = await x();
7814
7814
  let a = t.size - 24;
7815
7815
  if (M(t.id, [145, 7, 220, 183, 183, 169, 207, 17, 142, 230, 0, 192, 12, 32, 83, 101])) {
7816
- const r = new Uint8Array(16);
7817
- if (a -= await e.readBuffer(r), M(r, [64, 158, 105, 248, 77, 91, 207, 17, 168, 253, 0, 128, 95, 92, 68, 43]))
7816
+ const n = new Uint8Array(16);
7817
+ if (a -= await e.readBuffer(n), M(n, [64, 158, 105, 248, 77, 91, 207, 17, 168, 253, 0, 128, 95, 92, 68, 43]))
7818
7818
  return {
7819
7819
  ext: "asf",
7820
7820
  mime: "audio/x-ms-asf"
7821
7821
  };
7822
- if (M(r, [192, 239, 25, 188, 77, 91, 207, 17, 168, 253, 0, 128, 95, 92, 68, 43]))
7822
+ if (M(n, [192, 239, 25, 188, 77, 91, 207, 17, 168, 253, 0, 128, 95, 92, 68, 43]))
7823
7823
  return {
7824
7824
  ext: "asf",
7825
7825
  mime: "video/x-ms-asf"
@@ -8033,7 +8033,7 @@ class _e {
8033
8033
  };
8034
8034
  // Detections with limited supporting data, resulting in a higher likelihood of false positives
8035
8035
  detectImprecise = async (e) => {
8036
- if (this.buffer = new Uint8Array(x0), await e.peekBuffer(this.buffer, { length: Math.min(8, e.fileInfo.size), mayBeLess: !0 }), this.check([0, 0, 1, 186]) || this.check([0, 0, 1, 179]))
8036
+ if (this.buffer = new Uint8Array(e0), await e.peekBuffer(this.buffer, { length: Math.min(8, e.fileInfo.size), mayBeLess: !0 }), this.check([0, 0, 1, 186]) || this.check([0, 0, 1, 179]))
8037
8037
  return {
8038
8038
  ext: "mpg",
8039
8039
  mime: "video/mpeg"
@@ -8061,7 +8061,7 @@ class _e {
8061
8061
  }
8062
8062
  };
8063
8063
  async readTiffTag(e) {
8064
- const x = await this.tokenizer.readToken(e ? W : F);
8064
+ const x = await this.tokenizer.readToken(e ? W : S);
8065
8065
  switch (this.tokenizer.ignore(10), x) {
8066
8066
  case 50341:
8067
8067
  return {
@@ -8076,7 +8076,7 @@ class _e {
8076
8076
  }
8077
8077
  }
8078
8078
  async readTiffIFD(e) {
8079
- const x = await this.tokenizer.readToken(e ? W : F);
8079
+ const x = await this.tokenizer.readToken(e ? W : S);
8080
8080
  for (let t = 0; t < x; ++t) {
8081
8081
  const a = await this.readTiffTag(e);
8082
8082
  if (a)
@@ -8084,7 +8084,7 @@ class _e {
8084
8084
  }
8085
8085
  }
8086
8086
  async readTiffHeader(e) {
8087
- const x = (e ? W : F).get(this.buffer, 2), t = (e ? J0 : _).get(this.buffer, 4);
8087
+ const x = (e ? W : S).get(this.buffer, 2), t = (e ? J0 : _).get(this.buffer, 4);
8088
8088
  if (x === 42) {
8089
8089
  if (t >= 6) {
8090
8090
  if (this.checkString("CR", { offset: 8 }))
@@ -8093,8 +8093,8 @@ class _e {
8093
8093
  mime: "image/x-canon-cr2"
8094
8094
  };
8095
8095
  if (t >= 8) {
8096
- const r = (e ? W : F).get(this.buffer, 8), s = (e ? W : F).get(this.buffer, 10);
8097
- if (r === 28 && s === 254 || r === 31 && s === 11)
8096
+ const n = (e ? W : S).get(this.buffer, 8), s = (e ? W : S).get(this.buffer, 10);
8097
+ if (n === 28 && s === 254 || n === 31 && s === 11)
8098
8098
  return {
8099
8099
  ext: "nef",
8100
8100
  mime: "image/x-nikon-nef"
@@ -8147,7 +8147,7 @@ class _e {
8147
8147
  }
8148
8148
  }
8149
8149
  new Set(ve);
8150
- new Set(Se);
8150
+ new Set(Fe);
8151
8151
  class De extends Error {
8152
8152
  locator;
8153
8153
  /** Logical source of the error. */
@@ -8157,22 +8157,22 @@ class De extends Error {
8157
8157
  }
8158
8158
  class Be extends De {
8159
8159
  }
8160
- class Ie extends Be {
8160
+ let Ie = class extends Be {
8161
8161
  body;
8162
8162
  /** Sanitized HTTP response body. */
8163
8163
  constructor(e, x, t, a) {
8164
8164
  super(e, x, a), this.name = new.target.name, this.body = Le(t ?? void 0);
8165
8165
  }
8166
- }
8166
+ };
8167
8167
  async function Oe(i, e, x) {
8168
8168
  const t = ` - ${i.statusText}`, a = `${e} Response status '${i.status}${i.statusText ? t : ""}' received.`;
8169
- let r;
8169
+ let n;
8170
8170
  try {
8171
- r = await i.text();
8171
+ n = await i.text();
8172
8172
  } catch (s) {
8173
- r = `<body unavailable: ${Ee(s).message}>`;
8173
+ n = `<body unavailable: ${Ee(s).message}>`;
8174
8174
  }
8175
- return new Ie(a, x, r);
8175
+ return new Ie(a, x, n);
8176
8176
  }
8177
8177
  function Ee(i) {
8178
8178
  if (i instanceof Error) return i;
@@ -8191,9 +8191,9 @@ function Le(i) {
8191
8191
  if (!(i == null || i === ""))
8192
8192
  return i.length > 2048 ? `${i.slice(0, 2048)}... [truncated]` : i;
8193
8193
  }
8194
- const Te = { id: "ascii", groupLabel: "", label: "ascii", isDetectable: !1, isDecodable: !0 }, Ae = { id: "big5", groupLabel: "Chinese Traditional", label: "Chinese Traditional (big5)", isDetectable: !0, isDecodable: !0 }, Me = { id: "gb18030", groupLabel: "Chinese Simplified", label: "Chinese Simplified (gb18030)", isDetectable: !0, isDecodable: !0 }, ze = { id: "gbk", groupLabel: "Chinese Simplified", label: "Chinese Simplified (gbk)", isDetectable: !1, isDecodable: !0 }, Ue = { id: "ibm866", groupLabel: "Cyrillic", label: "Cyrillic (ibm866)", isDetectable: !1, isDecodable: !0 }, je = { id: "latin1", groupLabel: "Western", label: "Western (latin1)", isDetectable: !1, isDecodable: !0 }, Re = { id: "macintosh", groupLabel: "Western", label: "Western (macintosh)", isDetectable: !1, isDecodable: !0 }, Pe = { id: "shift_jis", groupLabel: "Japanese", label: "Japanese (shift_jis)", isDetectable: !0, isDecodable: !0 }, qe = { id: "utf16", groupLabel: "Unicode 16", label: "Unicode 16 (utf16)", isDetectable: !1, isDecodable: !0 }, Ne = { id: "utf16be", groupLabel: "Unicode 16", label: "Unicode 16 (utf16be)", isDetectable: !0, isDecodable: !0 }, Ve = { id: "utf16le", groupLabel: "Unicode 16", label: "Unicode 16 (utf16le)", isDetectable: !0, isDecodable: !0 }, He = { id: "utf32be", groupLabel: "Unicode 32", label: "Unicode 32 (utf32be)", isDetectable: !0, isDecodable: !1 }, We = { id: "utf32le", groupLabel: "Unicode 32", label: "Unicode 32 (utf32le)", isDetectable: !0, isDecodable: !1 }, Ge = { id: "utf8", groupLabel: "", label: "utf8", isDetectable: !0, isDecodable: !0 }, Q = {
8195
- ascii: Te,
8196
- big5: Ae,
8194
+ const Ae = { id: "ascii", groupLabel: "", label: "ascii", isDetectable: !1, isDecodable: !0 }, Te = { id: "big5", groupLabel: "Chinese Traditional", label: "Chinese Traditional (big5)", isDetectable: !0, isDecodable: !0 }, Me = { id: "gb18030", groupLabel: "Chinese Simplified", label: "Chinese Simplified (gb18030)", isDetectable: !0, isDecodable: !0 }, ze = { id: "gbk", groupLabel: "Chinese Simplified", label: "Chinese Simplified (gbk)", isDetectable: !1, isDecodable: !0 }, Ue = { id: "ibm866", groupLabel: "Cyrillic", label: "Cyrillic (ibm866)", isDetectable: !1, isDecodable: !0 }, je = { id: "latin1", groupLabel: "Western", label: "Western (latin1)", isDetectable: !1, isDecodable: !0 }, Re = { id: "macintosh", groupLabel: "Western", label: "Western (macintosh)", isDetectable: !1, isDecodable: !0 }, Pe = { id: "shift_jis", groupLabel: "Japanese", label: "Japanese (shift_jis)", isDetectable: !0, isDecodable: !0 }, qe = { id: "utf16", groupLabel: "Unicode 16", label: "Unicode 16 (utf16)", isDetectable: !1, isDecodable: !0 }, Ne = { id: "utf16be", groupLabel: "Unicode 16", label: "Unicode 16 (utf16be)", isDetectable: !0, isDecodable: !0 }, Ve = { id: "utf16le", groupLabel: "Unicode 16", label: "Unicode 16 (utf16le)", isDetectable: !0, isDecodable: !0 }, He = { id: "utf32be", groupLabel: "Unicode 32", label: "Unicode 32 (utf32be)", isDetectable: !0, isDecodable: !1 }, We = { id: "utf32le", groupLabel: "Unicode 32", label: "Unicode 32 (utf32le)", isDetectable: !0, isDecodable: !1 }, Ge = { id: "utf8", groupLabel: "", label: "utf8", isDetectable: !0, isDecodable: !0 }, Je = {
8195
+ ascii: Ae,
8196
+ big5: Te,
8197
8197
  "euc-jp": { id: "euc-jp", groupLabel: "Japanese", label: "Japanese (euc-jp)", isDetectable: !0, isDecodable: !0 },
8198
8198
  "euc-kr": { id: "euc-kr", groupLabel: "Korean", label: "Korean (euc-kr)", isDetectable: !0, isDecodable: !0 },
8199
8199
  gb18030: Me,
@@ -8241,67 +8241,49 @@ const Te = { id: "ascii", groupLabel: "", label: "ascii", isDetectable: !1, isDe
8241
8241
  "windows-874": { id: "windows-874", groupLabel: "Thai", label: "Thai (windows-874)", isDetectable: !1, isDecodable: !0 },
8242
8242
  "x-mac-cyrillic": { id: "x-mac-cyrillic", groupLabel: "Cyrillic", label: "Cyrillic (x-mac-cyrillic)", isDetectable: !1, isDecodable: !0 },
8243
8243
  "x-user-defined": { id: "x-user-defined", groupLabel: "Other", label: "Other (x-user-defined)", isDetectable: !1, isDecodable: !0 }
8244
- }, Je = 4096;
8245
- class Ye {
8246
- /**
8247
- * Get encoding configurations.
8248
- */
8249
- getEncodingConfigs(e = "en") {
8250
- const x = [];
8251
- for (const t in Q)
8252
- if (Object.prototype.hasOwnProperty.call(Q, t)) {
8253
- const a = Q[t];
8254
- if (a == null) continue;
8255
- x.push({ ...a, label: a.label || a.id });
8256
- }
8257
- return x.toSorted((t, a) => t.groupLabel.localeCompare(a.groupLabel) || t.label.localeCompare(a.label));
8258
- }
8244
+ }, Ke = 4096, v0 = { id: "utf8", confidenceLevel: void 0 };
8245
+ class xx {
8259
8246
  /**
8260
8247
  * Preview remote file.
8261
8248
  */
8262
8249
  async previewRemoteFile(e, x, t) {
8263
- const a = await fetch(encodeURI(e), { headers: { Range: `bytes=0-${t ?? Je - 1}` }, signal: x });
8250
+ const a = await fetch(encodeURI(e), { headers: { Range: `bytes=0-${t ?? Ke - 1}` }, signal: x });
8264
8251
  if (!a.ok)
8265
8252
  throw await Oe(a, `Failed to fetch '${e}' file.`, "datapos-tool-file-operators.previewRemoteFile");
8266
- const r = new Uint8Array(await a.arrayBuffer()), s = await Fe(r);
8267
- if (s != null) throw new Error(`Files of type '${s.ext}' (mine '${s.mime}') not supported.`);
8268
- return Ke(r);
8253
+ const n = new Uint8Array(await a.arrayBuffer()), s = await Se(n);
8254
+ if (s && !s.mime.startsWith("text/"))
8255
+ throw new Error(`Files of type '${s.ext}' (mine '${s.mime}') not supported.`);
8256
+ return Ze(n);
8269
8257
  }
8270
8258
  }
8271
- function Ke(i) {
8272
- const e = Ze(i), x = $e(i, e);
8259
+ function Ze(i) {
8260
+ const e = $e(i), x = Qe(i, e);
8273
8261
  return {
8274
- asAt: Date.now(),
8275
- columnConfigs: [],
8262
+ bytes: i,
8276
8263
  dataFormatId: "dtv",
8277
- duration: 0,
8278
8264
  encodingId: x.encoding.id,
8279
8265
  encodingConfidenceLevel: x.encoding.confidenceLevel,
8280
- hasHeaders: void 0,
8281
- records: [],
8282
8266
  size: i.length,
8283
- text: x.textData
8267
+ text: x.text
8284
8268
  };
8285
8269
  }
8286
- function Ze(i) {
8270
+ function $e(i) {
8287
8271
  if (i[0] === 239 && i[1] === 187 && i[2] === 191) return { confidenceLevel: 100, id: "utf8" };
8288
8272
  if (i[0] === 254 && i[1] === 255) return { confidenceLevel: 100, id: "utf-16be" };
8289
8273
  if (i[0] === 255 && i[1] === 254) return { confidenceLevel: 100, id: "utf-16le" };
8290
- const x = j0.analyse(i)[0] ?? { confidence: void 0, name: "utf8" }, t = Q[x.name.toLowerCase()], a = t == null ? "utf8" : t.id;
8274
+ const x = j0.analyse(i)[0] ?? { confidence: void 0, name: "utf8" }, t = Je[x.name.toLowerCase()], a = t == null ? "utf8" : t.id;
8291
8275
  return { confidenceLevel: x.confidence, id: a };
8292
8276
  }
8293
- function $e(i, e) {
8277
+ function Qe(i, e) {
8294
8278
  try {
8295
- const x = new TextDecoder(e.id).decode(S0(i));
8296
- return { encoding: e, textData: x };
8297
- } catch (x) {
8298
- const t = { id: "utf8", confidenceLevel: void 0 };
8299
- console.log(`Unsupported encoding '${e.id}' defaulted to '${t.id}'.`, x);
8300
- const a = new TextDecoder(t.id).decode(S0(i));
8301
- return { encoding: t, textData: a };
8279
+ const x = new TextDecoder(e.id).decode(F0(i));
8280
+ return { encoding: e, text: x };
8281
+ } catch {
8282
+ const x = new TextDecoder(v0.id, { fatal: !1 }).decode(F0(i));
8283
+ return { encoding: v0, text: x };
8302
8284
  }
8303
8285
  }
8304
- function S0(i) {
8286
+ function F0(i) {
8305
8287
  let e = i;
8306
8288
  const x = e.length;
8307
8289
  for (let t = x - 1; t >= 0; t--) {
@@ -8322,5 +8304,5 @@ function S0(i) {
8322
8304
  return e;
8323
8305
  }
8324
8306
  export {
8325
- Ye as Tool
8307
+ xx as Tool
8326
8308
  };