brsh 3.0.0 → 3.1.1
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/CHANGELOG.md +14 -0
- package/POSIX-CHECKLIST.md +3 -3
- package/Readme.md +138 -223
- package/bin/Readme.md +70 -24
- package/dist/shell.es.js +353 -334
- package/dist/shell.es.js.map +1 -1
- package/dist/shell.min.js +7 -7
- package/dist/shell.min.js.map +1 -1
- package/dist/wbt.es.js +198 -176
- package/dist/wbt.es.js.map +1 -1
- package/dist/wbt.min.js +7 -7
- package/dist/wbt.min.js.map +1 -1
- package/index.js +20 -0
- package/lib/Readme.md +111 -12
- package/lib/WasmCommand.js +26 -5
- package/lib/wbt/index.js +3 -2
- package/lib/wbt/registry.js +15 -1
- package/package.json +1 -1
- package/test/shell.test.js +49 -0
- package/test/wbt.test.js +92 -0
package/dist/shell.es.js
CHANGED
|
@@ -234,17 +234,17 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
|
|
|
234
234
|
let r = !1;
|
|
235
235
|
if ((t === void 0 || t < 0) && (t = 0), t > this.length || ((n === void 0 || n > this.length) && (n = this.length), n <= 0) || (n >>>= 0, t >>>= 0, n <= t)) return "";
|
|
236
236
|
for (e ||= "utf8";;) switch (e) {
|
|
237
|
-
case "hex": return
|
|
237
|
+
case "hex": return B(this, t, n);
|
|
238
238
|
case "utf8":
|
|
239
239
|
case "utf-8": return F(this, t, n);
|
|
240
240
|
case "ascii": return R(this, t, n);
|
|
241
241
|
case "latin1":
|
|
242
|
-
case "binary": return
|
|
242
|
+
case "binary": return z(this, t, n);
|
|
243
243
|
case "base64": return P(this, t, n);
|
|
244
244
|
case "ucs2":
|
|
245
245
|
case "ucs-2":
|
|
246
246
|
case "utf16le":
|
|
247
|
-
case "utf-16le": return
|
|
247
|
+
case "utf-16le": return V(this, t, n);
|
|
248
248
|
default:
|
|
249
249
|
if (r) throw TypeError("Unknown encoding: " + e);
|
|
250
250
|
e = (e + "").toLowerCase(), r = !0;
|
|
@@ -434,20 +434,20 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
|
|
|
434
434
|
for (let i = t; i < n; ++i) r += String.fromCharCode(e[i] & 127);
|
|
435
435
|
return r;
|
|
436
436
|
}
|
|
437
|
-
function
|
|
437
|
+
function z(e, t, n) {
|
|
438
438
|
let r = "";
|
|
439
439
|
n = Math.min(e.length, n);
|
|
440
440
|
for (let i = t; i < n; ++i) r += String.fromCharCode(e[i]);
|
|
441
441
|
return r;
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function B(e, t, n) {
|
|
444
444
|
let r = e.length;
|
|
445
445
|
(!t || t < 0) && (t = 0), (!n || n < 0 || n > r) && (n = r);
|
|
446
446
|
let i = "";
|
|
447
447
|
for (let r = t; r < n; ++r) i += he[e[r]];
|
|
448
448
|
return i;
|
|
449
449
|
}
|
|
450
|
-
function
|
|
450
|
+
function V(e, t, n) {
|
|
451
451
|
let r = e.slice(t, n), i = "";
|
|
452
452
|
for (let e = 0; e < r.length - 1; e += 2) i += String.fromCharCode(r[e] + r[e + 1] * 256);
|
|
453
453
|
return i;
|
|
@@ -458,30 +458,30 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
|
|
|
458
458
|
let r = this.subarray(e, t);
|
|
459
459
|
return Object.setPrototypeOf(r, u.prototype), r;
|
|
460
460
|
};
|
|
461
|
-
function
|
|
461
|
+
function H(e, t, n) {
|
|
462
462
|
if (e % 1 != 0 || e < 0) throw RangeError("offset is not uint");
|
|
463
463
|
if (e + t > n) throw RangeError("Trying to access beyond buffer length");
|
|
464
464
|
}
|
|
465
465
|
u.prototype.readUintLE = u.prototype.readUIntLE = function(e, t, n) {
|
|
466
|
-
e >>>= 0, t >>>= 0, n ||
|
|
466
|
+
e >>>= 0, t >>>= 0, n || H(e, t, this.length);
|
|
467
467
|
let r = this[e], i = 1, a = 0;
|
|
468
468
|
for (; ++a < t && (i *= 256);) r += this[e + a] * i;
|
|
469
469
|
return r;
|
|
470
470
|
}, u.prototype.readUintBE = u.prototype.readUIntBE = function(e, t, n) {
|
|
471
|
-
e >>>= 0, t >>>= 0, n ||
|
|
471
|
+
e >>>= 0, t >>>= 0, n || H(e, t, this.length);
|
|
472
472
|
let r = this[e + --t], i = 1;
|
|
473
473
|
for (; t > 0 && (i *= 256);) r += this[e + --t] * i;
|
|
474
474
|
return r;
|
|
475
475
|
}, u.prototype.readUint8 = u.prototype.readUInt8 = function(e, t) {
|
|
476
|
-
return e >>>= 0, t ||
|
|
476
|
+
return e >>>= 0, t || H(e, 1, this.length), this[e];
|
|
477
477
|
}, u.prototype.readUint16LE = u.prototype.readUInt16LE = function(e, t) {
|
|
478
|
-
return e >>>= 0, t ||
|
|
478
|
+
return e >>>= 0, t || H(e, 2, this.length), this[e] | this[e + 1] << 8;
|
|
479
479
|
}, u.prototype.readUint16BE = u.prototype.readUInt16BE = function(e, t) {
|
|
480
|
-
return e >>>= 0, t ||
|
|
480
|
+
return e >>>= 0, t || H(e, 2, this.length), this[e] << 8 | this[e + 1];
|
|
481
481
|
}, u.prototype.readUint32LE = u.prototype.readUInt32LE = function(e, t) {
|
|
482
|
-
return e >>>= 0, t ||
|
|
482
|
+
return e >>>= 0, t || H(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + this[e + 3] * 16777216;
|
|
483
483
|
}, u.prototype.readUint32BE = u.prototype.readUInt32BE = function(e, t) {
|
|
484
|
-
return e >>>= 0, t ||
|
|
484
|
+
return e >>>= 0, t || H(e, 4, this.length), this[e] * 16777216 + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]);
|
|
485
485
|
}, u.prototype.readBigUInt64LE = X(function(e) {
|
|
486
486
|
e >>>= 0, J(e, "offset");
|
|
487
487
|
let t = this[e], n = this[e + 7];
|
|
@@ -495,29 +495,29 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
|
|
|
495
495
|
let r = t * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + this[++e], i = this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + n;
|
|
496
496
|
return (BigInt(r) << BigInt(32)) + BigInt(i);
|
|
497
497
|
}), u.prototype.readIntLE = function(e, t, n) {
|
|
498
|
-
e >>>= 0, t >>>= 0, n ||
|
|
498
|
+
e >>>= 0, t >>>= 0, n || H(e, t, this.length);
|
|
499
499
|
let r = this[e], i = 1, a = 0;
|
|
500
500
|
for (; ++a < t && (i *= 256);) r += this[e + a] * i;
|
|
501
501
|
return i *= 128, r >= i && (r -= 2 ** (8 * t)), r;
|
|
502
502
|
}, u.prototype.readIntBE = function(e, t, n) {
|
|
503
|
-
e >>>= 0, t >>>= 0, n ||
|
|
503
|
+
e >>>= 0, t >>>= 0, n || H(e, t, this.length);
|
|
504
504
|
let r = t, i = 1, a = this[e + --r];
|
|
505
505
|
for (; r > 0 && (i *= 256);) a += this[e + --r] * i;
|
|
506
506
|
return i *= 128, a >= i && (a -= 2 ** (8 * t)), a;
|
|
507
507
|
}, u.prototype.readInt8 = function(e, t) {
|
|
508
|
-
return e >>>= 0, t ||
|
|
508
|
+
return e >>>= 0, t || H(e, 1, this.length), this[e] & 128 ? (255 - this[e] + 1) * -1 : this[e];
|
|
509
509
|
}, u.prototype.readInt16LE = function(e, t) {
|
|
510
|
-
e >>>= 0, t ||
|
|
510
|
+
e >>>= 0, t || H(e, 2, this.length);
|
|
511
511
|
let n = this[e] | this[e + 1] << 8;
|
|
512
512
|
return n & 32768 ? n | 4294901760 : n;
|
|
513
513
|
}, u.prototype.readInt16BE = function(e, t) {
|
|
514
|
-
e >>>= 0, t ||
|
|
514
|
+
e >>>= 0, t || H(e, 2, this.length);
|
|
515
515
|
let n = this[e + 1] | this[e] << 8;
|
|
516
516
|
return n & 32768 ? n | 4294901760 : n;
|
|
517
517
|
}, u.prototype.readInt32LE = function(e, t) {
|
|
518
|
-
return e >>>= 0, t ||
|
|
518
|
+
return e >>>= 0, t || H(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24;
|
|
519
519
|
}, u.prototype.readInt32BE = function(e, t) {
|
|
520
|
-
return e >>>= 0, t ||
|
|
520
|
+
return e >>>= 0, t || H(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3];
|
|
521
521
|
}, u.prototype.readBigInt64LE = X(function(e) {
|
|
522
522
|
e >>>= 0, J(e, "offset");
|
|
523
523
|
let t = this[e], n = this[e + 7];
|
|
@@ -531,15 +531,15 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
|
|
|
531
531
|
let r = (t << 24) + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + this[++e];
|
|
532
532
|
return (BigInt(r) << BigInt(32)) + BigInt(this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + n);
|
|
533
533
|
}), u.prototype.readFloatLE = function(e, t) {
|
|
534
|
-
return e >>>= 0, t ||
|
|
534
|
+
return e >>>= 0, t || H(e, 4, this.length), n.read(this, e, !0, 23, 4);
|
|
535
535
|
}, u.prototype.readFloatBE = function(e, t) {
|
|
536
|
-
return e >>>= 0, t ||
|
|
536
|
+
return e >>>= 0, t || H(e, 4, this.length), n.read(this, e, !1, 23, 4);
|
|
537
537
|
}, u.prototype.readDoubleLE = function(e, t) {
|
|
538
|
-
return e >>>= 0, t ||
|
|
538
|
+
return e >>>= 0, t || H(e, 8, this.length), n.read(this, e, !0, 52, 8);
|
|
539
539
|
}, u.prototype.readDoubleBE = function(e, t) {
|
|
540
|
-
return e >>>= 0, t ||
|
|
540
|
+
return e >>>= 0, t || H(e, 8, this.length), n.read(this, e, !1, 52, 8);
|
|
541
541
|
};
|
|
542
|
-
function
|
|
542
|
+
function U(e, t, n, r, i, a) {
|
|
543
543
|
if (!u.isBuffer(e)) throw TypeError("\"buffer\" argument must be a Buffer instance");
|
|
544
544
|
if (t > i || t < a) throw RangeError("\"value\" argument is out of bounds");
|
|
545
545
|
if (n + r > e.length) throw RangeError("Index out of range");
|
|
@@ -547,7 +547,7 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
|
|
|
547
547
|
u.prototype.writeUintLE = u.prototype.writeUIntLE = function(e, t, n, r) {
|
|
548
548
|
if (e = +e, t >>>= 0, n >>>= 0, !r) {
|
|
549
549
|
let r = 2 ** (8 * n) - 1;
|
|
550
|
-
|
|
550
|
+
U(this, e, t, n, r, 0);
|
|
551
551
|
}
|
|
552
552
|
let i = 1, a = 0;
|
|
553
553
|
for (this[t] = e & 255; ++a < n && (i *= 256);) this[t + a] = e / i & 255;
|
|
@@ -555,44 +555,44 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
|
|
|
555
555
|
}, u.prototype.writeUintBE = u.prototype.writeUIntBE = function(e, t, n, r) {
|
|
556
556
|
if (e = +e, t >>>= 0, n >>>= 0, !r) {
|
|
557
557
|
let r = 2 ** (8 * n) - 1;
|
|
558
|
-
|
|
558
|
+
U(this, e, t, n, r, 0);
|
|
559
559
|
}
|
|
560
560
|
let i = n - 1, a = 1;
|
|
561
561
|
for (this[t + i] = e & 255; --i >= 0 && (a *= 256);) this[t + i] = e / a & 255;
|
|
562
562
|
return t + n;
|
|
563
563
|
}, u.prototype.writeUint8 = u.prototype.writeUInt8 = function(e, t, n) {
|
|
564
|
-
return e = +e, t >>>= 0, n ||
|
|
564
|
+
return e = +e, t >>>= 0, n || U(this, e, t, 1, 255, 0), this[t] = e & 255, t + 1;
|
|
565
565
|
}, u.prototype.writeUint16LE = u.prototype.writeUInt16LE = function(e, t, n) {
|
|
566
|
-
return e = +e, t >>>= 0, n ||
|
|
566
|
+
return e = +e, t >>>= 0, n || U(this, e, t, 2, 65535, 0), this[t] = e & 255, this[t + 1] = e >>> 8, t + 2;
|
|
567
567
|
}, u.prototype.writeUint16BE = u.prototype.writeUInt16BE = function(e, t, n) {
|
|
568
|
-
return e = +e, t >>>= 0, n ||
|
|
568
|
+
return e = +e, t >>>= 0, n || U(this, e, t, 2, 65535, 0), this[t] = e >>> 8, this[t + 1] = e & 255, t + 2;
|
|
569
569
|
}, u.prototype.writeUint32LE = u.prototype.writeUInt32LE = function(e, t, n) {
|
|
570
|
-
return e = +e, t >>>= 0, n ||
|
|
570
|
+
return e = +e, t >>>= 0, n || U(this, e, t, 4, 4294967295, 0), this[t + 3] = e >>> 24, this[t + 2] = e >>> 16, this[t + 1] = e >>> 8, this[t] = e & 255, t + 4;
|
|
571
571
|
}, u.prototype.writeUint32BE = u.prototype.writeUInt32BE = function(e, t, n) {
|
|
572
|
-
return e = +e, t >>>= 0, n ||
|
|
572
|
+
return e = +e, t >>>= 0, n || U(this, e, t, 4, 4294967295, 0), this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = e & 255, t + 4;
|
|
573
573
|
};
|
|
574
|
-
function
|
|
575
|
-
|
|
574
|
+
function ee(e, t, n, r, i) {
|
|
575
|
+
ae(t, r, i, e, n, 7);
|
|
576
576
|
let a = Number(t & BigInt(4294967295));
|
|
577
577
|
e[n++] = a, a >>= 8, e[n++] = a, a >>= 8, e[n++] = a, a >>= 8, e[n++] = a;
|
|
578
578
|
let o = Number(t >> BigInt(32) & BigInt(4294967295));
|
|
579
579
|
return e[n++] = o, o >>= 8, e[n++] = o, o >>= 8, e[n++] = o, o >>= 8, e[n++] = o, n;
|
|
580
580
|
}
|
|
581
|
-
function
|
|
582
|
-
|
|
581
|
+
function te(e, t, n, r, i) {
|
|
582
|
+
ae(t, r, i, e, n, 7);
|
|
583
583
|
let a = Number(t & BigInt(4294967295));
|
|
584
584
|
e[n + 7] = a, a >>= 8, e[n + 6] = a, a >>= 8, e[n + 5] = a, a >>= 8, e[n + 4] = a;
|
|
585
585
|
let o = Number(t >> BigInt(32) & BigInt(4294967295));
|
|
586
586
|
return e[n + 3] = o, o >>= 8, e[n + 2] = o, o >>= 8, e[n + 1] = o, o >>= 8, e[n] = o, n + 8;
|
|
587
587
|
}
|
|
588
588
|
u.prototype.writeBigUInt64LE = X(function(e, t = 0) {
|
|
589
|
-
return
|
|
589
|
+
return ee(this, e, t, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
590
590
|
}), u.prototype.writeBigUInt64BE = X(function(e, t = 0) {
|
|
591
|
-
return
|
|
591
|
+
return te(this, e, t, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
592
592
|
}), u.prototype.writeIntLE = function(e, t, n, r) {
|
|
593
593
|
if (e = +e, t >>>= 0, !r) {
|
|
594
594
|
let r = 2 ** (8 * n - 1);
|
|
595
|
-
|
|
595
|
+
U(this, e, t, n, r - 1, -r);
|
|
596
596
|
}
|
|
597
597
|
let i = 0, a = 1, o = 0;
|
|
598
598
|
for (this[t] = e & 255; ++i < n && (a *= 256);) e < 0 && o === 0 && this[t + i - 1] !== 0 && (o = 1), this[t + i] = (e / a >> 0) - o & 255;
|
|
@@ -600,44 +600,44 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
|
|
|
600
600
|
}, u.prototype.writeIntBE = function(e, t, n, r) {
|
|
601
601
|
if (e = +e, t >>>= 0, !r) {
|
|
602
602
|
let r = 2 ** (8 * n - 1);
|
|
603
|
-
|
|
603
|
+
U(this, e, t, n, r - 1, -r);
|
|
604
604
|
}
|
|
605
605
|
let i = n - 1, a = 1, o = 0;
|
|
606
606
|
for (this[t + i] = e & 255; --i >= 0 && (a *= 256);) e < 0 && o === 0 && this[t + i + 1] !== 0 && (o = 1), this[t + i] = (e / a >> 0) - o & 255;
|
|
607
607
|
return t + n;
|
|
608
608
|
}, u.prototype.writeInt8 = function(e, t, n) {
|
|
609
|
-
return e = +e, t >>>= 0, n ||
|
|
609
|
+
return e = +e, t >>>= 0, n || U(this, e, t, 1, 127, -128), e < 0 && (e = 255 + e + 1), this[t] = e & 255, t + 1;
|
|
610
610
|
}, u.prototype.writeInt16LE = function(e, t, n) {
|
|
611
|
-
return e = +e, t >>>= 0, n ||
|
|
611
|
+
return e = +e, t >>>= 0, n || U(this, e, t, 2, 32767, -32768), this[t] = e & 255, this[t + 1] = e >>> 8, t + 2;
|
|
612
612
|
}, u.prototype.writeInt16BE = function(e, t, n) {
|
|
613
|
-
return e = +e, t >>>= 0, n ||
|
|
613
|
+
return e = +e, t >>>= 0, n || U(this, e, t, 2, 32767, -32768), this[t] = e >>> 8, this[t + 1] = e & 255, t + 2;
|
|
614
614
|
}, u.prototype.writeInt32LE = function(e, t, n) {
|
|
615
|
-
return e = +e, t >>>= 0, n ||
|
|
615
|
+
return e = +e, t >>>= 0, n || U(this, e, t, 4, 2147483647, -2147483648), this[t] = e & 255, this[t + 1] = e >>> 8, this[t + 2] = e >>> 16, this[t + 3] = e >>> 24, t + 4;
|
|
616
616
|
}, u.prototype.writeInt32BE = function(e, t, n) {
|
|
617
|
-
return e = +e, t >>>= 0, n ||
|
|
617
|
+
return e = +e, t >>>= 0, n || U(this, e, t, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1), this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = e & 255, t + 4;
|
|
618
618
|
}, u.prototype.writeBigInt64LE = X(function(e, t = 0) {
|
|
619
|
-
return
|
|
619
|
+
return ee(this, e, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
620
620
|
}), u.prototype.writeBigInt64BE = X(function(e, t = 0) {
|
|
621
|
-
return
|
|
621
|
+
return te(this, e, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
622
622
|
});
|
|
623
|
-
function
|
|
623
|
+
function W(e, t, n, r, i, a) {
|
|
624
624
|
if (n + r > e.length || n < 0) throw RangeError("Index out of range");
|
|
625
625
|
}
|
|
626
|
-
function
|
|
627
|
-
return t = +t, r >>>= 0, a ||
|
|
626
|
+
function ne(e, t, r, i, a) {
|
|
627
|
+
return t = +t, r >>>= 0, a || W(e, t, r, 4), n.write(e, t, r, i, 23, 4), r + 4;
|
|
628
628
|
}
|
|
629
629
|
u.prototype.writeFloatLE = function(e, t, n) {
|
|
630
|
-
return
|
|
630
|
+
return ne(this, e, t, !0, n);
|
|
631
631
|
}, u.prototype.writeFloatBE = function(e, t, n) {
|
|
632
|
-
return
|
|
632
|
+
return ne(this, e, t, !1, n);
|
|
633
633
|
};
|
|
634
|
-
function
|
|
635
|
-
return t = +t, r >>>= 0, a ||
|
|
634
|
+
function re(e, t, r, i, a) {
|
|
635
|
+
return t = +t, r >>>= 0, a || W(e, t, r, 8), n.write(e, t, r, i, 52, 8), r + 8;
|
|
636
636
|
}
|
|
637
637
|
u.prototype.writeDoubleLE = function(e, t, n) {
|
|
638
|
-
return
|
|
638
|
+
return re(this, e, t, !0, n);
|
|
639
639
|
}, u.prototype.writeDoubleBE = function(e, t, n) {
|
|
640
|
-
return
|
|
640
|
+
return re(this, e, t, !1, n);
|
|
641
641
|
}, u.prototype.copy = function(e, t, n, r) {
|
|
642
642
|
if (!u.isBuffer(e)) throw TypeError("argument should be a Buffer");
|
|
643
643
|
if (n ||= 0, !r && r !== 0 && (r = this.length), t >= e.length && (t = e.length), t ||= 0, r > 0 && r < n && (r = n), r === n || e.length === 0 || this.length === 0) return 0;
|
|
@@ -668,9 +668,9 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
|
|
|
668
668
|
}
|
|
669
669
|
return this;
|
|
670
670
|
};
|
|
671
|
-
let
|
|
672
|
-
function
|
|
673
|
-
|
|
671
|
+
let G = {};
|
|
672
|
+
function K(e, t, n) {
|
|
673
|
+
G[e] = class extends n {
|
|
674
674
|
constructor() {
|
|
675
675
|
super(), Object.defineProperty(this, "message", {
|
|
676
676
|
value: t.apply(this, arguments),
|
|
@@ -694,34 +694,34 @@ var u, d, f, p, m, h, g, _, v, y, b = e((() => {
|
|
|
694
694
|
}
|
|
695
695
|
};
|
|
696
696
|
}
|
|
697
|
-
|
|
697
|
+
K("ERR_BUFFER_OUT_OF_BOUNDS", function(e) {
|
|
698
698
|
return e ? `${e} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
|
|
699
|
-
}, RangeError),
|
|
699
|
+
}, RangeError), K("ERR_INVALID_ARG_TYPE", function(e, t) {
|
|
700
700
|
return `The "${e}" argument must be of type number. Received type ${typeof t}`;
|
|
701
|
-
}, TypeError),
|
|
701
|
+
}, TypeError), K("ERR_OUT_OF_RANGE", function(e, t, n) {
|
|
702
702
|
let r = `The value of "${e}" is out of range.`, i = n;
|
|
703
|
-
return Number.isInteger(n) && Math.abs(n) > 2 ** 32 ? i =
|
|
703
|
+
return Number.isInteger(n) && Math.abs(n) > 2 ** 32 ? i = ie(String(n)) : typeof n == "bigint" && (i = String(n), (n > BigInt(2) ** BigInt(32) || n < -(BigInt(2) ** BigInt(32))) && (i = ie(i)), i += "n"), r += ` It must be ${t}. Received ${i}`, r;
|
|
704
704
|
}, RangeError);
|
|
705
|
-
function
|
|
705
|
+
function ie(e) {
|
|
706
706
|
let t = "", n = e.length, r = +(e[0] === "-");
|
|
707
707
|
for (; n >= r + 4; n -= 3) t = `_${e.slice(n - 3, n)}${t}`;
|
|
708
708
|
return `${e.slice(0, n)}${t}`;
|
|
709
709
|
}
|
|
710
|
-
function
|
|
710
|
+
function q(e, t, n) {
|
|
711
711
|
J(t, "offset"), (e[t] === void 0 || e[t + n] === void 0) && oe(t, e.length - (n + 1));
|
|
712
712
|
}
|
|
713
|
-
function
|
|
713
|
+
function ae(e, t, n, r, i, a) {
|
|
714
714
|
if (e > n || e < t) {
|
|
715
715
|
let r = typeof t == "bigint" ? "n" : "", i;
|
|
716
|
-
throw i = a > 3 ? t === 0 || t === BigInt(0) ? `>= 0${r} and < 2${r} ** ${(a + 1) * 8}${r}` : `>= -(2${r} ** ${(a + 1) * 8 - 1}${r}) and < 2 ** ${(a + 1) * 8 - 1}${r}` : `>= ${t}${r} and <= ${n}${r}`, new
|
|
716
|
+
throw i = a > 3 ? t === 0 || t === BigInt(0) ? `>= 0${r} and < 2${r} ** ${(a + 1) * 8}${r}` : `>= -(2${r} ** ${(a + 1) * 8 - 1}${r}) and < 2 ** ${(a + 1) * 8 - 1}${r}` : `>= ${t}${r} and <= ${n}${r}`, new G.ERR_OUT_OF_RANGE("value", i, e);
|
|
717
717
|
}
|
|
718
|
-
|
|
718
|
+
q(r, i, a);
|
|
719
719
|
}
|
|
720
720
|
function J(e, t) {
|
|
721
|
-
if (typeof e != "number") throw new
|
|
721
|
+
if (typeof e != "number") throw new G.ERR_INVALID_ARG_TYPE(t, "number", e);
|
|
722
722
|
}
|
|
723
723
|
function oe(e, t, n) {
|
|
724
|
-
throw Math.floor(e) === e ? t < 0 ? new
|
|
724
|
+
throw Math.floor(e) === e ? t < 0 ? new G.ERR_BUFFER_OUT_OF_BOUNDS() : new G.ERR_OUT_OF_RANGE(n || "offset", `>= ${+!!n} and <= ${t}`, e) : (J(e, n), new G.ERR_OUT_OF_RANGE(n || "offset", "an integer", e));
|
|
725
725
|
}
|
|
726
726
|
let se = /[^+/0-9A-Za-z-_]/g;
|
|
727
727
|
function ce(e) {
|
|
@@ -937,7 +937,7 @@ function k(e, t) {
|
|
|
937
937
|
this.fun = e, this.array = t;
|
|
938
938
|
}
|
|
939
939
|
function A() {}
|
|
940
|
-
var j, M, N, P, F, I, L, R,
|
|
940
|
+
var j, M, N, P, F, I, L, R, z, B, V = e((() => {
|
|
941
941
|
j = { exports: {} }, M = j.exports = {}, (function() {
|
|
942
942
|
try {
|
|
943
943
|
N = typeof setTimeout == "function" ? setTimeout : C;
|
|
@@ -965,8 +965,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
965
965
|
throw Error("process.chdir is not supported");
|
|
966
966
|
}, M.umask = function() {
|
|
967
967
|
return 0;
|
|
968
|
-
},
|
|
969
|
-
})),
|
|
968
|
+
}, z = j.exports, B = /* @__PURE__ */ S(z);
|
|
969
|
+
})), H = /* @__PURE__ */ t(((e, t) => {
|
|
970
970
|
var n = typeof Reflect == "object" ? Reflect : null, r = n && typeof n.apply == "function" ? n.apply : function(e, t, n) {
|
|
971
971
|
return Function.prototype.apply.call(e, t, n);
|
|
972
972
|
}, i = n && typeof n.ownKeys == "function" ? n.ownKeys : Object.getOwnPropertySymbols ? function(e) {
|
|
@@ -1141,7 +1141,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
1141
1141
|
});
|
|
1142
1142
|
else throw TypeError("The \"emitter\" argument must be of type EventEmitter. Received type " + typeof e);
|
|
1143
1143
|
}
|
|
1144
|
-
})),
|
|
1144
|
+
})), U = /* @__PURE__ */ t(((e, t) => {
|
|
1145
1145
|
var n = ["out", "err"];
|
|
1146
1146
|
t.exports = class {
|
|
1147
1147
|
constructor(e, t) {
|
|
@@ -1149,8 +1149,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
1149
1149
|
this.type = e, this.string = t;
|
|
1150
1150
|
}
|
|
1151
1151
|
};
|
|
1152
|
-
})),
|
|
1153
|
-
var n =
|
|
1152
|
+
})), ee = /* @__PURE__ */ t(((e, t) => {
|
|
1153
|
+
var n = U();
|
|
1154
1154
|
t.exports = class {
|
|
1155
1155
|
constructor(e = [], t = 0) {
|
|
1156
1156
|
if (typeof t != "number") throw Error("Command Result ExitCode must be a number");
|
|
@@ -1174,9 +1174,9 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
1174
1174
|
return this.std = [], e;
|
|
1175
1175
|
}
|
|
1176
1176
|
};
|
|
1177
|
-
})),
|
|
1177
|
+
})), te = /* @__PURE__ */ t(((e, t) => {
|
|
1178
1178
|
b();
|
|
1179
|
-
var n =
|
|
1179
|
+
var n = H(), r = n.EventEmitter || n.default || n;
|
|
1180
1180
|
function i(e) {
|
|
1181
1181
|
if (!e) return [];
|
|
1182
1182
|
let t = typeof e == "string" ? e : e instanceof Uint8Array || y !== void 0 && y.isBuffer(e) ? new TextDecoder().decode(e) : String(e), n = [], r = 0;
|
|
@@ -1286,8 +1286,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
1286
1286
|
},
|
|
1287
1287
|
parseVtKeys: i
|
|
1288
1288
|
};
|
|
1289
|
-
})),
|
|
1290
|
-
var n =
|
|
1289
|
+
})), W = /* @__PURE__ */ t(((e, t) => {
|
|
1290
|
+
var n = H(), r = ee(), { TtyStream: i, parseVtKeys: a } = te(), o = n.EventEmitter || n.default || n;
|
|
1291
1291
|
t.exports = class extends o {
|
|
1292
1292
|
constructor(e, t) {
|
|
1293
1293
|
super(), this.arguments = e, this.result = new r(), this.context = t || null;
|
|
@@ -1335,8 +1335,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
1335
1335
|
this.emit("flush", this.result.flush());
|
|
1336
1336
|
}
|
|
1337
1337
|
};
|
|
1338
|
-
})),
|
|
1339
|
-
var n =
|
|
1338
|
+
})), ne = /* @__PURE__ */ t(((e, t) => {
|
|
1339
|
+
var n = W();
|
|
1340
1340
|
t.exports = class extends n {
|
|
1341
1341
|
get captureInput() {
|
|
1342
1342
|
return !0;
|
|
@@ -1365,8 +1365,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
1365
1365
|
});
|
|
1366
1366
|
}
|
|
1367
1367
|
};
|
|
1368
|
-
})),
|
|
1369
|
-
b(),
|
|
1368
|
+
})), re = /* @__PURE__ */ t(((e, t) => {
|
|
1369
|
+
b(), V();
|
|
1370
1370
|
var { BinaryFile: n, SymlinkRef: r } = x(), i = new Uint8Array([
|
|
1371
1371
|
66,
|
|
1372
1372
|
82,
|
|
@@ -1471,7 +1471,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
1471
1471
|
let t = e.$c;
|
|
1472
1472
|
if (m[t]) return m[t];
|
|
1473
1473
|
if (f.inlineCommands && f.inlineCommands[t]) try {
|
|
1474
|
-
let e =
|
|
1474
|
+
let e = W(), n = ne();
|
|
1475
1475
|
return Function("Command", "InteractiveCommand", `return (${f.inlineCommands[t]});`)(e, n);
|
|
1476
1476
|
} catch {
|
|
1477
1477
|
return null;
|
|
@@ -1503,8 +1503,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
1503
1503
|
let t = new DecompressionStream("gzip"), n = new Blob([e]).stream().pipeThrough(t), r = await new Response(n).arrayBuffer();
|
|
1504
1504
|
return new Uint8Array(r);
|
|
1505
1505
|
}
|
|
1506
|
-
if (
|
|
1507
|
-
let t =
|
|
1506
|
+
if (B !== void 0 && typeof B.getBuiltinModule == "function") {
|
|
1507
|
+
let t = B.getBuiltinModule("zlib");
|
|
1508
1508
|
if (t) return new Uint8Array(t.gunzipSync(y.from(e.buffer, e.byteOffset, e.byteLength)));
|
|
1509
1509
|
}
|
|
1510
1510
|
throw Error("Gzip decompression is not supported in this environment");
|
|
@@ -1523,8 +1523,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
1523
1523
|
return f(new Uint8Array(n), t);
|
|
1524
1524
|
}
|
|
1525
1525
|
if (typeof e == "string") {
|
|
1526
|
-
if (!/^https?:\/\//i.test(e) &&
|
|
1527
|
-
let n =
|
|
1526
|
+
if (!/^https?:\/\//i.test(e) && B !== void 0 && typeof B.getBuiltinModule == "function" && typeof window > "u") try {
|
|
1527
|
+
let n = B.getBuiltinModule("fs");
|
|
1528
1528
|
if (n && n.existsSync(e)) {
|
|
1529
1529
|
let r = await n.promises.readFile(e);
|
|
1530
1530
|
return f(new Uint8Array(r.buffer, r.byteOffset, r.byteLength), t);
|
|
@@ -1636,7 +1636,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
1636
1636
|
}
|
|
1637
1637
|
}
|
|
1638
1638
|
};
|
|
1639
|
-
})),
|
|
1639
|
+
})), G = /* @__PURE__ */ t(((e, t) => {
|
|
1640
1640
|
b();
|
|
1641
1641
|
var n = x(), { BinaryFile: r, SymlinkRef: i } = n;
|
|
1642
1642
|
function a(e) {
|
|
@@ -1661,20 +1661,20 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
1661
1661
|
t.exports = class extends n {
|
|
1662
1662
|
constructor(e = "/", t = {}, n = {}, r = null) {
|
|
1663
1663
|
if (super(), t instanceof Uint8Array || t instanceof ArrayBuffer) {
|
|
1664
|
-
let { deserializeBinaryFilesystem: e } =
|
|
1664
|
+
let { deserializeBinaryFilesystem: e } = re(), r = e(t);
|
|
1665
1665
|
t = r.filesystem, n = Object.assign({}, r.permissions, n);
|
|
1666
1666
|
} else if (t && typeof t == "object" && t.filesystem && (t.filesystem instanceof Uint8Array || typeof t.filesystem == "object") && (n = Object.assign({}, t.permissions || {}, n), t = t.filesystem, t instanceof Uint8Array || t instanceof ArrayBuffer)) {
|
|
1667
|
-
let { deserializeBinaryFilesystem: e } =
|
|
1667
|
+
let { deserializeBinaryFilesystem: e } = re(), r = e(t);
|
|
1668
1668
|
t = r.filesystem, n = Object.assign({}, r.permissions, n);
|
|
1669
1669
|
}
|
|
1670
1670
|
a(t), this.fileSystem = t, this.permissions = Object.assign({}, n), this.cwd = e, this._onChange = r, this._changeScheduled = !1;
|
|
1671
1671
|
}
|
|
1672
1672
|
toBinaryContainer(e = {}) {
|
|
1673
|
-
let { serializeBinaryFilesystem: t } =
|
|
1673
|
+
let { serializeBinaryFilesystem: t } = re();
|
|
1674
1674
|
return t(this.fileSystem, this.permissions, e);
|
|
1675
1675
|
}
|
|
1676
1676
|
static fromBinaryContainer(e, t = {}) {
|
|
1677
|
-
let { deserializeBinaryFilesystem: n } =
|
|
1677
|
+
let { deserializeBinaryFilesystem: n } = re();
|
|
1678
1678
|
return n(e, t);
|
|
1679
1679
|
}
|
|
1680
1680
|
getFileByPath(e) {
|
|
@@ -1852,10 +1852,10 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
1852
1852
|
return null;
|
|
1853
1853
|
}
|
|
1854
1854
|
}, t.exports.BinaryFile = r, t.exports.SymlinkRef = i;
|
|
1855
|
-
})),
|
|
1855
|
+
})), K = /* @__PURE__ */ t(((e, t) => {
|
|
1856
1856
|
t.exports = null;
|
|
1857
|
-
})),
|
|
1858
|
-
|
|
1857
|
+
})), ie = /* @__PURE__ */ t(((e, t) => {
|
|
1858
|
+
V();
|
|
1859
1859
|
function n(e) {
|
|
1860
1860
|
if (typeof e != "string") throw TypeError("Path must be a string. Received " + JSON.stringify(e));
|
|
1861
1861
|
}
|
|
@@ -1893,7 +1893,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
1893
1893
|
resolve: function() {
|
|
1894
1894
|
for (var e = "", t = !1, i, a = arguments.length - 1; a >= -1 && !t; a--) {
|
|
1895
1895
|
var o;
|
|
1896
|
-
a >= 0 ? o = arguments[a] : (i === void 0 && (i =
|
|
1896
|
+
a >= 0 ? o = arguments[a] : (i === void 0 && (i = B.cwd()), o = i), n(o), o.length !== 0 && (e = o + "/" + e, t = o.charCodeAt(0) === 47);
|
|
1897
1897
|
}
|
|
1898
1898
|
return e = r(e, !t), t ? e.length > 0 ? "/" + e : "/" : e.length > 0 ? e : ".";
|
|
1899
1899
|
},
|
|
@@ -2022,12 +2022,12 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
2022
2022
|
posix: null
|
|
2023
2023
|
};
|
|
2024
2024
|
a.posix = a, t.exports = a;
|
|
2025
|
-
})),
|
|
2026
|
-
|
|
2027
|
-
var n =
|
|
2025
|
+
})), q = /* @__PURE__ */ t(((e, t) => {
|
|
2026
|
+
V();
|
|
2027
|
+
var n = K(), r = ie(), i = x();
|
|
2028
2028
|
t.exports = class extends i {
|
|
2029
2029
|
constructor(e, t = null) {
|
|
2030
|
-
super(), this._onChange = t, this._changeScheduled = !1, this._virtualFiles = {}, this.cwd = this._normalizeCwd(e ||
|
|
2030
|
+
super(), this._onChange = t, this._changeScheduled = !1, this._virtualFiles = {}, this.cwd = this._normalizeCwd(e || B.cwd());
|
|
2031
2031
|
}
|
|
2032
2032
|
get isRealFilesystem() {
|
|
2033
2033
|
return !0;
|
|
@@ -2231,8 +2231,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
2231
2231
|
}
|
|
2232
2232
|
}
|
|
2233
2233
|
};
|
|
2234
|
-
})),
|
|
2235
|
-
var n =
|
|
2234
|
+
})), ae = /* @__PURE__ */ t(((e, t) => {
|
|
2235
|
+
var n = G();
|
|
2236
2236
|
t.exports = class {
|
|
2237
2237
|
constructor(e) {
|
|
2238
2238
|
this.options = e;
|
|
@@ -2266,7 +2266,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
2266
2266
|
return this.fs._getFileRaw(t) || null;
|
|
2267
2267
|
}
|
|
2268
2268
|
setNodeFilesystem(e) {
|
|
2269
|
-
let t =
|
|
2269
|
+
let t = q(), n = this.fs._onChange;
|
|
2270
2270
|
this.fs = new t(e, n);
|
|
2271
2271
|
}
|
|
2272
2272
|
setFilesystem(e, t = {}) {
|
|
@@ -2287,7 +2287,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
2287
2287
|
}
|
|
2288
2288
|
};
|
|
2289
2289
|
})), J = /* @__PURE__ */ t(((e, t) => {
|
|
2290
|
-
var n =
|
|
2290
|
+
var n = W();
|
|
2291
2291
|
t.exports = class extends n {
|
|
2292
2292
|
constructor(e, t) {
|
|
2293
2293
|
super(e, t);
|
|
@@ -2661,7 +2661,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
2661
2661
|
}, t.exports.isKnownInterpreter = r;
|
|
2662
2662
|
})), se = /* @__PURE__ */ t(((e, t) => {
|
|
2663
2663
|
b();
|
|
2664
|
-
var n = oe(), { BinaryFile: r } =
|
|
2664
|
+
var n = oe(), { BinaryFile: r } = G(), i = 0, a = 8, o = 20, s = 28, c = 31, l = 44, u = 54, d = 70, f = 0, p = 2, m = 3, h = 4, g = 1, _ = 2, v = 4, x = 8, S = 1, C = class extends n {
|
|
2665
2665
|
get name() {
|
|
2666
2666
|
return "wasm";
|
|
2667
2667
|
}
|
|
@@ -2671,7 +2671,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
2671
2671
|
run() {
|
|
2672
2672
|
let e = this.script, t = (() => {
|
|
2673
2673
|
try {
|
|
2674
|
-
return
|
|
2674
|
+
return K();
|
|
2675
2675
|
} catch {
|
|
2676
2676
|
return null;
|
|
2677
2677
|
}
|
|
@@ -2737,29 +2737,29 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
2737
2737
|
let t = {
|
|
2738
2738
|
1: "",
|
|
2739
2739
|
2: ""
|
|
2740
|
-
}, n = new TextDecoder(),
|
|
2740
|
+
}, n = new TextDecoder(), b = new TextEncoder(), C = null, w = (e, n) => {
|
|
2741
2741
|
t[e] = (t[e] || "") + n;
|
|
2742
2742
|
let r = t[e].split("\n");
|
|
2743
2743
|
t[e] = r.pop();
|
|
2744
2744
|
for (let t of r) e === 1 ? this.stdOut = t : this.stdErr = t;
|
|
2745
|
-
},
|
|
2745
|
+
}, T = () => {
|
|
2746
2746
|
t[1] &&= (this.stdOut = t[1], ""), t[2] &&= (this.stdErr = t[2], "");
|
|
2747
|
-
},
|
|
2747
|
+
}, E = typeof this.stdin == "string" ? b.encode(this.stdin) : this.stdin instanceof Uint8Array ? this.stdin : y !== void 0 && y.isBuffer(this.stdin) ? new Uint8Array(this.stdin) : new Uint8Array(), D = 0, O = this.context && this.context.fs ? this.context.fs : this.fs, j = 5, M = new Map([[3, {
|
|
2748
2748
|
type: "preopen",
|
|
2749
2749
|
path: "/",
|
|
2750
2750
|
guestName: "/"
|
|
2751
2751
|
}], [4, {
|
|
2752
2752
|
type: "preopen",
|
|
2753
|
-
path:
|
|
2753
|
+
path: O && O.cwd || "/",
|
|
2754
2754
|
guestName: "."
|
|
2755
|
-
}]]),
|
|
2756
|
-
let n =
|
|
2755
|
+
}]]), N = (e, t) => {
|
|
2756
|
+
let n = M.get(e);
|
|
2757
2757
|
if (!n || n.type !== "preopen" && n.type !== "dir") return null;
|
|
2758
|
-
if (t.startsWith("/")) return
|
|
2758
|
+
if (t.startsWith("/")) return O.absolutePath(t);
|
|
2759
2759
|
let r = n.path.endsWith("/") ? n.path : n.path + "/";
|
|
2760
|
-
return
|
|
2761
|
-
},
|
|
2762
|
-
if (!(!e || e.type !== "file" || !e.dirty || !
|
|
2760
|
+
return O.absolutePath(r + t);
|
|
2761
|
+
}, P = (e) => {
|
|
2762
|
+
if (!(!e || e.type !== "file" || !e.dirty || !O)) try {
|
|
2763
2763
|
let t = !0;
|
|
2764
2764
|
for (let n = 0; n < e.bytes.length; n++) if (e.bytes[n] === 0) {
|
|
2765
2765
|
t = !1;
|
|
@@ -2767,32 +2767,32 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
2767
2767
|
}
|
|
2768
2768
|
if (t) {
|
|
2769
2769
|
let t = n.decode(e.bytes);
|
|
2770
|
-
|
|
2770
|
+
O.setFileByPath(e.path, t, !0);
|
|
2771
2771
|
} else {
|
|
2772
2772
|
let t = new Uint8Array(e.bytes.length);
|
|
2773
|
-
t.set(e.bytes),
|
|
2773
|
+
t.set(e.bytes), O.setFileByPath(e.path, new r(t.buffer, "application/octet-stream"), !0);
|
|
2774
2774
|
}
|
|
2775
2775
|
e.dirty = !1;
|
|
2776
2776
|
} catch {}
|
|
2777
|
-
},
|
|
2777
|
+
}, F = Object.entries(this.context && this.context.vars || {}).map(([e, t]) => `${e}=${t}`), I = new Proxy({
|
|
2778
2778
|
fd_write: (e, t, r, o) => {
|
|
2779
|
-
if (!
|
|
2780
|
-
let s = new DataView(
|
|
2779
|
+
if (!C) return a;
|
|
2780
|
+
let s = new DataView(C.buffer);
|
|
2781
2781
|
if (e === 1 || e === 2) {
|
|
2782
2782
|
let a = 0;
|
|
2783
2783
|
for (let i = 0; i < r; i++) {
|
|
2784
2784
|
let r = s.getUint32(t + i * 8, !0), o = s.getUint32(t + i * 8 + 4, !0);
|
|
2785
|
-
o > 0 &&
|
|
2785
|
+
o > 0 && w(e, n.decode(new Uint8Array(C.buffer, r, o))), a += o;
|
|
2786
2786
|
}
|
|
2787
2787
|
return s.setUint32(o, a, !0), i;
|
|
2788
2788
|
}
|
|
2789
|
-
let c =
|
|
2789
|
+
let c = M.get(e);
|
|
2790
2790
|
if (!c || c.type !== "file") return a;
|
|
2791
2791
|
let l = 0;
|
|
2792
2792
|
for (let e = 0; e < r; e++) {
|
|
2793
2793
|
let n = s.getUint32(t + e * 8, !0), r = s.getUint32(t + e * 8 + 4, !0);
|
|
2794
2794
|
if (r > 0) {
|
|
2795
|
-
let e = new Uint8Array(
|
|
2795
|
+
let e = new Uint8Array(C.buffer, n, r), t = c.append ? c.bytes.length : c.pos, i = t + r;
|
|
2796
2796
|
if (i > c.bytes.length) {
|
|
2797
2797
|
let e = new Uint8Array(i);
|
|
2798
2798
|
e.set(c.bytes), c.bytes = e;
|
|
@@ -2803,29 +2803,29 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
2803
2803
|
return s.setUint32(o, l, !0), i;
|
|
2804
2804
|
},
|
|
2805
2805
|
fd_read: (e, t, n, r) => {
|
|
2806
|
-
if (!
|
|
2807
|
-
let o = new DataView(
|
|
2806
|
+
if (!C) return a;
|
|
2807
|
+
let o = new DataView(C.buffer);
|
|
2808
2808
|
if (e === 0) {
|
|
2809
2809
|
let e = 0;
|
|
2810
|
-
for (let r = 0; r < n &&
|
|
2811
|
-
let n = o.getUint32(t + r * 8, !0), i = o.getUint32(t + r * 8 + 4, !0), a = Math.min(i,
|
|
2812
|
-
new Uint8Array(
|
|
2810
|
+
for (let r = 0; r < n && D < E.length; r++) {
|
|
2811
|
+
let n = o.getUint32(t + r * 8, !0), i = o.getUint32(t + r * 8 + 4, !0), a = Math.min(i, E.length - D);
|
|
2812
|
+
new Uint8Array(C.buffer).set(E.slice(D, D + a), n), D += a, e += a;
|
|
2813
2813
|
}
|
|
2814
2814
|
return o.setUint32(r, e, !0), i;
|
|
2815
2815
|
}
|
|
2816
|
-
let s =
|
|
2816
|
+
let s = M.get(e);
|
|
2817
2817
|
if (!s || s.type !== "file") return a;
|
|
2818
2818
|
let c = 0;
|
|
2819
2819
|
for (let e = 0; e < n && s.pos < s.bytes.length; e++) {
|
|
2820
2820
|
let n = o.getUint32(t + e * 8, !0), r = o.getUint32(t + e * 8 + 4, !0), i = Math.min(r, s.bytes.length - s.pos);
|
|
2821
|
-
new Uint8Array(
|
|
2821
|
+
new Uint8Array(C.buffer).set(s.bytes.subarray(s.pos, s.pos + i), n), s.pos += i, c += i;
|
|
2822
2822
|
}
|
|
2823
2823
|
return o.setUint32(r, c, !0), i;
|
|
2824
2824
|
},
|
|
2825
2825
|
fd_seek: (e, t, n, r, o) => {
|
|
2826
|
-
if (!
|
|
2826
|
+
if (!C) return a;
|
|
2827
2827
|
if (e <= 2) return d;
|
|
2828
|
-
let c =
|
|
2828
|
+
let c = M.get(e);
|
|
2829
2829
|
if (!c || c.type !== "file") return a;
|
|
2830
2830
|
let l, u, f;
|
|
2831
2831
|
typeof t == "bigint" ? (l = Number(t), u = n, f = r) : (l = t, u = r, f = o);
|
|
@@ -2834,46 +2834,46 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
2834
2834
|
else if (u === 1) p = c.pos + l;
|
|
2835
2835
|
else if (u === 2) p = c.bytes.length + l;
|
|
2836
2836
|
else return s;
|
|
2837
|
-
return p < 0 ? s : (c.pos = p, f && new DataView(
|
|
2837
|
+
return p < 0 ? s : (c.pos = p, f && new DataView(C.buffer).setBigUint64(f, BigInt(c.pos), !0), i);
|
|
2838
2838
|
},
|
|
2839
2839
|
fd_tell: (e, t) => {
|
|
2840
|
-
if (!
|
|
2841
|
-
let n =
|
|
2842
|
-
return !n || n.type !== "file" ? a : (new DataView(
|
|
2840
|
+
if (!C) return a;
|
|
2841
|
+
let n = M.get(e);
|
|
2842
|
+
return !n || n.type !== "file" ? a : (new DataView(C.buffer).setBigUint64(t, BigInt(n.pos), !0), i);
|
|
2843
2843
|
},
|
|
2844
2844
|
fd_close: (e) => {
|
|
2845
2845
|
if (e <= 2) return i;
|
|
2846
|
-
let t =
|
|
2847
|
-
return t ? (
|
|
2846
|
+
let t = M.get(e);
|
|
2847
|
+
return t ? (P(t), M.delete(e), i) : a;
|
|
2848
2848
|
},
|
|
2849
2849
|
fd_sync: (e) => {
|
|
2850
|
-
let t =
|
|
2851
|
-
return t &&
|
|
2850
|
+
let t = M.get(e);
|
|
2851
|
+
return t && P(t), i;
|
|
2852
2852
|
},
|
|
2853
2853
|
fd_datasync: (e) => {
|
|
2854
|
-
let t =
|
|
2855
|
-
return t &&
|
|
2854
|
+
let t = M.get(e);
|
|
2855
|
+
return t && P(t), i;
|
|
2856
2856
|
},
|
|
2857
2857
|
fd_prestat_get: (e, t) => {
|
|
2858
|
-
if (!
|
|
2859
|
-
let n =
|
|
2858
|
+
if (!C) return a;
|
|
2859
|
+
let n = M.get(e);
|
|
2860
2860
|
if (!n || n.type !== "preopen") return a;
|
|
2861
|
-
let r = new DataView(
|
|
2861
|
+
let r = new DataView(C.buffer), o = b.encode(n.guestName);
|
|
2862
2862
|
return r.setUint8(t, 0), r.setUint32(t + 4, o.length, !0), i;
|
|
2863
2863
|
},
|
|
2864
2864
|
fd_prestat_dir_name: (e, t, n) => {
|
|
2865
|
-
if (!
|
|
2866
|
-
let r =
|
|
2865
|
+
if (!C) return a;
|
|
2866
|
+
let r = M.get(e);
|
|
2867
2867
|
if (!r || r.type !== "preopen") return a;
|
|
2868
|
-
let o =
|
|
2869
|
-
return new Uint8Array(
|
|
2868
|
+
let o = b.encode(r.guestName);
|
|
2869
|
+
return new Uint8Array(C.buffer, t, Math.min(n, o.length)).set(o.subarray(0, n)), i;
|
|
2870
2870
|
},
|
|
2871
2871
|
fd_fdstat_get: (e, t) => {
|
|
2872
|
-
if (!
|
|
2873
|
-
let n = new DataView(
|
|
2872
|
+
if (!C) return a;
|
|
2873
|
+
let n = new DataView(C.buffer), r = f;
|
|
2874
2874
|
if (e <= 2) r = p;
|
|
2875
2875
|
else {
|
|
2876
|
-
let t =
|
|
2876
|
+
let t = M.get(e);
|
|
2877
2877
|
if (!t) return a;
|
|
2878
2878
|
r = t.type === "preopen" || t.type === "dir" ? m : h;
|
|
2879
2879
|
}
|
|
@@ -2882,83 +2882,83 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
2882
2882
|
},
|
|
2883
2883
|
fd_fdstat_set_flags: () => i,
|
|
2884
2884
|
fd_filestat_get: (e, t) => {
|
|
2885
|
-
if (!
|
|
2886
|
-
let n = new DataView(
|
|
2885
|
+
if (!C) return a;
|
|
2886
|
+
let n = new DataView(C.buffer);
|
|
2887
2887
|
for (let e = 0; e < 64; e++) n.setUint8(t + e, 0);
|
|
2888
2888
|
if (e <= 2) return n.setUint8(t + 16, p), i;
|
|
2889
|
-
let r =
|
|
2889
|
+
let r = M.get(e);
|
|
2890
2890
|
if (!r) return a;
|
|
2891
2891
|
let o = r.type === "preopen" || r.type === "dir";
|
|
2892
2892
|
return n.setUint8(t + 16, o ? m : h), n.setBigUint64(t + 24, 1n, !0), n.setBigUint64(t + 32, BigInt(r.bytes ? r.bytes.length : 0), !0), i;
|
|
2893
2893
|
},
|
|
2894
2894
|
path_open: (e, t, r, s, d, f, p, m, h) => {
|
|
2895
|
-
if (!
|
|
2896
|
-
let
|
|
2897
|
-
if (!
|
|
2898
|
-
let w =
|
|
2895
|
+
if (!C || !O) return a;
|
|
2896
|
+
let y = N(e, n.decode(new Uint8Array(C.buffer, r, s)));
|
|
2897
|
+
if (!y) return a;
|
|
2898
|
+
let w = O.stat(y), T = w !== null;
|
|
2899
2899
|
if (d & v && d & g && T) return o;
|
|
2900
2900
|
if (d & _) {
|
|
2901
2901
|
if (!T) return l;
|
|
2902
2902
|
if (!w.isDirectory) return u;
|
|
2903
|
-
let e =
|
|
2904
|
-
return
|
|
2903
|
+
let e = j++;
|
|
2904
|
+
return M.set(e, {
|
|
2905
2905
|
type: "dir",
|
|
2906
|
-
path:
|
|
2907
|
-
}), new DataView(
|
|
2906
|
+
path: y
|
|
2907
|
+
}), new DataView(C.buffer).setUint32(h, e, !0), i;
|
|
2908
2908
|
}
|
|
2909
2909
|
if (T && w.isDirectory) return c;
|
|
2910
2910
|
if (!T && !(d & g)) return l;
|
|
2911
|
-
let E = new Uint8Array(),
|
|
2911
|
+
let E = new Uint8Array(), D = !1;
|
|
2912
2912
|
if (T && !(d & x)) {
|
|
2913
|
-
let e =
|
|
2914
|
-
e != null && (E = typeof e == "string" ?
|
|
2915
|
-
} else
|
|
2916
|
-
let
|
|
2917
|
-
return
|
|
2913
|
+
let e = O.getFileByPath(y);
|
|
2914
|
+
e != null && (E = typeof e == "string" ? b.encode(e) : new Uint8Array(this._contentToBytes(e)));
|
|
2915
|
+
} else D = !0;
|
|
2916
|
+
let k = j++;
|
|
2917
|
+
return M.set(k, {
|
|
2918
2918
|
type: "file",
|
|
2919
|
-
path:
|
|
2919
|
+
path: y,
|
|
2920
2920
|
bytes: E,
|
|
2921
2921
|
pos: m & S ? E.length : 0,
|
|
2922
2922
|
append: !!(m & S),
|
|
2923
|
-
dirty:
|
|
2924
|
-
}), new DataView(
|
|
2923
|
+
dirty: D
|
|
2924
|
+
}), new DataView(C.buffer).setUint32(h, k, !0), i;
|
|
2925
2925
|
},
|
|
2926
2926
|
path_filestat_get: (e, t, r, o, s) => {
|
|
2927
|
-
if (!
|
|
2928
|
-
let c =
|
|
2927
|
+
if (!C || !O) return a;
|
|
2928
|
+
let c = N(e, n.decode(new Uint8Array(C.buffer, r, o)));
|
|
2929
2929
|
if (!c) return a;
|
|
2930
|
-
let u =
|
|
2930
|
+
let u = O.stat(c);
|
|
2931
2931
|
if (!u) return l;
|
|
2932
|
-
let d = new DataView(
|
|
2932
|
+
let d = new DataView(C.buffer);
|
|
2933
2933
|
for (let e = 0; e < 64; e++) d.setUint8(s + e, 0);
|
|
2934
|
-
return d.setUint8(s + 16, u.isDirectory ? m : h), d.setBigUint64(s + 24, 1n, !0), d.setBigUint64(s + 32, BigInt(
|
|
2934
|
+
return d.setUint8(s + 16, u.isDirectory ? m : h), d.setBigUint64(s + 24, 1n, !0), d.setBigUint64(s + 32, BigInt(O.getSize(c) || 0), !0), i;
|
|
2935
2935
|
},
|
|
2936
2936
|
path_create_directory: (e, t, r) => {
|
|
2937
|
-
if (!
|
|
2938
|
-
let o =
|
|
2937
|
+
if (!C || !O) return a;
|
|
2938
|
+
let o = N(e, n.decode(new Uint8Array(C.buffer, t, r)));
|
|
2939
2939
|
if (!o) return a;
|
|
2940
2940
|
try {
|
|
2941
|
-
return
|
|
2941
|
+
return O.setFileByPath(o, {}, !0), i;
|
|
2942
2942
|
} catch {
|
|
2943
2943
|
return s;
|
|
2944
2944
|
}
|
|
2945
2945
|
},
|
|
2946
2946
|
path_unlink_file: (e, t, r) => {
|
|
2947
|
-
if (!
|
|
2948
|
-
let o =
|
|
2949
|
-
if (!o || !
|
|
2947
|
+
if (!C || !O) return a;
|
|
2948
|
+
let o = N(e, n.decode(new Uint8Array(C.buffer, t, r)));
|
|
2949
|
+
if (!o || !O.exists(o)) return l;
|
|
2950
2950
|
try {
|
|
2951
|
-
return
|
|
2951
|
+
return O.deleteFileByPath(o), i;
|
|
2952
2952
|
} catch {
|
|
2953
2953
|
return s;
|
|
2954
2954
|
}
|
|
2955
2955
|
},
|
|
2956
2956
|
path_remove_directory: (e, t, r) => {
|
|
2957
|
-
if (!
|
|
2958
|
-
let o =
|
|
2959
|
-
if (!o || !
|
|
2957
|
+
if (!C || !O) return a;
|
|
2958
|
+
let o = N(e, n.decode(new Uint8Array(C.buffer, t, r)));
|
|
2959
|
+
if (!o || !O.exists(o)) return l;
|
|
2960
2960
|
try {
|
|
2961
|
-
return
|
|
2961
|
+
return O.deleteFileByPath(o), i;
|
|
2962
2962
|
} catch {
|
|
2963
2963
|
return s;
|
|
2964
2964
|
}
|
|
@@ -2970,88 +2970,88 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
2970
2970
|
};
|
|
2971
2971
|
},
|
|
2972
2972
|
args_sizes_get: (e, t) => {
|
|
2973
|
-
if (!
|
|
2974
|
-
let n = [this.script, ...this.arguments || []], r = new DataView(
|
|
2975
|
-
return r.setUint32(e, n.length, !0), r.setUint32(t, n.reduce((e, t) => e +
|
|
2973
|
+
if (!C) return s;
|
|
2974
|
+
let n = [this.script, ...this.arguments || []], r = new DataView(C.buffer);
|
|
2975
|
+
return r.setUint32(e, n.length, !0), r.setUint32(t, n.reduce((e, t) => e + b.encode(t).length + 1, 0), !0), i;
|
|
2976
2976
|
},
|
|
2977
2977
|
args_get: (e, t) => {
|
|
2978
|
-
if (!
|
|
2979
|
-
let n = [this.script, ...this.arguments || []], r = new DataView(
|
|
2978
|
+
if (!C) return s;
|
|
2979
|
+
let n = [this.script, ...this.arguments || []], r = new DataView(C.buffer), a = t;
|
|
2980
2980
|
for (let t = 0; t < n.length; t++) {
|
|
2981
2981
|
r.setUint32(e + t * 4, a, !0);
|
|
2982
|
-
let i =
|
|
2983
|
-
new Uint8Array(
|
|
2982
|
+
let i = b.encode(n[t] + "\0");
|
|
2983
|
+
new Uint8Array(C.buffer).set(i, a), a += i.length;
|
|
2984
2984
|
}
|
|
2985
2985
|
return i;
|
|
2986
2986
|
},
|
|
2987
2987
|
environ_sizes_get: (e, t) => {
|
|
2988
|
-
if (!
|
|
2989
|
-
let n = new DataView(
|
|
2990
|
-
n.setUint32(e,
|
|
2991
|
-
let r =
|
|
2988
|
+
if (!C) return s;
|
|
2989
|
+
let n = new DataView(C.buffer);
|
|
2990
|
+
n.setUint32(e, F.length, !0);
|
|
2991
|
+
let r = F.reduce((e, t) => e + b.encode(t).length + 1, 0);
|
|
2992
2992
|
return n.setUint32(t, r, !0), i;
|
|
2993
2993
|
},
|
|
2994
2994
|
environ_get: (e, t) => {
|
|
2995
|
-
if (!
|
|
2996
|
-
let n = new DataView(
|
|
2997
|
-
for (let t = 0; t <
|
|
2995
|
+
if (!C) return s;
|
|
2996
|
+
let n = new DataView(C.buffer), r = t;
|
|
2997
|
+
for (let t = 0; t < F.length; t++) {
|
|
2998
2998
|
n.setUint32(e + t * 4, r, !0);
|
|
2999
|
-
let i =
|
|
3000
|
-
new Uint8Array(
|
|
2999
|
+
let i = b.encode(F[t] + "\0");
|
|
3000
|
+
new Uint8Array(C.buffer).set(i, r), r += i.length;
|
|
3001
3001
|
}
|
|
3002
3002
|
return i;
|
|
3003
3003
|
},
|
|
3004
3004
|
clock_time_get: (e, t, n) => {
|
|
3005
|
-
if (
|
|
3005
|
+
if (C) {
|
|
3006
3006
|
let e = BigInt(Date.now()) * 1000000n;
|
|
3007
|
-
new DataView(
|
|
3007
|
+
new DataView(C.buffer).setBigUint64(n, e, !0);
|
|
3008
3008
|
}
|
|
3009
3009
|
return i;
|
|
3010
3010
|
},
|
|
3011
3011
|
random_get: (e, t) => {
|
|
3012
|
-
if (
|
|
3013
|
-
let n = new Uint8Array(
|
|
3012
|
+
if (C) {
|
|
3013
|
+
let n = new Uint8Array(C.buffer, e, t);
|
|
3014
3014
|
for (let e = 0; e < t; e++) n[e] = Math.random() * 256 | 0;
|
|
3015
3015
|
}
|
|
3016
3016
|
return i;
|
|
3017
3017
|
}
|
|
3018
3018
|
}, { get(e, t) {
|
|
3019
3019
|
return t in e ? e[t] : () => 0;
|
|
3020
|
-
} }),
|
|
3021
|
-
if (!
|
|
3020
|
+
} }), L = (e) => {
|
|
3021
|
+
if (!C || !e) return "";
|
|
3022
3022
|
try {
|
|
3023
|
-
let t = new DataView(
|
|
3023
|
+
let t = new DataView(C.buffer).getUint32(e - 4, !0), n = new Uint16Array(C.buffer, e, t >>> 1);
|
|
3024
3024
|
return String.fromCharCode(...n);
|
|
3025
3025
|
} catch {
|
|
3026
3026
|
return "";
|
|
3027
3027
|
}
|
|
3028
|
-
},
|
|
3029
|
-
wasi_snapshot_preview1:
|
|
3030
|
-
wasi_unstable:
|
|
3028
|
+
}, R = {
|
|
3029
|
+
wasi_snapshot_preview1: I,
|
|
3030
|
+
wasi_unstable: I,
|
|
3031
3031
|
env: new Proxy({
|
|
3032
3032
|
print: (e, t) => {
|
|
3033
|
-
|
|
3033
|
+
C && w(1, n.decode(new Uint8Array(C.buffer, e, t)));
|
|
3034
3034
|
},
|
|
3035
3035
|
eprint: (e, t) => {
|
|
3036
|
-
|
|
3036
|
+
C && w(2, n.decode(new Uint8Array(C.buffer, e, t)));
|
|
3037
3037
|
},
|
|
3038
3038
|
log: (e) => {
|
|
3039
|
-
|
|
3039
|
+
w(1, L(e) + "\n");
|
|
3040
3040
|
},
|
|
3041
3041
|
logi: (e) => {
|
|
3042
|
-
|
|
3042
|
+
w(1, String(e) + "\n");
|
|
3043
3043
|
},
|
|
3044
3044
|
logf: (e) => {
|
|
3045
|
-
|
|
3045
|
+
w(1, String(e) + "\n");
|
|
3046
3046
|
},
|
|
3047
3047
|
trace: (e, t, ...n) => {
|
|
3048
3048
|
let r = t > 0 ? " " + n.slice(0, t).join(", ") : "";
|
|
3049
|
-
|
|
3049
|
+
w(1, `trace: ${L(e)}${r}\n`);
|
|
3050
3050
|
},
|
|
3051
3051
|
seed: () => Date.now() * Math.random(),
|
|
3052
3052
|
abort: (e, t, n, r) => {
|
|
3053
|
-
let i =
|
|
3054
|
-
throw (i || a) &&
|
|
3053
|
+
let i = L(e), a = L(t);
|
|
3054
|
+
throw (i || a) && w(2, `abort: ${i || "aborted"} at ${a || this.script}:${n || 0}:${r || 0}\n`), this.exitCode = 134, {
|
|
3055
3055
|
_wasmExit: !0,
|
|
3056
3056
|
code: 134
|
|
3057
3057
|
};
|
|
@@ -3067,10 +3067,10 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3067
3067
|
initial: 1,
|
|
3068
3068
|
maximum: 256
|
|
3069
3069
|
});
|
|
3070
|
-
|
|
3070
|
+
C = t, R[e.module] || (R[e.module] = {}), R[e.module][e.name] = t;
|
|
3071
3071
|
}
|
|
3072
|
-
let n = await WebAssembly.instantiate(t,
|
|
3073
|
-
n.exports.memory && (
|
|
3072
|
+
let n = await WebAssembly.instantiate(t, R);
|
|
3073
|
+
n.exports.memory && (C = n.exports.memory);
|
|
3074
3074
|
let r = n.exports._start || n.exports.__wasi_command || n.exports.main || n.exports.run;
|
|
3075
3075
|
if (r) try {
|
|
3076
3076
|
await r();
|
|
@@ -3084,27 +3084,27 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3084
3084
|
} catch (e) {
|
|
3085
3085
|
(!e || !e._wasmExit) && (this.stdErr = `${this.script}: ${e?.message || String(e)}`, this.exitCode = 1);
|
|
3086
3086
|
} finally {
|
|
3087
|
-
for (let e of
|
|
3087
|
+
for (let e of M.values()) P(e);
|
|
3088
3088
|
}
|
|
3089
|
-
|
|
3090
|
-
let
|
|
3089
|
+
T();
|
|
3090
|
+
let z = this.arguments || [];
|
|
3091
3091
|
if (!(this.result && this.result.getStdOutput && this.result.getStdOutput().length > 0) && (this.exitCode === 0 || this.exitCode === void 0)) {
|
|
3092
3092
|
let t = (this.script || "wasm").split("/").pop(), n = Object.assign({
|
|
3093
3093
|
name: t,
|
|
3094
3094
|
version: "wasi",
|
|
3095
3095
|
description: `WebAssembly WASI binary (${this.script})`
|
|
3096
3096
|
}, this._pkgMeta || {});
|
|
3097
|
-
if (
|
|
3097
|
+
if (z.includes("--help") || z.includes("-h")) {
|
|
3098
3098
|
let r = k(e);
|
|
3099
3099
|
for (let e of A(t, n, r)) this.stdOut = e;
|
|
3100
|
-
} else (
|
|
3100
|
+
} else (z.includes("--version") || z.includes("-V") || z.includes("-v")) && (this.stdOut = `${t} (${n.name} ${n.version} wasm)`);
|
|
3101
3101
|
}
|
|
3102
3102
|
}
|
|
3103
3103
|
}, w = /* @__PURE__ */ new Map();
|
|
3104
3104
|
function T(e, t) {
|
|
3105
3105
|
if (!e || !e.exists(t)) return null;
|
|
3106
3106
|
if (e.isRealFilesystem) try {
|
|
3107
|
-
let n =
|
|
3107
|
+
let n = K();
|
|
3108
3108
|
return new Uint8Array(n.readFileSync(e.absolutePath(t)));
|
|
3109
3109
|
} catch {}
|
|
3110
3110
|
let n = e.getFileByPath(t);
|
|
@@ -3133,7 +3133,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3133
3133
|
o.set(a);
|
|
3134
3134
|
let s = new r(o.buffer, i);
|
|
3135
3135
|
if (e.isRealFilesystem) try {
|
|
3136
|
-
let n =
|
|
3136
|
+
let n = K(), r = ie(), i = e.absolutePath(t);
|
|
3137
3137
|
n.mkdirSync(r.dirname(i), { recursive: !0 }), n.writeFileSync(i, y.from(a.buffer, a.byteOffset, a.byteLength));
|
|
3138
3138
|
return;
|
|
3139
3139
|
} catch {
|
|
@@ -3243,9 +3243,16 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3243
3243
|
let n = [...this.arguments || []], r = n.includes("--help") || n.includes("-h"), a = !r && (n.includes("--version") || n.includes("-V") || n.includes("-v"));
|
|
3244
3244
|
this._inspectedWasm = null, this._persistedWasmBytes = e.wasmPath ? T(this.context && this.context.fs || this.fs, e.wasmPath) : null, r && this._persistedWasmBytes && this._persistedWasmBytes.byteLength > 0 && (this._inspectedWasm = k(this._persistedWasmBytes));
|
|
3245
3245
|
try {
|
|
3246
|
-
if (e.type === "wasm" && (this._persistedWasmBytes || e.wasmUrl)
|
|
3247
|
-
let
|
|
3248
|
-
|
|
3246
|
+
if ((e.type === "wasm" || e.type === "custom-wasm") && (this._persistedWasmBytes || e.wasmUrl)) {
|
|
3247
|
+
let i = this._persistedWasmBytes;
|
|
3248
|
+
if (!i && t.moduleLoader) try {
|
|
3249
|
+
let n = await t.moduleLoader(e.name, e.cdnUrl);
|
|
3250
|
+
n instanceof Uint8Array || n instanceof ArrayBuffer ? i = n instanceof Uint8Array ? n : new Uint8Array(n) : n && (n.wasmBytes || n.wasm || n.wasmBinary) && (i = n.wasmBytes || n.wasm || n.wasmBinary);
|
|
3251
|
+
} catch {}
|
|
3252
|
+
if (!i && e.wasmUrl && (i = await this._fetchWasmBytes(e.wasmUrl)), i) {
|
|
3253
|
+
r && (this._inspectedWasm = k(i)), await this._runRawWasmBytes(i, n);
|
|
3254
|
+
return;
|
|
3255
|
+
}
|
|
3249
3256
|
} else {
|
|
3250
3257
|
let o = e.cdnUrl || e.wasmUrl || `https://esm.sh/${e.name}`, s = typeof globalThis.fetch == "function" ? globalThis.fetch : null;
|
|
3251
3258
|
if (s && this._persistedWasmBytes && this._persistedWasmBytes.byteLength > 0 && typeof Response < "u") {
|
|
@@ -3500,7 +3507,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3500
3507
|
}
|
|
3501
3508
|
C.readBytesFromFs = T, C.writeBytesToFs = E, C.loadModule = D, C.extractHelpFromText = O, C.inspectWasmBytes = k, C.formatWasmHelp = A, C.createGenericWasmCommand = j, C.createCommand = j, t.exports = C;
|
|
3502
3509
|
})), ce = /* @__PURE__ */ t(((e, t) => {
|
|
3503
|
-
var n =
|
|
3510
|
+
var n = W(), r = class extends n {
|
|
3504
3511
|
static get name() {
|
|
3505
3512
|
return "test";
|
|
3506
3513
|
}
|
|
@@ -3585,7 +3592,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3585
3592
|
}
|
|
3586
3593
|
};
|
|
3587
3594
|
})), le = /* @__PURE__ */ t(((e, t) => {
|
|
3588
|
-
var n =
|
|
3595
|
+
var n = W();
|
|
3589
3596
|
t.exports = class extends n {
|
|
3590
3597
|
static get name() {
|
|
3591
3598
|
return "cat";
|
|
@@ -3739,21 +3746,21 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3739
3746
|
pe = globalThis || self;
|
|
3740
3747
|
})), me = /* @__PURE__ */ t(((e, t) => {
|
|
3741
3748
|
Y();
|
|
3742
|
-
var n = Infinity, r = "[object Symbol]", i = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, a = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, o = "\\ud800-\\udfff", s = "\\u0300-\\u036f\\ufe20-\\ufe23", c = "\\u20d0-\\u20f0", l = "\\u2700-\\u27bf", u = "a-z\\xdf-\\xf6\\xf8-\\xff", d = "\\xac\\xb1\\xd7\\xf7", f = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", p = "\\u2000-\\u206f", m = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", h = "A-Z\\xc0-\\xd6\\xd8-\\xde", g = "\\ufe0e\\ufe0f", _ = d + f + p + m, v = "['’]", y = "[" + o + "]", b = "[" + _ + "]", x = "[" + s + c + "]", S = "\\d+", C = "[" + l + "]", w = "[" + u + "]", T = "[^" + o + _ + S + l + u + h + "]", E = "\\ud83c[\\udffb-\\udfff]", D = "(?:" + x + "|" + E + ")", O = "[^" + o + "]", k = "(?:\\ud83c[\\udde6-\\uddff]){2}", A = "[\\ud800-\\udbff][\\udc00-\\udfff]", j = "[" + h + "]", M = "\\u200d", N = "(?:" + w + "|" + T + ")", P = "(?:" + j + "|" + T + ")", F = "(?:" + v + "(?:d|ll|m|re|s|t|ve))?", I = "(?:" + v + "(?:D|LL|M|RE|S|T|VE))?", L = D + "?", R = "[" + g + "]?",
|
|
3749
|
+
var n = Infinity, r = "[object Symbol]", i = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, a = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, o = "\\ud800-\\udfff", s = "\\u0300-\\u036f\\ufe20-\\ufe23", c = "\\u20d0-\\u20f0", l = "\\u2700-\\u27bf", u = "a-z\\xdf-\\xf6\\xf8-\\xff", d = "\\xac\\xb1\\xd7\\xf7", f = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", p = "\\u2000-\\u206f", m = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", h = "A-Z\\xc0-\\xd6\\xd8-\\xde", g = "\\ufe0e\\ufe0f", _ = d + f + p + m, v = "['’]", y = "[" + o + "]", b = "[" + _ + "]", x = "[" + s + c + "]", S = "\\d+", C = "[" + l + "]", w = "[" + u + "]", T = "[^" + o + _ + S + l + u + h + "]", E = "\\ud83c[\\udffb-\\udfff]", D = "(?:" + x + "|" + E + ")", O = "[^" + o + "]", k = "(?:\\ud83c[\\udde6-\\uddff]){2}", A = "[\\ud800-\\udbff][\\udc00-\\udfff]", j = "[" + h + "]", M = "\\u200d", N = "(?:" + w + "|" + T + ")", P = "(?:" + j + "|" + T + ")", F = "(?:" + v + "(?:d|ll|m|re|s|t|ve))?", I = "(?:" + v + "(?:D|LL|M|RE|S|T|VE))?", L = D + "?", R = "[" + g + "]?", z = "(?:" + M + "(?:" + [
|
|
3743
3750
|
O,
|
|
3744
3751
|
k,
|
|
3745
3752
|
A
|
|
3746
|
-
].join("|") + ")" + R + L + ")*",
|
|
3753
|
+
].join("|") + ")" + R + L + ")*", B = R + L + z, V = "(?:" + [
|
|
3747
3754
|
C,
|
|
3748
3755
|
k,
|
|
3749
3756
|
A
|
|
3750
|
-
].join("|") + ")" +
|
|
3757
|
+
].join("|") + ")" + B, H = "(?:" + [
|
|
3751
3758
|
O + x + "?",
|
|
3752
3759
|
x,
|
|
3753
3760
|
k,
|
|
3754
3761
|
A,
|
|
3755
3762
|
y
|
|
3756
|
-
].join("|") + ")",
|
|
3763
|
+
].join("|") + ")", U = RegExp(v, "g"), ee = RegExp(x, "g"), te = RegExp(E + "(?=" + E + ")|" + H + B, "g"), W = RegExp([
|
|
3757
3764
|
j + "?" + w + "+" + F + "(?=" + [
|
|
3758
3765
|
b,
|
|
3759
3766
|
j,
|
|
@@ -3767,8 +3774,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3767
3774
|
j + "?" + N + "+" + F,
|
|
3768
3775
|
j + "+" + I,
|
|
3769
3776
|
S,
|
|
3770
|
-
|
|
3771
|
-
].join("|"), "g"),
|
|
3777
|
+
V
|
|
3778
|
+
].join("|"), "g"), ne = RegExp("[" + M + o + s + c + g + "]"), re = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, G = {
|
|
3772
3779
|
À: "A",
|
|
3773
3780
|
Á: "A",
|
|
3774
3781
|
Â: "A",
|
|
@@ -3959,8 +3966,8 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3959
3966
|
œ: "oe",
|
|
3960
3967
|
ʼn: "'n",
|
|
3961
3968
|
ſ: "ss"
|
|
3962
|
-
},
|
|
3963
|
-
function
|
|
3969
|
+
}, K = typeof pe == "object" && pe && pe.Object === Object && pe, ie = typeof self == "object" && self && self.Object === Object && self, q = K || ie || Function("return this")();
|
|
3970
|
+
function ae(e, t, n, r) {
|
|
3964
3971
|
var i = -1, a = e ? e.length : 0;
|
|
3965
3972
|
for (r && a && (n = e[++i]); ++i < a;) n = t(n, e[i], i, e);
|
|
3966
3973
|
return n;
|
|
@@ -3976,23 +3983,23 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
3976
3983
|
return e?.[t];
|
|
3977
3984
|
};
|
|
3978
3985
|
}
|
|
3979
|
-
var ce = se(
|
|
3986
|
+
var ce = se(G);
|
|
3980
3987
|
function le(e) {
|
|
3981
|
-
return
|
|
3988
|
+
return ne.test(e);
|
|
3982
3989
|
}
|
|
3983
3990
|
function ue(e) {
|
|
3984
|
-
return
|
|
3991
|
+
return re.test(e);
|
|
3985
3992
|
}
|
|
3986
3993
|
function de(e) {
|
|
3987
3994
|
return le(e) ? fe(e) : J(e);
|
|
3988
3995
|
}
|
|
3989
3996
|
function fe(e) {
|
|
3990
|
-
return e.match(
|
|
3997
|
+
return e.match(te) || [];
|
|
3991
3998
|
}
|
|
3992
3999
|
function me(e) {
|
|
3993
|
-
return e.match(
|
|
4000
|
+
return e.match(W) || [];
|
|
3994
4001
|
}
|
|
3995
|
-
var he = Object.prototype.toString, X =
|
|
4002
|
+
var he = Object.prototype.toString, X = q.Symbol, ge = X ? X.prototype : void 0, _e = ge ? ge.toString : void 0;
|
|
3996
4003
|
function ve(e, t, n) {
|
|
3997
4004
|
var r = -1, i = e.length;
|
|
3998
4005
|
t < 0 && (t = -t > i ? 0 : i + t), n = n > i ? i : n, n < 0 && (n += i), i = t > n ? 0 : n - t >>> 0, t >>>= 0;
|
|
@@ -4018,7 +4025,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
4018
4025
|
}
|
|
4019
4026
|
function Se(e) {
|
|
4020
4027
|
return function(t) {
|
|
4021
|
-
return
|
|
4028
|
+
return ae(Ae(Oe(t).replace(U, "")), e, "");
|
|
4022
4029
|
};
|
|
4023
4030
|
}
|
|
4024
4031
|
function Ce(e) {
|
|
@@ -4037,7 +4044,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
4037
4044
|
return ke(Te(e).toLowerCase());
|
|
4038
4045
|
}
|
|
4039
4046
|
function Oe(e) {
|
|
4040
|
-
return e = Te(e), e && e.replace(a, ce).replace(
|
|
4047
|
+
return e = Te(e), e && e.replace(a, ce).replace(ee, "");
|
|
4041
4048
|
}
|
|
4042
4049
|
var ke = xe("toUpperCase");
|
|
4043
4050
|
function Ae(e, t, n) {
|
|
@@ -4045,7 +4052,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
4045
4052
|
}
|
|
4046
4053
|
t.exports = Ee;
|
|
4047
4054
|
})), he = /* @__PURE__ */ t(((e, t) => {
|
|
4048
|
-
|
|
4055
|
+
V();
|
|
4049
4056
|
var n = ue(), r = de(), i = fe(), a = me(), o = {
|
|
4050
4057
|
short: /^-([^\d-])$/,
|
|
4051
4058
|
long: /^--(\S+)/,
|
|
@@ -4053,10 +4060,10 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
4053
4060
|
optEquals: /^(--\S+?)=(.*)/
|
|
4054
4061
|
}, s = class extends Array {
|
|
4055
4062
|
load(e) {
|
|
4056
|
-
if (this.clear(), e && e !==
|
|
4063
|
+
if (this.clear(), e && e !== B.argv) e = n(e);
|
|
4057
4064
|
else {
|
|
4058
|
-
e =
|
|
4059
|
-
let t =
|
|
4065
|
+
e = B.argv.slice(0);
|
|
4066
|
+
let t = B.execArgv.some(m) ? 1 : 2;
|
|
4060
4067
|
e.splice(0, t);
|
|
4061
4068
|
}
|
|
4062
4069
|
e.forEach((e) => this.push(String(e)));
|
|
@@ -4312,7 +4319,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
4312
4319
|
}
|
|
4313
4320
|
t.exports = E;
|
|
4314
4321
|
})), X = /* @__PURE__ */ t(((e, t) => {
|
|
4315
|
-
var n =
|
|
4322
|
+
var n = W(), r = he();
|
|
4316
4323
|
t.exports = class extends n {
|
|
4317
4324
|
static get name() {
|
|
4318
4325
|
return "ls";
|
|
@@ -4413,7 +4420,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
4413
4420
|
}
|
|
4414
4421
|
};
|
|
4415
4422
|
})), ge = /* @__PURE__ */ t(((e, t) => {
|
|
4416
|
-
var n =
|
|
4423
|
+
var n = W();
|
|
4417
4424
|
t.exports = class extends n {
|
|
4418
4425
|
static get name() {
|
|
4419
4426
|
return "echo";
|
|
@@ -4429,7 +4436,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
4429
4436
|
}
|
|
4430
4437
|
};
|
|
4431
4438
|
})), _e = /* @__PURE__ */ t(((e, t) => {
|
|
4432
|
-
var n =
|
|
4439
|
+
var n = W();
|
|
4433
4440
|
t.exports = class extends n {
|
|
4434
4441
|
static get name() {
|
|
4435
4442
|
return "printf";
|
|
@@ -4448,7 +4455,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
4448
4455
|
}
|
|
4449
4456
|
};
|
|
4450
4457
|
})), ve = /* @__PURE__ */ t(((e, t) => {
|
|
4451
|
-
var n =
|
|
4458
|
+
var n = W();
|
|
4452
4459
|
t.exports = class extends n {
|
|
4453
4460
|
static get name() {
|
|
4454
4461
|
return "grep";
|
|
@@ -4646,7 +4653,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
4646
4653
|
}
|
|
4647
4654
|
};
|
|
4648
4655
|
})), ye = /* @__PURE__ */ t(((e, t) => {
|
|
4649
|
-
var n =
|
|
4656
|
+
var n = W();
|
|
4650
4657
|
t.exports = class extends n {
|
|
4651
4658
|
static get name() {
|
|
4652
4659
|
return "true";
|
|
@@ -4656,7 +4663,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
4656
4663
|
}
|
|
4657
4664
|
};
|
|
4658
4665
|
})), be = /* @__PURE__ */ t(((e, t) => {
|
|
4659
|
-
var n =
|
|
4666
|
+
var n = W();
|
|
4660
4667
|
t.exports = class extends n {
|
|
4661
4668
|
static get name() {
|
|
4662
4669
|
return "false";
|
|
@@ -4771,7 +4778,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
4771
4778
|
}
|
|
4772
4779
|
};
|
|
4773
4780
|
})), Ee = /* @__PURE__ */ t(((e, t) => {
|
|
4774
|
-
var n = J(), r =
|
|
4781
|
+
var n = J(), r = K();
|
|
4775
4782
|
t.exports = class extends n {
|
|
4776
4783
|
static get name() {
|
|
4777
4784
|
return "cp";
|
|
@@ -4869,7 +4876,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
4869
4876
|
})), De = /* @__PURE__ */ t(((e, t) => {
|
|
4870
4877
|
var n = J(), r = (() => {
|
|
4871
4878
|
try {
|
|
4872
|
-
return
|
|
4879
|
+
return K();
|
|
4873
4880
|
} catch {
|
|
4874
4881
|
return null;
|
|
4875
4882
|
}
|
|
@@ -4967,7 +4974,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
4967
4974
|
}
|
|
4968
4975
|
};
|
|
4969
4976
|
})), ke = /* @__PURE__ */ t(((e, t) => {
|
|
4970
|
-
var n = J(), r =
|
|
4977
|
+
var n = J(), r = K();
|
|
4971
4978
|
t.exports = class extends n {
|
|
4972
4979
|
static get name() {
|
|
4973
4980
|
return "mv";
|
|
@@ -5011,7 +5018,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
5011
5018
|
continue;
|
|
5012
5019
|
}
|
|
5013
5020
|
try {
|
|
5014
|
-
let e =
|
|
5021
|
+
let e = ie();
|
|
5015
5022
|
r.mkdirSync(e.dirname(i), { recursive: !0 }), r.renameSync(n, i);
|
|
5016
5023
|
} catch (n) {
|
|
5017
5024
|
this.stdErr = `mv: cannot move '${e}' to '${t}': ${n.message}`, this.exitCode = 1;
|
|
@@ -5051,7 +5058,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
5051
5058
|
}
|
|
5052
5059
|
};
|
|
5053
5060
|
})), je = /* @__PURE__ */ t(((e, t) => {
|
|
5054
|
-
var n = J(), r =
|
|
5061
|
+
var n = J(), r = K();
|
|
5055
5062
|
t.exports = class extends n {
|
|
5056
5063
|
static get name() {
|
|
5057
5064
|
return "rm";
|
|
@@ -5098,7 +5105,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
5098
5105
|
})), Me = /* @__PURE__ */ t(((e, t) => {
|
|
5099
5106
|
var n = J(), r = (() => {
|
|
5100
5107
|
try {
|
|
5101
|
-
return
|
|
5108
|
+
return K();
|
|
5102
5109
|
} catch {
|
|
5103
5110
|
return null;
|
|
5104
5111
|
}
|
|
@@ -5167,7 +5174,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
5167
5174
|
})), Ne = /* @__PURE__ */ t(((e, t) => {
|
|
5168
5175
|
var n = J(), r = (() => {
|
|
5169
5176
|
try {
|
|
5170
|
-
return
|
|
5177
|
+
return K();
|
|
5171
5178
|
} catch {
|
|
5172
5179
|
return null;
|
|
5173
5180
|
}
|
|
@@ -5342,7 +5349,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
5342
5349
|
}
|
|
5343
5350
|
};
|
|
5344
5351
|
})), ze = /* @__PURE__ */ t(((e, t) => {
|
|
5345
|
-
var n = J(), r =
|
|
5352
|
+
var n = J(), r = W();
|
|
5346
5353
|
t.exports = class extends n {
|
|
5347
5354
|
static get name() {
|
|
5348
5355
|
return "jsfunction";
|
|
@@ -5476,7 +5483,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
5476
5483
|
let e = new TextDecoder().decode(t);
|
|
5477
5484
|
this.fs.setFileByPath(s, e, !0);
|
|
5478
5485
|
} else {
|
|
5479
|
-
let { BinaryFile: e } =
|
|
5486
|
+
let { BinaryFile: e } = G(), r = e ? new e(t.buffer, n || "application/octet-stream") : t;
|
|
5480
5487
|
this.fs.setFileByPath(s, r, !0);
|
|
5481
5488
|
}
|
|
5482
5489
|
} catch (e) {
|
|
@@ -5944,15 +5951,15 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
5944
5951
|
"%URIErrorPrototype%": ["URIError", "prototype"],
|
|
5945
5952
|
"%WeakMapPrototype%": ["WeakMap", "prototype"],
|
|
5946
5953
|
"%WeakSetPrototype%": ["WeakSet", "prototype"]
|
|
5947
|
-
}, F = pt(), I = xt(), L = F.call(k, Array.prototype.concat), R = F.call(O, Array.prototype.splice),
|
|
5948
|
-
var t =
|
|
5954
|
+
}, F = pt(), I = xt(), L = F.call(k, Array.prototype.concat), R = F.call(O, Array.prototype.splice), z = F.call(k, String.prototype.replace), B = F.call(k, String.prototype.slice), V = F.call(k, RegExp.prototype.exec), H = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, U = /\\(\\)?/g, ee = function(e) {
|
|
5955
|
+
var t = B(e, 0, 1), n = B(e, -1);
|
|
5949
5956
|
if (t === "%" && n !== "%") throw new c("invalid intrinsic syntax, expected closing `%`");
|
|
5950
5957
|
if (n === "%" && t !== "%") throw new c("invalid intrinsic syntax, expected opening `%`");
|
|
5951
5958
|
var r = [];
|
|
5952
|
-
return
|
|
5953
|
-
r[r.length] = n ?
|
|
5959
|
+
return z(e, H, function(e, t, n, i) {
|
|
5960
|
+
r[r.length] = n ? z(i, U, "$1") : t || e;
|
|
5954
5961
|
}), r;
|
|
5955
|
-
},
|
|
5962
|
+
}, te = function(e, t) {
|
|
5956
5963
|
var n = e, r;
|
|
5957
5964
|
if (I(P, n) && (r = P[n], n = "%" + r[0] + "%"), I(M, n)) {
|
|
5958
5965
|
var i = M[n];
|
|
@@ -5968,11 +5975,11 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
5968
5975
|
t.exports = function(e, t) {
|
|
5969
5976
|
if (typeof e != "string" || e.length === 0) throw new l("intrinsic name must be a non-empty string");
|
|
5970
5977
|
if (arguments.length > 1 && typeof t != "boolean") throw new l("\"allowMissing\" argument must be a boolean");
|
|
5971
|
-
if (
|
|
5972
|
-
var n =
|
|
5978
|
+
if (V(/^%?[^%]*%?$/, e) === null) throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
|
|
5979
|
+
var n = ee(e), r = n.length > 0 ? n[0] : "", i = te("%" + r + "%", t), a = i.name, o = i.value, s = !1, u = i.alias;
|
|
5973
5980
|
u && (r = u[0], R(n, L([0, 1], u)));
|
|
5974
5981
|
for (var d = 1, f = !0; d < n.length; d += 1) {
|
|
5975
|
-
var p = n[d], m =
|
|
5982
|
+
var p = n[d], m = B(p, 0, 1), h = B(p, -1);
|
|
5976
5983
|
if ((m === "\"" || m === "'" || m === "`" || h === "\"" || h === "'" || h === "`") && m !== h) throw new c("property names with quotes must have matching quotes");
|
|
5977
5984
|
if ((p === "constructor" || !f) && (s = !0), r += "." + p, a = "%" + r + "%", I(M, a)) o = M[a];
|
|
5978
5985
|
else if (o != null) {
|
|
@@ -6186,7 +6193,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
6186
6193
|
}
|
|
6187
6194
|
return v.call(t, n, "$&_");
|
|
6188
6195
|
}
|
|
6189
|
-
var P = Pt(), F = P.custom, I =
|
|
6196
|
+
var P = Pt(), F = P.custom, I = G(F) ? F : null, L = {
|
|
6190
6197
|
__proto__: null,
|
|
6191
6198
|
double: "\"",
|
|
6192
6199
|
single: "'"
|
|
@@ -6197,12 +6204,12 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
6197
6204
|
};
|
|
6198
6205
|
t.exports = function e(t, n, r, o) {
|
|
6199
6206
|
var s = n || {};
|
|
6200
|
-
if (
|
|
6201
|
-
if (
|
|
6202
|
-
var u =
|
|
6207
|
+
if (q(s, "quoteStyle") && !q(L, s.quoteStyle)) throw TypeError("option \"quoteStyle\" must be \"single\" or \"double\"");
|
|
6208
|
+
if (q(s, "maxStringLength") && (typeof s.maxStringLength == "number" ? s.maxStringLength < 0 && s.maxStringLength !== Infinity : s.maxStringLength !== null)) throw TypeError("option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`");
|
|
6209
|
+
var u = q(s, "customInspect") ? s.customInspect : !0;
|
|
6203
6210
|
if (typeof u != "boolean" && u !== "symbol") throw TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
|
|
6204
|
-
if (
|
|
6205
|
-
if (
|
|
6211
|
+
if (q(s, "indent") && s.indent !== null && s.indent !== " " && !(parseInt(s.indent, 10) === s.indent && s.indent > 0)) throw TypeError("option \"indent\" must be \"\\t\", an integer > 0, or `null`");
|
|
6212
|
+
if (q(s, "numericSeparator") && typeof s.numericSeparator != "boolean") throw TypeError("option \"numericSeparator\", if provided, must be `true` or `false`");
|
|
6206
6213
|
var d = s.numericSeparator;
|
|
6207
6214
|
if (t === void 0) return "undefined";
|
|
6208
6215
|
if (t === null) return "null";
|
|
@@ -6218,35 +6225,35 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
6218
6225
|
return d ? N(t, m) : m;
|
|
6219
6226
|
}
|
|
6220
6227
|
var h = s.depth === void 0 ? 5 : s.depth;
|
|
6221
|
-
if (r === void 0 && (r = 0), r >= h && h > 0 && typeof t == "object") return
|
|
6228
|
+
if (r === void 0 && (r = 0), r >= h && h > 0 && typeof t == "object") return H(t) ? "[Array]" : "[Object]";
|
|
6222
6229
|
var g = ye(s, r);
|
|
6223
6230
|
if (o === void 0) o = [];
|
|
6224
6231
|
else if (oe(o, t) >= 0) return "[Circular]";
|
|
6225
6232
|
function y(t, n, i) {
|
|
6226
6233
|
if (n && (o = w.call(o), o.push(n)), i) {
|
|
6227
6234
|
var a = { depth: s.depth };
|
|
6228
|
-
return
|
|
6235
|
+
return q(s, "quoteStyle") && (a.quoteStyle = s.quoteStyle), e(t, a, r + 1, o);
|
|
6229
6236
|
}
|
|
6230
6237
|
return e(t, s, r + 1, o);
|
|
6231
6238
|
}
|
|
6232
|
-
if (typeof t == "function" && !
|
|
6239
|
+
if (typeof t == "function" && !ee(t)) {
|
|
6233
6240
|
var x = J(t), T = xe(t, y);
|
|
6234
6241
|
return "[Function" + (x ? ": " + x : " (anonymous)") + "]" + (T.length > 0 ? " { " + C.call(T, ", ") + " }" : "");
|
|
6235
6242
|
}
|
|
6236
|
-
if (
|
|
6243
|
+
if (G(t)) {
|
|
6237
6244
|
var D = k ? v.call(String(t), /^(Symbol\(.*\))_[^)]*$/, "$1") : O.call(t);
|
|
6238
6245
|
return typeof t == "object" && !k ? X(D) : D;
|
|
6239
6246
|
}
|
|
6240
6247
|
if (fe(t)) {
|
|
6241
|
-
for (var F = "<" + b.call(String(t.nodeName)), R = t.attributes || [],
|
|
6248
|
+
for (var F = "<" + b.call(String(t.nodeName)), R = t.attributes || [], V = 0; V < R.length; V++) F += " " + R[V].name + "=" + z(B(R[V].value), "double", s);
|
|
6242
6249
|
return F += ">", t.childNodes && t.childNodes.length && (F += "..."), F += "</" + b.call(String(t.nodeName)) + ">", F;
|
|
6243
6250
|
}
|
|
6244
|
-
if (
|
|
6251
|
+
if (H(t)) {
|
|
6245
6252
|
if (t.length === 0) return "[]";
|
|
6246
|
-
var
|
|
6247
|
-
return g && !ve(
|
|
6253
|
+
var ie = xe(t, y);
|
|
6254
|
+
return g && !ve(ie) ? "[" + be(ie, g) + "]" : "[ " + C.call(ie, ", ") + " ]";
|
|
6248
6255
|
}
|
|
6249
|
-
if (
|
|
6256
|
+
if (te(t)) {
|
|
6250
6257
|
var Y = xe(t, y);
|
|
6251
6258
|
return !("cause" in Error.prototype) && "cause" in t && !j.call(t, "cause") ? "{ [" + String(t) + "] " + C.call(S.call("[cause]: " + y(t.cause), Y), ", ") + " }" : Y.length === 0 ? "[" + String(t) + "]" : "{ [" + String(t) + "] " + C.call(Y, ", ") + " }";
|
|
6252
6259
|
}
|
|
@@ -6269,50 +6276,50 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
6269
6276
|
if (ce(t)) return ge("WeakMap");
|
|
6270
6277
|
if (de(t)) return ge("WeakSet");
|
|
6271
6278
|
if (le(t)) return ge("WeakRef");
|
|
6272
|
-
if (
|
|
6273
|
-
if (
|
|
6274
|
-
if (
|
|
6275
|
-
if (
|
|
6279
|
+
if (ne(t)) return X(y(Number(t)));
|
|
6280
|
+
if (K(t)) return X(y(E.call(t)));
|
|
6281
|
+
if (re(t)) return X(p.call(t));
|
|
6282
|
+
if (W(t)) return X(y(String(t)));
|
|
6276
6283
|
if (typeof window < "u" && t === window) return "{ [object Window] }";
|
|
6277
6284
|
if (typeof globalThis < "u" && t === globalThis || pe !== void 0 && t === pe) return "{ [object globalThis] }";
|
|
6278
|
-
if (!
|
|
6279
|
-
var Ce = xe(t, y), we = M ? M(t) === Object.prototype : t instanceof Object || t.constructor === Object, Te = t instanceof Object ? "" : "null prototype", Ee = !we && A && Object(t) === t && A in t ? _.call(
|
|
6285
|
+
if (!U(t) && !ee(t)) {
|
|
6286
|
+
var Ce = xe(t, y), we = M ? M(t) === Object.prototype : t instanceof Object || t.constructor === Object, Te = t instanceof Object ? "" : "null prototype", Ee = !we && A && Object(t) === t && A in t ? _.call(ae(t), 8, -1) : Te ? "Object" : "", De = (we || typeof t.constructor != "function" ? "" : t.constructor.name ? t.constructor.name + " " : "") + (Ee || Te ? "[" + C.call(S.call([], Ee || [], Te || []), ": ") + "] " : "");
|
|
6280
6287
|
return Ce.length === 0 ? De + "{}" : g ? De + "{" + be(Ce, g) + "}" : De + "{ " + C.call(Ce, ", ") + " }";
|
|
6281
6288
|
}
|
|
6282
6289
|
return String(t);
|
|
6283
6290
|
};
|
|
6284
|
-
function
|
|
6291
|
+
function z(e, t, n) {
|
|
6285
6292
|
var r = L[n.quoteStyle || t];
|
|
6286
6293
|
return r + e + r;
|
|
6287
6294
|
}
|
|
6288
|
-
function z(e) {
|
|
6289
|
-
return v.call(String(e), /"/g, """);
|
|
6290
|
-
}
|
|
6291
6295
|
function B(e) {
|
|
6292
|
-
return
|
|
6296
|
+
return v.call(String(e), /"/g, """);
|
|
6293
6297
|
}
|
|
6294
6298
|
function V(e) {
|
|
6295
|
-
return
|
|
6299
|
+
return !A || !(typeof e == "object" && (A in e || e[A] !== void 0));
|
|
6296
6300
|
}
|
|
6297
6301
|
function H(e) {
|
|
6298
|
-
return
|
|
6302
|
+
return ae(e) === "[object Array]" && V(e);
|
|
6303
|
+
}
|
|
6304
|
+
function U(e) {
|
|
6305
|
+
return ae(e) === "[object Date]" && V(e);
|
|
6306
|
+
}
|
|
6307
|
+
function ee(e) {
|
|
6308
|
+
return ae(e) === "[object RegExp]" && V(e);
|
|
6299
6309
|
}
|
|
6300
6310
|
function te(e) {
|
|
6301
|
-
return
|
|
6311
|
+
return ae(e) === "[object Error]" && V(e);
|
|
6302
6312
|
}
|
|
6303
|
-
function
|
|
6304
|
-
return
|
|
6313
|
+
function W(e) {
|
|
6314
|
+
return ae(e) === "[object String]" && V(e);
|
|
6305
6315
|
}
|
|
6306
|
-
function
|
|
6307
|
-
return
|
|
6316
|
+
function ne(e) {
|
|
6317
|
+
return ae(e) === "[object Number]" && V(e);
|
|
6308
6318
|
}
|
|
6309
6319
|
function re(e) {
|
|
6310
|
-
return
|
|
6320
|
+
return ae(e) === "[object Boolean]" && V(e);
|
|
6311
6321
|
}
|
|
6312
|
-
function
|
|
6313
|
-
return q(e) === "[object Boolean]" && B(e);
|
|
6314
|
-
}
|
|
6315
|
-
function W(e) {
|
|
6322
|
+
function G(e) {
|
|
6316
6323
|
if (k) return e && typeof e == "object" && e instanceof Symbol;
|
|
6317
6324
|
if (typeof e == "symbol") return !0;
|
|
6318
6325
|
if (!e || typeof e != "object" || !O) return !1;
|
|
@@ -6321,20 +6328,20 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
6321
6328
|
} catch {}
|
|
6322
6329
|
return !1;
|
|
6323
6330
|
}
|
|
6324
|
-
function
|
|
6331
|
+
function K(e) {
|
|
6325
6332
|
if (!e || typeof e != "object" || !E) return !1;
|
|
6326
6333
|
try {
|
|
6327
6334
|
return E.call(e), !0;
|
|
6328
6335
|
} catch {}
|
|
6329
6336
|
return !1;
|
|
6330
6337
|
}
|
|
6331
|
-
var
|
|
6338
|
+
var ie = Object.prototype.hasOwnProperty || function(e) {
|
|
6332
6339
|
return e in this;
|
|
6333
6340
|
};
|
|
6334
|
-
function
|
|
6335
|
-
return
|
|
6341
|
+
function q(e, t) {
|
|
6342
|
+
return ie.call(e, t);
|
|
6336
6343
|
}
|
|
6337
|
-
function
|
|
6344
|
+
function ae(e) {
|
|
6338
6345
|
return m.call(e);
|
|
6339
6346
|
}
|
|
6340
6347
|
function J(e) {
|
|
@@ -6415,7 +6422,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
6415
6422
|
return me(_.call(e, 0, t.maxStringLength), t) + r;
|
|
6416
6423
|
}
|
|
6417
6424
|
var i = R[t.quoteStyle || "single"];
|
|
6418
|
-
return i.lastIndex = 0,
|
|
6425
|
+
return i.lastIndex = 0, z(v.call(v.call(e, i, "\\$1"), /[\x00-\x1f]/g, he), "single", t);
|
|
6419
6426
|
}
|
|
6420
6427
|
function he(e) {
|
|
6421
6428
|
var t = e.charCodeAt(0), n = {
|
|
@@ -6457,17 +6464,17 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
6457
6464
|
return n + C.call(e, "," + n) + "\n" + t.prev;
|
|
6458
6465
|
}
|
|
6459
6466
|
function xe(e, t) {
|
|
6460
|
-
var n =
|
|
6467
|
+
var n = H(e), r = [];
|
|
6461
6468
|
if (n) {
|
|
6462
6469
|
r.length = e.length;
|
|
6463
|
-
for (var i = 0; i < e.length; i++) r[i] =
|
|
6470
|
+
for (var i = 0; i < e.length; i++) r[i] = q(e, i) ? t(e[i], e) : "";
|
|
6464
6471
|
}
|
|
6465
6472
|
var a = typeof D == "function" ? D(e) : [], o;
|
|
6466
6473
|
if (k) {
|
|
6467
6474
|
o = {};
|
|
6468
6475
|
for (var s = 0; s < a.length; s++) o["$" + a[s]] = a[s];
|
|
6469
6476
|
}
|
|
6470
|
-
for (var c in e)
|
|
6477
|
+
for (var c in e) q(e, c) && (n && String(Number(c)) === c && c < e.length || k && o["$" + c] instanceof Symbol || (x.call(/[^\w$]/, c) ? r.push(t(c, e) + ": " + t(e[c], e)) : r.push(c + ": " + t(e[c], e))));
|
|
6471
6478
|
if (typeof D == "function") for (var l = 0; l < a.length; l++) j.call(e, a[l]) && r.push("[" + t(a[l]) + "]: " + t(e[a[l]], e));
|
|
6472
6479
|
return r;
|
|
6473
6480
|
}
|
|
@@ -7380,7 +7387,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
7380
7387
|
shim: o
|
|
7381
7388
|
}), t.exports = s;
|
|
7382
7389
|
})), sr = /* @__PURE__ */ t(((e, t) => {
|
|
7383
|
-
var n =
|
|
7390
|
+
var n = ne(), { createGenericWasmCommand: r } = se(), i = "\x1B[2J\x1B[H", a = "\x1B[0m", o = "\x1B[7m", s = "\x1B[1m", c = "\x1B[2m", l = "\x1B[36m", u = "\x1B[31m", d = "\x1B[32m", f = class extends n {
|
|
7384
7391
|
get requiresFilesystem() {
|
|
7385
7392
|
return !0;
|
|
7386
7393
|
}
|
|
@@ -7637,7 +7644,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
7637
7644
|
f.createReplWasmCommand = p, f.createCommand = p, t.exports = f;
|
|
7638
7645
|
})), cr = /* @__PURE__ */ t(((e, t) => {
|
|
7639
7646
|
b();
|
|
7640
|
-
var r =
|
|
7647
|
+
var r = ae(), i = J(), a = oe(), o = se(), s = W(), c = ne(), { TtyStream: l } = te(), u = "/.brsh_history", d = xe(), f = Ue(), p = H(), m = x(), { isAsyncFilesystemSource: h, resolveFilesystemSource: g } = re(), _ = /\$(?:\{([\w\d?#-]+)\}|([\w\d]+|[?#-]))/g, v = p.EventEmitter || p.default || p;
|
|
7641
7648
|
String.prototype.regexIndexOf = function(e, t) {
|
|
7642
7649
|
let n = this.substring(t || 0).search(e);
|
|
7643
7650
|
return n >= 0 ? n + (t || 0) : n;
|
|
@@ -8287,6 +8294,18 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
8287
8294
|
a.push(l), l === "(" ? i++ : l === ")" && i--;
|
|
8288
8295
|
continue;
|
|
8289
8296
|
}
|
|
8297
|
+
if (r && l === "\\" && c + 1 < e.length) {
|
|
8298
|
+
let t = e[c + 1];
|
|
8299
|
+
if (t === "\"" || t === "\\" || t === "$") {
|
|
8300
|
+
a.push(t), c++;
|
|
8301
|
+
continue;
|
|
8302
|
+
}
|
|
8303
|
+
}
|
|
8304
|
+
if (!n && !r && l === "\\" && c + 1 < e.length) {
|
|
8305
|
+
let t = e[++c];
|
|
8306
|
+
a.push(t), (t === "\"" || t === "'") && (o = !0);
|
|
8307
|
+
continue;
|
|
8308
|
+
}
|
|
8290
8309
|
if (l === "'" && !r) {
|
|
8291
8310
|
n = !n, o = !0;
|
|
8292
8311
|
continue;
|
|
@@ -8338,7 +8357,7 @@ var j, M, N, P, F, I, L, R, ee, z, B = e((() => {
|
|
|
8338
8357
|
return e.create(Object.assign({}, n, { filesystem: t }));
|
|
8339
8358
|
}
|
|
8340
8359
|
};
|
|
8341
|
-
S.STATUS_READY = "READY", S.STATUS_WORKING = "WORKING", S.STATUS_DESTROYED = "DESTROYED", S.Command = s, S.InteractiveCommand = c, S.WasmCommand = o, S.createWasmCommand = o.createGenericWasmCommand || o.createCommand, S.ReplCommand = sr(), S.FS = m, S.BinaryContainer =
|
|
8360
|
+
S.STATUS_READY = "READY", S.STATUS_WORKING = "WORKING", S.STATUS_DESTROYED = "DESTROYED", S.Command = s, S.InteractiveCommand = c, S.WasmCommand = o, S.createWasmCommand = o.createGenericWasmCommand || o.createCommand, S.ReplCommand = sr(), S.FS = m, S.BinaryContainer = re(), S.Storage = S.BinaryContainer.FilesystemStorage, globalThis.shell = S, globalThis.Shell = S, t.exports = S;
|
|
8342
8361
|
}));
|
|
8343
8362
|
//#endregion
|
|
8344
8363
|
export default cr();
|