@elizaos/cli 1.0.1 → 1.0.3

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.
Files changed (77) hide show
  1. package/README.md +1 -0
  2. package/dist/assets/index-BLUE6ehn.css +1 -0
  3. package/dist/assets/index-BLUE6ehn.css.br +0 -0
  4. package/dist/assets/{index-DLCBfFYd.js → index-BaWElBml.js} +1789 -1788
  5. package/dist/assets/{index-DLCBfFYd.js.map → index-BaWElBml.js.map} +1 -1
  6. package/dist/assets/{index-DNxLn4OZ.js → index-Bs4IloEa.js} +2 -2
  7. package/dist/assets/index-Bs4IloEa.js.br +0 -0
  8. package/dist/assets/{index-DNxLn4OZ.js.map → index-Bs4IloEa.js.map} +1 -1
  9. package/dist/assets/vendor-CFQmvqmR.js.br +0 -0
  10. package/dist/{chunk-QC5MM66L.js → chunk-246Q3Y5O.js} +3 -3
  11. package/dist/chunk-2GXSCVA2.js +2057 -0
  12. package/dist/chunk-67L4I5S7.js +80 -0
  13. package/dist/chunk-7HDCC22V.js +771 -0
  14. package/dist/{chunk-F3WZNGHX.js → chunk-BZIUA2KE.js} +6 -0
  15. package/dist/{chunk-QU55ROKN.js → chunk-GE5HMHU5.js} +12 -6
  16. package/dist/{chunk-UMDJUAZA.js → chunk-JT3O6PBU.js} +3908 -377
  17. package/dist/{chunk-5R4LDP3N.js → chunk-KNZMV4HH.js} +4 -4
  18. package/dist/{chunk-QPXAVEMR.js → chunk-NQ5HAYUQ.js} +40 -2
  19. package/dist/{chunk-XF2FQZM2.js → chunk-OF5WHPTG.js} +105 -798
  20. package/dist/{chunk-ENUVIKE2.js → chunk-OG4OJUNA.js} +2 -2
  21. package/dist/{chunk-SOL3WRAY.js → chunk-OJMVYUOU.js} +1 -1
  22. package/dist/{chunk-XLCI6Y5F.js → chunk-QGZZVGE5.js} +2 -2
  23. package/dist/{chunk-PJJS5DFB.js → chunk-WAJ5RHPK.js} +1 -1
  24. package/dist/commands/agent.js +2 -1
  25. package/dist/commands/create.js +4 -3
  26. package/dist/commands/dev.js +4 -3
  27. package/dist/commands/env.js +3 -2
  28. package/dist/commands/plugins.js +4 -3
  29. package/dist/commands/publish.js +5 -4
  30. package/dist/commands/setup-monorepo.js +3 -2
  31. package/dist/commands/start.js +7 -5
  32. package/dist/commands/test.js +8 -6
  33. package/dist/commands/update.js +4 -3
  34. package/dist/fileFromPath-DCRQMDLJ.js +132 -0
  35. package/dist/index.html +2 -2
  36. package/dist/index.js +14 -12
  37. package/dist/migrator-7EYGXTDW.js +29035 -0
  38. package/dist/{registry-YU4WBPLU.js → registry-RGSXW4LO.js} +2 -1
  39. package/package.json +10 -4
  40. package/templates/plugin-starter/package.json +1 -1
  41. package/templates/project-starter/.env.example +1 -0
  42. package/templates/project-starter/package.json +4 -4
  43. package/templates/project-starter/src/index.ts +1 -1
  44. package/templates/project-tee-starter/.dockerignore +20 -0
  45. package/templates/project-tee-starter/.env.example +55 -0
  46. package/templates/project-tee-starter/Dockerfile +66 -0
  47. package/templates/project-tee-starter/GUIDE.md +235 -0
  48. package/templates/project-tee-starter/README.md +173 -0
  49. package/templates/project-tee-starter/__tests__/actions.test.ts +9 -0
  50. package/templates/project-tee-starter/__tests__/character.test.ts +86 -0
  51. package/templates/project-tee-starter/__tests__/config.test.ts +31 -0
  52. package/templates/project-tee-starter/__tests__/env.test.ts +87 -0
  53. package/templates/project-tee-starter/__tests__/error-handling.test.ts +30 -0
  54. package/templates/project-tee-starter/__tests__/events.test.ts +21 -0
  55. package/templates/project-tee-starter/__tests__/file-structure.test.ts +135 -0
  56. package/templates/project-tee-starter/__tests__/integration.test.ts +209 -0
  57. package/templates/project-tee-starter/__tests__/models.test.ts +22 -0
  58. package/templates/project-tee-starter/__tests__/plugin.test.ts +44 -0
  59. package/templates/project-tee-starter/__tests__/provider.test.ts +189 -0
  60. package/templates/project-tee-starter/__tests__/routes.test.ts +21 -0
  61. package/templates/project-tee-starter/__tests__/test-utils.ts +121 -0
  62. package/templates/project-tee-starter/__tests__/utils/core-test-utils.ts +167 -0
  63. package/templates/project-tee-starter/assets/mr-tee-portrait.jpg +0 -0
  64. package/templates/project-tee-starter/docker-compose.yaml +57 -0
  65. package/templates/project-tee-starter/e2e/project.test.ts +38 -0
  66. package/templates/project-tee-starter/e2e/starter-plugin.test.ts +92 -0
  67. package/templates/project-tee-starter/package.json +76 -0
  68. package/templates/project-tee-starter/src/character.ts +257 -0
  69. package/templates/project-tee-starter/src/index.ts +33 -0
  70. package/templates/project-tee-starter/src/plugin.ts +169 -0
  71. package/templates/project-tee-starter/tsconfig.build.json +13 -0
  72. package/templates/project-tee-starter/tsconfig.json +30 -0
  73. package/templates/project-tee-starter/tsup.config.ts +19 -0
  74. package/templates/project-tee-starter/vitest.config.ts +19 -0
  75. package/dist/assets/index-ljsW7JJO.css +0 -1
  76. package/dist/eliza-J3ANDQXN.js +0 -13
  77. /package/dist/{chunk-YX7JHUJ5.js → chunk-BDPGXNHU.js} +0 -0
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DNxLn4OZ.js","assets/vendor-CFQmvqmR.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Bs4IloEa.js","assets/vendor-CFQmvqmR.js"])))=>i.map(i=>d[i]);
2
2
  import { r as requireReact, a as requireReactDom, p as process$1, b as reactExports, g as getDefaultExportFromCjs, c as reactDomExports, R as React, d as ReactDOM, e as React$1, f as getAugmentedNamespace, u as useNavigate, h as useLocation, N as NavLink, i as useParams, L as Link, B as BrowserRouter, j as Routes, k as Route } from './vendor-CFQmvqmR.js';
3
3
 
