bsv2 2.2.1 → 2.2.2
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 +3 -4
- package/dist/bsv2.cjs +7 -7
- package/dist/bsv2.cjs.map +1 -1
- package/dist/bsv2.mjs +975 -965
- package/dist/bsv2.mjs.map +1 -1
- package/dist/bsv2.umd.js +7 -7
- package/dist/bsv2.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/bsv2.mjs
CHANGED
|
@@ -162,13 +162,13 @@ function Te() {
|
|
|
162
162
|
this.length = Math.ceil(m.length / 3), this.words = new Array(this.length);
|
|
163
163
|
for (var R = 0; R < this.length; R++)
|
|
164
164
|
this.words[R] = 0;
|
|
165
|
-
var A,
|
|
165
|
+
var A, F, K = 0;
|
|
166
166
|
if (O === "be")
|
|
167
167
|
for (R = m.length - 1, A = 0; R >= 0; R -= 3)
|
|
168
|
-
|
|
168
|
+
F = m[R] | m[R - 1] << 8 | m[R - 2] << 16, this.words[A] |= F << K & 67108863, this.words[A + 1] = F >>> 26 - K & 67108863, K += 24, K >= 26 && (K -= 26, A++);
|
|
169
169
|
else if (O === "le")
|
|
170
170
|
for (R = 0, A = 0; R < m.length; R += 3)
|
|
171
|
-
|
|
171
|
+
F = m[R] | m[R + 1] << 8 | m[R + 2] << 16, this.words[A] |= F << K & 67108863, this.words[A + 1] = F >>> 26 - K & 67108863, K += 24, K >= 26 && (K -= 26, A++);
|
|
172
172
|
return this._strip();
|
|
173
173
|
};
|
|
174
174
|
function a(k, m) {
|
|
@@ -189,19 +189,19 @@ function Te() {
|
|
|
189
189
|
this.length = Math.ceil((m.length - E) / 6), this.words = new Array(this.length);
|
|
190
190
|
for (var R = 0; R < this.length; R++)
|
|
191
191
|
this.words[R] = 0;
|
|
192
|
-
var A = 0,
|
|
192
|
+
var A = 0, F = 0, K;
|
|
193
193
|
if (O === "be")
|
|
194
194
|
for (R = m.length - 1; R >= E; R -= 2)
|
|
195
|
-
K = o(m, E, R) << A, this.words[
|
|
195
|
+
K = o(m, E, R) << A, this.words[F] |= K & 67108863, A >= 18 ? (A -= 18, F += 1, this.words[F] |= K >>> 26) : A += 8;
|
|
196
196
|
else {
|
|
197
197
|
var L = m.length - E;
|
|
198
198
|
for (R = L % 2 === 0 ? E + 1 : E; R < m.length; R += 2)
|
|
199
|
-
K = o(m, E, R) << A, this.words[
|
|
199
|
+
K = o(m, E, R) << A, this.words[F] |= K & 67108863, A >= 18 ? (A -= 18, F += 1, this.words[F] |= K >>> 26) : A += 8;
|
|
200
200
|
}
|
|
201
201
|
this._strip();
|
|
202
202
|
};
|
|
203
203
|
function f(k, m, E, O) {
|
|
204
|
-
for (var R = 0, A = 0,
|
|
204
|
+
for (var R = 0, A = 0, F = Math.min(k.length, E), K = m; K < F; K++) {
|
|
205
205
|
var L = k.charCodeAt(K) - 48;
|
|
206
206
|
R *= O, L >= 49 ? A = L - 49 + 10 : L >= 17 ? A = L - 17 + 10 : A = L, n(L >= 0 && A < O, "Invalid character"), R += A;
|
|
207
207
|
}
|
|
@@ -212,11 +212,11 @@ function Te() {
|
|
|
212
212
|
for (var R = 0, A = 1; A <= 67108863; A *= E)
|
|
213
213
|
R++;
|
|
214
214
|
R--, A = A / E | 0;
|
|
215
|
-
for (var
|
|
216
|
-
_ = f(m,
|
|
215
|
+
for (var F = m.length - O, K = F % R, L = Math.min(F, F - K) + O, _ = 0, U = O; U < L; U += R)
|
|
216
|
+
_ = f(m, U, U + R, E), this.imuln(A), this.words[0] + _ < 67108864 ? this.words[0] += _ : this._iaddn(_);
|
|
217
217
|
if (K !== 0) {
|
|
218
218
|
var fe = 1;
|
|
219
|
-
for (_ = f(m,
|
|
219
|
+
for (_ = f(m, U, m.length, E), U = 0; U < K; U++)
|
|
220
220
|
fe *= E;
|
|
221
221
|
this.imuln(fe), this.words[0] + _ < 67108864 ? this.words[0] += _ : this._iaddn(_);
|
|
222
222
|
}
|
|
@@ -365,21 +365,21 @@ function Te() {
|
|
|
365
365
|
var O;
|
|
366
366
|
if (m === 16 || m === "hex") {
|
|
367
367
|
O = "";
|
|
368
|
-
for (var R = 0, A = 0,
|
|
369
|
-
var K = this.words[
|
|
370
|
-
A = K >>> 24 - R & 16777215, R += 2, R >= 26 && (R -= 26,
|
|
368
|
+
for (var R = 0, A = 0, F = 0; F < this.length; F++) {
|
|
369
|
+
var K = this.words[F], L = ((K << R | A) & 16777215).toString(16);
|
|
370
|
+
A = K >>> 24 - R & 16777215, R += 2, R >= 26 && (R -= 26, F--), A !== 0 || F !== this.length - 1 ? O = h[6 - L.length] + L + O : O = L + O;
|
|
371
371
|
}
|
|
372
372
|
for (A !== 0 && (O = A.toString(16) + O); O.length % E !== 0; )
|
|
373
373
|
O = "0" + O;
|
|
374
374
|
return this.negative !== 0 && (O = "-" + O), O;
|
|
375
375
|
}
|
|
376
376
|
if (m === (m | 0) && m >= 2 && m <= 36) {
|
|
377
|
-
var _ = d[m],
|
|
377
|
+
var _ = d[m], U = b[m];
|
|
378
378
|
O = "";
|
|
379
379
|
var fe = this.clone();
|
|
380
380
|
for (fe.negative = 0; !fe.isZero(); ) {
|
|
381
|
-
var se = fe.modrn(
|
|
382
|
-
fe = fe.idivn(
|
|
381
|
+
var se = fe.modrn(U).toString(m);
|
|
382
|
+
fe = fe.idivn(U), fe.isZero() ? O = se + O : O = h[_ - se.length] + se + O;
|
|
383
383
|
}
|
|
384
384
|
for (this.isZero() && (O = "0" + O); O.length % E !== 0; )
|
|
385
385
|
O = "0" + O;
|
|
@@ -403,20 +403,20 @@ function Te() {
|
|
|
403
403
|
this._strip();
|
|
404
404
|
var R = this.byteLength(), A = O || Math.max(1, R);
|
|
405
405
|
n(R <= A, "byte array longer than desired length"), n(A > 0, "Requested array length <= 0");
|
|
406
|
-
var
|
|
407
|
-
return this["_toArrayLike" + K](
|
|
406
|
+
var F = p(m, A), K = E === "le" ? "LE" : "BE";
|
|
407
|
+
return this["_toArrayLike" + K](F, R), F;
|
|
408
408
|
}, r.prototype._toArrayLikeLE = function(m, E) {
|
|
409
|
-
for (var O = 0, R = 0, A = 0,
|
|
410
|
-
var K = this.words[A] <<
|
|
411
|
-
m[O++] = K & 255, O < m.length && (m[O++] = K >> 8 & 255), O < m.length && (m[O++] = K >> 16 & 255),
|
|
409
|
+
for (var O = 0, R = 0, A = 0, F = 0; A < this.length; A++) {
|
|
410
|
+
var K = this.words[A] << F | R;
|
|
411
|
+
m[O++] = K & 255, O < m.length && (m[O++] = K >> 8 & 255), O < m.length && (m[O++] = K >> 16 & 255), F === 6 ? (O < m.length && (m[O++] = K >> 24 & 255), R = 0, F = 0) : (R = K >>> 24, F += 2);
|
|
412
412
|
}
|
|
413
413
|
if (O < m.length)
|
|
414
414
|
for (m[O++] = R; O < m.length; )
|
|
415
415
|
m[O++] = 0;
|
|
416
416
|
}, r.prototype._toArrayLikeBE = function(m, E) {
|
|
417
|
-
for (var O = m.length - 1, R = 0, A = 0,
|
|
418
|
-
var K = this.words[A] <<
|
|
419
|
-
m[O--] = K & 255, O >= 0 && (m[O--] = K >> 8 & 255), O >= 0 && (m[O--] = K >> 16 & 255),
|
|
417
|
+
for (var O = m.length - 1, R = 0, A = 0, F = 0; A < this.length; A++) {
|
|
418
|
+
var K = this.words[A] << F | R;
|
|
419
|
+
m[O--] = K & 255, O >= 0 && (m[O--] = K >> 8 & 255), O >= 0 && (m[O--] = K >> 16 & 255), F === 6 ? (O >= 0 && (m[O--] = K >> 24 & 255), R = 0, F = 0) : (R = K >>> 24, F += 2);
|
|
420
420
|
}
|
|
421
421
|
if (O >= 0)
|
|
422
422
|
for (m[O--] = R; O >= 0; )
|
|
@@ -520,15 +520,15 @@ function Te() {
|
|
|
520
520
|
return m.negative = 0, E = this.isub(m), m.negative = 1, E._normSign();
|
|
521
521
|
var O, R;
|
|
522
522
|
this.length > m.length ? (O = this, R = m) : (O = m, R = this);
|
|
523
|
-
for (var A = 0,
|
|
524
|
-
E = (O.words[
|
|
525
|
-
for (; A !== 0 &&
|
|
526
|
-
E = (O.words[
|
|
523
|
+
for (var A = 0, F = 0; F < R.length; F++)
|
|
524
|
+
E = (O.words[F] | 0) + (R.words[F] | 0) + A, this.words[F] = E & 67108863, A = E >>> 26;
|
|
525
|
+
for (; A !== 0 && F < O.length; F++)
|
|
526
|
+
E = (O.words[F] | 0) + A, this.words[F] = E & 67108863, A = E >>> 26;
|
|
527
527
|
if (this.length = O.length, A !== 0)
|
|
528
528
|
this.words[this.length] = A, this.length++;
|
|
529
529
|
else if (O !== this)
|
|
530
|
-
for (;
|
|
531
|
-
this.words[
|
|
530
|
+
for (; F < O.length; F++)
|
|
531
|
+
this.words[F] = O.words[F];
|
|
532
532
|
return this;
|
|
533
533
|
}, r.prototype.add = function(m) {
|
|
534
534
|
var E;
|
|
@@ -545,11 +545,11 @@ function Te() {
|
|
|
545
545
|
return this.negative = 0, this.length = 1, this.words[0] = 0, this;
|
|
546
546
|
var R, A;
|
|
547
547
|
O > 0 ? (R = this, A = m) : (R = m, A = this);
|
|
548
|
-
for (var
|
|
549
|
-
E = (R.words[K] | 0) - (A.words[K] | 0) +
|
|
550
|
-
for (;
|
|
551
|
-
E = (R.words[K] | 0) +
|
|
552
|
-
if (
|
|
548
|
+
for (var F = 0, K = 0; K < A.length; K++)
|
|
549
|
+
E = (R.words[K] | 0) - (A.words[K] | 0) + F, F = E >> 26, this.words[K] = E & 67108863;
|
|
550
|
+
for (; F !== 0 && K < R.length; K++)
|
|
551
|
+
E = (R.words[K] | 0) + F, F = E >> 26, this.words[K] = E & 67108863;
|
|
552
|
+
if (F === 0 && K < R.length && R !== this)
|
|
553
553
|
for (; K < R.length; K++)
|
|
554
554
|
this.words[K] = R.words[K];
|
|
555
555
|
return this.length = Math.max(this.length, K), R !== this && (this.negative = 1), this._strip();
|
|
@@ -560,70 +560,70 @@ function Te() {
|
|
|
560
560
|
E.negative = m.negative ^ k.negative;
|
|
561
561
|
var O = k.length + m.length | 0;
|
|
562
562
|
E.length = O, O = O - 1 | 0;
|
|
563
|
-
var R = k.words[0] | 0, A = m.words[0] | 0,
|
|
563
|
+
var R = k.words[0] | 0, A = m.words[0] | 0, F = R * A, K = F & 67108863, L = F / 67108864 | 0;
|
|
564
564
|
E.words[0] = K;
|
|
565
565
|
for (var _ = 1; _ < O; _++) {
|
|
566
|
-
for (var
|
|
566
|
+
for (var U = L >>> 26, fe = L & 67108863, se = Math.min(_, m.length - 1), V = Math.max(0, _ - k.length + 1); V <= se; V++) {
|
|
567
567
|
var P = _ - V | 0;
|
|
568
|
-
R = k.words[P] | 0, A = m.words[V] | 0,
|
|
568
|
+
R = k.words[P] | 0, A = m.words[V] | 0, F = R * A + fe, U += F / 67108864 | 0, fe = F & 67108863;
|
|
569
569
|
}
|
|
570
|
-
E.words[_] = fe | 0, L =
|
|
570
|
+
E.words[_] = fe | 0, L = U | 0;
|
|
571
571
|
}
|
|
572
572
|
return L !== 0 ? E.words[_] = L | 0 : E.length--, E._strip();
|
|
573
573
|
}
|
|
574
574
|
var g = function(m, E, O) {
|
|
575
|
-
var R = m.words, A = E.words,
|
|
576
|
-
O.negative = m.negative ^ E.negative, O.length = 19, L = Math.imul(se, we), _ = Math.imul(se, ye), _ = _ + Math.imul(V, we) | 0,
|
|
575
|
+
var R = m.words, A = E.words, F = O.words, K = 0, L, _, U, fe = R[0] | 0, se = fe & 8191, V = fe >>> 13, P = R[1] | 0, M = P & 8191, Y = P >>> 13, Q = R[2] | 0, D = Q & 8191, T = Q >>> 13, J = R[3] | 0, ie = J & 8191, ue = J >>> 13, oe = R[4] | 0, ce = oe & 8191, ge = oe >>> 13, Ke = R[5] | 0, Se = Ke & 8191, de = Ke >>> 13, Be = R[6] | 0, ve = Be & 8191, me = Be >>> 13, Le = R[7] | 0, Pe = Le & 8191, N = Le >>> 13, w = R[8] | 0, S = w & 8191, H = w >>> 13, W = R[9] | 0, X = W & 8191, ee = W >>> 13, Ee = A[0] | 0, we = Ee & 8191, ye = Ee >>> 13, De = A[1] | 0, le = De & 8191, je = De >>> 13, os = A[2] | 0, ze = os & 8191, Ve = os >>> 13, cs = A[3] | 0, Ge = cs & 8191, $e = cs >>> 13, us = A[4] | 0, We = us & 8191, Ye = us >>> 13, hs = A[5] | 0, Je = hs & 8191, Xe = hs >>> 13, ds = A[6] | 0, Qe = ds & 8191, Ze = ds >>> 13, ls = A[7] | 0, et = ls & 8191, tt = ls >>> 13, bs = A[8] | 0, rt = bs & 8191, it = bs >>> 13, ps = A[9] | 0, nt = ps & 8191, at = ps >>> 13;
|
|
576
|
+
O.negative = m.negative ^ E.negative, O.length = 19, L = Math.imul(se, we), _ = Math.imul(se, ye), _ = _ + Math.imul(V, we) | 0, U = Math.imul(V, ye);
|
|
577
577
|
var Kr = (K + L | 0) + ((_ & 8191) << 13) | 0;
|
|
578
|
-
K = (
|
|
578
|
+
K = (U + (_ >>> 13) | 0) + (Kr >>> 26) | 0, Kr &= 67108863, L = Math.imul(M, we), _ = Math.imul(M, ye), _ = _ + Math.imul(Y, we) | 0, U = Math.imul(Y, ye), L = L + Math.imul(se, le) | 0, _ = _ + Math.imul(se, je) | 0, _ = _ + Math.imul(V, le) | 0, U = U + Math.imul(V, je) | 0;
|
|
579
579
|
var jr = (K + L | 0) + ((_ & 8191) << 13) | 0;
|
|
580
|
-
K = (
|
|
580
|
+
K = (U + (_ >>> 13) | 0) + (jr >>> 26) | 0, jr &= 67108863, L = Math.imul(D, we), _ = Math.imul(D, ye), _ = _ + Math.imul(T, we) | 0, U = Math.imul(T, ye), L = L + Math.imul(M, le) | 0, _ = _ + Math.imul(M, je) | 0, _ = _ + Math.imul(Y, le) | 0, U = U + Math.imul(Y, je) | 0, L = L + Math.imul(se, ze) | 0, _ = _ + Math.imul(se, Ve) | 0, _ = _ + Math.imul(V, ze) | 0, U = U + Math.imul(V, Ve) | 0;
|
|
581
581
|
var zr = (K + L | 0) + ((_ & 8191) << 13) | 0;
|
|
582
|
-
K = (
|
|
582
|
+
K = (U + (_ >>> 13) | 0) + (zr >>> 26) | 0, zr &= 67108863, L = Math.imul(ie, we), _ = Math.imul(ie, ye), _ = _ + Math.imul(ue, we) | 0, U = Math.imul(ue, ye), L = L + Math.imul(D, le) | 0, _ = _ + Math.imul(D, je) | 0, _ = _ + Math.imul(T, le) | 0, U = U + Math.imul(T, je) | 0, L = L + Math.imul(M, ze) | 0, _ = _ + Math.imul(M, Ve) | 0, _ = _ + Math.imul(Y, ze) | 0, U = U + Math.imul(Y, Ve) | 0, L = L + Math.imul(se, Ge) | 0, _ = _ + Math.imul(se, $e) | 0, _ = _ + Math.imul(V, Ge) | 0, U = U + Math.imul(V, $e) | 0;
|
|
583
583
|
var Vr = (K + L | 0) + ((_ & 8191) << 13) | 0;
|
|
584
|
-
K = (
|
|
584
|
+
K = (U + (_ >>> 13) | 0) + (Vr >>> 26) | 0, Vr &= 67108863, L = Math.imul(ce, we), _ = Math.imul(ce, ye), _ = _ + Math.imul(ge, we) | 0, U = Math.imul(ge, ye), L = L + Math.imul(ie, le) | 0, _ = _ + Math.imul(ie, je) | 0, _ = _ + Math.imul(ue, le) | 0, U = U + Math.imul(ue, je) | 0, L = L + Math.imul(D, ze) | 0, _ = _ + Math.imul(D, Ve) | 0, _ = _ + Math.imul(T, ze) | 0, U = U + Math.imul(T, Ve) | 0, L = L + Math.imul(M, Ge) | 0, _ = _ + Math.imul(M, $e) | 0, _ = _ + Math.imul(Y, Ge) | 0, U = U + Math.imul(Y, $e) | 0, L = L + Math.imul(se, We) | 0, _ = _ + Math.imul(se, Ye) | 0, _ = _ + Math.imul(V, We) | 0, U = U + Math.imul(V, Ye) | 0;
|
|
585
585
|
var Gr = (K + L | 0) + ((_ & 8191) << 13) | 0;
|
|
586
|
-
K = (
|
|
586
|
+
K = (U + (_ >>> 13) | 0) + (Gr >>> 26) | 0, Gr &= 67108863, L = Math.imul(Se, we), _ = Math.imul(Se, ye), _ = _ + Math.imul(de, we) | 0, U = Math.imul(de, ye), L = L + Math.imul(ce, le) | 0, _ = _ + Math.imul(ce, je) | 0, _ = _ + Math.imul(ge, le) | 0, U = U + Math.imul(ge, je) | 0, L = L + Math.imul(ie, ze) | 0, _ = _ + Math.imul(ie, Ve) | 0, _ = _ + Math.imul(ue, ze) | 0, U = U + Math.imul(ue, Ve) | 0, L = L + Math.imul(D, Ge) | 0, _ = _ + Math.imul(D, $e) | 0, _ = _ + Math.imul(T, Ge) | 0, U = U + Math.imul(T, $e) | 0, L = L + Math.imul(M, We) | 0, _ = _ + Math.imul(M, Ye) | 0, _ = _ + Math.imul(Y, We) | 0, U = U + Math.imul(Y, Ye) | 0, L = L + Math.imul(se, Je) | 0, _ = _ + Math.imul(se, Xe) | 0, _ = _ + Math.imul(V, Je) | 0, U = U + Math.imul(V, Xe) | 0;
|
|
587
587
|
var $r = (K + L | 0) + ((_ & 8191) << 13) | 0;
|
|
588
|
-
K = (
|
|
588
|
+
K = (U + (_ >>> 13) | 0) + ($r >>> 26) | 0, $r &= 67108863, L = Math.imul(ve, we), _ = Math.imul(ve, ye), _ = _ + Math.imul(me, we) | 0, U = Math.imul(me, ye), L = L + Math.imul(Se, le) | 0, _ = _ + Math.imul(Se, je) | 0, _ = _ + Math.imul(de, le) | 0, U = U + Math.imul(de, je) | 0, L = L + Math.imul(ce, ze) | 0, _ = _ + Math.imul(ce, Ve) | 0, _ = _ + Math.imul(ge, ze) | 0, U = U + Math.imul(ge, Ve) | 0, L = L + Math.imul(ie, Ge) | 0, _ = _ + Math.imul(ie, $e) | 0, _ = _ + Math.imul(ue, Ge) | 0, U = U + Math.imul(ue, $e) | 0, L = L + Math.imul(D, We) | 0, _ = _ + Math.imul(D, Ye) | 0, _ = _ + Math.imul(T, We) | 0, U = U + Math.imul(T, Ye) | 0, L = L + Math.imul(M, Je) | 0, _ = _ + Math.imul(M, Xe) | 0, _ = _ + Math.imul(Y, Je) | 0, U = U + Math.imul(Y, Xe) | 0, L = L + Math.imul(se, Qe) | 0, _ = _ + Math.imul(se, Ze) | 0, _ = _ + Math.imul(V, Qe) | 0, U = U + Math.imul(V, Ze) | 0;
|
|
589
589
|
var Wr = (K + L | 0) + ((_ & 8191) << 13) | 0;
|
|
590
|
-
K = (
|
|
590
|
+
K = (U + (_ >>> 13) | 0) + (Wr >>> 26) | 0, Wr &= 67108863, L = Math.imul(Pe, we), _ = Math.imul(Pe, ye), _ = _ + Math.imul(N, we) | 0, U = Math.imul(N, ye), L = L + Math.imul(ve, le) | 0, _ = _ + Math.imul(ve, je) | 0, _ = _ + Math.imul(me, le) | 0, U = U + Math.imul(me, je) | 0, L = L + Math.imul(Se, ze) | 0, _ = _ + Math.imul(Se, Ve) | 0, _ = _ + Math.imul(de, ze) | 0, U = U + Math.imul(de, Ve) | 0, L = L + Math.imul(ce, Ge) | 0, _ = _ + Math.imul(ce, $e) | 0, _ = _ + Math.imul(ge, Ge) | 0, U = U + Math.imul(ge, $e) | 0, L = L + Math.imul(ie, We) | 0, _ = _ + Math.imul(ie, Ye) | 0, _ = _ + Math.imul(ue, We) | 0, U = U + Math.imul(ue, Ye) | 0, L = L + Math.imul(D, Je) | 0, _ = _ + Math.imul(D, Xe) | 0, _ = _ + Math.imul(T, Je) | 0, U = U + Math.imul(T, Xe) | 0, L = L + Math.imul(M, Qe) | 0, _ = _ + Math.imul(M, Ze) | 0, _ = _ + Math.imul(Y, Qe) | 0, U = U + Math.imul(Y, Ze) | 0, L = L + Math.imul(se, et) | 0, _ = _ + Math.imul(se, tt) | 0, _ = _ + Math.imul(V, et) | 0, U = U + Math.imul(V, tt) | 0;
|
|
591
591
|
var Yr = (K + L | 0) + ((_ & 8191) << 13) | 0;
|
|
592
|
-
K = (
|
|
592
|
+
K = (U + (_ >>> 13) | 0) + (Yr >>> 26) | 0, Yr &= 67108863, L = Math.imul(S, we), _ = Math.imul(S, ye), _ = _ + Math.imul(H, we) | 0, U = Math.imul(H, ye), L = L + Math.imul(Pe, le) | 0, _ = _ + Math.imul(Pe, je) | 0, _ = _ + Math.imul(N, le) | 0, U = U + Math.imul(N, je) | 0, L = L + Math.imul(ve, ze) | 0, _ = _ + Math.imul(ve, Ve) | 0, _ = _ + Math.imul(me, ze) | 0, U = U + Math.imul(me, Ve) | 0, L = L + Math.imul(Se, Ge) | 0, _ = _ + Math.imul(Se, $e) | 0, _ = _ + Math.imul(de, Ge) | 0, U = U + Math.imul(de, $e) | 0, L = L + Math.imul(ce, We) | 0, _ = _ + Math.imul(ce, Ye) | 0, _ = _ + Math.imul(ge, We) | 0, U = U + Math.imul(ge, Ye) | 0, L = L + Math.imul(ie, Je) | 0, _ = _ + Math.imul(ie, Xe) | 0, _ = _ + Math.imul(ue, Je) | 0, U = U + Math.imul(ue, Xe) | 0, L = L + Math.imul(D, Qe) | 0, _ = _ + Math.imul(D, Ze) | 0, _ = _ + Math.imul(T, Qe) | 0, U = U + Math.imul(T, Ze) | 0, L = L + Math.imul(M, et) | 0, _ = _ + Math.imul(M, tt) | 0, _ = _ + Math.imul(Y, et) | 0, U = U + Math.imul(Y, tt) | 0, L = L + Math.imul(se, rt) | 0, _ = _ + Math.imul(se, it) | 0, _ = _ + Math.imul(V, rt) | 0, U = U + Math.imul(V, it) | 0;
|
|
593
593
|
var Jr = (K + L | 0) + ((_ & 8191) << 13) | 0;
|
|
594
|
-
K = (
|
|
594
|
+
K = (U + (_ >>> 13) | 0) + (Jr >>> 26) | 0, Jr &= 67108863, L = Math.imul(X, we), _ = Math.imul(X, ye), _ = _ + Math.imul(ee, we) | 0, U = Math.imul(ee, ye), L = L + Math.imul(S, le) | 0, _ = _ + Math.imul(S, je) | 0, _ = _ + Math.imul(H, le) | 0, U = U + Math.imul(H, je) | 0, L = L + Math.imul(Pe, ze) | 0, _ = _ + Math.imul(Pe, Ve) | 0, _ = _ + Math.imul(N, ze) | 0, U = U + Math.imul(N, Ve) | 0, L = L + Math.imul(ve, Ge) | 0, _ = _ + Math.imul(ve, $e) | 0, _ = _ + Math.imul(me, Ge) | 0, U = U + Math.imul(me, $e) | 0, L = L + Math.imul(Se, We) | 0, _ = _ + Math.imul(Se, Ye) | 0, _ = _ + Math.imul(de, We) | 0, U = U + Math.imul(de, Ye) | 0, L = L + Math.imul(ce, Je) | 0, _ = _ + Math.imul(ce, Xe) | 0, _ = _ + Math.imul(ge, Je) | 0, U = U + Math.imul(ge, Xe) | 0, L = L + Math.imul(ie, Qe) | 0, _ = _ + Math.imul(ie, Ze) | 0, _ = _ + Math.imul(ue, Qe) | 0, U = U + Math.imul(ue, Ze) | 0, L = L + Math.imul(D, et) | 0, _ = _ + Math.imul(D, tt) | 0, _ = _ + Math.imul(T, et) | 0, U = U + Math.imul(T, tt) | 0, L = L + Math.imul(M, rt) | 0, _ = _ + Math.imul(M, it) | 0, _ = _ + Math.imul(Y, rt) | 0, U = U + Math.imul(Y, it) | 0, L = L + Math.imul(se, nt) | 0, _ = _ + Math.imul(se, at) | 0, _ = _ + Math.imul(V, nt) | 0, U = U + Math.imul(V, at) | 0;
|
|
595
595
|
var Xr = (K + L | 0) + ((_ & 8191) << 13) | 0;
|
|
596
|
-
K = (
|
|
596
|
+
K = (U + (_ >>> 13) | 0) + (Xr >>> 26) | 0, Xr &= 67108863, L = Math.imul(X, le), _ = Math.imul(X, je), _ = _ + Math.imul(ee, le) | 0, U = Math.imul(ee, je), L = L + Math.imul(S, ze) | 0, _ = _ + Math.imul(S, Ve) | 0, _ = _ + Math.imul(H, ze) | 0, U = U + Math.imul(H, Ve) | 0, L = L + Math.imul(Pe, Ge) | 0, _ = _ + Math.imul(Pe, $e) | 0, _ = _ + Math.imul(N, Ge) | 0, U = U + Math.imul(N, $e) | 0, L = L + Math.imul(ve, We) | 0, _ = _ + Math.imul(ve, Ye) | 0, _ = _ + Math.imul(me, We) | 0, U = U + Math.imul(me, Ye) | 0, L = L + Math.imul(Se, Je) | 0, _ = _ + Math.imul(Se, Xe) | 0, _ = _ + Math.imul(de, Je) | 0, U = U + Math.imul(de, Xe) | 0, L = L + Math.imul(ce, Qe) | 0, _ = _ + Math.imul(ce, Ze) | 0, _ = _ + Math.imul(ge, Qe) | 0, U = U + Math.imul(ge, Ze) | 0, L = L + Math.imul(ie, et) | 0, _ = _ + Math.imul(ie, tt) | 0, _ = _ + Math.imul(ue, et) | 0, U = U + Math.imul(ue, tt) | 0, L = L + Math.imul(D, rt) | 0, _ = _ + Math.imul(D, it) | 0, _ = _ + Math.imul(T, rt) | 0, U = U + Math.imul(T, it) | 0, L = L + Math.imul(M, nt) | 0, _ = _ + Math.imul(M, at) | 0, _ = _ + Math.imul(Y, nt) | 0, U = U + Math.imul(Y, at) | 0;
|
|
597
597
|
var Qr = (K + L | 0) + ((_ & 8191) << 13) | 0;
|
|
598
|
-
K = (
|
|
598
|
+
K = (U + (_ >>> 13) | 0) + (Qr >>> 26) | 0, Qr &= 67108863, L = Math.imul(X, ze), _ = Math.imul(X, Ve), _ = _ + Math.imul(ee, ze) | 0, U = Math.imul(ee, Ve), L = L + Math.imul(S, Ge) | 0, _ = _ + Math.imul(S, $e) | 0, _ = _ + Math.imul(H, Ge) | 0, U = U + Math.imul(H, $e) | 0, L = L + Math.imul(Pe, We) | 0, _ = _ + Math.imul(Pe, Ye) | 0, _ = _ + Math.imul(N, We) | 0, U = U + Math.imul(N, Ye) | 0, L = L + Math.imul(ve, Je) | 0, _ = _ + Math.imul(ve, Xe) | 0, _ = _ + Math.imul(me, Je) | 0, U = U + Math.imul(me, Xe) | 0, L = L + Math.imul(Se, Qe) | 0, _ = _ + Math.imul(Se, Ze) | 0, _ = _ + Math.imul(de, Qe) | 0, U = U + Math.imul(de, Ze) | 0, L = L + Math.imul(ce, et) | 0, _ = _ + Math.imul(ce, tt) | 0, _ = _ + Math.imul(ge, et) | 0, U = U + Math.imul(ge, tt) | 0, L = L + Math.imul(ie, rt) | 0, _ = _ + Math.imul(ie, it) | 0, _ = _ + Math.imul(ue, rt) | 0, U = U + Math.imul(ue, it) | 0, L = L + Math.imul(D, nt) | 0, _ = _ + Math.imul(D, at) | 0, _ = _ + Math.imul(T, nt) | 0, U = U + Math.imul(T, at) | 0;
|
|
599
599
|
var Zr = (K + L | 0) + ((_ & 8191) << 13) | 0;
|
|
600
|
-
K = (
|
|
600
|
+
K = (U + (_ >>> 13) | 0) + (Zr >>> 26) | 0, Zr &= 67108863, L = Math.imul(X, Ge), _ = Math.imul(X, $e), _ = _ + Math.imul(ee, Ge) | 0, U = Math.imul(ee, $e), L = L + Math.imul(S, We) | 0, _ = _ + Math.imul(S, Ye) | 0, _ = _ + Math.imul(H, We) | 0, U = U + Math.imul(H, Ye) | 0, L = L + Math.imul(Pe, Je) | 0, _ = _ + Math.imul(Pe, Xe) | 0, _ = _ + Math.imul(N, Je) | 0, U = U + Math.imul(N, Xe) | 0, L = L + Math.imul(ve, Qe) | 0, _ = _ + Math.imul(ve, Ze) | 0, _ = _ + Math.imul(me, Qe) | 0, U = U + Math.imul(me, Ze) | 0, L = L + Math.imul(Se, et) | 0, _ = _ + Math.imul(Se, tt) | 0, _ = _ + Math.imul(de, et) | 0, U = U + Math.imul(de, tt) | 0, L = L + Math.imul(ce, rt) | 0, _ = _ + Math.imul(ce, it) | 0, _ = _ + Math.imul(ge, rt) | 0, U = U + Math.imul(ge, it) | 0, L = L + Math.imul(ie, nt) | 0, _ = _ + Math.imul(ie, at) | 0, _ = _ + Math.imul(ue, nt) | 0, U = U + Math.imul(ue, at) | 0;
|
|
601
601
|
var ei = (K + L | 0) + ((_ & 8191) << 13) | 0;
|
|
602
|
-
K = (
|
|
602
|
+
K = (U + (_ >>> 13) | 0) + (ei >>> 26) | 0, ei &= 67108863, L = Math.imul(X, We), _ = Math.imul(X, Ye), _ = _ + Math.imul(ee, We) | 0, U = Math.imul(ee, Ye), L = L + Math.imul(S, Je) | 0, _ = _ + Math.imul(S, Xe) | 0, _ = _ + Math.imul(H, Je) | 0, U = U + Math.imul(H, Xe) | 0, L = L + Math.imul(Pe, Qe) | 0, _ = _ + Math.imul(Pe, Ze) | 0, _ = _ + Math.imul(N, Qe) | 0, U = U + Math.imul(N, Ze) | 0, L = L + Math.imul(ve, et) | 0, _ = _ + Math.imul(ve, tt) | 0, _ = _ + Math.imul(me, et) | 0, U = U + Math.imul(me, tt) | 0, L = L + Math.imul(Se, rt) | 0, _ = _ + Math.imul(Se, it) | 0, _ = _ + Math.imul(de, rt) | 0, U = U + Math.imul(de, it) | 0, L = L + Math.imul(ce, nt) | 0, _ = _ + Math.imul(ce, at) | 0, _ = _ + Math.imul(ge, nt) | 0, U = U + Math.imul(ge, at) | 0;
|
|
603
603
|
var ti = (K + L | 0) + ((_ & 8191) << 13) | 0;
|
|
604
|
-
K = (
|
|
604
|
+
K = (U + (_ >>> 13) | 0) + (ti >>> 26) | 0, ti &= 67108863, L = Math.imul(X, Je), _ = Math.imul(X, Xe), _ = _ + Math.imul(ee, Je) | 0, U = Math.imul(ee, Xe), L = L + Math.imul(S, Qe) | 0, _ = _ + Math.imul(S, Ze) | 0, _ = _ + Math.imul(H, Qe) | 0, U = U + Math.imul(H, Ze) | 0, L = L + Math.imul(Pe, et) | 0, _ = _ + Math.imul(Pe, tt) | 0, _ = _ + Math.imul(N, et) | 0, U = U + Math.imul(N, tt) | 0, L = L + Math.imul(ve, rt) | 0, _ = _ + Math.imul(ve, it) | 0, _ = _ + Math.imul(me, rt) | 0, U = U + Math.imul(me, it) | 0, L = L + Math.imul(Se, nt) | 0, _ = _ + Math.imul(Se, at) | 0, _ = _ + Math.imul(de, nt) | 0, U = U + Math.imul(de, at) | 0;
|
|
605
605
|
var ri = (K + L | 0) + ((_ & 8191) << 13) | 0;
|
|
606
|
-
K = (
|
|
606
|
+
K = (U + (_ >>> 13) | 0) + (ri >>> 26) | 0, ri &= 67108863, L = Math.imul(X, Qe), _ = Math.imul(X, Ze), _ = _ + Math.imul(ee, Qe) | 0, U = Math.imul(ee, Ze), L = L + Math.imul(S, et) | 0, _ = _ + Math.imul(S, tt) | 0, _ = _ + Math.imul(H, et) | 0, U = U + Math.imul(H, tt) | 0, L = L + Math.imul(Pe, rt) | 0, _ = _ + Math.imul(Pe, it) | 0, _ = _ + Math.imul(N, rt) | 0, U = U + Math.imul(N, it) | 0, L = L + Math.imul(ve, nt) | 0, _ = _ + Math.imul(ve, at) | 0, _ = _ + Math.imul(me, nt) | 0, U = U + Math.imul(me, at) | 0;
|
|
607
607
|
var ii = (K + L | 0) + ((_ & 8191) << 13) | 0;
|
|
608
|
-
K = (
|
|
608
|
+
K = (U + (_ >>> 13) | 0) + (ii >>> 26) | 0, ii &= 67108863, L = Math.imul(X, et), _ = Math.imul(X, tt), _ = _ + Math.imul(ee, et) | 0, U = Math.imul(ee, tt), L = L + Math.imul(S, rt) | 0, _ = _ + Math.imul(S, it) | 0, _ = _ + Math.imul(H, rt) | 0, U = U + Math.imul(H, it) | 0, L = L + Math.imul(Pe, nt) | 0, _ = _ + Math.imul(Pe, at) | 0, _ = _ + Math.imul(N, nt) | 0, U = U + Math.imul(N, at) | 0;
|
|
609
609
|
var ni = (K + L | 0) + ((_ & 8191) << 13) | 0;
|
|
610
|
-
K = (
|
|
610
|
+
K = (U + (_ >>> 13) | 0) + (ni >>> 26) | 0, ni &= 67108863, L = Math.imul(X, rt), _ = Math.imul(X, it), _ = _ + Math.imul(ee, rt) | 0, U = Math.imul(ee, it), L = L + Math.imul(S, nt) | 0, _ = _ + Math.imul(S, at) | 0, _ = _ + Math.imul(H, nt) | 0, U = U + Math.imul(H, at) | 0;
|
|
611
611
|
var ai = (K + L | 0) + ((_ & 8191) << 13) | 0;
|
|
612
|
-
K = (
|
|
612
|
+
K = (U + (_ >>> 13) | 0) + (ai >>> 26) | 0, ai &= 67108863, L = Math.imul(X, nt), _ = Math.imul(X, at), _ = _ + Math.imul(ee, nt) | 0, U = Math.imul(ee, at);
|
|
613
613
|
var fi = (K + L | 0) + ((_ & 8191) << 13) | 0;
|
|
614
|
-
return K = (
|
|
614
|
+
return K = (U + (_ >>> 13) | 0) + (fi >>> 26) | 0, fi &= 67108863, F[0] = Kr, F[1] = jr, F[2] = zr, F[3] = Vr, F[4] = Gr, F[5] = $r, F[6] = Wr, F[7] = Yr, F[8] = Jr, F[9] = Xr, F[10] = Qr, F[11] = Zr, F[12] = ei, F[13] = ti, F[14] = ri, F[15] = ii, F[16] = ni, F[17] = ai, F[18] = fi, K !== 0 && (F[19] = K, O.length++), O;
|
|
615
615
|
};
|
|
616
616
|
Math.imul || (g = v);
|
|
617
617
|
function x(k, m, E) {
|
|
618
618
|
E.negative = m.negative ^ k.negative, E.length = k.length + m.length;
|
|
619
619
|
for (var O = 0, R = 0, A = 0; A < E.length - 1; A++) {
|
|
620
|
-
var
|
|
620
|
+
var F = R;
|
|
621
621
|
R = 0;
|
|
622
622
|
for (var K = O & 67108863, L = Math.min(A, m.length - 1), _ = Math.max(0, A - k.length + 1); _ <= L; _++) {
|
|
623
|
-
var
|
|
624
|
-
|
|
623
|
+
var U = A - _, fe = k.words[U] | 0, se = m.words[_] | 0, V = fe * se, P = V & 67108863;
|
|
624
|
+
F = F + (V / 67108864 | 0) | 0, P = P + K | 0, K = P & 67108863, F = F + (P >>> 26) | 0, R += F >>> 26, F &= 67108863;
|
|
625
625
|
}
|
|
626
|
-
E.words[A] = K, O =
|
|
626
|
+
E.words[A] = K, O = F, F = R;
|
|
627
627
|
}
|
|
628
628
|
return O !== 0 ? E.words[A] = O : E.length--, E._strip();
|
|
629
629
|
}
|
|
@@ -645,8 +645,8 @@ function Te() {
|
|
|
645
645
|
var E = m < 0;
|
|
646
646
|
E && (m = -m), n(typeof m == "number"), n(m < 67108864);
|
|
647
647
|
for (var O = 0, R = 0; R < this.length; R++) {
|
|
648
|
-
var A = (this.words[R] | 0) * m,
|
|
649
|
-
O >>= 26, O += A / 67108864 | 0, O +=
|
|
648
|
+
var A = (this.words[R] | 0) * m, F = (A & 67108863) + (O & 67108863);
|
|
649
|
+
O >>= 26, O += A / 67108864 | 0, O += F >>> 26, this.words[R] = F & 67108863;
|
|
650
650
|
}
|
|
651
651
|
return O !== 0 && (this.words[R] = O, this.length++), this.length = m === 0 ? 1 : this.length, E ? this.ineg() : this;
|
|
652
652
|
}, r.prototype.muln = function(m) {
|
|
@@ -668,12 +668,12 @@ function Te() {
|
|
|
668
668
|
n(typeof m == "number" && m >= 0);
|
|
669
669
|
var E = m % 26, O = (m - E) / 26, R = 67108863 >>> 26 - E << 26 - E, A;
|
|
670
670
|
if (E !== 0) {
|
|
671
|
-
var
|
|
671
|
+
var F = 0;
|
|
672
672
|
for (A = 0; A < this.length; A++) {
|
|
673
673
|
var K = this.words[A] & R, L = (this.words[A] | 0) - K << E;
|
|
674
|
-
this.words[A] = L |
|
|
674
|
+
this.words[A] = L | F, F = K >>> 26 - E;
|
|
675
675
|
}
|
|
676
|
-
|
|
676
|
+
F && (this.words[A] = F, this.length++);
|
|
677
677
|
}
|
|
678
678
|
if (O !== 0) {
|
|
679
679
|
for (A = this.length - 1; A >= 0; A--)
|
|
@@ -689,23 +689,23 @@ function Te() {
|
|
|
689
689
|
n(typeof m == "number" && m >= 0);
|
|
690
690
|
var R;
|
|
691
691
|
E ? R = (E - E % 26) / 26 : R = 0;
|
|
692
|
-
var A = m % 26,
|
|
693
|
-
if (R -=
|
|
694
|
-
for (var _ = 0; _ <
|
|
692
|
+
var A = m % 26, F = Math.min((m - A) / 26, this.length), K = 67108863 ^ 67108863 >>> A << A, L = O;
|
|
693
|
+
if (R -= F, R = Math.max(0, R), L) {
|
|
694
|
+
for (var _ = 0; _ < F; _++)
|
|
695
695
|
L.words[_] = this.words[_];
|
|
696
|
-
L.length =
|
|
696
|
+
L.length = F;
|
|
697
697
|
}
|
|
698
|
-
if (
|
|
699
|
-
for (this.length -=
|
|
700
|
-
this.words[_] = this.words[_ +
|
|
698
|
+
if (F !== 0) if (this.length > F)
|
|
699
|
+
for (this.length -= F, _ = 0; _ < this.length; _++)
|
|
700
|
+
this.words[_] = this.words[_ + F];
|
|
701
701
|
else
|
|
702
702
|
this.words[0] = 0, this.length = 1;
|
|
703
|
-
var
|
|
704
|
-
for (_ = this.length - 1; _ >= 0 && (
|
|
703
|
+
var U = 0;
|
|
704
|
+
for (_ = this.length - 1; _ >= 0 && (U !== 0 || _ >= R); _--) {
|
|
705
705
|
var fe = this.words[_] | 0;
|
|
706
|
-
this.words[_] =
|
|
706
|
+
this.words[_] = U << 26 - A | fe >>> A, U = fe & K;
|
|
707
707
|
}
|
|
708
|
-
return L &&
|
|
708
|
+
return L && U !== 0 && (L.words[L.length++] = U), this.length === 0 && (this.words[0] = 0, this.length = 1), this._strip();
|
|
709
709
|
}, r.prototype.ishrn = function(m, E, O) {
|
|
710
710
|
return n(this.negative === 0), this.iushrn(m, E, O);
|
|
711
711
|
}, r.prototype.shln = function(m) {
|
|
@@ -762,32 +762,32 @@ function Te() {
|
|
|
762
762
|
}, r.prototype._ishlnsubmul = function(m, E, O) {
|
|
763
763
|
var R = m.length + O, A;
|
|
764
764
|
this._expand(R);
|
|
765
|
-
var
|
|
765
|
+
var F, K = 0;
|
|
766
766
|
for (A = 0; A < m.length; A++) {
|
|
767
|
-
|
|
767
|
+
F = (this.words[A + O] | 0) + K;
|
|
768
768
|
var L = (m.words[A] | 0) * E;
|
|
769
|
-
|
|
769
|
+
F -= L & 67108863, K = (F >> 26) - (L / 67108864 | 0), this.words[A + O] = F & 67108863;
|
|
770
770
|
}
|
|
771
771
|
for (; A < this.length - O; A++)
|
|
772
|
-
|
|
772
|
+
F = (this.words[A + O] | 0) + K, K = F >> 26, this.words[A + O] = F & 67108863;
|
|
773
773
|
if (K === 0) return this._strip();
|
|
774
774
|
for (n(K === -1), K = 0, A = 0; A < this.length; A++)
|
|
775
|
-
|
|
775
|
+
F = -(this.words[A] | 0) + K, K = F >> 26, this.words[A] = F & 67108863;
|
|
776
776
|
return this.negative = 1, this._strip();
|
|
777
777
|
}, r.prototype._wordDiv = function(m, E) {
|
|
778
|
-
var O = this.length - m.length, R = this.clone(), A = m,
|
|
779
|
-
O = 26 - K, O !== 0 && (A = A.ushln(O), R.iushln(O),
|
|
778
|
+
var O = this.length - m.length, R = this.clone(), A = m, F = A.words[A.length - 1] | 0, K = this._countBits(F);
|
|
779
|
+
O = 26 - K, O !== 0 && (A = A.ushln(O), R.iushln(O), F = A.words[A.length - 1] | 0);
|
|
780
780
|
var L = R.length - A.length, _;
|
|
781
781
|
if (E !== "mod") {
|
|
782
782
|
_ = new r(null), _.length = L + 1, _.words = new Array(_.length);
|
|
783
|
-
for (var
|
|
784
|
-
_.words[
|
|
783
|
+
for (var U = 0; U < _.length; U++)
|
|
784
|
+
_.words[U] = 0;
|
|
785
785
|
}
|
|
786
786
|
var fe = R.clone()._ishlnsubmul(A, 1, L);
|
|
787
787
|
fe.negative === 0 && (R = fe, _ && (_.words[L] = 1));
|
|
788
788
|
for (var se = L - 1; se >= 0; se--) {
|
|
789
789
|
var V = (R.words[A.length + se] | 0) * 67108864 + (R.words[A.length + se - 1] | 0);
|
|
790
|
-
for (V = Math.min(V /
|
|
790
|
+
for (V = Math.min(V / F | 0, 67108863), R._ishlnsubmul(A, V, se); R.negative !== 0; )
|
|
791
791
|
V--, R.negative = 0, R._ishlnsubmul(A, 1, se), R.isZero() || (R.negative ^= 1);
|
|
792
792
|
_ && (_.words[se] = V);
|
|
793
793
|
}
|
|
@@ -801,15 +801,15 @@ function Te() {
|
|
|
801
801
|
div: new r(0),
|
|
802
802
|
mod: new r(0)
|
|
803
803
|
};
|
|
804
|
-
var R, A,
|
|
805
|
-
return this.negative !== 0 && m.negative === 0 ? (
|
|
804
|
+
var R, A, F;
|
|
805
|
+
return this.negative !== 0 && m.negative === 0 ? (F = this.neg().divmod(m, E), E !== "mod" && (R = F.div.neg()), E !== "div" && (A = F.mod.neg(), O && A.negative !== 0 && A.iadd(m)), {
|
|
806
806
|
div: R,
|
|
807
807
|
mod: A
|
|
808
|
-
}) : this.negative === 0 && m.negative !== 0 ? (
|
|
808
|
+
}) : this.negative === 0 && m.negative !== 0 ? (F = this.divmod(m.neg(), E), E !== "mod" && (R = F.div.neg()), {
|
|
809
809
|
div: R,
|
|
810
|
-
mod:
|
|
811
|
-
}) : (this.negative & m.negative) !== 0 ? (
|
|
812
|
-
div:
|
|
810
|
+
mod: F.mod
|
|
811
|
+
}) : (this.negative & m.negative) !== 0 ? (F = this.neg().divmod(m.neg(), E), E !== "div" && (A = F.mod.neg(), O && A.negative !== 0 && A.isub(m)), {
|
|
812
|
+
div: F.div,
|
|
813
813
|
mod: A
|
|
814
814
|
}) : m.length > this.length || this.cmp(m) < 0 ? {
|
|
815
815
|
div: new r(0),
|
|
@@ -833,8 +833,8 @@ function Te() {
|
|
|
833
833
|
}, r.prototype.divRound = function(m) {
|
|
834
834
|
var E = this.divmod(m);
|
|
835
835
|
if (E.mod.isZero()) return E.div;
|
|
836
|
-
var O = E.div.negative !== 0 ? E.mod.isub(m) : E.mod, R = m.ushrn(1), A = m.andln(1),
|
|
837
|
-
return
|
|
836
|
+
var O = E.div.negative !== 0 ? E.mod.isub(m) : E.mod, R = m.ushrn(1), A = m.andln(1), F = O.cmp(R);
|
|
837
|
+
return F < 0 || A === 1 && F === 0 ? E.div : E.div.negative !== 0 ? E.div.isubn(1) : E.div.iaddn(1);
|
|
838
838
|
}, r.prototype.modrn = function(m) {
|
|
839
839
|
var E = m < 0;
|
|
840
840
|
E && (m = -m), n(m <= 67108863);
|
|
@@ -857,21 +857,21 @@ function Te() {
|
|
|
857
857
|
n(m.negative === 0), n(!m.isZero());
|
|
858
858
|
var E = this, O = m.clone();
|
|
859
859
|
E.negative !== 0 ? E = E.umod(m) : E = E.clone();
|
|
860
|
-
for (var R = new r(1), A = new r(0),
|
|
860
|
+
for (var R = new r(1), A = new r(0), F = new r(0), K = new r(1), L = 0; E.isEven() && O.isEven(); )
|
|
861
861
|
E.iushrn(1), O.iushrn(1), ++L;
|
|
862
|
-
for (var _ = O.clone(),
|
|
862
|
+
for (var _ = O.clone(), U = E.clone(); !E.isZero(); ) {
|
|
863
863
|
for (var fe = 0, se = 1; (E.words[0] & se) === 0 && fe < 26; ++fe, se <<= 1) ;
|
|
864
864
|
if (fe > 0)
|
|
865
865
|
for (E.iushrn(fe); fe-- > 0; )
|
|
866
|
-
(R.isOdd() || A.isOdd()) && (R.iadd(_), A.isub(
|
|
866
|
+
(R.isOdd() || A.isOdd()) && (R.iadd(_), A.isub(U)), R.iushrn(1), A.iushrn(1);
|
|
867
867
|
for (var V = 0, P = 1; (O.words[0] & P) === 0 && V < 26; ++V, P <<= 1) ;
|
|
868
868
|
if (V > 0)
|
|
869
869
|
for (O.iushrn(V); V-- > 0; )
|
|
870
|
-
(
|
|
871
|
-
E.cmp(O) >= 0 ? (E.isub(O), R.isub(
|
|
870
|
+
(F.isOdd() || K.isOdd()) && (F.iadd(_), K.isub(U)), F.iushrn(1), K.iushrn(1);
|
|
871
|
+
E.cmp(O) >= 0 ? (E.isub(O), R.isub(F), A.isub(K)) : (O.isub(E), F.isub(R), K.isub(A));
|
|
872
872
|
}
|
|
873
873
|
return {
|
|
874
|
-
a:
|
|
874
|
+
a: F,
|
|
875
875
|
b: K,
|
|
876
876
|
gcd: O.iushln(L)
|
|
877
877
|
};
|
|
@@ -879,15 +879,15 @@ function Te() {
|
|
|
879
879
|
n(m.negative === 0), n(!m.isZero());
|
|
880
880
|
var E = this, O = m.clone();
|
|
881
881
|
E.negative !== 0 ? E = E.umod(m) : E = E.clone();
|
|
882
|
-
for (var R = new r(1), A = new r(0),
|
|
882
|
+
for (var R = new r(1), A = new r(0), F = O.clone(); E.cmpn(1) > 0 && O.cmpn(1) > 0; ) {
|
|
883
883
|
for (var K = 0, L = 1; (E.words[0] & L) === 0 && K < 26; ++K, L <<= 1) ;
|
|
884
884
|
if (K > 0)
|
|
885
885
|
for (E.iushrn(K); K-- > 0; )
|
|
886
|
-
R.isOdd() && R.iadd(
|
|
887
|
-
for (var _ = 0,
|
|
886
|
+
R.isOdd() && R.iadd(F), R.iushrn(1);
|
|
887
|
+
for (var _ = 0, U = 1; (O.words[0] & U) === 0 && _ < 26; ++_, U <<= 1) ;
|
|
888
888
|
if (_ > 0)
|
|
889
889
|
for (O.iushrn(_); _-- > 0; )
|
|
890
|
-
A.isOdd() && A.iadd(
|
|
890
|
+
A.isOdd() && A.iadd(F), A.iushrn(1);
|
|
891
891
|
E.cmp(O) >= 0 ? (E.isub(O), R.isub(A)) : (O.isub(E), A.isub(R));
|
|
892
892
|
}
|
|
893
893
|
var fe;
|
|
@@ -906,8 +906,8 @@ function Te() {
|
|
|
906
906
|
O.iushrn(1);
|
|
907
907
|
var A = E.cmp(O);
|
|
908
908
|
if (A < 0) {
|
|
909
|
-
var
|
|
910
|
-
E = O, O =
|
|
909
|
+
var F = E;
|
|
910
|
+
E = O, O = F;
|
|
911
911
|
} else if (A === 0 || O.cmpn(1) === 0)
|
|
912
912
|
break;
|
|
913
913
|
E.isub(O);
|
|
@@ -926,11 +926,11 @@ function Te() {
|
|
|
926
926
|
var E = m % 26, O = (m - E) / 26, R = 1 << E;
|
|
927
927
|
if (this.length <= O)
|
|
928
928
|
return this._expand(O + 1), this.words[O] |= R, this;
|
|
929
|
-
for (var A = R,
|
|
930
|
-
var K = this.words[
|
|
931
|
-
K += A, A = K >>> 26, K &= 67108863, this.words[
|
|
929
|
+
for (var A = R, F = O; A !== 0 && F < this.length; F++) {
|
|
930
|
+
var K = this.words[F] | 0;
|
|
931
|
+
K += A, A = K >>> 26, K &= 67108863, this.words[F] = K;
|
|
932
932
|
}
|
|
933
|
-
return A !== 0 && (this.words[
|
|
933
|
+
return A !== 0 && (this.words[F] = A, this.length++), this;
|
|
934
934
|
}, r.prototype.isZero = function() {
|
|
935
935
|
return this.length === 1 && this.words[0] === 0;
|
|
936
936
|
}, r.prototype.cmpn = function(m) {
|
|
@@ -1058,12 +1058,12 @@ function Te() {
|
|
|
1058
1058
|
m.words[0] = 0, m.length = 1;
|
|
1059
1059
|
return;
|
|
1060
1060
|
}
|
|
1061
|
-
var
|
|
1062
|
-
for (E.words[E.length++] =
|
|
1061
|
+
var F = m.words[9];
|
|
1062
|
+
for (E.words[E.length++] = F & O, A = 10; A < m.length; A++) {
|
|
1063
1063
|
var K = m.words[A] | 0;
|
|
1064
|
-
m.words[A - 10] = (K & O) << 4 |
|
|
1064
|
+
m.words[A - 10] = (K & O) << 4 | F >>> 22, F = K;
|
|
1065
1065
|
}
|
|
1066
|
-
|
|
1066
|
+
F >>>= 22, m.words[A - 10] = F, F === 0 && m.length > 10 ? m.length -= 10 : m.length -= 9;
|
|
1067
1067
|
}, j.prototype.imulK = function(m) {
|
|
1068
1068
|
m.words[m.length] = 0, m.words[m.length + 1] = 0, m.length += 2;
|
|
1069
1069
|
for (var E = 0, O = 0; O < m.length; O++) {
|
|
@@ -1170,15 +1170,15 @@ function Te() {
|
|
|
1170
1170
|
for (var R = this.m.subn(1), A = 0; !R.isZero() && R.andln(1) === 0; )
|
|
1171
1171
|
A++, R.iushrn(1);
|
|
1172
1172
|
n(!R.isZero());
|
|
1173
|
-
var
|
|
1173
|
+
var F = new r(1).toRed(this), K = F.redNeg(), L = this.m.subn(1).iushrn(1), _ = this.m.bitLength();
|
|
1174
1174
|
for (_ = new r(2 * _ * _).toRed(this); this.pow(_, L).cmp(K) !== 0; )
|
|
1175
1175
|
_.redIAdd(K);
|
|
1176
|
-
for (var
|
|
1177
|
-
for (var P = se, M = 0; P.cmp(
|
|
1176
|
+
for (var U = this.pow(_, R), fe = this.pow(m, R.addn(1).iushrn(1)), se = this.pow(m, R), V = A; se.cmp(F) !== 0; ) {
|
|
1177
|
+
for (var P = se, M = 0; P.cmp(F) !== 0; M++)
|
|
1178
1178
|
P = P.redSqr();
|
|
1179
1179
|
n(M < V);
|
|
1180
|
-
var Y = this.pow(
|
|
1181
|
-
fe = fe.redMul(Y),
|
|
1180
|
+
var Y = this.pow(U, new r(1).iushln(V - M - 1));
|
|
1181
|
+
fe = fe.redMul(Y), U = Y.redSqr(), se = se.redMul(U), V = M;
|
|
1182
1182
|
}
|
|
1183
1183
|
return fe;
|
|
1184
1184
|
}, ne.prototype.invm = function(m) {
|
|
@@ -1191,19 +1191,19 @@ function Te() {
|
|
|
1191
1191
|
R[0] = new r(1).toRed(this), R[1] = m;
|
|
1192
1192
|
for (var A = 2; A < R.length; A++)
|
|
1193
1193
|
R[A] = this.mul(R[A - 1], m);
|
|
1194
|
-
var
|
|
1194
|
+
var F = R[0], K = 0, L = 0, _ = E.bitLength() % 26;
|
|
1195
1195
|
for (_ === 0 && (_ = 26), A = E.length - 1; A >= 0; A--) {
|
|
1196
|
-
for (var
|
|
1197
|
-
var se =
|
|
1198
|
-
if (
|
|
1196
|
+
for (var U = E.words[A], fe = _ - 1; fe >= 0; fe--) {
|
|
1197
|
+
var se = U >> fe & 1;
|
|
1198
|
+
if (F !== R[0] && (F = this.sqr(F)), se === 0 && K === 0) {
|
|
1199
1199
|
L = 0;
|
|
1200
1200
|
continue;
|
|
1201
1201
|
}
|
|
1202
|
-
K <<= 1, K |= se, L++, !(L !== O && (A !== 0 || fe !== 0)) && (
|
|
1202
|
+
K <<= 1, K |= se, L++, !(L !== O && (A !== 0 || fe !== 0)) && (F = this.mul(F, R[K]), L = 0, K = 0);
|
|
1203
1203
|
}
|
|
1204
1204
|
_ = 26;
|
|
1205
1205
|
}
|
|
1206
|
-
return
|
|
1206
|
+
return F;
|
|
1207
1207
|
}, ne.prototype.convertTo = function(m) {
|
|
1208
1208
|
var E = m.umod(this.m);
|
|
1209
1209
|
return E === m ? E.clone() : E;
|
|
@@ -1224,12 +1224,12 @@ function Te() {
|
|
|
1224
1224
|
}, $.prototype.imul = function(m, E) {
|
|
1225
1225
|
if (m.isZero() || E.isZero())
|
|
1226
1226
|
return m.words[0] = 0, m.length = 1, m;
|
|
1227
|
-
var O = m.imul(E), R = O.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), A = O.isub(R).iushrn(this.shift),
|
|
1228
|
-
return A.cmp(this.m) >= 0 ?
|
|
1227
|
+
var O = m.imul(E), R = O.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), A = O.isub(R).iushrn(this.shift), F = A;
|
|
1228
|
+
return A.cmp(this.m) >= 0 ? F = A.isub(this.m) : A.cmpn(0) < 0 && (F = A.iadd(this.m)), F._forceRed(this);
|
|
1229
1229
|
}, $.prototype.mul = function(m, E) {
|
|
1230
1230
|
if (m.isZero() || E.isZero()) return new r(0)._forceRed(this);
|
|
1231
|
-
var O = m.mul(E), R = O.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), A = O.isub(R).iushrn(this.shift),
|
|
1232
|
-
return A.cmp(this.m) >= 0 ?
|
|
1231
|
+
var O = m.mul(E), R = O.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), A = O.isub(R).iushrn(this.shift), F = A;
|
|
1232
|
+
return A.cmp(this.m) >= 0 ? F = A.isub(this.m) : A.cmpn(0) < 0 && (F = A.iadd(this.m)), F._forceRed(this);
|
|
1233
1233
|
}, $.prototype.invm = function(m) {
|
|
1234
1234
|
var E = this.imod(m._invmp(this.m).mul(this.r2));
|
|
1235
1235
|
return E._forceRed(this);
|
|
@@ -1444,7 +1444,7 @@ function Lt() {
|
|
|
1444
1444
|
})(ci)), ci;
|
|
1445
1445
|
}
|
|
1446
1446
|
var br = { exports: {} }, xe = {}, pr = { exports: {} }, vr = { exports: {} }, di = {}, $t = {}, _s;
|
|
1447
|
-
function
|
|
1447
|
+
function Fd() {
|
|
1448
1448
|
if (_s) return $t;
|
|
1449
1449
|
_s = 1, $t.byteLength = a, $t.toByteArray = f, $t.fromByteArray = h;
|
|
1450
1450
|
for (var l = [], e = [], t = typeof Uint8Array < "u" ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", u = 0, r = n.length; u < r; ++u)
|
|
@@ -1493,7 +1493,7 @@ function qd() {
|
|
|
1493
1493
|
}
|
|
1494
1494
|
var mr = {};
|
|
1495
1495
|
var Ss;
|
|
1496
|
-
function
|
|
1496
|
+
function qd() {
|
|
1497
1497
|
return Ss || (Ss = 1, mr.read = function(l, e, t, n, u) {
|
|
1498
1498
|
var r, s, a = u * 8 - n - 1, o = (1 << a) - 1, f = o >> 1, i = -7, c = t ? u - 1 : 0, h = t ? -1 : 1, d = l[e + c];
|
|
1499
1499
|
for (c += h, r = d & (1 << -i) - 1, d >>= -i, i += a; i > 0; r = r * 256 + l[e + c], c += h, i -= 8)
|
|
@@ -1520,7 +1520,7 @@ function Fd() {
|
|
|
1520
1520
|
var xs;
|
|
1521
1521
|
function St() {
|
|
1522
1522
|
return xs || (xs = 1, (function(l) {
|
|
1523
|
-
const e =
|
|
1523
|
+
const e = Fd(), t = qd(), n = typeof Symbol == "function" && typeof Symbol.for == "function" ? /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom") : null;
|
|
1524
1524
|
l.Buffer = a, l.SlowBuffer = g, l.INSPECT_MAX_BYTES = 50;
|
|
1525
1525
|
const u = 2147483647;
|
|
1526
1526
|
l.kMaxLength = u, a.TYPED_ARRAY_SUPPORT = r(), !a.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
|
|
@@ -1581,9 +1581,9 @@ function St() {
|
|
|
1581
1581
|
throw new TypeError(
|
|
1582
1582
|
'The "value" argument must not be of type number. Received type number'
|
|
1583
1583
|
);
|
|
1584
|
-
const
|
|
1585
|
-
if (
|
|
1586
|
-
return a.from(
|
|
1584
|
+
const H = N.valueOf && N.valueOf();
|
|
1585
|
+
if (H != null && H !== N)
|
|
1586
|
+
return a.from(H, w, S);
|
|
1587
1587
|
const W = y(N);
|
|
1588
1588
|
if (W) return W;
|
|
1589
1589
|
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof N[Symbol.toPrimitive] == "function")
|
|
@@ -1619,14 +1619,14 @@ function St() {
|
|
|
1619
1619
|
if ((typeof w != "string" || w === "") && (w = "utf8"), !a.isEncoding(w))
|
|
1620
1620
|
throw new TypeError("Unknown encoding: " + w);
|
|
1621
1621
|
const S = x(N, w) | 0;
|
|
1622
|
-
let
|
|
1623
|
-
const W =
|
|
1624
|
-
return W !== S && (
|
|
1622
|
+
let H = s(S);
|
|
1623
|
+
const W = H.write(N, w);
|
|
1624
|
+
return W !== S && (H = H.slice(0, W)), H;
|
|
1625
1625
|
}
|
|
1626
1626
|
function d(N) {
|
|
1627
1627
|
const w = N.length < 0 ? 0 : v(N.length) | 0, S = s(w);
|
|
1628
|
-
for (let
|
|
1629
|
-
S[
|
|
1628
|
+
for (let H = 0; H < w; H += 1)
|
|
1629
|
+
S[H] = N[H] & 255;
|
|
1630
1630
|
return S;
|
|
1631
1631
|
}
|
|
1632
1632
|
function b(N) {
|
|
@@ -1641,8 +1641,8 @@ function St() {
|
|
|
1641
1641
|
throw new RangeError('"offset" is outside of buffer bounds');
|
|
1642
1642
|
if (N.byteLength < w + (S || 0))
|
|
1643
1643
|
throw new RangeError('"length" is outside of buffer bounds');
|
|
1644
|
-
let
|
|
1645
|
-
return w === void 0 && S === void 0 ?
|
|
1644
|
+
let H;
|
|
1645
|
+
return w === void 0 && S === void 0 ? H = new Uint8Array(N) : S === void 0 ? H = new Uint8Array(N, w) : H = new Uint8Array(N, w, S), Object.setPrototypeOf(H, a.prototype), H;
|
|
1646
1646
|
}
|
|
1647
1647
|
function y(N) {
|
|
1648
1648
|
if (a.isBuffer(N)) {
|
|
@@ -1670,13 +1670,13 @@ function St() {
|
|
|
1670
1670
|
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
|
|
1671
1671
|
);
|
|
1672
1672
|
if (w === S) return 0;
|
|
1673
|
-
let
|
|
1674
|
-
for (let X = 0, ee = Math.min(
|
|
1673
|
+
let H = w.length, W = S.length;
|
|
1674
|
+
for (let X = 0, ee = Math.min(H, W); X < ee; ++X)
|
|
1675
1675
|
if (w[X] !== S[X]) {
|
|
1676
|
-
|
|
1676
|
+
H = w[X], W = S[X];
|
|
1677
1677
|
break;
|
|
1678
1678
|
}
|
|
1679
|
-
return
|
|
1679
|
+
return H < W ? -1 : W < H ? 1 : 0;
|
|
1680
1680
|
}, a.isEncoding = function(w) {
|
|
1681
1681
|
switch (String(w).toLowerCase()) {
|
|
1682
1682
|
case "hex":
|
|
@@ -1699,14 +1699,14 @@ function St() {
|
|
|
1699
1699
|
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
1700
1700
|
if (w.length === 0)
|
|
1701
1701
|
return a.alloc(0);
|
|
1702
|
-
let
|
|
1702
|
+
let H;
|
|
1703
1703
|
if (S === void 0)
|
|
1704
|
-
for (S = 0,
|
|
1705
|
-
S += w[
|
|
1704
|
+
for (S = 0, H = 0; H < w.length; ++H)
|
|
1705
|
+
S += w[H].length;
|
|
1706
1706
|
const W = a.allocUnsafe(S);
|
|
1707
1707
|
let X = 0;
|
|
1708
|
-
for (
|
|
1709
|
-
let ee = w[
|
|
1708
|
+
for (H = 0; H < w.length; ++H) {
|
|
1709
|
+
let ee = w[H];
|
|
1710
1710
|
if (Be(ee, Uint8Array))
|
|
1711
1711
|
X + ee.length > W.length ? (a.isBuffer(ee) || (ee = a.from(ee)), ee.copy(W, X)) : Uint8Array.prototype.set.call(
|
|
1712
1712
|
W,
|
|
@@ -1730,8 +1730,8 @@ function St() {
|
|
|
1730
1730
|
throw new TypeError(
|
|
1731
1731
|
'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof N
|
|
1732
1732
|
);
|
|
1733
|
-
const S = N.length,
|
|
1734
|
-
if (!
|
|
1733
|
+
const S = N.length, H = arguments.length > 2 && arguments[2] === !0;
|
|
1734
|
+
if (!H && S === 0) return 0;
|
|
1735
1735
|
let W = !1;
|
|
1736
1736
|
for (; ; )
|
|
1737
1737
|
switch (w) {
|
|
@@ -1753,19 +1753,19 @@ function St() {
|
|
|
1753
1753
|
return Se(N).length;
|
|
1754
1754
|
default:
|
|
1755
1755
|
if (W)
|
|
1756
|
-
return
|
|
1756
|
+
return H ? -1 : ce(N).length;
|
|
1757
1757
|
w = ("" + w).toLowerCase(), W = !0;
|
|
1758
1758
|
}
|
|
1759
1759
|
}
|
|
1760
1760
|
a.byteLength = x;
|
|
1761
1761
|
function B(N, w, S) {
|
|
1762
|
-
let
|
|
1762
|
+
let H = !1;
|
|
1763
1763
|
if ((w === void 0 || w < 0) && (w = 0), w > this.length || ((S === void 0 || S > this.length) && (S = this.length), S <= 0) || (S >>>= 0, w >>>= 0, S <= w))
|
|
1764
1764
|
return "";
|
|
1765
1765
|
for (N || (N = "utf8"); ; )
|
|
1766
1766
|
switch (N) {
|
|
1767
1767
|
case "hex":
|
|
1768
|
-
return
|
|
1768
|
+
return F(this, w, S);
|
|
1769
1769
|
case "utf8":
|
|
1770
1770
|
case "utf-8":
|
|
1771
1771
|
return m(this, w, S);
|
|
@@ -1782,14 +1782,14 @@ function St() {
|
|
|
1782
1782
|
case "utf-16le":
|
|
1783
1783
|
return K(this, w, S);
|
|
1784
1784
|
default:
|
|
1785
|
-
if (
|
|
1786
|
-
N = (N + "").toLowerCase(),
|
|
1785
|
+
if (H) throw new TypeError("Unknown encoding: " + N);
|
|
1786
|
+
N = (N + "").toLowerCase(), H = !0;
|
|
1787
1787
|
}
|
|
1788
1788
|
}
|
|
1789
1789
|
a.prototype._isBuffer = !0;
|
|
1790
1790
|
function I(N, w, S) {
|
|
1791
|
-
const
|
|
1792
|
-
N[w] = N[S], N[S] =
|
|
1791
|
+
const H = N[w];
|
|
1792
|
+
N[w] = N[S], N[S] = H;
|
|
1793
1793
|
}
|
|
1794
1794
|
a.prototype.swap16 = function() {
|
|
1795
1795
|
const w = this.length;
|
|
@@ -1822,22 +1822,22 @@ function St() {
|
|
|
1822
1822
|
let w = "";
|
|
1823
1823
|
const S = l.INSPECT_MAX_BYTES;
|
|
1824
1824
|
return w = this.toString("hex", 0, S).replace(/(.{2})/g, "$1 ").trim(), this.length > S && (w += " ... "), "<Buffer " + w + ">";
|
|
1825
|
-
}, n && (a.prototype[n] = a.prototype.inspect), a.prototype.compare = function(w, S,
|
|
1825
|
+
}, n && (a.prototype[n] = a.prototype.inspect), a.prototype.compare = function(w, S, H, W, X) {
|
|
1826
1826
|
if (Be(w, Uint8Array) && (w = a.from(w, w.offset, w.byteLength)), !a.isBuffer(w))
|
|
1827
1827
|
throw new TypeError(
|
|
1828
1828
|
'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof w
|
|
1829
1829
|
);
|
|
1830
|
-
if (S === void 0 && (S = 0),
|
|
1830
|
+
if (S === void 0 && (S = 0), H === void 0 && (H = w ? w.length : 0), W === void 0 && (W = 0), X === void 0 && (X = this.length), S < 0 || H > w.length || W < 0 || X > this.length)
|
|
1831
1831
|
throw new RangeError("out of range index");
|
|
1832
|
-
if (W >= X && S >=
|
|
1832
|
+
if (W >= X && S >= H)
|
|
1833
1833
|
return 0;
|
|
1834
1834
|
if (W >= X)
|
|
1835
1835
|
return -1;
|
|
1836
|
-
if (S >=
|
|
1836
|
+
if (S >= H)
|
|
1837
1837
|
return 1;
|
|
1838
|
-
if (S >>>= 0,
|
|
1839
|
-
let ee = X - W, Ee =
|
|
1840
|
-
const we = Math.min(ee, Ee), ye = this.slice(W, X), De = w.slice(S,
|
|
1838
|
+
if (S >>>= 0, H >>>= 0, W >>>= 0, X >>>= 0, this === w) return 0;
|
|
1839
|
+
let ee = X - W, Ee = H - S;
|
|
1840
|
+
const we = Math.min(ee, Ee), ye = this.slice(W, X), De = w.slice(S, H);
|
|
1841
1841
|
for (let le = 0; le < we; ++le)
|
|
1842
1842
|
if (ye[le] !== De[le]) {
|
|
1843
1843
|
ee = ye[le], Ee = De[le];
|
|
@@ -1845,23 +1845,23 @@ function St() {
|
|
|
1845
1845
|
}
|
|
1846
1846
|
return ee < Ee ? -1 : Ee < ee ? 1 : 0;
|
|
1847
1847
|
};
|
|
1848
|
-
function C(N, w, S,
|
|
1848
|
+
function C(N, w, S, H, W) {
|
|
1849
1849
|
if (N.length === 0) return -1;
|
|
1850
|
-
if (typeof S == "string" ? (
|
|
1850
|
+
if (typeof S == "string" ? (H = S, S = 0) : S > 2147483647 ? S = 2147483647 : S < -2147483648 && (S = -2147483648), S = +S, ve(S) && (S = W ? 0 : N.length - 1), S < 0 && (S = N.length + S), S >= N.length) {
|
|
1851
1851
|
if (W) return -1;
|
|
1852
1852
|
S = N.length - 1;
|
|
1853
1853
|
} else if (S < 0)
|
|
1854
1854
|
if (W) S = 0;
|
|
1855
1855
|
else return -1;
|
|
1856
|
-
if (typeof w == "string" && (w = a.from(w,
|
|
1857
|
-
return w.length === 0 ? -1 : j(N, w, S,
|
|
1856
|
+
if (typeof w == "string" && (w = a.from(w, H)), a.isBuffer(w))
|
|
1857
|
+
return w.length === 0 ? -1 : j(N, w, S, H, W);
|
|
1858
1858
|
if (typeof w == "number")
|
|
1859
|
-
return w = w & 255, typeof Uint8Array.prototype.indexOf == "function" ? W ? Uint8Array.prototype.indexOf.call(N, w, S) : Uint8Array.prototype.lastIndexOf.call(N, w, S) : j(N, [w], S,
|
|
1859
|
+
return w = w & 255, typeof Uint8Array.prototype.indexOf == "function" ? W ? Uint8Array.prototype.indexOf.call(N, w, S) : Uint8Array.prototype.lastIndexOf.call(N, w, S) : j(N, [w], S, H, W);
|
|
1860
1860
|
throw new TypeError("val must be string, number or Buffer");
|
|
1861
1861
|
}
|
|
1862
|
-
function j(N, w, S,
|
|
1862
|
+
function j(N, w, S, H, W) {
|
|
1863
1863
|
let X = 1, ee = N.length, Ee = w.length;
|
|
1864
|
-
if (
|
|
1864
|
+
if (H !== void 0 && (H = String(H).toLowerCase(), H === "ucs2" || H === "ucs-2" || H === "utf16le" || H === "utf-16le")) {
|
|
1865
1865
|
if (N.length < 2 || w.length < 2)
|
|
1866
1866
|
return -1;
|
|
1867
1867
|
X = 2, ee /= 2, Ee /= 2, S /= 2;
|
|
@@ -1889,73 +1889,73 @@ function St() {
|
|
|
1889
1889
|
}
|
|
1890
1890
|
return -1;
|
|
1891
1891
|
}
|
|
1892
|
-
a.prototype.includes = function(w, S,
|
|
1893
|
-
return this.indexOf(w, S,
|
|
1894
|
-
}, a.prototype.indexOf = function(w, S,
|
|
1895
|
-
return C(this, w, S,
|
|
1896
|
-
}, a.prototype.lastIndexOf = function(w, S,
|
|
1897
|
-
return C(this, w, S,
|
|
1892
|
+
a.prototype.includes = function(w, S, H) {
|
|
1893
|
+
return this.indexOf(w, S, H) !== -1;
|
|
1894
|
+
}, a.prototype.indexOf = function(w, S, H) {
|
|
1895
|
+
return C(this, w, S, H, !0);
|
|
1896
|
+
}, a.prototype.lastIndexOf = function(w, S, H) {
|
|
1897
|
+
return C(this, w, S, H, !1);
|
|
1898
1898
|
};
|
|
1899
|
-
function G(N, w, S,
|
|
1899
|
+
function G(N, w, S, H) {
|
|
1900
1900
|
S = Number(S) || 0;
|
|
1901
1901
|
const W = N.length - S;
|
|
1902
|
-
|
|
1902
|
+
H ? (H = Number(H), H > W && (H = W)) : H = W;
|
|
1903
1903
|
const X = w.length;
|
|
1904
|
-
|
|
1904
|
+
H > X / 2 && (H = X / 2);
|
|
1905
1905
|
let ee;
|
|
1906
|
-
for (ee = 0; ee <
|
|
1906
|
+
for (ee = 0; ee < H; ++ee) {
|
|
1907
1907
|
const Ee = parseInt(w.substr(ee * 2, 2), 16);
|
|
1908
1908
|
if (ve(Ee)) return ee;
|
|
1909
1909
|
N[S + ee] = Ee;
|
|
1910
1910
|
}
|
|
1911
1911
|
return ee;
|
|
1912
1912
|
}
|
|
1913
|
-
function z(N, w, S,
|
|
1914
|
-
return de(ce(w, N.length - S), N, S,
|
|
1913
|
+
function z(N, w, S, H) {
|
|
1914
|
+
return de(ce(w, N.length - S), N, S, H);
|
|
1915
1915
|
}
|
|
1916
|
-
function te(N, w, S,
|
|
1917
|
-
return de(ge(w), N, S,
|
|
1916
|
+
function te(N, w, S, H) {
|
|
1917
|
+
return de(ge(w), N, S, H);
|
|
1918
1918
|
}
|
|
1919
|
-
function ne(N, w, S,
|
|
1920
|
-
return de(Se(w), N, S,
|
|
1919
|
+
function ne(N, w, S, H) {
|
|
1920
|
+
return de(Se(w), N, S, H);
|
|
1921
1921
|
}
|
|
1922
|
-
function $(N, w, S,
|
|
1923
|
-
return de(Ke(w, N.length - S), N, S,
|
|
1922
|
+
function $(N, w, S, H) {
|
|
1923
|
+
return de(Ke(w, N.length - S), N, S, H);
|
|
1924
1924
|
}
|
|
1925
|
-
a.prototype.write = function(w, S,
|
|
1925
|
+
a.prototype.write = function(w, S, H, W) {
|
|
1926
1926
|
if (S === void 0)
|
|
1927
|
-
W = "utf8",
|
|
1928
|
-
else if (
|
|
1929
|
-
W = S,
|
|
1927
|
+
W = "utf8", H = this.length, S = 0;
|
|
1928
|
+
else if (H === void 0 && typeof S == "string")
|
|
1929
|
+
W = S, H = this.length, S = 0;
|
|
1930
1930
|
else if (isFinite(S))
|
|
1931
|
-
S = S >>> 0, isFinite(
|
|
1931
|
+
S = S >>> 0, isFinite(H) ? (H = H >>> 0, W === void 0 && (W = "utf8")) : (W = H, H = void 0);
|
|
1932
1932
|
else
|
|
1933
1933
|
throw new Error(
|
|
1934
1934
|
"Buffer.write(string, encoding, offset[, length]) is no longer supported"
|
|
1935
1935
|
);
|
|
1936
1936
|
const X = this.length - S;
|
|
1937
|
-
if ((
|
|
1937
|
+
if ((H === void 0 || H > X) && (H = X), w.length > 0 && (H < 0 || S < 0) || S > this.length)
|
|
1938
1938
|
throw new RangeError("Attempt to write outside buffer bounds");
|
|
1939
1939
|
W || (W = "utf8");
|
|
1940
1940
|
let ee = !1;
|
|
1941
1941
|
for (; ; )
|
|
1942
1942
|
switch (W) {
|
|
1943
1943
|
case "hex":
|
|
1944
|
-
return G(this, w, S,
|
|
1944
|
+
return G(this, w, S, H);
|
|
1945
1945
|
case "utf8":
|
|
1946
1946
|
case "utf-8":
|
|
1947
|
-
return z(this, w, S,
|
|
1947
|
+
return z(this, w, S, H);
|
|
1948
1948
|
case "ascii":
|
|
1949
1949
|
case "latin1":
|
|
1950
1950
|
case "binary":
|
|
1951
|
-
return te(this, w, S,
|
|
1951
|
+
return te(this, w, S, H);
|
|
1952
1952
|
case "base64":
|
|
1953
|
-
return ne(this, w, S,
|
|
1953
|
+
return ne(this, w, S, H);
|
|
1954
1954
|
case "ucs2":
|
|
1955
1955
|
case "ucs-2":
|
|
1956
1956
|
case "utf16le":
|
|
1957
1957
|
case "utf-16le":
|
|
1958
|
-
return $(this, w, S,
|
|
1958
|
+
return $(this, w, S, H);
|
|
1959
1959
|
default:
|
|
1960
1960
|
if (ee) throw new TypeError("Unknown encoding: " + W);
|
|
1961
1961
|
W = ("" + W).toLowerCase(), ee = !0;
|
|
@@ -1971,7 +1971,7 @@ function St() {
|
|
|
1971
1971
|
}
|
|
1972
1972
|
function m(N, w, S) {
|
|
1973
1973
|
S = Math.min(N.length, S);
|
|
1974
|
-
const
|
|
1974
|
+
const H = [];
|
|
1975
1975
|
let W = w;
|
|
1976
1976
|
for (; W < S; ) {
|
|
1977
1977
|
const X = N[W];
|
|
@@ -1992,55 +1992,55 @@ function St() {
|
|
|
1992
1992
|
we = N[W + 1], ye = N[W + 2], De = N[W + 3], (we & 192) === 128 && (ye & 192) === 128 && (De & 192) === 128 && (le = (X & 15) << 18 | (we & 63) << 12 | (ye & 63) << 6 | De & 63, le > 65535 && le < 1114112 && (ee = le));
|
|
1993
1993
|
}
|
|
1994
1994
|
}
|
|
1995
|
-
ee === null ? (ee = 65533, Ee = 1) : ee > 65535 && (ee -= 65536,
|
|
1995
|
+
ee === null ? (ee = 65533, Ee = 1) : ee > 65535 && (ee -= 65536, H.push(ee >>> 10 & 1023 | 55296), ee = 56320 | ee & 1023), H.push(ee), W += Ee;
|
|
1996
1996
|
}
|
|
1997
|
-
return O(
|
|
1997
|
+
return O(H);
|
|
1998
1998
|
}
|
|
1999
1999
|
const E = 4096;
|
|
2000
2000
|
function O(N) {
|
|
2001
2001
|
const w = N.length;
|
|
2002
2002
|
if (w <= E)
|
|
2003
2003
|
return String.fromCharCode.apply(String, N);
|
|
2004
|
-
let S = "",
|
|
2005
|
-
for (;
|
|
2004
|
+
let S = "", H = 0;
|
|
2005
|
+
for (; H < w; )
|
|
2006
2006
|
S += String.fromCharCode.apply(
|
|
2007
2007
|
String,
|
|
2008
|
-
N.slice(
|
|
2008
|
+
N.slice(H, H += E)
|
|
2009
2009
|
);
|
|
2010
2010
|
return S;
|
|
2011
2011
|
}
|
|
2012
2012
|
function R(N, w, S) {
|
|
2013
|
-
let
|
|
2013
|
+
let H = "";
|
|
2014
2014
|
S = Math.min(N.length, S);
|
|
2015
2015
|
for (let W = w; W < S; ++W)
|
|
2016
|
-
|
|
2017
|
-
return
|
|
2016
|
+
H += String.fromCharCode(N[W] & 127);
|
|
2017
|
+
return H;
|
|
2018
2018
|
}
|
|
2019
2019
|
function A(N, w, S) {
|
|
2020
|
-
let
|
|
2020
|
+
let H = "";
|
|
2021
2021
|
S = Math.min(N.length, S);
|
|
2022
2022
|
for (let W = w; W < S; ++W)
|
|
2023
|
-
|
|
2024
|
-
return
|
|
2023
|
+
H += String.fromCharCode(N[W]);
|
|
2024
|
+
return H;
|
|
2025
2025
|
}
|
|
2026
|
-
function
|
|
2027
|
-
const
|
|
2028
|
-
(!w || w < 0) && (w = 0), (!S || S < 0 || S >
|
|
2026
|
+
function F(N, w, S) {
|
|
2027
|
+
const H = N.length;
|
|
2028
|
+
(!w || w < 0) && (w = 0), (!S || S < 0 || S > H) && (S = H);
|
|
2029
2029
|
let W = "";
|
|
2030
2030
|
for (let X = w; X < S; ++X)
|
|
2031
2031
|
W += me[N[X]];
|
|
2032
2032
|
return W;
|
|
2033
2033
|
}
|
|
2034
2034
|
function K(N, w, S) {
|
|
2035
|
-
const
|
|
2035
|
+
const H = N.slice(w, S);
|
|
2036
2036
|
let W = "";
|
|
2037
|
-
for (let X = 0; X <
|
|
2038
|
-
W += String.fromCharCode(
|
|
2037
|
+
for (let X = 0; X < H.length - 1; X += 2)
|
|
2038
|
+
W += String.fromCharCode(H[X] + H[X + 1] * 256);
|
|
2039
2039
|
return W;
|
|
2040
2040
|
}
|
|
2041
2041
|
a.prototype.slice = function(w, S) {
|
|
2042
|
-
const
|
|
2043
|
-
w = ~~w, S = S === void 0 ?
|
|
2042
|
+
const H = this.length;
|
|
2043
|
+
w = ~~w, S = S === void 0 ? H : ~~S, w < 0 ? (w += H, w < 0 && (w = 0)) : w > H && (w = H), S < 0 ? (S += H, S < 0 && (S = 0)) : S > H && (S = H), S < w && (S = w);
|
|
2044
2044
|
const W = this.subarray(w, S);
|
|
2045
2045
|
return Object.setPrototypeOf(W, a.prototype), W;
|
|
2046
2046
|
};
|
|
@@ -2048,14 +2048,14 @@ function St() {
|
|
|
2048
2048
|
if (N % 1 !== 0 || N < 0) throw new RangeError("offset is not uint");
|
|
2049
2049
|
if (N + w > S) throw new RangeError("Trying to access beyond buffer length");
|
|
2050
2050
|
}
|
|
2051
|
-
a.prototype.readUintLE = a.prototype.readUIntLE = function(w, S,
|
|
2052
|
-
w = w >>> 0, S = S >>> 0,
|
|
2051
|
+
a.prototype.readUintLE = a.prototype.readUIntLE = function(w, S, H) {
|
|
2052
|
+
w = w >>> 0, S = S >>> 0, H || L(w, S, this.length);
|
|
2053
2053
|
let W = this[w], X = 1, ee = 0;
|
|
2054
2054
|
for (; ++ee < S && (X *= 256); )
|
|
2055
2055
|
W += this[w + ee] * X;
|
|
2056
2056
|
return W;
|
|
2057
|
-
}, a.prototype.readUintBE = a.prototype.readUIntBE = function(w, S,
|
|
2058
|
-
w = w >>> 0, S = S >>> 0,
|
|
2057
|
+
}, a.prototype.readUintBE = a.prototype.readUIntBE = function(w, S, H) {
|
|
2058
|
+
w = w >>> 0, S = S >>> 0, H || L(w, S, this.length);
|
|
2059
2059
|
let W = this[w + --S], X = 1;
|
|
2060
2060
|
for (; S > 0 && (X *= 256); )
|
|
2061
2061
|
W += this[w + --S] * X;
|
|
@@ -2072,24 +2072,24 @@ function St() {
|
|
|
2072
2072
|
return w = w >>> 0, S || L(w, 4, this.length), this[w] * 16777216 + (this[w + 1] << 16 | this[w + 2] << 8 | this[w + 3]);
|
|
2073
2073
|
}, a.prototype.readBigUInt64LE = Le(function(w) {
|
|
2074
2074
|
w = w >>> 0, J(w, "offset");
|
|
2075
|
-
const S = this[w],
|
|
2076
|
-
(S === void 0 ||
|
|
2077
|
-
const W = S + this[++w] * 2 ** 8 + this[++w] * 2 ** 16 + this[++w] * 2 ** 24, X = this[++w] + this[++w] * 2 ** 8 + this[++w] * 2 ** 16 +
|
|
2075
|
+
const S = this[w], H = this[w + 7];
|
|
2076
|
+
(S === void 0 || H === void 0) && ie(w, this.length - 8);
|
|
2077
|
+
const W = S + this[++w] * 2 ** 8 + this[++w] * 2 ** 16 + this[++w] * 2 ** 24, X = this[++w] + this[++w] * 2 ** 8 + this[++w] * 2 ** 16 + H * 2 ** 24;
|
|
2078
2078
|
return BigInt(W) + (BigInt(X) << BigInt(32));
|
|
2079
2079
|
}), a.prototype.readBigUInt64BE = Le(function(w) {
|
|
2080
2080
|
w = w >>> 0, J(w, "offset");
|
|
2081
|
-
const S = this[w],
|
|
2082
|
-
(S === void 0 ||
|
|
2083
|
-
const W = S * 2 ** 24 + this[++w] * 2 ** 16 + this[++w] * 2 ** 8 + this[++w], X = this[++w] * 2 ** 24 + this[++w] * 2 ** 16 + this[++w] * 2 ** 8 +
|
|
2081
|
+
const S = this[w], H = this[w + 7];
|
|
2082
|
+
(S === void 0 || H === void 0) && ie(w, this.length - 8);
|
|
2083
|
+
const W = S * 2 ** 24 + this[++w] * 2 ** 16 + this[++w] * 2 ** 8 + this[++w], X = this[++w] * 2 ** 24 + this[++w] * 2 ** 16 + this[++w] * 2 ** 8 + H;
|
|
2084
2084
|
return (BigInt(W) << BigInt(32)) + BigInt(X);
|
|
2085
|
-
}), a.prototype.readIntLE = function(w, S,
|
|
2086
|
-
w = w >>> 0, S = S >>> 0,
|
|
2085
|
+
}), a.prototype.readIntLE = function(w, S, H) {
|
|
2086
|
+
w = w >>> 0, S = S >>> 0, H || L(w, S, this.length);
|
|
2087
2087
|
let W = this[w], X = 1, ee = 0;
|
|
2088
2088
|
for (; ++ee < S && (X *= 256); )
|
|
2089
2089
|
W += this[w + ee] * X;
|
|
2090
2090
|
return X *= 128, W >= X && (W -= Math.pow(2, 8 * S)), W;
|
|
2091
|
-
}, a.prototype.readIntBE = function(w, S,
|
|
2092
|
-
w = w >>> 0, S = S >>> 0,
|
|
2091
|
+
}, a.prototype.readIntBE = function(w, S, H) {
|
|
2092
|
+
w = w >>> 0, S = S >>> 0, H || L(w, S, this.length);
|
|
2093
2093
|
let W = S, X = 1, ee = this[w + --W];
|
|
2094
2094
|
for (; W > 0 && (X *= 256); )
|
|
2095
2095
|
ee += this[w + --W] * X;
|
|
@@ -2098,29 +2098,29 @@ function St() {
|
|
|
2098
2098
|
return w = w >>> 0, S || L(w, 1, this.length), this[w] & 128 ? (255 - this[w] + 1) * -1 : this[w];
|
|
2099
2099
|
}, a.prototype.readInt16LE = function(w, S) {
|
|
2100
2100
|
w = w >>> 0, S || L(w, 2, this.length);
|
|
2101
|
-
const
|
|
2102
|
-
return
|
|
2101
|
+
const H = this[w] | this[w + 1] << 8;
|
|
2102
|
+
return H & 32768 ? H | 4294901760 : H;
|
|
2103
2103
|
}, a.prototype.readInt16BE = function(w, S) {
|
|
2104
2104
|
w = w >>> 0, S || L(w, 2, this.length);
|
|
2105
|
-
const
|
|
2106
|
-
return
|
|
2105
|
+
const H = this[w + 1] | this[w] << 8;
|
|
2106
|
+
return H & 32768 ? H | 4294901760 : H;
|
|
2107
2107
|
}, a.prototype.readInt32LE = function(w, S) {
|
|
2108
2108
|
return w = w >>> 0, S || L(w, 4, this.length), this[w] | this[w + 1] << 8 | this[w + 2] << 16 | this[w + 3] << 24;
|
|
2109
2109
|
}, a.prototype.readInt32BE = function(w, S) {
|
|
2110
2110
|
return w = w >>> 0, S || L(w, 4, this.length), this[w] << 24 | this[w + 1] << 16 | this[w + 2] << 8 | this[w + 3];
|
|
2111
2111
|
}, a.prototype.readBigInt64LE = Le(function(w) {
|
|
2112
2112
|
w = w >>> 0, J(w, "offset");
|
|
2113
|
-
const S = this[w],
|
|
2114
|
-
(S === void 0 ||
|
|
2115
|
-
const W = this[w + 4] + this[w + 5] * 2 ** 8 + this[w + 6] * 2 ** 16 + (
|
|
2113
|
+
const S = this[w], H = this[w + 7];
|
|
2114
|
+
(S === void 0 || H === void 0) && ie(w, this.length - 8);
|
|
2115
|
+
const W = this[w + 4] + this[w + 5] * 2 ** 8 + this[w + 6] * 2 ** 16 + (H << 24);
|
|
2116
2116
|
return (BigInt(W) << BigInt(32)) + BigInt(S + this[++w] * 2 ** 8 + this[++w] * 2 ** 16 + this[++w] * 2 ** 24);
|
|
2117
2117
|
}), a.prototype.readBigInt64BE = Le(function(w) {
|
|
2118
2118
|
w = w >>> 0, J(w, "offset");
|
|
2119
|
-
const S = this[w],
|
|
2120
|
-
(S === void 0 ||
|
|
2119
|
+
const S = this[w], H = this[w + 7];
|
|
2120
|
+
(S === void 0 || H === void 0) && ie(w, this.length - 8);
|
|
2121
2121
|
const W = (S << 24) + // Overflow
|
|
2122
2122
|
this[++w] * 2 ** 16 + this[++w] * 2 ** 8 + this[++w];
|
|
2123
|
-
return (BigInt(W) << BigInt(32)) + BigInt(this[++w] * 2 ** 24 + this[++w] * 2 ** 16 + this[++w] * 2 ** 8 +
|
|
2123
|
+
return (BigInt(W) << BigInt(32)) + BigInt(this[++w] * 2 ** 24 + this[++w] * 2 ** 16 + this[++w] * 2 ** 8 + H);
|
|
2124
2124
|
}), a.prototype.readFloatLE = function(w, S) {
|
|
2125
2125
|
return w = w >>> 0, S || L(w, 4, this.length), t.read(this, w, !0, 23, 4);
|
|
2126
2126
|
}, a.prototype.readFloatBE = function(w, S) {
|
|
@@ -2130,127 +2130,127 @@ function St() {
|
|
|
2130
2130
|
}, a.prototype.readDoubleBE = function(w, S) {
|
|
2131
2131
|
return w = w >>> 0, S || L(w, 8, this.length), t.read(this, w, !1, 52, 8);
|
|
2132
2132
|
};
|
|
2133
|
-
function _(N, w, S,
|
|
2133
|
+
function _(N, w, S, H, W, X) {
|
|
2134
2134
|
if (!a.isBuffer(N)) throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
2135
2135
|
if (w > W || w < X) throw new RangeError('"value" argument is out of bounds');
|
|
2136
|
-
if (S +
|
|
2136
|
+
if (S + H > N.length) throw new RangeError("Index out of range");
|
|
2137
2137
|
}
|
|
2138
|
-
a.prototype.writeUintLE = a.prototype.writeUIntLE = function(w, S,
|
|
2139
|
-
if (w = +w, S = S >>> 0,
|
|
2140
|
-
const Ee = Math.pow(2, 8 *
|
|
2141
|
-
_(this, w, S,
|
|
2138
|
+
a.prototype.writeUintLE = a.prototype.writeUIntLE = function(w, S, H, W) {
|
|
2139
|
+
if (w = +w, S = S >>> 0, H = H >>> 0, !W) {
|
|
2140
|
+
const Ee = Math.pow(2, 8 * H) - 1;
|
|
2141
|
+
_(this, w, S, H, Ee, 0);
|
|
2142
2142
|
}
|
|
2143
2143
|
let X = 1, ee = 0;
|
|
2144
|
-
for (this[S] = w & 255; ++ee <
|
|
2144
|
+
for (this[S] = w & 255; ++ee < H && (X *= 256); )
|
|
2145
2145
|
this[S + ee] = w / X & 255;
|
|
2146
|
-
return S +
|
|
2147
|
-
}, a.prototype.writeUintBE = a.prototype.writeUIntBE = function(w, S,
|
|
2148
|
-
if (w = +w, S = S >>> 0,
|
|
2149
|
-
const Ee = Math.pow(2, 8 *
|
|
2150
|
-
_(this, w, S,
|
|
2146
|
+
return S + H;
|
|
2147
|
+
}, a.prototype.writeUintBE = a.prototype.writeUIntBE = function(w, S, H, W) {
|
|
2148
|
+
if (w = +w, S = S >>> 0, H = H >>> 0, !W) {
|
|
2149
|
+
const Ee = Math.pow(2, 8 * H) - 1;
|
|
2150
|
+
_(this, w, S, H, Ee, 0);
|
|
2151
2151
|
}
|
|
2152
|
-
let X =
|
|
2152
|
+
let X = H - 1, ee = 1;
|
|
2153
2153
|
for (this[S + X] = w & 255; --X >= 0 && (ee *= 256); )
|
|
2154
2154
|
this[S + X] = w / ee & 255;
|
|
2155
|
-
return S +
|
|
2156
|
-
}, a.prototype.writeUint8 = a.prototype.writeUInt8 = function(w, S,
|
|
2157
|
-
return w = +w, S = S >>> 0,
|
|
2158
|
-
}, a.prototype.writeUint16LE = a.prototype.writeUInt16LE = function(w, S,
|
|
2159
|
-
return w = +w, S = S >>> 0,
|
|
2160
|
-
}, a.prototype.writeUint16BE = a.prototype.writeUInt16BE = function(w, S,
|
|
2161
|
-
return w = +w, S = S >>> 0,
|
|
2162
|
-
}, a.prototype.writeUint32LE = a.prototype.writeUInt32LE = function(w, S,
|
|
2163
|
-
return w = +w, S = S >>> 0,
|
|
2164
|
-
}, a.prototype.writeUint32BE = a.prototype.writeUInt32BE = function(w, S,
|
|
2165
|
-
return w = +w, S = S >>> 0,
|
|
2155
|
+
return S + H;
|
|
2156
|
+
}, a.prototype.writeUint8 = a.prototype.writeUInt8 = function(w, S, H) {
|
|
2157
|
+
return w = +w, S = S >>> 0, H || _(this, w, S, 1, 255, 0), this[S] = w & 255, S + 1;
|
|
2158
|
+
}, a.prototype.writeUint16LE = a.prototype.writeUInt16LE = function(w, S, H) {
|
|
2159
|
+
return w = +w, S = S >>> 0, H || _(this, w, S, 2, 65535, 0), this[S] = w & 255, this[S + 1] = w >>> 8, S + 2;
|
|
2160
|
+
}, a.prototype.writeUint16BE = a.prototype.writeUInt16BE = function(w, S, H) {
|
|
2161
|
+
return w = +w, S = S >>> 0, H || _(this, w, S, 2, 65535, 0), this[S] = w >>> 8, this[S + 1] = w & 255, S + 2;
|
|
2162
|
+
}, a.prototype.writeUint32LE = a.prototype.writeUInt32LE = function(w, S, H) {
|
|
2163
|
+
return w = +w, S = S >>> 0, H || _(this, w, S, 4, 4294967295, 0), this[S + 3] = w >>> 24, this[S + 2] = w >>> 16, this[S + 1] = w >>> 8, this[S] = w & 255, S + 4;
|
|
2164
|
+
}, a.prototype.writeUint32BE = a.prototype.writeUInt32BE = function(w, S, H) {
|
|
2165
|
+
return w = +w, S = S >>> 0, H || _(this, w, S, 4, 4294967295, 0), this[S] = w >>> 24, this[S + 1] = w >>> 16, this[S + 2] = w >>> 8, this[S + 3] = w & 255, S + 4;
|
|
2166
2166
|
};
|
|
2167
|
-
function
|
|
2168
|
-
T(w,
|
|
2167
|
+
function U(N, w, S, H, W) {
|
|
2168
|
+
T(w, H, W, N, S, 7);
|
|
2169
2169
|
let X = Number(w & BigInt(4294967295));
|
|
2170
2170
|
N[S++] = X, X = X >> 8, N[S++] = X, X = X >> 8, N[S++] = X, X = X >> 8, N[S++] = X;
|
|
2171
2171
|
let ee = Number(w >> BigInt(32) & BigInt(4294967295));
|
|
2172
2172
|
return N[S++] = ee, ee = ee >> 8, N[S++] = ee, ee = ee >> 8, N[S++] = ee, ee = ee >> 8, N[S++] = ee, S;
|
|
2173
2173
|
}
|
|
2174
|
-
function fe(N, w, S,
|
|
2175
|
-
T(w,
|
|
2174
|
+
function fe(N, w, S, H, W) {
|
|
2175
|
+
T(w, H, W, N, S, 7);
|
|
2176
2176
|
let X = Number(w & BigInt(4294967295));
|
|
2177
2177
|
N[S + 7] = X, X = X >> 8, N[S + 6] = X, X = X >> 8, N[S + 5] = X, X = X >> 8, N[S + 4] = X;
|
|
2178
2178
|
let ee = Number(w >> BigInt(32) & BigInt(4294967295));
|
|
2179
2179
|
return N[S + 3] = ee, ee = ee >> 8, N[S + 2] = ee, ee = ee >> 8, N[S + 1] = ee, ee = ee >> 8, N[S] = ee, S + 8;
|
|
2180
2180
|
}
|
|
2181
2181
|
a.prototype.writeBigUInt64LE = Le(function(w, S = 0) {
|
|
2182
|
-
return
|
|
2182
|
+
return U(this, w, S, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
2183
2183
|
}), a.prototype.writeBigUInt64BE = Le(function(w, S = 0) {
|
|
2184
2184
|
return fe(this, w, S, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
2185
|
-
}), a.prototype.writeIntLE = function(w, S,
|
|
2185
|
+
}), a.prototype.writeIntLE = function(w, S, H, W) {
|
|
2186
2186
|
if (w = +w, S = S >>> 0, !W) {
|
|
2187
|
-
const we = Math.pow(2, 8 *
|
|
2188
|
-
_(this, w, S,
|
|
2187
|
+
const we = Math.pow(2, 8 * H - 1);
|
|
2188
|
+
_(this, w, S, H, we - 1, -we);
|
|
2189
2189
|
}
|
|
2190
2190
|
let X = 0, ee = 1, Ee = 0;
|
|
2191
|
-
for (this[S] = w & 255; ++X <
|
|
2191
|
+
for (this[S] = w & 255; ++X < H && (ee *= 256); )
|
|
2192
2192
|
w < 0 && Ee === 0 && this[S + X - 1] !== 0 && (Ee = 1), this[S + X] = (w / ee >> 0) - Ee & 255;
|
|
2193
|
-
return S +
|
|
2194
|
-
}, a.prototype.writeIntBE = function(w, S,
|
|
2193
|
+
return S + H;
|
|
2194
|
+
}, a.prototype.writeIntBE = function(w, S, H, W) {
|
|
2195
2195
|
if (w = +w, S = S >>> 0, !W) {
|
|
2196
|
-
const we = Math.pow(2, 8 *
|
|
2197
|
-
_(this, w, S,
|
|
2196
|
+
const we = Math.pow(2, 8 * H - 1);
|
|
2197
|
+
_(this, w, S, H, we - 1, -we);
|
|
2198
2198
|
}
|
|
2199
|
-
let X =
|
|
2199
|
+
let X = H - 1, ee = 1, Ee = 0;
|
|
2200
2200
|
for (this[S + X] = w & 255; --X >= 0 && (ee *= 256); )
|
|
2201
2201
|
w < 0 && Ee === 0 && this[S + X + 1] !== 0 && (Ee = 1), this[S + X] = (w / ee >> 0) - Ee & 255;
|
|
2202
|
-
return S +
|
|
2203
|
-
}, a.prototype.writeInt8 = function(w, S,
|
|
2204
|
-
return w = +w, S = S >>> 0,
|
|
2205
|
-
}, a.prototype.writeInt16LE = function(w, S,
|
|
2206
|
-
return w = +w, S = S >>> 0,
|
|
2207
|
-
}, a.prototype.writeInt16BE = function(w, S,
|
|
2208
|
-
return w = +w, S = S >>> 0,
|
|
2209
|
-
}, a.prototype.writeInt32LE = function(w, S,
|
|
2210
|
-
return w = +w, S = S >>> 0,
|
|
2211
|
-
}, a.prototype.writeInt32BE = function(w, S,
|
|
2212
|
-
return w = +w, S = S >>> 0,
|
|
2202
|
+
return S + H;
|
|
2203
|
+
}, a.prototype.writeInt8 = function(w, S, H) {
|
|
2204
|
+
return w = +w, S = S >>> 0, H || _(this, w, S, 1, 127, -128), w < 0 && (w = 255 + w + 1), this[S] = w & 255, S + 1;
|
|
2205
|
+
}, a.prototype.writeInt16LE = function(w, S, H) {
|
|
2206
|
+
return w = +w, S = S >>> 0, H || _(this, w, S, 2, 32767, -32768), this[S] = w & 255, this[S + 1] = w >>> 8, S + 2;
|
|
2207
|
+
}, a.prototype.writeInt16BE = function(w, S, H) {
|
|
2208
|
+
return w = +w, S = S >>> 0, H || _(this, w, S, 2, 32767, -32768), this[S] = w >>> 8, this[S + 1] = w & 255, S + 2;
|
|
2209
|
+
}, a.prototype.writeInt32LE = function(w, S, H) {
|
|
2210
|
+
return w = +w, S = S >>> 0, H || _(this, w, S, 4, 2147483647, -2147483648), this[S] = w & 255, this[S + 1] = w >>> 8, this[S + 2] = w >>> 16, this[S + 3] = w >>> 24, S + 4;
|
|
2211
|
+
}, a.prototype.writeInt32BE = function(w, S, H) {
|
|
2212
|
+
return w = +w, S = S >>> 0, H || _(this, w, S, 4, 2147483647, -2147483648), w < 0 && (w = 4294967295 + w + 1), this[S] = w >>> 24, this[S + 1] = w >>> 16, this[S + 2] = w >>> 8, this[S + 3] = w & 255, S + 4;
|
|
2213
2213
|
}, a.prototype.writeBigInt64LE = Le(function(w, S = 0) {
|
|
2214
|
-
return
|
|
2214
|
+
return U(this, w, S, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
2215
2215
|
}), a.prototype.writeBigInt64BE = Le(function(w, S = 0) {
|
|
2216
2216
|
return fe(this, w, S, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
2217
2217
|
});
|
|
2218
|
-
function se(N, w, S,
|
|
2219
|
-
if (S +
|
|
2218
|
+
function se(N, w, S, H, W, X) {
|
|
2219
|
+
if (S + H > N.length) throw new RangeError("Index out of range");
|
|
2220
2220
|
if (S < 0) throw new RangeError("Index out of range");
|
|
2221
2221
|
}
|
|
2222
|
-
function V(N, w, S,
|
|
2223
|
-
return w = +w, S = S >>> 0, W || se(N, w, S, 4), t.write(N, w, S,
|
|
2222
|
+
function V(N, w, S, H, W) {
|
|
2223
|
+
return w = +w, S = S >>> 0, W || se(N, w, S, 4), t.write(N, w, S, H, 23, 4), S + 4;
|
|
2224
2224
|
}
|
|
2225
|
-
a.prototype.writeFloatLE = function(w, S,
|
|
2226
|
-
return V(this, w, S, !0,
|
|
2227
|
-
}, a.prototype.writeFloatBE = function(w, S,
|
|
2228
|
-
return V(this, w, S, !1,
|
|
2225
|
+
a.prototype.writeFloatLE = function(w, S, H) {
|
|
2226
|
+
return V(this, w, S, !0, H);
|
|
2227
|
+
}, a.prototype.writeFloatBE = function(w, S, H) {
|
|
2228
|
+
return V(this, w, S, !1, H);
|
|
2229
2229
|
};
|
|
2230
|
-
function P(N, w, S,
|
|
2231
|
-
return w = +w, S = S >>> 0, W || se(N, w, S, 8), t.write(N, w, S,
|
|
2232
|
-
}
|
|
2233
|
-
a.prototype.writeDoubleLE = function(w, S,
|
|
2234
|
-
return P(this, w, S, !0,
|
|
2235
|
-
}, a.prototype.writeDoubleBE = function(w, S,
|
|
2236
|
-
return P(this, w, S, !1,
|
|
2237
|
-
}, a.prototype.copy = function(w, S,
|
|
2230
|
+
function P(N, w, S, H, W) {
|
|
2231
|
+
return w = +w, S = S >>> 0, W || se(N, w, S, 8), t.write(N, w, S, H, 52, 8), S + 8;
|
|
2232
|
+
}
|
|
2233
|
+
a.prototype.writeDoubleLE = function(w, S, H) {
|
|
2234
|
+
return P(this, w, S, !0, H);
|
|
2235
|
+
}, a.prototype.writeDoubleBE = function(w, S, H) {
|
|
2236
|
+
return P(this, w, S, !1, H);
|
|
2237
|
+
}, a.prototype.copy = function(w, S, H, W) {
|
|
2238
2238
|
if (!a.isBuffer(w)) throw new TypeError("argument should be a Buffer");
|
|
2239
|
-
if (
|
|
2239
|
+
if (H || (H = 0), !W && W !== 0 && (W = this.length), S >= w.length && (S = w.length), S || (S = 0), W > 0 && W < H && (W = H), W === H || w.length === 0 || this.length === 0) return 0;
|
|
2240
2240
|
if (S < 0)
|
|
2241
2241
|
throw new RangeError("targetStart out of bounds");
|
|
2242
|
-
if (
|
|
2242
|
+
if (H < 0 || H >= this.length) throw new RangeError("Index out of range");
|
|
2243
2243
|
if (W < 0) throw new RangeError("sourceEnd out of bounds");
|
|
2244
|
-
W > this.length && (W = this.length), w.length - S < W -
|
|
2245
|
-
const X = W -
|
|
2246
|
-
return this === w && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(S,
|
|
2244
|
+
W > this.length && (W = this.length), w.length - S < W - H && (W = w.length - S + H);
|
|
2245
|
+
const X = W - H;
|
|
2246
|
+
return this === w && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(S, H, W) : Uint8Array.prototype.set.call(
|
|
2247
2247
|
w,
|
|
2248
|
-
this.subarray(
|
|
2248
|
+
this.subarray(H, W),
|
|
2249
2249
|
S
|
|
2250
2250
|
), X;
|
|
2251
|
-
}, a.prototype.fill = function(w, S,
|
|
2251
|
+
}, a.prototype.fill = function(w, S, H, W) {
|
|
2252
2252
|
if (typeof w == "string") {
|
|
2253
|
-
if (typeof S == "string" ? (W = S, S = 0,
|
|
2253
|
+
if (typeof S == "string" ? (W = S, S = 0, H = this.length) : typeof H == "string" && (W = H, H = this.length), W !== void 0 && typeof W != "string")
|
|
2254
2254
|
throw new TypeError("encoding must be a string");
|
|
2255
2255
|
if (typeof W == "string" && !a.isEncoding(W))
|
|
2256
2256
|
throw new TypeError("Unknown encoding: " + W);
|
|
@@ -2259,20 +2259,20 @@ function St() {
|
|
|
2259
2259
|
(W === "utf8" && ee < 128 || W === "latin1") && (w = ee);
|
|
2260
2260
|
}
|
|
2261
2261
|
} else typeof w == "number" ? w = w & 255 : typeof w == "boolean" && (w = Number(w));
|
|
2262
|
-
if (S < 0 || this.length < S || this.length <
|
|
2262
|
+
if (S < 0 || this.length < S || this.length < H)
|
|
2263
2263
|
throw new RangeError("Out of range index");
|
|
2264
|
-
if (
|
|
2264
|
+
if (H <= S)
|
|
2265
2265
|
return this;
|
|
2266
|
-
S = S >>> 0,
|
|
2266
|
+
S = S >>> 0, H = H === void 0 ? this.length : H >>> 0, w || (w = 0);
|
|
2267
2267
|
let X;
|
|
2268
2268
|
if (typeof w == "number")
|
|
2269
|
-
for (X = S; X <
|
|
2269
|
+
for (X = S; X < H; ++X)
|
|
2270
2270
|
this[X] = w;
|
|
2271
2271
|
else {
|
|
2272
2272
|
const ee = a.isBuffer(w) ? w : a.from(w, W), Ee = ee.length;
|
|
2273
2273
|
if (Ee === 0)
|
|
2274
2274
|
throw new TypeError('The value "' + w + '" is invalid for argument "value"');
|
|
2275
|
-
for (X = 0; X <
|
|
2275
|
+
for (X = 0; X < H - S; ++X)
|
|
2276
2276
|
this[X + S] = ee[X % Ee];
|
|
2277
2277
|
}
|
|
2278
2278
|
return this;
|
|
@@ -2318,34 +2318,34 @@ function St() {
|
|
|
2318
2318
|
), Y(
|
|
2319
2319
|
"ERR_OUT_OF_RANGE",
|
|
2320
2320
|
function(N, w, S) {
|
|
2321
|
-
let
|
|
2322
|
-
return Number.isInteger(S) && Math.abs(S) > 2 ** 32 ? W = Q(String(S)) : typeof S == "bigint" && (W = String(S), (S > BigInt(2) ** BigInt(32) || S < -(BigInt(2) ** BigInt(32))) && (W = Q(W)), W += "n"),
|
|
2321
|
+
let H = `The value of "${N}" is out of range.`, W = S;
|
|
2322
|
+
return Number.isInteger(S) && Math.abs(S) > 2 ** 32 ? W = Q(String(S)) : typeof S == "bigint" && (W = String(S), (S > BigInt(2) ** BigInt(32) || S < -(BigInt(2) ** BigInt(32))) && (W = Q(W)), W += "n"), H += ` It must be ${w}. Received ${W}`, H;
|
|
2323
2323
|
},
|
|
2324
2324
|
RangeError
|
|
2325
2325
|
);
|
|
2326
2326
|
function Q(N) {
|
|
2327
2327
|
let w = "", S = N.length;
|
|
2328
|
-
const
|
|
2329
|
-
for (; S >=
|
|
2328
|
+
const H = N[0] === "-" ? 1 : 0;
|
|
2329
|
+
for (; S >= H + 4; S -= 3)
|
|
2330
2330
|
w = `_${N.slice(S - 3, S)}${w}`;
|
|
2331
2331
|
return `${N.slice(0, S)}${w}`;
|
|
2332
2332
|
}
|
|
2333
2333
|
function D(N, w, S) {
|
|
2334
|
-
J(w, "offset"), (N[w] === void 0 || N[w + S] === void 0) &&
|
|
2334
|
+
J(w, "offset"), (N[w] === void 0 || N[w + S] === void 0) && ie(w, N.length - (S + 1));
|
|
2335
2335
|
}
|
|
2336
|
-
function T(N, w, S,
|
|
2336
|
+
function T(N, w, S, H, W, X) {
|
|
2337
2337
|
if (N > S || N < w) {
|
|
2338
2338
|
const ee = typeof w == "bigint" ? "n" : "";
|
|
2339
2339
|
let Ee;
|
|
2340
2340
|
throw w === 0 || w === BigInt(0) ? Ee = `>= 0${ee} and < 2${ee} ** ${(X + 1) * 8}${ee}` : Ee = `>= -(2${ee} ** ${(X + 1) * 8 - 1}${ee}) and < 2 ** ${(X + 1) * 8 - 1}${ee}`, new M.ERR_OUT_OF_RANGE("value", Ee, N);
|
|
2341
2341
|
}
|
|
2342
|
-
D(
|
|
2342
|
+
D(H, W, X);
|
|
2343
2343
|
}
|
|
2344
2344
|
function J(N, w) {
|
|
2345
2345
|
if (typeof N != "number")
|
|
2346
2346
|
throw new M.ERR_INVALID_ARG_TYPE(w, "number", N);
|
|
2347
2347
|
}
|
|
2348
|
-
function
|
|
2348
|
+
function ie(N, w, S) {
|
|
2349
2349
|
throw Math.floor(N) !== N ? (J(N, S), new M.ERR_OUT_OF_RANGE("offset", "an integer", N)) : w < 0 ? new M.ERR_BUFFER_OUT_OF_BOUNDS() : new M.ERR_OUT_OF_RANGE(
|
|
2350
2350
|
"offset",
|
|
2351
2351
|
`>= 0 and <= ${w}`,
|
|
@@ -2362,16 +2362,16 @@ function St() {
|
|
|
2362
2362
|
function ce(N, w) {
|
|
2363
2363
|
w = w || 1 / 0;
|
|
2364
2364
|
let S;
|
|
2365
|
-
const
|
|
2365
|
+
const H = N.length;
|
|
2366
2366
|
let W = null;
|
|
2367
2367
|
const X = [];
|
|
2368
|
-
for (let ee = 0; ee <
|
|
2368
|
+
for (let ee = 0; ee < H; ++ee) {
|
|
2369
2369
|
if (S = N.charCodeAt(ee), S > 55295 && S < 57344) {
|
|
2370
2370
|
if (!W) {
|
|
2371
2371
|
if (S > 56319) {
|
|
2372
2372
|
(w -= 3) > -1 && X.push(239, 191, 189);
|
|
2373
2373
|
continue;
|
|
2374
|
-
} else if (ee + 1 ===
|
|
2374
|
+
} else if (ee + 1 === H) {
|
|
2375
2375
|
(w -= 3) > -1 && X.push(239, 191, 189);
|
|
2376
2376
|
continue;
|
|
2377
2377
|
}
|
|
@@ -2420,18 +2420,18 @@ function St() {
|
|
|
2420
2420
|
return w;
|
|
2421
2421
|
}
|
|
2422
2422
|
function Ke(N, w) {
|
|
2423
|
-
let S,
|
|
2423
|
+
let S, H, W;
|
|
2424
2424
|
const X = [];
|
|
2425
2425
|
for (let ee = 0; ee < N.length && !((w -= 2) < 0); ++ee)
|
|
2426
|
-
S = N.charCodeAt(ee),
|
|
2426
|
+
S = N.charCodeAt(ee), H = S >> 8, W = S % 256, X.push(W), X.push(H);
|
|
2427
2427
|
return X;
|
|
2428
2428
|
}
|
|
2429
2429
|
function Se(N) {
|
|
2430
2430
|
return e.toByteArray(oe(N));
|
|
2431
2431
|
}
|
|
2432
|
-
function de(N, w, S,
|
|
2432
|
+
function de(N, w, S, H) {
|
|
2433
2433
|
let W;
|
|
2434
|
-
for (W = 0; W <
|
|
2434
|
+
for (W = 0; W < H && !(W + S >= w.length || W >= N.length); ++W)
|
|
2435
2435
|
w[W + S] = N[W];
|
|
2436
2436
|
return W;
|
|
2437
2437
|
}
|
|
@@ -2444,9 +2444,9 @@ function St() {
|
|
|
2444
2444
|
const me = (function() {
|
|
2445
2445
|
const N = "0123456789abcdef", w = new Array(256);
|
|
2446
2446
|
for (let S = 0; S < 16; ++S) {
|
|
2447
|
-
const
|
|
2447
|
+
const H = S * 16;
|
|
2448
2448
|
for (let W = 0; W < 16; ++W)
|
|
2449
|
-
w[
|
|
2449
|
+
w[H + W] = N[S] + N[W];
|
|
2450
2450
|
}
|
|
2451
2451
|
return w;
|
|
2452
2452
|
})();
|
|
@@ -3141,7 +3141,7 @@ function Oh() {
|
|
|
3141
3141
|
this._writableState.corked++;
|
|
3142
3142
|
}, G.prototype.uncork = function() {
|
|
3143
3143
|
var V = this._writableState;
|
|
3144
|
-
V.corked && (V.corked--, !V.writing && !V.corked && !V.bufferProcessing && V.bufferedRequest &&
|
|
3144
|
+
V.corked && (V.corked--, !V.writing && !V.corked && !V.bufferProcessing && V.bufferedRequest && F(this, V));
|
|
3145
3145
|
}, G.prototype.setDefaultEncoding = function(P) {
|
|
3146
3146
|
if (typeof P == "string" && (P = P.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((P + "").toLowerCase()) > -1)) throw new x(P);
|
|
3147
3147
|
return this._writableState.defaultEncoding = P, this;
|
|
@@ -3173,8 +3173,8 @@ function Oh() {
|
|
|
3173
3173
|
}
|
|
3174
3174
|
var J = P.objectMode ? 1 : Y.length;
|
|
3175
3175
|
P.length += J;
|
|
3176
|
-
var
|
|
3177
|
-
if (
|
|
3176
|
+
var ie = P.length < P.highWaterMark;
|
|
3177
|
+
if (ie || (P.needDrain = !0), P.writing || P.corked) {
|
|
3178
3178
|
var ue = P.lastBufferedRequest;
|
|
3179
3179
|
P.lastBufferedRequest = {
|
|
3180
3180
|
chunk: Y,
|
|
@@ -3185,13 +3185,13 @@ function Oh() {
|
|
|
3185
3185
|
}, ue ? ue.next = P.lastBufferedRequest : P.bufferedRequest = P.lastBufferedRequest, P.bufferedRequestCount += 1;
|
|
3186
3186
|
} else
|
|
3187
3187
|
k(V, P, !1, J, Y, Q, D);
|
|
3188
|
-
return
|
|
3188
|
+
return ie;
|
|
3189
3189
|
}
|
|
3190
3190
|
function k(V, P, M, Y, Q, D, T) {
|
|
3191
3191
|
P.writelen = Y, P.writecb = T, P.writing = !0, P.sync = !0, P.destroyed ? P.onwrite(new y("write")) : M ? V._writev(Q, P.onwrite) : V._write(Q, D, P.onwrite), P.sync = !1;
|
|
3192
3192
|
}
|
|
3193
3193
|
function m(V, P, M, Y, Q) {
|
|
3194
|
-
--P.pendingcb, M ? (process.nextTick(Q, Y), process.nextTick(
|
|
3194
|
+
--P.pendingcb, M ? (process.nextTick(Q, Y), process.nextTick(U, V, P), V._writableState.errorEmitted = !0, B(V, Y)) : (Q(Y), V._writableState.errorEmitted = !0, B(V, Y), U(V, P));
|
|
3195
3195
|
}
|
|
3196
3196
|
function E(V) {
|
|
3197
3197
|
V.writing = !1, V.writecb = null, V.length -= V.writelen, V.writelen = 0;
|
|
@@ -3202,16 +3202,16 @@ function Oh() {
|
|
|
3202
3202
|
if (E(M), P) m(V, M, Y, P, Q);
|
|
3203
3203
|
else {
|
|
3204
3204
|
var D = K(M) || V.destroyed;
|
|
3205
|
-
!D && !M.corked && !M.bufferProcessing && M.bufferedRequest &&
|
|
3205
|
+
!D && !M.corked && !M.bufferProcessing && M.bufferedRequest && F(V, M), Y ? process.nextTick(R, V, M, D, Q) : R(V, M, D, Q);
|
|
3206
3206
|
}
|
|
3207
3207
|
}
|
|
3208
3208
|
function R(V, P, M, Y) {
|
|
3209
|
-
M || A(V, P), P.pendingcb--, Y(),
|
|
3209
|
+
M || A(V, P), P.pendingcb--, Y(), U(V, P);
|
|
3210
3210
|
}
|
|
3211
3211
|
function A(V, P) {
|
|
3212
3212
|
P.length === 0 && P.needDrain && (P.needDrain = !1, V.emit("drain"));
|
|
3213
3213
|
}
|
|
3214
|
-
function
|
|
3214
|
+
function F(V, P) {
|
|
3215
3215
|
P.bufferProcessing = !0;
|
|
3216
3216
|
var M = P.bufferedRequest;
|
|
3217
3217
|
if (V._writev && M && M.next) {
|
|
@@ -3222,8 +3222,8 @@ function Oh() {
|
|
|
3222
3222
|
Q.allBuffers = J, k(V, P, !0, P.length, Q, "", D.finish), P.pendingcb++, P.lastBufferedRequest = null, D.next ? (P.corkedRequestsFree = D.next, D.next = null) : P.corkedRequestsFree = new l(P), P.bufferedRequestCount = 0;
|
|
3223
3223
|
} else {
|
|
3224
3224
|
for (; M; ) {
|
|
3225
|
-
var
|
|
3226
|
-
if (k(V, P, !1, ce,
|
|
3225
|
+
var ie = M.chunk, ue = M.encoding, oe = M.callback, ce = P.objectMode ? 1 : ie.length;
|
|
3226
|
+
if (k(V, P, !1, ce, ie, ue, oe), M = M.next, P.bufferedRequestCount--, P.writing)
|
|
3227
3227
|
break;
|
|
3228
3228
|
}
|
|
3229
3229
|
M === null && (P.lastBufferedRequest = null);
|
|
@@ -3249,13 +3249,13 @@ function Oh() {
|
|
|
3249
3249
|
}
|
|
3250
3250
|
function L(V, P) {
|
|
3251
3251
|
V._final(function(M) {
|
|
3252
|
-
P.pendingcb--, M && B(V, M), P.prefinished = !0, V.emit("prefinish"),
|
|
3252
|
+
P.pendingcb--, M && B(V, M), P.prefinished = !0, V.emit("prefinish"), U(V, P);
|
|
3253
3253
|
});
|
|
3254
3254
|
}
|
|
3255
3255
|
function _(V, P) {
|
|
3256
3256
|
!P.prefinished && !P.finalCalled && (typeof V._final == "function" && !P.destroyed ? (P.pendingcb++, P.finalCalled = !0, process.nextTick(L, V, P)) : (P.prefinished = !0, V.emit("prefinish")));
|
|
3257
3257
|
}
|
|
3258
|
-
function
|
|
3258
|
+
function U(V, P) {
|
|
3259
3259
|
var M = K(P);
|
|
3260
3260
|
if (M && (_(V, P), P.pendingcb === 0 && (P.finished = !0, V.emit("finish"), P.autoDestroy))) {
|
|
3261
3261
|
var Y = V._readableState;
|
|
@@ -3264,7 +3264,7 @@ function Oh() {
|
|
|
3264
3264
|
return M;
|
|
3265
3265
|
}
|
|
3266
3266
|
function fe(V, P, M) {
|
|
3267
|
-
P.ending = !0,
|
|
3267
|
+
P.ending = !0, U(V, P), M && (P.finished ? process.nextTick(M) : V.once("finish", M)), P.ended = !0, V.writable = !1;
|
|
3268
3268
|
}
|
|
3269
3269
|
function se(V, P, M) {
|
|
3270
3270
|
var Y = V.entry;
|
|
@@ -3354,7 +3354,7 @@ function Ut() {
|
|
|
3354
3354
|
}), wi;
|
|
3355
3355
|
}
|
|
3356
3356
|
var _i = {}, Ls;
|
|
3357
|
-
function
|
|
3357
|
+
function Ff() {
|
|
3358
3358
|
if (Ls) return _i;
|
|
3359
3359
|
Ls = 1;
|
|
3360
3360
|
var l = _e().Buffer, e = l.isEncoding || function(v) {
|
|
@@ -3558,10 +3558,10 @@ function $f() {
|
|
|
3558
3558
|
}
|
|
3559
3559
|
return Si = u, Si;
|
|
3560
3560
|
}
|
|
3561
|
-
var xi,
|
|
3561
|
+
var xi, Fs;
|
|
3562
3562
|
function Hd() {
|
|
3563
|
-
if (
|
|
3564
|
-
|
|
3563
|
+
if (Fs) return xi;
|
|
3564
|
+
Fs = 1;
|
|
3565
3565
|
var l;
|
|
3566
3566
|
function e(x, B, I) {
|
|
3567
3567
|
return B = t(B), B in x ? Object.defineProperty(x, B, { value: I, enumerable: !0, configurable: !0, writable: !0 }) : x[B] = I, x;
|
|
@@ -3684,9 +3684,9 @@ function Hd() {
|
|
|
3684
3684
|
};
|
|
3685
3685
|
return xi = g, xi;
|
|
3686
3686
|
}
|
|
3687
|
-
var Ei,
|
|
3687
|
+
var Ei, qs;
|
|
3688
3688
|
function Kd() {
|
|
3689
|
-
return
|
|
3689
|
+
return qs || (qs = 1, Ei = function() {
|
|
3690
3690
|
throw new Error("Readable.from is not available in the browser");
|
|
3691
3691
|
}), Ei;
|
|
3692
3692
|
}
|
|
@@ -3717,7 +3717,7 @@ function Ph() {
|
|
|
3717
3717
|
!D._events || !D._events[T] ? D.on(T, J) : Array.isArray(D._events[T]) ? D._events[T].unshift(J) : D._events[T] = [J, D._events[T]];
|
|
3718
3718
|
}
|
|
3719
3719
|
function G(D, T, J) {
|
|
3720
|
-
l = l || Ut(), D = D || {}, typeof J != "boolean" && (J = T instanceof l), this.objectMode = !!D.objectMode, J && (this.objectMode = this.objectMode || !!D.readableObjectMode), this.highWaterMark = h(this, D, "readableHighWaterMark", J), this.buffer = new f(), this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = !1, this.endEmitted = !1, this.reading = !1, this.sync = !0, this.needReadable = !1, this.emittedReadable = !1, this.readableListening = !1, this.resumeScheduled = !1, this.paused = !0, this.emitClose = D.emitClose !== !1, this.autoDestroy = !!D.autoDestroy, this.destroyed = !1, this.defaultEncoding = D.defaultEncoding || "utf8", this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, D.encoding && (g || (g =
|
|
3720
|
+
l = l || Ut(), D = D || {}, typeof J != "boolean" && (J = T instanceof l), this.objectMode = !!D.objectMode, J && (this.objectMode = this.objectMode || !!D.readableObjectMode), this.highWaterMark = h(this, D, "readableHighWaterMark", J), this.buffer = new f(), this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = !1, this.endEmitted = !1, this.reading = !1, this.sync = !0, this.needReadable = !1, this.emittedReadable = !1, this.readableListening = !1, this.resumeScheduled = !1, this.paused = !0, this.emitClose = D.emitClose !== !1, this.autoDestroy = !!D.autoDestroy, this.destroyed = !1, this.defaultEncoding = D.defaultEncoding || "utf8", this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, D.encoding && (g || (g = Ff().StringDecoder), this.decoder = new g(D.encoding), this.encoding = D.encoding);
|
|
3721
3721
|
}
|
|
3722
3722
|
function z(D) {
|
|
3723
3723
|
if (l = l || Ut(), !(this instanceof z)) return new z(D);
|
|
@@ -3738,12 +3738,12 @@ function Ph() {
|
|
|
3738
3738
|
}), z.prototype.destroy = i.destroy, z.prototype._undestroy = i.undestroy, z.prototype._destroy = function(D, T) {
|
|
3739
3739
|
T(D);
|
|
3740
3740
|
}, z.prototype.push = function(D, T) {
|
|
3741
|
-
var J = this._readableState,
|
|
3742
|
-
return J.objectMode ?
|
|
3741
|
+
var J = this._readableState, ie;
|
|
3742
|
+
return J.objectMode ? ie = !0 : typeof D == "string" && (T = T || J.defaultEncoding, T !== J.encoding && (D = n.from(D, T), T = ""), ie = !0), te(this, D, T, !1, ie);
|
|
3743
3743
|
}, z.prototype.unshift = function(D) {
|
|
3744
3744
|
return te(this, D, null, !0, !1);
|
|
3745
3745
|
};
|
|
3746
|
-
function te(D, T, J,
|
|
3746
|
+
function te(D, T, J, ie, ue) {
|
|
3747
3747
|
o("readableAddChunk", T);
|
|
3748
3748
|
var oe = D._readableState;
|
|
3749
3749
|
if (T === null)
|
|
@@ -3753,21 +3753,21 @@ function Ph() {
|
|
|
3753
3753
|
if (ue || (ce = $(oe, T)), ce)
|
|
3754
3754
|
I(D, ce);
|
|
3755
3755
|
else if (oe.objectMode || T && T.length > 0)
|
|
3756
|
-
if (typeof T != "string" && !oe.objectMode && Object.getPrototypeOf(T) !== n.prototype && (T = r(T)),
|
|
3756
|
+
if (typeof T != "string" && !oe.objectMode && Object.getPrototypeOf(T) !== n.prototype && (T = r(T)), ie)
|
|
3757
3757
|
oe.endEmitted ? I(D, new v()) : ne(D, oe, T, !0);
|
|
3758
3758
|
else if (oe.ended)
|
|
3759
3759
|
I(D, new p());
|
|
3760
3760
|
else {
|
|
3761
3761
|
if (oe.destroyed)
|
|
3762
3762
|
return !1;
|
|
3763
|
-
oe.reading = !1, oe.decoder && !J ? (T = oe.decoder.write(T), oe.objectMode || T.length !== 0 ? ne(D, oe, T, !1) :
|
|
3763
|
+
oe.reading = !1, oe.decoder && !J ? (T = oe.decoder.write(T), oe.objectMode || T.length !== 0 ? ne(D, oe, T, !1) : F(D, oe)) : ne(D, oe, T, !1);
|
|
3764
3764
|
}
|
|
3765
|
-
else
|
|
3765
|
+
else ie || (oe.reading = !1, F(D, oe));
|
|
3766
3766
|
}
|
|
3767
3767
|
return !oe.ended && (oe.length < oe.highWaterMark || oe.length === 0);
|
|
3768
3768
|
}
|
|
3769
|
-
function ne(D, T, J,
|
|
3770
|
-
T.flowing && T.length === 0 && !T.sync ? (T.awaitDrain = 0, D.emit("data", J)) : (T.length += T.objectMode ? 1 : J.length,
|
|
3769
|
+
function ne(D, T, J, ie) {
|
|
3770
|
+
T.flowing && T.length === 0 && !T.sync ? (T.awaitDrain = 0, D.emit("data", J)) : (T.length += T.objectMode ? 1 : J.length, ie ? T.buffer.unshift(J) : T.buffer.push(J), T.needReadable && R(D)), F(D, T);
|
|
3771
3771
|
}
|
|
3772
3772
|
function $(D, T) {
|
|
3773
3773
|
var J;
|
|
@@ -3776,12 +3776,12 @@ function Ph() {
|
|
|
3776
3776
|
z.prototype.isPaused = function() {
|
|
3777
3777
|
return this._readableState.flowing === !1;
|
|
3778
3778
|
}, z.prototype.setEncoding = function(D) {
|
|
3779
|
-
g || (g =
|
|
3779
|
+
g || (g = Ff().StringDecoder);
|
|
3780
3780
|
var T = new g(D);
|
|
3781
3781
|
this._readableState.decoder = T, this._readableState.encoding = this._readableState.decoder.encoding;
|
|
3782
|
-
for (var J = this._readableState.buffer.head,
|
|
3783
|
-
|
|
3784
|
-
return this._readableState.buffer.clear(),
|
|
3782
|
+
for (var J = this._readableState.buffer.head, ie = ""; J !== null; )
|
|
3783
|
+
ie += T.write(J.data), J = J.next;
|
|
3784
|
+
return this._readableState.buffer.clear(), ie !== "" && this._readableState.buffer.push(ie), this._readableState.length = ie.length, this;
|
|
3785
3785
|
};
|
|
3786
3786
|
var k = 1073741824;
|
|
3787
3787
|
function m(D) {
|
|
@@ -3797,8 +3797,8 @@ function Ph() {
|
|
|
3797
3797
|
return o("read: emitReadable", T.length, T.ended), T.length === 0 && T.ended ? M(this) : R(this), null;
|
|
3798
3798
|
if (D = E(D, T), D === 0 && T.ended)
|
|
3799
3799
|
return T.length === 0 && M(this), null;
|
|
3800
|
-
var
|
|
3801
|
-
o("need readable",
|
|
3800
|
+
var ie = T.needReadable;
|
|
3801
|
+
o("need readable", ie), (T.length === 0 || T.length - D < T.highWaterMark) && (ie = !0, o("length less than watermark", ie)), T.ended || T.reading ? (ie = !1, o("reading or ended", ie)) : ie && (o("do read"), T.reading = !0, T.sync = !0, T.length === 0 && (T.needReadable = !0), this._read(T.highWaterMark), T.sync = !1, T.reading || (D = E(J, T)));
|
|
3802
3802
|
var ue;
|
|
3803
3803
|
return D > 0 ? ue = P(D, T) : ue = null, ue === null ? (T.needReadable = T.length <= T.highWaterMark, D = 0) : (T.length -= D, T.awaitDrain = 0), T.length === 0 && (T.ended || (T.needReadable = !0), J !== D && T.ended && M(this)), ue !== null && this.emit("data", ue), ue;
|
|
3804
3804
|
};
|
|
@@ -3819,7 +3819,7 @@ function Ph() {
|
|
|
3819
3819
|
var T = D._readableState;
|
|
3820
3820
|
o("emitReadable_", T.destroyed, T.length, T.ended), !T.destroyed && (T.length || T.ended) && (D.emit("readable"), T.emittedReadable = !1), T.needReadable = !T.flowing && !T.ended && T.length <= T.highWaterMark, V(D);
|
|
3821
3821
|
}
|
|
3822
|
-
function
|
|
3822
|
+
function F(D, T) {
|
|
3823
3823
|
T.readingMore || (T.readingMore = !0, process.nextTick(K, D, T));
|
|
3824
3824
|
}
|
|
3825
3825
|
function K(D, T) {
|
|
@@ -3833,21 +3833,21 @@ function Ph() {
|
|
|
3833
3833
|
z.prototype._read = function(D) {
|
|
3834
3834
|
I(this, new y("_read()"));
|
|
3835
3835
|
}, z.prototype.pipe = function(D, T) {
|
|
3836
|
-
var J = this,
|
|
3837
|
-
switch (
|
|
3836
|
+
var J = this, ie = this._readableState;
|
|
3837
|
+
switch (ie.pipesCount) {
|
|
3838
3838
|
case 0:
|
|
3839
|
-
|
|
3839
|
+
ie.pipes = D;
|
|
3840
3840
|
break;
|
|
3841
3841
|
case 1:
|
|
3842
|
-
|
|
3842
|
+
ie.pipes = [ie.pipes, D];
|
|
3843
3843
|
break;
|
|
3844
3844
|
default:
|
|
3845
|
-
|
|
3845
|
+
ie.pipes.push(D);
|
|
3846
3846
|
break;
|
|
3847
3847
|
}
|
|
3848
|
-
|
|
3848
|
+
ie.pipesCount += 1, o("pipe count=%d opts=%j", ie.pipesCount, T);
|
|
3849
3849
|
var ue = (!T || T.end !== !1) && D !== process.stdout && D !== process.stderr, oe = ue ? ge : Pe;
|
|
3850
|
-
|
|
3850
|
+
ie.endEmitted ? process.nextTick(oe) : J.once("end", oe), D.on("unpipe", ce);
|
|
3851
3851
|
function ce(N, w) {
|
|
3852
3852
|
o("onunpipe"), N === J && w && w.hasUnpiped === !1 && (w.hasUnpiped = !0, de());
|
|
3853
3853
|
}
|
|
@@ -3858,13 +3858,13 @@ function Ph() {
|
|
|
3858
3858
|
D.on("drain", Ke);
|
|
3859
3859
|
var Se = !1;
|
|
3860
3860
|
function de() {
|
|
3861
|
-
o("cleanup"), D.removeListener("close", me), D.removeListener("finish", Le), D.removeListener("drain", Ke), D.removeListener("error", ve), D.removeListener("unpipe", ce), J.removeListener("end", ge), J.removeListener("end", Pe), J.removeListener("data", Be), Se = !0,
|
|
3861
|
+
o("cleanup"), D.removeListener("close", me), D.removeListener("finish", Le), D.removeListener("drain", Ke), D.removeListener("error", ve), D.removeListener("unpipe", ce), J.removeListener("end", ge), J.removeListener("end", Pe), J.removeListener("data", Be), Se = !0, ie.awaitDrain && (!D._writableState || D._writableState.needDrain) && Ke();
|
|
3862
3862
|
}
|
|
3863
3863
|
J.on("data", Be);
|
|
3864
3864
|
function Be(N) {
|
|
3865
3865
|
o("ondata");
|
|
3866
3866
|
var w = D.write(N);
|
|
3867
|
-
o("dest.write", w), w === !1 && ((
|
|
3867
|
+
o("dest.write", w), w === !1 && ((ie.pipesCount === 1 && ie.pipes === D || ie.pipesCount > 1 && Q(ie.pipes, D) !== -1) && !Se && (o("false write response, pause", ie.awaitDrain), ie.awaitDrain++), J.pause());
|
|
3868
3868
|
}
|
|
3869
3869
|
function ve(N) {
|
|
3870
3870
|
o("onerror", N), Pe(), D.removeListener("error", ve), e(D, "error") === 0 && I(D, N);
|
|
@@ -3881,7 +3881,7 @@ function Ph() {
|
|
|
3881
3881
|
function Pe() {
|
|
3882
3882
|
o("unpipe"), J.unpipe(D);
|
|
3883
3883
|
}
|
|
3884
|
-
return D.emit("pipe", J),
|
|
3884
|
+
return D.emit("pipe", J), ie.flowing || (o("pipe resume"), J.resume()), D;
|
|
3885
3885
|
};
|
|
3886
3886
|
function L(D) {
|
|
3887
3887
|
return function() {
|
|
@@ -3897,9 +3897,9 @@ function Ph() {
|
|
|
3897
3897
|
if (T.pipesCount === 1)
|
|
3898
3898
|
return D && D !== T.pipes ? this : (D || (D = T.pipes), T.pipes = null, T.pipesCount = 0, T.flowing = !1, D && D.emit("unpipe", this, J), this);
|
|
3899
3899
|
if (!D) {
|
|
3900
|
-
var
|
|
3900
|
+
var ie = T.pipes, ue = T.pipesCount;
|
|
3901
3901
|
T.pipes = null, T.pipesCount = 0, T.flowing = !1;
|
|
3902
|
-
for (var oe = 0; oe < ue; oe++)
|
|
3902
|
+
for (var oe = 0; oe < ue; oe++) ie[oe].emit("unpipe", this, {
|
|
3903
3903
|
hasUnpiped: !1
|
|
3904
3904
|
});
|
|
3905
3905
|
return this;
|
|
@@ -3907,8 +3907,8 @@ function Ph() {
|
|
|
3907
3907
|
var ce = Q(T.pipes, D);
|
|
3908
3908
|
return ce === -1 ? this : (T.pipes.splice(ce, 1), T.pipesCount -= 1, T.pipesCount === 1 && (T.pipes = T.pipes[0]), D.emit("unpipe", this, J), this);
|
|
3909
3909
|
}, z.prototype.on = function(D, T) {
|
|
3910
|
-
var J = t.prototype.on.call(this, D, T),
|
|
3911
|
-
return D === "data" ? (
|
|
3910
|
+
var J = t.prototype.on.call(this, D, T), ie = this._readableState;
|
|
3911
|
+
return D === "data" ? (ie.readableListening = this.listenerCount("readable") > 0, ie.flowing !== !1 && this.resume()) : D === "readable" && !ie.endEmitted && !ie.readableListening && (ie.readableListening = ie.needReadable = !0, ie.flowing = !1, ie.emittedReadable = !1, o("on readable", ie.length, ie.reading), ie.length ? R(this) : ie.reading || process.nextTick(U, this)), J;
|
|
3912
3912
|
}, z.prototype.addListener = z.prototype.on, z.prototype.removeListener = function(D, T) {
|
|
3913
3913
|
var J = t.prototype.removeListener.call(this, D, T);
|
|
3914
3914
|
return D === "readable" && process.nextTick(_, this), J;
|
|
@@ -3920,7 +3920,7 @@ function Ph() {
|
|
|
3920
3920
|
var T = D._readableState;
|
|
3921
3921
|
T.readableListening = D.listenerCount("readable") > 0, T.resumeScheduled && !T.paused ? T.flowing = !0 : D.listenerCount("data") > 0 && D.resume();
|
|
3922
3922
|
}
|
|
3923
|
-
function
|
|
3923
|
+
function U(D) {
|
|
3924
3924
|
o("readable nexttick read 0"), D.read(0);
|
|
3925
3925
|
}
|
|
3926
3926
|
z.prototype.resume = function() {
|
|
@@ -3941,7 +3941,7 @@ function Ph() {
|
|
|
3941
3941
|
for (o("flow", T.flowing); T.flowing && D.read() !== null; ) ;
|
|
3942
3942
|
}
|
|
3943
3943
|
z.prototype.wrap = function(D) {
|
|
3944
|
-
var T = this, J = this._readableState,
|
|
3944
|
+
var T = this, J = this._readableState, ie = !1;
|
|
3945
3945
|
D.on("end", function() {
|
|
3946
3946
|
if (o("wrapped end"), J.decoder && !J.ended) {
|
|
3947
3947
|
var ce = J.decoder.end();
|
|
@@ -3951,7 +3951,7 @@ function Ph() {
|
|
|
3951
3951
|
}), D.on("data", function(ce) {
|
|
3952
3952
|
if (o("wrapped data"), J.decoder && (ce = J.decoder.write(ce)), !(J.objectMode && ce == null) && !(!J.objectMode && (!ce || !ce.length))) {
|
|
3953
3953
|
var ge = T.push(ce);
|
|
3954
|
-
ge || (
|
|
3954
|
+
ge || (ie = !0, D.pause());
|
|
3955
3955
|
}
|
|
3956
3956
|
});
|
|
3957
3957
|
for (var ue in D)
|
|
@@ -3963,7 +3963,7 @@ function Ph() {
|
|
|
3963
3963
|
for (var oe = 0; oe < C.length; oe++)
|
|
3964
3964
|
D.on(C[oe], this.emit.bind(this, C[oe]));
|
|
3965
3965
|
return this._read = function(ce) {
|
|
3966
|
-
o("wrapped _read", ce),
|
|
3966
|
+
o("wrapped _read", ce), ie && (ie = !1, D.resume());
|
|
3967
3967
|
}, this;
|
|
3968
3968
|
}, typeof Symbol == "function" && (z.prototype[Symbol.asyncIterator] = function() {
|
|
3969
3969
|
return x === void 0 && (x = Hd()), x(this);
|
|
@@ -4022,7 +4022,7 @@ function Ph() {
|
|
|
4022
4022
|
return B === void 0 && (B = Kd()), B(z, D, T);
|
|
4023
4023
|
});
|
|
4024
4024
|
function Q(D, T) {
|
|
4025
|
-
for (var J = 0,
|
|
4025
|
+
for (var J = 0, ie = D.length; J < ie; J++)
|
|
4026
4026
|
if (D[J] === T) return J;
|
|
4027
4027
|
return -1;
|
|
4028
4028
|
}
|
|
@@ -4327,13 +4327,13 @@ var Di, Qs;
|
|
|
4327
4327
|
function Yd() {
|
|
4328
4328
|
return Qs || (Qs = 1, Di = RangeError), Di;
|
|
4329
4329
|
}
|
|
4330
|
-
var
|
|
4330
|
+
var Fi, Zs;
|
|
4331
4331
|
function Jd() {
|
|
4332
|
-
return Zs || (Zs = 1,
|
|
4332
|
+
return Zs || (Zs = 1, Fi = ReferenceError), Fi;
|
|
4333
4333
|
}
|
|
4334
|
-
var
|
|
4334
|
+
var qi, eo;
|
|
4335
4335
|
function Th() {
|
|
4336
|
-
return eo || (eo = 1,
|
|
4336
|
+
return eo || (eo = 1, qi = SyntaxError), qi;
|
|
4337
4337
|
}
|
|
4338
4338
|
var Ui, to;
|
|
4339
4339
|
function Xd() {
|
|
@@ -4523,7 +4523,7 @@ function c0() {
|
|
|
4523
4523
|
return So || (So = 1, sn = typeof Reflect < "u" && Reflect && Reflect.apply), sn;
|
|
4524
4524
|
}
|
|
4525
4525
|
var on, xo;
|
|
4526
|
-
function
|
|
4526
|
+
function Fh() {
|
|
4527
4527
|
if (xo) return on;
|
|
4528
4528
|
xo = 1;
|
|
4529
4529
|
var l = nr(), e = Jf(), t = Yf(), n = c0();
|
|
@@ -4533,7 +4533,7 @@ var cn, Eo;
|
|
|
4533
4533
|
function Xf() {
|
|
4534
4534
|
if (Eo) return cn;
|
|
4535
4535
|
Eo = 1;
|
|
4536
|
-
var l = nr(), e = /* @__PURE__ */ rr(), t = Yf(), n =
|
|
4536
|
+
var l = nr(), e = /* @__PURE__ */ rr(), t = Yf(), n = Fh();
|
|
4537
4537
|
return cn = function(r) {
|
|
4538
4538
|
if (r.length < 1 || typeof r[0] != "function")
|
|
4539
4539
|
throw new e("a function is required");
|
|
@@ -4587,7 +4587,7 @@ function d0() {
|
|
|
4587
4587
|
return dn = t.call(l, e), dn;
|
|
4588
4588
|
}
|
|
4589
4589
|
var ln, Ao;
|
|
4590
|
-
function
|
|
4590
|
+
function qh() {
|
|
4591
4591
|
if (Ao) return ln;
|
|
4592
4592
|
Ao = 1;
|
|
4593
4593
|
var l, e = /* @__PURE__ */ Mh(), t = /* @__PURE__ */ $d(), n = /* @__PURE__ */ Wd(), u = /* @__PURE__ */ Yd(), r = /* @__PURE__ */ Jd(), s = /* @__PURE__ */ Th(), a = /* @__PURE__ */ rr(), o = /* @__PURE__ */ Xd(), f = /* @__PURE__ */ Qd(), i = /* @__PURE__ */ Zd(), c = /* @__PURE__ */ e0(), h = /* @__PURE__ */ t0(), d = /* @__PURE__ */ r0(), b = /* @__PURE__ */ i0(), p = /* @__PURE__ */ a0(), y = Function, v = function(Y) {
|
|
@@ -4767,26 +4767,26 @@ function Fh() {
|
|
|
4767
4767
|
"%URIErrorPrototype%": ["URIError", "prototype"],
|
|
4768
4768
|
"%WeakMapPrototype%": ["WeakMap", "prototype"],
|
|
4769
4769
|
"%WeakSetPrototype%": ["WeakSet", "prototype"]
|
|
4770
|
-
}, A = nr(),
|
|
4771
|
-
var D =
|
|
4770
|
+
}, A = nr(), F = /* @__PURE__ */ d0(), K = A.call(ne, Array.prototype.concat), L = A.call(te, Array.prototype.splice), _ = A.call(ne, String.prototype.replace), U = A.call(ne, String.prototype.slice), fe = A.call(ne, RegExp.prototype.exec), se = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, V = /\\(\\)?/g, P = function(Q) {
|
|
4771
|
+
var D = U(Q, 0, 1), T = U(Q, -1);
|
|
4772
4772
|
if (D === "%" && T !== "%")
|
|
4773
4773
|
throw new s("invalid intrinsic syntax, expected closing `%`");
|
|
4774
4774
|
if (T === "%" && D !== "%")
|
|
4775
4775
|
throw new s("invalid intrinsic syntax, expected opening `%`");
|
|
4776
4776
|
var J = [];
|
|
4777
|
-
return _(Q, se, function(
|
|
4778
|
-
J[J.length] = oe ? _(ce, V, "$1") : ue ||
|
|
4777
|
+
return _(Q, se, function(ie, ue, oe, ce) {
|
|
4778
|
+
J[J.length] = oe ? _(ce, V, "$1") : ue || ie;
|
|
4779
4779
|
}), J;
|
|
4780
4780
|
}, M = function(Q, D) {
|
|
4781
4781
|
var T = Q, J;
|
|
4782
|
-
if (
|
|
4783
|
-
var
|
|
4784
|
-
if (
|
|
4782
|
+
if (F(R, T) && (J = R[T], T = "%" + J[0] + "%"), F(m, T)) {
|
|
4783
|
+
var ie = m[T];
|
|
4784
|
+
if (ie === $ && (ie = O(T)), typeof ie > "u" && !D)
|
|
4785
4785
|
throw new a("intrinsic " + Q + " exists, but is not available. Please file an issue!");
|
|
4786
4786
|
return {
|
|
4787
4787
|
alias: J,
|
|
4788
4788
|
name: T,
|
|
4789
|
-
value:
|
|
4789
|
+
value: ie
|
|
4790
4790
|
};
|
|
4791
4791
|
}
|
|
4792
4792
|
throw new s("intrinsic " + Q + " does not exist!");
|
|
@@ -4798,13 +4798,13 @@ function Fh() {
|
|
|
4798
4798
|
throw new a('"allowMissing" argument must be a boolean');
|
|
4799
4799
|
if (fe(/^%?[^%]*%?$/, Q) === null)
|
|
4800
4800
|
throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
|
|
4801
|
-
var T = P(Q), J = T.length > 0 ? T[0] : "",
|
|
4801
|
+
var T = P(Q), J = T.length > 0 ? T[0] : "", ie = M("%" + J + "%", D), ue = ie.name, oe = ie.value, ce = !1, ge = ie.alias;
|
|
4802
4802
|
ge && (J = ge[0], L(T, K([0, 1], ge)));
|
|
4803
4803
|
for (var Ke = 1, Se = !0; Ke < T.length; Ke += 1) {
|
|
4804
|
-
var de = T[Ke], Be =
|
|
4804
|
+
var de = T[Ke], Be = U(de, 0, 1), ve = U(de, -1);
|
|
4805
4805
|
if ((Be === '"' || Be === "'" || Be === "`" || ve === '"' || ve === "'" || ve === "`") && Be !== ve)
|
|
4806
4806
|
throw new s("property names with quotes must have matching quotes");
|
|
4807
|
-
if ((de === "constructor" || !Se) && (ce = !0), J += "." + de, ue = "%" + J + "%",
|
|
4807
|
+
if ((de === "constructor" || !Se) && (ce = !0), J += "." + de, ue = "%" + J + "%", F(m, ue))
|
|
4808
4808
|
oe = m[ue];
|
|
4809
4809
|
else if (oe != null) {
|
|
4810
4810
|
if (!(de in oe)) {
|
|
@@ -4816,7 +4816,7 @@ function Fh() {
|
|
|
4816
4816
|
var me = g(oe, de);
|
|
4817
4817
|
Se = !!me, Se && "get" in me && !("originalValue" in me.get) ? oe = me.get : oe = oe[de];
|
|
4818
4818
|
} else
|
|
4819
|
-
Se =
|
|
4819
|
+
Se = F(oe, de), oe = oe[de];
|
|
4820
4820
|
Se && !ce && (m[ue] = oe);
|
|
4821
4821
|
}
|
|
4822
4822
|
}
|
|
@@ -4827,7 +4827,7 @@ var bn, Oo;
|
|
|
4827
4827
|
function Uh() {
|
|
4828
4828
|
if (Oo) return bn;
|
|
4829
4829
|
Oo = 1;
|
|
4830
|
-
var l = /* @__PURE__ */
|
|
4830
|
+
var l = /* @__PURE__ */ qh(), e = Xf(), t = e([l("%String.prototype.indexOf%")]);
|
|
4831
4831
|
return bn = function(u, r) {
|
|
4832
4832
|
var s = (
|
|
4833
4833
|
/** @type {Parameters<typeof callBindBasic>[0][0]} */
|
|
@@ -5010,7 +5010,7 @@ var Sn, Lo;
|
|
|
5010
5010
|
function g0() {
|
|
5011
5011
|
if (Lo) return Sn;
|
|
5012
5012
|
Lo = 1;
|
|
5013
|
-
var l = /* @__PURE__ */
|
|
5013
|
+
var l = /* @__PURE__ */ qh(), e = /* @__PURE__ */ m0(), t = /* @__PURE__ */ y0()(), n = /* @__PURE__ */ ir(), u = /* @__PURE__ */ rr(), r = l("%Math.floor%");
|
|
5014
5014
|
return Sn = function(a, o) {
|
|
5015
5015
|
if (typeof a != "function")
|
|
5016
5016
|
throw new u("`fn` is not a function");
|
|
@@ -5040,14 +5040,14 @@ var xn, Do;
|
|
|
5040
5040
|
function w0() {
|
|
5041
5041
|
if (Do) return xn;
|
|
5042
5042
|
Do = 1;
|
|
5043
|
-
var l = nr(), e = Jf(), t =
|
|
5043
|
+
var l = nr(), e = Jf(), t = Fh();
|
|
5044
5044
|
return xn = function() {
|
|
5045
5045
|
return t(l, e, arguments);
|
|
5046
5046
|
}, xn;
|
|
5047
5047
|
}
|
|
5048
|
-
var
|
|
5048
|
+
var Fo;
|
|
5049
5049
|
function _0() {
|
|
5050
|
-
return
|
|
5050
|
+
return Fo || (Fo = 1, (function(l) {
|
|
5051
5051
|
var e = /* @__PURE__ */ g0(), t = /* @__PURE__ */ Mr(), n = Xf(), u = w0();
|
|
5052
5052
|
l.exports = function(s) {
|
|
5053
5053
|
var a = n(arguments), o = s.length - (arguments.length - 1);
|
|
@@ -5059,10 +5059,10 @@ function _0() {
|
|
|
5059
5059
|
}, t ? t(l.exports, "apply", { value: u }) : l.exports.apply = u;
|
|
5060
5060
|
})(gn)), gn.exports;
|
|
5061
5061
|
}
|
|
5062
|
-
var En,
|
|
5062
|
+
var En, qo;
|
|
5063
5063
|
function S0() {
|
|
5064
|
-
if (
|
|
5065
|
-
|
|
5064
|
+
if (qo) return En;
|
|
5065
|
+
qo = 1;
|
|
5066
5066
|
var l = Ch();
|
|
5067
5067
|
return En = function() {
|
|
5068
5068
|
return l() && !!Symbol.toStringTag;
|
|
@@ -5452,19 +5452,19 @@ function jh() {
|
|
|
5452
5452
|
}
|
|
5453
5453
|
function d(R, A) {
|
|
5454
5454
|
n = n || Ht(), R = R || {};
|
|
5455
|
-
var
|
|
5456
|
-
this.objectMode = !!R.objectMode,
|
|
5455
|
+
var F = A instanceof n;
|
|
5456
|
+
this.objectMode = !!R.objectMode, F && (this.objectMode = this.objectMode || !!R.writableObjectMode);
|
|
5457
5457
|
var K = R.highWaterMark, L = R.writableHighWaterMark, _ = this.objectMode ? 16 : 16 * 1024;
|
|
5458
|
-
K || K === 0 ? this.highWaterMark = K :
|
|
5459
|
-
var
|
|
5460
|
-
this.decodeStrings = !
|
|
5458
|
+
K || K === 0 ? this.highWaterMark = K : F && (L || L === 0) ? this.highWaterMark = L : this.highWaterMark = _, this.highWaterMark = Math.floor(this.highWaterMark), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1;
|
|
5459
|
+
var U = R.decodeStrings === !1;
|
|
5460
|
+
this.decodeStrings = !U, this.defaultEncoding = R.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function(fe) {
|
|
5461
5461
|
j(A, fe);
|
|
5462
5462
|
}, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.bufferedRequestCount = 0, this.corkedRequestsFree = new e(this);
|
|
5463
5463
|
}
|
|
5464
5464
|
d.prototype.getBuffer = function() {
|
|
5465
|
-
for (var A = this.bufferedRequest,
|
|
5466
|
-
|
|
5467
|
-
return
|
|
5465
|
+
for (var A = this.bufferedRequest, F = []; A; )
|
|
5466
|
+
F.push(A), A = A.next;
|
|
5467
|
+
return F;
|
|
5468
5468
|
}, (function() {
|
|
5469
5469
|
try {
|
|
5470
5470
|
Object.defineProperty(d.prototype, "buffer", {
|
|
@@ -5492,16 +5492,16 @@ function jh() {
|
|
|
5492
5492
|
this.emit("error", new Error("Cannot pipe, not readable"));
|
|
5493
5493
|
};
|
|
5494
5494
|
function y(R, A) {
|
|
5495
|
-
var
|
|
5496
|
-
R.emit("error",
|
|
5495
|
+
var F = new Error("write after end");
|
|
5496
|
+
R.emit("error", F), l.nextTick(A, F);
|
|
5497
5497
|
}
|
|
5498
|
-
function v(R, A,
|
|
5498
|
+
function v(R, A, F, K) {
|
|
5499
5499
|
var L = !0, _ = !1;
|
|
5500
|
-
return
|
|
5500
|
+
return F === null ? _ = new TypeError("May not write null values to stream") : typeof F != "string" && F !== void 0 && !A.objectMode && (_ = new TypeError("Invalid non-string/buffer chunk")), _ && (R.emit("error", _), l.nextTick(K, _), L = !1), L;
|
|
5501
5501
|
}
|
|
5502
|
-
p.prototype.write = function(R, A,
|
|
5502
|
+
p.prototype.write = function(R, A, F) {
|
|
5503
5503
|
var K = this._writableState, L = !1, _ = !K.objectMode && i(R);
|
|
5504
|
-
return _ && !a.isBuffer(R) && (R = f(R)), typeof A == "function" && (
|
|
5504
|
+
return _ && !a.isBuffer(R) && (R = f(R)), typeof A == "function" && (F = A, A = null), _ ? A = "buffer" : A || (A = K.defaultEncoding), typeof F != "function" && (F = h), K.ended ? y(this, F) : (_ || v(this, K, R, F)) && (K.pendingcb++, L = x(this, K, _, R, A, F)), L;
|
|
5505
5505
|
}, p.prototype.cork = function() {
|
|
5506
5506
|
var R = this._writableState;
|
|
5507
5507
|
R.corked++;
|
|
@@ -5512,8 +5512,8 @@ function jh() {
|
|
|
5512
5512
|
if (typeof A == "string" && (A = A.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((A + "").toLowerCase()) > -1)) throw new TypeError("Unknown encoding: " + A);
|
|
5513
5513
|
return this._writableState.defaultEncoding = A, this;
|
|
5514
5514
|
};
|
|
5515
|
-
function g(R, A,
|
|
5516
|
-
return !R.objectMode && R.decodeStrings !== !1 && typeof A == "string" && (A = a.from(A,
|
|
5515
|
+
function g(R, A, F) {
|
|
5516
|
+
return !R.objectMode && R.decodeStrings !== !1 && typeof A == "string" && (A = a.from(A, F)), A;
|
|
5517
5517
|
}
|
|
5518
5518
|
Object.defineProperty(p.prototype, "writableHighWaterMark", {
|
|
5519
5519
|
// making it explicit this property is not enumerable
|
|
@@ -5524,10 +5524,10 @@ function jh() {
|
|
|
5524
5524
|
return this._writableState.highWaterMark;
|
|
5525
5525
|
}
|
|
5526
5526
|
});
|
|
5527
|
-
function x(R, A,
|
|
5528
|
-
if (!
|
|
5529
|
-
var
|
|
5530
|
-
K !==
|
|
5527
|
+
function x(R, A, F, K, L, _) {
|
|
5528
|
+
if (!F) {
|
|
5529
|
+
var U = g(A, K, L);
|
|
5530
|
+
K !== U && (F = !0, L = "buffer", K = U);
|
|
5531
5531
|
}
|
|
5532
5532
|
var fe = A.objectMode ? 1 : K.length;
|
|
5533
5533
|
A.length += fe;
|
|
@@ -5537,7 +5537,7 @@ function jh() {
|
|
|
5537
5537
|
A.lastBufferedRequest = {
|
|
5538
5538
|
chunk: K,
|
|
5539
5539
|
encoding: L,
|
|
5540
|
-
isBuf:
|
|
5540
|
+
isBuf: F,
|
|
5541
5541
|
callback: _,
|
|
5542
5542
|
next: null
|
|
5543
5543
|
}, V ? V.next = A.lastBufferedRequest : A.bufferedRequest = A.lastBufferedRequest, A.bufferedRequestCount += 1;
|
|
@@ -5545,77 +5545,77 @@ function jh() {
|
|
|
5545
5545
|
B(R, A, !1, fe, K, L, _);
|
|
5546
5546
|
return se;
|
|
5547
5547
|
}
|
|
5548
|
-
function B(R, A,
|
|
5549
|
-
A.writelen = K, A.writecb =
|
|
5548
|
+
function B(R, A, F, K, L, _, U) {
|
|
5549
|
+
A.writelen = K, A.writecb = U, A.writing = !0, A.sync = !0, F ? R._writev(L, A.onwrite) : R._write(L, _, A.onwrite), A.sync = !1;
|
|
5550
5550
|
}
|
|
5551
|
-
function I(R, A,
|
|
5552
|
-
--A.pendingcb,
|
|
5551
|
+
function I(R, A, F, K, L) {
|
|
5552
|
+
--A.pendingcb, F ? (l.nextTick(L, K), l.nextTick(m, R, A), R._writableState.errorEmitted = !0, R.emit("error", K)) : (L(K), R._writableState.errorEmitted = !0, R.emit("error", K), m(R, A));
|
|
5553
5553
|
}
|
|
5554
5554
|
function C(R) {
|
|
5555
5555
|
R.writing = !1, R.writecb = null, R.length -= R.writelen, R.writelen = 0;
|
|
5556
5556
|
}
|
|
5557
5557
|
function j(R, A) {
|
|
5558
|
-
var
|
|
5559
|
-
if (C(
|
|
5558
|
+
var F = R._writableState, K = F.sync, L = F.writecb;
|
|
5559
|
+
if (C(F), A) I(R, F, K, A, L);
|
|
5560
5560
|
else {
|
|
5561
|
-
var _ = ne(
|
|
5562
|
-
!_ && !
|
|
5561
|
+
var _ = ne(F);
|
|
5562
|
+
!_ && !F.corked && !F.bufferProcessing && F.bufferedRequest && te(R, F), K ? t(G, R, F, _, L) : G(R, F, _, L);
|
|
5563
5563
|
}
|
|
5564
5564
|
}
|
|
5565
|
-
function G(R, A,
|
|
5566
|
-
|
|
5565
|
+
function G(R, A, F, K) {
|
|
5566
|
+
F || z(R, A), A.pendingcb--, K(), m(R, A);
|
|
5567
5567
|
}
|
|
5568
5568
|
function z(R, A) {
|
|
5569
5569
|
A.length === 0 && A.needDrain && (A.needDrain = !1, R.emit("drain"));
|
|
5570
5570
|
}
|
|
5571
5571
|
function te(R, A) {
|
|
5572
5572
|
A.bufferProcessing = !0;
|
|
5573
|
-
var
|
|
5574
|
-
if (R._writev &&
|
|
5573
|
+
var F = A.bufferedRequest;
|
|
5574
|
+
if (R._writev && F && F.next) {
|
|
5575
5575
|
var K = A.bufferedRequestCount, L = new Array(K), _ = A.corkedRequestsFree;
|
|
5576
|
-
_.entry =
|
|
5577
|
-
for (var
|
|
5578
|
-
L[
|
|
5576
|
+
_.entry = F;
|
|
5577
|
+
for (var U = 0, fe = !0; F; )
|
|
5578
|
+
L[U] = F, F.isBuf || (fe = !1), F = F.next, U += 1;
|
|
5579
5579
|
L.allBuffers = fe, B(R, A, !0, A.length, L, "", _.finish), A.pendingcb++, A.lastBufferedRequest = null, _.next ? (A.corkedRequestsFree = _.next, _.next = null) : A.corkedRequestsFree = new e(A), A.bufferedRequestCount = 0;
|
|
5580
5580
|
} else {
|
|
5581
|
-
for (;
|
|
5582
|
-
var se =
|
|
5583
|
-
if (B(R, A, !1, M, se, V, P),
|
|
5581
|
+
for (; F; ) {
|
|
5582
|
+
var se = F.chunk, V = F.encoding, P = F.callback, M = A.objectMode ? 1 : se.length;
|
|
5583
|
+
if (B(R, A, !1, M, se, V, P), F = F.next, A.bufferedRequestCount--, A.writing)
|
|
5584
5584
|
break;
|
|
5585
5585
|
}
|
|
5586
|
-
|
|
5586
|
+
F === null && (A.lastBufferedRequest = null);
|
|
5587
5587
|
}
|
|
5588
|
-
A.bufferedRequest =
|
|
5588
|
+
A.bufferedRequest = F, A.bufferProcessing = !1;
|
|
5589
5589
|
}
|
|
5590
|
-
p.prototype._write = function(R, A,
|
|
5591
|
-
|
|
5592
|
-
}, p.prototype._writev = null, p.prototype.end = function(R, A,
|
|
5590
|
+
p.prototype._write = function(R, A, F) {
|
|
5591
|
+
F(new Error("_write() is not implemented"));
|
|
5592
|
+
}, p.prototype._writev = null, p.prototype.end = function(R, A, F) {
|
|
5593
5593
|
var K = this._writableState;
|
|
5594
|
-
typeof R == "function" ? (
|
|
5594
|
+
typeof R == "function" ? (F = R, R = null, A = null) : typeof A == "function" && (F = A, A = null), R != null && this.write(R, A), K.corked && (K.corked = 1, this.uncork()), K.ending || E(this, K, F);
|
|
5595
5595
|
};
|
|
5596
5596
|
function ne(R) {
|
|
5597
5597
|
return R.ending && R.length === 0 && R.bufferedRequest === null && !R.finished && !R.writing;
|
|
5598
5598
|
}
|
|
5599
5599
|
function $(R, A) {
|
|
5600
|
-
R._final(function(
|
|
5601
|
-
A.pendingcb--,
|
|
5600
|
+
R._final(function(F) {
|
|
5601
|
+
A.pendingcb--, F && R.emit("error", F), A.prefinished = !0, R.emit("prefinish"), m(R, A);
|
|
5602
5602
|
});
|
|
5603
5603
|
}
|
|
5604
5604
|
function k(R, A) {
|
|
5605
5605
|
!A.prefinished && !A.finalCalled && (typeof R._final == "function" ? (A.pendingcb++, A.finalCalled = !0, l.nextTick($, R, A)) : (A.prefinished = !0, R.emit("prefinish")));
|
|
5606
5606
|
}
|
|
5607
5607
|
function m(R, A) {
|
|
5608
|
-
var
|
|
5609
|
-
return
|
|
5608
|
+
var F = ne(A);
|
|
5609
|
+
return F && (k(R, A), A.pendingcb === 0 && (A.finished = !0, R.emit("finish"))), F;
|
|
5610
5610
|
}
|
|
5611
|
-
function E(R, A,
|
|
5612
|
-
A.ending = !0, m(R, A),
|
|
5611
|
+
function E(R, A, F) {
|
|
5612
|
+
A.ending = !0, m(R, A), F && (A.finished ? l.nextTick(F) : R.once("finish", F)), A.ended = !0, R.writable = !1;
|
|
5613
5613
|
}
|
|
5614
|
-
function O(R, A,
|
|
5614
|
+
function O(R, A, F) {
|
|
5615
5615
|
var K = R.entry;
|
|
5616
5616
|
for (R.entry = null; K; ) {
|
|
5617
5617
|
var L = K.callback;
|
|
5618
|
-
A.pendingcb--, L(
|
|
5618
|
+
A.pendingcb--, L(F), K = K.next;
|
|
5619
5619
|
}
|
|
5620
5620
|
A.corkedRequestsFree.next = R;
|
|
5621
5621
|
}
|
|
@@ -5951,7 +5951,7 @@ function zh() {
|
|
|
5951
5951
|
M.needReadable = !1, M.emittedReadable || (c("emitReadable", M.flowing), M.emittedReadable = !0, M.sync ? l.nextTick($, P) : $(P));
|
|
5952
5952
|
}
|
|
5953
5953
|
function $(P) {
|
|
5954
|
-
c("emit readable"), P.emit("readable"),
|
|
5954
|
+
c("emit readable"), P.emit("readable"), F(P);
|
|
5955
5955
|
}
|
|
5956
5956
|
function k(P, M) {
|
|
5957
5957
|
M.readingMore || (M.readingMore = !0, l.nextTick(m, P, M));
|
|
@@ -5977,19 +5977,19 @@ function zh() {
|
|
|
5977
5977
|
break;
|
|
5978
5978
|
}
|
|
5979
5979
|
Q.pipesCount += 1, c("pipe count=%d opts=%j", Q.pipesCount, M);
|
|
5980
|
-
var D = (!M || M.end !== !1) && P !== process.stdout && P !== process.stderr, T = D ?
|
|
5980
|
+
var D = (!M || M.end !== !1) && P !== process.stdout && P !== process.stderr, T = D ? ie : ve;
|
|
5981
5981
|
Q.endEmitted ? l.nextTick(T) : Y.once("end", T), P.on("unpipe", J);
|
|
5982
5982
|
function J(me, Le) {
|
|
5983
5983
|
c("onunpipe"), me === Y && Le && Le.hasUnpiped === !1 && (Le.hasUnpiped = !0, ce());
|
|
5984
5984
|
}
|
|
5985
|
-
function
|
|
5985
|
+
function ie() {
|
|
5986
5986
|
c("onend"), P.end();
|
|
5987
5987
|
}
|
|
5988
5988
|
var ue = E(Y);
|
|
5989
5989
|
P.on("drain", ue);
|
|
5990
5990
|
var oe = !1;
|
|
5991
5991
|
function ce() {
|
|
5992
|
-
c("cleanup"), P.removeListener("close", de), P.removeListener("finish", Be), P.removeListener("drain", ue), P.removeListener("error", Se), P.removeListener("unpipe", J), Y.removeListener("end",
|
|
5992
|
+
c("cleanup"), P.removeListener("close", de), P.removeListener("finish", Be), P.removeListener("drain", ue), P.removeListener("error", Se), P.removeListener("unpipe", J), Y.removeListener("end", ie), Y.removeListener("end", ve), Y.removeListener("data", Ke), oe = !0, Q.awaitDrain && (!P._writableState || P._writableState.needDrain) && ue();
|
|
5993
5993
|
}
|
|
5994
5994
|
var ge = !1;
|
|
5995
5995
|
Y.on("data", Ke);
|
|
@@ -6018,7 +6018,7 @@ function zh() {
|
|
|
6018
6018
|
function E(P) {
|
|
6019
6019
|
return function() {
|
|
6020
6020
|
var M = P._readableState;
|
|
6021
|
-
c("pipeOnDrain", M.awaitDrain), M.awaitDrain && M.awaitDrain--, M.awaitDrain === 0 && n(P, "data") && (M.flowing = !0,
|
|
6021
|
+
c("pipeOnDrain", M.awaitDrain), M.awaitDrain && M.awaitDrain--, M.awaitDrain === 0 && n(P, "data") && (M.flowing = !0, F(P));
|
|
6022
6022
|
};
|
|
6023
6023
|
}
|
|
6024
6024
|
g.prototype.unpipe = function(P) {
|
|
@@ -6056,12 +6056,12 @@ function zh() {
|
|
|
6056
6056
|
M.resumeScheduled || (M.resumeScheduled = !0, l.nextTick(A, P, M));
|
|
6057
6057
|
}
|
|
6058
6058
|
function A(P, M) {
|
|
6059
|
-
M.reading || (c("resume read 0"), P.read(0)), M.resumeScheduled = !1, M.awaitDrain = 0, P.emit("resume"),
|
|
6059
|
+
M.reading || (c("resume read 0"), P.read(0)), M.resumeScheduled = !1, M.awaitDrain = 0, P.emit("resume"), F(P), M.flowing && !M.reading && P.read(0);
|
|
6060
6060
|
}
|
|
6061
6061
|
g.prototype.pause = function() {
|
|
6062
6062
|
return c("call pause flowing=%j", this._readableState.flowing), this._readableState.flowing !== !1 && (c("pause"), this._readableState.flowing = !1, this.emit("pause")), this;
|
|
6063
6063
|
};
|
|
6064
|
-
function
|
|
6064
|
+
function F(P) {
|
|
6065
6065
|
var M = P._readableState;
|
|
6066
6066
|
for (c("flow", M.flowing); M.flowing && P.read() !== null; )
|
|
6067
6067
|
;
|
|
@@ -6076,8 +6076,8 @@ function zh() {
|
|
|
6076
6076
|
M.push(null);
|
|
6077
6077
|
}), P.on("data", function(J) {
|
|
6078
6078
|
if (c("wrapped data"), Y.decoder && (J = Y.decoder.write(J)), !(Y.objectMode && J == null) && !(!Y.objectMode && (!J || !J.length))) {
|
|
6079
|
-
var
|
|
6080
|
-
|
|
6079
|
+
var ie = M.push(J);
|
|
6080
|
+
ie || (Q = !0, P.pause());
|
|
6081
6081
|
}
|
|
6082
6082
|
});
|
|
6083
6083
|
for (var D in P)
|
|
@@ -6107,7 +6107,7 @@ function zh() {
|
|
|
6107
6107
|
}
|
|
6108
6108
|
function L(P, M, Y) {
|
|
6109
6109
|
var Q;
|
|
6110
|
-
return P < M.head.data.length ? (Q = M.head.data.slice(0, P), M.head.data = M.head.data.slice(P)) : P === M.head.data.length ? Q = M.shift() : Q = Y ? _(P, M) :
|
|
6110
|
+
return P < M.head.data.length ? (Q = M.head.data.slice(0, P), M.head.data = M.head.data.slice(P)) : P === M.head.data.length ? Q = M.shift() : Q = Y ? _(P, M) : U(P, M), Q;
|
|
6111
6111
|
}
|
|
6112
6112
|
function _(P, M) {
|
|
6113
6113
|
var Y = M.head, Q = 1, D = Y.data;
|
|
@@ -6121,7 +6121,7 @@ function zh() {
|
|
|
6121
6121
|
}
|
|
6122
6122
|
return M.length -= Q, D;
|
|
6123
6123
|
}
|
|
6124
|
-
function
|
|
6124
|
+
function U(P, M) {
|
|
6125
6125
|
var Y = r.allocUnsafe(P), Q = M.head, D = 1;
|
|
6126
6126
|
for (Q.data.copy(Y), P -= Q.data.length; Q = Q.next; ) {
|
|
6127
6127
|
var T = Q.data, J = P > T.length ? T.length : P;
|
|
@@ -6148,10 +6148,10 @@ function zh() {
|
|
|
6148
6148
|
}
|
|
6149
6149
|
return Dn;
|
|
6150
6150
|
}
|
|
6151
|
-
var
|
|
6151
|
+
var Fn, ic;
|
|
6152
6152
|
function Vh() {
|
|
6153
|
-
if (ic) return
|
|
6154
|
-
ic = 1,
|
|
6153
|
+
if (ic) return Fn;
|
|
6154
|
+
ic = 1, Fn = n;
|
|
6155
6155
|
var l = Ht(), e = Object.create(ar());
|
|
6156
6156
|
e.inherits = pe(), e.inherits(n, l);
|
|
6157
6157
|
function t(s, a) {
|
|
@@ -6206,12 +6206,12 @@ function Vh() {
|
|
|
6206
6206
|
if (s._transformState.transforming) throw new Error("Calling transform done when still transforming");
|
|
6207
6207
|
return s.push(null);
|
|
6208
6208
|
}
|
|
6209
|
-
return
|
|
6209
|
+
return Fn;
|
|
6210
6210
|
}
|
|
6211
|
-
var
|
|
6211
|
+
var qn, nc;
|
|
6212
6212
|
function O0() {
|
|
6213
|
-
if (nc) return
|
|
6214
|
-
nc = 1,
|
|
6213
|
+
if (nc) return qn;
|
|
6214
|
+
nc = 1, qn = t;
|
|
6215
6215
|
var l = Vh(), e = Object.create(ar());
|
|
6216
6216
|
e.inherits = pe(), e.inherits(t, l);
|
|
6217
6217
|
function t(n) {
|
|
@@ -6220,7 +6220,7 @@ function O0() {
|
|
|
6220
6220
|
}
|
|
6221
6221
|
return t.prototype._transform = function(n, u, r) {
|
|
6222
6222
|
r(null, n);
|
|
6223
|
-
},
|
|
6223
|
+
}, qn;
|
|
6224
6224
|
}
|
|
6225
6225
|
var ac;
|
|
6226
6226
|
function Gh() {
|
|
@@ -7088,16 +7088,16 @@ function Wh() {
|
|
|
7088
7088
|
for (var y = this._w, v = this._ah | 0, g = this._bh | 0, x = this._ch | 0, B = this._dh | 0, I = this._eh | 0, C = this._fh | 0, j = this._gh | 0, G = this._hh | 0, z = this._al | 0, te = this._bl | 0, ne = this._cl | 0, $ = this._dl | 0, k = this._el | 0, m = this._fl | 0, E = this._gl | 0, O = this._hl | 0, R = 0; R < 32; R += 2)
|
|
7089
7089
|
y[R] = p.readInt32BE(R * 4), y[R + 1] = p.readInt32BE(R * 4 + 4);
|
|
7090
7090
|
for (; R < 160; R += 2) {
|
|
7091
|
-
var A = y[R - 30],
|
|
7092
|
-
A = y[R - 4],
|
|
7093
|
-
var _ = h(A,
|
|
7094
|
-
M = M +
|
|
7091
|
+
var A = y[R - 30], F = y[R - 30 + 1], K = i(A, F), L = c(F, A);
|
|
7092
|
+
A = y[R - 4], F = y[R - 4 + 1];
|
|
7093
|
+
var _ = h(A, F), U = d(F, A), fe = y[R - 14], se = y[R - 14 + 1], V = y[R - 32], P = y[R - 32 + 1], M = L + se | 0, Y = K + fe + b(M, L) | 0;
|
|
7094
|
+
M = M + U | 0, Y = Y + _ + b(M, U) | 0, M = M + P | 0, Y = Y + V + b(M, P) | 0, y[R] = Y, y[R + 1] = M;
|
|
7095
7095
|
}
|
|
7096
7096
|
for (var Q = 0; Q < 160; Q += 2) {
|
|
7097
7097
|
Y = y[Q], M = y[Q + 1];
|
|
7098
|
-
var D = a(v, g, x), T = a(z, te, ne), J = o(v, z),
|
|
7098
|
+
var D = a(v, g, x), T = a(z, te, ne), J = o(v, z), ie = o(z, v), ue = f(I, k), oe = f(k, I), ce = n[Q], ge = n[Q + 1], Ke = s(I, C, j), Se = s(k, m, E), de = O + oe | 0, Be = G + ue + b(de, O) | 0;
|
|
7099
7099
|
de = de + Se | 0, Be = Be + Ke + b(de, Se) | 0, de = de + ge | 0, Be = Be + ce + b(de, ge) | 0, de = de + M | 0, Be = Be + Y + b(de, M) | 0;
|
|
7100
|
-
var ve =
|
|
7100
|
+
var ve = ie + T | 0, me = J + D + b(ve, ie) | 0;
|
|
7101
7101
|
G = j, O = E, j = C, E = m, C = I, m = k, k = $ + de | 0, I = B + Be + b(k, $) | 0, B = x, $ = ne, x = g, ne = te, g = v, te = z, z = de + ve | 0, v = Be + me + b(z, de) | 0;
|
|
7102
7102
|
}
|
|
7103
7103
|
this._al = this._al + z | 0, this._bl = this._bl + te | 0, this._cl = this._cl + ne | 0, this._dl = this._dl + $ | 0, this._el = this._el + k | 0, this._fl = this._fl + m | 0, this._gl = this._gl + E | 0, this._hl = this._hl + O | 0, this._ah = this._ah + v + b(this._al, z) | 0, this._bh = this._bh + g + b(this._bl, te) | 0, this._ch = this._ch + x + b(this._cl, ne) | 0, this._dh = this._dh + B + b(this._dl, $) | 0, this._eh = this._eh + I + b(this._el, k) | 0, this._fh = this._fh + C + b(this._fl, m) | 0, this._gh = this._gh + j + b(this._gl, E) | 0, this._hh = this._hh + G + b(this._hl, O) | 0;
|
|
@@ -7142,7 +7142,7 @@ var Jn, vc;
|
|
|
7142
7142
|
function Ot() {
|
|
7143
7143
|
if (vc) return Jn;
|
|
7144
7144
|
vc = 1;
|
|
7145
|
-
var l = _e().Buffer, e = Nh().Transform, t =
|
|
7145
|
+
var l = _e().Buffer, e = Nh().Transform, t = Ff().StringDecoder, n = pe(), u = /* @__PURE__ */ Tr();
|
|
7146
7146
|
function r(s) {
|
|
7147
7147
|
e.call(this), this.hashMode = typeof s == "string", this.hashMode ? this[s] = this._finalOrDigest : this.final = this._finalOrDigest, this._final && (this.__final = this._final, this._final = null), this._decoder = null, this._encoding = null;
|
|
7148
7148
|
}
|
|
@@ -7251,14 +7251,14 @@ function Jh() {
|
|
|
7251
7251
|
return i = i.toLowerCase(), i === "rmd160" || i === "ripemd160" ? new o("rmd160", c) : i === "md5" ? new e(u, c) : new o(i, c);
|
|
7252
7252
|
}, ea;
|
|
7253
7253
|
}
|
|
7254
|
-
const L0 = { sign: "rsa", hash: "sha224", id: "302d300d06096086480165030402040500041c" }, D0 = { sign: "rsa", hash: "sha256", id: "3031300d060960864801650304020105000420" },
|
|
7254
|
+
const L0 = { sign: "rsa", hash: "sha224", id: "302d300d06096086480165030402040500041c" }, D0 = { sign: "rsa", hash: "sha256", id: "3031300d060960864801650304020105000420" }, F0 = { sign: "rsa", hash: "sha384", id: "3041300d060960864801650304020205000430" }, q0 = { sign: "rsa", hash: "sha512", id: "3051300d060960864801650304020305000440" }, U0 = { sign: "ecdsa", hash: "sha256", id: "" }, H0 = { sign: "ecdsa", hash: "sha224", id: "" }, K0 = { sign: "ecdsa", hash: "sha384", id: "" }, j0 = { sign: "ecdsa", hash: "sha512", id: "" }, z0 = { sign: "dsa", hash: "sha1", id: "" }, V0 = { sign: "rsa", hash: "rmd160", id: "3021300906052b2403020105000414" }, G0 = { sign: "rsa", hash: "md5", id: "3020300c06082a864886f70d020505000410" }, Xh = {
|
|
7255
7255
|
sha224WithRSAEncryption: L0,
|
|
7256
7256
|
"RSA-SHA224": { sign: "ecdsa/rsa", hash: "sha224", id: "302d300d06096086480165030402040500041c" },
|
|
7257
7257
|
sha256WithRSAEncryption: D0,
|
|
7258
7258
|
"RSA-SHA256": { sign: "ecdsa/rsa", hash: "sha256", id: "3031300d060960864801650304020105000420" },
|
|
7259
|
-
sha384WithRSAEncryption:
|
|
7259
|
+
sha384WithRSAEncryption: F0,
|
|
7260
7260
|
"RSA-SHA384": { sign: "ecdsa/rsa", hash: "sha384", id: "3041300d060960864801650304020205000430" },
|
|
7261
|
-
sha512WithRSAEncryption:
|
|
7261
|
+
sha512WithRSAEncryption: q0,
|
|
7262
7262
|
"RSA-SHA512": { sign: "ecdsa/rsa", hash: "sha512", id: "3051300d060960864801650304020305000440" },
|
|
7263
7263
|
"RSA-SHA1": { sign: "rsa", hash: "sha1", id: "3021300906052b0e03021a05000414" },
|
|
7264
7264
|
"ecdsa-with-SHA1": { sign: "ecdsa", hash: "sha1", id: "" },
|
|
@@ -8438,10 +8438,10 @@ function el() {
|
|
|
8438
8438
|
return l(u, n);
|
|
8439
8439
|
}, Rr;
|
|
8440
8440
|
}
|
|
8441
|
-
var la = {},
|
|
8441
|
+
var la = {}, Fc;
|
|
8442
8442
|
function tl() {
|
|
8443
|
-
if (
|
|
8444
|
-
|
|
8443
|
+
if (Fc) return la;
|
|
8444
|
+
Fc = 1;
|
|
8445
8445
|
var l = _e().Buffer, e = sr();
|
|
8446
8446
|
function t(n, u, r) {
|
|
8447
8447
|
var s = u.length, a = e(u, n._cache);
|
|
@@ -8458,10 +8458,10 @@ function tl() {
|
|
|
8458
8458
|
return s;
|
|
8459
8459
|
}, la;
|
|
8460
8460
|
}
|
|
8461
|
-
var ba = {},
|
|
8461
|
+
var ba = {}, qc;
|
|
8462
8462
|
function rl() {
|
|
8463
|
-
if (
|
|
8464
|
-
|
|
8463
|
+
if (qc) return ba;
|
|
8464
|
+
qc = 1;
|
|
8465
8465
|
var l = _e().Buffer;
|
|
8466
8466
|
function e(t, n, u) {
|
|
8467
8467
|
var r = t._cipher.encryptBlock(t._prev), s = r[0] ^ n;
|
|
@@ -8772,7 +8772,7 @@ function sd() {
|
|
|
8772
8772
|
}, xa = u, xa;
|
|
8773
8773
|
}
|
|
8774
8774
|
var Ea, Jc;
|
|
8775
|
-
function
|
|
8775
|
+
function Fr() {
|
|
8776
8776
|
if (Jc) return Ea;
|
|
8777
8777
|
Jc = 1;
|
|
8778
8778
|
var l = _e().Buffer, e = Wf();
|
|
@@ -8800,7 +8800,7 @@ var Xc;
|
|
|
8800
8800
|
function cl() {
|
|
8801
8801
|
if (Xc) return Er;
|
|
8802
8802
|
Xc = 1;
|
|
8803
|
-
var l = rs(), e = fd(), t = _e().Buffer, n = sd(), u = Ot(), r = Dr(), s =
|
|
8803
|
+
var l = rs(), e = fd(), t = _e().Buffer, n = sd(), u = Ot(), r = Dr(), s = Fr(), a = pe();
|
|
8804
8804
|
function o(d, b, p) {
|
|
8805
8805
|
u.call(this), this._cache = new i(), this._cipher = new r.AES(b), this._prev = t.from(p), this._mode = d, this._autopadding = !0;
|
|
8806
8806
|
}
|
|
@@ -8855,7 +8855,7 @@ var Ir = {}, Qc;
|
|
|
8855
8855
|
function ul() {
|
|
8856
8856
|
if (Qc) return Ir;
|
|
8857
8857
|
Qc = 1;
|
|
8858
|
-
var l = fd(), e = _e().Buffer, t = rs(), n = sd(), u = Ot(), r = Dr(), s =
|
|
8858
|
+
var l = fd(), e = _e().Buffer, t = rs(), n = sd(), u = Ot(), r = Dr(), s = Fr(), a = pe();
|
|
8859
8859
|
function o(d, b, p) {
|
|
8860
8860
|
u.call(this), this._cache = new f(), this._last = void 0, this._cipher = new r.AES(b), this._prev = e.from(p), this._mode = d, this._autopadding = !0;
|
|
8861
8861
|
}
|
|
@@ -8952,7 +8952,7 @@ var tu;
|
|
|
8952
8952
|
function dl() {
|
|
8953
8953
|
if (tu) return bt;
|
|
8954
8954
|
tu = 1;
|
|
8955
|
-
var l = Q0(), e = is(), t = rs(), n = hl(), u =
|
|
8955
|
+
var l = Q0(), e = is(), t = rs(), n = hl(), u = Fr();
|
|
8956
8956
|
function r(i, c) {
|
|
8957
8957
|
i = i.toLowerCase();
|
|
8958
8958
|
var h, d;
|
|
@@ -9286,7 +9286,7 @@ function mt() {
|
|
|
9286
9286
|
})(ka)), ka;
|
|
9287
9287
|
}
|
|
9288
9288
|
var Na = {}, Ma, ou;
|
|
9289
|
-
function
|
|
9289
|
+
function qr() {
|
|
9290
9290
|
if (ou) return Ma;
|
|
9291
9291
|
ou = 1;
|
|
9292
9292
|
var l = Te(), e = mt(), t = e.getNAF, n = e.getJSF, u = e.assert;
|
|
@@ -9472,7 +9472,7 @@ var Ta, cu;
|
|
|
9472
9472
|
function Rl() {
|
|
9473
9473
|
if (cu) return Ta;
|
|
9474
9474
|
cu = 1;
|
|
9475
|
-
var l = mt(), e = Te(), t = pe(), n =
|
|
9475
|
+
var l = mt(), e = Te(), t = pe(), n = qr(), u = l.assert;
|
|
9476
9476
|
function r(o) {
|
|
9477
9477
|
n.call(this, "short", o), this.a = new e(o.a, 16).toRed(this.red), this.b = new e(o.b, 16).toRed(this.red), this.tinv = this.two.redInvm(), this.zeroA = this.a.fromRed().cmpn(0) === 0, this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0, this.endo = this._getEndomorphism(o), this._endoWnafT1 = new Array(4), this._endoWnafT2 = new Array(4);
|
|
9478
9478
|
}
|
|
@@ -9820,7 +9820,7 @@ var Ca, uu;
|
|
|
9820
9820
|
function Il() {
|
|
9821
9821
|
if (uu) return Ca;
|
|
9822
9822
|
uu = 1;
|
|
9823
|
-
var l = Te(), e = pe(), t =
|
|
9823
|
+
var l = Te(), e = pe(), t = qr(), n = mt();
|
|
9824
9824
|
function u(s) {
|
|
9825
9825
|
t.call(this, "mont", s), this.a = new l(s.a, 16).toRed(this.red), this.b = new l(s.b, 16).toRed(this.red), this.i4 = new l(4).toRed(this.red).redInvm(), this.two = new l(2).toRed(this.red), this.a24 = this.i4.redMul(this.a.redAdd(this.two));
|
|
9826
9826
|
}
|
|
@@ -9876,7 +9876,7 @@ var La, hu;
|
|
|
9876
9876
|
function Al() {
|
|
9877
9877
|
if (hu) return La;
|
|
9878
9878
|
hu = 1;
|
|
9879
|
-
var l = mt(), e = Te(), t = pe(), n =
|
|
9879
|
+
var l = mt(), e = Te(), t = pe(), n = qr(), u = l.assert;
|
|
9880
9880
|
function r(a) {
|
|
9881
9881
|
this.twisted = (a.a | 0) !== 1, this.mOneA = this.twisted && (a.a | 0) === -1, this.extended = this.mOneA, n.call(this, "edwards", a), this.a = new e(a.a, 16).umod(this.red.m), this.a = this.a.toRed(this.red), this.c = new e(a.c, 16).toRed(this.red), this.c2 = this.c.redSqr(), this.d = new e(a.d, 16).toRed(this.red), this.dd = this.d.redAdd(this.d), u(!this.twisted || this.c.fromRed().cmpn(1) === 0), this.oneC = (a.c | 0) === 1;
|
|
9882
9882
|
}
|
|
@@ -9989,10 +9989,10 @@ var du;
|
|
|
9989
9989
|
function ud() {
|
|
9990
9990
|
return du || (du = 1, (function(l) {
|
|
9991
9991
|
var e = l;
|
|
9992
|
-
e.base =
|
|
9992
|
+
e.base = qr(), e.short = Rl(), e.mont = Il(), e.edwards = Al();
|
|
9993
9993
|
})(Na)), Na;
|
|
9994
9994
|
}
|
|
9995
|
-
var Da = {},
|
|
9995
|
+
var Da = {}, Fa = {}, Ne = {}, lu;
|
|
9996
9996
|
function Bt() {
|
|
9997
9997
|
if (lu) return Ne;
|
|
9998
9998
|
lu = 1;
|
|
@@ -10052,9 +10052,9 @@ function Bt() {
|
|
|
10052
10052
|
function f($, k, m, E) {
|
|
10053
10053
|
var O = m - k;
|
|
10054
10054
|
l(O % 4 === 0);
|
|
10055
|
-
for (var R = new Array(O / 4), A = 0,
|
|
10055
|
+
for (var R = new Array(O / 4), A = 0, F = k; A < R.length; A++, F += 4) {
|
|
10056
10056
|
var K;
|
|
10057
|
-
E === "big" ? K = $[
|
|
10057
|
+
E === "big" ? K = $[F] << 24 | $[F + 1] << 16 | $[F + 2] << 8 | $[F + 3] : K = $[F + 3] << 24 | $[F + 2] << 16 | $[F + 1] << 8 | $[F], R[A] = K >>> 0;
|
|
10058
10058
|
}
|
|
10059
10059
|
return R;
|
|
10060
10060
|
}
|
|
@@ -10092,8 +10092,8 @@ function Bt() {
|
|
|
10092
10092
|
}
|
|
10093
10093
|
Ne.sum32_5 = y;
|
|
10094
10094
|
function v($, k, m, E) {
|
|
10095
|
-
var O = $[k], R = $[k + 1], A = E + R >>> 0,
|
|
10096
|
-
$[k] =
|
|
10095
|
+
var O = $[k], R = $[k + 1], A = E + R >>> 0, F = (A < E ? 1 : 0) + m + O;
|
|
10096
|
+
$[k] = F >>> 0, $[k + 1] = A;
|
|
10097
10097
|
}
|
|
10098
10098
|
Ne.sum64 = v;
|
|
10099
10099
|
function g($, k, m, E) {
|
|
@@ -10106,27 +10106,27 @@ function Bt() {
|
|
|
10106
10106
|
return O >>> 0;
|
|
10107
10107
|
}
|
|
10108
10108
|
Ne.sum64_lo = x;
|
|
10109
|
-
function B($, k, m, E, O, R, A,
|
|
10109
|
+
function B($, k, m, E, O, R, A, F) {
|
|
10110
10110
|
var K = 0, L = k;
|
|
10111
|
-
L = L + E >>> 0, K += L < k ? 1 : 0, L = L + R >>> 0, K += L < R ? 1 : 0, L = L +
|
|
10111
|
+
L = L + E >>> 0, K += L < k ? 1 : 0, L = L + R >>> 0, K += L < R ? 1 : 0, L = L + F >>> 0, K += L < F ? 1 : 0;
|
|
10112
10112
|
var _ = $ + m + O + A + K;
|
|
10113
10113
|
return _ >>> 0;
|
|
10114
10114
|
}
|
|
10115
10115
|
Ne.sum64_4_hi = B;
|
|
10116
|
-
function I($, k, m, E, O, R, A,
|
|
10117
|
-
var K = k + E + R +
|
|
10116
|
+
function I($, k, m, E, O, R, A, F) {
|
|
10117
|
+
var K = k + E + R + F;
|
|
10118
10118
|
return K >>> 0;
|
|
10119
10119
|
}
|
|
10120
10120
|
Ne.sum64_4_lo = I;
|
|
10121
|
-
function C($, k, m, E, O, R, A,
|
|
10122
|
-
var _ = 0,
|
|
10123
|
-
|
|
10121
|
+
function C($, k, m, E, O, R, A, F, K, L) {
|
|
10122
|
+
var _ = 0, U = k;
|
|
10123
|
+
U = U + E >>> 0, _ += U < k ? 1 : 0, U = U + R >>> 0, _ += U < R ? 1 : 0, U = U + F >>> 0, _ += U < F ? 1 : 0, U = U + L >>> 0, _ += U < L ? 1 : 0;
|
|
10124
10124
|
var fe = $ + m + O + A + K + _;
|
|
10125
10125
|
return fe >>> 0;
|
|
10126
10126
|
}
|
|
10127
10127
|
Ne.sum64_5_hi = C;
|
|
10128
|
-
function j($, k, m, E, O, R, A,
|
|
10129
|
-
var _ = k + E + R +
|
|
10128
|
+
function j($, k, m, E, O, R, A, F, K, L) {
|
|
10129
|
+
var _ = k + E + R + F + L;
|
|
10130
10130
|
return _ >>> 0;
|
|
10131
10131
|
}
|
|
10132
10132
|
Ne.sum64_5_lo = j;
|
|
@@ -10150,15 +10150,15 @@ function Bt() {
|
|
|
10150
10150
|
}
|
|
10151
10151
|
return Ne.shr64_lo = ne, Ne;
|
|
10152
10152
|
}
|
|
10153
|
-
var
|
|
10153
|
+
var qa = {}, bu;
|
|
10154
10154
|
function or() {
|
|
10155
|
-
if (bu) return
|
|
10155
|
+
if (bu) return qa;
|
|
10156
10156
|
bu = 1;
|
|
10157
10157
|
var l = Bt(), e = lt();
|
|
10158
10158
|
function t() {
|
|
10159
10159
|
this.pending = null, this.pendingTotal = 0, this.blockSize = this.constructor.blockSize, this.outSize = this.constructor.outSize, this.hmacStrength = this.constructor.hmacStrength, this.padLength = this.constructor.padLength / 8, this.endian = "big", this._delta8 = this.blockSize / 8, this._delta32 = this.blockSize / 32;
|
|
10160
10160
|
}
|
|
10161
|
-
return
|
|
10161
|
+
return qa.BlockHash = t, t.prototype.update = function(u, r) {
|
|
10162
10162
|
if (u = l.toArray(u, r), this.pending ? this.pending = this.pending.concat(u) : this.pending = u, this.pendingTotal += u.length, this.pending.length >= this._delta8) {
|
|
10163
10163
|
u = this.pending;
|
|
10164
10164
|
var s = u.length % this._delta8;
|
|
@@ -10182,7 +10182,7 @@ function or() {
|
|
|
10182
10182
|
for (a[o++] = u & 255, a[o++] = u >>> 8 & 255, a[o++] = u >>> 16 & 255, a[o++] = u >>> 24 & 255, a[o++] = 0, a[o++] = 0, a[o++] = 0, a[o++] = 0, f = 8; f < this.padLength; f++)
|
|
10183
10183
|
a[o++] = 0;
|
|
10184
10184
|
return a;
|
|
10185
|
-
},
|
|
10185
|
+
}, qa;
|
|
10186
10186
|
}
|
|
10187
10187
|
var Mt = {}, xt = {}, pu;
|
|
10188
10188
|
function hd() {
|
|
@@ -10577,34 +10577,34 @@ function ld() {
|
|
|
10577
10577
|
for (var O = this.W, R = 0; R < 32; R++)
|
|
10578
10578
|
O[R] = m[E + R];
|
|
10579
10579
|
for (; R < O.length; R += 2) {
|
|
10580
|
-
var A = ne(O[R - 4], O[R - 3]),
|
|
10580
|
+
var A = ne(O[R - 4], O[R - 3]), F = $(O[R - 4], O[R - 3]), K = O[R - 14], L = O[R - 13], _ = z(O[R - 30], O[R - 29]), U = te(O[R - 30], O[R - 29]), fe = O[R - 32], se = O[R - 31];
|
|
10581
10581
|
O[R] = i(
|
|
10582
10582
|
A,
|
|
10583
|
-
|
|
10583
|
+
F,
|
|
10584
10584
|
K,
|
|
10585
10585
|
L,
|
|
10586
10586
|
_,
|
|
10587
|
-
|
|
10587
|
+
U,
|
|
10588
10588
|
fe,
|
|
10589
10589
|
se
|
|
10590
10590
|
), O[R + 1] = c(
|
|
10591
10591
|
A,
|
|
10592
|
-
|
|
10592
|
+
F,
|
|
10593
10593
|
K,
|
|
10594
10594
|
L,
|
|
10595
10595
|
_,
|
|
10596
|
-
|
|
10596
|
+
U,
|
|
10597
10597
|
fe,
|
|
10598
10598
|
se
|
|
10599
10599
|
);
|
|
10600
10600
|
}
|
|
10601
10601
|
}, y.prototype._update = function(m, E) {
|
|
10602
10602
|
this._prepareBlock(m, E);
|
|
10603
|
-
var O = this.W, R = this.h[0], A = this.h[1],
|
|
10603
|
+
var O = this.W, R = this.h[0], A = this.h[1], F = this.h[2], K = this.h[3], L = this.h[4], _ = this.h[5], U = this.h[6], fe = this.h[7], se = this.h[8], V = this.h[9], P = this.h[10], M = this.h[11], Y = this.h[12], Q = this.h[13], D = this.h[14], T = this.h[15];
|
|
10604
10604
|
t(this.k.length === O.length);
|
|
10605
10605
|
for (var J = 0; J < O.length; J += 2) {
|
|
10606
|
-
var
|
|
10607
|
-
|
|
10606
|
+
var ie = D, ue = T, oe = j(se, V), ce = G(se, V), ge = v(se, V, P, M, Y), Ke = g(se, V, P, M, Y, Q), Se = this.k[J], de = this.k[J + 1], Be = O[J], ve = O[J + 1], me = h(
|
|
10607
|
+
ie,
|
|
10608
10608
|
ue,
|
|
10609
10609
|
oe,
|
|
10610
10610
|
ce,
|
|
@@ -10615,7 +10615,7 @@ function ld() {
|
|
|
10615
10615
|
Be,
|
|
10616
10616
|
ve
|
|
10617
10617
|
), Le = d(
|
|
10618
|
-
|
|
10618
|
+
ie,
|
|
10619
10619
|
ue,
|
|
10620
10620
|
oe,
|
|
10621
10621
|
ce,
|
|
@@ -10626,11 +10626,11 @@ function ld() {
|
|
|
10626
10626
|
Be,
|
|
10627
10627
|
ve
|
|
10628
10628
|
);
|
|
10629
|
-
|
|
10630
|
-
var Pe = o(
|
|
10631
|
-
D = Y, T = Q, Y = P, Q = M, P = se, M = V, se = o(
|
|
10629
|
+
ie = I(R, A), ue = C(R, A), oe = x(R, A, F, K, L), ce = B(R, A, F, K, L, _);
|
|
10630
|
+
var Pe = o(ie, ue, oe, ce), N = f(ie, ue, oe, ce);
|
|
10631
|
+
D = Y, T = Q, Y = P, Q = M, P = se, M = V, se = o(U, fe, me, Le), V = f(fe, fe, me, Le), U = L, fe = _, L = F, _ = K, F = R, K = A, R = o(me, Le, Pe, N), A = f(me, Le, Pe, N);
|
|
10632
10632
|
}
|
|
10633
|
-
a(this.h, 0, R, A), a(this.h, 2,
|
|
10633
|
+
a(this.h, 0, R, A), a(this.h, 2, F, K), a(this.h, 4, L, _), a(this.h, 6, U, fe), a(this.h, 8, se, V), a(this.h, 10, P, M), a(this.h, 12, Y, Q), a(this.h, 14, D, T);
|
|
10634
10634
|
}, y.prototype._digest = function(m) {
|
|
10635
10635
|
return m === "hex" ? l.toHex32(this.h, "big") : l.split32(this.h, "big");
|
|
10636
10636
|
};
|
|
@@ -10639,16 +10639,16 @@ function ld() {
|
|
|
10639
10639
|
return A < 0 && (A += 4294967296), A;
|
|
10640
10640
|
}
|
|
10641
10641
|
function g(k, m, E, O, R, A) {
|
|
10642
|
-
var
|
|
10643
|
-
return
|
|
10642
|
+
var F = m & O ^ ~m & A;
|
|
10643
|
+
return F < 0 && (F += 4294967296), F;
|
|
10644
10644
|
}
|
|
10645
10645
|
function x(k, m, E, O, R) {
|
|
10646
10646
|
var A = k & E ^ k & R ^ E & R;
|
|
10647
10647
|
return A < 0 && (A += 4294967296), A;
|
|
10648
10648
|
}
|
|
10649
10649
|
function B(k, m, E, O, R, A) {
|
|
10650
|
-
var
|
|
10651
|
-
return
|
|
10650
|
+
var F = m & O ^ m & A ^ O & A;
|
|
10651
|
+
return F < 0 && (F += 4294967296), F;
|
|
10652
10652
|
}
|
|
10653
10653
|
function I(k, m) {
|
|
10654
10654
|
var E = n(k, m, 28), O = n(m, k, 2), R = n(m, k, 7), A = E ^ O ^ R;
|
|
@@ -11116,7 +11116,7 @@ function cr() {
|
|
|
11116
11116
|
return Eu || (Eu = 1, (function(l) {
|
|
11117
11117
|
var e = l;
|
|
11118
11118
|
e.utils = Bt(), e.common = or(), e.sha = Nl(), e.ripemd = Ml(), e.hmac = Tl(), e.sha1 = e.sha.sha1, e.sha256 = e.sha.sha256, e.sha224 = e.sha.sha224, e.sha384 = e.sha.sha384, e.sha512 = e.sha.sha512, e.ripemd160 = e.ripemd.ripemd160;
|
|
11119
|
-
})(
|
|
11119
|
+
})(Fa)), Fa;
|
|
11120
11120
|
}
|
|
11121
11121
|
var $a, Bu;
|
|
11122
11122
|
function Cl() {
|
|
@@ -12219,7 +12219,7 @@ function Dl() {
|
|
|
12219
12219
|
}, Ja;
|
|
12220
12220
|
}
|
|
12221
12221
|
var Xa, Pu;
|
|
12222
|
-
function
|
|
12222
|
+
function Fl() {
|
|
12223
12223
|
if (Pu) return Xa;
|
|
12224
12224
|
Pu = 1;
|
|
12225
12225
|
var l = Te(), e = bd(), t = mt(), n = as(), u = hr(), r = t.assert, s = Ll(), a = Dl();
|
|
@@ -12329,7 +12329,7 @@ function ql() {
|
|
|
12329
12329
|
}, Xa;
|
|
12330
12330
|
}
|
|
12331
12331
|
var Qa, ku;
|
|
12332
|
-
function
|
|
12332
|
+
function ql() {
|
|
12333
12333
|
if (ku) return Qa;
|
|
12334
12334
|
ku = 1;
|
|
12335
12335
|
var l = mt(), e = l.assert, t = l.parseBytes, n = l.cachedProperty;
|
|
@@ -12394,7 +12394,7 @@ var ef, Mu;
|
|
|
12394
12394
|
function Hl() {
|
|
12395
12395
|
if (Mu) return ef;
|
|
12396
12396
|
Mu = 1;
|
|
12397
|
-
var l = cr(), e = as(), t = mt(), n = t.assert, u = t.parseBytes, r =
|
|
12397
|
+
var l = cr(), e = as(), t = mt(), n = t.assert, u = t.parseBytes, r = ql(), s = Ul();
|
|
12398
12398
|
function a(o) {
|
|
12399
12399
|
if (n(o === "ed25519", "only tested with ed25519 so far"), !(this instanceof a))
|
|
12400
12400
|
return new a(o);
|
|
@@ -12438,7 +12438,7 @@ var Tu;
|
|
|
12438
12438
|
function fs() {
|
|
12439
12439
|
return Tu || (Tu = 1, (function(l) {
|
|
12440
12440
|
var e = l;
|
|
12441
|
-
e.version = Bl.version, e.utils = mt(), e.rand = hr(), e.curve = ud(), e.curves = as(), e.ec =
|
|
12441
|
+
e.version = Bl.version, e.utils = mt(), e.rand = hr(), e.curve = ud(), e.curves = as(), e.ec = Fl(), e.eddsa = Hl();
|
|
12442
12442
|
})(Pa)), Pa;
|
|
12443
12443
|
}
|
|
12444
12444
|
var vt = {}, tf = {}, rf = {}, Cu;
|
|
@@ -12543,7 +12543,7 @@ function jl() {
|
|
|
12543
12543
|
}, af;
|
|
12544
12544
|
}
|
|
12545
12545
|
var Ar = {}, Du;
|
|
12546
|
-
function
|
|
12546
|
+
function Fu() {
|
|
12547
12547
|
if (Du) return Ar;
|
|
12548
12548
|
Du = 1;
|
|
12549
12549
|
var l = pe(), e = Zt().Reporter, t = St().Buffer;
|
|
@@ -12593,10 +12593,10 @@ function qu() {
|
|
|
12593
12593
|
}) : (typeof this.value == "number" ? s[a] = this.value : typeof this.value == "string" ? s.write(this.value, a) : t.isBuffer(this.value) && this.value.copy(s, a), a += this.length)), s;
|
|
12594
12594
|
}, Ar;
|
|
12595
12595
|
}
|
|
12596
|
-
var ff,
|
|
12596
|
+
var ff, qu;
|
|
12597
12597
|
function zl() {
|
|
12598
|
-
if (
|
|
12599
|
-
|
|
12598
|
+
if (qu) return ff;
|
|
12599
|
+
qu = 1;
|
|
12600
12600
|
var l = Zt().Reporter, e = Zt().EncoderBuffer, t = Zt().DecoderBuffer, n = lt(), u = [
|
|
12601
12601
|
"seq",
|
|
12602
12602
|
"seqof",
|
|
@@ -12920,7 +12920,7 @@ var Uu;
|
|
|
12920
12920
|
function Zt() {
|
|
12921
12921
|
return Uu || (Uu = 1, (function(l) {
|
|
12922
12922
|
var e = l;
|
|
12923
|
-
e.Reporter = jl().Reporter, e.DecoderBuffer =
|
|
12923
|
+
e.Reporter = jl().Reporter, e.DecoderBuffer = Fu().DecoderBuffer, e.EncoderBuffer = Fu().EncoderBuffer, e.Node = zl();
|
|
12924
12924
|
})(nf)), nf;
|
|
12925
12925
|
}
|
|
12926
12926
|
var sf = {}, of = {}, Hu;
|
|
@@ -13553,7 +13553,7 @@ var vf, Qu;
|
|
|
13553
13553
|
function Zl() {
|
|
13554
13554
|
if (Qu) return vf;
|
|
13555
13555
|
Qu = 1;
|
|
13556
|
-
var l = /Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m, e = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m, t = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m, n =
|
|
13556
|
+
var l = /Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m, e = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m, t = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m, n = Fr(), u = is(), r = _e().Buffer;
|
|
13557
13557
|
return vf = function(s, a) {
|
|
13558
13558
|
var o = s.toString(), f = o.match(l), i;
|
|
13559
13559
|
if (f) {
|
|
@@ -14063,9 +14063,9 @@ function f1() {
|
|
|
14063
14063
|
};
|
|
14064
14064
|
})(_f)), _f;
|
|
14065
14065
|
}
|
|
14066
|
-
var
|
|
14066
|
+
var qt = {}, uh;
|
|
14067
14067
|
function s1() {
|
|
14068
|
-
if (uh) return
|
|
14068
|
+
if (uh) return qt;
|
|
14069
14069
|
uh = 1;
|
|
14070
14070
|
function l() {
|
|
14071
14071
|
throw new Error(`secure random number generation not supported by this browser
|
|
@@ -14088,7 +14088,7 @@ use chrome, FireFox or Internet Explorer 11`);
|
|
|
14088
14088
|
if (h + d > b || h > u)
|
|
14089
14089
|
throw new RangeError("buffer too small");
|
|
14090
14090
|
}
|
|
14091
|
-
r && r.getRandomValues || !process.browser ? (
|
|
14091
|
+
r && r.getRandomValues || !process.browser ? (qt.randomFill = f, qt.randomFillSync = c) : (qt.randomFill = l, qt.randomFillSync = l);
|
|
14092
14092
|
function f(h, d, b, p) {
|
|
14093
14093
|
if (!n.isBuffer(h) && !(h instanceof Re.Uint8Array))
|
|
14094
14094
|
throw new TypeError('"buf" argument must be a Buffer or Uint8Array');
|
|
@@ -14127,7 +14127,7 @@ use chrome, FireFox or Internet Explorer 11`);
|
|
|
14127
14127
|
throw new TypeError('"buf" argument must be a Buffer or Uint8Array');
|
|
14128
14128
|
return a(d, h.length), b === void 0 && (b = h.length - d), o(b, d, h.length), i(h, d, b);
|
|
14129
14129
|
}
|
|
14130
|
-
return
|
|
14130
|
+
return qt;
|
|
14131
14131
|
}
|
|
14132
14132
|
var hh;
|
|
14133
14133
|
function o1() {
|
|
@@ -15810,7 +15810,7 @@ const dr = /* @__PURE__ */ jt(v1);
|
|
|
15810
15810
|
var m1 = es();
|
|
15811
15811
|
const Rd = /* @__PURE__ */ jt(m1);
|
|
15812
15812
|
var y1 = St();
|
|
15813
|
-
const g1 = "2.2.
|
|
15813
|
+
const g1 = "2.2.2", w1 = {
|
|
15814
15814
|
version: g1
|
|
15815
15815
|
};
|
|
15816
15816
|
function Z(l, e, t) {
|
|
@@ -16486,7 +16486,7 @@ class er extends Ce {
|
|
|
16486
16486
|
return er.encode(this.buf);
|
|
16487
16487
|
}
|
|
16488
16488
|
}
|
|
16489
|
-
const
|
|
16489
|
+
const Ft = (l, e) => {
|
|
16490
16490
|
if (!Buffer.isBuffer(l) || !Buffer.isBuffer(e))
|
|
16491
16491
|
throw new Error("buf1 and buf2 must be buffers");
|
|
16492
16492
|
if (l.length !== e.length)
|
|
@@ -16680,7 +16680,7 @@ class Rt extends Ce {
|
|
|
16680
16680
|
if (t.length < 4)
|
|
16681
16681
|
throw new Error("Input string too short");
|
|
16682
16682
|
const n = t.slice(0, -4), u = t.slice(-4), s = ae.sha256Sha256(n).slice(0, 4);
|
|
16683
|
-
if (!
|
|
16683
|
+
if (!Ft(u, s))
|
|
16684
16684
|
throw new Error("Checksum mismatch");
|
|
16685
16685
|
return n;
|
|
16686
16686
|
}
|
|
@@ -17127,7 +17127,7 @@ const T1 = (l) => Oe.Mainnet.Msg.magicNum === l ? Oe.Mainnet : Oe.Testnet.Msg.ma
|
|
|
17127
17127
|
OP_PUBKEY: 254,
|
|
17128
17128
|
OP_INVALIDOPCODE: 255
|
|
17129
17129
|
};
|
|
17130
|
-
class
|
|
17130
|
+
class q extends Ce {
|
|
17131
17131
|
constructor(e) {
|
|
17132
17132
|
super({ num: e });
|
|
17133
17133
|
}
|
|
@@ -17159,25 +17159,25 @@ class H extends Ce {
|
|
|
17159
17159
|
return new this().fromNoOpString(e);
|
|
17160
17160
|
}
|
|
17161
17161
|
toString() {
|
|
17162
|
-
const e =
|
|
17163
|
-
return e === void 0 ? this.num > 0 && this.num <
|
|
17162
|
+
const e = q.str[this.num];
|
|
17163
|
+
return e === void 0 ? this.num > 0 && this.num < q.OP_PUSHDATA1 ? this.num.toString() : "OP_" + this.num.toNumber() : e;
|
|
17164
17164
|
}
|
|
17165
17165
|
toNoOpString() {
|
|
17166
|
-
const e =
|
|
17167
|
-
return e === void 0 ? this.num > 0 && this.num <
|
|
17166
|
+
const e = q.noopstr[this.num];
|
|
17167
|
+
return e === void 0 ? this.num > 0 && this.num < q.OP_PUSHDATA1 ? this.num.toString() : this.num.toNumber() : e;
|
|
17168
17168
|
}
|
|
17169
17169
|
}
|
|
17170
|
-
|
|
17171
|
-
|
|
17170
|
+
q.str = {};
|
|
17171
|
+
q.noopstr = {};
|
|
17172
17172
|
for (const l in Xt)
|
|
17173
|
-
|
|
17173
|
+
q[l] = Xt[l], Object.prototype.hasOwnProperty.call(Xt, l) && (q.str[Xt[l]] = l);
|
|
17174
17174
|
for (const l in Jt)
|
|
17175
|
-
|
|
17176
|
-
|
|
17177
|
-
|
|
17178
|
-
|
|
17179
|
-
|
|
17180
|
-
|
|
17175
|
+
q[l] = Jt[l], Object.prototype.hasOwnProperty.call(Jt, l) && (q.noopstr[Jt[l]] = l);
|
|
17176
|
+
q.OP_SUBSTR_CHRONICLE = 179;
|
|
17177
|
+
q.OP_LEFT_CHRONICLE = 180;
|
|
17178
|
+
q.OP_RIGHT_CHRONICLE = 181;
|
|
17179
|
+
q.OP_LSHIFTNUM = 182;
|
|
17180
|
+
q.OP_RSHIFTNUM = 183;
|
|
17181
17181
|
const Qt = Bd.curves.secp256k1, A1 = Qt.curve.point(), Tt = A1.constructor;
|
|
17182
17182
|
class Ie extends Tt {
|
|
17183
17183
|
constructor(e, t, n) {
|
|
@@ -17700,13 +17700,13 @@ class Ae extends Ce {
|
|
|
17700
17700
|
for (; !t.eof(); ) {
|
|
17701
17701
|
const n = t.readUInt8();
|
|
17702
17702
|
let u = 0, r = Buffer.from([]);
|
|
17703
|
-
if (n > 0 && n <
|
|
17703
|
+
if (n > 0 && n < q.OP_PUSHDATA1)
|
|
17704
17704
|
u = n, this.chunks.push({
|
|
17705
17705
|
buf: t.read(u),
|
|
17706
17706
|
len: u,
|
|
17707
17707
|
opCodeNum: n
|
|
17708
17708
|
});
|
|
17709
|
-
else if (n ===
|
|
17709
|
+
else if (n === q.OP_PUSHDATA1) {
|
|
17710
17710
|
try {
|
|
17711
17711
|
u = t.readUInt8(), r = t.read(u);
|
|
17712
17712
|
} catch {
|
|
@@ -17717,7 +17717,7 @@ class Ae extends Ce {
|
|
|
17717
17717
|
len: u,
|
|
17718
17718
|
opCodeNum: n
|
|
17719
17719
|
});
|
|
17720
|
-
} else if (n ===
|
|
17720
|
+
} else if (n === q.OP_PUSHDATA2) {
|
|
17721
17721
|
try {
|
|
17722
17722
|
u = t.readUInt16LE(), r = t.read(u);
|
|
17723
17723
|
} catch {
|
|
@@ -17728,7 +17728,7 @@ class Ae extends Ce {
|
|
|
17728
17728
|
len: u,
|
|
17729
17729
|
opCodeNum: n
|
|
17730
17730
|
});
|
|
17731
|
-
} else if (n ===
|
|
17731
|
+
} else if (n === q.OP_PUSHDATA4) {
|
|
17732
17732
|
try {
|
|
17733
17733
|
u = t.readUInt32LE(), r = t.read(u);
|
|
17734
17734
|
} catch {
|
|
@@ -17750,7 +17750,7 @@ class Ae extends Ce {
|
|
|
17750
17750
|
const e = new ke();
|
|
17751
17751
|
for (let t = 0; t < this.chunks.length; t++) {
|
|
17752
17752
|
const n = this.chunks[t], u = n.opCodeNum;
|
|
17753
|
-
e.writeUInt8(u), n.buf && (u <
|
|
17753
|
+
e.writeUInt8(u), n.buf && (u < q.OP_PUSHDATA1 ? e.write(n.buf) : u === q.OP_PUSHDATA1 ? (e.writeUInt8(n.len), e.write(n.buf)) : u === q.OP_PUSHDATA2 ? (e.writeUInt16LE(n.len), e.write(n.buf)) : u === q.OP_PUSHDATA4 && (e.writeUInt32LE(n.len), e.write(n.buf)));
|
|
17754
17754
|
}
|
|
17755
17755
|
return e.toBuffer();
|
|
17756
17756
|
}
|
|
@@ -17763,11 +17763,11 @@ class Ae extends Ce {
|
|
|
17763
17763
|
const u = t[n];
|
|
17764
17764
|
let r;
|
|
17765
17765
|
try {
|
|
17766
|
-
r = new
|
|
17766
|
+
r = new q().fromString(u).toNumber();
|
|
17767
17767
|
} catch {
|
|
17768
17768
|
}
|
|
17769
17769
|
if (r === void 0)
|
|
17770
|
-
if (r = parseInt(u, 10), r > 0 && r <
|
|
17770
|
+
if (r = parseInt(u, 10), r > 0 && r < q.OP_PUSHDATA1)
|
|
17771
17771
|
this.chunks.push({
|
|
17772
17772
|
buf: Buffer.from(t[n + 1].slice(2), "hex"),
|
|
17773
17773
|
len: r,
|
|
@@ -17779,7 +17779,7 @@ class Ae extends Ce {
|
|
|
17779
17779
|
}), n = n + 1;
|
|
17780
17780
|
else
|
|
17781
17781
|
throw new Error("Invalid script");
|
|
17782
|
-
else if (r ===
|
|
17782
|
+
else if (r === q.OP_PUSHDATA1 || r === q.OP_PUSHDATA2 || r === q.OP_PUSHDATA4) {
|
|
17783
17783
|
if (t[n + 2].slice(0, 2) !== "0x")
|
|
17784
17784
|
throw new Error("Pushdata data must start with 0x");
|
|
17785
17785
|
this.chunks.push({
|
|
@@ -17798,7 +17798,7 @@ class Ae extends Ce {
|
|
|
17798
17798
|
let t = "";
|
|
17799
17799
|
for (let n = 0; n < this.chunks.length; n++) {
|
|
17800
17800
|
const u = this.chunks[n], r = u.opCodeNum?.num ? u.opCodeNum.num : u.opCodeNum;
|
|
17801
|
-
u.buf ? ((r ===
|
|
17801
|
+
u.buf ? ((r === q.OP_PUSHDATA1 || r === q.OP_PUSHDATA2 || r === q.OP_PUSHDATA4) && (t = e.noOp ? t + " " + new q(r).toNoOpString() : t + " " + new q(r).toString()), t = t + " " + u.len, t = t + " 0x" + u.buf.toString("hex")) : q.str[r] !== void 0 || q.noopstr[r] !== void 0 ? t = e.noOp ? t + " " + new q(r).toNoOpString() : t + " " + new q(r).toString() : t = t + " 0x" + r.toString(16);
|
|
17802
17802
|
}
|
|
17803
17803
|
return t.substr(1);
|
|
17804
17804
|
}
|
|
@@ -17817,11 +17817,11 @@ class Ae extends Ce {
|
|
|
17817
17817
|
} else if (s[0] === "'") {
|
|
17818
17818
|
const a = s.slice(1, s.length - 1), o = Buffer.from(a), f = new Ae().writeBuffer(o).toBuffer();
|
|
17819
17819
|
t.write(f);
|
|
17820
|
-
} else if (
|
|
17821
|
-
const a = "OP_" + s, o =
|
|
17820
|
+
} else if (q["OP_" + s] !== void 0) {
|
|
17821
|
+
const a = "OP_" + s, o = q[a];
|
|
17822
17822
|
t.writeUInt8(o);
|
|
17823
|
-
} else if (typeof
|
|
17824
|
-
const o =
|
|
17823
|
+
} else if (typeof q[s] == "number") {
|
|
17824
|
+
const o = q[s];
|
|
17825
17825
|
t.writeUInt8(o);
|
|
17826
17826
|
} else {
|
|
17827
17827
|
if (isNaN(parseInt(s, 10)))
|
|
@@ -17848,8 +17848,8 @@ class Ae extends Ce {
|
|
|
17848
17848
|
if (n.buf) {
|
|
17849
17849
|
const r = new Ae([n]).toBuffer().toString("hex");
|
|
17850
17850
|
e = e + " 0x" + r;
|
|
17851
|
-
} else if (
|
|
17852
|
-
const u = new
|
|
17851
|
+
} else if (q.str[n.opCodeNum] !== void 0) {
|
|
17852
|
+
const u = new q(n.opCodeNum).toString();
|
|
17853
17853
|
e = e + " " + u.slice(3);
|
|
17854
17854
|
} else
|
|
17855
17855
|
e = e + " 0x" + n.opCodeNum.toString(16);
|
|
@@ -17867,7 +17867,7 @@ class Ae extends Ce {
|
|
|
17867
17867
|
const u = t[n];
|
|
17868
17868
|
let r, s;
|
|
17869
17869
|
try {
|
|
17870
|
-
r =
|
|
17870
|
+
r = q.fromString(u), s = r.toNumber();
|
|
17871
17871
|
} catch {
|
|
17872
17872
|
r = void 0, s = void 0;
|
|
17873
17873
|
}
|
|
@@ -17876,7 +17876,7 @@ class Ae extends Ce {
|
|
|
17876
17876
|
opCodeNum: s
|
|
17877
17877
|
}), n = n + 1;
|
|
17878
17878
|
else if (u === "-1")
|
|
17879
|
-
s =
|
|
17879
|
+
s = q.OP_1NEGATE, this.chunks.push({
|
|
17880
17880
|
opCodeNum: s
|
|
17881
17881
|
}), n = n + 1;
|
|
17882
17882
|
else if (r === void 0) {
|
|
@@ -17884,7 +17884,7 @@ class Ae extends Ce {
|
|
|
17884
17884
|
if (o.toString("hex") !== a)
|
|
17885
17885
|
throw new Error("invalid hex string in script");
|
|
17886
17886
|
const f = o.length;
|
|
17887
|
-
f >= 0 && f <
|
|
17887
|
+
f >= 0 && f < q.OP_PUSHDATA1 ? s = f : f < Math.pow(2, 8) ? s = q.OP_PUSHDATA1 : f < Math.pow(2, 16) ? s = q.OP_PUSHDATA2 : f < Math.pow(2, 32) && (s = q.OP_PUSHDATA4), this.chunks.push({
|
|
17888
17888
|
buf: o,
|
|
17889
17889
|
len: o.length,
|
|
17890
17890
|
opCodeNum: s
|
|
@@ -17915,8 +17915,8 @@ class Ae extends Ce {
|
|
|
17915
17915
|
let u = "";
|
|
17916
17916
|
if (e.buf)
|
|
17917
17917
|
e.len > 0 && (u = u + " " + e.buf.toString("hex"));
|
|
17918
|
-
else if (typeof
|
|
17919
|
-
n === 0 ? u = u + " 0" : n === 79 ? u = u + " -1" : u = t.noOp ? u + " " + new
|
|
17918
|
+
else if (typeof q.str[n] < "u")
|
|
17919
|
+
n === 0 ? u = u + " 0" : n === 79 ? u = u + " -1" : u = t.noOp ? u + " " + new q(n).toNoOpString() : u + " " + new q(n).toString();
|
|
17920
17920
|
else {
|
|
17921
17921
|
let r = n.toString(16);
|
|
17922
17922
|
r.length % 2 !== 0 && (r = "0" + r), u = u + " " + r;
|
|
@@ -17924,19 +17924,19 @@ class Ae extends Ce {
|
|
|
17924
17924
|
return u;
|
|
17925
17925
|
}
|
|
17926
17926
|
fromOpReturnData(e) {
|
|
17927
|
-
return this.writeOpCode(
|
|
17927
|
+
return this.writeOpCode(q.OP_RETURN), this.writeBuffer(e), this;
|
|
17928
17928
|
}
|
|
17929
17929
|
static fromOpReturnData(e) {
|
|
17930
17930
|
return new this().fromOpReturnData(e);
|
|
17931
17931
|
}
|
|
17932
17932
|
fromSafeData(e) {
|
|
17933
|
-
return this.writeOpCode(
|
|
17933
|
+
return this.writeOpCode(q.OP_FALSE), this.writeOpCode(q.OP_RETURN), this.writeBuffer(e), this;
|
|
17934
17934
|
}
|
|
17935
17935
|
static fromSafeData(e) {
|
|
17936
17936
|
return new this().fromSafeData(e);
|
|
17937
17937
|
}
|
|
17938
17938
|
fromSafeDataArray(e) {
|
|
17939
|
-
this.writeOpCode(
|
|
17939
|
+
this.writeOpCode(q.OP_FALSE), this.writeOpCode(q.OP_RETURN);
|
|
17940
17940
|
for (const t in e) {
|
|
17941
17941
|
const n = e[t];
|
|
17942
17942
|
this.writeBuffer(n);
|
|
@@ -17959,7 +17959,7 @@ class Ae extends Ce {
|
|
|
17959
17959
|
fromPubKeyHash(e) {
|
|
17960
17960
|
if (e.length !== 20)
|
|
17961
17961
|
throw new Error("hashBuf must be a 20 byte buffer");
|
|
17962
|
-
return this.writeOpCode(
|
|
17962
|
+
return this.writeOpCode(q.OP_DUP), this.writeOpCode(q.OP_HASH160), this.writeBuffer(e), this.writeOpCode(q.OP_EQUALVERIFY), this.writeOpCode(q.OP_CHECKSIG), this;
|
|
17963
17963
|
}
|
|
17964
17964
|
static fromPubKeyHash(e) {
|
|
17965
17965
|
return new this().fromPubKeyHash(e);
|
|
@@ -17987,10 +17987,10 @@ class Ae extends Ce {
|
|
|
17987
17987
|
fromPubKeys(e, t, n = !0) {
|
|
17988
17988
|
if (typeof e != "number")
|
|
17989
17989
|
throw new Error("m must be a number");
|
|
17990
|
-
n === !0 && (t = Ae.sortPubKeys(t)), this.writeOpCode(e +
|
|
17990
|
+
n === !0 && (t = Ae.sortPubKeys(t)), this.writeOpCode(e + q.OP_1 - 1);
|
|
17991
17991
|
for (const u in t)
|
|
17992
17992
|
this.writeBuffer(t[u].toBuffer());
|
|
17993
|
-
return this.writeOpCode(t.length +
|
|
17993
|
+
return this.writeOpCode(t.length + q.OP_1 - 1), this.writeOpCode(q.OP_CHECKMULTISIG), this;
|
|
17994
17994
|
}
|
|
17995
17995
|
static fromPubKeys(e, t, n) {
|
|
17996
17996
|
return new this().fromPubKeys(e, t, n);
|
|
@@ -17998,30 +17998,30 @@ class Ae extends Ce {
|
|
|
17998
17998
|
removeCodeseparators() {
|
|
17999
17999
|
const e = [];
|
|
18000
18000
|
for (let t = 0; t < this.chunks.length; t++)
|
|
18001
|
-
this.chunks[t].opCodeNum !==
|
|
18001
|
+
this.chunks[t].opCodeNum !== q.OP_CODESEPARATOR && e.push(this.chunks[t]);
|
|
18002
18002
|
return this.chunks = e, this;
|
|
18003
18003
|
}
|
|
18004
18004
|
isPushOnly() {
|
|
18005
18005
|
for (let e = 0; e < this.chunks.length; e++)
|
|
18006
|
-
if (this.chunks[e].opCodeNum >
|
|
18006
|
+
if (this.chunks[e].opCodeNum > q.OP_16)
|
|
18007
18007
|
return !1;
|
|
18008
18008
|
return !0;
|
|
18009
18009
|
}
|
|
18010
18010
|
isNonSpendable() {
|
|
18011
|
-
const e = this.chunks[0].opCodeNum ===
|
|
18011
|
+
const e = this.chunks[0].opCodeNum === q.OP_FALSE, t = this.chunks[1] && this.chunks[1].opCodeNum === q.OP_RETURN;
|
|
18012
18012
|
return !!e && !!t;
|
|
18013
18013
|
}
|
|
18014
18014
|
isOpReturn() {
|
|
18015
|
-
return this.chunks[0].opCodeNum ===
|
|
18015
|
+
return this.chunks[0].opCodeNum === q.OP_RETURN && this.chunks.filter((e) => Buffer.isBuffer(e.buf)).length === this.chunks.slice(1).length;
|
|
18016
18016
|
}
|
|
18017
18017
|
isSafeDataOut() {
|
|
18018
|
-
if (this.chunks.length < 2 || this.chunks[0].opCodeNum !==
|
|
18018
|
+
if (this.chunks.length < 2 || this.chunks[0].opCodeNum !== q.OP_FALSE)
|
|
18019
18019
|
return !1;
|
|
18020
18020
|
const e = this.chunks.slice(1);
|
|
18021
18021
|
return new Ae(e).isOpReturn();
|
|
18022
18022
|
}
|
|
18023
18023
|
isPubKeyHashOut() {
|
|
18024
|
-
return !!(this.chunks[0] && this.chunks[0].opCodeNum ===
|
|
18024
|
+
return !!(this.chunks[0] && this.chunks[0].opCodeNum === q.OP_DUP && this.chunks[1] && this.chunks[1].opCodeNum === q.OP_HASH160 && this.chunks[2].buf && this.chunks[3] && this.chunks[3].opCodeNum === q.OP_EQUALVERIFY && this.chunks[4] && this.chunks[4].opCodeNum === q.OP_CHECKSIG);
|
|
18025
18025
|
}
|
|
18026
18026
|
/**
|
|
18027
18027
|
* A pubKeyHash input should consist of two push operations. The first push
|
|
@@ -18029,11 +18029,11 @@ class Ae extends Ce {
|
|
|
18029
18029
|
* for some partially signed (and invalid) transactions.
|
|
18030
18030
|
*/
|
|
18031
18031
|
isPubKeyHashIn() {
|
|
18032
|
-
return !!(this.chunks.length === 2 && (this.chunks[0].buf || this.chunks[0].opCodeNum ===
|
|
18032
|
+
return !!(this.chunks.length === 2 && (this.chunks[0].buf || this.chunks[0].opCodeNum === q.OP_0) && (this.chunks[1].buf || this.chunks[0].opCodeNum === q.OP_0));
|
|
18033
18033
|
}
|
|
18034
18034
|
isScriptHashOut() {
|
|
18035
18035
|
const e = this.toBuffer();
|
|
18036
|
-
return e.length === 23 && e[0] ===
|
|
18036
|
+
return e.length === 23 && e[0] === q.OP_HASH160 && e[1] === 20 && e[22] === q.OP_EQUAL;
|
|
18037
18037
|
}
|
|
18038
18038
|
/**
|
|
18039
18039
|
* Note that these are frequently indistinguishable from pubKeyHashin
|
|
@@ -18049,7 +18049,7 @@ class Ae extends Ce {
|
|
|
18049
18049
|
return !0;
|
|
18050
18050
|
}
|
|
18051
18051
|
isMultiSigOut() {
|
|
18052
|
-
const e = this.chunks[0].opCodeNum -
|
|
18052
|
+
const e = this.chunks[0].opCodeNum - q.OP_1 + 1;
|
|
18053
18053
|
if (!(e >= 1 && e <= 16) || !this.chunks.slice(1, this.chunks.length - 2).every((u) => {
|
|
18054
18054
|
try {
|
|
18055
18055
|
const r = u.buf;
|
|
@@ -18059,11 +18059,11 @@ class Ae extends Ce {
|
|
|
18059
18059
|
}
|
|
18060
18060
|
}))
|
|
18061
18061
|
return !1;
|
|
18062
|
-
const n = this.chunks[this.chunks.length - 2].opCodeNum -
|
|
18063
|
-
return !(!(n >= e && n <= 16) || this.chunks[1 + n + 1].opCodeNum !==
|
|
18062
|
+
const n = this.chunks[this.chunks.length - 2].opCodeNum - q.OP_1 + 1;
|
|
18063
|
+
return !(!(n >= e && n <= 16) || this.chunks[1 + n + 1].opCodeNum !== q.OP_CHECKMULTISIG);
|
|
18064
18064
|
}
|
|
18065
18065
|
isMultiSigIn() {
|
|
18066
|
-
if (this.chunks[0].opCodeNum !==
|
|
18066
|
+
if (this.chunks[0].opCodeNum !== q.OP_0)
|
|
18067
18067
|
return !1;
|
|
18068
18068
|
const e = this.chunks.slice(1);
|
|
18069
18069
|
return e.length < 1 ? !1 : e.every(
|
|
@@ -18082,7 +18082,7 @@ class Ae extends Ce {
|
|
|
18082
18082
|
const t = e.toBuffer();
|
|
18083
18083
|
for (let n = 0; n < this.chunks.length; n++) {
|
|
18084
18084
|
const r = new Ae([this.chunks[n]]).toBuffer();
|
|
18085
|
-
|
|
18085
|
+
Ft(t, r) && this.chunks.splice(n, 1);
|
|
18086
18086
|
}
|
|
18087
18087
|
return this;
|
|
18088
18088
|
}
|
|
@@ -18110,17 +18110,17 @@ class Ae extends Ce {
|
|
|
18110
18110
|
}
|
|
18111
18111
|
// write a big number in the minimal way
|
|
18112
18112
|
writeBn(e) {
|
|
18113
|
-
if (e.cmp(0) ===
|
|
18113
|
+
if (e.cmp(0) === q.OP_0)
|
|
18114
18114
|
this.chunks.push({
|
|
18115
|
-
opCodeNum:
|
|
18115
|
+
opCodeNum: q.OP_0
|
|
18116
18116
|
});
|
|
18117
18117
|
else if (e.cmp(-1) === 0)
|
|
18118
18118
|
this.chunks.push({
|
|
18119
|
-
opCodeNum:
|
|
18119
|
+
opCodeNum: q.OP_1NEGATE
|
|
18120
18120
|
});
|
|
18121
18121
|
else if (e.cmp(1) >= 0 && e.cmp(16) <= 0)
|
|
18122
18122
|
this.chunks.push({
|
|
18123
|
-
opCodeNum: e.toNumber() +
|
|
18123
|
+
opCodeNum: e.toNumber() + q.OP_1 - 1
|
|
18124
18124
|
});
|
|
18125
18125
|
else {
|
|
18126
18126
|
const t = e.toSm({ endian: "little" });
|
|
@@ -18145,16 +18145,16 @@ class Ae extends Ce {
|
|
|
18145
18145
|
writeBuffer(e) {
|
|
18146
18146
|
let t;
|
|
18147
18147
|
const n = e.length;
|
|
18148
|
-
if (e.length > 0 && e.length <
|
|
18148
|
+
if (e.length > 0 && e.length < q.OP_PUSHDATA1)
|
|
18149
18149
|
t = e.length;
|
|
18150
18150
|
else if (e.length === 0)
|
|
18151
|
-
t =
|
|
18151
|
+
t = q.OP_0;
|
|
18152
18152
|
else if (e.length < Math.pow(2, 8))
|
|
18153
|
-
t =
|
|
18153
|
+
t = q.OP_PUSHDATA1;
|
|
18154
18154
|
else if (e.length < Math.pow(2, 16))
|
|
18155
|
-
t =
|
|
18155
|
+
t = q.OP_PUSHDATA2;
|
|
18156
18156
|
else if (e.length < Math.pow(2, 32))
|
|
18157
|
-
t =
|
|
18157
|
+
t = q.OP_PUSHDATA4;
|
|
18158
18158
|
else
|
|
18159
18159
|
throw new Error("You can't push that much data");
|
|
18160
18160
|
return this.chunks.push({
|
|
@@ -18173,7 +18173,7 @@ class Ae extends Ce {
|
|
|
18173
18173
|
// comes from bitcoind's script interpreter CheckMinimalPush function
|
|
18174
18174
|
checkMinimalPush(e) {
|
|
18175
18175
|
const t = this.chunks[e], n = t.buf, u = t.opCodeNum;
|
|
18176
|
-
return n ? n.length === 0 ? u ===
|
|
18176
|
+
return n ? n.length === 0 ? u === q.OP_0 : n.length === 1 && n[0] >= 1 && n[0] <= 16 ? u === q.OP_1 + (n[0] - 1) : n.length === 1 && n[0] === 129 ? u === q.OP_1NEGATE : n.length <= 75 ? u === n.length : n.length <= 255 ? u === q.OP_PUSHDATA1 : n.length <= 65535 ? u === q.OP_PUSHDATA2 : !0 : !0;
|
|
18177
18177
|
}
|
|
18178
18178
|
}
|
|
18179
18179
|
class Et extends Ce {
|
|
@@ -18280,7 +18280,7 @@ class Et extends Ce {
|
|
|
18280
18280
|
}
|
|
18281
18281
|
toTxOutScript() {
|
|
18282
18282
|
const e = new Ae();
|
|
18283
|
-
return e.writeOpCode(
|
|
18283
|
+
return e.writeOpCode(q.OP_DUP), e.writeOpCode(q.OP_HASH160), e.writeBuffer(this.hashBuf), e.writeOpCode(q.OP_EQUALVERIFY), e.writeOpCode(q.OP_CHECKSIG), e;
|
|
18284
18284
|
}
|
|
18285
18285
|
fromTxInScript(e) {
|
|
18286
18286
|
const t = ae.sha256Ripemd160(e.chunks[1].buf || Buffer.from("00".repeat(32), "hex"));
|
|
@@ -18570,7 +18570,7 @@ kr.Testnet = class extends kr {
|
|
|
18570
18570
|
);
|
|
18571
18571
|
}
|
|
18572
18572
|
};
|
|
18573
|
-
const
|
|
18573
|
+
const qf = [
|
|
18574
18574
|
"abandon",
|
|
18575
18575
|
"ability",
|
|
18576
18576
|
"able",
|
|
@@ -20620,7 +20620,7 @@ const Ff = [
|
|
|
20620
20620
|
"zone",
|
|
20621
20621
|
"zoo"
|
|
20622
20622
|
];
|
|
20623
|
-
|
|
20623
|
+
qf.space = " ";
|
|
20624
20624
|
const Uf = [
|
|
20625
20625
|
"あいこくしん",
|
|
20626
20626
|
"あいさつ",
|
|
@@ -24725,7 +24725,7 @@ const Hf = [
|
|
|
24725
24725
|
Hf.space = " ";
|
|
24726
24726
|
class Kf extends Ce {
|
|
24727
24727
|
constructor(e, t, n) {
|
|
24728
|
-
super({ mnemonic: e, seed: t, wordlist: n }), this.Wordlist = n ||
|
|
24728
|
+
super({ mnemonic: e, seed: t, wordlist: n }), this.Wordlist = n || qf, this.es = Hf, this.jp = Uf;
|
|
24729
24729
|
}
|
|
24730
24730
|
setLang(e) {
|
|
24731
24731
|
switch (e) {
|
|
@@ -24736,7 +24736,7 @@ class Kf extends Ce {
|
|
|
24736
24736
|
this.Wordlist = Uf;
|
|
24737
24737
|
break;
|
|
24738
24738
|
default:
|
|
24739
|
-
this.Wordlist =
|
|
24739
|
+
this.Wordlist = qf;
|
|
24740
24740
|
break;
|
|
24741
24741
|
}
|
|
24742
24742
|
}
|
|
@@ -25269,7 +25269,7 @@ class yt extends Ce {
|
|
|
25269
25269
|
void 0,
|
|
25270
25270
|
this.sig.compressed
|
|
25271
25271
|
);
|
|
25272
|
-
return
|
|
25272
|
+
return Ft(n.hashBuf, this.address.hashBuf) ? this.verified = !0 : this.verified = !1, this;
|
|
25273
25273
|
}
|
|
25274
25274
|
}
|
|
25275
25275
|
yt.magicBytes = Buffer.from(`Bitcoin Signed Message:
|
|
@@ -25384,7 +25384,7 @@ class Nr extends Ce {
|
|
|
25384
25384
|
};
|
|
25385
25385
|
}
|
|
25386
25386
|
}
|
|
25387
|
-
class
|
|
25387
|
+
class qe extends Ce {
|
|
25388
25388
|
constructor(e) {
|
|
25389
25389
|
super({ buf: e });
|
|
25390
25390
|
}
|
|
@@ -25429,7 +25429,7 @@ class He extends Ce {
|
|
|
25429
25429
|
super({ txHashBuf: e, txOutNum: t, scriptVi: n, script: u, nSequence: r });
|
|
25430
25430
|
}
|
|
25431
25431
|
setScript(e) {
|
|
25432
|
-
return this.scriptVi =
|
|
25432
|
+
return this.scriptVi = qe.fromNumber(e.toBuffer().length), this.script = e, this;
|
|
25433
25433
|
}
|
|
25434
25434
|
fromProperties(e, t, n, u) {
|
|
25435
25435
|
return this.fromObject({ txHashBuf: e, txOutNum: t, nSequence: u }), this.setScript(n), this;
|
|
@@ -25441,7 +25441,7 @@ class He extends Ce {
|
|
|
25441
25441
|
return this.fromObject({
|
|
25442
25442
|
txHashBuf: typeof e.txHashBuf < "u" ? Buffer.from(e.txHashBuf, "hex") : void 0,
|
|
25443
25443
|
txOutNum: e.txOutNum,
|
|
25444
|
-
scriptVi: typeof e.scriptVi < "u" ?
|
|
25444
|
+
scriptVi: typeof e.scriptVi < "u" ? qe.fromJSON(e.scriptVi) : void 0,
|
|
25445
25445
|
script: typeof e.script < "u" ? Ae.fromJSON(e.script) : void 0,
|
|
25446
25446
|
nSequence: e.nSequence
|
|
25447
25447
|
}), this;
|
|
@@ -25456,7 +25456,7 @@ class He extends Ce {
|
|
|
25456
25456
|
};
|
|
25457
25457
|
}
|
|
25458
25458
|
fromBr(e) {
|
|
25459
|
-
return this.txHashBuf = e.read(32), this.txOutNum = e.readUInt32LE(), this.scriptVi =
|
|
25459
|
+
return this.txHashBuf = e.read(32), this.txOutNum = e.readUInt32LE(), this.scriptVi = qe.fromBuffer(e.readVarIntBuf()), this.script = Ae.fromBuffer(e.read(this.scriptVi.toNumber())), this.nSequence = e.readUInt32LE(), this;
|
|
25460
25460
|
}
|
|
25461
25461
|
toBw(e) {
|
|
25462
25462
|
return e || (e = new ke()), e.write(this.txHashBuf), e.writeUInt32LE(this.txOutNum), e.write(this.scriptVi.buf), e.write(this.script.toBuffer()), e.writeUInt32LE(this.nSequence), e;
|
|
@@ -25470,7 +25470,7 @@ class He extends Ce {
|
|
|
25470
25470
|
fromPubKeyHashTxOut(e, t, n, u) {
|
|
25471
25471
|
const r = new Ae();
|
|
25472
25472
|
if (n.script.isPubKeyHashOut())
|
|
25473
|
-
r.writeOpCode(
|
|
25473
|
+
r.writeOpCode(q.OP_0), u ? r.writeBuffer(u.toBuffer()) : r.writeOpCode(q.OP_0);
|
|
25474
25474
|
else
|
|
25475
25475
|
throw new Error("txOut must be of type pubKeyHash");
|
|
25476
25476
|
return this.txHashBuf = e, this.txOutNum = t, this.setScript(r), this;
|
|
@@ -25496,7 +25496,7 @@ class gt extends Ce {
|
|
|
25496
25496
|
super({ valueBn: e, scriptVi: t, script: n });
|
|
25497
25497
|
}
|
|
25498
25498
|
setScript(e) {
|
|
25499
|
-
return this.scriptVi =
|
|
25499
|
+
return this.scriptVi = qe.fromNumber(e.toBuffer().length), this.script = e, this;
|
|
25500
25500
|
}
|
|
25501
25501
|
fromProperties(e, t) {
|
|
25502
25502
|
return this.fromObject({ valueBn: e }), this.setScript(t), this;
|
|
@@ -25507,7 +25507,7 @@ class gt extends Ce {
|
|
|
25507
25507
|
fromJSON(e) {
|
|
25508
25508
|
return this.fromObject({
|
|
25509
25509
|
valueBn: new Z().fromJSON(e.valueBn),
|
|
25510
|
-
scriptVi: new
|
|
25510
|
+
scriptVi: new qe().fromJSON(e.scriptVi),
|
|
25511
25511
|
script: new Ae().fromJSON(e.script)
|
|
25512
25512
|
}), this;
|
|
25513
25513
|
}
|
|
@@ -25519,14 +25519,14 @@ class gt extends Ce {
|
|
|
25519
25519
|
};
|
|
25520
25520
|
}
|
|
25521
25521
|
fromBr(e) {
|
|
25522
|
-
return this.valueBn = e.readUInt64LEBn(), this.scriptVi =
|
|
25522
|
+
return this.valueBn = e.readUInt64LEBn(), this.scriptVi = qe.fromNumber(e.readVarIntNum()), this.script = new Ae().fromBuffer(e.read(this.scriptVi.toNumber())), this;
|
|
25523
25523
|
}
|
|
25524
25524
|
toBw(e) {
|
|
25525
25525
|
return e || (e = new ke()), e.writeUInt64LEBn(this.valueBn), e.write(this.scriptVi.buf), e.write(this.script.toBuffer()), e;
|
|
25526
25526
|
}
|
|
25527
25527
|
}
|
|
25528
25528
|
class Me extends Ce {
|
|
25529
|
-
constructor(e = 1, t =
|
|
25529
|
+
constructor(e = 1, t = qe.fromNumber(0), n = [], u = qe.fromNumber(0), r = [], s = 0) {
|
|
25530
25530
|
super({ versionBytesNum: e, txInsVi: t, txIns: n, txOutsVi: u, txOuts: r, nLockTime: s });
|
|
25531
25531
|
}
|
|
25532
25532
|
fromJSON(e) {
|
|
@@ -25539,9 +25539,9 @@ class Me extends Ce {
|
|
|
25539
25539
|
n.push(new gt().fromJSON(u));
|
|
25540
25540
|
}), this.fromObject({
|
|
25541
25541
|
versionBytesNum: e.versionBytesNum,
|
|
25542
|
-
txInsVi: new
|
|
25542
|
+
txInsVi: new qe().fromJSON(e.txInsVi),
|
|
25543
25543
|
txIns: t,
|
|
25544
|
-
txOutsVi: new
|
|
25544
|
+
txOutsVi: new qe().fromJSON(e.txOutsVi),
|
|
25545
25545
|
txOuts: n,
|
|
25546
25546
|
nLockTime: e.nLockTime
|
|
25547
25547
|
}), this;
|
|
@@ -25564,12 +25564,12 @@ class Me extends Ce {
|
|
|
25564
25564
|
};
|
|
25565
25565
|
}
|
|
25566
25566
|
fromBr(e) {
|
|
25567
|
-
this.versionBytesNum = e.readUInt32LE(), this.txInsVi = new
|
|
25567
|
+
this.versionBytesNum = e.readUInt32LE(), this.txInsVi = new qe(e.readVarIntBuf());
|
|
25568
25568
|
const t = this.txInsVi.toNumber();
|
|
25569
25569
|
this.txIns = [];
|
|
25570
25570
|
for (let u = 0; u < t; u++)
|
|
25571
25571
|
this.txIns.push(new He().fromBr(e));
|
|
25572
|
-
this.txOutsVi = new
|
|
25572
|
+
this.txOutsVi = new qe(e.readVarIntBuf());
|
|
25573
25573
|
const n = this.txOutsVi.toNumber();
|
|
25574
25574
|
this.txOuts = [];
|
|
25575
25575
|
for (let u = 0; u < n; u++)
|
|
@@ -25645,7 +25645,7 @@ class Me extends Ce {
|
|
|
25645
25645
|
if (a.txIns[t] = He.fromBuffer(
|
|
25646
25646
|
a.txIns[t].toBuffer()
|
|
25647
25647
|
).setScript(n), (e & 31) === he.SIGHASH_NONE) {
|
|
25648
|
-
a.txOuts.length = 0, a.txOutsVi =
|
|
25648
|
+
a.txOuts.length = 0, a.txOutsVi = qe.fromNumber(0);
|
|
25649
25649
|
for (let f = 0; f < a.txIns.length; f++)
|
|
25650
25650
|
f !== t && (a.txIns[f].nSequence = 0);
|
|
25651
25651
|
} else if ((e & 31) === he.SIGHASH_SINGLE) {
|
|
@@ -25654,7 +25654,7 @@ class Me extends Ce {
|
|
|
25654
25654
|
"0000000000000000000000000000000000000000000000000000000000000001",
|
|
25655
25655
|
"hex"
|
|
25656
25656
|
);
|
|
25657
|
-
a.txOuts.length = t + 1, a.txOutsVi =
|
|
25657
|
+
a.txOuts.length = t + 1, a.txOutsVi = qe.fromNumber(t + 1);
|
|
25658
25658
|
for (let f = 0; f < a.txOuts.length; f++)
|
|
25659
25659
|
f < t && (a.txOuts[f] = gt.fromProperties(
|
|
25660
25660
|
new Z().fromBuffer(Buffer.from("ffffffffffffffff", "hex")),
|
|
@@ -25663,7 +25663,7 @@ class Me extends Ce {
|
|
|
25663
25663
|
for (let f = 0; f < a.txIns.length; f++)
|
|
25664
25664
|
f !== t && (a.txIns[f].nSequence = 0);
|
|
25665
25665
|
}
|
|
25666
|
-
return e & he.SIGHASH_ANYONECANPAY && (a.txIns[0] = a.txIns[t], a.txIns.length = 1, a.txInsVi =
|
|
25666
|
+
return e & he.SIGHASH_ANYONECANPAY && (a.txIns[0] = a.txIns[t], a.txIns.length = 1, a.txInsVi = qe.fromNumber(1)), new ke().write(a.toBuffer()).writeUInt32LE(e >>> 0).toBuffer();
|
|
25667
25667
|
}
|
|
25668
25668
|
async asyncSighashPreimage(e, t, n, u, r = 0, s = {}) {
|
|
25669
25669
|
return (await be.asyncObjectMethod(this, "sighashPreimage", [
|
|
@@ -25727,11 +25727,11 @@ class Me extends Ce {
|
|
|
25727
25727
|
}
|
|
25728
25728
|
addTxIn(e, t, n, u) {
|
|
25729
25729
|
let r;
|
|
25730
|
-
return e instanceof He ? r = e : r = new He().fromObject({ txHashBuf: e, txOutNum: t, nSequence: u }).setScript(n), this.txIns.push(r), this.txInsVi =
|
|
25730
|
+
return e instanceof He ? r = e : r = new He().fromObject({ txHashBuf: e, txOutNum: t, nSequence: u }).setScript(n), this.txIns.push(r), this.txInsVi = qe.fromNumber(this.txInsVi.toNumber() + 1), this;
|
|
25731
25731
|
}
|
|
25732
25732
|
addTxOut(e, t) {
|
|
25733
25733
|
let n;
|
|
25734
|
-
return e instanceof gt ? n = e : n = new gt().fromObject({ valueBn: e }).setScript(t), this.txOuts.push(n), this.txOutsVi =
|
|
25734
|
+
return e instanceof gt ? n = e : n = new gt().fromObject({ valueBn: e }).setScript(t), this.txOuts.push(n), this.txOutsVi = qe.fromNumber(this.txOutsVi.toNumber() + 1), this;
|
|
25735
25735
|
}
|
|
25736
25736
|
/**
|
|
25737
25737
|
* Analagous to bitcoind's IsCoinBase function in transaction.h
|
|
@@ -25758,7 +25758,7 @@ class ss extends Ce {
|
|
|
25758
25758
|
t.push(new Me().fromJSON(n));
|
|
25759
25759
|
}), this.fromObject({
|
|
25760
25760
|
blockHeader: new Pr().fromJSON(e.blockHeader),
|
|
25761
|
-
txsVi: new
|
|
25761
|
+
txsVi: new qe().fromJSON(e.txsVi),
|
|
25762
25762
|
txs: t
|
|
25763
25763
|
}), this;
|
|
25764
25764
|
}
|
|
@@ -25773,7 +25773,7 @@ class ss extends Ce {
|
|
|
25773
25773
|
};
|
|
25774
25774
|
}
|
|
25775
25775
|
fromBr(e) {
|
|
25776
|
-
this.blockHeader = new Pr().fromBr(e), this.txsVi = new
|
|
25776
|
+
this.blockHeader = new Pr().fromBr(e), this.txsVi = new qe(e.readVarIntBuf());
|
|
25777
25777
|
const t = this.txsVi.toNumber();
|
|
25778
25778
|
this.txs = [];
|
|
25779
25779
|
for (let n = 0; n < t; n++)
|
|
@@ -25814,7 +25814,7 @@ class ss extends Ce {
|
|
|
25814
25814
|
* @param {Buffer} blockBuf A buffer of a block.
|
|
25815
25815
|
*/
|
|
25816
25816
|
static iterateTxs(e) {
|
|
25817
|
-
const t = new ot(e), n = new Pr().fromBr(t), u = new
|
|
25817
|
+
const t = new ot(e), n = new Pr().fromBr(t), u = new qe(t.readVarIntBuf()), r = u.toNumber();
|
|
25818
25818
|
return {
|
|
25819
25819
|
blockHeader: n,
|
|
25820
25820
|
txsVi: u,
|
|
@@ -25916,7 +25916,7 @@ class C1 {
|
|
|
25916
25916
|
time: Math.floor(Date.now() / 1e3),
|
|
25917
25917
|
bits: n,
|
|
25918
25918
|
nonce: 0
|
|
25919
|
-
}), r = [this.createCoinbaseTx(), ...e], s = new
|
|
25919
|
+
}), r = [this.createCoinbaseTx(), ...e], s = new qe().fromNumber(r.length);
|
|
25920
25920
|
return new k1(u, s, r);
|
|
25921
25921
|
}
|
|
25922
25922
|
/** Calculate merkle root from transactions */
|
|
@@ -25937,27 +25937,27 @@ class C1 {
|
|
|
25937
25937
|
}
|
|
25938
25938
|
}
|
|
25939
25939
|
const N1 = [
|
|
25940
|
-
|
|
25941
|
-
|
|
25942
|
-
|
|
25943
|
-
|
|
25944
|
-
|
|
25945
|
-
|
|
25946
|
-
|
|
25947
|
-
|
|
25948
|
-
|
|
25949
|
-
|
|
25950
|
-
|
|
25951
|
-
|
|
25952
|
-
|
|
25953
|
-
|
|
25954
|
-
|
|
25940
|
+
q.OP_CAT,
|
|
25941
|
+
q.OP_SUBSTR,
|
|
25942
|
+
q.OP_LEFT,
|
|
25943
|
+
q.OP_RIGHT,
|
|
25944
|
+
q.OP_INVERT,
|
|
25945
|
+
q.OP_AND,
|
|
25946
|
+
q.OP_OR,
|
|
25947
|
+
q.OP_XOR,
|
|
25948
|
+
q.OP_2MUL,
|
|
25949
|
+
q.OP_2DIV,
|
|
25950
|
+
q.OP_MUL,
|
|
25951
|
+
q.OP_DIV,
|
|
25952
|
+
q.OP_MOD,
|
|
25953
|
+
q.OP_LSHIFT,
|
|
25954
|
+
q.OP_RSHIFT
|
|
25955
25955
|
];
|
|
25956
25956
|
function jf(l) {
|
|
25957
25957
|
return l.length === 0 || (l[l.length - 1] & 127) !== 0 ? l : l.length === 1 ? [] : (l[l.length - 2] & 128) === 0 ? jf(l.slice(0, l.length - 1)) : l;
|
|
25958
25958
|
}
|
|
25959
|
-
class
|
|
25960
|
-
constructor(e, t, n, u = [], r = [], s = 0, a = 0, o = 0, f = [], i = "", c =
|
|
25959
|
+
class re extends Ce {
|
|
25960
|
+
constructor(e, t, n, u = [], r = [], s = 0, a = 0, o = 0, f = [], i = "", c = re.defaultFlags, h = new Z(0)) {
|
|
25961
25961
|
super({
|
|
25962
25962
|
script: e,
|
|
25963
25963
|
tx: t,
|
|
@@ -25974,26 +25974,26 @@ class ie extends Ce {
|
|
|
25974
25974
|
});
|
|
25975
25975
|
}
|
|
25976
25976
|
initialize() {
|
|
25977
|
-
return this.script = new Ae(), this.stack = [], this.altStack = [], this.pc = 0, this.pBeginCodeHash = 0, this.nOpCount = 0, this.ifStack = [], this.errStr = "", this.flags =
|
|
25977
|
+
return this.script = new Ae(), this.stack = [], this.altStack = [], this.pc = 0, this.pBeginCodeHash = 0, this.nOpCount = 0, this.ifStack = [], this.errStr = "", this.flags = re.defaultFlags, this.setLimits(), this;
|
|
25978
25978
|
}
|
|
25979
25979
|
setLimits() {
|
|
25980
|
-
return this.scriptLimit = this.isPreGenesis() ?
|
|
25980
|
+
return this.scriptLimit = this.isPreGenesis() ? re.PREGENESIS_SCRIPT_LIMIT : 1e7, this.stackLimit = this.isPreGenesis() ? re.PREGENESIS_STACK_LIMIT : 1e7, this;
|
|
25981
25981
|
}
|
|
25982
25982
|
// Restore pre-Genesis limits and disabled opcodes.
|
|
25983
25983
|
isPreGenesis() {
|
|
25984
|
-
return (this.flags &
|
|
25984
|
+
return (this.flags & re.SCRIPT_VERIFY_PREGENESIS_LIMITS) !== 0;
|
|
25985
25985
|
}
|
|
25986
25986
|
// Chronicle rules apply via the flag or a transaction version above 1.
|
|
25987
25987
|
isChronicle() {
|
|
25988
|
-
return (this.flags &
|
|
25988
|
+
return (this.flags & re.SCRIPT_VERIFY_CHRONICLE) !== 0 || this.tx !== void 0 && this.tx.versionBytesNum > 1;
|
|
25989
25989
|
}
|
|
25990
25990
|
// Maximum script number length for the active policy.
|
|
25991
25991
|
scriptNumMaxSize() {
|
|
25992
|
-
return this.isPreGenesis() ?
|
|
25992
|
+
return this.isPreGenesis() ? re.PREGENESIS_SCRIPT_NUM_LENGTH : this.isChronicle() ? re.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_CHRONICLE : re.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS;
|
|
25993
25993
|
}
|
|
25994
25994
|
// Maximum push size for the active policy.
|
|
25995
25995
|
maxScriptElementSize() {
|
|
25996
|
-
return this.isPreGenesis() ?
|
|
25996
|
+
return this.isPreGenesis() ? re.PREGENESIS_MAX_SCRIPT_ELEMENT_SIZE : re.MAX_SCRIPT_ELEMENT_SIZE;
|
|
25997
25997
|
}
|
|
25998
25998
|
// Transaction version as a little-endian uint32, as pushed by OP_VER.
|
|
25999
25999
|
versionBuf() {
|
|
@@ -26007,7 +26007,7 @@ class ie extends Ce {
|
|
|
26007
26007
|
}
|
|
26008
26008
|
// Execute a Chronicle-only string or numeric shift opcode.
|
|
26009
26009
|
stepChronicleOp(e, t) {
|
|
26010
|
-
const n = e ===
|
|
26010
|
+
const n = e === q.OP_SUBSTR_CHRONICLE;
|
|
26011
26011
|
if (this.stack.length < (n ? 3 : 2))
|
|
26012
26012
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
26013
26013
|
let u, r = 0, s, a;
|
|
@@ -26017,7 +26017,7 @@ class ie extends Ce {
|
|
|
26017
26017
|
t,
|
|
26018
26018
|
this.scriptNumMaxSize()
|
|
26019
26019
|
);
|
|
26020
|
-
if (n || e ===
|
|
26020
|
+
if (n || e === q.OP_LEFT_CHRONICLE || e === q.OP_RIGHT_CHRONICLE ? u = h.toNumber() : s = h.toNumber(), n) {
|
|
26021
26021
|
const d = this.stack[this.stack.length - 2];
|
|
26022
26022
|
r = new Z().fromScriptNumBuffer(d, t, this.scriptNumMaxSize()).toNumber();
|
|
26023
26023
|
} else if (!n) {
|
|
@@ -26031,18 +26031,18 @@ class ie extends Ce {
|
|
|
26031
26031
|
} catch (c) {
|
|
26032
26032
|
return this.errStr = c.message.includes("overflow") ? "SCRIPTNUM_OVERFLOW" : "SCRIPT_ERR_UNKNOWN_ERROR", !1;
|
|
26033
26033
|
}
|
|
26034
|
-
if (n || e ===
|
|
26034
|
+
if (n || e === q.OP_LEFT_CHRONICLE || e === q.OP_RIGHT_CHRONICLE) {
|
|
26035
26035
|
const c = this.stack.length - (n ? 3 : 2), h = this.stack[c], d = h.length;
|
|
26036
26036
|
if (u < 0 || u > d || n && (r < 0 || r >= d || u > d - r))
|
|
26037
26037
|
return this.errStr = "SCRIPT_ERR_INVALID_NUMBER_RANGE", !1;
|
|
26038
|
-
const b = n ? r : e ===
|
|
26038
|
+
const b = n ? r : e === q.OP_LEFT_CHRONICLE ? 0 : d - u;
|
|
26039
26039
|
return this.stack[c] = h.slice(b, b + u), this.stack.pop(), n && this.stack.pop(), !0;
|
|
26040
26040
|
}
|
|
26041
26041
|
if (s < 0)
|
|
26042
26042
|
return this.errStr = "SCRIPT_ERR_INVALID_NUMBER_RANGE", !1;
|
|
26043
26043
|
const o = a.negative, f = a.abs();
|
|
26044
26044
|
let i;
|
|
26045
|
-
if (e ===
|
|
26045
|
+
if (e === q.OP_LSHIFTNUM)
|
|
26046
26046
|
i = f.ushln(s);
|
|
26047
26047
|
else {
|
|
26048
26048
|
const c = new Z(1).ushln(s);
|
|
@@ -26062,20 +26062,20 @@ class ie extends Ce {
|
|
|
26062
26062
|
checkSigEncoding(e) {
|
|
26063
26063
|
if (e.length === 0)
|
|
26064
26064
|
return !0;
|
|
26065
|
-
if ((this.flags & (
|
|
26065
|
+
if ((this.flags & (re.SCRIPT_VERIFY_DERSIG | re.SCRIPT_VERIFY_LOW_S | re.SCRIPT_VERIFY_STRICTENC)) !== 0 && !he.IsTxDer(e))
|
|
26066
26066
|
return this.errStr = "SCRIPT_ERR_SIG_DER", !1;
|
|
26067
|
-
if ((this.flags &
|
|
26067
|
+
if ((this.flags & re.SCRIPT_VERIFY_LOW_S) !== 0 && !this.isChronicle()) {
|
|
26068
26068
|
if (!new he().fromTxFormat(e).hasLowS())
|
|
26069
26069
|
return this.errStr = "SCRIPT_ERR_SIG_DER", !1;
|
|
26070
|
-
} else if ((this.flags &
|
|
26070
|
+
} else if ((this.flags & re.SCRIPT_VERIFY_STRICTENC) !== 0) {
|
|
26071
26071
|
const t = new he().fromTxFormat(e);
|
|
26072
26072
|
if (!t.hasDefinedHashType())
|
|
26073
26073
|
return this.errStr = "SCRIPT_ERR_SIG_HASHTYPE", !1;
|
|
26074
|
-
if (!(this.flags &
|
|
26074
|
+
if (!(this.flags & re.SCRIPT_ENABLE_SIGHASH_FORKID) && t.nHashType & he.SIGHASH_FORKID)
|
|
26075
26075
|
return this.errStr = "SCRIPT_ERR_ILLEGAL_FORKID", !1;
|
|
26076
26076
|
if (t.isChronicle() && !this.isChronicle())
|
|
26077
26077
|
return this.errStr = "SCRIPT_ERR_ILLEGAL_CHRONICLE", !1;
|
|
26078
|
-
if (this.flags &
|
|
26078
|
+
if (this.flags & re.SCRIPT_ENABLE_SIGHASH_FORKID && !(t.nHashType & he.SIGHASH_FORKID) && this.flags & re.SCRIPT_VERIFY_STRICTENC)
|
|
26079
26079
|
return this.errStr = "SCRIPT_ERR_MUST_USE_FORKID", !1;
|
|
26080
26080
|
}
|
|
26081
26081
|
return !0;
|
|
@@ -26084,13 +26084,13 @@ class ie extends Ce {
|
|
|
26084
26084
|
* Translated from bitcoin core's CheckPubKeyEncoding
|
|
26085
26085
|
*/
|
|
26086
26086
|
checkPubKeyEncoding(e) {
|
|
26087
|
-
return (this.flags &
|
|
26087
|
+
return (this.flags & re.SCRIPT_VERIFY_STRICTENC) !== 0 && !Ue.isCompressedOrUncompressed(e) ? (this.errStr = "SCRIPT_ERR_PUBKEYTYPE", !1) : !0;
|
|
26088
26088
|
}
|
|
26089
26089
|
/**
|
|
26090
26090
|
* Translated from bitcoin core's CheckLockTime
|
|
26091
26091
|
*/
|
|
26092
26092
|
checkLockTime(e) {
|
|
26093
|
-
return !(!(this.tx.nLockTime <
|
|
26093
|
+
return !(!(this.tx.nLockTime < re.LOCKTIME_THRESHOLD && e < re.LOCKTIME_THRESHOLD || this.tx.nLockTime >= re.LOCKTIME_THRESHOLD && e >= re.LOCKTIME_THRESHOLD) || e > this.tx.nLockTime || this.tx.txIns[this.nIn].nSequence === 4294967295);
|
|
26094
26094
|
}
|
|
26095
26095
|
/**
|
|
26096
26096
|
* Translated from bitcoin core's CheckSequence
|
|
@@ -26106,7 +26106,7 @@ class ie extends Ce {
|
|
|
26106
26106
|
* opcode and then returns. To evaluate an entire script, use eval().
|
|
26107
26107
|
*/
|
|
26108
26108
|
*step() {
|
|
26109
|
-
const e = (this.flags &
|
|
26109
|
+
const e = (this.flags & re.SCRIPT_VERIFY_MINIMALDATA) !== 0 && !this.isChronicle();
|
|
26110
26110
|
if (this.pc >= this.script.chunks.length)
|
|
26111
26111
|
return !0;
|
|
26112
26112
|
const t = this.script.chunks[this.pc];
|
|
@@ -26114,56 +26114,56 @@ class ie extends Ce {
|
|
|
26114
26114
|
const n = t.opCodeNum, u = this.ifStack.indexOf(!1) === -1;
|
|
26115
26115
|
if (t.buf && t.buf.length > this.maxScriptElementSize())
|
|
26116
26116
|
return this.errStr = "SCRIPT_ERR_PUSH_SIZE", !1;
|
|
26117
|
-
if (n >
|
|
26117
|
+
if (n > q.OP_16 && ++this.nOpCount > 201)
|
|
26118
26118
|
return this.errStr = "SCRIPT_ERR_OP_COUNT", !1;
|
|
26119
|
-
if ((n ===
|
|
26119
|
+
if ((n === q.OP_2MUL || n === q.OP_2DIV) && !this.isChronicle())
|
|
26120
26120
|
return this.errStr = "SCRIPT_ERR_DISABLED_OPCODE", !1;
|
|
26121
|
-
if (u && n >= 0 && n <=
|
|
26121
|
+
if (u && n >= 0 && n <= q.OP_PUSHDATA4) {
|
|
26122
26122
|
if (e && !this.script.checkMinimalPush(this.pc - 1))
|
|
26123
26123
|
return this.errStr = "SCRIPT_ERR_MINIMALDATA", !1;
|
|
26124
26124
|
if (!t.buf)
|
|
26125
|
-
this.stack.push(
|
|
26125
|
+
this.stack.push(re.false);
|
|
26126
26126
|
else {
|
|
26127
26127
|
if (t.len !== t.buf.length)
|
|
26128
26128
|
throw new Error("length of push value not equal to length of data");
|
|
26129
26129
|
this.stack.push(t.buf);
|
|
26130
26130
|
}
|
|
26131
|
-
} else if (u ||
|
|
26131
|
+
} else if (u || q.OP_IF <= n && n <= q.OP_ENDIF)
|
|
26132
26132
|
switch (n) {
|
|
26133
26133
|
//
|
|
26134
26134
|
// Push value
|
|
26135
26135
|
//
|
|
26136
|
-
case
|
|
26137
|
-
case
|
|
26138
|
-
case
|
|
26139
|
-
case
|
|
26140
|
-
case
|
|
26141
|
-
case
|
|
26142
|
-
case
|
|
26143
|
-
case
|
|
26144
|
-
case
|
|
26145
|
-
case
|
|
26146
|
-
case
|
|
26147
|
-
case
|
|
26148
|
-
case
|
|
26149
|
-
case
|
|
26150
|
-
case
|
|
26151
|
-
case
|
|
26152
|
-
case
|
|
26136
|
+
case q.OP_1NEGATE:
|
|
26137
|
+
case q.OP_1:
|
|
26138
|
+
case q.OP_2:
|
|
26139
|
+
case q.OP_3:
|
|
26140
|
+
case q.OP_4:
|
|
26141
|
+
case q.OP_5:
|
|
26142
|
+
case q.OP_6:
|
|
26143
|
+
case q.OP_7:
|
|
26144
|
+
case q.OP_8:
|
|
26145
|
+
case q.OP_9:
|
|
26146
|
+
case q.OP_10:
|
|
26147
|
+
case q.OP_11:
|
|
26148
|
+
case q.OP_12:
|
|
26149
|
+
case q.OP_13:
|
|
26150
|
+
case q.OP_14:
|
|
26151
|
+
case q.OP_15:
|
|
26152
|
+
case q.OP_16:
|
|
26153
26153
|
{
|
|
26154
|
-
let r = n - (
|
|
26154
|
+
let r = n - (q.OP_1 - 1), s = new Z(r).toScriptNumBuffer();
|
|
26155
26155
|
this.stack.push(s);
|
|
26156
26156
|
}
|
|
26157
26157
|
break;
|
|
26158
26158
|
//
|
|
26159
26159
|
// Control
|
|
26160
26160
|
//
|
|
26161
|
-
case
|
|
26161
|
+
case q.OP_NOP:
|
|
26162
26162
|
break;
|
|
26163
|
-
case
|
|
26163
|
+
case q.OP_CHECKLOCKTIMEVERIFY:
|
|
26164
26164
|
{
|
|
26165
|
-
if (!(this.flags &
|
|
26166
|
-
if (this.flags &
|
|
26165
|
+
if (!(this.flags & re.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)) {
|
|
26166
|
+
if (this.flags & re.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)
|
|
26167
26167
|
return this.errStr = "SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS", !1;
|
|
26168
26168
|
break;
|
|
26169
26169
|
}
|
|
@@ -26186,10 +26186,10 @@ class ie extends Ce {
|
|
|
26186
26186
|
return this.errStr = "SCRIPT_ERR_UNSATISFIED_LOCKTIME", !1;
|
|
26187
26187
|
}
|
|
26188
26188
|
break;
|
|
26189
|
-
case
|
|
26189
|
+
case q.OP_CHECKSEQUENCEVERIFY:
|
|
26190
26190
|
{
|
|
26191
|
-
if (!(this.flags &
|
|
26192
|
-
if (this.flags &
|
|
26191
|
+
if (!(this.flags & re.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY)) {
|
|
26192
|
+
if (this.flags & re.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)
|
|
26193
26193
|
return this.errStr = "SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS", !1;
|
|
26194
26194
|
break;
|
|
26195
26195
|
}
|
|
@@ -26214,86 +26214,88 @@ class ie extends Ce {
|
|
|
26214
26214
|
return this.errStr = "SCRIPT_ERR_UNSATISFIED_LOCKTIME", !1;
|
|
26215
26215
|
}
|
|
26216
26216
|
break;
|
|
26217
|
-
case
|
|
26218
|
-
case
|
|
26219
|
-
case
|
|
26220
|
-
case
|
|
26221
|
-
case
|
|
26222
|
-
case
|
|
26223
|
-
case
|
|
26224
|
-
case
|
|
26225
|
-
case
|
|
26226
|
-
if (this.isChronicle() && (n ===
|
|
26217
|
+
case q.OP_NOP1:
|
|
26218
|
+
case q.OP_NOP3:
|
|
26219
|
+
case q.OP_NOP4:
|
|
26220
|
+
case q.OP_NOP5:
|
|
26221
|
+
case q.OP_NOP6:
|
|
26222
|
+
case q.OP_NOP7:
|
|
26223
|
+
case q.OP_NOP8:
|
|
26224
|
+
case q.OP_NOP9:
|
|
26225
|
+
case q.OP_NOP10:
|
|
26226
|
+
if (this.isChronicle() && (n === q.OP_SUBSTR_CHRONICLE || n === q.OP_LEFT_CHRONICLE || n === q.OP_RIGHT_CHRONICLE || n === q.OP_LSHIFTNUM || n === q.OP_RSHIFTNUM))
|
|
26227
26227
|
return this.stepChronicleOp(n, e);
|
|
26228
|
-
if (this.flags &
|
|
26228
|
+
if (this.flags & re.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)
|
|
26229
26229
|
return this.errStr = "SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS", !1;
|
|
26230
26230
|
break;
|
|
26231
|
-
case
|
|
26232
|
-
case
|
|
26233
|
-
case
|
|
26234
|
-
case
|
|
26231
|
+
case q.OP_IF:
|
|
26232
|
+
case q.OP_NOTIF:
|
|
26233
|
+
case q.OP_VERIF:
|
|
26234
|
+
case q.OP_VERNOTIF:
|
|
26235
26235
|
{
|
|
26236
|
-
if ((n ===
|
|
26236
|
+
if ((n === q.OP_VERIF || n === q.OP_VERNOTIF) && !this.isChronicle())
|
|
26237
26237
|
return this.errStr = "SCRIPT_ERR_BAD_OPCODE", !1;
|
|
26238
26238
|
let r = !1;
|
|
26239
26239
|
if (u) {
|
|
26240
26240
|
if (this.stack.length < 1)
|
|
26241
26241
|
return this.errStr = "SCRIPT_ERR_UNBALANCED_CONDITIONAL", !1;
|
|
26242
26242
|
const s = this.stack.pop();
|
|
26243
|
-
n ===
|
|
26243
|
+
if ((n === q.OP_IF || n === q.OP_NOTIF) && (this.flags & re.SCRIPT_VERIFY_MINIMALIF) !== 0 && !this.isChronicle() && (s.length > 1 || s.length === 1 && s[0] !== 1))
|
|
26244
|
+
return this.errStr = "SCRIPT_ERR_MINIMALIF", !1;
|
|
26245
|
+
n === q.OP_VERIF || n === q.OP_VERNOTIF ? r = s.length === 4 && s.equals(this.versionBuf()) : r = re.castToBool(s), (n === q.OP_NOTIF || n === q.OP_VERNOTIF) && (r = !r);
|
|
26244
26246
|
}
|
|
26245
26247
|
this.ifStack.push(r);
|
|
26246
26248
|
}
|
|
26247
26249
|
break;
|
|
26248
|
-
case
|
|
26250
|
+
case q.OP_ELSE:
|
|
26249
26251
|
if (this.ifStack.length === 0)
|
|
26250
26252
|
return this.errStr = "SCRIPT_ERR_UNBALANCED_CONDITIONAL", !1;
|
|
26251
26253
|
this.ifStack[this.ifStack.length - 1] = !this.ifStack[this.ifStack.length - 1];
|
|
26252
26254
|
break;
|
|
26253
|
-
case
|
|
26255
|
+
case q.OP_ENDIF:
|
|
26254
26256
|
if (this.ifStack.length === 0)
|
|
26255
26257
|
return this.errStr = "SCRIPT_ERR_UNBALANCED_CONDITIONAL", !1;
|
|
26256
26258
|
this.ifStack.pop();
|
|
26257
26259
|
break;
|
|
26258
|
-
case
|
|
26260
|
+
case q.OP_VER:
|
|
26259
26261
|
{
|
|
26260
26262
|
if (!this.isChronicle())
|
|
26261
26263
|
return this.errStr = "SCRIPT_ERR_BAD_OPCODE", !1;
|
|
26262
26264
|
this.stack.push(this.versionBuf());
|
|
26263
26265
|
}
|
|
26264
26266
|
break;
|
|
26265
|
-
case
|
|
26267
|
+
case q.OP_VERIFY:
|
|
26266
26268
|
{
|
|
26267
26269
|
if (this.stack.length < 1)
|
|
26268
26270
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
26269
26271
|
const r = this.stack[this.stack.length - 1];
|
|
26270
|
-
if (
|
|
26272
|
+
if (re.castToBool(r))
|
|
26271
26273
|
this.stack.pop();
|
|
26272
26274
|
else
|
|
26273
26275
|
return this.errStr = "SCRIPT_ERR_VERIFY", !1;
|
|
26274
26276
|
}
|
|
26275
26277
|
break;
|
|
26276
|
-
case
|
|
26278
|
+
case q.OP_RETURN:
|
|
26277
26279
|
return this.isUnlockingScript && this.isChronicle() ? (this.pc = this.script.chunks.length, this.ifStack = [], !0) : (this.errStr = "SCRIPT_ERR_OP_RETURN", !1);
|
|
26278
26280
|
//
|
|
26279
26281
|
// Stack ops
|
|
26280
26282
|
//
|
|
26281
|
-
case
|
|
26283
|
+
case q.OP_TOALTSTACK:
|
|
26282
26284
|
if (this.stack.length < 1)
|
|
26283
26285
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
26284
26286
|
this.altStack.push(this.stack.pop());
|
|
26285
26287
|
break;
|
|
26286
|
-
case
|
|
26288
|
+
case q.OP_FROMALTSTACK:
|
|
26287
26289
|
if (this.altStack.length < 1)
|
|
26288
26290
|
return this.errStr = "SCRIPT_ERR_INVALID_ALTSTACK_OPERATION", !1;
|
|
26289
26291
|
this.stack.push(this.altStack.pop());
|
|
26290
26292
|
break;
|
|
26291
|
-
case
|
|
26293
|
+
case q.OP_2DROP:
|
|
26292
26294
|
if (this.stack.length < 2)
|
|
26293
26295
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
26294
26296
|
this.stack.pop(), this.stack.pop();
|
|
26295
26297
|
break;
|
|
26296
|
-
case
|
|
26298
|
+
case q.OP_2DUP:
|
|
26297
26299
|
{
|
|
26298
26300
|
if (this.stack.length < 2)
|
|
26299
26301
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
@@ -26301,7 +26303,7 @@ class ie extends Ce {
|
|
|
26301
26303
|
this.stack.push(r), this.stack.push(s);
|
|
26302
26304
|
}
|
|
26303
26305
|
break;
|
|
26304
|
-
case
|
|
26306
|
+
case q.OP_3DUP:
|
|
26305
26307
|
{
|
|
26306
26308
|
if (this.stack.length < 3)
|
|
26307
26309
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
@@ -26309,7 +26311,7 @@ class ie extends Ce {
|
|
|
26309
26311
|
this.stack.push(r), this.stack.push(s), this.stack.push(a);
|
|
26310
26312
|
}
|
|
26311
26313
|
break;
|
|
26312
|
-
case
|
|
26314
|
+
case q.OP_2OVER:
|
|
26313
26315
|
{
|
|
26314
26316
|
if (this.stack.length < 4)
|
|
26315
26317
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
@@ -26317,7 +26319,7 @@ class ie extends Ce {
|
|
|
26317
26319
|
this.stack.push(r), this.stack.push(s);
|
|
26318
26320
|
}
|
|
26319
26321
|
break;
|
|
26320
|
-
case
|
|
26322
|
+
case q.OP_2ROT:
|
|
26321
26323
|
{
|
|
26322
26324
|
if (this.stack.length < 6)
|
|
26323
26325
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
@@ -26325,7 +26327,7 @@ class ie extends Ce {
|
|
|
26325
26327
|
this.stack.push(r[0]), this.stack.push(r[1]);
|
|
26326
26328
|
}
|
|
26327
26329
|
break;
|
|
26328
|
-
case
|
|
26330
|
+
case q.OP_2SWAP:
|
|
26329
26331
|
{
|
|
26330
26332
|
if (this.stack.length < 4)
|
|
26331
26333
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
@@ -26333,42 +26335,42 @@ class ie extends Ce {
|
|
|
26333
26335
|
this.stack.push(r[0]), this.stack.push(r[1]);
|
|
26334
26336
|
}
|
|
26335
26337
|
break;
|
|
26336
|
-
case
|
|
26338
|
+
case q.OP_IFDUP:
|
|
26337
26339
|
{
|
|
26338
26340
|
if (this.stack.length < 1)
|
|
26339
26341
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
26340
26342
|
const r = this.stack[this.stack.length - 1];
|
|
26341
|
-
|
|
26343
|
+
re.castToBool(r) && this.stack.push(r);
|
|
26342
26344
|
}
|
|
26343
26345
|
break;
|
|
26344
|
-
case
|
|
26346
|
+
case q.OP_DEPTH:
|
|
26345
26347
|
{
|
|
26346
26348
|
const r = new Z(this.stack.length).toScriptNumBuffer();
|
|
26347
26349
|
this.stack.push(r);
|
|
26348
26350
|
}
|
|
26349
26351
|
break;
|
|
26350
|
-
case
|
|
26352
|
+
case q.OP_DROP:
|
|
26351
26353
|
if (this.stack.length < 1)
|
|
26352
26354
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
26353
26355
|
this.stack.pop();
|
|
26354
26356
|
break;
|
|
26355
|
-
case
|
|
26357
|
+
case q.OP_DUP:
|
|
26356
26358
|
if (this.stack.length < 1)
|
|
26357
26359
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
26358
26360
|
this.stack.push(this.stack[this.stack.length - 1]);
|
|
26359
26361
|
break;
|
|
26360
|
-
case
|
|
26362
|
+
case q.OP_NIP:
|
|
26361
26363
|
if (this.stack.length < 2)
|
|
26362
26364
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
26363
26365
|
this.stack.splice(this.stack.length - 2, 1);
|
|
26364
26366
|
break;
|
|
26365
|
-
case
|
|
26367
|
+
case q.OP_OVER:
|
|
26366
26368
|
if (this.stack.length < 2)
|
|
26367
26369
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
26368
26370
|
this.stack.push(this.stack[this.stack.length - 2]);
|
|
26369
26371
|
break;
|
|
26370
|
-
case
|
|
26371
|
-
case
|
|
26372
|
+
case q.OP_PICK:
|
|
26373
|
+
case q.OP_ROLL:
|
|
26372
26374
|
{
|
|
26373
26375
|
if (this.stack.length < 2)
|
|
26374
26376
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
@@ -26382,10 +26384,10 @@ class ie extends Ce {
|
|
|
26382
26384
|
if (this.stack.pop(), r < 0 || r >= this.stack.length)
|
|
26383
26385
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
26384
26386
|
const s = this.stack[this.stack.length - r - 1];
|
|
26385
|
-
n ===
|
|
26387
|
+
n === q.OP_ROLL && this.stack.splice(this.stack.length - r - 1, 1), this.stack.push(s);
|
|
26386
26388
|
}
|
|
26387
26389
|
break;
|
|
26388
|
-
case
|
|
26390
|
+
case q.OP_ROT:
|
|
26389
26391
|
{
|
|
26390
26392
|
if (this.stack.length < 3)
|
|
26391
26393
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
@@ -26393,7 +26395,7 @@ class ie extends Ce {
|
|
|
26393
26395
|
this.stack[this.stack.length - 3] = s, this.stack[this.stack.length - 2] = a, this.stack[this.stack.length - 1] = r;
|
|
26394
26396
|
}
|
|
26395
26397
|
break;
|
|
26396
|
-
case
|
|
26398
|
+
case q.OP_SWAP:
|
|
26397
26399
|
{
|
|
26398
26400
|
if (this.stack.length < 2)
|
|
26399
26401
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
@@ -26401,7 +26403,7 @@ class ie extends Ce {
|
|
|
26401
26403
|
this.stack[this.stack.length - 2] = s, this.stack[this.stack.length - 1] = r;
|
|
26402
26404
|
}
|
|
26403
26405
|
break;
|
|
26404
|
-
case
|
|
26406
|
+
case q.OP_TUCK:
|
|
26405
26407
|
if (this.stack.length < 2)
|
|
26406
26408
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
26407
26409
|
this.stack.splice(
|
|
@@ -26410,7 +26412,7 @@ class ie extends Ce {
|
|
|
26410
26412
|
this.stack[this.stack.length - 1]
|
|
26411
26413
|
);
|
|
26412
26414
|
break;
|
|
26413
|
-
case
|
|
26415
|
+
case q.OP_SIZE:
|
|
26414
26416
|
{
|
|
26415
26417
|
if (this.stack.length < 1)
|
|
26416
26418
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
@@ -26421,9 +26423,9 @@ class ie extends Ce {
|
|
|
26421
26423
|
//
|
|
26422
26424
|
// Bitwise logic
|
|
26423
26425
|
//
|
|
26424
|
-
case
|
|
26425
|
-
case
|
|
26426
|
-
case
|
|
26426
|
+
case q.OP_AND:
|
|
26427
|
+
case q.OP_OR:
|
|
26428
|
+
case q.OP_XOR:
|
|
26427
26429
|
{
|
|
26428
26430
|
if (this.stack.length < 2)
|
|
26429
26431
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
@@ -26431,15 +26433,15 @@ class ie extends Ce {
|
|
|
26431
26433
|
if (r.length !== s.length)
|
|
26432
26434
|
return this.errStr = "SCRIPT_ERR_INVALID_OPERAND_SIZE", !1;
|
|
26433
26435
|
switch (n) {
|
|
26434
|
-
case
|
|
26436
|
+
case q.OP_AND:
|
|
26435
26437
|
for (let a = 0; a < r.length; a++)
|
|
26436
26438
|
r[a] &= s[a];
|
|
26437
26439
|
break;
|
|
26438
|
-
case
|
|
26440
|
+
case q.OP_OR:
|
|
26439
26441
|
for (let a = 0; a < r.length; a++)
|
|
26440
26442
|
r[a] |= s[a];
|
|
26441
26443
|
break;
|
|
26442
|
-
case
|
|
26444
|
+
case q.OP_XOR:
|
|
26443
26445
|
for (let a = 0; a < r.length; a++)
|
|
26444
26446
|
r[a] ^= s[a];
|
|
26445
26447
|
break;
|
|
@@ -26447,7 +26449,7 @@ class ie extends Ce {
|
|
|
26447
26449
|
this.stack.pop();
|
|
26448
26450
|
}
|
|
26449
26451
|
break;
|
|
26450
|
-
case
|
|
26452
|
+
case q.OP_INVERT:
|
|
26451
26453
|
{
|
|
26452
26454
|
if (this.stack.length < 1)
|
|
26453
26455
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
@@ -26456,8 +26458,8 @@ class ie extends Ce {
|
|
|
26456
26458
|
r[s] = ~r[s];
|
|
26457
26459
|
}
|
|
26458
26460
|
break;
|
|
26459
|
-
case
|
|
26460
|
-
case
|
|
26461
|
+
case q.OP_LSHIFT:
|
|
26462
|
+
case q.OP_RSHIFT:
|
|
26461
26463
|
{
|
|
26462
26464
|
if (this.stack.length < 2)
|
|
26463
26465
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
@@ -26476,10 +26478,10 @@ class ie extends Ce {
|
|
|
26476
26478
|
if (a < 0)
|
|
26477
26479
|
return this.errStr = "SCRIPT_ERR_INVALID_NUMBER_RANGE", !1;
|
|
26478
26480
|
switch (this.stack.pop(), this.stack.pop(), n) {
|
|
26479
|
-
case
|
|
26481
|
+
case q.OP_LSHIFT:
|
|
26480
26482
|
s = s.shln(a);
|
|
26481
26483
|
break;
|
|
26482
|
-
case
|
|
26484
|
+
case q.OP_RSHIFT:
|
|
26483
26485
|
s = s.shrn(a);
|
|
26484
26486
|
break;
|
|
26485
26487
|
}
|
|
@@ -26487,13 +26489,13 @@ class ie extends Ce {
|
|
|
26487
26489
|
o.length > r.length ? o = o.slice(o.length - r.length) : o.length < r.length && (o = Buffer.concat([Buffer.alloc(r.length - o.length), o])), this.stack.push(o);
|
|
26488
26490
|
}
|
|
26489
26491
|
break;
|
|
26490
|
-
case
|
|
26491
|
-
case
|
|
26492
|
+
case q.OP_EQUAL:
|
|
26493
|
+
case q.OP_EQUALVERIFY:
|
|
26492
26494
|
{
|
|
26493
26495
|
if (this.stack.length < 2)
|
|
26494
26496
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
26495
|
-
const r = this.stack[this.stack.length - 2], s = this.stack[this.stack.length - 1], a =
|
|
26496
|
-
if (this.stack.pop(), this.stack.pop(), this.stack.push(a ?
|
|
26497
|
+
const r = this.stack[this.stack.length - 2], s = this.stack[this.stack.length - 1], a = Ft(r, s);
|
|
26498
|
+
if (this.stack.pop(), this.stack.pop(), this.stack.push(a ? re.true : re.false), n === q.OP_EQUALVERIFY)
|
|
26497
26499
|
if (a)
|
|
26498
26500
|
this.stack.pop();
|
|
26499
26501
|
else
|
|
@@ -26503,16 +26505,16 @@ class ie extends Ce {
|
|
|
26503
26505
|
//
|
|
26504
26506
|
// Numeric
|
|
26505
26507
|
//
|
|
26506
|
-
case
|
|
26507
|
-
case
|
|
26508
|
-
case
|
|
26509
|
-
case
|
|
26510
|
-
case
|
|
26511
|
-
case
|
|
26512
|
-
case
|
|
26513
|
-
case
|
|
26508
|
+
case q.OP_1ADD:
|
|
26509
|
+
case q.OP_1SUB:
|
|
26510
|
+
case q.OP_2MUL:
|
|
26511
|
+
case q.OP_2DIV:
|
|
26512
|
+
case q.OP_NEGATE:
|
|
26513
|
+
case q.OP_ABS:
|
|
26514
|
+
case q.OP_NOT:
|
|
26515
|
+
case q.OP_0NOTEQUAL:
|
|
26514
26516
|
{
|
|
26515
|
-
if ((n ===
|
|
26517
|
+
if ((n === q.OP_2MUL || n === q.OP_2DIV) && !this.isChronicle())
|
|
26516
26518
|
return this.errStr = "SCRIPT_ERR_BAD_OPCODE", !1;
|
|
26517
26519
|
if (this.stack.length < 1)
|
|
26518
26520
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
@@ -26524,50 +26526,50 @@ class ie extends Ce {
|
|
|
26524
26526
|
return this.errStr = a.message.includes("overflow") ? "SCRIPTNUM_OVERFLOW" : "SCRIPT_ERR_UNKNOWN_ERROR", !1;
|
|
26525
26527
|
}
|
|
26526
26528
|
switch (n) {
|
|
26527
|
-
case
|
|
26529
|
+
case q.OP_1ADD:
|
|
26528
26530
|
s = s.add(1);
|
|
26529
26531
|
break;
|
|
26530
|
-
case
|
|
26532
|
+
case q.OP_1SUB:
|
|
26531
26533
|
s = s.sub(1);
|
|
26532
26534
|
break;
|
|
26533
|
-
case
|
|
26535
|
+
case q.OP_2MUL:
|
|
26534
26536
|
s = s.add(s);
|
|
26535
26537
|
break;
|
|
26536
|
-
case
|
|
26538
|
+
case q.OP_2DIV:
|
|
26537
26539
|
s = s.div(new Z(2));
|
|
26538
26540
|
break;
|
|
26539
|
-
case
|
|
26541
|
+
case q.OP_NEGATE:
|
|
26540
26542
|
s = s.neg();
|
|
26541
26543
|
break;
|
|
26542
|
-
case
|
|
26544
|
+
case q.OP_ABS:
|
|
26543
26545
|
s.lt(0) && (s = s.neg());
|
|
26544
26546
|
break;
|
|
26545
|
-
case
|
|
26547
|
+
case q.OP_NOT:
|
|
26546
26548
|
s = new Z(s.eq(0) ? 1 : 0);
|
|
26547
26549
|
break;
|
|
26548
|
-
case
|
|
26550
|
+
case q.OP_0NOTEQUAL:
|
|
26549
26551
|
s = new Z(s.neq(0) ? 1 : 0);
|
|
26550
26552
|
break;
|
|
26551
26553
|
}
|
|
26552
26554
|
this.stack.pop(), this.stack.push(s.toScriptNumBuffer());
|
|
26553
26555
|
}
|
|
26554
26556
|
break;
|
|
26555
|
-
case
|
|
26556
|
-
case
|
|
26557
|
-
case
|
|
26558
|
-
case
|
|
26559
|
-
case
|
|
26560
|
-
case
|
|
26561
|
-
case
|
|
26562
|
-
case
|
|
26563
|
-
case
|
|
26564
|
-
case
|
|
26565
|
-
case
|
|
26566
|
-
case
|
|
26567
|
-
case
|
|
26568
|
-
case
|
|
26569
|
-
case
|
|
26570
|
-
case
|
|
26557
|
+
case q.OP_ADD:
|
|
26558
|
+
case q.OP_SUB:
|
|
26559
|
+
case q.OP_MUL:
|
|
26560
|
+
case q.OP_DIV:
|
|
26561
|
+
case q.OP_MOD:
|
|
26562
|
+
case q.OP_BOOLAND:
|
|
26563
|
+
case q.OP_BOOLOR:
|
|
26564
|
+
case q.OP_NUMEQUAL:
|
|
26565
|
+
case q.OP_NUMEQUALVERIFY:
|
|
26566
|
+
case q.OP_NUMNOTEQUAL:
|
|
26567
|
+
case q.OP_LESSTHAN:
|
|
26568
|
+
case q.OP_GREATERTHAN:
|
|
26569
|
+
case q.OP_LESSTHANOREQUAL:
|
|
26570
|
+
case q.OP_GREATERTHANOREQUAL:
|
|
26571
|
+
case q.OP_MIN:
|
|
26572
|
+
case q.OP_MAX:
|
|
26571
26573
|
{
|
|
26572
26574
|
if (this.stack.length < 2)
|
|
26573
26575
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
@@ -26587,67 +26589,67 @@ class ie extends Ce {
|
|
|
26587
26589
|
}
|
|
26588
26590
|
let a = new Z(0);
|
|
26589
26591
|
switch (n) {
|
|
26590
|
-
case
|
|
26592
|
+
case q.OP_ADD:
|
|
26591
26593
|
a = r.add(s);
|
|
26592
26594
|
break;
|
|
26593
|
-
case
|
|
26595
|
+
case q.OP_SUB:
|
|
26594
26596
|
a = r.sub(s);
|
|
26595
26597
|
break;
|
|
26596
|
-
case
|
|
26598
|
+
case q.OP_MUL:
|
|
26597
26599
|
a = r.mul(s);
|
|
26598
26600
|
break;
|
|
26599
|
-
case
|
|
26601
|
+
case q.OP_DIV:
|
|
26600
26602
|
if (s.eq(0))
|
|
26601
26603
|
return this.errStr = "SCRIPT_ERR_DIV_BY_ZERO", !1;
|
|
26602
26604
|
a = r.div(s);
|
|
26603
26605
|
break;
|
|
26604
|
-
case
|
|
26606
|
+
case q.OP_MOD:
|
|
26605
26607
|
if (s.eq(0))
|
|
26606
26608
|
return this.errStr = "SCRIPT_ERR_DIV_BY_ZERO", !1;
|
|
26607
26609
|
a = r.mod(s);
|
|
26608
26610
|
break;
|
|
26609
|
-
case
|
|
26611
|
+
case q.OP_BOOLAND:
|
|
26610
26612
|
a = new Z(r.neq(0) && s.neq(0) ? 1 : 0);
|
|
26611
26613
|
break;
|
|
26612
|
-
case
|
|
26614
|
+
case q.OP_BOOLOR:
|
|
26613
26615
|
a = new Z(r.neq(0) || s.neq(0) ? 1 : 0);
|
|
26614
26616
|
break;
|
|
26615
|
-
case
|
|
26617
|
+
case q.OP_NUMEQUAL:
|
|
26616
26618
|
a = new Z(r.eq(s) ? 1 : 0);
|
|
26617
26619
|
break;
|
|
26618
|
-
case
|
|
26620
|
+
case q.OP_NUMEQUALVERIFY:
|
|
26619
26621
|
a = new Z(r.eq(s) ? 1 : 0);
|
|
26620
26622
|
break;
|
|
26621
|
-
case
|
|
26623
|
+
case q.OP_NUMNOTEQUAL:
|
|
26622
26624
|
a = new Z(r.neq(s) ? 1 : 0);
|
|
26623
26625
|
break;
|
|
26624
|
-
case
|
|
26626
|
+
case q.OP_LESSTHAN:
|
|
26625
26627
|
a = new Z(r.lt(s) ? 1 : 0);
|
|
26626
26628
|
break;
|
|
26627
|
-
case
|
|
26629
|
+
case q.OP_GREATERTHAN:
|
|
26628
26630
|
a = new Z(r.gt(s) ? 1 : 0);
|
|
26629
26631
|
break;
|
|
26630
|
-
case
|
|
26632
|
+
case q.OP_LESSTHANOREQUAL:
|
|
26631
26633
|
a = new Z(r.leq(s) ? 1 : 0);
|
|
26632
26634
|
break;
|
|
26633
|
-
case
|
|
26635
|
+
case q.OP_GREATERTHANOREQUAL:
|
|
26634
26636
|
a = new Z(r.geq(s) ? 1 : 0);
|
|
26635
26637
|
break;
|
|
26636
|
-
case
|
|
26638
|
+
case q.OP_MIN:
|
|
26637
26639
|
a = r.lt(s) ? r : s;
|
|
26638
26640
|
break;
|
|
26639
|
-
case
|
|
26641
|
+
case q.OP_MAX:
|
|
26640
26642
|
a = r.gt(s) ? r : s;
|
|
26641
26643
|
break;
|
|
26642
26644
|
}
|
|
26643
|
-
if (this.stack.pop(), this.stack.pop(), this.stack.push(a.toScriptNumBuffer()), n ===
|
|
26644
|
-
if (
|
|
26645
|
+
if (this.stack.pop(), this.stack.pop(), this.stack.push(a.toScriptNumBuffer()), n === q.OP_NUMEQUALVERIFY)
|
|
26646
|
+
if (re.castToBool(this.stack[this.stack.length - 1]))
|
|
26645
26647
|
this.stack.pop();
|
|
26646
26648
|
else
|
|
26647
26649
|
return this.errStr = "SCRIPT_ERR_NUMEQUALVERIFY", !1;
|
|
26648
26650
|
}
|
|
26649
26651
|
break;
|
|
26650
|
-
case
|
|
26652
|
+
case q.OP_WITHIN:
|
|
26651
26653
|
{
|
|
26652
26654
|
if (this.stack.length < 3)
|
|
26653
26655
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
@@ -26670,30 +26672,30 @@ class ie extends Ce {
|
|
|
26670
26672
|
return this.errStr = f.message.includes("overflow") ? "SCRIPTNUM_OVERFLOW" : "SCRIPT_ERR_UNKNOWN_ERROR", !1;
|
|
26671
26673
|
}
|
|
26672
26674
|
const o = s.leq(r) && r.lt(a);
|
|
26673
|
-
this.stack.pop(), this.stack.pop(), this.stack.pop(), this.stack.push(o ?
|
|
26675
|
+
this.stack.pop(), this.stack.pop(), this.stack.pop(), this.stack.push(o ? re.true : re.false);
|
|
26674
26676
|
}
|
|
26675
26677
|
break;
|
|
26676
26678
|
//
|
|
26677
26679
|
// Crypto
|
|
26678
26680
|
//
|
|
26679
|
-
case
|
|
26680
|
-
case
|
|
26681
|
-
case
|
|
26682
|
-
case
|
|
26683
|
-
case
|
|
26681
|
+
case q.OP_RIPEMD160:
|
|
26682
|
+
case q.OP_SHA1:
|
|
26683
|
+
case q.OP_SHA256:
|
|
26684
|
+
case q.OP_HASH160:
|
|
26685
|
+
case q.OP_HASH256:
|
|
26684
26686
|
{
|
|
26685
26687
|
if (this.stack.length < 1)
|
|
26686
26688
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
26687
26689
|
const r = this.stack[this.stack.length - 1];
|
|
26688
26690
|
let s;
|
|
26689
|
-
n ===
|
|
26691
|
+
n === q.OP_RIPEMD160 ? s = ae.ripemd160(r) : n === q.OP_SHA1 ? s = ae.sha1(r) : n === q.OP_SHA256 ? s = ae.sha256(r) : n === q.OP_HASH160 ? s = ae.sha256Ripemd160(r) : n === q.OP_HASH256 && (s = ae.sha256Sha256(r)), this.stack.pop(), this.stack.push(s);
|
|
26690
26692
|
}
|
|
26691
26693
|
break;
|
|
26692
|
-
case
|
|
26694
|
+
case q.OP_CODESEPARATOR:
|
|
26693
26695
|
this.pBeginCodeHash = this.pc;
|
|
26694
26696
|
break;
|
|
26695
|
-
case
|
|
26696
|
-
case
|
|
26697
|
+
case q.OP_CHECKSIG:
|
|
26698
|
+
case q.OP_CHECKSIGVERIFY:
|
|
26697
26699
|
{
|
|
26698
26700
|
if (this.stack.length < 2)
|
|
26699
26701
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
@@ -26702,7 +26704,7 @@ class ie extends Ce {
|
|
|
26702
26704
|
return !1;
|
|
26703
26705
|
const a = this.buildSubScript();
|
|
26704
26706
|
if ((r.length > 0 ? r.readUInt8(r.length - 1) : 0) & he.SIGHASH_FORKID) {
|
|
26705
|
-
if (!(this.flags &
|
|
26707
|
+
if (!(this.flags & re.SCRIPT_ENABLE_SIGHASH_FORKID))
|
|
26706
26708
|
return this.errStr = "SCRIPT_ERR_ILLEGAL_FORKID", !1;
|
|
26707
26709
|
} else
|
|
26708
26710
|
a.findAndDelete(new Ae().writeBuffer(r));
|
|
@@ -26714,32 +26716,34 @@ class ie extends Ce {
|
|
|
26714
26716
|
c,
|
|
26715
26717
|
this.nIn,
|
|
26716
26718
|
a,
|
|
26717
|
-
!!(this.flags &
|
|
26719
|
+
!!(this.flags & re.SCRIPT_VERIFY_LOW_S) && !this.isChronicle(),
|
|
26718
26720
|
this.valueBn,
|
|
26719
26721
|
this.flags
|
|
26720
26722
|
);
|
|
26721
26723
|
} catch {
|
|
26722
26724
|
f = !1;
|
|
26723
26725
|
}
|
|
26724
|
-
if (this.
|
|
26726
|
+
if (!f && (this.flags & re.SCRIPT_VERIFY_NULLFAIL) !== 0 && !this.isChronicle() && r.length > 0)
|
|
26727
|
+
return this.errStr = "SCRIPT_ERR_SIG_NULLFAIL", !1;
|
|
26728
|
+
if (this.stack.pop(), this.stack.pop(), this.stack.push(f ? re.true : re.false), n === q.OP_CHECKSIGVERIFY)
|
|
26725
26729
|
if (f)
|
|
26726
26730
|
this.stack.pop();
|
|
26727
26731
|
else
|
|
26728
26732
|
return this.errStr = "SCRIPT_ERR_CHECKSIGVERIFY", !1;
|
|
26729
26733
|
}
|
|
26730
26734
|
break;
|
|
26731
|
-
case
|
|
26732
|
-
case
|
|
26735
|
+
case q.OP_CHECKMULTISIG:
|
|
26736
|
+
case q.OP_CHECKMULTISIGVERIFY:
|
|
26733
26737
|
{
|
|
26734
26738
|
let r = 1;
|
|
26735
26739
|
if (this.stack.length < r)
|
|
26736
26740
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
26737
26741
|
let s;
|
|
26738
26742
|
try {
|
|
26739
|
-
const
|
|
26740
|
-
s = new Z().fromScriptNumBuffer(
|
|
26741
|
-
} catch (
|
|
26742
|
-
return this.errStr =
|
|
26743
|
+
const d = this.stack[this.stack.length - r];
|
|
26744
|
+
s = new Z().fromScriptNumBuffer(d, e).toNumber();
|
|
26745
|
+
} catch (d) {
|
|
26746
|
+
return this.errStr = d.message.includes("overflow") ? "SCRIPTNUM_OVERFLOW" : "SCRIPT_ERR_UNKNOWN_ERROR", !1;
|
|
26743
26747
|
}
|
|
26744
26748
|
if (s < 0 || s > 20)
|
|
26745
26749
|
return this.errStr = "SCRIPT_ERR_PUBKEY_COUNT", !1;
|
|
@@ -26750,10 +26754,10 @@ class ie extends Ce {
|
|
|
26750
26754
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
26751
26755
|
let o;
|
|
26752
26756
|
try {
|
|
26753
|
-
const
|
|
26754
|
-
o = new Z().fromScriptNumBuffer(
|
|
26755
|
-
} catch (
|
|
26756
|
-
return this.errStr =
|
|
26757
|
+
const d = this.stack[this.stack.length - r];
|
|
26758
|
+
o = new Z().fromScriptNumBuffer(d, e).toNumber();
|
|
26759
|
+
} catch (d) {
|
|
26760
|
+
return this.errStr = d.message.includes("overflow") ? "SCRIPTNUM_OVERFLOW" : "SCRIPT_ERR_UNKNOWN_ERROR", !1;
|
|
26757
26761
|
}
|
|
26758
26762
|
if (o < 0 || o > s)
|
|
26759
26763
|
return this.errStr = "SCRIPT_ERR_SIG_COUNT", !1;
|
|
@@ -26761,46 +26765,50 @@ class ie extends Ce {
|
|
|
26761
26765
|
if (r += o, this.stack.length < r)
|
|
26762
26766
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
26763
26767
|
const i = this.buildSubScript();
|
|
26764
|
-
for (let
|
|
26765
|
-
const
|
|
26766
|
-
if ((
|
|
26767
|
-
if (!(this.flags &
|
|
26768
|
+
for (let d = 0; d < o; d++) {
|
|
26769
|
+
const b = this.stack[this.stack.length - f - d];
|
|
26770
|
+
if ((b.length > 0 ? b.readUInt8(b.length - 1) : 0) & he.SIGHASH_FORKID) {
|
|
26771
|
+
if (!(this.flags & re.SCRIPT_ENABLE_SIGHASH_FORKID))
|
|
26768
26772
|
return this.errStr = "SCRIPT_ERR_ILLEGAL_FORKID", !1;
|
|
26769
26773
|
} else
|
|
26770
|
-
i.findAndDelete(new Ae().writeBuffer(
|
|
26774
|
+
i.findAndDelete(new Ae().writeBuffer(b));
|
|
26771
26775
|
}
|
|
26772
|
-
let c = !0;
|
|
26776
|
+
let c = !0, h = Buffer.alloc(0);
|
|
26773
26777
|
for (; c && o > 0; ) {
|
|
26774
|
-
const
|
|
26775
|
-
|
|
26778
|
+
const d = this.stack[this.stack.length - f];
|
|
26779
|
+
h = d;
|
|
26780
|
+
const b = this.stack[this.stack.length - a];
|
|
26781
|
+
if (!this.checkSigEncoding(d) || !this.checkPubKeyEncoding(b))
|
|
26776
26782
|
return !1;
|
|
26777
|
-
let
|
|
26783
|
+
let p;
|
|
26778
26784
|
try {
|
|
26779
|
-
const
|
|
26780
|
-
|
|
26781
|
-
p,
|
|
26785
|
+
const y = new he().fromTxFormat(d), v = new Ue().fromBuffer(b, !1);
|
|
26786
|
+
p = this.tx.verify(
|
|
26782
26787
|
y,
|
|
26788
|
+
v,
|
|
26783
26789
|
this.nIn,
|
|
26784
26790
|
i,
|
|
26785
|
-
!!(this.flags &
|
|
26791
|
+
!!(this.flags & re.SCRIPT_VERIFY_LOW_S) && !this.isChronicle(),
|
|
26786
26792
|
this.valueBn,
|
|
26787
26793
|
this.flags
|
|
26788
26794
|
);
|
|
26789
26795
|
} catch {
|
|
26790
|
-
|
|
26796
|
+
p = !1;
|
|
26791
26797
|
}
|
|
26792
|
-
|
|
26798
|
+
p && (f++, o--), a++, s--, o > s && (c = !1);
|
|
26793
26799
|
}
|
|
26800
|
+
if (!c && s === 0 && (this.flags & re.SCRIPT_VERIFY_NULLFAIL) !== 0 && !this.isChronicle() && h.length > 0)
|
|
26801
|
+
return this.errStr = "SCRIPT_ERR_SIG_NULLFAIL", !1;
|
|
26794
26802
|
for (; r-- > 1; )
|
|
26795
26803
|
this.stack.pop();
|
|
26796
26804
|
if (this.stack.length < 1)
|
|
26797
26805
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
26798
26806
|
if (
|
|
26799
26807
|
// Chronicle removes NULLDUMMY.
|
|
26800
|
-
this.flags &
|
|
26808
|
+
this.flags & re.SCRIPT_VERIFY_NULLDUMMY && !this.isChronicle() && this.stack[this.stack.length - 1].length
|
|
26801
26809
|
)
|
|
26802
26810
|
return this.errStr = "SCRIPT_ERR_SIG_NULLDUMMY", !1;
|
|
26803
|
-
if (this.stack.pop(), this.stack.push(c ?
|
|
26811
|
+
if (this.stack.pop(), this.stack.push(c ? re.true : re.false), n === q.OP_CHECKMULTISIGVERIFY)
|
|
26804
26812
|
if (c)
|
|
26805
26813
|
this.stack.pop();
|
|
26806
26814
|
else
|
|
@@ -26810,7 +26818,7 @@ class ie extends Ce {
|
|
|
26810
26818
|
//
|
|
26811
26819
|
// Byte string operations
|
|
26812
26820
|
//
|
|
26813
|
-
case
|
|
26821
|
+
case q.OP_CAT:
|
|
26814
26822
|
{
|
|
26815
26823
|
if (this.stack.length < 2)
|
|
26816
26824
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
@@ -26818,7 +26826,7 @@ class ie extends Ce {
|
|
|
26818
26826
|
this.stack[this.stack.length - 2] = Buffer.concat([r, s]), this.stack.pop();
|
|
26819
26827
|
}
|
|
26820
26828
|
break;
|
|
26821
|
-
case
|
|
26829
|
+
case q.OP_SPLIT:
|
|
26822
26830
|
{
|
|
26823
26831
|
if (this.stack.length < 2)
|
|
26824
26832
|
return this.errStr = "SCRIPT_ERR_INVALID_STACK_OPERATION", !1;
|
|
@@ -26836,7 +26844,7 @@ class ie extends Ce {
|
|
|
26836
26844
|
this.stack.pop(), this.stack.pop(), this.stack.push(a), this.stack.push(o);
|
|
26837
26845
|
}
|
|
26838
26846
|
break;
|
|
26839
|
-
case
|
|
26847
|
+
case q.OP_NUM2BIN:
|
|
26840
26848
|
{
|
|
26841
26849
|
if (this.stack.length < 2)
|
|
26842
26850
|
return this.errStr = "OP_NUM2BIN requires at least two items to be on the stack.", !1;
|
|
@@ -26852,7 +26860,7 @@ class ie extends Ce {
|
|
|
26852
26860
|
return this.errStr = f.message.includes("overflow") ? "SCRIPTNUM_OVERFLOW" : "SCRIPT_ERR_UNKNOWN_ERROR", !1;
|
|
26853
26861
|
}
|
|
26854
26862
|
if (r > this.maxScriptElementSize())
|
|
26855
|
-
return this.errStr = `It's not currently possible to push data larger than ${
|
|
26863
|
+
return this.errStr = `It's not currently possible to push data larger than ${re.MAX_SCRIPT_ELEMENT_SIZE} bytes.`, !1;
|
|
26856
26864
|
this.stack.pop();
|
|
26857
26865
|
let s = this.stack[this.stack.length - 1];
|
|
26858
26866
|
if (s = jf(s), s.length > r)
|
|
@@ -26865,7 +26873,7 @@ class ie extends Ce {
|
|
|
26865
26873
|
s.copy(o), r > 0 && (o[r - 1] |= a), this.stack[this.stack.length - 1] = o;
|
|
26866
26874
|
}
|
|
26867
26875
|
break;
|
|
26868
|
-
case
|
|
26876
|
+
case q.OP_BIN2NUM:
|
|
26869
26877
|
{
|
|
26870
26878
|
if (this.stack.length < 1)
|
|
26871
26879
|
return this.errStr = "OP_BIN2NUM requires at least one item to be on the stack.", !1;
|
|
@@ -26961,7 +26969,7 @@ class ie extends Ce {
|
|
|
26961
26969
|
}
|
|
26962
26970
|
static getFlags(e) {
|
|
26963
26971
|
let t = 0;
|
|
26964
|
-
return e.indexOf("NONE") !== -1 && (t = t |
|
|
26972
|
+
return e.indexOf("NONE") !== -1 && (t = t | re.SCRIPT_VERIFY_NONE), e.indexOf("P2SH") !== -1 && (t = t | re.SCRIPT_VERIFY_P2SH), e.indexOf("STRICTENC") !== -1 && (t = t | re.SCRIPT_VERIFY_STRICTENC), e.indexOf("DERSIG") !== -1 && (t = t | re.SCRIPT_VERIFY_DERSIG), e.indexOf("LOW_S") !== -1 && (t = t | re.SCRIPT_VERIFY_LOW_S), e.indexOf("NULLDUMMY") !== -1 && (t = t | re.SCRIPT_VERIFY_NULLDUMMY), e.indexOf("SIGPUSHONLY") !== -1 && (t = t | re.SCRIPT_VERIFY_SIGPUSHONLY), e.indexOf("MINIMALDATA") !== -1 && (t = t | re.SCRIPT_VERIFY_MINIMALDATA), e.indexOf("DISCOURAGE_UPGRADABLE_NOPS") !== -1 && (t = t | re.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS), e.indexOf("CLEANSTACK") !== -1 && (t = t | re.SCRIPT_VERIFY_CLEANSTACK), e.indexOf("CHECKLOCKTIMEVERIFY") !== -1 && (t = t | re.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY), e.indexOf("CHECKSEQUENCEVERIFY") !== -1 && (t = t | re.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY), e.indexOf("SIGHASH_FORKID") !== -1 && (t = t | re.SCRIPT_ENABLE_SIGHASH_FORKID), e.indexOf("MINIMALIF") !== -1 && (t = t | re.SCRIPT_VERIFY_MINIMALIF), e.indexOf("NULLFAIL") !== -1 && (t = t | re.SCRIPT_VERIFY_NULLFAIL), e.indexOf("CHRONICLE") !== -1 && (t = t | re.SCRIPT_VERIFY_CHRONICLE), t;
|
|
26965
26973
|
}
|
|
26966
26974
|
*eval() {
|
|
26967
26975
|
if (this.isPreGenesis())
|
|
@@ -27004,7 +27012,7 @@ class ie extends Ce {
|
|
|
27004
27012
|
nIn: u,
|
|
27005
27013
|
flags: r,
|
|
27006
27014
|
valueBn: s
|
|
27007
|
-
}), this.setLimits(), this.isUnlockingScript = !0, this.lockingScript = t, (r &
|
|
27015
|
+
}), this.setLimits(), this.isUnlockingScript = !0, this.lockingScript = t, (r & re.SCRIPT_VERIFY_SIGPUSHONLY) !== 0 && !this.isChronicle() && !e.isPushOnly() && (this.errStr = this.errStr || "SCRIPT_ERR_SIG_PUSHONLY", yield !1), yield* this.eval(), r & re.SCRIPT_VERIFY_P2SH && (a = this.stack.slice());
|
|
27008
27016
|
const o = this.stack;
|
|
27009
27017
|
this.initialize(), this.fromObject({
|
|
27010
27018
|
script: t,
|
|
@@ -27015,7 +27023,7 @@ class ie extends Ce {
|
|
|
27015
27023
|
valueBn: s
|
|
27016
27024
|
}), this.setLimits(), this.isUnlockingScript = !1, yield* this.eval(), this.stack.length === 0 && (this.errStr = this.errStr || "SCRIPT_ERR_EVAL_FALSE", yield !1);
|
|
27017
27025
|
const f = this.stack[this.stack.length - 1];
|
|
27018
|
-
if (
|
|
27026
|
+
if (re.castToBool(f) || (this.errStr = this.errStr || "SCRIPT_ERR_EVAL_FALSE", yield !1), r & re.SCRIPT_VERIFY_P2SH && t.isScriptHashOut()) {
|
|
27019
27027
|
e.isPushOnly() || (this.errStr = this.errStr || "SCRIPT_ERR_SIG_PUSHONLY", yield !1);
|
|
27020
27028
|
const i = this.stack;
|
|
27021
27029
|
if (this.stack = a, a = i, this.stack.length === 0)
|
|
@@ -27030,10 +27038,10 @@ class ie extends Ce {
|
|
|
27030
27038
|
nIn: u,
|
|
27031
27039
|
flags: r,
|
|
27032
27040
|
valueBn: s
|
|
27033
|
-
}), this.setLimits(), yield* this.eval(), this.stack.length === 0 && (this.errStr = this.errStr || "SCRIPT_ERR_EVAL_FALSE", yield !1),
|
|
27041
|
+
}), this.setLimits(), yield* this.eval(), this.stack.length === 0 && (this.errStr = this.errStr || "SCRIPT_ERR_EVAL_FALSE", yield !1), re.castToBool(this.stack[this.stack.length - 1]) ? yield !0 : (this.errStr = this.errStr || "SCRIPT_ERR_EVAL_FALSE", yield !1);
|
|
27034
27042
|
}
|
|
27035
|
-
if ((r &
|
|
27036
|
-
if (!(r &
|
|
27043
|
+
if ((r & re.SCRIPT_VERIFY_CLEANSTACK) !== 0 && !this.isChronicle()) {
|
|
27044
|
+
if (!(r & re.SCRIPT_VERIFY_P2SH))
|
|
27037
27045
|
throw new Error("cannot use CLEANSTACK without P2SH");
|
|
27038
27046
|
this.stack.length !== 1 && (this.errStr = this.errStr || "SCRIPT_ERR_CLEANSTACK", yield !1);
|
|
27039
27047
|
}
|
|
@@ -27047,39 +27055,41 @@ class ie extends Ce {
|
|
|
27047
27055
|
pc: e,
|
|
27048
27056
|
stack: this.stack.map((t) => t.toString("hex")),
|
|
27049
27057
|
altStack: this.altStack.map((t) => t.toString("hex")),
|
|
27050
|
-
opCodeStr: this.script && this.script.chunks && this.script.chunks[e] ?
|
|
27058
|
+
opCodeStr: this.script && this.script.chunks && this.script.chunks[e] ? q.fromNumber(this.script.chunks[e].opCodeNum).toString() : "no script or chunk found"
|
|
27051
27059
|
};
|
|
27052
27060
|
}
|
|
27053
27061
|
getDebugString() {
|
|
27054
27062
|
return JSON.stringify(this.getDebugObject(), null, 2);
|
|
27055
27063
|
}
|
|
27056
27064
|
}
|
|
27057
|
-
|
|
27058
|
-
|
|
27059
|
-
|
|
27060
|
-
|
|
27061
|
-
|
|
27062
|
-
|
|
27063
|
-
|
|
27064
|
-
|
|
27065
|
-
|
|
27066
|
-
|
|
27067
|
-
|
|
27068
|
-
|
|
27069
|
-
|
|
27070
|
-
|
|
27071
|
-
|
|
27072
|
-
|
|
27073
|
-
|
|
27074
|
-
|
|
27075
|
-
|
|
27076
|
-
|
|
27077
|
-
|
|
27078
|
-
|
|
27079
|
-
|
|
27080
|
-
|
|
27081
|
-
|
|
27082
|
-
|
|
27065
|
+
re.true = Buffer.from([1]);
|
|
27066
|
+
re.false = Buffer.from([]);
|
|
27067
|
+
re.MAX_SCRIPT_ELEMENT_SIZE = 500 * 1e3;
|
|
27068
|
+
re.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS = 10 * 1e3;
|
|
27069
|
+
re.LOCKTIME_THRESHOLD = 5e8;
|
|
27070
|
+
re.SCRIPT_VERIFY_NONE = 0;
|
|
27071
|
+
re.SCRIPT_VERIFY_P2SH = 1;
|
|
27072
|
+
re.SCRIPT_VERIFY_STRICTENC = 2;
|
|
27073
|
+
re.SCRIPT_VERIFY_DERSIG = 4;
|
|
27074
|
+
re.SCRIPT_VERIFY_LOW_S = 8;
|
|
27075
|
+
re.SCRIPT_VERIFY_NULLDUMMY = 16;
|
|
27076
|
+
re.SCRIPT_VERIFY_SIGPUSHONLY = 32;
|
|
27077
|
+
re.SCRIPT_VERIFY_MINIMALDATA = 64;
|
|
27078
|
+
re.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS = 128;
|
|
27079
|
+
re.SCRIPT_VERIFY_CLEANSTACK = 256;
|
|
27080
|
+
re.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY = 512;
|
|
27081
|
+
re.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY = 1024;
|
|
27082
|
+
re.SCRIPT_VERIFY_MINIMALIF = 8192;
|
|
27083
|
+
re.SCRIPT_VERIFY_NULLFAIL = 16384;
|
|
27084
|
+
re.SCRIPT_ENABLE_SIGHASH_FORKID = 65536;
|
|
27085
|
+
re.SCRIPT_VERIFY_PREGENESIS_LIMITS = 1 << 17;
|
|
27086
|
+
re.PREGENESIS_SCRIPT_NUM_LENGTH = 4;
|
|
27087
|
+
re.PREGENESIS_MAX_SCRIPT_ELEMENT_SIZE = 520;
|
|
27088
|
+
re.PREGENESIS_SCRIPT_LIMIT = 1e4;
|
|
27089
|
+
re.PREGENESIS_STACK_LIMIT = 1e3;
|
|
27090
|
+
re.SCRIPT_VERIFY_CHRONICLE = 1 << 18;
|
|
27091
|
+
re.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_CHRONICLE = 32 * 1024 * 1024;
|
|
27092
|
+
re.defaultFlags = re.SCRIPT_VERIFY_P2SH | re.SCRIPT_VERIFY_STRICTENC | re.SCRIPT_ENABLE_SIGHASH_FORKID | re.SCRIPT_VERIFY_LOW_S | re.SCRIPT_VERIFY_NULLDUMMY | re.SCRIPT_VERIFY_DERSIG | re.SCRIPT_VERIFY_MINIMALDATA | re.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS | re.SCRIPT_VERIFY_CLEANSTACK | re.SCRIPT_VERIFY_SIGPUSHONLY | re.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY | re.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY;
|
|
27083
27093
|
class xh extends Ce {
|
|
27084
27094
|
constructor(e = /* @__PURE__ */ new Map()) {
|
|
27085
27095
|
super({ map: e });
|
|
@@ -27396,7 +27406,7 @@ class L1 extends Ce {
|
|
|
27396
27406
|
if (this.changeAmountBn.geq(t)) {
|
|
27397
27407
|
if (this.feeAmountBn = t, this.changeAmountBn = this.changeAmountBn.sub(this.feeAmountBn), this.tx.txOuts[this.tx.txOuts.length - 1].valueBn = this.changeAmountBn, this.changeAmountBn.lt(this.dust))
|
|
27398
27408
|
if (this.dustChangeToFees)
|
|
27399
|
-
this.tx.txOuts.pop(), this.tx.txOutsVi =
|
|
27409
|
+
this.tx.txOuts.pop(), this.tx.txOutsVi = qe.fromNumber(this.tx.txOutsVi.toNumber() - 1), this.feeAmountBn = this.feeAmountBn.add(this.changeAmountBn), this.changeAmountBn = new Z(0);
|
|
27400
27410
|
else
|
|
27401
27411
|
throw new Error("unable to create change amount greater than dust");
|
|
27402
27412
|
if (this.tx.nLockTime = this.nLockTime, this.tx.versionBytesNum = this.versionBytesNum, this.tx.txOuts.length === 0)
|
|
@@ -27433,7 +27443,7 @@ class L1 extends Ce {
|
|
|
27433
27443
|
const u = this.tx.txIns[e];
|
|
27434
27444
|
return u.script.chunks[t] = new Ae().writeBuffer(
|
|
27435
27445
|
n.toTxFormat()
|
|
27436
|
-
).chunks[0], u.scriptVi =
|
|
27446
|
+
).chunks[0], u.scriptVi = qe.fromNumber(u.script.toBuffer().length), this;
|
|
27437
27447
|
}
|
|
27438
27448
|
/**
|
|
27439
27449
|
* Sign an input, but do not fill the signature into the transaction. Return
|
|
@@ -27548,7 +27558,7 @@ class zf extends Ce {
|
|
|
27548
27558
|
* valid, which is not performed by this test. That check is done with the
|
|
27549
27559
|
* normal verify function.
|
|
27550
27560
|
*/
|
|
27551
|
-
verify(e =
|
|
27561
|
+
verify(e = re.SCRIPT_ENABLE_SIGHASH_FORKID) {
|
|
27552
27562
|
return !this.checkStr() && !this.verifyStr(e);
|
|
27553
27563
|
}
|
|
27554
27564
|
/*
|
|
@@ -27633,7 +27643,7 @@ class zf extends Ce {
|
|
|
27633
27643
|
if (!r)
|
|
27634
27644
|
return console.log("output " + n.txOutNum + " not found"), !1;
|
|
27635
27645
|
const s = r.script, a = r.valueBn;
|
|
27636
|
-
return this.interp = new
|
|
27646
|
+
return this.interp = new re(), this.interp.verify(
|
|
27637
27647
|
u,
|
|
27638
27648
|
s,
|
|
27639
27649
|
this.tx,
|
|
@@ -27647,7 +27657,7 @@ class zf extends Ce {
|
|
|
27647
27657
|
if (!r)
|
|
27648
27658
|
return console.log("output " + n.txOutNum + " not found"), !1;
|
|
27649
27659
|
const s = r.script, a = r.valueBn;
|
|
27650
|
-
this.interp = new
|
|
27660
|
+
this.interp = new re();
|
|
27651
27661
|
const o = await be.asyncObjectMethod(
|
|
27652
27662
|
this.interp,
|
|
27653
27663
|
"verify",
|
|
@@ -27689,66 +27699,66 @@ dt.words2Buf = function(l) {
|
|
|
27689
27699
|
e.writeUInt32BE(l[t], t * 4);
|
|
27690
27700
|
return e;
|
|
27691
27701
|
};
|
|
27692
|
-
class
|
|
27702
|
+
class Fe {
|
|
27693
27703
|
}
|
|
27694
|
-
|
|
27704
|
+
Fe.buf2BlocksBuf = function(l, e) {
|
|
27695
27705
|
const t = e / 8, n = [];
|
|
27696
27706
|
for (let u = 0; u <= l.length / t; u++) {
|
|
27697
27707
|
let r = l.slice(u * t, u * t + t);
|
|
27698
|
-
r.length < e && (r =
|
|
27708
|
+
r.length < e && (r = Fe.pkcs7Pad(r, e)), n.push(r);
|
|
27699
27709
|
}
|
|
27700
27710
|
return n;
|
|
27701
27711
|
};
|
|
27702
|
-
|
|
27712
|
+
Fe.blockBufs2Buf = function(l) {
|
|
27703
27713
|
let e = l[l.length - 1];
|
|
27704
|
-
return e =
|
|
27714
|
+
return e = Fe.pkcs7Unpad(e), l[l.length - 1] = e, Buffer.concat(l);
|
|
27705
27715
|
};
|
|
27706
|
-
|
|
27707
|
-
const u = e.length * 8, r =
|
|
27716
|
+
Fe.encrypt = function(l, e, t, n) {
|
|
27717
|
+
const u = e.length * 8, r = Fe.buf2BlocksBuf(l, u), s = Fe.encryptBlocks(r, e, t, n);
|
|
27708
27718
|
return Buffer.concat(s);
|
|
27709
27719
|
};
|
|
27710
|
-
|
|
27720
|
+
Fe.decrypt = function(l, e, t, n) {
|
|
27711
27721
|
const u = e.length, r = [];
|
|
27712
27722
|
for (let o = 0; o < l.length / u; o++)
|
|
27713
27723
|
r.push(l.slice(o * u, o * u + u));
|
|
27714
|
-
const s =
|
|
27715
|
-
return
|
|
27724
|
+
const s = Fe.decryptBlocks(r, e, t, n);
|
|
27725
|
+
return Fe.blockBufs2Buf(s);
|
|
27716
27726
|
};
|
|
27717
|
-
|
|
27718
|
-
const u =
|
|
27727
|
+
Fe.encryptBlock = function(l, e, t, n) {
|
|
27728
|
+
const u = Fe.xorBufs(l, e);
|
|
27719
27729
|
return t.encrypt(u, n);
|
|
27720
27730
|
};
|
|
27721
|
-
|
|
27731
|
+
Fe.decryptBlock = function(l, e, t, n) {
|
|
27722
27732
|
const u = t.decrypt(l, n);
|
|
27723
|
-
return
|
|
27733
|
+
return Fe.xorBufs(u, e);
|
|
27724
27734
|
};
|
|
27725
|
-
|
|
27735
|
+
Fe.encryptBlocks = function(l, e, t, n) {
|
|
27726
27736
|
const u = [];
|
|
27727
27737
|
for (let r = 0; r < l.length; r++) {
|
|
27728
|
-
const s = l[r], a =
|
|
27738
|
+
const s = l[r], a = Fe.encryptBlock(s, e, t, n);
|
|
27729
27739
|
u.push(a), e = a;
|
|
27730
27740
|
}
|
|
27731
27741
|
return u;
|
|
27732
27742
|
};
|
|
27733
|
-
|
|
27743
|
+
Fe.decryptBlocks = function(l, e, t, n) {
|
|
27734
27744
|
const u = [];
|
|
27735
27745
|
for (let r = 0; r < l.length; r++) {
|
|
27736
|
-
const s = l[r], a =
|
|
27746
|
+
const s = l[r], a = Fe.decryptBlock(s, e, t, n);
|
|
27737
27747
|
u.push(a), e = s;
|
|
27738
27748
|
}
|
|
27739
27749
|
return u;
|
|
27740
27750
|
};
|
|
27741
|
-
|
|
27751
|
+
Fe.pkcs7Pad = function(l, e) {
|
|
27742
27752
|
const n = e / 8 - l.length, u = Buffer.alloc(n);
|
|
27743
27753
|
return u.fill(n), Buffer.concat([l, u]);
|
|
27744
27754
|
};
|
|
27745
|
-
|
|
27755
|
+
Fe.pkcs7Unpad = function(l) {
|
|
27746
27756
|
const e = l[l.length - 1], t = l.slice(l.length - e, l.length), n = Buffer.alloc(e);
|
|
27747
|
-
if (n.fill(e), !
|
|
27757
|
+
if (n.fill(e), !Ft(t, n))
|
|
27748
27758
|
throw new Error("invalid padding");
|
|
27749
27759
|
return l.slice(0, l.length - e);
|
|
27750
27760
|
};
|
|
27751
|
-
|
|
27761
|
+
Fe.xorBufs = function(l, e) {
|
|
27752
27762
|
if (l.length !== e.length)
|
|
27753
27763
|
throw new Error("bufs must have the same length");
|
|
27754
27764
|
const t = Buffer.alloc(l.length);
|
|
@@ -27760,16 +27770,16 @@ class Pt {
|
|
|
27760
27770
|
}
|
|
27761
27771
|
Pt.encrypt = function(l, e, t, n = !0) {
|
|
27762
27772
|
t = t || It.getRandomBuffer(128 / 8);
|
|
27763
|
-
const u =
|
|
27773
|
+
const u = Fe.encrypt(l, t, dt, e);
|
|
27764
27774
|
return n ? Buffer.concat([t, u]) : u;
|
|
27765
27775
|
};
|
|
27766
27776
|
Pt.decrypt = function(l, e, t = !1) {
|
|
27767
27777
|
if (t) {
|
|
27768
27778
|
const n = l;
|
|
27769
|
-
return
|
|
27779
|
+
return Fe.decrypt(n, t, dt, e);
|
|
27770
27780
|
} else {
|
|
27771
27781
|
const n = l.slice(0, 16), u = l.slice(128 / 8);
|
|
27772
|
-
return
|
|
27782
|
+
return Fe.decrypt(u, n, dt, e);
|
|
27773
27783
|
}
|
|
27774
27784
|
};
|
|
27775
27785
|
class Kt {
|
|
@@ -27791,7 +27801,7 @@ Kt.decrypt = function(l, e) {
|
|
|
27791
27801
|
const t = l.slice(0, 256 / 8);
|
|
27792
27802
|
l = l.slice(256 / 8, l.length);
|
|
27793
27803
|
const n = ae.sha256Hmac(l, e);
|
|
27794
|
-
if (!
|
|
27804
|
+
if (!Ft(t, n))
|
|
27795
27805
|
throw new Error(
|
|
27796
27806
|
"Message authentication failed - Hmacs are not equivalent"
|
|
27797
27807
|
);
|
|
@@ -27853,7 +27863,7 @@ _t.bitcoreDecrypt = function(l, e) {
|
|
|
27853
27863
|
if (r.eq(new Ie()))
|
|
27854
27864
|
throw new Error("P equals 0");
|
|
27855
27865
|
const a = r.getX().toBuffer({ size: 32 }), o = ae.sha512(a), f = o.slice(0, 32), i = o.slice(32, 64), c = l.slice(33, l.length - 32), h = l.slice(l.length - 32, l.length), d = ae.sha256Hmac(c, i);
|
|
27856
|
-
if (!
|
|
27866
|
+
if (!Ft(h, d))
|
|
27857
27867
|
throw new Error("Invalid checksum");
|
|
27858
27868
|
return Pt.decrypt(c, f);
|
|
27859
27869
|
};
|
|
@@ -27869,7 +27879,7 @@ const D1 = {
|
|
|
27869
27879
|
hashjs: dr,
|
|
27870
27880
|
pbkdf2: Rd,
|
|
27871
27881
|
Buffer: y1.Buffer
|
|
27872
|
-
},
|
|
27882
|
+
}, F1 = w1.version;
|
|
27873
27883
|
export {
|
|
27874
27884
|
Kt as Ach,
|
|
27875
27885
|
Et as Address,
|
|
@@ -27885,16 +27895,16 @@ export {
|
|
|
27885
27895
|
ot as Br,
|
|
27886
27896
|
yt as Bsm,
|
|
27887
27897
|
ke as Bw,
|
|
27888
|
-
|
|
27898
|
+
Fe as Cbc,
|
|
27889
27899
|
Oe as Constants,
|
|
27890
27900
|
ht as Ecdsa,
|
|
27891
27901
|
_t as Ecies,
|
|
27892
27902
|
ae as Hash,
|
|
27893
|
-
|
|
27903
|
+
re as Interp,
|
|
27894
27904
|
st as KeyPair,
|
|
27895
27905
|
k1 as MinableBlock,
|
|
27896
27906
|
C1 as MiningUtils,
|
|
27897
|
-
|
|
27907
|
+
q as OpCode,
|
|
27898
27908
|
Ie as Point,
|
|
27899
27909
|
wt as PrivKey,
|
|
27900
27910
|
Ue as PubKey,
|
|
@@ -27909,15 +27919,15 @@ export {
|
|
|
27909
27919
|
gt as TxOut,
|
|
27910
27920
|
Eh as TxOutMap,
|
|
27911
27921
|
zf as TxVerifier,
|
|
27912
|
-
|
|
27922
|
+
qe as VarInt,
|
|
27913
27923
|
be as Workers,
|
|
27914
27924
|
Sh as WorkersResult,
|
|
27915
|
-
|
|
27925
|
+
Ft as cmp,
|
|
27916
27926
|
D1 as deps,
|
|
27917
|
-
|
|
27927
|
+
qf as en,
|
|
27918
27928
|
Hf as es,
|
|
27919
27929
|
T1 as getConstants,
|
|
27920
27930
|
Uf as jp,
|
|
27921
|
-
|
|
27931
|
+
F1 as version
|
|
27922
27932
|
};
|
|
27923
27933
|
//# sourceMappingURL=bsv2.mjs.map
|