4
4
  true &&(function polyfill() {
@@ -16058,6 +16058,9 @@ var handleScroll = function (axis, endTarget, event, sourceDelta, noOverscroll)
16058
16058
  var availableScroll = 0;
16059
16059
  var availableScrollTop = 0;
16060
16060
  do {
16061
+ if (!target) {
16062
+ break;
16063
+ }
16061
16064
  var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
16062
16065
  var elementScroll = scroll_1 - capacity - directionFactor * position;
16063
16066
  if (position || elementScroll) {
@@ -16066,9 +16069,10 @@ var handleScroll = function (axis, endTarget, event, sourceDelta, noOverscroll)
16066
16069
  availableScrollTop += position;
16067
16070
  }
16068
16071
  }
16072
+ var parent_1 = target.parentNode;
16069
16073
  // we will "bubble" from ShadowDom in case we are, or just to the parent in normal case
16070
16074
  // this is the same logic used in focus-lock
16071
- target = (target.parentNode.host || target.parentNode);
16075
+ target = (parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1);
16072
16076
  } while (
16073
16077
  // portaled content
16074
16078
  (!targetInLock && target !== document.body) ||
@@ -26889,8 +26893,8 @@ Spartan is direct, efficient, and always prioritizes risk management. He require
26889
26893
  TWITTER_DRY_RUN: false,
26890
26894
  MAX_TWEET_LENGTH: 280,
26891
26895
  TWITTER_ENABLE_POST_GENERATION: true,
26892
- POST_INTERVAL_MIN: 90,
26893
- POST_INTERVAL_MAX: 180,
26896
+ TWITTER_POST_INTERVAL_MIN: 90,
26897
+ TWITTER_POST_INTERVAL_MAX: 180,
26894
26898
  secrets: {
26895
26899
  TWITTER_USERNAME: "process.env.TWITTER_USERNAME",
26896
26900
  TWITTER_PASSWORD: "process.env.TWITTER_PASSWORD",
@@ -27543,1773 +27547,6 @@ var SOCKET_MESSAGE_TYPE = /* @__PURE__ */ ((SOCKET_MESSAGE_TYPE2) => {
27543
27547
  return SOCKET_MESSAGE_TYPE2;
27544
27548
  })(SOCKET_MESSAGE_TYPE || {});
27545
27549
 
27546
- var buffer$1 = {};
27547
- var base64Js$1 = {};
27548
- base64Js$1.byteLength = byteLength$1;
27549
- base64Js$1.toByteArray = toByteArray;
27550
- base64Js$1.fromByteArray = fromByteArray;
27551
- var lookup$3 = [];
27552
- var revLookup = [];
27553
- var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
27554
- var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
27555
- for (var i$1 = 0, len = code.length; i$1 < len; ++i$1) {
27556
- lookup$3[i$1] = code[i$1];
27557
- revLookup[code.charCodeAt(i$1)] = i$1;
27558
- }
27559
- revLookup["-".charCodeAt(0)] = 62;
27560
- revLookup["_".charCodeAt(0)] = 63;
27561
- function getLens(b64) {
27562
- var len = b64.length;
27563
- if (len % 4 > 0) {
27564
- throw new Error("Invalid string. Length must be a multiple of 4");
27565
- }
27566
- var validLen = b64.indexOf("=");
27567
- if (validLen === -1) validLen = len;
27568
- var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4;
27569
- return [validLen, placeHoldersLen];
27570
- }
27571
- function byteLength$1(b64) {
27572
- var lens = getLens(b64);
27573
- var validLen = lens[0];
27574
- var placeHoldersLen = lens[1];
27575
- return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
27576
- }
27577
- function _byteLength(b64, validLen, placeHoldersLen) {
27578
- return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
27579
- }
27580
- function toByteArray(b64) {
27581
- var tmp;
27582
- var lens = getLens(b64);
27583
- var validLen = lens[0];
27584
- var placeHoldersLen = lens[1];
27585
- var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));
27586
- var curByte = 0;
27587
- var len = placeHoldersLen > 0 ? validLen - 4 : validLen;
27588
- var i;
27589
- for (i = 0; i < len; i += 4) {
27590
- tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)];
27591
- arr[curByte++] = tmp >> 16 & 255;
27592
- arr[curByte++] = tmp >> 8 & 255;
27593
- arr[curByte++] = tmp & 255;
27594
- }
27595
- if (placeHoldersLen === 2) {
27596
- tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4;
27597
- arr[curByte++] = tmp & 255;
27598
- }
27599
- if (placeHoldersLen === 1) {
27600
- tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2;
27601
- arr[curByte++] = tmp >> 8 & 255;
27602
- arr[curByte++] = tmp & 255;
27603
- }
27604
- return arr;
27605
- }
27606
- function tripletToBase64(num) {
27607
- return lookup$3[num >> 18 & 63] + lookup$3[num >> 12 & 63] + lookup$3[num >> 6 & 63] + lookup$3[num & 63];
27608
- }
27609
- function encodeChunk(uint8, start, end) {
27610
- var tmp;
27611
- var output = [];
27612
- for (var i = start; i < end; i += 3) {
27613
- tmp = (uint8[i] << 16 & 16711680) + (uint8[i + 1] << 8 & 65280) + (uint8[i + 2] & 255);
27614
- output.push(tripletToBase64(tmp));
27615
- }
27616
- return output.join("");
27617
- }
27618
- function fromByteArray(uint8) {
27619
- var tmp;
27620
- var len = uint8.length;
27621
- var extraBytes = len % 3;
27622
- var parts = [];
27623
- var maxChunkLength = 16383;
27624
- for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
27625
- parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));
27626
- }
27627
- if (extraBytes === 1) {
27628
- tmp = uint8[len - 1];
27629
- parts.push(
27630
- lookup$3[tmp >> 2] + lookup$3[tmp << 4 & 63] + "=="
27631
- );
27632
- } else if (extraBytes === 2) {
27633
- tmp = (uint8[len - 2] << 8) + uint8[len - 1];
27634
- parts.push(
27635
- lookup$3[tmp >> 10] + lookup$3[tmp >> 4 & 63] + lookup$3[tmp << 2 & 63] + "="
27636
- );
27637
- }
27638
- return parts.join("");
27639
- }
27640
- var ieee754 = {};
27641
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
27642
- ieee754.read = function(buffer2, offset, isLE, mLen, nBytes) {
27643
- var e, m;
27644
- var eLen = nBytes * 8 - mLen - 1;
27645
- var eMax = (1 << eLen) - 1;
27646
- var eBias = eMax >> 1;
27647
- var nBits = -7;
27648
- var i = isLE ? nBytes - 1 : 0;
27649
- var d = isLE ? -1 : 1;
27650
- var s = buffer2[offset + i];
27651
- i += d;
27652
- e = s & (1 << -nBits) - 1;
27653
- s >>= -nBits;
27654
- nBits += eLen;
27655
- for (; nBits > 0; e = e * 256 + buffer2[offset + i], i += d, nBits -= 8) {
27656
- }
27657
- m = e & (1 << -nBits) - 1;
27658
- e >>= -nBits;
27659
- nBits += mLen;
27660
- for (; nBits > 0; m = m * 256 + buffer2[offset + i], i += d, nBits -= 8) {
27661
- }
27662
- if (e === 0) {
27663
- e = 1 - eBias;
27664
- } else if (e === eMax) {
27665
- return m ? NaN : (s ? -1 : 1) * Infinity;
27666
- } else {
27667
- m = m + Math.pow(2, mLen);
27668
- e = e - eBias;
27669
- }
27670
- return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
27671
- };
27672
- ieee754.write = function(buffer2, value, offset, isLE, mLen, nBytes) {
27673
- var e, m, c;
27674
- var eLen = nBytes * 8 - mLen - 1;
27675
- var eMax = (1 << eLen) - 1;
27676
- var eBias = eMax >> 1;
27677
- var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
27678
- var i = isLE ? 0 : nBytes - 1;
27679
- var d = isLE ? 1 : -1;
27680
- var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
27681
- value = Math.abs(value);
27682
- if (isNaN(value) || value === Infinity) {
27683
- m = isNaN(value) ? 1 : 0;
27684
- e = eMax;
27685
- } else {
27686
- e = Math.floor(Math.log(value) / Math.LN2);
27687
- if (value * (c = Math.pow(2, -e)) < 1) {
27688
- e--;
27689
- c *= 2;
27690
- }
27691
- if (e + eBias >= 1) {
27692
- value += rt / c;
27693
- } else {
27694
- value += rt * Math.pow(2, 1 - eBias);
27695
- }
27696
- if (value * c >= 2) {
27697
- e++;
27698
- c /= 2;
27699
- }
27700
- if (e + eBias >= eMax) {
27701
- m = 0;
27702
- e = eMax;
27703
- } else if (e + eBias >= 1) {
27704
- m = (value * c - 1) * Math.pow(2, mLen);
27705
- e = e + eBias;
27706
- } else {
27707
- m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
27708
- e = 0;
27709
- }
27710
- }
27711
- for (; mLen >= 8; buffer2[offset + i] = m & 255, i += d, m /= 256, mLen -= 8) {
27712
- }
27713
- e = e << mLen | m;
27714
- eLen += mLen;
27715
- for (; eLen > 0; buffer2[offset + i] = e & 255, i += d, e /= 256, eLen -= 8) {
27716
- }
27717
- buffer2[offset + i - d] |= s * 128;
27718
- };
27719
- /*!
27720
- * The buffer module from node.js, for the browser.
27721
- *
27722
- * @author Feross Aboukhadijeh <https://feross.org>
27723
- * @license MIT
27724
- */
27725
- (function(exports) {
27726
- const base64 = base64Js$1;
27727
- const ieee754$1 = ieee754;
27728
- const customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null;
27729
- exports.Buffer = Buffer2;
27730
- exports.SlowBuffer = SlowBuffer2;
27731
- exports.INSPECT_MAX_BYTES = 50;
27732
- const K_MAX_LENGTH = 2147483647;
27733
- exports.kMaxLength = K_MAX_LENGTH;
27734
- const { Uint8Array: GlobalUint8Array, ArrayBuffer: GlobalArrayBuffer, SharedArrayBuffer: GlobalSharedArrayBuffer } = globalThis;
27735
- Buffer2.TYPED_ARRAY_SUPPORT = typedArraySupport();
27736
- if (!Buffer2.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && typeof console.error === "function") {
27737
- console.error(
27738
- "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
27739
- );
27740
- }
27741
- function typedArraySupport() {
27742
- try {
27743
- const arr = new GlobalUint8Array(1);
27744
- const proto = { foo: function() {
27745
- return 42;
27746
- } };
27747
- Object.setPrototypeOf(proto, GlobalUint8Array.prototype);
27748
- Object.setPrototypeOf(arr, proto);
27749
- return arr.foo() === 42;
27750
- } catch (e) {
27751
- return false;
27752
- }
27753
- }
27754
- Object.defineProperty(Buffer2.prototype, "parent", {
27755
- enumerable: true,
27756
- get: function() {
27757
- if (!Buffer2.isBuffer(this)) return void 0;
27758
- return this.buffer;
27759
- }
27760
- });
27761
- Object.defineProperty(Buffer2.prototype, "offset", {
27762
- enumerable: true,
27763
- get: function() {
27764
- if (!Buffer2.isBuffer(this)) return void 0;
27765
- return this.byteOffset;
27766
- }
27767
- });
27768
- function createBuffer(length) {
27769
- if (length > K_MAX_LENGTH) {
27770
- throw new RangeError('The value "' + length + '" is invalid for option "size"');
27771
- }
27772
- const buf = new GlobalUint8Array(length);
27773
- Object.setPrototypeOf(buf, Buffer2.prototype);
27774
- return buf;
27775
- }
27776
- function Buffer2(arg, encodingOrOffset, length) {
27777
- if (typeof arg === "number") {
27778
- if (typeof encodingOrOffset === "string") {
27779
- throw new TypeError(
27780
- 'The "string" argument must be of type string. Received type number'
27781
- );
27782
- }
27783
- return allocUnsafe(arg);
27784
- }
27785
- return from(arg, encodingOrOffset, length);
27786
- }
27787
- Buffer2.poolSize = 8192;
27788
- function from(value, encodingOrOffset, length) {
27789
- if (typeof value === "string") {
27790
- return fromString(value, encodingOrOffset);
27791
- }
27792
- if (GlobalArrayBuffer.isView(value)) {
27793
- return fromArrayView(value);
27794
- }
27795
- if (value == null) {
27796
- throw new TypeError(
27797
- "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value
27798
- );
27799
- }
27800
- if (isInstance(value, GlobalArrayBuffer) || value && isInstance(value.buffer, GlobalArrayBuffer)) {
27801
- return fromArrayBuffer(value, encodingOrOffset, length);
27802
- }
27803
- if (typeof GlobalSharedArrayBuffer !== "undefined" && (isInstance(value, GlobalSharedArrayBuffer) || value && isInstance(value.buffer, GlobalSharedArrayBuffer))) {
27804
- return fromArrayBuffer(value, encodingOrOffset, length);
27805
- }
27806
- if (typeof value === "number") {
27807
- throw new TypeError(
27808
- 'The "value" argument must not be of type number. Received type number'
27809
- );
27810
- }
27811
- const valueOf = value.valueOf && value.valueOf();
27812
- if (valueOf != null && valueOf !== value) {
27813
- return Buffer2.from(valueOf, encodingOrOffset, length);
27814
- }
27815
- const b = fromObject(value);
27816
- if (b) return b;
27817
- if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") {
27818
- return Buffer2.from(value[Symbol.toPrimitive]("string"), encodingOrOffset, length);
27819
- }
27820
- throw new TypeError(
27821
- "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value
27822
- );
27823
- }
27824
- Buffer2.from = function(value, encodingOrOffset, length) {
27825
- return from(value, encodingOrOffset, length);
27826
- };
27827
- Object.setPrototypeOf(Buffer2.prototype, GlobalUint8Array.prototype);
27828
- Object.setPrototypeOf(Buffer2, GlobalUint8Array);
27829
- function assertSize(size) {
27830
- if (typeof size !== "number") {
27831
- throw new TypeError('"size" argument must be of type number');
27832
- } else if (size < 0) {
27833
- throw new RangeError('The value "' + size + '" is invalid for option "size"');
27834
- }
27835
- }
27836
- function alloc(size, fill, encoding) {
27837
- assertSize(size);
27838
- if (size <= 0) {
27839
- return createBuffer(size);
27840
- }
27841
- if (fill !== void 0) {
27842
- return typeof encoding === "string" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill);
27843
- }
27844
- return createBuffer(size);
27845
- }
27846
- Buffer2.alloc = function(size, fill, encoding) {
27847
- return alloc(size, fill, encoding);
27848
- };
27849
- function allocUnsafe(size) {
27850
- assertSize(size);
27851
- return createBuffer(size < 0 ? 0 : checked(size) | 0);
27852
- }
27853
- Buffer2.allocUnsafe = function(size) {
27854
- return allocUnsafe(size);
27855
- };
27856
- Buffer2.allocUnsafeSlow = function(size) {
27857
- return allocUnsafe(size);
27858
- };
27859
- function fromString(string, encoding) {
27860
- if (typeof encoding !== "string" || encoding === "") {
27861
- encoding = "utf8";
27862
- }
27863
- if (!Buffer2.isEncoding(encoding)) {
27864
- throw new TypeError("Unknown encoding: " + encoding);
27865
- }
27866
- const length = byteLength2(string, encoding) | 0;
27867
- let buf = createBuffer(length);
27868
- const actual = buf.write(string, encoding);
27869
- if (actual !== length) {
27870
- buf = buf.slice(0, actual);
27871
- }
27872
- return buf;
27873
- }
27874
- function fromArrayLike(array) {
27875
- const length = array.length < 0 ? 0 : checked(array.length) | 0;
27876
- const buf = createBuffer(length);
27877
- for (let i = 0; i < length; i += 1) {
27878
- buf[i] = array[i] & 255;
27879
- }
27880
- return buf;
27881
- }
27882
- function fromArrayView(arrayView) {
27883
- if (isInstance(arrayView, GlobalUint8Array)) {
27884
- const copy = new GlobalUint8Array(arrayView);
27885
- return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength);
27886
- }
27887
- return fromArrayLike(arrayView);
27888
- }
27889
- function fromArrayBuffer(array, byteOffset, length) {
27890
- if (byteOffset < 0 || array.byteLength < byteOffset) {
27891
- throw new RangeError('"offset" is outside of buffer bounds');
27892
- }
27893
- if (array.byteLength < byteOffset + (length || 0)) {
27894
- throw new RangeError('"length" is outside of buffer bounds');
27895
- }
27896
- let buf;
27897
- if (byteOffset === void 0 && length === void 0) {
27898
- buf = new GlobalUint8Array(array);
27899
- } else if (length === void 0) {
27900
- buf = new GlobalUint8Array(array, byteOffset);
27901
- } else {
27902
- buf = new GlobalUint8Array(array, byteOffset, length);
27903
- }
27904
- Object.setPrototypeOf(buf, Buffer2.prototype);
27905
- return buf;
27906
- }
27907
- function fromObject(obj) {
27908
- if (Buffer2.isBuffer(obj)) {
27909
- const len = checked(obj.length) | 0;
27910
- const buf = createBuffer(len);
27911
- if (buf.length === 0) {
27912
- return buf;
27913
- }
27914
- obj.copy(buf, 0, 0, len);
27915
- return buf;
27916
- }
27917
- if (obj.length !== void 0) {
27918
- if (typeof obj.length !== "number" || numberIsNaN(obj.length)) {
27919
- return createBuffer(0);
27920
- }
27921
- return fromArrayLike(obj);
27922
- }
27923
- if (obj.type === "Buffer" && Array.isArray(obj.data)) {
27924
- return fromArrayLike(obj.data);
27925
- }
27926
- }
27927
- function checked(length) {
27928
- if (length >= K_MAX_LENGTH) {
27929
- throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes");
27930
- }
27931
- return length | 0;
27932
- }
27933
- function SlowBuffer2(length) {
27934
- if (+length != length) {
27935
- length = 0;
27936
- }
27937
- return Buffer2.alloc(+length);
27938
- }
27939
- Buffer2.isBuffer = function isBuffer(b) {
27940
- return b != null && b._isBuffer === true && b !== Buffer2.prototype;
27941
- };
27942
- Buffer2.compare = function compare(a, b) {
27943
- if (isInstance(a, GlobalUint8Array)) a = Buffer2.from(a, a.offset, a.byteLength);
27944
- if (isInstance(b, GlobalUint8Array)) b = Buffer2.from(b, b.offset, b.byteLength);
27945
- if (!Buffer2.isBuffer(a) || !Buffer2.isBuffer(b)) {
27946
- throw new TypeError(
27947
- 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
27948
- );
27949
- }
27950
- if (a === b) return 0;
27951
- let x = a.length;
27952
- let y = b.length;
27953
- for (let i = 0, len = Math.min(x, y); i < len; ++i) {
27954
- if (a[i] !== b[i]) {
27955
- x = a[i];
27956
- y = b[i];
27957
- break;
27958
- }
27959
- }
27960
- if (x < y) return -1;
27961
- if (y < x) return 1;
27962
- return 0;
27963
- };
27964
- Buffer2.isEncoding = function isEncoding(encoding) {
27965
- switch (String(encoding).toLowerCase()) {
27966
- case "hex":
27967
- case "utf8":
27968
- case "utf-8":
27969
- case "ascii":
27970
- case "latin1":
27971
- case "binary":
27972
- case "base64":
27973
- case "ucs2":
27974
- case "ucs-2":
27975
- case "utf16le":
27976
- case "utf-16le":
27977
- return true;
27978
- default:
27979
- return false;
27980
- }
27981
- };
27982
- Buffer2.concat = function concat(list, length) {
27983
- if (!Array.isArray(list)) {
27984
- throw new TypeError('"list" argument must be an Array of Buffers');
27985
- }
27986
- if (list.length === 0) {
27987
- return Buffer2.alloc(0);
27988
- }
27989
- let i;
27990
- if (length === void 0) {
27991
- length = 0;
27992
- for (i = 0; i < list.length; ++i) {
27993
- length += list[i].length;
27994
- }
27995
- }
27996
- const buffer2 = Buffer2.allocUnsafe(length);
27997
- let pos = 0;
27998
- for (i = 0; i < list.length; ++i) {
27999
- let buf = list[i];
28000
- if (isInstance(buf, GlobalUint8Array)) {
28001
- if (pos + buf.length > buffer2.length) {
28002
- if (!Buffer2.isBuffer(buf)) buf = Buffer2.from(buf);
28003
- buf.copy(buffer2, pos);
28004
- } else {
28005
- GlobalUint8Array.prototype.set.call(
28006
- buffer2,
28007
- buf,
28008
- pos
28009
- );
28010
- }
28011
- } else if (!Buffer2.isBuffer(buf)) {
28012
- throw new TypeError('"list" argument must be an Array of Buffers');
28013
- } else {
28014
- buf.copy(buffer2, pos);
28015
- }
28016
- pos += buf.length;
28017
- }
28018
- return buffer2;
28019
- };
28020
- function byteLength2(string, encoding) {
28021
- if (Buffer2.isBuffer(string)) {
28022
- return string.length;
28023
- }
28024
- if (GlobalArrayBuffer.isView(string) || isInstance(string, GlobalArrayBuffer)) {
28025
- return string.byteLength;
28026
- }
28027
- if (typeof string !== "string") {
28028
- throw new TypeError(
28029
- 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof string
28030
- );
28031
- }
28032
- const len = string.length;
28033
- const mustMatch = arguments.length > 2 && arguments[2] === true;
28034
- if (!mustMatch && len === 0) return 0;
28035
- let loweredCase = false;
28036
- for (; ; ) {
28037
- switch (encoding) {
28038
- case "ascii":
28039
- case "latin1":
28040
- case "binary":
28041
- return len;
28042
- case "utf8":
28043
- case "utf-8":
28044
- return utf8ToBytes(string).length;
28045
- case "ucs2":
28046
- case "ucs-2":
28047
- case "utf16le":
28048
- case "utf-16le":
28049
- return len * 2;
28050
- case "hex":
28051
- return len >>> 1;
28052
- case "base64":
28053
- return base64ToBytes(string).length;
28054
- default:
28055
- if (loweredCase) {
28056
- return mustMatch ? -1 : utf8ToBytes(string).length;
28057
- }
28058
- encoding = ("" + encoding).toLowerCase();
28059
- loweredCase = true;
28060
- }
28061
- }
28062
- }
28063
- Buffer2.byteLength = byteLength2;
28064
- function slowToString(encoding, start, end) {
28065
- let loweredCase = false;
28066
- if (start === void 0 || start < 0) {
28067
- start = 0;
28068
- }
28069
- if (start > this.length) {
28070
- return "";
28071
- }
28072
- if (end === void 0 || end > this.length) {
28073
- end = this.length;
28074
- }
28075
- if (end <= 0) {
28076
- return "";
28077
- }
28078
- end >>>= 0;
28079
- start >>>= 0;
28080
- if (end <= start) {
28081
- return "";
28082
- }
28083
- if (!encoding) encoding = "utf8";
28084
- while (true) {
28085
- switch (encoding) {
28086
- case "hex":
28087
- return hexSlice(this, start, end);
28088
- case "utf8":
28089
- case "utf-8":
28090
- return utf8Slice(this, start, end);
28091
- case "ascii":
28092
- return asciiSlice(this, start, end);
28093
- case "latin1":
28094
- case "binary":
28095
- return latin1Slice(this, start, end);
28096
- case "base64":
28097
- return base64Slice(this, start, end);
28098
- case "ucs2":
28099
- case "ucs-2":
28100
- case "utf16le":
28101
- case "utf-16le":
28102
- return utf16leSlice(this, start, end);
28103
- default:
28104
- if (loweredCase) throw new TypeError("Unknown encoding: " + encoding);
28105
- encoding = (encoding + "").toLowerCase();
28106
- loweredCase = true;
28107
- }
28108
- }
28109
- }
28110
- Buffer2.prototype._isBuffer = true;
28111
- function swap(b, n, m) {
28112
- const i = b[n];
28113
- b[n] = b[m];
28114
- b[m] = i;
28115
- }
28116
- Buffer2.prototype.swap16 = function swap16() {
28117
- const len = this.length;
28118
- if (len % 2 !== 0) {
28119
- throw new RangeError("Buffer size must be a multiple of 16-bits");
28120
- }
28121
- for (let i = 0; i < len; i += 2) {
28122
- swap(this, i, i + 1);
28123
- }
28124
- return this;
28125
- };
28126
- Buffer2.prototype.swap32 = function swap32() {
28127
- const len = this.length;
28128
- if (len % 4 !== 0) {
28129
- throw new RangeError("Buffer size must be a multiple of 32-bits");
28130
- }
28131
- for (let i = 0; i < len; i += 4) {
28132
- swap(this, i, i + 3);
28133
- swap(this, i + 1, i + 2);
28134
- }
28135
- return this;
28136
- };
28137
- Buffer2.prototype.swap64 = function swap64() {
28138
- const len = this.length;
28139
- if (len % 8 !== 0) {
28140
- throw new RangeError("Buffer size must be a multiple of 64-bits");
28141
- }
28142
- for (let i = 0; i < len; i += 8) {
28143
- swap(this, i, i + 7);
28144
- swap(this, i + 1, i + 6);
28145
- swap(this, i + 2, i + 5);
28146
- swap(this, i + 3, i + 4);
28147
- }
28148
- return this;
28149
- };
28150
- Buffer2.prototype.toString = function toString() {
28151
- const length = this.length;
28152
- if (length === 0) return "";
28153
- if (arguments.length === 0) return utf8Slice(this, 0, length);
28154
- return slowToString.apply(this, arguments);
28155
- };
28156
- Buffer2.prototype.toLocaleString = Buffer2.prototype.toString;
28157
- Buffer2.prototype.equals = function equals(b) {
28158
- if (!Buffer2.isBuffer(b)) throw new TypeError("Argument must be a Buffer");
28159
- if (this === b) return true;
28160
- return Buffer2.compare(this, b) === 0;
28161
- };
28162
- Buffer2.prototype.inspect = function inspect() {
28163
- let str = "";
28164
- const max = exports.INSPECT_MAX_BYTES;
28165
- str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim();
28166
- if (this.length > max) str += " ... ";
28167
- return "<Buffer " + str + ">";
28168
- };
28169
- if (customInspectSymbol) {
28170
- Buffer2.prototype[customInspectSymbol] = Buffer2.prototype.inspect;
28171
- }
28172
- Buffer2.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {
28173
- if (isInstance(target, GlobalUint8Array)) {
28174
- target = Buffer2.from(target, target.offset, target.byteLength);
28175
- }
28176
- if (!Buffer2.isBuffer(target)) {
28177
- throw new TypeError(
28178
- 'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof target
28179
- );
28180
- }
28181
- if (start === void 0) {
28182
- start = 0;
28183
- }
28184
- if (end === void 0) {
28185
- end = target ? target.length : 0;
28186
- }
28187
- if (thisStart === void 0) {
28188
- thisStart = 0;
28189
- }
28190
- if (thisEnd === void 0) {
28191
- thisEnd = this.length;
28192
- }
28193
- if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
28194
- throw new RangeError("out of range index");
28195
- }
28196
- if (thisStart >= thisEnd && start >= end) {
28197
- return 0;
28198
- }
28199
- if (thisStart >= thisEnd) {
28200
- return -1;
28201
- }
28202
- if (start >= end) {
28203
- return 1;
28204
- }
28205
- start >>>= 0;
28206
- end >>>= 0;
28207
- thisStart >>>= 0;
28208
- thisEnd >>>= 0;
28209
- if (this === target) return 0;
28210
- let x = thisEnd - thisStart;
28211
- let y = end - start;
28212
- const len = Math.min(x, y);
28213
- const thisCopy = this.slice(thisStart, thisEnd);
28214
- const targetCopy = target.slice(start, end);
28215
- for (let i = 0; i < len; ++i) {
28216
- if (thisCopy[i] !== targetCopy[i]) {
28217
- x = thisCopy[i];
28218
- y = targetCopy[i];
28219
- break;
28220
- }
28221
- }
28222
- if (x < y) return -1;
28223
- if (y < x) return 1;
28224
- return 0;
28225
- };
28226
- function bidirectionalIndexOf(buffer2, val, byteOffset, encoding, dir) {
28227
- if (buffer2.length === 0) return -1;
28228
- if (typeof byteOffset === "string") {
28229
- encoding = byteOffset;
28230
- byteOffset = 0;
28231
- } else if (byteOffset > 2147483647) {
28232
- byteOffset = 2147483647;
28233
- } else if (byteOffset < -2147483648) {
28234
- byteOffset = -2147483648;
28235
- }
28236
- byteOffset = +byteOffset;
28237
- if (numberIsNaN(byteOffset)) {
28238
- byteOffset = dir ? 0 : buffer2.length - 1;
28239
- }
28240
- if (byteOffset < 0) byteOffset = buffer2.length + byteOffset;
28241
- if (byteOffset >= buffer2.length) {
28242
- if (dir) return -1;
28243
- else byteOffset = buffer2.length - 1;
28244
- } else if (byteOffset < 0) {
28245
- if (dir) byteOffset = 0;
28246
- else return -1;
28247
- }
28248
- if (typeof val === "string") {
28249
- val = Buffer2.from(val, encoding);
28250
- }
28251
- if (Buffer2.isBuffer(val)) {
28252
- if (val.length === 0) {
28253
- return -1;
28254
- }
28255
- return arrayIndexOf(buffer2, val, byteOffset, encoding, dir);
28256
- } else if (typeof val === "number") {
28257
- val = val & 255;
28258
- if (typeof GlobalUint8Array.prototype.indexOf === "function") {
28259
- if (dir) {
28260
- return GlobalUint8Array.prototype.indexOf.call(buffer2, val, byteOffset);
28261
- } else {
28262
- return GlobalUint8Array.prototype.lastIndexOf.call(buffer2, val, byteOffset);
28263
- }
28264
- }
28265
- return arrayIndexOf(buffer2, [val], byteOffset, encoding, dir);
28266
- }
28267
- throw new TypeError("val must be string, number or Buffer");
28268
- }
28269
- function arrayIndexOf(arr, val, byteOffset, encoding, dir) {
28270
- let indexSize = 1;
28271
- let arrLength = arr.length;
28272
- let valLength = val.length;
28273
- if (encoding !== void 0) {
28274
- encoding = String(encoding).toLowerCase();
28275
- if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") {
28276
- if (arr.length < 2 || val.length < 2) {
28277
- return -1;
28278
- }
28279
- indexSize = 2;
28280
- arrLength /= 2;
28281
- valLength /= 2;
28282
- byteOffset /= 2;
28283
- }
28284
- }
28285
- function read(buf, i2) {
28286
- if (indexSize === 1) {
28287
- return buf[i2];
28288
- } else {
28289
- return buf.readUInt16BE(i2 * indexSize);
28290
- }
28291
- }
28292
- let i;
28293
- if (dir) {
28294
- let foundIndex = -1;
28295
- for (i = byteOffset; i < arrLength; i++) {
28296
- if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
28297
- if (foundIndex === -1) foundIndex = i;
28298
- if (i - foundIndex + 1 === valLength) return foundIndex * indexSize;
28299
- } else {
28300
- if (foundIndex !== -1) i -= i - foundIndex;
28301
- foundIndex = -1;
28302
- }
28303
- }
28304
- } else {
28305
- if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;
28306
- for (i = byteOffset; i >= 0; i--) {
28307
- let found = true;
28308
- for (let j = 0; j < valLength; j++) {
28309
- if (read(arr, i + j) !== read(val, j)) {
28310
- found = false;
28311
- break;
28312
- }
28313
- }
28314
- if (found) return i;
28315
- }
28316
- }
28317
- return -1;
28318
- }
28319
- Buffer2.prototype.includes = function includes(val, byteOffset, encoding) {
28320
- return this.indexOf(val, byteOffset, encoding) !== -1;
28321
- };
28322
- Buffer2.prototype.indexOf = function indexOf(val, byteOffset, encoding) {
28323
- return bidirectionalIndexOf(this, val, byteOffset, encoding, true);
28324
- };
28325
- Buffer2.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
28326
- return bidirectionalIndexOf(this, val, byteOffset, encoding, false);
28327
- };
28328
- function hexWrite(buf, string, offset, length) {
28329
- offset = Number(offset) || 0;
28330
- const remaining = buf.length - offset;
28331
- if (!length) {
28332
- length = remaining;
28333
- } else {
28334
- length = Number(length);
28335
- if (length > remaining) {
28336
- length = remaining;
28337
- }
28338
- }
28339
- const strLen = string.length;
28340
- if (length > strLen / 2) {
28341
- length = strLen / 2;
28342
- }
28343
- let i;
28344
- for (i = 0; i < length; ++i) {
28345
- const parsed = parseInt(string.substr(i * 2, 2), 16);
28346
- if (numberIsNaN(parsed)) return i;
28347
- buf[offset + i] = parsed;
28348
- }
28349
- return i;
28350
- }
28351
- function utf8Write(buf, string, offset, length) {
28352
- return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);
28353
- }
28354
- function asciiWrite(buf, string, offset, length) {
28355
- return blitBuffer(asciiToBytes(string), buf, offset, length);
28356
- }
28357
- function base64Write(buf, string, offset, length) {
28358
- return blitBuffer(base64ToBytes(string), buf, offset, length);
28359
- }
28360
- function ucs2Write(buf, string, offset, length) {
28361
- return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);
28362
- }
28363
- Buffer2.prototype.write = function write(string, offset, length, encoding) {
28364
- if (offset === void 0) {
28365
- encoding = "utf8";
28366
- length = this.length;
28367
- offset = 0;
28368
- } else if (length === void 0 && typeof offset === "string") {
28369
- encoding = offset;
28370
- length = this.length;
28371
- offset = 0;
28372
- } else if (isFinite(offset)) {
28373
- offset = offset >>> 0;
28374
- if (isFinite(length)) {
28375
- length = length >>> 0;
28376
- if (encoding === void 0) encoding = "utf8";
28377
- } else {
28378
- encoding = length;
28379
- length = void 0;
28380
- }
28381
- } else {
28382
- throw new Error(
28383
- "Buffer.write(string, encoding, offset[, length]) is no longer supported"
28384
- );
28385
- }
28386
- const remaining = this.length - offset;
28387
- if (length === void 0 || length > remaining) length = remaining;
28388
- if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) {
28389
- throw new RangeError("Attempt to write outside buffer bounds");
28390
- }
28391
- if (!encoding) encoding = "utf8";
28392
- let loweredCase = false;
28393
- for (; ; ) {
28394
- switch (encoding) {
28395
- case "hex":
28396
- return hexWrite(this, string, offset, length);
28397
- case "utf8":
28398
- case "utf-8":
28399
- return utf8Write(this, string, offset, length);
28400
- case "ascii":
28401
- case "latin1":
28402
- case "binary":
28403
- return asciiWrite(this, string, offset, length);
28404
- case "base64":
28405
- return base64Write(this, string, offset, length);
28406
- case "ucs2":
28407
- case "ucs-2":
28408
- case "utf16le":
28409
- case "utf-16le":
28410
- return ucs2Write(this, string, offset, length);
28411
- default:
28412
- if (loweredCase) throw new TypeError("Unknown encoding: " + encoding);
28413
- encoding = ("" + encoding).toLowerCase();
28414
- loweredCase = true;
28415
- }
28416
- }
28417
- };
28418
- Buffer2.prototype.toJSON = function toJSON() {
28419
- return {
28420
- type: "Buffer",
28421
- data: Array.prototype.slice.call(this._arr || this, 0)
28422
- };
28423
- };
28424
- function base64Slice(buf, start, end) {
28425
- if (start === 0 && end === buf.length) {
28426
- return base64.fromByteArray(buf);
28427
- } else {
28428
- return base64.fromByteArray(buf.slice(start, end));
28429
- }
28430
- }
28431
- function utf8Slice(buf, start, end) {
28432
- end = Math.min(buf.length, end);
28433
- const res = [];
28434
- let i = start;
28435
- while (i < end) {
28436
- const firstByte = buf[i];
28437
- let codePoint = null;
28438
- let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1;
28439
- if (i + bytesPerSequence <= end) {
28440
- let secondByte, thirdByte, fourthByte, tempCodePoint;
28441
- switch (bytesPerSequence) {
28442
- case 1:
28443
- if (firstByte < 128) {
28444
- codePoint = firstByte;
28445
- }
28446
- break;
28447
- case 2:
28448
- secondByte = buf[i + 1];
28449
- if ((secondByte & 192) === 128) {
28450
- tempCodePoint = (firstByte & 31) << 6 | secondByte & 63;
28451
- if (tempCodePoint > 127) {
28452
- codePoint = tempCodePoint;
28453
- }
28454
- }
28455
- break;
28456
- case 3:
28457
- secondByte = buf[i + 1];
28458
- thirdByte = buf[i + 2];
28459
- if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) {
28460
- tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63;
28461
- if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) {
28462
- codePoint = tempCodePoint;
28463
- }
28464
- }
28465
- break;
28466
- case 4:
28467
- secondByte = buf[i + 1];
28468
- thirdByte = buf[i + 2];
28469
- fourthByte = buf[i + 3];
28470
- if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) {
28471
- tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63;
28472
- if (tempCodePoint > 65535 && tempCodePoint < 1114112) {
28473
- codePoint = tempCodePoint;
28474
- }
28475
- }
28476
- }
28477
- }
28478
- if (codePoint === null) {
28479
- codePoint = 65533;
28480
- bytesPerSequence = 1;
28481
- } else if (codePoint > 65535) {
28482
- codePoint -= 65536;
28483
- res.push(codePoint >>> 10 & 1023 | 55296);
28484
- codePoint = 56320 | codePoint & 1023;
28485
- }
28486
- res.push(codePoint);
28487
- i += bytesPerSequence;
28488
- }
28489
- return decodeCodePointsArray(res);
28490
- }
28491
- const MAX_ARGUMENTS_LENGTH = 4096;
28492
- function decodeCodePointsArray(codePoints) {
28493
- const len = codePoints.length;
28494
- if (len <= MAX_ARGUMENTS_LENGTH) {
28495
- return String.fromCharCode.apply(String, codePoints);
28496
- }
28497
- let res = "";
28498
- let i = 0;
28499
- while (i < len) {
28500
- res += String.fromCharCode.apply(
28501
- String,
28502
- codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
28503
- );
28504
- }
28505
- return res;
28506
- }
28507
- function asciiSlice(buf, start, end) {
28508
- let ret = "";
28509
- end = Math.min(buf.length, end);
28510
- for (let i = start; i < end; ++i) {
28511
- ret += String.fromCharCode(buf[i] & 127);
28512
- }
28513
- return ret;
28514
- }
28515
- function latin1Slice(buf, start, end) {
28516
- let ret = "";
28517
- end = Math.min(buf.length, end);
28518
- for (let i = start; i < end; ++i) {
28519
- ret += String.fromCharCode(buf[i]);
28520
- }
28521
- return ret;
28522
- }
28523
- function hexSlice(buf, start, end) {
28524
- const len = buf.length;
28525
- if (!start || start < 0) start = 0;
28526
- if (!end || end < 0 || end > len) end = len;
28527
- let out = "";
28528
- for (let i = start; i < end; ++i) {
28529
- out += hexSliceLookupTable[buf[i]];
28530
- }
28531
- return out;
28532
- }
28533
- function utf16leSlice(buf, start, end) {
28534
- const bytes = buf.slice(start, end);
28535
- let res = "";
28536
- for (let i = 0; i < bytes.length - 1; i += 2) {
28537
- res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);
28538
- }
28539
- return res;
28540
- }
28541
- Buffer2.prototype.slice = function slice(start, end) {
28542
- const len = this.length;
28543
- start = ~~start;
28544
- end = end === void 0 ? len : ~~end;
28545
- if (start < 0) {
28546
- start += len;
28547
- if (start < 0) start = 0;
28548
- } else if (start > len) {
28549
- start = len;
28550
- }
28551
- if (end < 0) {
28552
- end += len;
28553
- if (end < 0) end = 0;
28554
- } else if (end > len) {
28555
- end = len;
28556
- }
28557
- if (end < start) end = start;
28558
- const newBuf = this.subarray(start, end);
28559
- Object.setPrototypeOf(newBuf, Buffer2.prototype);
28560
- return newBuf;
28561
- };
28562
- function checkOffset(offset, ext, length) {
28563
- if (offset % 1 !== 0 || offset < 0) throw new RangeError("offset is not uint");
28564
- if (offset + ext > length) throw new RangeError("Trying to access beyond buffer length");
28565
- }
28566
- Buffer2.prototype.readUintLE = Buffer2.prototype.readUIntLE = function readUIntLE(offset, byteLength3, noAssert) {
28567
- offset = offset >>> 0;
28568
- byteLength3 = byteLength3 >>> 0;
28569
- if (!noAssert) checkOffset(offset, byteLength3, this.length);
28570
- let val = this[offset];
28571
- let mul = 1;
28572
- let i = 0;
28573
- while (++i < byteLength3 && (mul *= 256)) {
28574
- val += this[offset + i] * mul;
28575
- }
28576
- return val;
28577
- };
28578
- Buffer2.prototype.readUintBE = Buffer2.prototype.readUIntBE = function readUIntBE(offset, byteLength3, noAssert) {
28579
- offset = offset >>> 0;
28580
- byteLength3 = byteLength3 >>> 0;
28581
- if (!noAssert) {
28582
- checkOffset(offset, byteLength3, this.length);
28583
- }
28584
- let val = this[offset + --byteLength3];
28585
- let mul = 1;
28586
- while (byteLength3 > 0 && (mul *= 256)) {
28587
- val += this[offset + --byteLength3] * mul;
28588
- }
28589
- return val;
28590
- };
28591
- Buffer2.prototype.readUint8 = Buffer2.prototype.readUInt8 = function readUInt8(offset, noAssert) {
28592
- offset = offset >>> 0;
28593
- if (!noAssert) checkOffset(offset, 1, this.length);
28594
- return this[offset];
28595
- };
28596
- Buffer2.prototype.readUint16LE = Buffer2.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {
28597
- offset = offset >>> 0;
28598
- if (!noAssert) checkOffset(offset, 2, this.length);
28599
- return this[offset] | this[offset + 1] << 8;
28600
- };
28601
- Buffer2.prototype.readUint16BE = Buffer2.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {
28602
- offset = offset >>> 0;
28603
- if (!noAssert) checkOffset(offset, 2, this.length);
28604
- return this[offset] << 8 | this[offset + 1];
28605
- };
28606
- Buffer2.prototype.readUint32LE = Buffer2.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {
28607
- offset = offset >>> 0;
28608
- if (!noAssert) checkOffset(offset, 4, this.length);
28609
- return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216;
28610
- };
28611
- Buffer2.prototype.readUint32BE = Buffer2.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {
28612
- offset = offset >>> 0;
28613
- if (!noAssert) checkOffset(offset, 4, this.length);
28614
- return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);
28615
- };
28616
- Buffer2.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset) {
28617
- offset = offset >>> 0;
28618
- validateNumber(offset, "offset");
28619
- const first = this[offset];
28620
- const last = this[offset + 7];
28621
- if (first === void 0 || last === void 0) {
28622
- boundsError(offset, this.length - 8);
28623
- }
28624
- const lo = first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24;
28625
- const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last * 2 ** 24;
28626
- return BigInt(lo) + (BigInt(hi) << BigInt(32));
28627
- });
28628
- Buffer2.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset) {
28629
- offset = offset >>> 0;
28630
- validateNumber(offset, "offset");
28631
- const first = this[offset];
28632
- const last = this[offset + 7];
28633
- if (first === void 0 || last === void 0) {
28634
- boundsError(offset, this.length - 8);
28635
- }
28636
- const hi = first * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];
28637
- const lo = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last;
28638
- return (BigInt(hi) << BigInt(32)) + BigInt(lo);
28639
- });
28640
- Buffer2.prototype.readIntLE = function readIntLE(offset, byteLength3, noAssert) {
28641
- offset = offset >>> 0;
28642
- byteLength3 = byteLength3 >>> 0;
28643
- if (!noAssert) checkOffset(offset, byteLength3, this.length);
28644
- let val = this[offset];
28645
- let mul = 1;
28646
- let i = 0;
28647
- while (++i < byteLength3 && (mul *= 256)) {
28648
- val += this[offset + i] * mul;
28649
- }
28650
- mul *= 128;
28651
- if (val >= mul) val -= Math.pow(2, 8 * byteLength3);
28652
- return val;
28653
- };
28654
- Buffer2.prototype.readIntBE = function readIntBE(offset, byteLength3, noAssert) {
28655
- offset = offset >>> 0;
28656
- byteLength3 = byteLength3 >>> 0;
28657
- if (!noAssert) checkOffset(offset, byteLength3, this.length);
28658
- let i = byteLength3;
28659
- let mul = 1;
28660
- let val = this[offset + --i];
28661
- while (i > 0 && (mul *= 256)) {
28662
- val += this[offset + --i] * mul;
28663
- }
28664
- mul *= 128;
28665
- if (val >= mul) val -= Math.pow(2, 8 * byteLength3);
28666
- return val;
28667
- };
28668
- Buffer2.prototype.readInt8 = function readInt8(offset, noAssert) {
28669
- offset = offset >>> 0;
28670
- if (!noAssert) checkOffset(offset, 1, this.length);
28671
- if (!(this[offset] & 128)) return this[offset];
28672
- return (255 - this[offset] + 1) * -1;
28673
- };
28674
- Buffer2.prototype.readInt16LE = function readInt16LE(offset, noAssert) {
28675
- offset = offset >>> 0;
28676
- if (!noAssert) checkOffset(offset, 2, this.length);
28677
- const val = this[offset] | this[offset + 1] << 8;
28678
- return val & 32768 ? val | 4294901760 : val;
28679
- };
28680
- Buffer2.prototype.readInt16BE = function readInt16BE(offset, noAssert) {
28681
- offset = offset >>> 0;
28682
- if (!noAssert) checkOffset(offset, 2, this.length);
28683
- const val = this[offset + 1] | this[offset] << 8;
28684
- return val & 32768 ? val | 4294901760 : val;
28685
- };
28686
- Buffer2.prototype.readInt32LE = function readInt32LE(offset, noAssert) {
28687
- offset = offset >>> 0;
28688
- if (!noAssert) checkOffset(offset, 4, this.length);
28689
- return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;
28690
- };
28691
- Buffer2.prototype.readInt32BE = function readInt32BE(offset, noAssert) {
28692
- offset = offset >>> 0;
28693
- if (!noAssert) checkOffset(offset, 4, this.length);
28694
- return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];
28695
- };
28696
- Buffer2.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset) {
28697
- offset = offset >>> 0;
28698
- validateNumber(offset, "offset");
28699
- const first = this[offset];
28700
- const last = this[offset + 7];
28701
- if (first === void 0 || last === void 0) {
28702
- boundsError(offset, this.length - 8);
28703
- }
28704
- const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last << 24);
28705
- return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24);
28706
- });
28707
- Buffer2.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset) {
28708
- offset = offset >>> 0;
28709
- validateNumber(offset, "offset");
28710
- const first = this[offset];
28711
- const last = this[offset + 7];
28712
- if (first === void 0 || last === void 0) {
28713
- boundsError(offset, this.length - 8);
28714
- }
28715
- const val = (first << 24) + // Overflow
28716
- this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];
28717
- return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last);
28718
- });
28719
- Buffer2.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
28720
- offset = offset >>> 0;
28721
- if (!noAssert) checkOffset(offset, 4, this.length);
28722
- return ieee754$1.read(this, offset, true, 23, 4);
28723
- };
28724
- Buffer2.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
28725
- offset = offset >>> 0;
28726
- if (!noAssert) checkOffset(offset, 4, this.length);
28727
- return ieee754$1.read(this, offset, false, 23, 4);
28728
- };
28729
- Buffer2.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
28730
- offset = offset >>> 0;
28731
- if (!noAssert) checkOffset(offset, 8, this.length);
28732
- return ieee754$1.read(this, offset, true, 52, 8);
28733
- };
28734
- Buffer2.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
28735
- offset = offset >>> 0;
28736
- if (!noAssert) checkOffset(offset, 8, this.length);
28737
- return ieee754$1.read(this, offset, false, 52, 8);
28738
- };
28739
- function checkInt(buf, value, offset, ext, max, min) {
28740
- if (!Buffer2.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance');
28741
- if (value > max || value < min) throw new RangeError('"value" argument is out of bounds');
28742
- if (offset + ext > buf.length) throw new RangeError("Index out of range");
28743
- }
28744
- Buffer2.prototype.writeUintLE = Buffer2.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength3, noAssert) {
28745
- value = +value;
28746
- offset = offset >>> 0;
28747
- byteLength3 = byteLength3 >>> 0;
28748
- if (!noAssert) {
28749
- const maxBytes = Math.pow(2, 8 * byteLength3) - 1;
28750
- checkInt(this, value, offset, byteLength3, maxBytes, 0);
28751
- }
28752
- let mul = 1;
28753
- let i = 0;
28754
- this[offset] = value & 255;
28755
- while (++i < byteLength3 && (mul *= 256)) {
28756
- this[offset + i] = value / mul & 255;
28757
- }
28758
- return offset + byteLength3;
28759
- };
28760
- Buffer2.prototype.writeUintBE = Buffer2.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength3, noAssert) {
28761
- value = +value;
28762
- offset = offset >>> 0;
28763
- byteLength3 = byteLength3 >>> 0;
28764
- if (!noAssert) {
28765
- const maxBytes = Math.pow(2, 8 * byteLength3) - 1;
28766
- checkInt(this, value, offset, byteLength3, maxBytes, 0);
28767
- }
28768
- let i = byteLength3 - 1;
28769
- let mul = 1;
28770
- this[offset + i] = value & 255;
28771
- while (--i >= 0 && (mul *= 256)) {
28772
- this[offset + i] = value / mul & 255;
28773
- }
28774
- return offset + byteLength3;
28775
- };
28776
- Buffer2.prototype.writeUint8 = Buffer2.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {
28777
- value = +value;
28778
- offset = offset >>> 0;
28779
- if (!noAssert) checkInt(this, value, offset, 1, 255, 0);
28780
- this[offset] = value & 255;
28781
- return offset + 1;
28782
- };
28783
- Buffer2.prototype.writeUint16LE = Buffer2.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {
28784
- value = +value;
28785
- offset = offset >>> 0;
28786
- if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);
28787
- this[offset] = value & 255;
28788
- this[offset + 1] = value >>> 8;
28789
- return offset + 2;
28790
- };
28791
- Buffer2.prototype.writeUint16BE = Buffer2.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {
28792
- value = +value;
28793
- offset = offset >>> 0;
28794
- if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);
28795
- this[offset] = value >>> 8;
28796
- this[offset + 1] = value & 255;
28797
- return offset + 2;
28798
- };
28799
- Buffer2.prototype.writeUint32LE = Buffer2.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {
28800
- value = +value;
28801
- offset = offset >>> 0;
28802
- if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);
28803
- this[offset + 3] = value >>> 24;
28804
- this[offset + 2] = value >>> 16;
28805
- this[offset + 1] = value >>> 8;
28806
- this[offset] = value & 255;
28807
- return offset + 4;
28808
- };
28809
- Buffer2.prototype.writeUint32BE = Buffer2.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {
28810
- value = +value;
28811
- offset = offset >>> 0;
28812
- if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);
28813
- this[offset] = value >>> 24;
28814
- this[offset + 1] = value >>> 16;
28815
- this[offset + 2] = value >>> 8;
28816
- this[offset + 3] = value & 255;
28817
- return offset + 4;
28818
- };
28819
- function wrtBigUInt64LE(buf, value, offset, min, max) {
28820
- checkIntBI(value, min, max, buf, offset, 7);
28821
- let lo = Number(value & BigInt(4294967295));
28822
- buf[offset++] = lo;
28823
- lo = lo >> 8;
28824
- buf[offset++] = lo;
28825
- lo = lo >> 8;
28826
- buf[offset++] = lo;
28827
- lo = lo >> 8;
28828
- buf[offset++] = lo;
28829
- let hi = Number(value >> BigInt(32) & BigInt(4294967295));
28830
- buf[offset++] = hi;
28831
- hi = hi >> 8;
28832
- buf[offset++] = hi;
28833
- hi = hi >> 8;
28834
- buf[offset++] = hi;
28835
- hi = hi >> 8;
28836
- buf[offset++] = hi;
28837
- return offset;
28838
- }
28839
- function wrtBigUInt64BE(buf, value, offset, min, max) {
28840
- checkIntBI(value, min, max, buf, offset, 7);
28841
- let lo = Number(value & BigInt(4294967295));
28842
- buf[offset + 7] = lo;
28843
- lo = lo >> 8;
28844
- buf[offset + 6] = lo;
28845
- lo = lo >> 8;
28846
- buf[offset + 5] = lo;
28847
- lo = lo >> 8;
28848
- buf[offset + 4] = lo;
28849
- let hi = Number(value >> BigInt(32) & BigInt(4294967295));
28850
- buf[offset + 3] = hi;
28851
- hi = hi >> 8;
28852
- buf[offset + 2] = hi;
28853
- hi = hi >> 8;
28854
- buf[offset + 1] = hi;
28855
- hi = hi >> 8;
28856
- buf[offset] = hi;
28857
- return offset + 8;
28858
- }
28859
- Buffer2.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value, offset = 0) {
28860
- return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff"));
28861
- });
28862
- Buffer2.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value, offset = 0) {
28863
- return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff"));
28864
- });
28865
- Buffer2.prototype.writeIntLE = function writeIntLE(value, offset, byteLength3, noAssert) {
28866
- value = +value;
28867
- offset = offset >>> 0;
28868
- if (!noAssert) {
28869
- const limit = Math.pow(2, 8 * byteLength3 - 1);
28870
- checkInt(this, value, offset, byteLength3, limit - 1, -limit);
28871
- }
28872
- let i = 0;
28873
- let mul = 1;
28874
- let sub = 0;
28875
- this[offset] = value & 255;
28876
- while (++i < byteLength3 && (mul *= 256)) {
28877
- if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
28878
- sub = 1;
28879
- }
28880
- this[offset + i] = (value / mul >> 0) - sub & 255;
28881
- }
28882
- return offset + byteLength3;
28883
- };
28884
- Buffer2.prototype.writeIntBE = function writeIntBE(value, offset, byteLength3, noAssert) {
28885
- value = +value;
28886
- offset = offset >>> 0;
28887
- if (!noAssert) {
28888
- const limit = Math.pow(2, 8 * byteLength3 - 1);
28889
- checkInt(this, value, offset, byteLength3, limit - 1, -limit);
28890
- }
28891
- let i = byteLength3 - 1;
28892
- let mul = 1;
28893
- let sub = 0;
28894
- this[offset + i] = value & 255;
28895
- while (--i >= 0 && (mul *= 256)) {
28896
- if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
28897
- sub = 1;
28898
- }
28899
- this[offset + i] = (value / mul >> 0) - sub & 255;
28900
- }
28901
- return offset + byteLength3;
28902
- };
28903
- Buffer2.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {
28904
- value = +value;
28905
- offset = offset >>> 0;
28906
- if (!noAssert) checkInt(this, value, offset, 1, 127, -128);
28907
- if (value < 0) value = 255 + value + 1;
28908
- this[offset] = value & 255;
28909
- return offset + 1;
28910
- };
28911
- Buffer2.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {
28912
- value = +value;
28913
- offset = offset >>> 0;
28914
- if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);
28915
- this[offset] = value & 255;
28916
- this[offset + 1] = value >>> 8;
28917
- return offset + 2;
28918
- };
28919
- Buffer2.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {
28920
- value = +value;
28921
- offset = offset >>> 0;
28922
- if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);
28923
- this[offset] = value >>> 8;
28924
- this[offset + 1] = value & 255;
28925
- return offset + 2;
28926
- };
28927
- Buffer2.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {
28928
- value = +value;
28929
- offset = offset >>> 0;
28930
- if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);
28931
- this[offset] = value & 255;
28932
- this[offset + 1] = value >>> 8;
28933
- this[offset + 2] = value >>> 16;
28934
- this[offset + 3] = value >>> 24;
28935
- return offset + 4;
28936
- };
28937
- Buffer2.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {
28938
- value = +value;
28939
- offset = offset >>> 0;
28940
- if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);
28941
- if (value < 0) value = 4294967295 + value + 1;
28942
- this[offset] = value >>> 24;
28943
- this[offset + 1] = value >>> 16;
28944
- this[offset + 2] = value >>> 8;
28945
- this[offset + 3] = value & 255;
28946
- return offset + 4;
28947
- };
28948
- Buffer2.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value, offset = 0) {
28949
- return wrtBigUInt64LE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
28950
- });
28951
- Buffer2.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value, offset = 0) {
28952
- return wrtBigUInt64BE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
28953
- });
28954
- function checkIEEE754(buf, value, offset, ext, max, min) {
28955
- if (offset + ext > buf.length) throw new RangeError("Index out of range");
28956
- if (offset < 0) throw new RangeError("Index out of range");
28957
- }
28958
- function writeFloat(buf, value, offset, littleEndian, noAssert) {
28959
- value = +value;
28960
- offset = offset >>> 0;
28961
- if (!noAssert) {
28962
- checkIEEE754(buf, value, offset, 4);
28963
- }
28964
- ieee754$1.write(buf, value, offset, littleEndian, 23, 4);
28965
- return offset + 4;
28966
- }
28967
- Buffer2.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {
28968
- return writeFloat(this, value, offset, true, noAssert);
28969
- };
28970
- Buffer2.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {
28971
- return writeFloat(this, value, offset, false, noAssert);
28972
- };
28973
- function writeDouble(buf, value, offset, littleEndian, noAssert) {
28974
- value = +value;
28975
- offset = offset >>> 0;
28976
- if (!noAssert) {
28977
- checkIEEE754(buf, value, offset, 8);
28978
- }
28979
- ieee754$1.write(buf, value, offset, littleEndian, 52, 8);
28980
- return offset + 8;
28981
- }
28982
- Buffer2.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {
28983
- return writeDouble(this, value, offset, true, noAssert);
28984
- };
28985
- Buffer2.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {
28986
- return writeDouble(this, value, offset, false, noAssert);
28987
- };
28988
- Buffer2.prototype.copy = function copy(target, targetStart, start, end) {
28989
- if (!Buffer2.isBuffer(target)) throw new TypeError("argument should be a Buffer");
28990
- if (!start) start = 0;
28991
- if (!end && end !== 0) end = this.length;
28992
- if (targetStart >= target.length) targetStart = target.length;
28993
- if (!targetStart) targetStart = 0;
28994
- if (end > 0 && end < start) end = start;
28995
- if (end === start) return 0;
28996
- if (target.length === 0 || this.length === 0) return 0;
28997
- if (targetStart < 0) {
28998
- throw new RangeError("targetStart out of bounds");
28999
- }
29000
- if (start < 0 || start >= this.length) throw new RangeError("Index out of range");
29001
- if (end < 0) throw new RangeError("sourceEnd out of bounds");
29002
- if (end > this.length) end = this.length;
29003
- if (target.length - targetStart < end - start) {
29004
- end = target.length - targetStart + start;
29005
- }
29006
- const len = end - start;
29007
- if (this === target && typeof GlobalUint8Array.prototype.copyWithin === "function") {
29008
- this.copyWithin(targetStart, start, end);
29009
- } else {
29010
- GlobalUint8Array.prototype.set.call(
29011
- target,
29012
- this.subarray(start, end),
29013
- targetStart
29014
- );
29015
- }
29016
- return len;
29017
- };
29018
- Buffer2.prototype.fill = function fill(val, start, end, encoding) {
29019
- if (typeof val === "string") {
29020
- if (typeof start === "string") {
29021
- encoding = start;
29022
- start = 0;
29023
- end = this.length;
29024
- } else if (typeof end === "string") {
29025
- encoding = end;
29026
- end = this.length;
29027
- }
29028
- if (encoding !== void 0 && typeof encoding !== "string") {
29029
- throw new TypeError("encoding must be a string");
29030
- }
29031
- if (typeof encoding === "string" && !Buffer2.isEncoding(encoding)) {
29032
- throw new TypeError("Unknown encoding: " + encoding);
29033
- }
29034
- if (val.length === 1) {
29035
- const code2 = val.charCodeAt(0);
29036
- if (encoding === "utf8" && code2 < 128 || encoding === "latin1") {
29037
- val = code2;
29038
- }
29039
- }
29040
- } else if (typeof val === "number") {
29041
- val = val & 255;
29042
- } else if (typeof val === "boolean") {
29043
- val = Number(val);
29044
- }
29045
- if (start < 0 || this.length < start || this.length < end) {
29046
- throw new RangeError("Out of range index");
29047
- }
29048
- if (end <= start) {
29049
- return this;
29050
- }
29051
- start = start >>> 0;
29052
- end = end === void 0 ? this.length : end >>> 0;
29053
- if (!val) val = 0;
29054
- let i;
29055
- if (typeof val === "number") {
29056
- for (i = start; i < end; ++i) {
29057
- this[i] = val;
29058
- }
29059
- } else {
29060
- const bytes = Buffer2.isBuffer(val) ? val : Buffer2.from(val, encoding);
29061
- const len = bytes.length;
29062
- if (len === 0) {
29063
- throw new TypeError('The value "' + val + '" is invalid for argument "value"');
29064
- }
29065
- for (i = 0; i < end - start; ++i) {
29066
- this[i + start] = bytes[i % len];
29067
- }
29068
- }
29069
- return this;
29070
- };
29071
- const errors = {};
29072
- function E(sym, getMessage, Base) {
29073
- errors[sym] = class NodeError extends Base {
29074
- constructor() {
29075
- super();
29076
- Object.defineProperty(this, "message", {
29077
- value: getMessage.apply(this, arguments),
29078
- writable: true,
29079
- configurable: true
29080
- });
29081
- this.name = `${this.name} [${sym}]`;
29082
- this.stack;
29083
- delete this.name;
29084
- }
29085
- get code() {
29086
- return sym;
29087
- }
29088
- set code(value) {
29089
- Object.defineProperty(this, "code", {
29090
- configurable: true,
29091
- enumerable: true,
29092
- value,
29093
- writable: true
29094
- });
29095
- }
29096
- toString() {
29097
- return `${this.name} [${sym}]: ${this.message}`;
29098
- }
29099
- };
29100
- }
29101
- E(
29102
- "ERR_BUFFER_OUT_OF_BOUNDS",
29103
- function(name) {
29104
- if (name) {
29105
- return `${name} is outside of buffer bounds`;
29106
- }
29107
- return "Attempt to access memory outside buffer bounds";
29108
- },
29109
- RangeError
29110
- );
29111
- E(
29112
- "ERR_INVALID_ARG_TYPE",
29113
- function(name, actual) {
29114
- return `The "${name}" argument must be of type number. Received type ${typeof actual}`;
29115
- },
29116
- TypeError
29117
- );
29118
- E(
29119
- "ERR_OUT_OF_RANGE",
29120
- function(str, range, input) {
29121
- let msg = `The value of "${str}" is out of range.`;
29122
- let received = input;
29123
- if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {
29124
- received = addNumericalSeparator(String(input));
29125
- } else if (typeof input === "bigint") {
29126
- received = String(input);
29127
- if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {
29128
- received = addNumericalSeparator(received);
29129
- }
29130
- received += "n";
29131
- }
29132
- msg += ` It must be ${range}. Received ${received}`;
29133
- return msg;
29134
- },
29135
- RangeError
29136
- );
29137
- function addNumericalSeparator(val) {
29138
- let res = "";
29139
- let i = val.length;
29140
- const start = val[0] === "-" ? 1 : 0;
29141
- for (; i >= start + 4; i -= 3) {
29142
- res = `_${val.slice(i - 3, i)}${res}`;
29143
- }
29144
- return `${val.slice(0, i)}${res}`;
29145
- }
29146
- function checkBounds(buf, offset, byteLength3) {
29147
- validateNumber(offset, "offset");
29148
- if (buf[offset] === void 0 || buf[offset + byteLength3] === void 0) {
29149
- boundsError(offset, buf.length - (byteLength3 + 1));
29150
- }
29151
- }
29152
- function checkIntBI(value, min, max, buf, offset, byteLength3) {
29153
- if (value > max || value < min) {
29154
- const n = typeof min === "bigint" ? "n" : "";
29155
- let range;
29156
- {
29157
- if (min === 0 || min === BigInt(0)) {
29158
- range = `>= 0${n} and < 2${n} ** ${(byteLength3 + 1) * 8}${n}`;
29159
- } else {
29160
- range = `>= -(2${n} ** ${(byteLength3 + 1) * 8 - 1}${n}) and < 2 ** ${(byteLength3 + 1) * 8 - 1}${n}`;
29161
- }
29162
- }
29163
- throw new errors.ERR_OUT_OF_RANGE("value", range, value);
29164
- }
29165
- checkBounds(buf, offset, byteLength3);
29166
- }
29167
- function validateNumber(value, name) {
29168
- if (typeof value !== "number") {
29169
- throw new errors.ERR_INVALID_ARG_TYPE(name, "number", value);
29170
- }
29171
- }
29172
- function boundsError(value, length, type) {
29173
- if (Math.floor(value) !== value) {
29174
- validateNumber(value, type);
29175
- throw new errors.ERR_OUT_OF_RANGE("offset", "an integer", value);
29176
- }
29177
- if (length < 0) {
29178
- throw new errors.ERR_BUFFER_OUT_OF_BOUNDS();
29179
- }
29180
- throw new errors.ERR_OUT_OF_RANGE(
29181
- "offset",
29182
- `>= ${0} and <= ${length}`,
29183
- value
29184
- );
29185
- }
29186
- const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g;
29187
- function base64clean(str) {
29188
- str = str.split("=")[0];
29189
- str = str.trim().replace(INVALID_BASE64_RE, "");
29190
- if (str.length < 2) return "";
29191
- while (str.length % 4 !== 0) {
29192
- str = str + "=";
29193
- }
29194
- return str;
29195
- }
29196
- function utf8ToBytes(string, units) {
29197
- units = units || Infinity;
29198
- let codePoint;
29199
- const length = string.length;
29200
- let leadSurrogate = null;
29201
- const bytes = [];
29202
- for (let i = 0; i < length; ++i) {
29203
- codePoint = string.charCodeAt(i);
29204
- if (codePoint > 55295 && codePoint < 57344) {
29205
- if (!leadSurrogate) {
29206
- if (codePoint > 56319) {
29207
- if ((units -= 3) > -1) bytes.push(239, 191, 189);
29208
- continue;
29209
- } else if (i + 1 === length) {
29210
- if ((units -= 3) > -1) bytes.push(239, 191, 189);
29211
- continue;
29212
- }
29213
- leadSurrogate = codePoint;
29214
- continue;
29215
- }
29216
- if (codePoint < 56320) {
29217
- if ((units -= 3) > -1) bytes.push(239, 191, 189);
29218
- leadSurrogate = codePoint;
29219
- continue;
29220
- }
29221
- codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536;
29222
- } else if (leadSurrogate) {
29223
- if ((units -= 3) > -1) bytes.push(239, 191, 189);
29224
- }
29225
- leadSurrogate = null;
29226
- if (codePoint < 128) {
29227
- if ((units -= 1) < 0) break;
29228
- bytes.push(codePoint);
29229
- } else if (codePoint < 2048) {
29230
- if ((units -= 2) < 0) break;
29231
- bytes.push(
29232
- codePoint >> 6 | 192,
29233
- codePoint & 63 | 128
29234
- );
29235
- } else if (codePoint < 65536) {
29236
- if ((units -= 3) < 0) break;
29237
- bytes.push(
29238
- codePoint >> 12 | 224,
29239
- codePoint >> 6 & 63 | 128,
29240
- codePoint & 63 | 128
29241
- );
29242
- } else if (codePoint < 1114112) {
29243
- if ((units -= 4) < 0) break;
29244
- bytes.push(
29245
- codePoint >> 18 | 240,
29246
- codePoint >> 12 & 63 | 128,
29247
- codePoint >> 6 & 63 | 128,
29248
- codePoint & 63 | 128
29249
- );
29250
- } else {
29251
- throw new Error("Invalid code point");
29252
- }
29253
- }
29254
- return bytes;
29255
- }
29256
- function asciiToBytes(str) {
29257
- const byteArray = [];
29258
- for (let i = 0; i < str.length; ++i) {
29259
- byteArray.push(str.charCodeAt(i) & 255);
29260
- }
29261
- return byteArray;
29262
- }
29263
- function utf16leToBytes(str, units) {
29264
- let c, hi, lo;
29265
- const byteArray = [];
29266
- for (let i = 0; i < str.length; ++i) {
29267
- if ((units -= 2) < 0) break;
29268
- c = str.charCodeAt(i);
29269
- hi = c >> 8;
29270
- lo = c % 256;
29271
- byteArray.push(lo);
29272
- byteArray.push(hi);
29273
- }
29274
- return byteArray;
29275
- }
29276
- function base64ToBytes(str) {
29277
- return base64.toByteArray(base64clean(str));
29278
- }
29279
- function blitBuffer(src, dst, offset, length) {
29280
- let i;
29281
- for (i = 0; i < length; ++i) {
29282
- if (i + offset >= dst.length || i >= src.length) break;
29283
- dst[i + offset] = src[i];
29284
- }
29285
- return i;
29286
- }
29287
- function isInstance(obj, type) {
29288
- return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name;
29289
- }
29290
- function numberIsNaN(obj) {
29291
- return obj !== obj;
29292
- }
29293
- const hexSliceLookupTable = function() {
29294
- const alphabet = "0123456789abcdef";
29295
- const table = new Array(256);
29296
- for (let i = 0; i < 16; ++i) {
29297
- const i16 = i * 16;
29298
- for (let j = 0; j < 16; ++j) {
29299
- table[i16 + j] = alphabet[i] + alphabet[j];
29300
- }
29301
- }
29302
- return table;
29303
- }();
29304
- function defineBigIntMethod(fn) {
29305
- return typeof BigInt === "undefined" ? BufferBigIntNotDefined : fn;
29306
- }
29307
- function BufferBigIntNotDefined() {
29308
- throw new Error("BigInt not supported");
29309
- }
29310
- })(buffer$1);
29311
- const Buffer = buffer$1.Buffer;
29312
-
29313
27550
  var handlebars = {exports: {}};
29314
27551
 
29315
27552
  var handlebars_runtime = {exports: {}};
@@ -29821,12 +28058,12 @@ function requireLog () {
29821
28058
  return log$2.exports;
29822
28059
  }
29823
28060
 
29824
- var lookup$2 = {exports: {}};
28061
+ var lookup$3 = {exports: {}};
29825
28062
 
29826
28063
  var hasRequiredLookup;
29827
28064
 
29828
28065
  function requireLookup () {
29829
- if (hasRequiredLookup) return lookup$2.exports;
28066
+ if (hasRequiredLookup) return lookup$3.exports;
29830
28067
  hasRequiredLookup = 1;
29831
28068
  (function (module, exports) {
29832
28069
 
@@ -29844,8 +28081,8 @@ function requireLookup () {
29844
28081
 
29845
28082
  module.exports = exports['default'];
29846
28083
 
29847
- } (lookup$2, lookup$2.exports));
29848
- return lookup$2.exports;
28084
+ } (lookup$3, lookup$3.exports));
28085
+ return lookup$3.exports;
29849
28086
  }
29850
28087
 
29851
28088
  var _with = {exports: {}};
@@ -48260,6 +46497,1773 @@ function requireEcb () {
48260
46497
 
48261
46498
  var cbc = {};
48262
46499
 
46500
+ var buffer$1 = {};
46501
+ var base64Js$1 = {};
46502
+ base64Js$1.byteLength = byteLength$1;
46503
+ base64Js$1.toByteArray = toByteArray;
46504
+ base64Js$1.fromByteArray = fromByteArray;
46505
+ var lookup$2 = [];
46506
+ var revLookup = [];
46507
+ var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
46508
+ var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
46509
+ for (var i$1 = 0, len = code.length; i$1 < len; ++i$1) {
46510
+ lookup$2[i$1] = code[i$1];
46511
+ revLookup[code.charCodeAt(i$1)] = i$1;
46512
+ }
46513
+ revLookup["-".charCodeAt(0)] = 62;
46514
+ revLookup["_".charCodeAt(0)] = 63;
46515
+ function getLens(b64) {
46516
+ var len = b64.length;
46517
+ if (len % 4 > 0) {
46518
+ throw new Error("Invalid string. Length must be a multiple of 4");
46519
+ }
46520
+ var validLen = b64.indexOf("=");
46521
+ if (validLen === -1) validLen = len;
46522
+ var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4;
46523
+ return [validLen, placeHoldersLen];
46524
+ }
46525
+ function byteLength$1(b64) {
46526
+ var lens = getLens(b64);
46527
+ var validLen = lens[0];
46528
+ var placeHoldersLen = lens[1];
46529
+ return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
46530
+ }
46531
+ function _byteLength(b64, validLen, placeHoldersLen) {
46532
+ return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
46533
+ }
46534
+ function toByteArray(b64) {
46535
+ var tmp;
46536
+ var lens = getLens(b64);
46537
+ var validLen = lens[0];
46538
+ var placeHoldersLen = lens[1];
46539
+ var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));
46540
+ var curByte = 0;
46541
+ var len = placeHoldersLen > 0 ? validLen - 4 : validLen;
46542
+ var i;
46543
+ for (i = 0; i < len; i += 4) {
46544
+ tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)];
46545
+ arr[curByte++] = tmp >> 16 & 255;
46546
+ arr[curByte++] = tmp >> 8 & 255;
46547
+ arr[curByte++] = tmp & 255;
46548
+ }
46549
+ if (placeHoldersLen === 2) {
46550
+ tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4;
46551
+ arr[curByte++] = tmp & 255;
46552
+ }
46553
+ if (placeHoldersLen === 1) {
46554
+ tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2;
46555
+ arr[curByte++] = tmp >> 8 & 255;
46556
+ arr[curByte++] = tmp & 255;
46557
+ }
46558
+ return arr;
46559
+ }
46560
+ function tripletToBase64(num) {
46561
+ return lookup$2[num >> 18 & 63] + lookup$2[num >> 12 & 63] + lookup$2[num >> 6 & 63] + lookup$2[num & 63];
46562
+ }
46563
+ function encodeChunk(uint8, start, end) {
46564
+ var tmp;
46565
+ var output = [];
46566
+ for (var i = start; i < end; i += 3) {
46567
+ tmp = (uint8[i] << 16 & 16711680) + (uint8[i + 1] << 8 & 65280) + (uint8[i + 2] & 255);
46568
+ output.push(tripletToBase64(tmp));
46569
+ }
46570
+ return output.join("");
46571
+ }
46572
+ function fromByteArray(uint8) {
46573
+ var tmp;
46574
+ var len = uint8.length;
46575
+ var extraBytes = len % 3;
46576
+ var parts = [];
46577
+ var maxChunkLength = 16383;
46578
+ for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
46579
+ parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));
46580
+ }
46581
+ if (extraBytes === 1) {
46582
+ tmp = uint8[len - 1];
46583
+ parts.push(
46584
+ lookup$2[tmp >> 2] + lookup$2[tmp << 4 & 63] + "=="
46585
+ );
46586
+ } else if (extraBytes === 2) {
46587
+ tmp = (uint8[len - 2] << 8) + uint8[len - 1];
46588
+ parts.push(
46589
+ lookup$2[tmp >> 10] + lookup$2[tmp >> 4 & 63] + lookup$2[tmp << 2 & 63] + "="
46590
+ );
46591
+ }
46592
+ return parts.join("");
46593
+ }
46594
+ var ieee754 = {};
46595
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
46596
+ ieee754.read = function(buffer2, offset, isLE, mLen, nBytes) {
46597
+ var e, m;
46598
+ var eLen = nBytes * 8 - mLen - 1;
46599
+ var eMax = (1 << eLen) - 1;
46600
+ var eBias = eMax >> 1;
46601
+ var nBits = -7;
46602
+ var i = isLE ? nBytes - 1 : 0;
46603
+ var d = isLE ? -1 : 1;
46604
+ var s = buffer2[offset + i];
46605
+ i += d;
46606
+ e = s & (1 << -nBits) - 1;
46607
+ s >>= -nBits;
46608
+ nBits += eLen;
46609
+ for (; nBits > 0; e = e * 256 + buffer2[offset + i], i += d, nBits -= 8) {
46610
+ }
46611
+ m = e & (1 << -nBits) - 1;
46612
+ e >>= -nBits;
46613
+ nBits += mLen;
46614
+ for (; nBits > 0; m = m * 256 + buffer2[offset + i], i += d, nBits -= 8) {
46615
+ }
46616
+ if (e === 0) {
46617
+ e = 1 - eBias;
46618
+ } else if (e === eMax) {
46619
+ return m ? NaN : (s ? -1 : 1) * Infinity;
46620
+ } else {
46621
+ m = m + Math.pow(2, mLen);
46622
+ e = e - eBias;
46623
+ }
46624
+ return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
46625
+ };
46626
+ ieee754.write = function(buffer2, value, offset, isLE, mLen, nBytes) {
46627
+ var e, m, c;
46628
+ var eLen = nBytes * 8 - mLen - 1;
46629
+ var eMax = (1 << eLen) - 1;
46630
+ var eBias = eMax >> 1;
46631
+ var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
46632
+ var i = isLE ? 0 : nBytes - 1;
46633
+ var d = isLE ? 1 : -1;
46634
+ var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
46635
+ value = Math.abs(value);
46636
+ if (isNaN(value) || value === Infinity) {
46637
+ m = isNaN(value) ? 1 : 0;
46638
+ e = eMax;
46639
+ } else {
46640
+ e = Math.floor(Math.log(value) / Math.LN2);
46641
+ if (value * (c = Math.pow(2, -e)) < 1) {
46642
+ e--;
46643
+ c *= 2;
46644
+ }
46645
+ if (e + eBias >= 1) {
46646
+ value += rt / c;
46647
+ } else {
46648
+ value += rt * Math.pow(2, 1 - eBias);
46649
+ }
46650
+ if (value * c >= 2) {
46651
+ e++;
46652
+ c /= 2;
46653
+ }
46654
+ if (e + eBias >= eMax) {
46655
+ m = 0;
46656
+ e = eMax;
46657
+ } else if (e + eBias >= 1) {
46658
+ m = (value * c - 1) * Math.pow(2, mLen);
46659
+ e = e + eBias;
46660
+ } else {
46661
+ m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
46662
+ e = 0;
46663
+ }
46664
+ }
46665
+ for (; mLen >= 8; buffer2[offset + i] = m & 255, i += d, m /= 256, mLen -= 8) {
46666
+ }
46667
+ e = e << mLen | m;
46668
+ eLen += mLen;
46669
+ for (; eLen > 0; buffer2[offset + i] = e & 255, i += d, e /= 256, eLen -= 8) {
46670
+ }
46671
+ buffer2[offset + i - d] |= s * 128;
46672
+ };
46673
+ /*!
46674
+ * The buffer module from node.js, for the browser.
46675
+ *
46676
+ * @author Feross Aboukhadijeh <https://feross.org>
46677
+ * @license MIT
46678
+ */
46679
+ (function(exports) {
46680
+ const base64 = base64Js$1;
46681
+ const ieee754$1 = ieee754;
46682
+ const customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null;
46683
+ exports.Buffer = Buffer2;
46684
+ exports.SlowBuffer = SlowBuffer2;
46685
+ exports.INSPECT_MAX_BYTES = 50;
46686
+ const K_MAX_LENGTH = 2147483647;
46687
+ exports.kMaxLength = K_MAX_LENGTH;
46688
+ const { Uint8Array: GlobalUint8Array, ArrayBuffer: GlobalArrayBuffer, SharedArrayBuffer: GlobalSharedArrayBuffer } = globalThis;
46689
+ Buffer2.TYPED_ARRAY_SUPPORT = typedArraySupport();
46690
+ if (!Buffer2.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && typeof console.error === "function") {
46691
+ console.error(
46692
+ "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
46693
+ );
46694
+ }
46695
+ function typedArraySupport() {
46696
+ try {
46697
+ const arr = new GlobalUint8Array(1);
46698
+ const proto = { foo: function() {
46699
+ return 42;
46700
+ } };
46701
+ Object.setPrototypeOf(proto, GlobalUint8Array.prototype);
46702
+ Object.setPrototypeOf(arr, proto);
46703
+ return arr.foo() === 42;
46704
+ } catch (e) {
46705
+ return false;
46706
+ }
46707
+ }
46708
+ Object.defineProperty(Buffer2.prototype, "parent", {
46709
+ enumerable: true,
46710
+ get: function() {
46711
+ if (!Buffer2.isBuffer(this)) return void 0;
46712
+ return this.buffer;
46713
+ }
46714
+ });
46715
+ Object.defineProperty(Buffer2.prototype, "offset", {
46716
+ enumerable: true,
46717
+ get: function() {
46718
+ if (!Buffer2.isBuffer(this)) return void 0;
46719
+ return this.byteOffset;
46720
+ }
46721
+ });
46722
+ function createBuffer(length) {
46723
+ if (length > K_MAX_LENGTH) {
46724
+ throw new RangeError('The value "' + length + '" is invalid for option "size"');
46725
+ }
46726
+ const buf = new GlobalUint8Array(length);
46727
+ Object.setPrototypeOf(buf, Buffer2.prototype);
46728
+ return buf;
46729
+ }
46730
+ function Buffer2(arg, encodingOrOffset, length) {
46731
+ if (typeof arg === "number") {
46732
+ if (typeof encodingOrOffset === "string") {
46733
+ throw new TypeError(
46734
+ 'The "string" argument must be of type string. Received type number'
46735
+ );
46736
+ }
46737
+ return allocUnsafe(arg);
46738
+ }
46739
+ return from(arg, encodingOrOffset, length);
46740
+ }
46741
+ Buffer2.poolSize = 8192;
46742
+ function from(value, encodingOrOffset, length) {
46743
+ if (typeof value === "string") {
46744
+ return fromString(value, encodingOrOffset);
46745
+ }
46746
+ if (GlobalArrayBuffer.isView(value)) {
46747
+ return fromArrayView(value);
46748
+ }
46749
+ if (value == null) {
46750
+ throw new TypeError(
46751
+ "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value
46752
+ );
46753
+ }
46754
+ if (isInstance(value, GlobalArrayBuffer) || value && isInstance(value.buffer, GlobalArrayBuffer)) {
46755
+ return fromArrayBuffer(value, encodingOrOffset, length);
46756
+ }
46757
+ if (typeof GlobalSharedArrayBuffer !== "undefined" && (isInstance(value, GlobalSharedArrayBuffer) || value && isInstance(value.buffer, GlobalSharedArrayBuffer))) {
46758
+ return fromArrayBuffer(value, encodingOrOffset, length);
46759
+ }
46760
+ if (typeof value === "number") {
46761
+ throw new TypeError(
46762
+ 'The "value" argument must not be of type number. Received type number'
46763
+ );
46764
+ }
46765
+ const valueOf = value.valueOf && value.valueOf();
46766
+ if (valueOf != null && valueOf !== value) {
46767
+ return Buffer2.from(valueOf, encodingOrOffset, length);
46768
+ }
46769
+ const b = fromObject(value);
46770
+ if (b) return b;
46771
+ if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") {
46772
+ return Buffer2.from(value[Symbol.toPrimitive]("string"), encodingOrOffset, length);
46773
+ }
46774
+ throw new TypeError(
46775
+ "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value
46776
+ );
46777
+ }
46778
+ Buffer2.from = function(value, encodingOrOffset, length) {
46779
+ return from(value, encodingOrOffset, length);
46780
+ };
46781
+ Object.setPrototypeOf(Buffer2.prototype, GlobalUint8Array.prototype);
46782
+ Object.setPrototypeOf(Buffer2, GlobalUint8Array);
46783
+ function assertSize(size) {
46784
+ if (typeof size !== "number") {
46785
+ throw new TypeError('"size" argument must be of type number');
46786
+ } else if (size < 0) {
46787
+ throw new RangeError('The value "' + size + '" is invalid for option "size"');
46788
+ }
46789
+ }
46790
+ function alloc(size, fill, encoding) {
46791
+ assertSize(size);
46792
+ if (size <= 0) {
46793
+ return createBuffer(size);
46794
+ }
46795
+ if (fill !== void 0) {
46796
+ return typeof encoding === "string" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill);
46797
+ }
46798
+ return createBuffer(size);
46799
+ }
46800
+ Buffer2.alloc = function(size, fill, encoding) {
46801
+ return alloc(size, fill, encoding);
46802
+ };
46803
+ function allocUnsafe(size) {
46804
+ assertSize(size);
46805
+ return createBuffer(size < 0 ? 0 : checked(size) | 0);
46806
+ }
46807
+ Buffer2.allocUnsafe = function(size) {
46808
+ return allocUnsafe(size);
46809
+ };
46810
+ Buffer2.allocUnsafeSlow = function(size) {
46811
+ return allocUnsafe(size);
46812
+ };
46813
+ function fromString(string, encoding) {
46814
+ if (typeof encoding !== "string" || encoding === "") {
46815
+ encoding = "utf8";
46816
+ }
46817
+ if (!Buffer2.isEncoding(encoding)) {
46818
+ throw new TypeError("Unknown encoding: " + encoding);
46819
+ }
46820
+ const length = byteLength2(string, encoding) | 0;
46821
+ let buf = createBuffer(length);
46822
+ const actual = buf.write(string, encoding);
46823
+ if (actual !== length) {
46824
+ buf = buf.slice(0, actual);
46825
+ }
46826
+ return buf;
46827
+ }
46828
+ function fromArrayLike(array) {
46829
+ const length = array.length < 0 ? 0 : checked(array.length) | 0;
46830
+ const buf = createBuffer(length);
46831
+ for (let i = 0; i < length; i += 1) {
46832
+ buf[i] = array[i] & 255;
46833
+ }
46834
+ return buf;
46835
+ }
46836
+ function fromArrayView(arrayView) {
46837
+ if (isInstance(arrayView, GlobalUint8Array)) {
46838
+ const copy = new GlobalUint8Array(arrayView);
46839
+ return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength);
46840
+ }
46841
+ return fromArrayLike(arrayView);
46842
+ }
46843
+ function fromArrayBuffer(array, byteOffset, length) {
46844
+ if (byteOffset < 0 || array.byteLength < byteOffset) {
46845
+ throw new RangeError('"offset" is outside of buffer bounds');
46846
+ }
46847
+ if (array.byteLength < byteOffset + (length || 0)) {
46848
+ throw new RangeError('"length" is outside of buffer bounds');
46849
+ }
46850
+ let buf;
46851
+ if (byteOffset === void 0 && length === void 0) {
46852
+ buf = new GlobalUint8Array(array);
46853
+ } else if (length === void 0) {
46854
+ buf = new GlobalUint8Array(array, byteOffset);
46855
+ } else {
46856
+ buf = new GlobalUint8Array(array, byteOffset, length);
46857
+ }
46858
+ Object.setPrototypeOf(buf, Buffer2.prototype);
46859
+ return buf;
46860
+ }
46861
+ function fromObject(obj) {
46862
+ if (Buffer2.isBuffer(obj)) {
46863
+ const len = checked(obj.length) | 0;
46864
+ const buf = createBuffer(len);
46865
+ if (buf.length === 0) {
46866
+ return buf;
46867
+ }
46868
+ obj.copy(buf, 0, 0, len);
46869
+ return buf;
46870
+ }
46871
+ if (obj.length !== void 0) {
46872
+ if (typeof obj.length !== "number" || numberIsNaN(obj.length)) {
46873
+ return createBuffer(0);
46874
+ }
46875
+ return fromArrayLike(obj);
46876
+ }
46877
+ if (obj.type === "Buffer" && Array.isArray(obj.data)) {
46878
+ return fromArrayLike(obj.data);
46879
+ }
46880
+ }
46881
+ function checked(length) {
46882
+ if (length >= K_MAX_LENGTH) {
46883
+ throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes");
46884
+ }
46885
+ return length | 0;
46886
+ }
46887
+ function SlowBuffer2(length) {
46888
+ if (+length != length) {
46889
+ length = 0;
46890
+ }
46891
+ return Buffer2.alloc(+length);
46892
+ }
46893
+ Buffer2.isBuffer = function isBuffer(b) {
46894
+ return b != null && b._isBuffer === true && b !== Buffer2.prototype;
46895
+ };
46896
+ Buffer2.compare = function compare(a, b) {
46897
+ if (isInstance(a, GlobalUint8Array)) a = Buffer2.from(a, a.offset, a.byteLength);
46898
+ if (isInstance(b, GlobalUint8Array)) b = Buffer2.from(b, b.offset, b.byteLength);
46899
+ if (!Buffer2.isBuffer(a) || !Buffer2.isBuffer(b)) {
46900
+ throw new TypeError(
46901
+ 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
46902
+ );
46903
+ }
46904
+ if (a === b) return 0;
46905
+ let x = a.length;
46906
+ let y = b.length;
46907
+ for (let i = 0, len = Math.min(x, y); i < len; ++i) {
46908
+ if (a[i] !== b[i]) {
46909
+ x = a[i];
46910
+ y = b[i];
46911
+ break;
46912
+ }
46913
+ }
46914
+ if (x < y) return -1;
46915
+ if (y < x) return 1;
46916
+ return 0;
46917
+ };
46918
+ Buffer2.isEncoding = function isEncoding(encoding) {
46919
+ switch (String(encoding).toLowerCase()) {
46920
+ case "hex":
46921
+ case "utf8":
46922
+ case "utf-8":
46923
+ case "ascii":
46924
+ case "latin1":
46925
+ case "binary":
46926
+ case "base64":
46927
+ case "ucs2":
46928
+ case "ucs-2":
46929
+ case "utf16le":
46930
+ case "utf-16le":
46931
+ return true;
46932
+ default:
46933
+ return false;
46934
+ }
46935
+ };
46936
+ Buffer2.concat = function concat(list, length) {
46937
+ if (!Array.isArray(list)) {
46938
+ throw new TypeError('"list" argument must be an Array of Buffers');
46939
+ }
46940
+ if (list.length === 0) {
46941
+ return Buffer2.alloc(0);
46942
+ }
46943
+ let i;
46944
+ if (length === void 0) {
46945
+ length = 0;
46946
+ for (i = 0; i < list.length; ++i) {
46947
+ length += list[i].length;
46948
+ }
46949
+ }
46950
+ const buffer2 = Buffer2.allocUnsafe(length);
46951
+ let pos = 0;
46952
+ for (i = 0; i < list.length; ++i) {
46953
+ let buf = list[i];
46954
+ if (isInstance(buf, GlobalUint8Array)) {
46955
+ if (pos + buf.length > buffer2.length) {
46956
+ if (!Buffer2.isBuffer(buf)) buf = Buffer2.from(buf);
46957
+ buf.copy(buffer2, pos);
46958
+ } else {
46959
+ GlobalUint8Array.prototype.set.call(
46960
+ buffer2,
46961
+ buf,
46962
+ pos
46963
+ );
46964
+ }
46965
+ } else if (!Buffer2.isBuffer(buf)) {
46966
+ throw new TypeError('"list" argument must be an Array of Buffers');
46967
+ } else {
46968
+ buf.copy(buffer2, pos);
46969
+ }
46970
+ pos += buf.length;
46971
+ }
46972
+ return buffer2;
46973
+ };
46974
+ function byteLength2(string, encoding) {
46975
+ if (Buffer2.isBuffer(string)) {
46976
+ return string.length;
46977
+ }
46978
+ if (GlobalArrayBuffer.isView(string) || isInstance(string, GlobalArrayBuffer)) {
46979
+ return string.byteLength;
46980
+ }
46981
+ if (typeof string !== "string") {
46982
+ throw new TypeError(
46983
+ 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof string
46984
+ );
46985
+ }
46986
+ const len = string.length;
46987
+ const mustMatch = arguments.length > 2 && arguments[2] === true;
46988
+ if (!mustMatch && len === 0) return 0;
46989
+ let loweredCase = false;
46990
+ for (; ; ) {
46991
+ switch (encoding) {
46992
+ case "ascii":
46993
+ case "latin1":
46994
+ case "binary":
46995
+ return len;
46996
+ case "utf8":
46997
+ case "utf-8":
46998
+ return utf8ToBytes(string).length;
46999
+ case "ucs2":
47000
+ case "ucs-2":
47001
+ case "utf16le":
47002
+ case "utf-16le":
47003
+ return len * 2;
47004
+ case "hex":
47005
+ return len >>> 1;
47006
+ case "base64":
47007
+ return base64ToBytes(string).length;
47008
+ default:
47009
+ if (loweredCase) {
47010
+ return mustMatch ? -1 : utf8ToBytes(string).length;
47011
+ }
47012
+ encoding = ("" + encoding).toLowerCase();
47013
+ loweredCase = true;
47014
+ }
47015
+ }
47016
+ }
47017
+ Buffer2.byteLength = byteLength2;
47018
+ function slowToString(encoding, start, end) {
47019
+ let loweredCase = false;
47020
+ if (start === void 0 || start < 0) {
47021
+ start = 0;
47022
+ }
47023
+ if (start > this.length) {
47024
+ return "";
47025
+ }
47026
+ if (end === void 0 || end > this.length) {
47027
+ end = this.length;
47028
+ }
47029
+ if (end <= 0) {
47030
+ return "";
47031
+ }
47032
+ end >>>= 0;
47033
+ start >>>= 0;
47034
+ if (end <= start) {
47035
+ return "";
47036
+ }
47037
+ if (!encoding) encoding = "utf8";
47038
+ while (true) {
47039
+ switch (encoding) {
47040
+ case "hex":
47041
+ return hexSlice(this, start, end);
47042
+ case "utf8":
47043
+ case "utf-8":
47044
+ return utf8Slice(this, start, end);
47045
+ case "ascii":
47046
+ return asciiSlice(this, start, end);
47047
+ case "latin1":
47048
+ case "binary":
47049
+ return latin1Slice(this, start, end);
47050
+ case "base64":
47051
+ return base64Slice(this, start, end);
47052
+ case "ucs2":
47053
+ case "ucs-2":
47054
+ case "utf16le":
47055
+ case "utf-16le":
47056
+ return utf16leSlice(this, start, end);
47057
+ default:
47058
+ if (loweredCase) throw new TypeError("Unknown encoding: " + encoding);
47059
+ encoding = (encoding + "").toLowerCase();
47060
+ loweredCase = true;
47061
+ }
47062
+ }
47063
+ }
47064
+ Buffer2.prototype._isBuffer = true;
47065
+ function swap(b, n, m) {
47066
+ const i = b[n];
47067
+ b[n] = b[m];
47068
+ b[m] = i;
47069
+ }
47070
+ Buffer2.prototype.swap16 = function swap16() {
47071
+ const len = this.length;
47072
+ if (len % 2 !== 0) {
47073
+ throw new RangeError("Buffer size must be a multiple of 16-bits");
47074
+ }
47075
+ for (let i = 0; i < len; i += 2) {
47076
+ swap(this, i, i + 1);
47077
+ }
47078
+ return this;
47079
+ };
47080
+ Buffer2.prototype.swap32 = function swap32() {
47081
+ const len = this.length;
47082
+ if (len % 4 !== 0) {
47083
+ throw new RangeError("Buffer size must be a multiple of 32-bits");
47084
+ }
47085
+ for (let i = 0; i < len; i += 4) {
47086
+ swap(this, i, i + 3);
47087
+ swap(this, i + 1, i + 2);
47088
+ }
47089
+ return this;
47090
+ };
47091
+ Buffer2.prototype.swap64 = function swap64() {
47092
+ const len = this.length;
47093
+ if (len % 8 !== 0) {
47094
+ throw new RangeError("Buffer size must be a multiple of 64-bits");
47095
+ }
47096
+ for (let i = 0; i < len; i += 8) {
47097
+ swap(this, i, i + 7);
47098
+ swap(this, i + 1, i + 6);
47099
+ swap(this, i + 2, i + 5);
47100
+ swap(this, i + 3, i + 4);
47101
+ }
47102
+ return this;
47103
+ };
47104
+ Buffer2.prototype.toString = function toString() {
47105
+ const length = this.length;
47106
+ if (length === 0) return "";
47107
+ if (arguments.length === 0) return utf8Slice(this, 0, length);
47108
+ return slowToString.apply(this, arguments);
47109
+ };
47110
+ Buffer2.prototype.toLocaleString = Buffer2.prototype.toString;
47111
+ Buffer2.prototype.equals = function equals(b) {
47112
+ if (!Buffer2.isBuffer(b)) throw new TypeError("Argument must be a Buffer");
47113
+ if (this === b) return true;
47114
+ return Buffer2.compare(this, b) === 0;
47115
+ };
47116
+ Buffer2.prototype.inspect = function inspect() {
47117
+ let str = "";
47118
+ const max = exports.INSPECT_MAX_BYTES;
47119
+ str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim();
47120
+ if (this.length > max) str += " ... ";
47121
+ return "<Buffer " + str + ">";
47122
+ };
47123
+ if (customInspectSymbol) {
47124
+ Buffer2.prototype[customInspectSymbol] = Buffer2.prototype.inspect;
47125
+ }
47126
+ Buffer2.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {
47127
+ if (isInstance(target, GlobalUint8Array)) {
47128
+ target = Buffer2.from(target, target.offset, target.byteLength);
47129
+ }
47130
+ if (!Buffer2.isBuffer(target)) {
47131
+ throw new TypeError(
47132
+ 'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof target
47133
+ );
47134
+ }
47135
+ if (start === void 0) {
47136
+ start = 0;
47137
+ }
47138
+ if (end === void 0) {
47139
+ end = target ? target.length : 0;
47140
+ }
47141
+ if (thisStart === void 0) {
47142
+ thisStart = 0;
47143
+ }
47144
+ if (thisEnd === void 0) {
47145
+ thisEnd = this.length;
47146
+ }
47147
+ if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
47148
+ throw new RangeError("out of range index");
47149
+ }
47150
+ if (thisStart >= thisEnd && start >= end) {
47151
+ return 0;
47152
+ }
47153
+ if (thisStart >= thisEnd) {
47154
+ return -1;
47155
+ }
47156
+ if (start >= end) {
47157
+ return 1;
47158
+ }
47159
+ start >>>= 0;
47160
+ end >>>= 0;
47161
+ thisStart >>>= 0;
47162
+ thisEnd >>>= 0;
47163
+ if (this === target) return 0;
47164
+ let x = thisEnd - thisStart;
47165
+ let y = end - start;
47166
+ const len = Math.min(x, y);
47167
+ const thisCopy = this.slice(thisStart, thisEnd);
47168
+ const targetCopy = target.slice(start, end);
47169
+ for (let i = 0; i < len; ++i) {
47170
+ if (thisCopy[i] !== targetCopy[i]) {
47171
+ x = thisCopy[i];
47172
+ y = targetCopy[i];
47173
+ break;
47174
+ }
47175
+ }
47176
+ if (x < y) return -1;
47177
+ if (y < x) return 1;
47178
+ return 0;
47179
+ };
47180
+ function bidirectionalIndexOf(buffer2, val, byteOffset, encoding, dir) {
47181
+ if (buffer2.length === 0) return -1;
47182
+ if (typeof byteOffset === "string") {
47183
+ encoding = byteOffset;
47184
+ byteOffset = 0;
47185
+ } else if (byteOffset > 2147483647) {
47186
+ byteOffset = 2147483647;
47187
+ } else if (byteOffset < -2147483648) {
47188
+ byteOffset = -2147483648;
47189
+ }
47190
+ byteOffset = +byteOffset;
47191
+ if (numberIsNaN(byteOffset)) {
47192
+ byteOffset = dir ? 0 : buffer2.length - 1;
47193
+ }
47194
+ if (byteOffset < 0) byteOffset = buffer2.length + byteOffset;
47195
+ if (byteOffset >= buffer2.length) {
47196
+ if (dir) return -1;
47197
+ else byteOffset = buffer2.length - 1;
47198
+ } else if (byteOffset < 0) {
47199
+ if (dir) byteOffset = 0;
47200
+ else return -1;
47201
+ }
47202
+ if (typeof val === "string") {
47203
+ val = Buffer2.from(val, encoding);
47204
+ }
47205
+ if (Buffer2.isBuffer(val)) {
47206
+ if (val.length === 0) {
47207
+ return -1;
47208
+ }
47209
+ return arrayIndexOf(buffer2, val, byteOffset, encoding, dir);
47210
+ } else if (typeof val === "number") {
47211
+ val = val & 255;
47212
+ if (typeof GlobalUint8Array.prototype.indexOf === "function") {
47213
+ if (dir) {
47214
+ return GlobalUint8Array.prototype.indexOf.call(buffer2, val, byteOffset);
47215
+ } else {
47216
+ return GlobalUint8Array.prototype.lastIndexOf.call(buffer2, val, byteOffset);
47217
+ }
47218
+ }
47219
+ return arrayIndexOf(buffer2, [val], byteOffset, encoding, dir);
47220
+ }
47221
+ throw new TypeError("val must be string, number or Buffer");
47222
+ }
47223
+ function arrayIndexOf(arr, val, byteOffset, encoding, dir) {
47224
+ let indexSize = 1;
47225
+ let arrLength = arr.length;
47226
+ let valLength = val.length;
47227
+ if (encoding !== void 0) {
47228
+ encoding = String(encoding).toLowerCase();
47229
+ if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") {
47230
+ if (arr.length < 2 || val.length < 2) {
47231
+ return -1;
47232
+ }
47233
+ indexSize = 2;
47234
+ arrLength /= 2;
47235
+ valLength /= 2;
47236
+ byteOffset /= 2;
47237
+ }
47238
+ }
47239
+ function read(buf, i2) {
47240
+ if (indexSize === 1) {
47241
+ return buf[i2];
47242
+ } else {
47243
+ return buf.readUInt16BE(i2 * indexSize);
47244
+ }
47245
+ }
47246
+ let i;
47247
+ if (dir) {
47248
+ let foundIndex = -1;
47249
+ for (i = byteOffset; i < arrLength; i++) {
47250
+ if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
47251
+ if (foundIndex === -1) foundIndex = i;
47252
+ if (i - foundIndex + 1 === valLength) return foundIndex * indexSize;
47253
+ } else {
47254
+ if (foundIndex !== -1) i -= i - foundIndex;
47255
+ foundIndex = -1;
47256
+ }
47257
+ }
47258
+ } else {
47259
+ if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;
47260
+ for (i = byteOffset; i >= 0; i--) {
47261
+ let found = true;
47262
+ for (let j = 0; j < valLength; j++) {
47263
+ if (read(arr, i + j) !== read(val, j)) {
47264
+ found = false;
47265
+ break;
47266
+ }
47267
+ }
47268
+ if (found) return i;
47269
+ }
47270
+ }
47271
+ return -1;
47272
+ }
47273
+ Buffer2.prototype.includes = function includes(val, byteOffset, encoding) {
47274
+ return this.indexOf(val, byteOffset, encoding) !== -1;
47275
+ };
47276
+ Buffer2.prototype.indexOf = function indexOf(val, byteOffset, encoding) {
47277
+ return bidirectionalIndexOf(this, val, byteOffset, encoding, true);
47278
+ };
47279
+ Buffer2.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
47280
+ return bidirectionalIndexOf(this, val, byteOffset, encoding, false);
47281
+ };
47282
+ function hexWrite(buf, string, offset, length) {
47283
+ offset = Number(offset) || 0;
47284
+ const remaining = buf.length - offset;
47285
+ if (!length) {
47286
+ length = remaining;
47287
+ } else {
47288
+ length = Number(length);
47289
+ if (length > remaining) {
47290
+ length = remaining;
47291
+ }
47292
+ }
47293
+ const strLen = string.length;
47294
+ if (length > strLen / 2) {
47295
+ length = strLen / 2;
47296
+ }
47297
+ let i;
47298
+ for (i = 0; i < length; ++i) {
47299
+ const parsed = parseInt(string.substr(i * 2, 2), 16);
47300
+ if (numberIsNaN(parsed)) return i;
47301
+ buf[offset + i] = parsed;
47302
+ }
47303
+ return i;
47304
+ }
47305
+ function utf8Write(buf, string, offset, length) {
47306
+ return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);
47307
+ }
47308
+ function asciiWrite(buf, string, offset, length) {
47309
+ return blitBuffer(asciiToBytes(string), buf, offset, length);
47310
+ }
47311
+ function base64Write(buf, string, offset, length) {
47312
+ return blitBuffer(base64ToBytes(string), buf, offset, length);
47313
+ }
47314
+ function ucs2Write(buf, string, offset, length) {
47315
+ return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);
47316
+ }
47317
+ Buffer2.prototype.write = function write(string, offset, length, encoding) {
47318
+ if (offset === void 0) {
47319
+ encoding = "utf8";
47320
+ length = this.length;
47321
+ offset = 0;
47322
+ } else if (length === void 0 && typeof offset === "string") {
47323
+ encoding = offset;
47324
+ length = this.length;
47325
+ offset = 0;
47326
+ } else if (isFinite(offset)) {
47327
+ offset = offset >>> 0;
47328
+ if (isFinite(length)) {
47329
+ length = length >>> 0;
47330
+ if (encoding === void 0) encoding = "utf8";
47331
+ } else {
47332
+ encoding = length;
47333
+ length = void 0;
47334
+ }
47335
+ } else {
47336
+ throw new Error(
47337
+ "Buffer.write(string, encoding, offset[, length]) is no longer supported"
47338
+ );
47339
+ }
47340
+ const remaining = this.length - offset;
47341
+ if (length === void 0 || length > remaining) length = remaining;
47342
+ if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) {
47343
+ throw new RangeError("Attempt to write outside buffer bounds");
47344
+ }
47345
+ if (!encoding) encoding = "utf8";
47346
+ let loweredCase = false;
47347
+ for (; ; ) {
47348
+ switch (encoding) {
47349
+ case "hex":
47350
+ return hexWrite(this, string, offset, length);
47351
+ case "utf8":
47352
+ case "utf-8":
47353
+ return utf8Write(this, string, offset, length);
47354
+ case "ascii":
47355
+ case "latin1":
47356
+ case "binary":
47357
+ return asciiWrite(this, string, offset, length);
47358
+ case "base64":
47359
+ return base64Write(this, string, offset, length);
47360
+ case "ucs2":
47361
+ case "ucs-2":
47362
+ case "utf16le":
47363
+ case "utf-16le":
47364
+ return ucs2Write(this, string, offset, length);
47365
+ default:
47366
+ if (loweredCase) throw new TypeError("Unknown encoding: " + encoding);
47367
+ encoding = ("" + encoding).toLowerCase();
47368
+ loweredCase = true;
47369
+ }
47370
+ }
47371
+ };
47372
+ Buffer2.prototype.toJSON = function toJSON() {
47373
+ return {
47374
+ type: "Buffer",
47375
+ data: Array.prototype.slice.call(this._arr || this, 0)
47376
+ };
47377
+ };
47378
+ function base64Slice(buf, start, end) {
47379
+ if (start === 0 && end === buf.length) {
47380
+ return base64.fromByteArray(buf);
47381
+ } else {
47382
+ return base64.fromByteArray(buf.slice(start, end));
47383
+ }
47384
+ }
47385
+ function utf8Slice(buf, start, end) {
47386
+ end = Math.min(buf.length, end);
47387
+ const res = [];
47388
+ let i = start;
47389
+ while (i < end) {
47390
+ const firstByte = buf[i];
47391
+ let codePoint = null;
47392
+ let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1;
47393
+ if (i + bytesPerSequence <= end) {
47394
+ let secondByte, thirdByte, fourthByte, tempCodePoint;
47395
+ switch (bytesPerSequence) {
47396
+ case 1:
47397
+ if (firstByte < 128) {
47398
+ codePoint = firstByte;
47399
+ }
47400
+ break;
47401
+ case 2:
47402
+ secondByte = buf[i + 1];
47403
+ if ((secondByte & 192) === 128) {
47404
+ tempCodePoint = (firstByte & 31) << 6 | secondByte & 63;
47405
+ if (tempCodePoint > 127) {
47406
+ codePoint = tempCodePoint;
47407
+ }
47408
+ }
47409
+ break;
47410
+ case 3:
47411
+ secondByte = buf[i + 1];
47412
+ thirdByte = buf[i + 2];
47413
+ if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) {
47414
+ tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63;
47415
+ if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) {
47416
+ codePoint = tempCodePoint;
47417
+ }
47418
+ }
47419
+ break;
47420
+ case 4:
47421
+ secondByte = buf[i + 1];
47422
+ thirdByte = buf[i + 2];
47423
+ fourthByte = buf[i + 3];
47424
+ if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) {
47425
+ tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63;
47426
+ if (tempCodePoint > 65535 && tempCodePoint < 1114112) {
47427
+ codePoint = tempCodePoint;
47428
+ }
47429
+ }
47430
+ }
47431
+ }
47432
+ if (codePoint === null) {
47433
+ codePoint = 65533;
47434
+ bytesPerSequence = 1;
47435
+ } else if (codePoint > 65535) {
47436
+ codePoint -= 65536;
47437
+ res.push(codePoint >>> 10 & 1023 | 55296);
47438
+ codePoint = 56320 | codePoint & 1023;
47439
+ }
47440
+ res.push(codePoint);
47441
+ i += bytesPerSequence;
47442
+ }
47443
+ return decodeCodePointsArray(res);
47444
+ }
47445
+ const MAX_ARGUMENTS_LENGTH = 4096;
47446
+ function decodeCodePointsArray(codePoints) {
47447
+ const len = codePoints.length;
47448
+ if (len <= MAX_ARGUMENTS_LENGTH) {
47449
+ return String.fromCharCode.apply(String, codePoints);
47450
+ }
47451
+ let res = "";
47452
+ let i = 0;
47453
+ while (i < len) {
47454
+ res += String.fromCharCode.apply(
47455
+ String,
47456
+ codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
47457
+ );
47458
+ }
47459
+ return res;
47460
+ }
47461
+ function asciiSlice(buf, start, end) {
47462
+ let ret = "";
47463
+ end = Math.min(buf.length, end);
47464
+ for (let i = start; i < end; ++i) {
47465
+ ret += String.fromCharCode(buf[i] & 127);
47466
+ }
47467
+ return ret;
47468
+ }
47469
+ function latin1Slice(buf, start, end) {
47470
+ let ret = "";
47471
+ end = Math.min(buf.length, end);
47472
+ for (let i = start; i < end; ++i) {
47473
+ ret += String.fromCharCode(buf[i]);
47474
+ }
47475
+ return ret;
47476
+ }
47477
+ function hexSlice(buf, start, end) {
47478
+ const len = buf.length;
47479
+ if (!start || start < 0) start = 0;
47480
+ if (!end || end < 0 || end > len) end = len;
47481
+ let out = "";
47482
+ for (let i = start; i < end; ++i) {
47483
+ out += hexSliceLookupTable[buf[i]];
47484
+ }
47485
+ return out;
47486
+ }
47487
+ function utf16leSlice(buf, start, end) {
47488
+ const bytes = buf.slice(start, end);
47489
+ let res = "";
47490
+ for (let i = 0; i < bytes.length - 1; i += 2) {
47491
+ res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);
47492
+ }
47493
+ return res;
47494
+ }
47495
+ Buffer2.prototype.slice = function slice(start, end) {
47496
+ const len = this.length;
47497
+ start = ~~start;
47498
+ end = end === void 0 ? len : ~~end;
47499
+ if (start < 0) {
47500
+ start += len;
47501
+ if (start < 0) start = 0;
47502
+ } else if (start > len) {
47503
+ start = len;
47504
+ }
47505
+ if (end < 0) {
47506
+ end += len;
47507
+ if (end < 0) end = 0;
47508
+ } else if (end > len) {
47509
+ end = len;
47510
+ }
47511
+ if (end < start) end = start;
47512
+ const newBuf = this.subarray(start, end);
47513
+ Object.setPrototypeOf(newBuf, Buffer2.prototype);
47514
+ return newBuf;
47515
+ };
47516
+ function checkOffset(offset, ext, length) {
47517
+ if (offset % 1 !== 0 || offset < 0) throw new RangeError("offset is not uint");
47518
+ if (offset + ext > length) throw new RangeError("Trying to access beyond buffer length");
47519
+ }
47520
+ Buffer2.prototype.readUintLE = Buffer2.prototype.readUIntLE = function readUIntLE(offset, byteLength3, noAssert) {
47521
+ offset = offset >>> 0;
47522
+ byteLength3 = byteLength3 >>> 0;
47523
+ if (!noAssert) checkOffset(offset, byteLength3, this.length);
47524
+ let val = this[offset];
47525
+ let mul = 1;
47526
+ let i = 0;
47527
+ while (++i < byteLength3 && (mul *= 256)) {
47528
+ val += this[offset + i] * mul;
47529
+ }
47530
+ return val;
47531
+ };
47532
+ Buffer2.prototype.readUintBE = Buffer2.prototype.readUIntBE = function readUIntBE(offset, byteLength3, noAssert) {
47533
+ offset = offset >>> 0;
47534
+ byteLength3 = byteLength3 >>> 0;
47535
+ if (!noAssert) {
47536
+ checkOffset(offset, byteLength3, this.length);
47537
+ }
47538
+ let val = this[offset + --byteLength3];
47539
+ let mul = 1;
47540
+ while (byteLength3 > 0 && (mul *= 256)) {
47541
+ val += this[offset + --byteLength3] * mul;
47542
+ }
47543
+ return val;
47544
+ };
47545
+ Buffer2.prototype.readUint8 = Buffer2.prototype.readUInt8 = function readUInt8(offset, noAssert) {
47546
+ offset = offset >>> 0;
47547
+ if (!noAssert) checkOffset(offset, 1, this.length);
47548
+ return this[offset];
47549
+ };
47550
+ Buffer2.prototype.readUint16LE = Buffer2.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {
47551
+ offset = offset >>> 0;
47552
+ if (!noAssert) checkOffset(offset, 2, this.length);
47553
+ return this[offset] | this[offset + 1] << 8;
47554
+ };
47555
+ Buffer2.prototype.readUint16BE = Buffer2.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {
47556
+ offset = offset >>> 0;
47557
+ if (!noAssert) checkOffset(offset, 2, this.length);
47558
+ return this[offset] << 8 | this[offset + 1];
47559
+ };
47560
+ Buffer2.prototype.readUint32LE = Buffer2.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {
47561
+ offset = offset >>> 0;
47562
+ if (!noAssert) checkOffset(offset, 4, this.length);
47563
+ return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216;
47564
+ };
47565
+ Buffer2.prototype.readUint32BE = Buffer2.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {
47566
+ offset = offset >>> 0;
47567
+ if (!noAssert) checkOffset(offset, 4, this.length);
47568
+ return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);
47569
+ };
47570
+ Buffer2.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset) {
47571
+ offset = offset >>> 0;
47572
+ validateNumber(offset, "offset");
47573
+ const first = this[offset];
47574
+ const last = this[offset + 7];
47575
+ if (first === void 0 || last === void 0) {
47576
+ boundsError(offset, this.length - 8);
47577
+ }
47578
+ const lo = first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24;
47579
+ const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last * 2 ** 24;
47580
+ return BigInt(lo) + (BigInt(hi) << BigInt(32));
47581
+ });
47582
+ Buffer2.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset) {
47583
+ offset = offset >>> 0;
47584
+ validateNumber(offset, "offset");
47585
+ const first = this[offset];
47586
+ const last = this[offset + 7];
47587
+ if (first === void 0 || last === void 0) {
47588
+ boundsError(offset, this.length - 8);
47589
+ }
47590
+ const hi = first * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];
47591
+ const lo = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last;
47592
+ return (BigInt(hi) << BigInt(32)) + BigInt(lo);
47593
+ });
47594
+ Buffer2.prototype.readIntLE = function readIntLE(offset, byteLength3, noAssert) {
47595
+ offset = offset >>> 0;
47596
+ byteLength3 = byteLength3 >>> 0;
47597
+ if (!noAssert) checkOffset(offset, byteLength3, this.length);
47598
+ let val = this[offset];
47599
+ let mul = 1;
47600
+ let i = 0;
47601
+ while (++i < byteLength3 && (mul *= 256)) {
47602
+ val += this[offset + i] * mul;
47603
+ }
47604
+ mul *= 128;
47605
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength3);
47606
+ return val;
47607
+ };
47608
+ Buffer2.prototype.readIntBE = function readIntBE(offset, byteLength3, noAssert) {
47609
+ offset = offset >>> 0;
47610
+ byteLength3 = byteLength3 >>> 0;
47611
+ if (!noAssert) checkOffset(offset, byteLength3, this.length);
47612
+ let i = byteLength3;
47613
+ let mul = 1;
47614
+ let val = this[offset + --i];
47615
+ while (i > 0 && (mul *= 256)) {
47616
+ val += this[offset + --i] * mul;
47617
+ }
47618
+ mul *= 128;
47619
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength3);
47620
+ return val;
47621
+ };
47622
+ Buffer2.prototype.readInt8 = function readInt8(offset, noAssert) {
47623
+ offset = offset >>> 0;
47624
+ if (!noAssert) checkOffset(offset, 1, this.length);
47625
+ if (!(this[offset] & 128)) return this[offset];
47626
+ return (255 - this[offset] + 1) * -1;
47627
+ };
47628
+ Buffer2.prototype.readInt16LE = function readInt16LE(offset, noAssert) {
47629
+ offset = offset >>> 0;
47630
+ if (!noAssert) checkOffset(offset, 2, this.length);
47631
+ const val = this[offset] | this[offset + 1] << 8;
47632
+ return val & 32768 ? val | 4294901760 : val;
47633
+ };
47634
+ Buffer2.prototype.readInt16BE = function readInt16BE(offset, noAssert) {
47635
+ offset = offset >>> 0;
47636
+ if (!noAssert) checkOffset(offset, 2, this.length);
47637
+ const val = this[offset + 1] | this[offset] << 8;
47638
+ return val & 32768 ? val | 4294901760 : val;
47639
+ };
47640
+ Buffer2.prototype.readInt32LE = function readInt32LE(offset, noAssert) {
47641
+ offset = offset >>> 0;
47642
+ if (!noAssert) checkOffset(offset, 4, this.length);
47643
+ return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;
47644
+ };
47645
+ Buffer2.prototype.readInt32BE = function readInt32BE(offset, noAssert) {
47646
+ offset = offset >>> 0;
47647
+ if (!noAssert) checkOffset(offset, 4, this.length);
47648
+ return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];
47649
+ };
47650
+ Buffer2.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset) {
47651
+ offset = offset >>> 0;
47652
+ validateNumber(offset, "offset");
47653
+ const first = this[offset];
47654
+ const last = this[offset + 7];
47655
+ if (first === void 0 || last === void 0) {
47656
+ boundsError(offset, this.length - 8);
47657
+ }
47658
+ const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last << 24);
47659
+ return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24);
47660
+ });
47661
+ Buffer2.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset) {
47662
+ offset = offset >>> 0;
47663
+ validateNumber(offset, "offset");
47664
+ const first = this[offset];
47665
+ const last = this[offset + 7];
47666
+ if (first === void 0 || last === void 0) {
47667
+ boundsError(offset, this.length - 8);
47668
+ }
47669
+ const val = (first << 24) + // Overflow
47670
+ this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];
47671
+ return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last);
47672
+ });
47673
+ Buffer2.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
47674
+ offset = offset >>> 0;
47675
+ if (!noAssert) checkOffset(offset, 4, this.length);
47676
+ return ieee754$1.read(this, offset, true, 23, 4);
47677
+ };
47678
+ Buffer2.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
47679
+ offset = offset >>> 0;
47680
+ if (!noAssert) checkOffset(offset, 4, this.length);
47681
+ return ieee754$1.read(this, offset, false, 23, 4);
47682
+ };
47683
+ Buffer2.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
47684
+ offset = offset >>> 0;
47685
+ if (!noAssert) checkOffset(offset, 8, this.length);
47686
+ return ieee754$1.read(this, offset, true, 52, 8);
47687
+ };
47688
+ Buffer2.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
47689
+ offset = offset >>> 0;
47690
+ if (!noAssert) checkOffset(offset, 8, this.length);
47691
+ return ieee754$1.read(this, offset, false, 52, 8);
47692
+ };
47693
+ function checkInt(buf, value, offset, ext, max, min) {
47694
+ if (!Buffer2.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance');
47695
+ if (value > max || value < min) throw new RangeError('"value" argument is out of bounds');
47696
+ if (offset + ext > buf.length) throw new RangeError("Index out of range");
47697
+ }
47698
+ Buffer2.prototype.writeUintLE = Buffer2.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength3, noAssert) {
47699
+ value = +value;
47700
+ offset = offset >>> 0;
47701
+ byteLength3 = byteLength3 >>> 0;
47702
+ if (!noAssert) {
47703
+ const maxBytes = Math.pow(2, 8 * byteLength3) - 1;
47704
+ checkInt(this, value, offset, byteLength3, maxBytes, 0);
47705
+ }
47706
+ let mul = 1;
47707
+ let i = 0;
47708
+ this[offset] = value & 255;
47709
+ while (++i < byteLength3 && (mul *= 256)) {
47710
+ this[offset + i] = value / mul & 255;
47711
+ }
47712
+ return offset + byteLength3;
47713
+ };
47714
+ Buffer2.prototype.writeUintBE = Buffer2.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength3, noAssert) {
47715
+ value = +value;
47716
+ offset = offset >>> 0;
47717
+ byteLength3 = byteLength3 >>> 0;
47718
+ if (!noAssert) {
47719
+ const maxBytes = Math.pow(2, 8 * byteLength3) - 1;
47720
+ checkInt(this, value, offset, byteLength3, maxBytes, 0);
47721
+ }
47722
+ let i = byteLength3 - 1;
47723
+ let mul = 1;
47724
+ this[offset + i] = value & 255;
47725
+ while (--i >= 0 && (mul *= 256)) {
47726
+ this[offset + i] = value / mul & 255;
47727
+ }
47728
+ return offset + byteLength3;
47729
+ };
47730
+ Buffer2.prototype.writeUint8 = Buffer2.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {
47731
+ value = +value;
47732
+ offset = offset >>> 0;
47733
+ if (!noAssert) checkInt(this, value, offset, 1, 255, 0);
47734
+ this[offset] = value & 255;
47735
+ return offset + 1;
47736
+ };
47737
+ Buffer2.prototype.writeUint16LE = Buffer2.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {
47738
+ value = +value;
47739
+ offset = offset >>> 0;
47740
+ if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);
47741
+ this[offset] = value & 255;
47742
+ this[offset + 1] = value >>> 8;
47743
+ return offset + 2;
47744
+ };
47745
+ Buffer2.prototype.writeUint16BE = Buffer2.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {
47746
+ value = +value;
47747
+ offset = offset >>> 0;
47748
+ if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);
47749
+ this[offset] = value >>> 8;
47750
+ this[offset + 1] = value & 255;
47751
+ return offset + 2;
47752
+ };
47753
+ Buffer2.prototype.writeUint32LE = Buffer2.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {
47754
+ value = +value;
47755
+ offset = offset >>> 0;
47756
+ if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);
47757
+ this[offset + 3] = value >>> 24;
47758
+ this[offset + 2] = value >>> 16;
47759
+ this[offset + 1] = value >>> 8;
47760
+ this[offset] = value & 255;
47761
+ return offset + 4;
47762
+ };
47763
+ Buffer2.prototype.writeUint32BE = Buffer2.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {
47764
+ value = +value;
47765
+ offset = offset >>> 0;
47766
+ if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);
47767
+ this[offset] = value >>> 24;
47768
+ this[offset + 1] = value >>> 16;
47769
+ this[offset + 2] = value >>> 8;
47770
+ this[offset + 3] = value & 255;
47771
+ return offset + 4;
47772
+ };
47773
+ function wrtBigUInt64LE(buf, value, offset, min, max) {
47774
+ checkIntBI(value, min, max, buf, offset, 7);
47775
+ let lo = Number(value & BigInt(4294967295));
47776
+ buf[offset++] = lo;
47777
+ lo = lo >> 8;
47778
+ buf[offset++] = lo;
47779
+ lo = lo >> 8;
47780
+ buf[offset++] = lo;
47781
+ lo = lo >> 8;
47782
+ buf[offset++] = lo;
47783
+ let hi = Number(value >> BigInt(32) & BigInt(4294967295));
47784
+ buf[offset++] = hi;
47785
+ hi = hi >> 8;
47786
+ buf[offset++] = hi;
47787
+ hi = hi >> 8;
47788
+ buf[offset++] = hi;
47789
+ hi = hi >> 8;
47790
+ buf[offset++] = hi;
47791
+ return offset;
47792
+ }
47793
+ function wrtBigUInt64BE(buf, value, offset, min, max) {
47794
+ checkIntBI(value, min, max, buf, offset, 7);
47795
+ let lo = Number(value & BigInt(4294967295));
47796
+ buf[offset + 7] = lo;
47797
+ lo = lo >> 8;
47798
+ buf[offset + 6] = lo;
47799
+ lo = lo >> 8;
47800
+ buf[offset + 5] = lo;
47801
+ lo = lo >> 8;
47802
+ buf[offset + 4] = lo;
47803
+ let hi = Number(value >> BigInt(32) & BigInt(4294967295));
47804
+ buf[offset + 3] = hi;
47805
+ hi = hi >> 8;
47806
+ buf[offset + 2] = hi;
47807
+ hi = hi >> 8;
47808
+ buf[offset + 1] = hi;
47809
+ hi = hi >> 8;
47810
+ buf[offset] = hi;
47811
+ return offset + 8;
47812
+ }
47813
+ Buffer2.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value, offset = 0) {
47814
+ return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff"));
47815
+ });
47816
+ Buffer2.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value, offset = 0) {
47817
+ return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff"));
47818
+ });
47819
+ Buffer2.prototype.writeIntLE = function writeIntLE(value, offset, byteLength3, noAssert) {
47820
+ value = +value;
47821
+ offset = offset >>> 0;
47822
+ if (!noAssert) {
47823
+ const limit = Math.pow(2, 8 * byteLength3 - 1);
47824
+ checkInt(this, value, offset, byteLength3, limit - 1, -limit);
47825
+ }
47826
+ let i = 0;
47827
+ let mul = 1;
47828
+ let sub = 0;
47829
+ this[offset] = value & 255;
47830
+ while (++i < byteLength3 && (mul *= 256)) {
47831
+ if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
47832
+ sub = 1;
47833
+ }
47834
+ this[offset + i] = (value / mul >> 0) - sub & 255;
47835
+ }
47836
+ return offset + byteLength3;
47837
+ };
47838
+ Buffer2.prototype.writeIntBE = function writeIntBE(value, offset, byteLength3, noAssert) {
47839
+ value = +value;
47840
+ offset = offset >>> 0;
47841
+ if (!noAssert) {
47842
+ const limit = Math.pow(2, 8 * byteLength3 - 1);
47843
+ checkInt(this, value, offset, byteLength3, limit - 1, -limit);
47844
+ }
47845
+ let i = byteLength3 - 1;
47846
+ let mul = 1;
47847
+ let sub = 0;
47848
+ this[offset + i] = value & 255;
47849
+ while (--i >= 0 && (mul *= 256)) {
47850
+ if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
47851
+ sub = 1;
47852
+ }
47853
+ this[offset + i] = (value / mul >> 0) - sub & 255;
47854
+ }
47855
+ return offset + byteLength3;
47856
+ };
47857
+ Buffer2.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {
47858
+ value = +value;
47859
+ offset = offset >>> 0;
47860
+ if (!noAssert) checkInt(this, value, offset, 1, 127, -128);
47861
+ if (value < 0) value = 255 + value + 1;
47862
+ this[offset] = value & 255;
47863
+ return offset + 1;
47864
+ };
47865
+ Buffer2.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {
47866
+ value = +value;
47867
+ offset = offset >>> 0;
47868
+ if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);
47869
+ this[offset] = value & 255;
47870
+ this[offset + 1] = value >>> 8;
47871
+ return offset + 2;
47872
+ };
47873
+ Buffer2.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {
47874
+ value = +value;
47875
+ offset = offset >>> 0;
47876
+ if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);
47877
+ this[offset] = value >>> 8;
47878
+ this[offset + 1] = value & 255;
47879
+ return offset + 2;
47880
+ };
47881
+ Buffer2.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {
47882
+ value = +value;
47883
+ offset = offset >>> 0;
47884
+ if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);
47885
+ this[offset] = value & 255;
47886
+ this[offset + 1] = value >>> 8;
47887
+ this[offset + 2] = value >>> 16;
47888
+ this[offset + 3] = value >>> 24;
47889
+ return offset + 4;
47890
+ };
47891
+ Buffer2.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {
47892
+ value = +value;
47893
+ offset = offset >>> 0;
47894
+ if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);
47895
+ if (value < 0) value = 4294967295 + value + 1;
47896
+ this[offset] = value >>> 24;
47897
+ this[offset + 1] = value >>> 16;
47898
+ this[offset + 2] = value >>> 8;
47899
+ this[offset + 3] = value & 255;
47900
+ return offset + 4;
47901
+ };
47902
+ Buffer2.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value, offset = 0) {
47903
+ return wrtBigUInt64LE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
47904
+ });
47905
+ Buffer2.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value, offset = 0) {
47906
+ return wrtBigUInt64BE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
47907
+ });
47908
+ function checkIEEE754(buf, value, offset, ext, max, min) {
47909
+ if (offset + ext > buf.length) throw new RangeError("Index out of range");
47910
+ if (offset < 0) throw new RangeError("Index out of range");
47911
+ }
47912
+ function writeFloat(buf, value, offset, littleEndian, noAssert) {
47913
+ value = +value;
47914
+ offset = offset >>> 0;
47915
+ if (!noAssert) {
47916
+ checkIEEE754(buf, value, offset, 4);
47917
+ }
47918
+ ieee754$1.write(buf, value, offset, littleEndian, 23, 4);
47919
+ return offset + 4;
47920
+ }
47921
+ Buffer2.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {
47922
+ return writeFloat(this, value, offset, true, noAssert);
47923
+ };
47924
+ Buffer2.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {
47925
+ return writeFloat(this, value, offset, false, noAssert);
47926
+ };
47927
+ function writeDouble(buf, value, offset, littleEndian, noAssert) {
47928
+ value = +value;
47929
+ offset = offset >>> 0;
47930
+ if (!noAssert) {
47931
+ checkIEEE754(buf, value, offset, 8);
47932
+ }
47933
+ ieee754$1.write(buf, value, offset, littleEndian, 52, 8);
47934
+ return offset + 8;
47935
+ }
47936
+ Buffer2.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {
47937
+ return writeDouble(this, value, offset, true, noAssert);
47938
+ };
47939
+ Buffer2.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {
47940
+ return writeDouble(this, value, offset, false, noAssert);
47941
+ };
47942
+ Buffer2.prototype.copy = function copy(target, targetStart, start, end) {
47943
+ if (!Buffer2.isBuffer(target)) throw new TypeError("argument should be a Buffer");
47944
+ if (!start) start = 0;
47945
+ if (!end && end !== 0) end = this.length;
47946
+ if (targetStart >= target.length) targetStart = target.length;
47947
+ if (!targetStart) targetStart = 0;
47948
+ if (end > 0 && end < start) end = start;
47949
+ if (end === start) return 0;
47950
+ if (target.length === 0 || this.length === 0) return 0;
47951
+ if (targetStart < 0) {
47952
+ throw new RangeError("targetStart out of bounds");
47953
+ }
47954
+ if (start < 0 || start >= this.length) throw new RangeError("Index out of range");
47955
+ if (end < 0) throw new RangeError("sourceEnd out of bounds");
47956
+ if (end > this.length) end = this.length;
47957
+ if (target.length - targetStart < end - start) {
47958
+ end = target.length - targetStart + start;
47959
+ }
47960
+ const len = end - start;
47961
+ if (this === target && typeof GlobalUint8Array.prototype.copyWithin === "function") {
47962
+ this.copyWithin(targetStart, start, end);
47963
+ } else {
47964
+ GlobalUint8Array.prototype.set.call(
47965
+ target,
47966
+ this.subarray(start, end),
47967
+ targetStart
47968
+ );
47969
+ }
47970
+ return len;
47971
+ };
47972
+ Buffer2.prototype.fill = function fill(val, start, end, encoding) {
47973
+ if (typeof val === "string") {
47974
+ if (typeof start === "string") {
47975
+ encoding = start;
47976
+ start = 0;
47977
+ end = this.length;
47978
+ } else if (typeof end === "string") {
47979
+ encoding = end;
47980
+ end = this.length;
47981
+ }
47982
+ if (encoding !== void 0 && typeof encoding !== "string") {
47983
+ throw new TypeError("encoding must be a string");
47984
+ }
47985
+ if (typeof encoding === "string" && !Buffer2.isEncoding(encoding)) {
47986
+ throw new TypeError("Unknown encoding: " + encoding);
47987
+ }
47988
+ if (val.length === 1) {
47989
+ const code2 = val.charCodeAt(0);
47990
+ if (encoding === "utf8" && code2 < 128 || encoding === "latin1") {
47991
+ val = code2;
47992
+ }
47993
+ }
47994
+ } else if (typeof val === "number") {
47995
+ val = val & 255;
47996
+ } else if (typeof val === "boolean") {
47997
+ val = Number(val);
47998
+ }
47999
+ if (start < 0 || this.length < start || this.length < end) {
48000
+ throw new RangeError("Out of range index");
48001
+ }
48002
+ if (end <= start) {
48003
+ return this;
48004
+ }
48005
+ start = start >>> 0;
48006
+ end = end === void 0 ? this.length : end >>> 0;
48007
+ if (!val) val = 0;
48008
+ let i;
48009
+ if (typeof val === "number") {
48010
+ for (i = start; i < end; ++i) {
48011
+ this[i] = val;
48012
+ }
48013
+ } else {
48014
+ const bytes = Buffer2.isBuffer(val) ? val : Buffer2.from(val, encoding);
48015
+ const len = bytes.length;
48016
+ if (len === 0) {
48017
+ throw new TypeError('The value "' + val + '" is invalid for argument "value"');
48018
+ }
48019
+ for (i = 0; i < end - start; ++i) {
48020
+ this[i + start] = bytes[i % len];
48021
+ }
48022
+ }
48023
+ return this;
48024
+ };
48025
+ const errors = {};
48026
+ function E(sym, getMessage, Base) {
48027
+ errors[sym] = class NodeError extends Base {
48028
+ constructor() {
48029
+ super();
48030
+ Object.defineProperty(this, "message", {
48031
+ value: getMessage.apply(this, arguments),
48032
+ writable: true,
48033
+ configurable: true
48034
+ });
48035
+ this.name = `${this.name} [${sym}]`;
48036
+ this.stack;
48037
+ delete this.name;
48038
+ }
48039
+ get code() {
48040
+ return sym;
48041
+ }
48042
+ set code(value) {
48043
+ Object.defineProperty(this, "code", {
48044
+ configurable: true,
48045
+ enumerable: true,
48046
+ value,
48047
+ writable: true
48048
+ });
48049
+ }
48050
+ toString() {
48051
+ return `${this.name} [${sym}]: ${this.message}`;
48052
+ }
48053
+ };
48054
+ }
48055
+ E(
48056
+ "ERR_BUFFER_OUT_OF_BOUNDS",
48057
+ function(name) {
48058
+ if (name) {
48059
+ return `${name} is outside of buffer bounds`;
48060
+ }
48061
+ return "Attempt to access memory outside buffer bounds";
48062
+ },
48063
+ RangeError
48064
+ );
48065
+ E(
48066
+ "ERR_INVALID_ARG_TYPE",
48067
+ function(name, actual) {
48068
+ return `The "${name}" argument must be of type number. Received type ${typeof actual}`;
48069
+ },
48070
+ TypeError
48071
+ );
48072
+ E(
48073
+ "ERR_OUT_OF_RANGE",
48074
+ function(str, range, input) {
48075
+ let msg = `The value of "${str}" is out of range.`;
48076
+ let received = input;
48077
+ if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {
48078
+ received = addNumericalSeparator(String(input));
48079
+ } else if (typeof input === "bigint") {
48080
+ received = String(input);
48081
+ if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {
48082
+ received = addNumericalSeparator(received);
48083
+ }
48084
+ received += "n";
48085
+ }
48086
+ msg += ` It must be ${range}. Received ${received}`;
48087
+ return msg;
48088
+ },
48089
+ RangeError
48090
+ );
48091
+ function addNumericalSeparator(val) {
48092
+ let res = "";
48093
+ let i = val.length;
48094
+ const start = val[0] === "-" ? 1 : 0;
48095
+ for (; i >= start + 4; i -= 3) {
48096
+ res = `_${val.slice(i - 3, i)}${res}`;
48097
+ }
48098
+ return `${val.slice(0, i)}${res}`;
48099
+ }
48100
+ function checkBounds(buf, offset, byteLength3) {
48101
+ validateNumber(offset, "offset");
48102
+ if (buf[offset] === void 0 || buf[offset + byteLength3] === void 0) {
48103
+ boundsError(offset, buf.length - (byteLength3 + 1));
48104
+ }
48105
+ }
48106
+ function checkIntBI(value, min, max, buf, offset, byteLength3) {
48107
+ if (value > max || value < min) {
48108
+ const n = typeof min === "bigint" ? "n" : "";
48109
+ let range;
48110
+ {
48111
+ if (min === 0 || min === BigInt(0)) {
48112
+ range = `>= 0${n} and < 2${n} ** ${(byteLength3 + 1) * 8}${n}`;
48113
+ } else {
48114
+ range = `>= -(2${n} ** ${(byteLength3 + 1) * 8 - 1}${n}) and < 2 ** ${(byteLength3 + 1) * 8 - 1}${n}`;
48115
+ }
48116
+ }
48117
+ throw new errors.ERR_OUT_OF_RANGE("value", range, value);
48118
+ }
48119
+ checkBounds(buf, offset, byteLength3);
48120
+ }
48121
+ function validateNumber(value, name) {
48122
+ if (typeof value !== "number") {
48123
+ throw new errors.ERR_INVALID_ARG_TYPE(name, "number", value);
48124
+ }
48125
+ }
48126
+ function boundsError(value, length, type) {
48127
+ if (Math.floor(value) !== value) {
48128
+ validateNumber(value, type);
48129
+ throw new errors.ERR_OUT_OF_RANGE("offset", "an integer", value);
48130
+ }
48131
+ if (length < 0) {
48132
+ throw new errors.ERR_BUFFER_OUT_OF_BOUNDS();
48133
+ }
48134
+ throw new errors.ERR_OUT_OF_RANGE(
48135
+ "offset",
48136
+ `>= ${0} and <= ${length}`,
48137
+ value
48138
+ );
48139
+ }
48140
+ const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g;
48141
+ function base64clean(str) {
48142
+ str = str.split("=")[0];
48143
+ str = str.trim().replace(INVALID_BASE64_RE, "");
48144
+ if (str.length < 2) return "";
48145
+ while (str.length % 4 !== 0) {
48146
+ str = str + "=";
48147
+ }
48148
+ return str;
48149
+ }
48150
+ function utf8ToBytes(string, units) {
48151
+ units = units || Infinity;
48152
+ let codePoint;
48153
+ const length = string.length;
48154
+ let leadSurrogate = null;
48155
+ const bytes = [];
48156
+ for (let i = 0; i < length; ++i) {
48157
+ codePoint = string.charCodeAt(i);
48158
+ if (codePoint > 55295 && codePoint < 57344) {
48159
+ if (!leadSurrogate) {
48160
+ if (codePoint > 56319) {
48161
+ if ((units -= 3) > -1) bytes.push(239, 191, 189);
48162
+ continue;
48163
+ } else if (i + 1 === length) {
48164
+ if ((units -= 3) > -1) bytes.push(239, 191, 189);
48165
+ continue;
48166
+ }
48167
+ leadSurrogate = codePoint;
48168
+ continue;
48169
+ }
48170
+ if (codePoint < 56320) {
48171
+ if ((units -= 3) > -1) bytes.push(239, 191, 189);
48172
+ leadSurrogate = codePoint;
48173
+ continue;
48174
+ }
48175
+ codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536;
48176
+ } else if (leadSurrogate) {
48177
+ if ((units -= 3) > -1) bytes.push(239, 191, 189);
48178
+ }
48179
+ leadSurrogate = null;
48180
+ if (codePoint < 128) {
48181
+ if ((units -= 1) < 0) break;
48182
+ bytes.push(codePoint);
48183
+ } else if (codePoint < 2048) {
48184
+ if ((units -= 2) < 0) break;
48185
+ bytes.push(
48186
+ codePoint >> 6 | 192,
48187
+ codePoint & 63 | 128
48188
+ );
48189
+ } else if (codePoint < 65536) {
48190
+ if ((units -= 3) < 0) break;
48191
+ bytes.push(
48192
+ codePoint >> 12 | 224,
48193
+ codePoint >> 6 & 63 | 128,
48194
+ codePoint & 63 | 128
48195
+ );
48196
+ } else if (codePoint < 1114112) {
48197
+ if ((units -= 4) < 0) break;
48198
+ bytes.push(
48199
+ codePoint >> 18 | 240,
48200
+ codePoint >> 12 & 63 | 128,
48201
+ codePoint >> 6 & 63 | 128,
48202
+ codePoint & 63 | 128
48203
+ );
48204
+ } else {
48205
+ throw new Error("Invalid code point");
48206
+ }
48207
+ }
48208
+ return bytes;
48209
+ }
48210
+ function asciiToBytes(str) {
48211
+ const byteArray = [];
48212
+ for (let i = 0; i < str.length; ++i) {
48213
+ byteArray.push(str.charCodeAt(i) & 255);
48214
+ }
48215
+ return byteArray;
48216
+ }
48217
+ function utf16leToBytes(str, units) {
48218
+ let c, hi, lo;
48219
+ const byteArray = [];
48220
+ for (let i = 0; i < str.length; ++i) {
48221
+ if ((units -= 2) < 0) break;
48222
+ c = str.charCodeAt(i);
48223
+ hi = c >> 8;
48224
+ lo = c % 256;
48225
+ byteArray.push(lo);
48226
+ byteArray.push(hi);
48227
+ }
48228
+ return byteArray;
48229
+ }
48230
+ function base64ToBytes(str) {
48231
+ return base64.toByteArray(base64clean(str));
48232
+ }
48233
+ function blitBuffer(src, dst, offset, length) {
48234
+ let i;
48235
+ for (i = 0; i < length; ++i) {
48236
+ if (i + offset >= dst.length || i >= src.length) break;
48237
+ dst[i + offset] = src[i];
48238
+ }
48239
+ return i;
48240
+ }
48241
+ function isInstance(obj, type) {
48242
+ return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name;
48243
+ }
48244
+ function numberIsNaN(obj) {
48245
+ return obj !== obj;
48246
+ }
48247
+ const hexSliceLookupTable = function() {
48248
+ const alphabet = "0123456789abcdef";
48249
+ const table = new Array(256);
48250
+ for (let i = 0; i < 16; ++i) {
48251
+ const i16 = i * 16;
48252
+ for (let j = 0; j < 16; ++j) {
48253
+ table[i16 + j] = alphabet[i] + alphabet[j];
48254
+ }
48255
+ }
48256
+ return table;
48257
+ }();
48258
+ function defineBigIntMethod(fn) {
48259
+ return typeof BigInt === "undefined" ? BufferBigIntNotDefined : fn;
48260
+ }
48261
+ function BufferBigIntNotDefined() {
48262
+ throw new Error("BigInt not supported");
48263
+ }
48264
+ })(buffer$1);
48265
+ const Buffer = buffer$1.Buffer;
48266
+
48263
48267
  var bufferXor;
48264
48268
  var hasRequiredBufferXor;
48265
48269
 
@@ -90050,9 +90054,6 @@ __publicField$1(Tiktoken, "specialTokenRegex", (tokens) => {
90050
90054
  return new RegExp(tokens.map((i) => escapeRegex(i)).join("|"), "g");
90051
90055
  });
90052
90056
 
90053
- var streamBrowserifyExports = requireStreamBrowserify();
90054
- const pkg = /*@__PURE__*/getDefaultExportFromCjs(streamBrowserifyExports);
90055
-
90056
90057
  var util$2;
90057
90058
  (function (util) {
90058
90059
  util.assertEqual = (_) => { };
@@ -103092,7 +103093,7 @@ const createStream = async () => {
103092
103093
  if (raw) {
103093
103094
  return void 0;
103094
103095
  }
103095
- const pretty = await __vitePreload(() => import('./index-DNxLn4OZ.js').then(n => n.i),true ?__vite__mapDeps([0,1]):void 0);
103096
+ const pretty = await __vitePreload(() => import('./index-Bs4IloEa.js').then(n => n.i),true ?__vite__mapDeps([0,1]):void 0);
103096
103097
  return pretty.default(createPrettyConfig());
103097
103098
  };
103098
103099
  const options = {
@@ -103182,7 +103183,6 @@ if (typeof process$1 !== "undefined") {
103182
103183
  }
103183
103184
  const elizaLogger = logger;
103184
103185
 
103185
- const { PassThrough, Readable } = pkg;
103186
103186
  function parseBooleanFromText(value) {
103187
103187
  if (!value) return false;
103188
103188
  const affirmative = ["YES", "Y", "TRUE", "T", "1", "ON", "ENABLE"];
@@ -122846,7 +122846,7 @@ const DropdownMenuSeparator = reactExports.forwardRef(({ className, ...props },
122846
122846
  ));
122847
122847
  DropdownMenuSeparator.displayName = Separator2.displayName;
122848
122848
 
122849
- const version = "1.0.0";
122849
+ const version = "1.0.2";
122850
122850
  const info = {
122851
122851
  version,
122852
122852
  };
@@ -131586,6 +131586,7 @@ function Page$1({
131586
131586
  reactExports.useEffect(() => {
131587
131587
  socketIOManager.initialize(entityId, [agentId]);
131588
131588
  socketIOManager.joinRoom(roomId);
131589
+ setInputDisabled(false);
131589
131590
  console.log(`[Chat] Joined room ${roomId} with entityId ${entityId}`);
131590
131591
  const handleMessageBroadcasting = (data) => {
131591
131592
  console.log("[Chat] Received message broadcast:", data);
@@ -131971,10 +131972,10 @@ function Page$1({
131971
131972
  ),
131972
131973
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-4 pb-4 mt-auto flex-shrink-0", children: [
131973
131974
  inputDisabled && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-2 pb-2 text-sm text-muted-foreground flex items-center gap-2", children: [
131974
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-1", children: [
131975
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-2 h-2 bg-blue-500 rounded-full animate-bounce [animation-delay:0ms]" }),
131976
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-2 h-2 bg-blue-500 rounded-full animate-bounce [animation-delay:150ms]" }),
131977
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-2 h-2 bg-blue-500 rounded-full animate-bounce [animation-delay:300ms]" })
131975
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-0.5 items-center justify-center", children: [
131976
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "w-[6px] h-[6px] bg-white rounded-full animate-bounce [animation-delay:0s]" }),
131977
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "w-[6px] h-[6px] bg-white rounded-full animate-bounce [animation-delay:0.2s]" }),
131978
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "w-[6px] h-[6px] bg-white rounded-full animate-bounce [animation-delay:0.4s]" })
131978
131979
  ] }),
131979
131980
  /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
131980
131981
  agentData.name,
@@ -132035,7 +132036,7 @@ function Page$1({
132035
132036
  onChange: ({ target }) => setInput(target.value),
132036
132037
  placeholder: inputDisabled ? "Input disabled while agent is processing..." : "Type your message here...",
132037
132038
  className: "min-h-12 resize-none rounded-md bg-card border-0 p-3 shadow-none focus-visible:ring-0",
132038
- disabled: inputDisabled
132039
+ disabled: inputDisabled || agentData.status === "inactive"
132039
132040
  }
132040
132041
  ),
132041
132042
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center p-3 pt-0", children: [
@@ -132081,7 +132082,7 @@ function Page$1({
132081
132082
  /* @__PURE__ */ jsxRuntimeExports.jsx(
132082
132083
  Button,
132083
132084
  {
132084
- disabled: inputDisabled || selectedFiles.some((f) => f.isUploading),
132085
+ disabled: inputDisabled || agentData.status === "inactive" || selectedFiles.some((f) => f.isUploading),
132085
132086
  type: "submit",
132086
132087
  size: "sm",
132087
132088
  className: "ml-auto gap-1.5 h-[30px]",
@@ -149464,4 +149465,4 @@ clientExports.createRoot(rootElement).render(
149464
149465
  );
149465
149466
 
149466
149467
  export { Buffer as B, requireString_decoder as a, requireUtil$3 as b, requireShams$1 as c, requireCallBound as d, requireEsObjectAtoms as e, requireCallBind as f, requireGetIntrinsic as g, requireDefineDataProperty as h, requireHasPropertyDescriptors as i, requireEvents as j, requireStreamBrowserify as r };
149467
- //# sourceMappingURL=index-DLCBfFYd.js.map
149468
+ //# sourceMappingURL=index-BaWElBml.js.map