@storm-software/esbuild 0.53.242 → 0.53.244

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 (3) hide show
  1. package/README.md +1 -1
  2. package/bin/esbuild.cjs +318 -4233
  3. package/package.json +8 -8
package/bin/esbuild.cjs CHANGED
@@ -558,7 +558,7 @@ var init_tslib_es6 = __esm({
558
558
  }
559
559
  });
560
560
 
561
- // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/scanner.js
561
+ // ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/scanner.js
562
562
  function createScanner(text, ignoreTrivia = false) {
563
563
  const len = text.length;
564
564
  let pos = 0, value = "", tokenOffset = 0, token = 16, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0;
@@ -897,7 +897,7 @@ function isDigit(ch) {
897
897
  }
898
898
  var CharacterCodes;
899
899
  var init_scanner = __esm({
900
- "../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/scanner.js"() {
900
+ "../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/scanner.js"() {
901
901
  "use strict";
902
902
  (function(CharacterCodes2) {
903
903
  CharacterCodes2[CharacterCodes2["lineFeed"] = 10] = "lineFeed";
@@ -984,7 +984,43 @@ var init_scanner = __esm({
984
984
  }
985
985
  });
986
986
 
987
- // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/format.js
987
+ // ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/string-intern.js
988
+ var cachedSpaces, maxCachedValues, cachedBreakLinesWithSpaces, supportedEols;
989
+ var init_string_intern = __esm({
990
+ "../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/string-intern.js"() {
991
+ cachedSpaces = new Array(20).fill(0).map((_, index) => {
992
+ return " ".repeat(index);
993
+ });
994
+ maxCachedValues = 200;
995
+ cachedBreakLinesWithSpaces = {
996
+ " ": {
997
+ "\n": new Array(maxCachedValues).fill(0).map((_, index) => {
998
+ return "\n" + " ".repeat(index);
999
+ }),
1000
+ "\r": new Array(maxCachedValues).fill(0).map((_, index) => {
1001
+ return "\r" + " ".repeat(index);
1002
+ }),
1003
+ "\r\n": new Array(maxCachedValues).fill(0).map((_, index) => {
1004
+ return "\r\n" + " ".repeat(index);
1005
+ })
1006
+ },
1007
+ " ": {
1008
+ "\n": new Array(maxCachedValues).fill(0).map((_, index) => {
1009
+ return "\n" + " ".repeat(index);
1010
+ }),
1011
+ "\r": new Array(maxCachedValues).fill(0).map((_, index) => {
1012
+ return "\r" + " ".repeat(index);
1013
+ }),
1014
+ "\r\n": new Array(maxCachedValues).fill(0).map((_, index) => {
1015
+ return "\r\n" + " ".repeat(index);
1016
+ })
1017
+ }
1018
+ };
1019
+ supportedEols = ["\n", "\r", "\r\n"];
1020
+ }
1021
+ });
1022
+
1023
+ // ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/format.js
988
1024
  function format(documentText, range, options) {
989
1025
  let initialIndentLevel;
990
1026
  let formatText;
@@ -1012,22 +1048,30 @@ function format(documentText, range, options) {
1012
1048
  rangeEnd = documentText.length;
1013
1049
  }
1014
1050
  const eol = getEOL(options, documentText);
1051
+ const eolFastPathSupported = supportedEols.includes(eol);
1015
1052
  let numberLineBreaks = 0;
1016
1053
  let indentLevel = 0;
1017
1054
  let indentValue;
1018
1055
  if (options.insertSpaces) {
1019
- indentValue = repeat(" ", options.tabSize || 4);
1056
+ indentValue = cachedSpaces[options.tabSize || 4] ?? repeat(cachedSpaces[1], options.tabSize || 4);
1020
1057
  } else {
1021
1058
  indentValue = " ";
1022
1059
  }
1060
+ const indentType = indentValue === " " ? " " : " ";
1023
1061
  let scanner = createScanner(formatText, false);
1024
1062
  let hasError = false;
1025
1063
  function newLinesAndIndent() {
1026
1064
  if (numberLineBreaks > 1) {
1027
1065
  return repeat(eol, numberLineBreaks) + repeat(indentValue, initialIndentLevel + indentLevel);
1028
- } else {
1066
+ }
1067
+ const amountOfSpaces = indentValue.length * (initialIndentLevel + indentLevel);
1068
+ if (!eolFastPathSupported || amountOfSpaces > cachedBreakLinesWithSpaces[indentType][eol].length) {
1029
1069
  return eol + repeat(indentValue, initialIndentLevel + indentLevel);
1030
1070
  }
1071
+ if (amountOfSpaces <= 0) {
1072
+ return eol;
1073
+ }
1074
+ return cachedBreakLinesWithSpaces[indentType][eol][amountOfSpaces];
1031
1075
  }
1032
1076
  function scanNext() {
1033
1077
  let token = scanner.scan();
@@ -1055,7 +1099,7 @@ function format(documentText, range, options) {
1055
1099
  }
1056
1100
  if (firstToken !== 17) {
1057
1101
  let firstTokenStart = scanner.getTokenOffset() + formatTextStart;
1058
- let initialIndent = repeat(indentValue, initialIndentLevel);
1102
+ let initialIndent = indentValue.length * initialIndentLevel < 20 && options.insertSpaces ? cachedSpaces[indentValue.length * initialIndentLevel] : repeat(indentValue, initialIndentLevel);
1059
1103
  addEdit(initialIndent, formatTextStart, firstTokenStart);
1060
1104
  }
1061
1105
  while (firstToken !== 17) {
@@ -1065,7 +1109,7 @@ function format(documentText, range, options) {
1065
1109
  let needsLineBreak = false;
1066
1110
  while (numberLineBreaks === 0 && (secondToken === 12 || secondToken === 13)) {
1067
1111
  let commentTokenStart = scanner.getTokenOffset() + formatTextStart;
1068
- addEdit(" ", firstTokenEnd, commentTokenStart);
1112
+ addEdit(cachedSpaces[1], firstTokenEnd, commentTokenStart);
1069
1113
  firstTokenEnd = scanner.getTokenOffset() + scanner.getTokenLength() + formatTextStart;
1070
1114
  needsLineBreak = secondToken === 12;
1071
1115
  replaceContent = needsLineBreak ? newLinesAndIndent() : "";
@@ -1079,7 +1123,7 @@ function format(documentText, range, options) {
1079
1123
  if (options.keepLines && numberLineBreaks > 0 || !options.keepLines && firstToken !== 1) {
1080
1124
  replaceContent = newLinesAndIndent();
1081
1125
  } else if (options.keepLines) {
1082
- replaceContent = " ";
1126
+ replaceContent = cachedSpaces[1];
1083
1127
  }
1084
1128
  } else if (secondToken === 4) {
1085
1129
  if (firstToken !== 3) {
@@ -1089,7 +1133,7 @@ function format(documentText, range, options) {
1089
1133
  if (options.keepLines && numberLineBreaks > 0 || !options.keepLines && firstToken !== 3) {
1090
1134
  replaceContent = newLinesAndIndent();
1091
1135
  } else if (options.keepLines) {
1092
- replaceContent = " ";
1136
+ replaceContent = cachedSpaces[1];
1093
1137
  }
1094
1138
  } else {
1095
1139
  switch (firstToken) {
@@ -1099,14 +1143,14 @@ function format(documentText, range, options) {
1099
1143
  if (options.keepLines && numberLineBreaks > 0 || !options.keepLines) {
1100
1144
  replaceContent = newLinesAndIndent();
1101
1145
  } else {
1102
- replaceContent = " ";
1146
+ replaceContent = cachedSpaces[1];
1103
1147
  }
1104
1148
  break;
1105
1149
  case 5:
1106
1150
  if (options.keepLines && numberLineBreaks > 0 || !options.keepLines) {
1107
1151
  replaceContent = newLinesAndIndent();
1108
1152
  } else {
1109
- replaceContent = " ";
1153
+ replaceContent = cachedSpaces[1];
1110
1154
  }
1111
1155
  break;
1112
1156
  case 12:
@@ -1116,14 +1160,14 @@ function format(documentText, range, options) {
1116
1160
  if (numberLineBreaks > 0) {
1117
1161
  replaceContent = newLinesAndIndent();
1118
1162
  } else if (!needsLineBreak) {
1119
- replaceContent = " ";
1163
+ replaceContent = cachedSpaces[1];
1120
1164
  }
1121
1165
  break;
1122
1166
  case 6:
1123
1167
  if (options.keepLines && numberLineBreaks > 0) {
1124
1168
  replaceContent = newLinesAndIndent();
1125
1169
  } else if (!needsLineBreak) {
1126
- replaceContent = " ";
1170
+ replaceContent = cachedSpaces[1];
1127
1171
  }
1128
1172
  break;
1129
1173
  case 10:
@@ -1143,7 +1187,7 @@ function format(documentText, range, options) {
1143
1187
  replaceContent = newLinesAndIndent();
1144
1188
  } else {
1145
1189
  if ((secondToken === 12 || secondToken === 13) && !needsLineBreak) {
1146
- replaceContent = " ";
1190
+ replaceContent = cachedSpaces[1];
1147
1191
  } else if (secondToken !== 5 && secondToken !== 17) {
1148
1192
  hasError = true;
1149
1193
  }
@@ -1183,7 +1227,7 @@ function computeIndentLevel(content, options) {
1183
1227
  const tabSize = options.tabSize || 4;
1184
1228
  while (i < content.length) {
1185
1229
  let ch = content.charAt(i);
1186
- if (ch === " ") {
1230
+ if (ch === cachedSpaces[1]) {
1187
1231
  nChars++;
1188
1232
  } else if (ch === " ") {
1189
1233
  nChars += tabSize;
@@ -1212,13 +1256,14 @@ function isEOL(text, offset) {
1212
1256
  return "\r\n".indexOf(text.charAt(offset)) !== -1;
1213
1257
  }
1214
1258
  var init_format = __esm({
1215
- "../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/format.js"() {
1259
+ "../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/format.js"() {
1216
1260
  "use strict";
1217
1261
  init_scanner();
1262
+ init_string_intern();
1218
1263
  }
1219
1264
  });
1220
1265
 
1221
- // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/parser.js
1266
+ // ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/parser.js
1222
1267
  function getLocation(text, position) {
1223
1268
  const segments = [];
1224
1269
  const earlyReturnException = new Object();
@@ -1522,19 +1567,39 @@ function findNodeAtOffset(node, offset, includeRightBound = false) {
1522
1567
  function visit(text, visitor, options = ParseOptions.DEFAULT) {
1523
1568
  const _scanner = createScanner(text, false);
1524
1569
  const _jsonPath = [];
1570
+ let suppressedCallbacks = 0;
1525
1571
  function toNoArgVisit(visitFunction) {
1526
- return visitFunction ? () => visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
1527
- }
1528
- function toNoArgVisitWithPath(visitFunction) {
1529
- return visitFunction ? () => visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true;
1572
+ return visitFunction ? () => suppressedCallbacks === 0 && visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
1530
1573
  }
1531
1574
  function toOneArgVisit(visitFunction) {
1532
- return visitFunction ? (arg) => visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
1575
+ return visitFunction ? (arg) => suppressedCallbacks === 0 && visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
1533
1576
  }
1534
1577
  function toOneArgVisitWithPath(visitFunction) {
1535
- return visitFunction ? (arg) => visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true;
1578
+ return visitFunction ? (arg) => suppressedCallbacks === 0 && visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true;
1579
+ }
1580
+ function toBeginVisit(visitFunction) {
1581
+ return visitFunction ? () => {
1582
+ if (suppressedCallbacks > 0) {
1583
+ suppressedCallbacks++;
1584
+ } else {
1585
+ let cbReturn = visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice());
1586
+ if (cbReturn === false) {
1587
+ suppressedCallbacks = 1;
1588
+ }
1589
+ }
1590
+ } : () => true;
1591
+ }
1592
+ function toEndVisit(visitFunction) {
1593
+ return visitFunction ? () => {
1594
+ if (suppressedCallbacks > 0) {
1595
+ suppressedCallbacks--;
1596
+ }
1597
+ if (suppressedCallbacks === 0) {
1598
+ visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter());
1599
+ }
1600
+ } : () => true;
1536
1601
  }
1537
- const onObjectBegin = toNoArgVisitWithPath(visitor.onObjectBegin), onObjectProperty = toOneArgVisitWithPath(visitor.onObjectProperty), onObjectEnd = toNoArgVisit(visitor.onObjectEnd), onArrayBegin = toNoArgVisitWithPath(visitor.onArrayBegin), onArrayEnd = toNoArgVisit(visitor.onArrayEnd), onLiteralValue = toOneArgVisitWithPath(visitor.onLiteralValue), onSeparator = toOneArgVisit(visitor.onSeparator), onComment = toNoArgVisit(visitor.onComment), onError = toOneArgVisit(visitor.onError);
1602
+ const onObjectBegin = toBeginVisit(visitor.onObjectBegin), onObjectProperty = toOneArgVisitWithPath(visitor.onObjectProperty), onObjectEnd = toEndVisit(visitor.onObjectEnd), onArrayBegin = toBeginVisit(visitor.onArrayBegin), onArrayEnd = toEndVisit(visitor.onArrayEnd), onLiteralValue = toOneArgVisitWithPath(visitor.onLiteralValue), onSeparator = toOneArgVisit(visitor.onSeparator), onComment = toNoArgVisit(visitor.onComment), onError = toOneArgVisit(visitor.onError);
1538
1603
  const disallowComments = options && options.disallowComments;
1539
1604
  const allowTrailingComma = options && options.allowTrailingComma;
1540
1605
  function scanNext() {
@@ -1847,7 +1912,7 @@ function getNodeType(value) {
1847
1912
  }
1848
1913
  var ParseOptions;
1849
1914
  var init_parser = __esm({
1850
- "../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/parser.js"() {
1915
+ "../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/parser.js"() {
1851
1916
  "use strict";
1852
1917
  init_scanner();
1853
1918
  (function(ParseOptions2) {
@@ -1858,7 +1923,7 @@ var init_parser = __esm({
1858
1923
  }
1859
1924
  });
1860
1925
 
1861
- // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/edit.js
1926
+ // ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/edit.js
1862
1927
  function setProperty(text, originalPath, value, options) {
1863
1928
  const path = originalPath.slice();
1864
1929
  const errors = [];
@@ -2002,14 +2067,14 @@ function applyEdit(text, edit) {
2002
2067
  return text.substring(0, edit.offset) + edit.content + text.substring(edit.offset + edit.length);
2003
2068
  }
2004
2069
  var init_edit = __esm({
2005
- "../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/edit.js"() {
2070
+ "../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/edit.js"() {
2006
2071
  "use strict";
2007
2072
  init_format();
2008
2073
  init_parser();
2009
2074
  }
2010
2075
  });
2011
2076
 
2012
- // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/main.js
2077
+ // ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/main.js
2013
2078
  var main_exports = {};
2014
2079
  __export(main_exports, {
2015
2080
  ParseErrorCode: () => ParseErrorCode,
@@ -2095,7 +2160,7 @@ function applyEdits(text, edits) {
2095
2160
  }
2096
2161
  var createScanner2, ScanError, SyntaxKind, getLocation2, parse2, parseTree2, findNodeAtLocation2, findNodeAtOffset2, getNodePath2, getNodeValue2, visit2, stripComments2, ParseErrorCode;
2097
2162
  var init_main = __esm({
2098
- "../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/main.js"() {
2163
+ "../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/main.js"() {
2099
2164
  "use strict";
2100
2165
  init_format();
2101
2166
  init_edit();
@@ -2207,4183 +2272,241 @@ var require_build = __commonJS({
2207
2272
  return { line, column };
2208
2273
  };
2209
2274
  LinesAndColumns2.prototype.indexForLocation = function(location) {
2210
- var line = location.line, column = location.column;
2211
- if (line < 0 || line >= this.offsets.length) {
2212
- return null;
2213
- }
2214
- if (column < 0 || column > this.lengthOfLine(line)) {
2215
- return null;
2216
- }
2217
- return this.offsets[line] + column;
2218
- };
2219
- LinesAndColumns2.prototype.lengthOfLine = function(line) {
2220
- var offset = this.offsets[line];
2221
- var nextOffset = line === this.offsets.length - 1 ? this.length : this.offsets[line + 1];
2222
- return nextOffset - offset;
2223
- };
2224
- return LinesAndColumns2;
2225
- })()
2226
- );
2227
- exports2.LinesAndColumns = LinesAndColumns;
2228
- }
2229
- });
2230
-
2231
- // ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
2232
- var require_picocolors = __commonJS({
2233
- "../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports2, module2) {
2234
- var p = process || {};
2235
- var argv = p.argv || [];
2236
- var env = p.env || {};
2237
- var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
2238
- var formatter = (open, close, replace = open) => (input) => {
2239
- let string = "" + input, index = string.indexOf(close, open.length);
2240
- return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
2241
- };
2242
- var replaceClose = (string, close, replace, index) => {
2243
- let result = "", cursor = 0;
2244
- do {
2245
- result += string.substring(cursor, index) + replace;
2246
- cursor = index + close.length;
2247
- index = string.indexOf(close, cursor);
2248
- } while (~index);
2249
- return result + string.substring(cursor);
2250
- };
2251
- var createColors = (enabled = isColorSupported) => {
2252
- let f = enabled ? formatter : () => String;
2253
- return {
2254
- isColorSupported: enabled,
2255
- reset: f("\x1B[0m", "\x1B[0m"),
2256
- bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
2257
- dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
2258
- italic: f("\x1B[3m", "\x1B[23m"),
2259
- underline: f("\x1B[4m", "\x1B[24m"),
2260
- inverse: f("\x1B[7m", "\x1B[27m"),
2261
- hidden: f("\x1B[8m", "\x1B[28m"),
2262
- strikethrough: f("\x1B[9m", "\x1B[29m"),
2263
- black: f("\x1B[30m", "\x1B[39m"),
2264
- red: f("\x1B[31m", "\x1B[39m"),
2265
- green: f("\x1B[32m", "\x1B[39m"),
2266
- yellow: f("\x1B[33m", "\x1B[39m"),
2267
- blue: f("\x1B[34m", "\x1B[39m"),
2268
- magenta: f("\x1B[35m", "\x1B[39m"),
2269
- cyan: f("\x1B[36m", "\x1B[39m"),
2270
- white: f("\x1B[37m", "\x1B[39m"),
2271
- gray: f("\x1B[90m", "\x1B[39m"),
2272
- bgBlack: f("\x1B[40m", "\x1B[49m"),
2273
- bgRed: f("\x1B[41m", "\x1B[49m"),
2274
- bgGreen: f("\x1B[42m", "\x1B[49m"),
2275
- bgYellow: f("\x1B[43m", "\x1B[49m"),
2276
- bgBlue: f("\x1B[44m", "\x1B[49m"),
2277
- bgMagenta: f("\x1B[45m", "\x1B[49m"),
2278
- bgCyan: f("\x1B[46m", "\x1B[49m"),
2279
- bgWhite: f("\x1B[47m", "\x1B[49m"),
2280
- blackBright: f("\x1B[90m", "\x1B[39m"),
2281
- redBright: f("\x1B[91m", "\x1B[39m"),
2282
- greenBright: f("\x1B[92m", "\x1B[39m"),
2283
- yellowBright: f("\x1B[93m", "\x1B[39m"),
2284
- blueBright: f("\x1B[94m", "\x1B[39m"),
2285
- magentaBright: f("\x1B[95m", "\x1B[39m"),
2286
- cyanBright: f("\x1B[96m", "\x1B[39m"),
2287
- whiteBright: f("\x1B[97m", "\x1B[39m"),
2288
- bgBlackBright: f("\x1B[100m", "\x1B[49m"),
2289
- bgRedBright: f("\x1B[101m", "\x1B[49m"),
2290
- bgGreenBright: f("\x1B[102m", "\x1B[49m"),
2291
- bgYellowBright: f("\x1B[103m", "\x1B[49m"),
2292
- bgBlueBright: f("\x1B[104m", "\x1B[49m"),
2293
- bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
2294
- bgCyanBright: f("\x1B[106m", "\x1B[49m"),
2295
- bgWhiteBright: f("\x1B[107m", "\x1B[49m")
2296
- };
2297
- };
2298
- module2.exports = createColors();
2299
- module2.exports.createColors = createColors;
2300
- }
2301
- });
2302
-
2303
- // ../../node_modules/.pnpm/nx@22.7.5_@swc-node+register@1.10.9_@swc+core@1.7.26_@swc+helpers@0.5.13__@swc+types@0._8bd88bec35363f4dee6e8456b6c0b9be/node_modules/nx/dist/src/utils/code-frames.js
2304
- var require_code_frames = __commonJS({
2305
- "../../node_modules/.pnpm/nx@22.7.5_@swc-node+register@1.10.9_@swc+core@1.7.26_@swc+helpers@0.5.13__@swc+types@0._8bd88bec35363f4dee6e8456b6c0b9be/node_modules/nx/dist/src/utils/code-frames.js"(exports2) {
2306
- "use strict";
2307
- Object.defineProperty(exports2, "__esModule", { value: true });
2308
- exports2.codeFrameColumns = codeFrameColumns;
2309
- var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
2310
- var pc = tslib_1.__importStar(require_picocolors());
2311
- var defs = {
2312
- gutter: pc.gray,
2313
- marker: (text) => pc.red(pc.bold(text)),
2314
- message: (text) => pc.red(pc.bold(text))
2315
- };
2316
- var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
2317
- function getMarkerLines(loc, source, opts = {}) {
2318
- const startLoc = {
2319
- column: 0,
2320
- line: -1,
2321
- ...loc.start
2322
- };
2323
- const endLoc = {
2324
- ...startLoc,
2325
- ...loc.end
2326
- };
2327
- const { linesAbove = 2, linesBelow = 3 } = opts || {};
2328
- const startLine = startLoc.line;
2329
- const startColumn = startLoc.column;
2330
- const endLine = endLoc.line;
2331
- const endColumn = endLoc.column;
2332
- let start = Math.max(startLine - (linesAbove + 1), 0);
2333
- let end = Math.min(source.length, endLine + linesBelow);
2334
- if (startLine === -1) {
2335
- start = 0;
2336
- }
2337
- if (endLine === -1) {
2338
- end = source.length;
2339
- }
2340
- const lineDiff = endLine - startLine;
2341
- const markerLines = {};
2342
- if (lineDiff) {
2343
- for (let i = 0; i <= lineDiff; i++) {
2344
- const lineNumber = i + startLine;
2345
- if (!startColumn) {
2346
- markerLines[lineNumber] = true;
2347
- } else if (i === 0) {
2348
- const sourceLength = source[lineNumber - 1].length;
2349
- markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
2350
- } else if (i === lineDiff) {
2351
- markerLines[lineNumber] = [0, endColumn];
2352
- } else {
2353
- const sourceLength = source[lineNumber - i].length;
2354
- markerLines[lineNumber] = [0, sourceLength];
2355
- }
2356
- }
2357
- } else {
2358
- if (startColumn === endColumn) {
2359
- if (startColumn) {
2360
- markerLines[startLine] = [startColumn, 0];
2361
- } else {
2362
- markerLines[startLine] = true;
2363
- }
2364
- } else {
2365
- markerLines[startLine] = [startColumn, endColumn - startColumn];
2366
- }
2367
- }
2368
- return { start, end, markerLines };
2369
- }
2370
- function codeFrameColumns(rawLines, loc, opts = {}) {
2371
- const lines = rawLines.split(NEWLINE);
2372
- const { start, end, markerLines } = getMarkerLines(loc, lines, opts);
2373
- const numberMaxWidth = String(end).length;
2374
- const highlightedLines = opts.highlight ? opts.highlight(rawLines) : rawLines;
2375
- let frame = highlightedLines.split(NEWLINE).slice(start, end).map((line, index) => {
2376
- const number = start + 1 + index;
2377
- const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
2378
- const gutter = ` ${paddedNumber} | `;
2379
- const hasMarker = markerLines[number];
2380
- if (hasMarker) {
2381
- let markerLine = "";
2382
- if (Array.isArray(hasMarker)) {
2383
- const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
2384
- const numberOfMarkers = hasMarker[1] || 1;
2385
- markerLine = [
2386
- "\n ",
2387
- defs.gutter(gutter.replace(/\d/g, " ")),
2388
- markerSpacing,
2389
- defs.marker("^").repeat(numberOfMarkers)
2390
- ].join("");
2391
- }
2392
- return [defs.marker(">"), defs.gutter(gutter), line, markerLine].join("");
2393
- } else {
2394
- return ` ${defs.gutter(gutter)}${line}`;
2395
- }
2396
- }).join("\n");
2397
- return pc.reset(frame);
2398
- }
2399
- }
2400
- });
2401
-
2402
- // ../../node_modules/.pnpm/nx@22.7.5_@swc-node+register@1.10.9_@swc+core@1.7.26_@swc+helpers@0.5.13__@swc+types@0._8bd88bec35363f4dee6e8456b6c0b9be/node_modules/nx/dist/src/utils/json.js
2403
- var require_json = __commonJS({
2404
- "../../node_modules/.pnpm/nx@22.7.5_@swc-node+register@1.10.9_@swc+core@1.7.26_@swc+helpers@0.5.13__@swc+types@0._8bd88bec35363f4dee6e8456b6c0b9be/node_modules/nx/dist/src/utils/json.js"(exports2) {
2405
- "use strict";
2406
- Object.defineProperty(exports2, "__esModule", { value: true });
2407
- exports2.stripJsonComments = void 0;
2408
- exports2.parseJson = parseJson;
2409
- exports2.serializeJson = serializeJson;
2410
- var jsonc_parser_1 = (init_main(), __toCommonJS(main_exports));
2411
- Object.defineProperty(exports2, "stripJsonComments", { enumerable: true, get: function() {
2412
- return jsonc_parser_1.stripComments;
2413
- } });
2414
- var lines_and_columns_1 = require_build();
2415
- var code_frames_1 = require_code_frames();
2416
- function parseJson(input, options) {
2417
- try {
2418
- if (options?.expectComments !== true) {
2419
- return JSON.parse(input);
2420
- }
2421
- } catch {
2422
- }
2423
- options = { allowTrailingComma: true, ...options };
2424
- const errors = [];
2425
- const result = (0, jsonc_parser_1.parse)(input, errors, options);
2426
- if (errors.length > 0) {
2427
- throw new Error(formatParseError(input, errors[0]));
2428
- }
2429
- return result;
2430
- }
2431
- function formatParseError(input, parseError) {
2432
- const { error, offset, length } = parseError;
2433
- let { line, column } = new lines_and_columns_1.LinesAndColumns(input).locationForIndex(offset);
2434
- line++;
2435
- column++;
2436
- return `${(0, jsonc_parser_1.printParseErrorCode)(error)} in JSON at ${line}:${column}
2437
- ` + (0, code_frames_1.codeFrameColumns)(input, {
2438
- start: { line, column },
2439
- end: { line, column: column + length }
2440
- }) + "\n";
2441
- }
2442
- function serializeJson(input, options) {
2443
- return JSON.stringify(input, null, options?.spaces ?? 2);
2444
- }
2445
- }
2446
- });
2447
-
2448
- // ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/stream.js
2449
- var require_stream = __commonJS({
2450
- "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/stream.js"(exports2, module2) {
2451
- module2.exports = require("stream");
2452
- }
2453
- });
2454
-
2455
- // ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/buffer_list.js
2456
- var require_buffer_list = __commonJS({
2457
- "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/buffer_list.js"(exports2, module2) {
2458
- "use strict";
2459
- function ownKeys2(object, enumerableOnly) {
2460
- var keys = Object.keys(object);
2461
- if (Object.getOwnPropertySymbols) {
2462
- var symbols = Object.getOwnPropertySymbols(object);
2463
- enumerableOnly && (symbols = symbols.filter(function(sym) {
2464
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
2465
- })), keys.push.apply(keys, symbols);
2466
- }
2467
- return keys;
2468
- }
2469
- function _objectSpread(target) {
2470
- for (var i = 1; i < arguments.length; i++) {
2471
- var source = null != arguments[i] ? arguments[i] : {};
2472
- i % 2 ? ownKeys2(Object(source), true).forEach(function(key) {
2473
- _defineProperty(target, key, source[key]);
2474
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys2(Object(source)).forEach(function(key) {
2475
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2476
- });
2477
- }
2478
- return target;
2479
- }
2480
- function _defineProperty(obj, key, value) {
2481
- key = _toPropertyKey(key);
2482
- if (key in obj) {
2483
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
2484
- } else {
2485
- obj[key] = value;
2486
- }
2487
- return obj;
2488
- }
2489
- function _classCallCheck(instance, Constructor) {
2490
- if (!(instance instanceof Constructor)) {
2491
- throw new TypeError("Cannot call a class as a function");
2492
- }
2493
- }
2494
- function _defineProperties(target, props) {
2495
- for (var i = 0; i < props.length; i++) {
2496
- var descriptor = props[i];
2497
- descriptor.enumerable = descriptor.enumerable || false;
2498
- descriptor.configurable = true;
2499
- if ("value" in descriptor) descriptor.writable = true;
2500
- Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
2501
- }
2502
- }
2503
- function _createClass(Constructor, protoProps, staticProps) {
2504
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
2505
- if (staticProps) _defineProperties(Constructor, staticProps);
2506
- Object.defineProperty(Constructor, "prototype", { writable: false });
2507
- return Constructor;
2508
- }
2509
- function _toPropertyKey(arg) {
2510
- var key = _toPrimitive(arg, "string");
2511
- return typeof key === "symbol" ? key : String(key);
2512
- }
2513
- function _toPrimitive(input, hint) {
2514
- if (typeof input !== "object" || input === null) return input;
2515
- var prim = input[Symbol.toPrimitive];
2516
- if (prim !== void 0) {
2517
- var res = prim.call(input, hint || "default");
2518
- if (typeof res !== "object") return res;
2519
- throw new TypeError("@@toPrimitive must return a primitive value.");
2520
- }
2521
- return (hint === "string" ? String : Number)(input);
2522
- }
2523
- var _require = require("buffer");
2524
- var Buffer2 = _require.Buffer;
2525
- var _require2 = require("util");
2526
- var inspect = _require2.inspect;
2527
- var custom = inspect && inspect.custom || "inspect";
2528
- function copyBuffer(src, target, offset) {
2529
- Buffer2.prototype.copy.call(src, target, offset);
2530
- }
2531
- module2.exports = /* @__PURE__ */ (function() {
2532
- function BufferList() {
2533
- _classCallCheck(this, BufferList);
2534
- this.head = null;
2535
- this.tail = null;
2536
- this.length = 0;
2537
- }
2538
- _createClass(BufferList, [{
2539
- key: "push",
2540
- value: function push(v) {
2541
- var entry = {
2542
- data: v,
2543
- next: null
2544
- };
2545
- if (this.length > 0) this.tail.next = entry;
2546
- else this.head = entry;
2547
- this.tail = entry;
2548
- ++this.length;
2549
- }
2550
- }, {
2551
- key: "unshift",
2552
- value: function unshift(v) {
2553
- var entry = {
2554
- data: v,
2555
- next: this.head
2556
- };
2557
- if (this.length === 0) this.tail = entry;
2558
- this.head = entry;
2559
- ++this.length;
2560
- }
2561
- }, {
2562
- key: "shift",
2563
- value: function shift() {
2564
- if (this.length === 0) return;
2565
- var ret = this.head.data;
2566
- if (this.length === 1) this.head = this.tail = null;
2567
- else this.head = this.head.next;
2568
- --this.length;
2569
- return ret;
2570
- }
2571
- }, {
2572
- key: "clear",
2573
- value: function clear() {
2574
- this.head = this.tail = null;
2575
- this.length = 0;
2576
- }
2577
- }, {
2578
- key: "join",
2579
- value: function join(s) {
2580
- if (this.length === 0) return "";
2581
- var p = this.head;
2582
- var ret = "" + p.data;
2583
- while (p = p.next) ret += s + p.data;
2584
- return ret;
2585
- }
2586
- }, {
2587
- key: "concat",
2588
- value: function concat(n) {
2589
- if (this.length === 0) return Buffer2.alloc(0);
2590
- var ret = Buffer2.allocUnsafe(n >>> 0);
2591
- var p = this.head;
2592
- var i = 0;
2593
- while (p) {
2594
- copyBuffer(p.data, ret, i);
2595
- i += p.data.length;
2596
- p = p.next;
2597
- }
2598
- return ret;
2599
- }
2600
- // Consumes a specified amount of bytes or characters from the buffered data.
2601
- }, {
2602
- key: "consume",
2603
- value: function consume(n, hasStrings) {
2604
- var ret;
2605
- if (n < this.head.data.length) {
2606
- ret = this.head.data.slice(0, n);
2607
- this.head.data = this.head.data.slice(n);
2608
- } else if (n === this.head.data.length) {
2609
- ret = this.shift();
2610
- } else {
2611
- ret = hasStrings ? this._getString(n) : this._getBuffer(n);
2612
- }
2613
- return ret;
2614
- }
2615
- }, {
2616
- key: "first",
2617
- value: function first() {
2618
- return this.head.data;
2619
- }
2620
- // Consumes a specified amount of characters from the buffered data.
2621
- }, {
2622
- key: "_getString",
2623
- value: function _getString(n) {
2624
- var p = this.head;
2625
- var c = 1;
2626
- var ret = p.data;
2627
- n -= ret.length;
2628
- while (p = p.next) {
2629
- var str = p.data;
2630
- var nb = n > str.length ? str.length : n;
2631
- if (nb === str.length) ret += str;
2632
- else ret += str.slice(0, n);
2633
- n -= nb;
2634
- if (n === 0) {
2635
- if (nb === str.length) {
2636
- ++c;
2637
- if (p.next) this.head = p.next;
2638
- else this.head = this.tail = null;
2639
- } else {
2640
- this.head = p;
2641
- p.data = str.slice(nb);
2642
- }
2643
- break;
2644
- }
2645
- ++c;
2646
- }
2647
- this.length -= c;
2648
- return ret;
2649
- }
2650
- // Consumes a specified amount of bytes from the buffered data.
2651
- }, {
2652
- key: "_getBuffer",
2653
- value: function _getBuffer(n) {
2654
- var ret = Buffer2.allocUnsafe(n);
2655
- var p = this.head;
2656
- var c = 1;
2657
- p.data.copy(ret);
2658
- n -= p.data.length;
2659
- while (p = p.next) {
2660
- var buf = p.data;
2661
- var nb = n > buf.length ? buf.length : n;
2662
- buf.copy(ret, ret.length - n, 0, nb);
2663
- n -= nb;
2664
- if (n === 0) {
2665
- if (nb === buf.length) {
2666
- ++c;
2667
- if (p.next) this.head = p.next;
2668
- else this.head = this.tail = null;
2669
- } else {
2670
- this.head = p;
2671
- p.data = buf.slice(nb);
2672
- }
2673
- break;
2674
- }
2675
- ++c;
2676
- }
2677
- this.length -= c;
2678
- return ret;
2679
- }
2680
- // Make sure the linked list only shows the minimal necessary information.
2681
- }, {
2682
- key: custom,
2683
- value: function value(_, options) {
2684
- return inspect(this, _objectSpread(_objectSpread({}, options), {}, {
2685
- // Only inspect one level.
2686
- depth: 0,
2687
- // It should not recurse.
2688
- customInspect: false
2689
- }));
2690
- }
2691
- }]);
2692
- return BufferList;
2693
- })();
2694
- }
2695
- });
2696
-
2697
- // ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/destroy.js
2698
- var require_destroy = __commonJS({
2699
- "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/destroy.js"(exports2, module2) {
2700
- "use strict";
2701
- function destroy(err, cb) {
2702
- var _this = this;
2703
- var readableDestroyed = this._readableState && this._readableState.destroyed;
2704
- var writableDestroyed = this._writableState && this._writableState.destroyed;
2705
- if (readableDestroyed || writableDestroyed) {
2706
- if (cb) {
2707
- cb(err);
2708
- } else if (err) {
2709
- if (!this._writableState) {
2710
- process.nextTick(emitErrorNT, this, err);
2711
- } else if (!this._writableState.errorEmitted) {
2712
- this._writableState.errorEmitted = true;
2713
- process.nextTick(emitErrorNT, this, err);
2714
- }
2715
- }
2716
- return this;
2717
- }
2718
- if (this._readableState) {
2719
- this._readableState.destroyed = true;
2720
- }
2721
- if (this._writableState) {
2722
- this._writableState.destroyed = true;
2723
- }
2724
- this._destroy(err || null, function(err2) {
2725
- if (!cb && err2) {
2726
- if (!_this._writableState) {
2727
- process.nextTick(emitErrorAndCloseNT, _this, err2);
2728
- } else if (!_this._writableState.errorEmitted) {
2729
- _this._writableState.errorEmitted = true;
2730
- process.nextTick(emitErrorAndCloseNT, _this, err2);
2731
- } else {
2732
- process.nextTick(emitCloseNT, _this);
2733
- }
2734
- } else if (cb) {
2735
- process.nextTick(emitCloseNT, _this);
2736
- cb(err2);
2737
- } else {
2738
- process.nextTick(emitCloseNT, _this);
2739
- }
2740
- });
2741
- return this;
2742
- }
2743
- function emitErrorAndCloseNT(self2, err) {
2744
- emitErrorNT(self2, err);
2745
- emitCloseNT(self2);
2746
- }
2747
- function emitCloseNT(self2) {
2748
- if (self2._writableState && !self2._writableState.emitClose) return;
2749
- if (self2._readableState && !self2._readableState.emitClose) return;
2750
- self2.emit("close");
2751
- }
2752
- function undestroy() {
2753
- if (this._readableState) {
2754
- this._readableState.destroyed = false;
2755
- this._readableState.reading = false;
2756
- this._readableState.ended = false;
2757
- this._readableState.endEmitted = false;
2758
- }
2759
- if (this._writableState) {
2760
- this._writableState.destroyed = false;
2761
- this._writableState.ended = false;
2762
- this._writableState.ending = false;
2763
- this._writableState.finalCalled = false;
2764
- this._writableState.prefinished = false;
2765
- this._writableState.finished = false;
2766
- this._writableState.errorEmitted = false;
2767
- }
2768
- }
2769
- function emitErrorNT(self2, err) {
2770
- self2.emit("error", err);
2771
- }
2772
- function errorOrDestroy(stream, err) {
2773
- var rState = stream._readableState;
2774
- var wState = stream._writableState;
2775
- if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);
2776
- else stream.emit("error", err);
2777
- }
2778
- module2.exports = {
2779
- destroy,
2780
- undestroy,
2781
- errorOrDestroy
2782
- };
2783
- }
2784
- });
2785
-
2786
- // ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/errors.js
2787
- var require_errors = __commonJS({
2788
- "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/errors.js"(exports2, module2) {
2789
- "use strict";
2790
- var codes = {};
2791
- function createErrorType(code, message, Base) {
2792
- if (!Base) {
2793
- Base = Error;
2794
- }
2795
- function getMessage(arg1, arg2, arg3) {
2796
- if (typeof message === "string") {
2797
- return message;
2798
- } else {
2799
- return message(arg1, arg2, arg3);
2800
- }
2801
- }
2802
- class NodeError extends Base {
2803
- constructor(arg1, arg2, arg3) {
2804
- super(getMessage(arg1, arg2, arg3));
2805
- }
2806
- }
2807
- NodeError.prototype.name = Base.name;
2808
- NodeError.prototype.code = code;
2809
- codes[code] = NodeError;
2810
- }
2811
- function oneOf(expected, thing) {
2812
- if (Array.isArray(expected)) {
2813
- const len = expected.length;
2814
- expected = expected.map((i) => String(i));
2815
- if (len > 2) {
2816
- return `one of ${thing} ${expected.slice(0, len - 1).join(", ")}, or ` + expected[len - 1];
2817
- } else if (len === 2) {
2818
- return `one of ${thing} ${expected[0]} or ${expected[1]}`;
2819
- } else {
2820
- return `of ${thing} ${expected[0]}`;
2821
- }
2822
- } else {
2823
- return `of ${thing} ${String(expected)}`;
2824
- }
2825
- }
2826
- function startsWith(str, search, pos) {
2827
- return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
2828
- }
2829
- function endsWith(str, search, this_len) {
2830
- if (this_len === void 0 || this_len > str.length) {
2831
- this_len = str.length;
2832
- }
2833
- return str.substring(this_len - search.length, this_len) === search;
2834
- }
2835
- function includes(str, search, start) {
2836
- if (typeof start !== "number") {
2837
- start = 0;
2838
- }
2839
- if (start + search.length > str.length) {
2840
- return false;
2841
- } else {
2842
- return str.indexOf(search, start) !== -1;
2843
- }
2844
- }
2845
- createErrorType("ERR_INVALID_OPT_VALUE", function(name, value) {
2846
- return 'The value "' + value + '" is invalid for option "' + name + '"';
2847
- }, TypeError);
2848
- createErrorType("ERR_INVALID_ARG_TYPE", function(name, expected, actual) {
2849
- let determiner;
2850
- if (typeof expected === "string" && startsWith(expected, "not ")) {
2851
- determiner = "must not be";
2852
- expected = expected.replace(/^not /, "");
2853
- } else {
2854
- determiner = "must be";
2855
- }
2856
- let msg;
2857
- if (endsWith(name, " argument")) {
2858
- msg = `The ${name} ${determiner} ${oneOf(expected, "type")}`;
2859
- } else {
2860
- const type = includes(name, ".") ? "property" : "argument";
2861
- msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, "type")}`;
2862
- }
2863
- msg += `. Received type ${typeof actual}`;
2864
- return msg;
2865
- }, TypeError);
2866
- createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
2867
- createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name) {
2868
- return "The " + name + " method is not implemented";
2869
- });
2870
- createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
2871
- createErrorType("ERR_STREAM_DESTROYED", function(name) {
2872
- return "Cannot call " + name + " after a stream was destroyed";
2873
- });
2874
- createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
2875
- createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
2876
- createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end");
2877
- createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError);
2878
- createErrorType("ERR_UNKNOWN_ENCODING", function(arg) {
2879
- return "Unknown encoding: " + arg;
2880
- }, TypeError);
2881
- createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event");
2882
- module2.exports.codes = codes;
2883
- }
2884
- });
2885
-
2886
- // ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/state.js
2887
- var require_state = __commonJS({
2888
- "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/state.js"(exports2, module2) {
2889
- "use strict";
2890
- var ERR_INVALID_OPT_VALUE = require_errors().codes.ERR_INVALID_OPT_VALUE;
2891
- function highWaterMarkFrom(options, isDuplex, duplexKey) {
2892
- return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;
2893
- }
2894
- function getHighWaterMark(state, options, duplexKey, isDuplex) {
2895
- var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
2896
- if (hwm != null) {
2897
- if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
2898
- var name = isDuplex ? duplexKey : "highWaterMark";
2899
- throw new ERR_INVALID_OPT_VALUE(name, hwm);
2900
- }
2901
- return Math.floor(hwm);
2902
- }
2903
- return state.objectMode ? 16 : 16 * 1024;
2904
- }
2905
- module2.exports = {
2906
- getHighWaterMark
2907
- };
2908
- }
2909
- });
2910
-
2911
- // ../../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js
2912
- var require_inherits_browser = __commonJS({
2913
- "../../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js"(exports2, module2) {
2914
- if (typeof Object.create === "function") {
2915
- module2.exports = function inherits(ctor, superCtor) {
2916
- if (superCtor) {
2917
- ctor.super_ = superCtor;
2918
- ctor.prototype = Object.create(superCtor.prototype, {
2919
- constructor: {
2920
- value: ctor,
2921
- enumerable: false,
2922
- writable: true,
2923
- configurable: true
2924
- }
2925
- });
2926
- }
2927
- };
2928
- } else {
2929
- module2.exports = function inherits(ctor, superCtor) {
2930
- if (superCtor) {
2931
- ctor.super_ = superCtor;
2932
- var TempCtor = function() {
2933
- };
2934
- TempCtor.prototype = superCtor.prototype;
2935
- ctor.prototype = new TempCtor();
2936
- ctor.prototype.constructor = ctor;
2937
- }
2938
- };
2939
- }
2940
- }
2941
- });
2942
-
2943
- // ../../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits.js
2944
- var require_inherits = __commonJS({
2945
- "../../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits.js"(exports2, module2) {
2946
- try {
2947
- util = require("util");
2948
- if (typeof util.inherits !== "function") throw "";
2949
- module2.exports = util.inherits;
2950
- } catch (e) {
2951
- module2.exports = require_inherits_browser();
2952
- }
2953
- var util;
2954
- }
2955
- });
2956
-
2957
- // ../../node_modules/.pnpm/util-deprecate@1.0.2/node_modules/util-deprecate/node.js
2958
- var require_node = __commonJS({
2959
- "../../node_modules/.pnpm/util-deprecate@1.0.2/node_modules/util-deprecate/node.js"(exports2, module2) {
2960
- module2.exports = require("util").deprecate;
2961
- }
2962
- });
2963
-
2964
- // ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_writable.js
2965
- var require_stream_writable = __commonJS({
2966
- "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_writable.js"(exports2, module2) {
2967
- "use strict";
2968
- module2.exports = Writable;
2969
- function CorkedRequest(state) {
2970
- var _this = this;
2971
- this.next = null;
2972
- this.entry = null;
2973
- this.finish = function() {
2974
- onCorkedFinish(_this, state);
2975
- };
2976
- }
2977
- var Duplex;
2978
- Writable.WritableState = WritableState;
2979
- var internalUtil = {
2980
- deprecate: require_node()
2981
- };
2982
- var Stream = require_stream();
2983
- var Buffer2 = require("buffer").Buffer;
2984
- var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
2985
- };
2986
- function _uint8ArrayToBuffer(chunk) {
2987
- return Buffer2.from(chunk);
2988
- }
2989
- function _isUint8Array(obj) {
2990
- return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array;
2991
- }
2992
- var destroyImpl = require_destroy();
2993
- var _require = require_state();
2994
- var getHighWaterMark = _require.getHighWaterMark;
2995
- var _require$codes = require_errors().codes;
2996
- var ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE;
2997
- var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED;
2998
- var ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK;
2999
- var ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE;
3000
- var ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
3001
- var ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES;
3002
- var ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END;
3003
- var ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;
3004
- var errorOrDestroy = destroyImpl.errorOrDestroy;
3005
- require_inherits()(Writable, Stream);
3006
- function nop() {
3007
- }
3008
- function WritableState(options, stream, isDuplex) {
3009
- Duplex = Duplex || require_stream_duplex();
3010
- options = options || {};
3011
- if (typeof isDuplex !== "boolean") isDuplex = stream instanceof Duplex;
3012
- this.objectMode = !!options.objectMode;
3013
- if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
3014
- this.highWaterMark = getHighWaterMark(this, options, "writableHighWaterMark", isDuplex);
3015
- this.finalCalled = false;
3016
- this.needDrain = false;
3017
- this.ending = false;
3018
- this.ended = false;
3019
- this.finished = false;
3020
- this.destroyed = false;
3021
- var noDecode = options.decodeStrings === false;
3022
- this.decodeStrings = !noDecode;
3023
- this.defaultEncoding = options.defaultEncoding || "utf8";
3024
- this.length = 0;
3025
- this.writing = false;
3026
- this.corked = 0;
3027
- this.sync = true;
3028
- this.bufferProcessing = false;
3029
- this.onwrite = function(er) {
3030
- onwrite(stream, er);
3031
- };
3032
- this.writecb = null;
3033
- this.writelen = 0;
3034
- this.bufferedRequest = null;
3035
- this.lastBufferedRequest = null;
3036
- this.pendingcb = 0;
3037
- this.prefinished = false;
3038
- this.errorEmitted = false;
3039
- this.emitClose = options.emitClose !== false;
3040
- this.autoDestroy = !!options.autoDestroy;
3041
- this.bufferedRequestCount = 0;
3042
- this.corkedRequestsFree = new CorkedRequest(this);
3043
- }
3044
- WritableState.prototype.getBuffer = function getBuffer() {
3045
- var current = this.bufferedRequest;
3046
- var out = [];
3047
- while (current) {
3048
- out.push(current);
3049
- current = current.next;
3050
- }
3051
- return out;
3052
- };
3053
- (function() {
3054
- try {
3055
- Object.defineProperty(WritableState.prototype, "buffer", {
3056
- get: internalUtil.deprecate(function writableStateBufferGetter() {
3057
- return this.getBuffer();
3058
- }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003")
3059
- });
3060
- } catch (_) {
3061
- }
3062
- })();
3063
- var realHasInstance;
3064
- if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") {
3065
- realHasInstance = Function.prototype[Symbol.hasInstance];
3066
- Object.defineProperty(Writable, Symbol.hasInstance, {
3067
- value: function value(object) {
3068
- if (realHasInstance.call(this, object)) return true;
3069
- if (this !== Writable) return false;
3070
- return object && object._writableState instanceof WritableState;
3071
- }
3072
- });
3073
- } else {
3074
- realHasInstance = function realHasInstance2(object) {
3075
- return object instanceof this;
3076
- };
3077
- }
3078
- function Writable(options) {
3079
- Duplex = Duplex || require_stream_duplex();
3080
- var isDuplex = this instanceof Duplex;
3081
- if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options);
3082
- this._writableState = new WritableState(options, this, isDuplex);
3083
- this.writable = true;
3084
- if (options) {
3085
- if (typeof options.write === "function") this._write = options.write;
3086
- if (typeof options.writev === "function") this._writev = options.writev;
3087
- if (typeof options.destroy === "function") this._destroy = options.destroy;
3088
- if (typeof options.final === "function") this._final = options.final;
3089
- }
3090
- Stream.call(this);
3091
- }
3092
- Writable.prototype.pipe = function() {
3093
- errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE());
3094
- };
3095
- function writeAfterEnd(stream, cb) {
3096
- var er = new ERR_STREAM_WRITE_AFTER_END();
3097
- errorOrDestroy(stream, er);
3098
- process.nextTick(cb, er);
3099
- }
3100
- function validChunk(stream, state, chunk, cb) {
3101
- var er;
3102
- if (chunk === null) {
3103
- er = new ERR_STREAM_NULL_VALUES();
3104
- } else if (typeof chunk !== "string" && !state.objectMode) {
3105
- er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer"], chunk);
3106
- }
3107
- if (er) {
3108
- errorOrDestroy(stream, er);
3109
- process.nextTick(cb, er);
3110
- return false;
3111
- }
3112
- return true;
3113
- }
3114
- Writable.prototype.write = function(chunk, encoding, cb) {
3115
- var state = this._writableState;
3116
- var ret = false;
3117
- var isBuf = !state.objectMode && _isUint8Array(chunk);
3118
- if (isBuf && !Buffer2.isBuffer(chunk)) {
3119
- chunk = _uint8ArrayToBuffer(chunk);
3120
- }
3121
- if (typeof encoding === "function") {
3122
- cb = encoding;
3123
- encoding = null;
3124
- }
3125
- if (isBuf) encoding = "buffer";
3126
- else if (!encoding) encoding = state.defaultEncoding;
3127
- if (typeof cb !== "function") cb = nop;
3128
- if (state.ending) writeAfterEnd(this, cb);
3129
- else if (isBuf || validChunk(this, state, chunk, cb)) {
3130
- state.pendingcb++;
3131
- ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
3132
- }
3133
- return ret;
3134
- };
3135
- Writable.prototype.cork = function() {
3136
- this._writableState.corked++;
3137
- };
3138
- Writable.prototype.uncork = function() {
3139
- var state = this._writableState;
3140
- if (state.corked) {
3141
- state.corked--;
3142
- if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
3143
- }
3144
- };
3145
- Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
3146
- if (typeof encoding === "string") encoding = encoding.toLowerCase();
3147
- if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding);
3148
- this._writableState.defaultEncoding = encoding;
3149
- return this;
3150
- };
3151
- Object.defineProperty(Writable.prototype, "writableBuffer", {
3152
- // making it explicit this property is not enumerable
3153
- // because otherwise some prototype manipulation in
3154
- // userland will fail
3155
- enumerable: false,
3156
- get: function get() {
3157
- return this._writableState && this._writableState.getBuffer();
3158
- }
3159
- });
3160
- function decodeChunk(state, chunk, encoding) {
3161
- if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") {
3162
- chunk = Buffer2.from(chunk, encoding);
3163
- }
3164
- return chunk;
3165
- }
3166
- Object.defineProperty(Writable.prototype, "writableHighWaterMark", {
3167
- // making it explicit this property is not enumerable
3168
- // because otherwise some prototype manipulation in
3169
- // userland will fail
3170
- enumerable: false,
3171
- get: function get() {
3172
- return this._writableState.highWaterMark;
3173
- }
3174
- });
3175
- function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
3176
- if (!isBuf) {
3177
- var newChunk = decodeChunk(state, chunk, encoding);
3178
- if (chunk !== newChunk) {
3179
- isBuf = true;
3180
- encoding = "buffer";
3181
- chunk = newChunk;
3182
- }
3183
- }
3184
- var len = state.objectMode ? 1 : chunk.length;
3185
- state.length += len;
3186
- var ret = state.length < state.highWaterMark;
3187
- if (!ret) state.needDrain = true;
3188
- if (state.writing || state.corked) {
3189
- var last = state.lastBufferedRequest;
3190
- state.lastBufferedRequest = {
3191
- chunk,
3192
- encoding,
3193
- isBuf,
3194
- callback: cb,
3195
- next: null
3196
- };
3197
- if (last) {
3198
- last.next = state.lastBufferedRequest;
3199
- } else {
3200
- state.bufferedRequest = state.lastBufferedRequest;
3201
- }
3202
- state.bufferedRequestCount += 1;
3203
- } else {
3204
- doWrite(stream, state, false, len, chunk, encoding, cb);
3205
- }
3206
- return ret;
3207
- }
3208
- function doWrite(stream, state, writev, len, chunk, encoding, cb) {
3209
- state.writelen = len;
3210
- state.writecb = cb;
3211
- state.writing = true;
3212
- state.sync = true;
3213
- if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED("write"));
3214
- else if (writev) stream._writev(chunk, state.onwrite);
3215
- else stream._write(chunk, encoding, state.onwrite);
3216
- state.sync = false;
3217
- }
3218
- function onwriteError(stream, state, sync, er, cb) {
3219
- --state.pendingcb;
3220
- if (sync) {
3221
- process.nextTick(cb, er);
3222
- process.nextTick(finishMaybe, stream, state);
3223
- stream._writableState.errorEmitted = true;
3224
- errorOrDestroy(stream, er);
3225
- } else {
3226
- cb(er);
3227
- stream._writableState.errorEmitted = true;
3228
- errorOrDestroy(stream, er);
3229
- finishMaybe(stream, state);
3230
- }
3231
- }
3232
- function onwriteStateUpdate(state) {
3233
- state.writing = false;
3234
- state.writecb = null;
3235
- state.length -= state.writelen;
3236
- state.writelen = 0;
3237
- }
3238
- function onwrite(stream, er) {
3239
- var state = stream._writableState;
3240
- var sync = state.sync;
3241
- var cb = state.writecb;
3242
- if (typeof cb !== "function") throw new ERR_MULTIPLE_CALLBACK();
3243
- onwriteStateUpdate(state);
3244
- if (er) onwriteError(stream, state, sync, er, cb);
3245
- else {
3246
- var finished = needFinish(state) || stream.destroyed;
3247
- if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
3248
- clearBuffer(stream, state);
3249
- }
3250
- if (sync) {
3251
- process.nextTick(afterWrite, stream, state, finished, cb);
3252
- } else {
3253
- afterWrite(stream, state, finished, cb);
3254
- }
3255
- }
3256
- }
3257
- function afterWrite(stream, state, finished, cb) {
3258
- if (!finished) onwriteDrain(stream, state);
3259
- state.pendingcb--;
3260
- cb();
3261
- finishMaybe(stream, state);
3262
- }
3263
- function onwriteDrain(stream, state) {
3264
- if (state.length === 0 && state.needDrain) {
3265
- state.needDrain = false;
3266
- stream.emit("drain");
3267
- }
3268
- }
3269
- function clearBuffer(stream, state) {
3270
- state.bufferProcessing = true;
3271
- var entry = state.bufferedRequest;
3272
- if (stream._writev && entry && entry.next) {
3273
- var l = state.bufferedRequestCount;
3274
- var buffer = new Array(l);
3275
- var holder = state.corkedRequestsFree;
3276
- holder.entry = entry;
3277
- var count = 0;
3278
- var allBuffers = true;
3279
- while (entry) {
3280
- buffer[count] = entry;
3281
- if (!entry.isBuf) allBuffers = false;
3282
- entry = entry.next;
3283
- count += 1;
3284
- }
3285
- buffer.allBuffers = allBuffers;
3286
- doWrite(stream, state, true, state.length, buffer, "", holder.finish);
3287
- state.pendingcb++;
3288
- state.lastBufferedRequest = null;
3289
- if (holder.next) {
3290
- state.corkedRequestsFree = holder.next;
3291
- holder.next = null;
3292
- } else {
3293
- state.corkedRequestsFree = new CorkedRequest(state);
3294
- }
3295
- state.bufferedRequestCount = 0;
3296
- } else {
3297
- while (entry) {
3298
- var chunk = entry.chunk;
3299
- var encoding = entry.encoding;
3300
- var cb = entry.callback;
3301
- var len = state.objectMode ? 1 : chunk.length;
3302
- doWrite(stream, state, false, len, chunk, encoding, cb);
3303
- entry = entry.next;
3304
- state.bufferedRequestCount--;
3305
- if (state.writing) {
3306
- break;
3307
- }
3308
- }
3309
- if (entry === null) state.lastBufferedRequest = null;
3310
- }
3311
- state.bufferedRequest = entry;
3312
- state.bufferProcessing = false;
3313
- }
3314
- Writable.prototype._write = function(chunk, encoding, cb) {
3315
- cb(new ERR_METHOD_NOT_IMPLEMENTED("_write()"));
3316
- };
3317
- Writable.prototype._writev = null;
3318
- Writable.prototype.end = function(chunk, encoding, cb) {
3319
- var state = this._writableState;
3320
- if (typeof chunk === "function") {
3321
- cb = chunk;
3322
- chunk = null;
3323
- encoding = null;
3324
- } else if (typeof encoding === "function") {
3325
- cb = encoding;
3326
- encoding = null;
3327
- }
3328
- if (chunk !== null && chunk !== void 0) this.write(chunk, encoding);
3329
- if (state.corked) {
3330
- state.corked = 1;
3331
- this.uncork();
3332
- }
3333
- if (!state.ending) endWritable(this, state, cb);
3334
- return this;
3335
- };
3336
- Object.defineProperty(Writable.prototype, "writableLength", {
3337
- // making it explicit this property is not enumerable
3338
- // because otherwise some prototype manipulation in
3339
- // userland will fail
3340
- enumerable: false,
3341
- get: function get() {
3342
- return this._writableState.length;
3343
- }
3344
- });
3345
- function needFinish(state) {
3346
- return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
3347
- }
3348
- function callFinal(stream, state) {
3349
- stream._final(function(err) {
3350
- state.pendingcb--;
3351
- if (err) {
3352
- errorOrDestroy(stream, err);
3353
- }
3354
- state.prefinished = true;
3355
- stream.emit("prefinish");
3356
- finishMaybe(stream, state);
3357
- });
3358
- }
3359
- function prefinish(stream, state) {
3360
- if (!state.prefinished && !state.finalCalled) {
3361
- if (typeof stream._final === "function" && !state.destroyed) {
3362
- state.pendingcb++;
3363
- state.finalCalled = true;
3364
- process.nextTick(callFinal, stream, state);
3365
- } else {
3366
- state.prefinished = true;
3367
- stream.emit("prefinish");
3368
- }
3369
- }
3370
- }
3371
- function finishMaybe(stream, state) {
3372
- var need = needFinish(state);
3373
- if (need) {
3374
- prefinish(stream, state);
3375
- if (state.pendingcb === 0) {
3376
- state.finished = true;
3377
- stream.emit("finish");
3378
- if (state.autoDestroy) {
3379
- var rState = stream._readableState;
3380
- if (!rState || rState.autoDestroy && rState.endEmitted) {
3381
- stream.destroy();
3382
- }
3383
- }
3384
- }
3385
- }
3386
- return need;
3387
- }
3388
- function endWritable(stream, state, cb) {
3389
- state.ending = true;
3390
- finishMaybe(stream, state);
3391
- if (cb) {
3392
- if (state.finished) process.nextTick(cb);
3393
- else stream.once("finish", cb);
3394
- }
3395
- state.ended = true;
3396
- stream.writable = false;
3397
- }
3398
- function onCorkedFinish(corkReq, state, err) {
3399
- var entry = corkReq.entry;
3400
- corkReq.entry = null;
3401
- while (entry) {
3402
- var cb = entry.callback;
3403
- state.pendingcb--;
3404
- cb(err);
3405
- entry = entry.next;
3406
- }
3407
- state.corkedRequestsFree.next = corkReq;
3408
- }
3409
- Object.defineProperty(Writable.prototype, "destroyed", {
3410
- // making it explicit this property is not enumerable
3411
- // because otherwise some prototype manipulation in
3412
- // userland will fail
3413
- enumerable: false,
3414
- get: function get() {
3415
- if (this._writableState === void 0) {
3416
- return false;
3417
- }
3418
- return this._writableState.destroyed;
3419
- },
3420
- set: function set(value) {
3421
- if (!this._writableState) {
3422
- return;
3423
- }
3424
- this._writableState.destroyed = value;
3425
- }
3426
- });
3427
- Writable.prototype.destroy = destroyImpl.destroy;
3428
- Writable.prototype._undestroy = destroyImpl.undestroy;
3429
- Writable.prototype._destroy = function(err, cb) {
3430
- cb(err);
3431
- };
3432
- }
3433
- });
3434
-
3435
- // ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_duplex.js
3436
- var require_stream_duplex = __commonJS({
3437
- "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_duplex.js"(exports2, module2) {
3438
- "use strict";
3439
- var objectKeys = Object.keys || function(obj) {
3440
- var keys2 = [];
3441
- for (var key in obj) keys2.push(key);
3442
- return keys2;
3443
- };
3444
- module2.exports = Duplex;
3445
- var Readable = require_stream_readable();
3446
- var Writable = require_stream_writable();
3447
- require_inherits()(Duplex, Readable);
3448
- {
3449
- keys = objectKeys(Writable.prototype);
3450
- for (v = 0; v < keys.length; v++) {
3451
- method = keys[v];
3452
- if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
3453
- }
3454
- }
3455
- var keys;
3456
- var method;
3457
- var v;
3458
- function Duplex(options) {
3459
- if (!(this instanceof Duplex)) return new Duplex(options);
3460
- Readable.call(this, options);
3461
- Writable.call(this, options);
3462
- this.allowHalfOpen = true;
3463
- if (options) {
3464
- if (options.readable === false) this.readable = false;
3465
- if (options.writable === false) this.writable = false;
3466
- if (options.allowHalfOpen === false) {
3467
- this.allowHalfOpen = false;
3468
- this.once("end", onend);
3469
- }
3470
- }
3471
- }
3472
- Object.defineProperty(Duplex.prototype, "writableHighWaterMark", {
3473
- // making it explicit this property is not enumerable
3474
- // because otherwise some prototype manipulation in
3475
- // userland will fail
3476
- enumerable: false,
3477
- get: function get() {
3478
- return this._writableState.highWaterMark;
3479
- }
3480
- });
3481
- Object.defineProperty(Duplex.prototype, "writableBuffer", {
3482
- // making it explicit this property is not enumerable
3483
- // because otherwise some prototype manipulation in
3484
- // userland will fail
3485
- enumerable: false,
3486
- get: function get() {
3487
- return this._writableState && this._writableState.getBuffer();
3488
- }
3489
- });
3490
- Object.defineProperty(Duplex.prototype, "writableLength", {
3491
- // making it explicit this property is not enumerable
3492
- // because otherwise some prototype manipulation in
3493
- // userland will fail
3494
- enumerable: false,
3495
- get: function get() {
3496
- return this._writableState.length;
3497
- }
3498
- });
3499
- function onend() {
3500
- if (this._writableState.ended) return;
3501
- process.nextTick(onEndNT, this);
3502
- }
3503
- function onEndNT(self2) {
3504
- self2.end();
3505
- }
3506
- Object.defineProperty(Duplex.prototype, "destroyed", {
3507
- // making it explicit this property is not enumerable
3508
- // because otherwise some prototype manipulation in
3509
- // userland will fail
3510
- enumerable: false,
3511
- get: function get() {
3512
- if (this._readableState === void 0 || this._writableState === void 0) {
3513
- return false;
3514
- }
3515
- return this._readableState.destroyed && this._writableState.destroyed;
3516
- },
3517
- set: function set(value) {
3518
- if (this._readableState === void 0 || this._writableState === void 0) {
3519
- return;
3520
- }
3521
- this._readableState.destroyed = value;
3522
- this._writableState.destroyed = value;
3523
- }
3524
- });
3525
- }
3526
- });
3527
-
3528
- // ../../node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js
3529
- var require_safe_buffer = __commonJS({
3530
- "../../node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js"(exports2, module2) {
3531
- var buffer = require("buffer");
3532
- var Buffer2 = buffer.Buffer;
3533
- function copyProps(src, dst) {
3534
- for (var key in src) {
3535
- dst[key] = src[key];
3536
- }
3537
- }
3538
- if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) {
3539
- module2.exports = buffer;
3540
- } else {
3541
- copyProps(buffer, exports2);
3542
- exports2.Buffer = SafeBuffer;
3543
- }
3544
- function SafeBuffer(arg, encodingOrOffset, length) {
3545
- return Buffer2(arg, encodingOrOffset, length);
3546
- }
3547
- SafeBuffer.prototype = Object.create(Buffer2.prototype);
3548
- copyProps(Buffer2, SafeBuffer);
3549
- SafeBuffer.from = function(arg, encodingOrOffset, length) {
3550
- if (typeof arg === "number") {
3551
- throw new TypeError("Argument must not be a number");
3552
- }
3553
- return Buffer2(arg, encodingOrOffset, length);
3554
- };
3555
- SafeBuffer.alloc = function(size, fill, encoding) {
3556
- if (typeof size !== "number") {
3557
- throw new TypeError("Argument must be a number");
3558
- }
3559
- var buf = Buffer2(size);
3560
- if (fill !== void 0) {
3561
- if (typeof encoding === "string") {
3562
- buf.fill(fill, encoding);
3563
- } else {
3564
- buf.fill(fill);
3565
- }
3566
- } else {
3567
- buf.fill(0);
3568
- }
3569
- return buf;
3570
- };
3571
- SafeBuffer.allocUnsafe = function(size) {
3572
- if (typeof size !== "number") {
3573
- throw new TypeError("Argument must be a number");
3574
- }
3575
- return Buffer2(size);
3576
- };
3577
- SafeBuffer.allocUnsafeSlow = function(size) {
3578
- if (typeof size !== "number") {
3579
- throw new TypeError("Argument must be a number");
3580
- }
3581
- return buffer.SlowBuffer(size);
3582
- };
3583
- }
3584
- });
3585
-
3586
- // ../../node_modules/.pnpm/string_decoder@1.3.0/node_modules/string_decoder/lib/string_decoder.js
3587
- var require_string_decoder = __commonJS({
3588
- "../../node_modules/.pnpm/string_decoder@1.3.0/node_modules/string_decoder/lib/string_decoder.js"(exports2) {
3589
- "use strict";
3590
- var Buffer2 = require_safe_buffer().Buffer;
3591
- var isEncoding = Buffer2.isEncoding || function(encoding) {
3592
- encoding = "" + encoding;
3593
- switch (encoding && encoding.toLowerCase()) {
3594
- case "hex":
3595
- case "utf8":
3596
- case "utf-8":
3597
- case "ascii":
3598
- case "binary":
3599
- case "base64":
3600
- case "ucs2":
3601
- case "ucs-2":
3602
- case "utf16le":
3603
- case "utf-16le":
3604
- case "raw":
3605
- return true;
3606
- default:
3607
- return false;
3608
- }
3609
- };
3610
- function _normalizeEncoding(enc) {
3611
- if (!enc) return "utf8";
3612
- var retried;
3613
- while (true) {
3614
- switch (enc) {
3615
- case "utf8":
3616
- case "utf-8":
3617
- return "utf8";
3618
- case "ucs2":
3619
- case "ucs-2":
3620
- case "utf16le":
3621
- case "utf-16le":
3622
- return "utf16le";
3623
- case "latin1":
3624
- case "binary":
3625
- return "latin1";
3626
- case "base64":
3627
- case "ascii":
3628
- case "hex":
3629
- return enc;
3630
- default:
3631
- if (retried) return;
3632
- enc = ("" + enc).toLowerCase();
3633
- retried = true;
3634
- }
3635
- }
3636
- }
3637
- function normalizeEncoding(enc) {
3638
- var nenc = _normalizeEncoding(enc);
3639
- if (typeof nenc !== "string" && (Buffer2.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc);
3640
- return nenc || enc;
3641
- }
3642
- exports2.StringDecoder = StringDecoder;
3643
- function StringDecoder(encoding) {
3644
- this.encoding = normalizeEncoding(encoding);
3645
- var nb;
3646
- switch (this.encoding) {
3647
- case "utf16le":
3648
- this.text = utf16Text;
3649
- this.end = utf16End;
3650
- nb = 4;
3651
- break;
3652
- case "utf8":
3653
- this.fillLast = utf8FillLast;
3654
- nb = 4;
3655
- break;
3656
- case "base64":
3657
- this.text = base64Text;
3658
- this.end = base64End;
3659
- nb = 3;
3660
- break;
3661
- default:
3662
- this.write = simpleWrite;
3663
- this.end = simpleEnd;
3664
- return;
3665
- }
3666
- this.lastNeed = 0;
3667
- this.lastTotal = 0;
3668
- this.lastChar = Buffer2.allocUnsafe(nb);
3669
- }
3670
- StringDecoder.prototype.write = function(buf) {
3671
- if (buf.length === 0) return "";
3672
- var r;
3673
- var i;
3674
- if (this.lastNeed) {
3675
- r = this.fillLast(buf);
3676
- if (r === void 0) return "";
3677
- i = this.lastNeed;
3678
- this.lastNeed = 0;
3679
- } else {
3680
- i = 0;
3681
- }
3682
- if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
3683
- return r || "";
3684
- };
3685
- StringDecoder.prototype.end = utf8End;
3686
- StringDecoder.prototype.text = utf8Text;
3687
- StringDecoder.prototype.fillLast = function(buf) {
3688
- if (this.lastNeed <= buf.length) {
3689
- buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
3690
- return this.lastChar.toString(this.encoding, 0, this.lastTotal);
3691
- }
3692
- buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
3693
- this.lastNeed -= buf.length;
3694
- };
3695
- function utf8CheckByte(byte) {
3696
- if (byte <= 127) return 0;
3697
- else if (byte >> 5 === 6) return 2;
3698
- else if (byte >> 4 === 14) return 3;
3699
- else if (byte >> 3 === 30) return 4;
3700
- return byte >> 6 === 2 ? -1 : -2;
3701
- }
3702
- function utf8CheckIncomplete(self2, buf, i) {
3703
- var j = buf.length - 1;
3704
- if (j < i) return 0;
3705
- var nb = utf8CheckByte(buf[j]);
3706
- if (nb >= 0) {
3707
- if (nb > 0) self2.lastNeed = nb - 1;
3708
- return nb;
3709
- }
3710
- if (--j < i || nb === -2) return 0;
3711
- nb = utf8CheckByte(buf[j]);
3712
- if (nb >= 0) {
3713
- if (nb > 0) self2.lastNeed = nb - 2;
3714
- return nb;
3715
- }
3716
- if (--j < i || nb === -2) return 0;
3717
- nb = utf8CheckByte(buf[j]);
3718
- if (nb >= 0) {
3719
- if (nb > 0) {
3720
- if (nb === 2) nb = 0;
3721
- else self2.lastNeed = nb - 3;
3722
- }
3723
- return nb;
3724
- }
3725
- return 0;
3726
- }
3727
- function utf8CheckExtraBytes(self2, buf, p) {
3728
- if ((buf[0] & 192) !== 128) {
3729
- self2.lastNeed = 0;
3730
- return "\uFFFD";
3731
- }
3732
- if (self2.lastNeed > 1 && buf.length > 1) {
3733
- if ((buf[1] & 192) !== 128) {
3734
- self2.lastNeed = 1;
3735
- return "\uFFFD";
3736
- }
3737
- if (self2.lastNeed > 2 && buf.length > 2) {
3738
- if ((buf[2] & 192) !== 128) {
3739
- self2.lastNeed = 2;
3740
- return "\uFFFD";
3741
- }
3742
- }
3743
- }
3744
- }
3745
- function utf8FillLast(buf) {
3746
- var p = this.lastTotal - this.lastNeed;
3747
- var r = utf8CheckExtraBytes(this, buf, p);
3748
- if (r !== void 0) return r;
3749
- if (this.lastNeed <= buf.length) {
3750
- buf.copy(this.lastChar, p, 0, this.lastNeed);
3751
- return this.lastChar.toString(this.encoding, 0, this.lastTotal);
3752
- }
3753
- buf.copy(this.lastChar, p, 0, buf.length);
3754
- this.lastNeed -= buf.length;
3755
- }
3756
- function utf8Text(buf, i) {
3757
- var total = utf8CheckIncomplete(this, buf, i);
3758
- if (!this.lastNeed) return buf.toString("utf8", i);
3759
- this.lastTotal = total;
3760
- var end = buf.length - (total - this.lastNeed);
3761
- buf.copy(this.lastChar, 0, end);
3762
- return buf.toString("utf8", i, end);
3763
- }
3764
- function utf8End(buf) {
3765
- var r = buf && buf.length ? this.write(buf) : "";
3766
- if (this.lastNeed) return r + "\uFFFD";
3767
- return r;
3768
- }
3769
- function utf16Text(buf, i) {
3770
- if ((buf.length - i) % 2 === 0) {
3771
- var r = buf.toString("utf16le", i);
3772
- if (r) {
3773
- var c = r.charCodeAt(r.length - 1);
3774
- if (c >= 55296 && c <= 56319) {
3775
- this.lastNeed = 2;
3776
- this.lastTotal = 4;
3777
- this.lastChar[0] = buf[buf.length - 2];
3778
- this.lastChar[1] = buf[buf.length - 1];
3779
- return r.slice(0, -1);
3780
- }
3781
- }
3782
- return r;
3783
- }
3784
- this.lastNeed = 1;
3785
- this.lastTotal = 2;
3786
- this.lastChar[0] = buf[buf.length - 1];
3787
- return buf.toString("utf16le", i, buf.length - 1);
3788
- }
3789
- function utf16End(buf) {
3790
- var r = buf && buf.length ? this.write(buf) : "";
3791
- if (this.lastNeed) {
3792
- var end = this.lastTotal - this.lastNeed;
3793
- return r + this.lastChar.toString("utf16le", 0, end);
3794
- }
3795
- return r;
3796
- }
3797
- function base64Text(buf, i) {
3798
- var n = (buf.length - i) % 3;
3799
- if (n === 0) return buf.toString("base64", i);
3800
- this.lastNeed = 3 - n;
3801
- this.lastTotal = 3;
3802
- if (n === 1) {
3803
- this.lastChar[0] = buf[buf.length - 1];
3804
- } else {
3805
- this.lastChar[0] = buf[buf.length - 2];
3806
- this.lastChar[1] = buf[buf.length - 1];
3807
- }
3808
- return buf.toString("base64", i, buf.length - n);
3809
- }
3810
- function base64End(buf) {
3811
- var r = buf && buf.length ? this.write(buf) : "";
3812
- if (this.lastNeed) return r + this.lastChar.toString("base64", 0, 3 - this.lastNeed);
3813
- return r;
3814
- }
3815
- function simpleWrite(buf) {
3816
- return buf.toString(this.encoding);
3817
- }
3818
- function simpleEnd(buf) {
3819
- return buf && buf.length ? this.write(buf) : "";
3820
- }
3821
- }
3822
- });
3823
-
3824
- // ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/end-of-stream.js
3825
- var require_end_of_stream = __commonJS({
3826
- "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(exports2, module2) {
3827
- "use strict";
3828
- var ERR_STREAM_PREMATURE_CLOSE = require_errors().codes.ERR_STREAM_PREMATURE_CLOSE;
3829
- function once(callback) {
3830
- var called = false;
3831
- return function() {
3832
- if (called) return;
3833
- called = true;
3834
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3835
- args[_key] = arguments[_key];
3836
- }
3837
- callback.apply(this, args);
3838
- };
3839
- }
3840
- function noop() {
3841
- }
3842
- function isRequest(stream) {
3843
- return stream.setHeader && typeof stream.abort === "function";
3844
- }
3845
- function eos(stream, opts, callback) {
3846
- if (typeof opts === "function") return eos(stream, null, opts);
3847
- if (!opts) opts = {};
3848
- callback = once(callback || noop);
3849
- var readable = opts.readable || opts.readable !== false && stream.readable;
3850
- var writable = opts.writable || opts.writable !== false && stream.writable;
3851
- var onlegacyfinish = function onlegacyfinish2() {
3852
- if (!stream.writable) onfinish();
3853
- };
3854
- var writableEnded = stream._writableState && stream._writableState.finished;
3855
- var onfinish = function onfinish2() {
3856
- writable = false;
3857
- writableEnded = true;
3858
- if (!readable) callback.call(stream);
3859
- };
3860
- var readableEnded = stream._readableState && stream._readableState.endEmitted;
3861
- var onend = function onend2() {
3862
- readable = false;
3863
- readableEnded = true;
3864
- if (!writable) callback.call(stream);
3865
- };
3866
- var onerror = function onerror2(err) {
3867
- callback.call(stream, err);
3868
- };
3869
- var onclose = function onclose2() {
3870
- var err;
3871
- if (readable && !readableEnded) {
3872
- if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
3873
- return callback.call(stream, err);
3874
- }
3875
- if (writable && !writableEnded) {
3876
- if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
3877
- return callback.call(stream, err);
3878
- }
3879
- };
3880
- var onrequest = function onrequest2() {
3881
- stream.req.on("finish", onfinish);
3882
- };
3883
- if (isRequest(stream)) {
3884
- stream.on("complete", onfinish);
3885
- stream.on("abort", onclose);
3886
- if (stream.req) onrequest();
3887
- else stream.on("request", onrequest);
3888
- } else if (writable && !stream._writableState) {
3889
- stream.on("end", onlegacyfinish);
3890
- stream.on("close", onlegacyfinish);
3891
- }
3892
- stream.on("end", onend);
3893
- stream.on("finish", onfinish);
3894
- if (opts.error !== false) stream.on("error", onerror);
3895
- stream.on("close", onclose);
3896
- return function() {
3897
- stream.removeListener("complete", onfinish);
3898
- stream.removeListener("abort", onclose);
3899
- stream.removeListener("request", onrequest);
3900
- if (stream.req) stream.req.removeListener("finish", onfinish);
3901
- stream.removeListener("end", onlegacyfinish);
3902
- stream.removeListener("close", onlegacyfinish);
3903
- stream.removeListener("finish", onfinish);
3904
- stream.removeListener("end", onend);
3905
- stream.removeListener("error", onerror);
3906
- stream.removeListener("close", onclose);
3907
- };
3908
- }
3909
- module2.exports = eos;
3910
- }
3911
- });
3912
-
3913
- // ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/async_iterator.js
3914
- var require_async_iterator = __commonJS({
3915
- "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/async_iterator.js"(exports2, module2) {
3916
- "use strict";
3917
- var _Object$setPrototypeO;
3918
- function _defineProperty(obj, key, value) {
3919
- key = _toPropertyKey(key);
3920
- if (key in obj) {
3921
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
3922
- } else {
3923
- obj[key] = value;
3924
- }
3925
- return obj;
3926
- }
3927
- function _toPropertyKey(arg) {
3928
- var key = _toPrimitive(arg, "string");
3929
- return typeof key === "symbol" ? key : String(key);
3930
- }
3931
- function _toPrimitive(input, hint) {
3932
- if (typeof input !== "object" || input === null) return input;
3933
- var prim = input[Symbol.toPrimitive];
3934
- if (prim !== void 0) {
3935
- var res = prim.call(input, hint || "default");
3936
- if (typeof res !== "object") return res;
3937
- throw new TypeError("@@toPrimitive must return a primitive value.");
3938
- }
3939
- return (hint === "string" ? String : Number)(input);
3940
- }
3941
- var finished = require_end_of_stream();
3942
- var kLastResolve = Symbol("lastResolve");
3943
- var kLastReject = Symbol("lastReject");
3944
- var kError = Symbol("error");
3945
- var kEnded = Symbol("ended");
3946
- var kLastPromise = Symbol("lastPromise");
3947
- var kHandlePromise = Symbol("handlePromise");
3948
- var kStream = Symbol("stream");
3949
- function createIterResult(value, done) {
3950
- return {
3951
- value,
3952
- done
3953
- };
3954
- }
3955
- function readAndResolve(iter) {
3956
- var resolve = iter[kLastResolve];
3957
- if (resolve !== null) {
3958
- var data = iter[kStream].read();
3959
- if (data !== null) {
3960
- iter[kLastPromise] = null;
3961
- iter[kLastResolve] = null;
3962
- iter[kLastReject] = null;
3963
- resolve(createIterResult(data, false));
3964
- }
3965
- }
3966
- }
3967
- function onReadable(iter) {
3968
- process.nextTick(readAndResolve, iter);
3969
- }
3970
- function wrapForNext(lastPromise, iter) {
3971
- return function(resolve, reject) {
3972
- lastPromise.then(function() {
3973
- if (iter[kEnded]) {
3974
- resolve(createIterResult(void 0, true));
3975
- return;
3976
- }
3977
- iter[kHandlePromise](resolve, reject);
3978
- }, reject);
3979
- };
3980
- }
3981
- var AsyncIteratorPrototype = Object.getPrototypeOf(function() {
3982
- });
3983
- var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = {
3984
- get stream() {
3985
- return this[kStream];
3986
- },
3987
- next: function next() {
3988
- var _this = this;
3989
- var error = this[kError];
3990
- if (error !== null) {
3991
- return Promise.reject(error);
3992
- }
3993
- if (this[kEnded]) {
3994
- return Promise.resolve(createIterResult(void 0, true));
3995
- }
3996
- if (this[kStream].destroyed) {
3997
- return new Promise(function(resolve, reject) {
3998
- process.nextTick(function() {
3999
- if (_this[kError]) {
4000
- reject(_this[kError]);
4001
- } else {
4002
- resolve(createIterResult(void 0, true));
4003
- }
4004
- });
4005
- });
4006
- }
4007
- var lastPromise = this[kLastPromise];
4008
- var promise;
4009
- if (lastPromise) {
4010
- promise = new Promise(wrapForNext(lastPromise, this));
4011
- } else {
4012
- var data = this[kStream].read();
4013
- if (data !== null) {
4014
- return Promise.resolve(createIterResult(data, false));
4015
- }
4016
- promise = new Promise(this[kHandlePromise]);
4017
- }
4018
- this[kLastPromise] = promise;
4019
- return promise;
4020
- }
4021
- }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function() {
4022
- return this;
4023
- }), _defineProperty(_Object$setPrototypeO, "return", function _return() {
4024
- var _this2 = this;
4025
- return new Promise(function(resolve, reject) {
4026
- _this2[kStream].destroy(null, function(err) {
4027
- if (err) {
4028
- reject(err);
4029
- return;
4030
- }
4031
- resolve(createIterResult(void 0, true));
4032
- });
4033
- });
4034
- }), _Object$setPrototypeO), AsyncIteratorPrototype);
4035
- var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator2(stream) {
4036
- var _Object$create;
4037
- var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, {
4038
- value: stream,
4039
- writable: true
4040
- }), _defineProperty(_Object$create, kLastResolve, {
4041
- value: null,
4042
- writable: true
4043
- }), _defineProperty(_Object$create, kLastReject, {
4044
- value: null,
4045
- writable: true
4046
- }), _defineProperty(_Object$create, kError, {
4047
- value: null,
4048
- writable: true
4049
- }), _defineProperty(_Object$create, kEnded, {
4050
- value: stream._readableState.endEmitted,
4051
- writable: true
4052
- }), _defineProperty(_Object$create, kHandlePromise, {
4053
- value: function value(resolve, reject) {
4054
- var data = iterator[kStream].read();
4055
- if (data) {
4056
- iterator[kLastPromise] = null;
4057
- iterator[kLastResolve] = null;
4058
- iterator[kLastReject] = null;
4059
- resolve(createIterResult(data, false));
4060
- } else {
4061
- iterator[kLastResolve] = resolve;
4062
- iterator[kLastReject] = reject;
4063
- }
4064
- },
4065
- writable: true
4066
- }), _Object$create));
4067
- iterator[kLastPromise] = null;
4068
- finished(stream, function(err) {
4069
- if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") {
4070
- var reject = iterator[kLastReject];
4071
- if (reject !== null) {
4072
- iterator[kLastPromise] = null;
4073
- iterator[kLastResolve] = null;
4074
- iterator[kLastReject] = null;
4075
- reject(err);
4076
- }
4077
- iterator[kError] = err;
4078
- return;
4079
- }
4080
- var resolve = iterator[kLastResolve];
4081
- if (resolve !== null) {
4082
- iterator[kLastPromise] = null;
4083
- iterator[kLastResolve] = null;
4084
- iterator[kLastReject] = null;
4085
- resolve(createIterResult(void 0, true));
4086
- }
4087
- iterator[kEnded] = true;
4088
- });
4089
- stream.on("readable", onReadable.bind(null, iterator));
4090
- return iterator;
4091
- };
4092
- module2.exports = createReadableStreamAsyncIterator;
4093
- }
4094
- });
4095
-
4096
- // ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/from.js
4097
- var require_from = __commonJS({
4098
- "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/from.js"(exports2, module2) {
4099
- "use strict";
4100
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
4101
- try {
4102
- var info = gen[key](arg);
4103
- var value = info.value;
4104
- } catch (error) {
4105
- reject(error);
4106
- return;
4107
- }
4108
- if (info.done) {
4109
- resolve(value);
4110
- } else {
4111
- Promise.resolve(value).then(_next, _throw);
4112
- }
4113
- }
4114
- function _asyncToGenerator(fn) {
4115
- return function() {
4116
- var self2 = this, args = arguments;
4117
- return new Promise(function(resolve, reject) {
4118
- var gen = fn.apply(self2, args);
4119
- function _next(value) {
4120
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
4121
- }
4122
- function _throw(err) {
4123
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
4124
- }
4125
- _next(void 0);
4126
- });
4127
- };
4128
- }
4129
- function ownKeys2(object, enumerableOnly) {
4130
- var keys = Object.keys(object);
4131
- if (Object.getOwnPropertySymbols) {
4132
- var symbols = Object.getOwnPropertySymbols(object);
4133
- enumerableOnly && (symbols = symbols.filter(function(sym) {
4134
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
4135
- })), keys.push.apply(keys, symbols);
4136
- }
4137
- return keys;
4138
- }
4139
- function _objectSpread(target) {
4140
- for (var i = 1; i < arguments.length; i++) {
4141
- var source = null != arguments[i] ? arguments[i] : {};
4142
- i % 2 ? ownKeys2(Object(source), true).forEach(function(key) {
4143
- _defineProperty(target, key, source[key]);
4144
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys2(Object(source)).forEach(function(key) {
4145
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
4146
- });
4147
- }
4148
- return target;
4149
- }
4150
- function _defineProperty(obj, key, value) {
4151
- key = _toPropertyKey(key);
4152
- if (key in obj) {
4153
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
4154
- } else {
4155
- obj[key] = value;
4156
- }
4157
- return obj;
4158
- }
4159
- function _toPropertyKey(arg) {
4160
- var key = _toPrimitive(arg, "string");
4161
- return typeof key === "symbol" ? key : String(key);
4162
- }
4163
- function _toPrimitive(input, hint) {
4164
- if (typeof input !== "object" || input === null) return input;
4165
- var prim = input[Symbol.toPrimitive];
4166
- if (prim !== void 0) {
4167
- var res = prim.call(input, hint || "default");
4168
- if (typeof res !== "object") return res;
4169
- throw new TypeError("@@toPrimitive must return a primitive value.");
4170
- }
4171
- return (hint === "string" ? String : Number)(input);
4172
- }
4173
- var ERR_INVALID_ARG_TYPE = require_errors().codes.ERR_INVALID_ARG_TYPE;
4174
- function from(Readable, iterable, opts) {
4175
- var iterator;
4176
- if (iterable && typeof iterable.next === "function") {
4177
- iterator = iterable;
4178
- } else if (iterable && iterable[Symbol.asyncIterator]) iterator = iterable[Symbol.asyncIterator]();
4179
- else if (iterable && iterable[Symbol.iterator]) iterator = iterable[Symbol.iterator]();
4180
- else throw new ERR_INVALID_ARG_TYPE("iterable", ["Iterable"], iterable);
4181
- var readable = new Readable(_objectSpread({
4182
- objectMode: true
4183
- }, opts));
4184
- var reading = false;
4185
- readable._read = function() {
4186
- if (!reading) {
4187
- reading = true;
4188
- next();
4189
- }
4190
- };
4191
- function next() {
4192
- return _next2.apply(this, arguments);
4193
- }
4194
- function _next2() {
4195
- _next2 = _asyncToGenerator(function* () {
4196
- try {
4197
- var _yield$iterator$next = yield iterator.next(), value = _yield$iterator$next.value, done = _yield$iterator$next.done;
4198
- if (done) {
4199
- readable.push(null);
4200
- } else if (readable.push(yield value)) {
4201
- next();
4202
- } else {
4203
- reading = false;
4204
- }
4205
- } catch (err) {
4206
- readable.destroy(err);
4207
- }
4208
- });
4209
- return _next2.apply(this, arguments);
4210
- }
4211
- return readable;
4212
- }
4213
- module2.exports = from;
4214
- }
4215
- });
4216
-
4217
- // ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_readable.js
4218
- var require_stream_readable = __commonJS({
4219
- "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_readable.js"(exports2, module2) {
4220
- "use strict";
4221
- module2.exports = Readable;
4222
- var Duplex;
4223
- Readable.ReadableState = ReadableState;
4224
- var EE = require("events").EventEmitter;
4225
- var EElistenerCount = function EElistenerCount2(emitter, type) {
4226
- return emitter.listeners(type).length;
4227
- };
4228
- var Stream = require_stream();
4229
- var Buffer2 = require("buffer").Buffer;
4230
- var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
4231
- };
4232
- function _uint8ArrayToBuffer(chunk) {
4233
- return Buffer2.from(chunk);
4234
- }
4235
- function _isUint8Array(obj) {
4236
- return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array;
4237
- }
4238
- var debugUtil = require("util");
4239
- var debug;
4240
- if (debugUtil && debugUtil.debuglog) {
4241
- debug = debugUtil.debuglog("stream");
4242
- } else {
4243
- debug = function debug2() {
4244
- };
4245
- }
4246
- var BufferList = require_buffer_list();
4247
- var destroyImpl = require_destroy();
4248
- var _require = require_state();
4249
- var getHighWaterMark = _require.getHighWaterMark;
4250
- var _require$codes = require_errors().codes;
4251
- var ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE;
4252
- var ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF;
4253
- var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED;
4254
- var ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;
4255
- var StringDecoder;
4256
- var createReadableStreamAsyncIterator;
4257
- var from;
4258
- require_inherits()(Readable, Stream);
4259
- var errorOrDestroy = destroyImpl.errorOrDestroy;
4260
- var kProxyEvents = ["error", "close", "destroy", "pause", "resume"];
4261
- function prependListener(emitter, event, fn) {
4262
- if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn);
4263
- if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);
4264
- else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);
4265
- else emitter._events[event] = [fn, emitter._events[event]];
4266
- }
4267
- function ReadableState(options, stream, isDuplex) {
4268
- Duplex = Duplex || require_stream_duplex();
4269
- options = options || {};
4270
- if (typeof isDuplex !== "boolean") isDuplex = stream instanceof Duplex;
4271
- this.objectMode = !!options.objectMode;
4272
- if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
4273
- this.highWaterMark = getHighWaterMark(this, options, "readableHighWaterMark", isDuplex);
4274
- this.buffer = new BufferList();
4275
- this.length = 0;
4276
- this.pipes = null;
4277
- this.pipesCount = 0;
4278
- this.flowing = null;
4279
- this.ended = false;
4280
- this.endEmitted = false;
4281
- this.reading = false;
4282
- this.sync = true;
4283
- this.needReadable = false;
4284
- this.emittedReadable = false;
4285
- this.readableListening = false;
4286
- this.resumeScheduled = false;
4287
- this.paused = true;
4288
- this.emitClose = options.emitClose !== false;
4289
- this.autoDestroy = !!options.autoDestroy;
4290
- this.destroyed = false;
4291
- this.defaultEncoding = options.defaultEncoding || "utf8";
4292
- this.awaitDrain = 0;
4293
- this.readingMore = false;
4294
- this.decoder = null;
4295
- this.encoding = null;
4296
- if (options.encoding) {
4297
- if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder;
4298
- this.decoder = new StringDecoder(options.encoding);
4299
- this.encoding = options.encoding;
4300
- }
4301
- }
4302
- function Readable(options) {
4303
- Duplex = Duplex || require_stream_duplex();
4304
- if (!(this instanceof Readable)) return new Readable(options);
4305
- var isDuplex = this instanceof Duplex;
4306
- this._readableState = new ReadableState(options, this, isDuplex);
4307
- this.readable = true;
4308
- if (options) {
4309
- if (typeof options.read === "function") this._read = options.read;
4310
- if (typeof options.destroy === "function") this._destroy = options.destroy;
4311
- }
4312
- Stream.call(this);
4313
- }
4314
- Object.defineProperty(Readable.prototype, "destroyed", {
4315
- // making it explicit this property is not enumerable
4316
- // because otherwise some prototype manipulation in
4317
- // userland will fail
4318
- enumerable: false,
4319
- get: function get() {
4320
- if (this._readableState === void 0) {
4321
- return false;
4322
- }
4323
- return this._readableState.destroyed;
4324
- },
4325
- set: function set(value) {
4326
- if (!this._readableState) {
4327
- return;
4328
- }
4329
- this._readableState.destroyed = value;
4330
- }
4331
- });
4332
- Readable.prototype.destroy = destroyImpl.destroy;
4333
- Readable.prototype._undestroy = destroyImpl.undestroy;
4334
- Readable.prototype._destroy = function(err, cb) {
4335
- cb(err);
4336
- };
4337
- Readable.prototype.push = function(chunk, encoding) {
4338
- var state = this._readableState;
4339
- var skipChunkCheck;
4340
- if (!state.objectMode) {
4341
- if (typeof chunk === "string") {
4342
- encoding = encoding || state.defaultEncoding;
4343
- if (encoding !== state.encoding) {
4344
- chunk = Buffer2.from(chunk, encoding);
4345
- encoding = "";
4346
- }
4347
- skipChunkCheck = true;
4348
- }
4349
- } else {
4350
- skipChunkCheck = true;
4351
- }
4352
- return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
4353
- };
4354
- Readable.prototype.unshift = function(chunk) {
4355
- return readableAddChunk(this, chunk, null, true, false);
4356
- };
4357
- function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
4358
- debug("readableAddChunk", chunk);
4359
- var state = stream._readableState;
4360
- if (chunk === null) {
4361
- state.reading = false;
4362
- onEofChunk(stream, state);
4363
- } else {
4364
- var er;
4365
- if (!skipChunkCheck) er = chunkInvalid(state, chunk);
4366
- if (er) {
4367
- errorOrDestroy(stream, er);
4368
- } else if (state.objectMode || chunk && chunk.length > 0) {
4369
- if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer2.prototype) {
4370
- chunk = _uint8ArrayToBuffer(chunk);
4371
- }
4372
- if (addToFront) {
4373
- if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());
4374
- else addChunk(stream, state, chunk, true);
4375
- } else if (state.ended) {
4376
- errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF());
4377
- } else if (state.destroyed) {
4378
- return false;
4379
- } else {
4380
- state.reading = false;
4381
- if (state.decoder && !encoding) {
4382
- chunk = state.decoder.write(chunk);
4383
- if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);
4384
- else maybeReadMore(stream, state);
4385
- } else {
4386
- addChunk(stream, state, chunk, false);
4387
- }
4388
- }
4389
- } else if (!addToFront) {
4390
- state.reading = false;
4391
- maybeReadMore(stream, state);
4392
- }
4393
- }
4394
- return !state.ended && (state.length < state.highWaterMark || state.length === 0);
4395
- }
4396
- function addChunk(stream, state, chunk, addToFront) {
4397
- if (state.flowing && state.length === 0 && !state.sync) {
4398
- state.awaitDrain = 0;
4399
- stream.emit("data", chunk);
4400
- } else {
4401
- state.length += state.objectMode ? 1 : chunk.length;
4402
- if (addToFront) state.buffer.unshift(chunk);
4403
- else state.buffer.push(chunk);
4404
- if (state.needReadable) emitReadable(stream);
4405
- }
4406
- maybeReadMore(stream, state);
4407
- }
4408
- function chunkInvalid(state, chunk) {
4409
- var er;
4410
- if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) {
4411
- er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer", "Uint8Array"], chunk);
4412
- }
4413
- return er;
4414
- }
4415
- Readable.prototype.isPaused = function() {
4416
- return this._readableState.flowing === false;
4417
- };
4418
- Readable.prototype.setEncoding = function(enc) {
4419
- if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder;
4420
- var decoder = new StringDecoder(enc);
4421
- this._readableState.decoder = decoder;
4422
- this._readableState.encoding = this._readableState.decoder.encoding;
4423
- var p = this._readableState.buffer.head;
4424
- var content = "";
4425
- while (p !== null) {
4426
- content += decoder.write(p.data);
4427
- p = p.next;
4428
- }
4429
- this._readableState.buffer.clear();
4430
- if (content !== "") this._readableState.buffer.push(content);
4431
- this._readableState.length = content.length;
4432
- return this;
4433
- };
4434
- var MAX_HWM = 1073741824;
4435
- function computeNewHighWaterMark(n) {
4436
- if (n >= MAX_HWM) {
4437
- n = MAX_HWM;
4438
- } else {
4439
- n--;
4440
- n |= n >>> 1;
4441
- n |= n >>> 2;
4442
- n |= n >>> 4;
4443
- n |= n >>> 8;
4444
- n |= n >>> 16;
4445
- n++;
4446
- }
4447
- return n;
4448
- }
4449
- function howMuchToRead(n, state) {
4450
- if (n <= 0 || state.length === 0 && state.ended) return 0;
4451
- if (state.objectMode) return 1;
4452
- if (n !== n) {
4453
- if (state.flowing && state.length) return state.buffer.head.data.length;
4454
- else return state.length;
4455
- }
4456
- if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
4457
- if (n <= state.length) return n;
4458
- if (!state.ended) {
4459
- state.needReadable = true;
4460
- return 0;
4461
- }
4462
- return state.length;
4463
- }
4464
- Readable.prototype.read = function(n) {
4465
- debug("read", n);
4466
- n = parseInt(n, 10);
4467
- var state = this._readableState;
4468
- var nOrig = n;
4469
- if (n !== 0) state.emittedReadable = false;
4470
- if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {
4471
- debug("read: emitReadable", state.length, state.ended);
4472
- if (state.length === 0 && state.ended) endReadable(this);
4473
- else emitReadable(this);
4474
- return null;
4475
- }
4476
- n = howMuchToRead(n, state);
4477
- if (n === 0 && state.ended) {
4478
- if (state.length === 0) endReadable(this);
4479
- return null;
4480
- }
4481
- var doRead = state.needReadable;
4482
- debug("need readable", doRead);
4483
- if (state.length === 0 || state.length - n < state.highWaterMark) {
4484
- doRead = true;
4485
- debug("length less than watermark", doRead);
4486
- }
4487
- if (state.ended || state.reading) {
4488
- doRead = false;
4489
- debug("reading or ended", doRead);
4490
- } else if (doRead) {
4491
- debug("do read");
4492
- state.reading = true;
4493
- state.sync = true;
4494
- if (state.length === 0) state.needReadable = true;
4495
- this._read(state.highWaterMark);
4496
- state.sync = false;
4497
- if (!state.reading) n = howMuchToRead(nOrig, state);
4498
- }
4499
- var ret;
4500
- if (n > 0) ret = fromList(n, state);
4501
- else ret = null;
4502
- if (ret === null) {
4503
- state.needReadable = state.length <= state.highWaterMark;
4504
- n = 0;
4505
- } else {
4506
- state.length -= n;
4507
- state.awaitDrain = 0;
4508
- }
4509
- if (state.length === 0) {
4510
- if (!state.ended) state.needReadable = true;
4511
- if (nOrig !== n && state.ended) endReadable(this);
4512
- }
4513
- if (ret !== null) this.emit("data", ret);
4514
- return ret;
4515
- };
4516
- function onEofChunk(stream, state) {
4517
- debug("onEofChunk");
4518
- if (state.ended) return;
4519
- if (state.decoder) {
4520
- var chunk = state.decoder.end();
4521
- if (chunk && chunk.length) {
4522
- state.buffer.push(chunk);
4523
- state.length += state.objectMode ? 1 : chunk.length;
4524
- }
4525
- }
4526
- state.ended = true;
4527
- if (state.sync) {
4528
- emitReadable(stream);
4529
- } else {
4530
- state.needReadable = false;
4531
- if (!state.emittedReadable) {
4532
- state.emittedReadable = true;
4533
- emitReadable_(stream);
4534
- }
4535
- }
4536
- }
4537
- function emitReadable(stream) {
4538
- var state = stream._readableState;
4539
- debug("emitReadable", state.needReadable, state.emittedReadable);
4540
- state.needReadable = false;
4541
- if (!state.emittedReadable) {
4542
- debug("emitReadable", state.flowing);
4543
- state.emittedReadable = true;
4544
- process.nextTick(emitReadable_, stream);
4545
- }
4546
- }
4547
- function emitReadable_(stream) {
4548
- var state = stream._readableState;
4549
- debug("emitReadable_", state.destroyed, state.length, state.ended);
4550
- if (!state.destroyed && (state.length || state.ended)) {
4551
- stream.emit("readable");
4552
- state.emittedReadable = false;
4553
- }
4554
- state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;
4555
- flow(stream);
4556
- }
4557
- function maybeReadMore(stream, state) {
4558
- if (!state.readingMore) {
4559
- state.readingMore = true;
4560
- process.nextTick(maybeReadMore_, stream, state);
4561
- }
4562
- }
4563
- function maybeReadMore_(stream, state) {
4564
- while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) {
4565
- var len = state.length;
4566
- debug("maybeReadMore read 0");
4567
- stream.read(0);
4568
- if (len === state.length)
4569
- break;
4570
- }
4571
- state.readingMore = false;
4572
- }
4573
- Readable.prototype._read = function(n) {
4574
- errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED("_read()"));
4575
- };
4576
- Readable.prototype.pipe = function(dest, pipeOpts) {
4577
- var src = this;
4578
- var state = this._readableState;
4579
- switch (state.pipesCount) {
4580
- case 0:
4581
- state.pipes = dest;
4582
- break;
4583
- case 1:
4584
- state.pipes = [state.pipes, dest];
4585
- break;
4586
- default:
4587
- state.pipes.push(dest);
4588
- break;
4589
- }
4590
- state.pipesCount += 1;
4591
- debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts);
4592
- var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
4593
- var endFn = doEnd ? onend : unpipe;
4594
- if (state.endEmitted) process.nextTick(endFn);
4595
- else src.once("end", endFn);
4596
- dest.on("unpipe", onunpipe);
4597
- function onunpipe(readable, unpipeInfo) {
4598
- debug("onunpipe");
4599
- if (readable === src) {
4600
- if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
4601
- unpipeInfo.hasUnpiped = true;
4602
- cleanup();
4603
- }
4604
- }
4605
- }
4606
- function onend() {
4607
- debug("onend");
4608
- dest.end();
4609
- }
4610
- var ondrain = pipeOnDrain(src);
4611
- dest.on("drain", ondrain);
4612
- var cleanedUp = false;
4613
- function cleanup() {
4614
- debug("cleanup");
4615
- dest.removeListener("close", onclose);
4616
- dest.removeListener("finish", onfinish);
4617
- dest.removeListener("drain", ondrain);
4618
- dest.removeListener("error", onerror);
4619
- dest.removeListener("unpipe", onunpipe);
4620
- src.removeListener("end", onend);
4621
- src.removeListener("end", unpipe);
4622
- src.removeListener("data", ondata);
4623
- cleanedUp = true;
4624
- if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
4625
- }
4626
- src.on("data", ondata);
4627
- function ondata(chunk) {
4628
- debug("ondata");
4629
- var ret = dest.write(chunk);
4630
- debug("dest.write", ret);
4631
- if (ret === false) {
4632
- if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
4633
- debug("false write response, pause", state.awaitDrain);
4634
- state.awaitDrain++;
4635
- }
4636
- src.pause();
4637
- }
4638
- }
4639
- function onerror(er) {
4640
- debug("onerror", er);
4641
- unpipe();
4642
- dest.removeListener("error", onerror);
4643
- if (EElistenerCount(dest, "error") === 0) errorOrDestroy(dest, er);
4644
- }
4645
- prependListener(dest, "error", onerror);
4646
- function onclose() {
4647
- dest.removeListener("finish", onfinish);
4648
- unpipe();
4649
- }
4650
- dest.once("close", onclose);
4651
- function onfinish() {
4652
- debug("onfinish");
4653
- dest.removeListener("close", onclose);
4654
- unpipe();
4655
- }
4656
- dest.once("finish", onfinish);
4657
- function unpipe() {
4658
- debug("unpipe");
4659
- src.unpipe(dest);
4660
- }
4661
- dest.emit("pipe", src);
4662
- if (!state.flowing) {
4663
- debug("pipe resume");
4664
- src.resume();
4665
- }
4666
- return dest;
4667
- };
4668
- function pipeOnDrain(src) {
4669
- return function pipeOnDrainFunctionResult() {
4670
- var state = src._readableState;
4671
- debug("pipeOnDrain", state.awaitDrain);
4672
- if (state.awaitDrain) state.awaitDrain--;
4673
- if (state.awaitDrain === 0 && EElistenerCount(src, "data")) {
4674
- state.flowing = true;
4675
- flow(src);
4676
- }
4677
- };
4678
- }
4679
- Readable.prototype.unpipe = function(dest) {
4680
- var state = this._readableState;
4681
- var unpipeInfo = {
4682
- hasUnpiped: false
4683
- };
4684
- if (state.pipesCount === 0) return this;
4685
- if (state.pipesCount === 1) {
4686
- if (dest && dest !== state.pipes) return this;
4687
- if (!dest) dest = state.pipes;
4688
- state.pipes = null;
4689
- state.pipesCount = 0;
4690
- state.flowing = false;
4691
- if (dest) dest.emit("unpipe", this, unpipeInfo);
4692
- return this;
4693
- }
4694
- if (!dest) {
4695
- var dests = state.pipes;
4696
- var len = state.pipesCount;
4697
- state.pipes = null;
4698
- state.pipesCount = 0;
4699
- state.flowing = false;
4700
- for (var i = 0; i < len; i++) dests[i].emit("unpipe", this, {
4701
- hasUnpiped: false
4702
- });
4703
- return this;
4704
- }
4705
- var index = indexOf(state.pipes, dest);
4706
- if (index === -1) return this;
4707
- state.pipes.splice(index, 1);
4708
- state.pipesCount -= 1;
4709
- if (state.pipesCount === 1) state.pipes = state.pipes[0];
4710
- dest.emit("unpipe", this, unpipeInfo);
4711
- return this;
4712
- };
4713
- Readable.prototype.on = function(ev, fn) {
4714
- var res = Stream.prototype.on.call(this, ev, fn);
4715
- var state = this._readableState;
4716
- if (ev === "data") {
4717
- state.readableListening = this.listenerCount("readable") > 0;
4718
- if (state.flowing !== false) this.resume();
4719
- } else if (ev === "readable") {
4720
- if (!state.endEmitted && !state.readableListening) {
4721
- state.readableListening = state.needReadable = true;
4722
- state.flowing = false;
4723
- state.emittedReadable = false;
4724
- debug("on readable", state.length, state.reading);
4725
- if (state.length) {
4726
- emitReadable(this);
4727
- } else if (!state.reading) {
4728
- process.nextTick(nReadingNextTick, this);
4729
- }
4730
- }
4731
- }
4732
- return res;
4733
- };
4734
- Readable.prototype.addListener = Readable.prototype.on;
4735
- Readable.prototype.removeListener = function(ev, fn) {
4736
- var res = Stream.prototype.removeListener.call(this, ev, fn);
4737
- if (ev === "readable") {
4738
- process.nextTick(updateReadableListening, this);
4739
- }
4740
- return res;
4741
- };
4742
- Readable.prototype.removeAllListeners = function(ev) {
4743
- var res = Stream.prototype.removeAllListeners.apply(this, arguments);
4744
- if (ev === "readable" || ev === void 0) {
4745
- process.nextTick(updateReadableListening, this);
4746
- }
4747
- return res;
4748
- };
4749
- function updateReadableListening(self2) {
4750
- var state = self2._readableState;
4751
- state.readableListening = self2.listenerCount("readable") > 0;
4752
- if (state.resumeScheduled && !state.paused) {
4753
- state.flowing = true;
4754
- } else if (self2.listenerCount("data") > 0) {
4755
- self2.resume();
4756
- }
4757
- }
4758
- function nReadingNextTick(self2) {
4759
- debug("readable nexttick read 0");
4760
- self2.read(0);
4761
- }
4762
- Readable.prototype.resume = function() {
4763
- var state = this._readableState;
4764
- if (!state.flowing) {
4765
- debug("resume");
4766
- state.flowing = !state.readableListening;
4767
- resume(this, state);
4768
- }
4769
- state.paused = false;
4770
- return this;
4771
- };
4772
- function resume(stream, state) {
4773
- if (!state.resumeScheduled) {
4774
- state.resumeScheduled = true;
4775
- process.nextTick(resume_, stream, state);
4776
- }
4777
- }
4778
- function resume_(stream, state) {
4779
- debug("resume", state.reading);
4780
- if (!state.reading) {
4781
- stream.read(0);
4782
- }
4783
- state.resumeScheduled = false;
4784
- stream.emit("resume");
4785
- flow(stream);
4786
- if (state.flowing && !state.reading) stream.read(0);
4787
- }
4788
- Readable.prototype.pause = function() {
4789
- debug("call pause flowing=%j", this._readableState.flowing);
4790
- if (this._readableState.flowing !== false) {
4791
- debug("pause");
4792
- this._readableState.flowing = false;
4793
- this.emit("pause");
4794
- }
4795
- this._readableState.paused = true;
4796
- return this;
4797
- };
4798
- function flow(stream) {
4799
- var state = stream._readableState;
4800
- debug("flow", state.flowing);
4801
- while (state.flowing && stream.read() !== null) ;
4802
- }
4803
- Readable.prototype.wrap = function(stream) {
4804
- var _this = this;
4805
- var state = this._readableState;
4806
- var paused = false;
4807
- stream.on("end", function() {
4808
- debug("wrapped end");
4809
- if (state.decoder && !state.ended) {
4810
- var chunk = state.decoder.end();
4811
- if (chunk && chunk.length) _this.push(chunk);
4812
- }
4813
- _this.push(null);
4814
- });
4815
- stream.on("data", function(chunk) {
4816
- debug("wrapped data");
4817
- if (state.decoder) chunk = state.decoder.write(chunk);
4818
- if (state.objectMode && (chunk === null || chunk === void 0)) return;
4819
- else if (!state.objectMode && (!chunk || !chunk.length)) return;
4820
- var ret = _this.push(chunk);
4821
- if (!ret) {
4822
- paused = true;
4823
- stream.pause();
4824
- }
4825
- });
4826
- for (var i in stream) {
4827
- if (this[i] === void 0 && typeof stream[i] === "function") {
4828
- this[i] = /* @__PURE__ */ (function methodWrap(method) {
4829
- return function methodWrapReturnFunction() {
4830
- return stream[method].apply(stream, arguments);
4831
- };
4832
- })(i);
4833
- }
4834
- }
4835
- for (var n = 0; n < kProxyEvents.length; n++) {
4836
- stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
4837
- }
4838
- this._read = function(n2) {
4839
- debug("wrapped _read", n2);
4840
- if (paused) {
4841
- paused = false;
4842
- stream.resume();
4843
- }
4844
- };
4845
- return this;
4846
- };
4847
- if (typeof Symbol === "function") {
4848
- Readable.prototype[Symbol.asyncIterator] = function() {
4849
- if (createReadableStreamAsyncIterator === void 0) {
4850
- createReadableStreamAsyncIterator = require_async_iterator();
4851
- }
4852
- return createReadableStreamAsyncIterator(this);
4853
- };
4854
- }
4855
- Object.defineProperty(Readable.prototype, "readableHighWaterMark", {
4856
- // making it explicit this property is not enumerable
4857
- // because otherwise some prototype manipulation in
4858
- // userland will fail
4859
- enumerable: false,
4860
- get: function get() {
4861
- return this._readableState.highWaterMark;
4862
- }
4863
- });
4864
- Object.defineProperty(Readable.prototype, "readableBuffer", {
4865
- // making it explicit this property is not enumerable
4866
- // because otherwise some prototype manipulation in
4867
- // userland will fail
4868
- enumerable: false,
4869
- get: function get() {
4870
- return this._readableState && this._readableState.buffer;
4871
- }
4872
- });
4873
- Object.defineProperty(Readable.prototype, "readableFlowing", {
4874
- // making it explicit this property is not enumerable
4875
- // because otherwise some prototype manipulation in
4876
- // userland will fail
4877
- enumerable: false,
4878
- get: function get() {
4879
- return this._readableState.flowing;
4880
- },
4881
- set: function set(state) {
4882
- if (this._readableState) {
4883
- this._readableState.flowing = state;
4884
- }
4885
- }
4886
- });
4887
- Readable._fromList = fromList;
4888
- Object.defineProperty(Readable.prototype, "readableLength", {
4889
- // making it explicit this property is not enumerable
4890
- // because otherwise some prototype manipulation in
4891
- // userland will fail
4892
- enumerable: false,
4893
- get: function get() {
4894
- return this._readableState.length;
4895
- }
4896
- });
4897
- function fromList(n, state) {
4898
- if (state.length === 0) return null;
4899
- var ret;
4900
- if (state.objectMode) ret = state.buffer.shift();
4901
- else if (!n || n >= state.length) {
4902
- if (state.decoder) ret = state.buffer.join("");
4903
- else if (state.buffer.length === 1) ret = state.buffer.first();
4904
- else ret = state.buffer.concat(state.length);
4905
- state.buffer.clear();
4906
- } else {
4907
- ret = state.buffer.consume(n, state.decoder);
4908
- }
4909
- return ret;
4910
- }
4911
- function endReadable(stream) {
4912
- var state = stream._readableState;
4913
- debug("endReadable", state.endEmitted);
4914
- if (!state.endEmitted) {
4915
- state.ended = true;
4916
- process.nextTick(endReadableNT, state, stream);
4917
- }
4918
- }
4919
- function endReadableNT(state, stream) {
4920
- debug("endReadableNT", state.endEmitted, state.length);
4921
- if (!state.endEmitted && state.length === 0) {
4922
- state.endEmitted = true;
4923
- stream.readable = false;
4924
- stream.emit("end");
4925
- if (state.autoDestroy) {
4926
- var wState = stream._writableState;
4927
- if (!wState || wState.autoDestroy && wState.finished) {
4928
- stream.destroy();
4929
- }
4930
- }
4931
- }
4932
- }
4933
- if (typeof Symbol === "function") {
4934
- Readable.from = function(iterable, opts) {
4935
- if (from === void 0) {
4936
- from = require_from();
4937
- }
4938
- return from(Readable, iterable, opts);
4939
- };
4940
- }
4941
- function indexOf(xs, x) {
4942
- for (var i = 0, l = xs.length; i < l; i++) {
4943
- if (xs[i] === x) return i;
4944
- }
4945
- return -1;
4946
- }
4947
- }
4948
- });
4949
-
4950
- // ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_transform.js
4951
- var require_stream_transform = __commonJS({
4952
- "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_transform.js"(exports2, module2) {
4953
- "use strict";
4954
- module2.exports = Transform;
4955
- var _require$codes = require_errors().codes;
4956
- var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED;
4957
- var ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK;
4958
- var ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING;
4959
- var ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;
4960
- var Duplex = require_stream_duplex();
4961
- require_inherits()(Transform, Duplex);
4962
- function afterTransform(er, data) {
4963
- var ts = this._transformState;
4964
- ts.transforming = false;
4965
- var cb = ts.writecb;
4966
- if (cb === null) {
4967
- return this.emit("error", new ERR_MULTIPLE_CALLBACK());
4968
- }
4969
- ts.writechunk = null;
4970
- ts.writecb = null;
4971
- if (data != null)
4972
- this.push(data);
4973
- cb(er);
4974
- var rs = this._readableState;
4975
- rs.reading = false;
4976
- if (rs.needReadable || rs.length < rs.highWaterMark) {
4977
- this._read(rs.highWaterMark);
4978
- }
4979
- }
4980
- function Transform(options) {
4981
- if (!(this instanceof Transform)) return new Transform(options);
4982
- Duplex.call(this, options);
4983
- this._transformState = {
4984
- afterTransform: afterTransform.bind(this),
4985
- needTransform: false,
4986
- transforming: false,
4987
- writecb: null,
4988
- writechunk: null,
4989
- writeencoding: null
4990
- };
4991
- this._readableState.needReadable = true;
4992
- this._readableState.sync = false;
4993
- if (options) {
4994
- if (typeof options.transform === "function") this._transform = options.transform;
4995
- if (typeof options.flush === "function") this._flush = options.flush;
4996
- }
4997
- this.on("prefinish", prefinish);
4998
- }
4999
- function prefinish() {
5000
- var _this = this;
5001
- if (typeof this._flush === "function" && !this._readableState.destroyed) {
5002
- this._flush(function(er, data) {
5003
- done(_this, er, data);
5004
- });
5005
- } else {
5006
- done(this, null, null);
5007
- }
5008
- }
5009
- Transform.prototype.push = function(chunk, encoding) {
5010
- this._transformState.needTransform = false;
5011
- return Duplex.prototype.push.call(this, chunk, encoding);
5012
- };
5013
- Transform.prototype._transform = function(chunk, encoding, cb) {
5014
- cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()"));
5015
- };
5016
- Transform.prototype._write = function(chunk, encoding, cb) {
5017
- var ts = this._transformState;
5018
- ts.writecb = cb;
5019
- ts.writechunk = chunk;
5020
- ts.writeencoding = encoding;
5021
- if (!ts.transforming) {
5022
- var rs = this._readableState;
5023
- if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
5024
- }
5025
- };
5026
- Transform.prototype._read = function(n) {
5027
- var ts = this._transformState;
5028
- if (ts.writechunk !== null && !ts.transforming) {
5029
- ts.transforming = true;
5030
- this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
5031
- } else {
5032
- ts.needTransform = true;
5033
- }
5034
- };
5035
- Transform.prototype._destroy = function(err, cb) {
5036
- Duplex.prototype._destroy.call(this, err, function(err2) {
5037
- cb(err2);
5038
- });
5039
- };
5040
- function done(stream, er, data) {
5041
- if (er) return stream.emit("error", er);
5042
- if (data != null)
5043
- stream.push(data);
5044
- if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0();
5045
- if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();
5046
- return stream.push(null);
5047
- }
5048
- }
5049
- });
5050
-
5051
- // ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_passthrough.js
5052
- var require_stream_passthrough = __commonJS({
5053
- "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_passthrough.js"(exports2, module2) {
5054
- "use strict";
5055
- module2.exports = PassThrough;
5056
- var Transform = require_stream_transform();
5057
- require_inherits()(PassThrough, Transform);
5058
- function PassThrough(options) {
5059
- if (!(this instanceof PassThrough)) return new PassThrough(options);
5060
- Transform.call(this, options);
5061
- }
5062
- PassThrough.prototype._transform = function(chunk, encoding, cb) {
5063
- cb(null, chunk);
5064
- };
5065
- }
5066
- });
5067
-
5068
- // ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/pipeline.js
5069
- var require_pipeline = __commonJS({
5070
- "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/pipeline.js"(exports2, module2) {
5071
- "use strict";
5072
- var eos;
5073
- function once(callback) {
5074
- var called = false;
5075
- return function() {
5076
- if (called) return;
5077
- called = true;
5078
- callback.apply(void 0, arguments);
5079
- };
5080
- }
5081
- var _require$codes = require_errors().codes;
5082
- var ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS;
5083
- var ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
5084
- function noop(err) {
5085
- if (err) throw err;
5086
- }
5087
- function isRequest(stream) {
5088
- return stream.setHeader && typeof stream.abort === "function";
5089
- }
5090
- function destroyer(stream, reading, writing, callback) {
5091
- callback = once(callback);
5092
- var closed = false;
5093
- stream.on("close", function() {
5094
- closed = true;
5095
- });
5096
- if (eos === void 0) eos = require_end_of_stream();
5097
- eos(stream, {
5098
- readable: reading,
5099
- writable: writing
5100
- }, function(err) {
5101
- if (err) return callback(err);
5102
- closed = true;
5103
- callback();
5104
- });
5105
- var destroyed = false;
5106
- return function(err) {
5107
- if (closed) return;
5108
- if (destroyed) return;
5109
- destroyed = true;
5110
- if (isRequest(stream)) return stream.abort();
5111
- if (typeof stream.destroy === "function") return stream.destroy();
5112
- callback(err || new ERR_STREAM_DESTROYED("pipe"));
5113
- };
5114
- }
5115
- function call(fn) {
5116
- fn();
5117
- }
5118
- function pipe(from, to) {
5119
- return from.pipe(to);
5120
- }
5121
- function popCallback(streams) {
5122
- if (!streams.length) return noop;
5123
- if (typeof streams[streams.length - 1] !== "function") return noop;
5124
- return streams.pop();
5125
- }
5126
- function pipeline() {
5127
- for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {
5128
- streams[_key] = arguments[_key];
5129
- }
5130
- var callback = popCallback(streams);
5131
- if (Array.isArray(streams[0])) streams = streams[0];
5132
- if (streams.length < 2) {
5133
- throw new ERR_MISSING_ARGS("streams");
5134
- }
5135
- var error;
5136
- var destroys = streams.map(function(stream, i) {
5137
- var reading = i < streams.length - 1;
5138
- var writing = i > 0;
5139
- return destroyer(stream, reading, writing, function(err) {
5140
- if (!error) error = err;
5141
- if (err) destroys.forEach(call);
5142
- if (reading) return;
5143
- destroys.forEach(call);
5144
- callback(error);
5145
- });
5146
- });
5147
- return streams.reduce(pipe);
5148
- }
5149
- module2.exports = pipeline;
5150
- }
5151
- });
5152
-
5153
- // ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/readable.js
5154
- var require_readable = __commonJS({
5155
- "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/readable.js"(exports2, module2) {
5156
- var Stream = require("stream");
5157
- if (process.env.READABLE_STREAM === "disable" && Stream) {
5158
- module2.exports = Stream.Readable;
5159
- Object.assign(module2.exports, Stream);
5160
- module2.exports.Stream = Stream;
5161
- } else {
5162
- exports2 = module2.exports = require_stream_readable();
5163
- exports2.Stream = Stream || exports2;
5164
- exports2.Readable = exports2;
5165
- exports2.Writable = require_stream_writable();
5166
- exports2.Duplex = require_stream_duplex();
5167
- exports2.Transform = require_stream_transform();
5168
- exports2.PassThrough = require_stream_passthrough();
5169
- exports2.finished = require_end_of_stream();
5170
- exports2.pipeline = require_pipeline();
5171
- }
5172
- }
5173
- });
5174
-
5175
- // ../../node_modules/.pnpm/bl@4.1.0/node_modules/bl/BufferList.js
5176
- var require_BufferList = __commonJS({
5177
- "../../node_modules/.pnpm/bl@4.1.0/node_modules/bl/BufferList.js"(exports2, module2) {
5178
- "use strict";
5179
- var { Buffer: Buffer2 } = require("buffer");
5180
- var symbol = Symbol.for("BufferList");
5181
- function BufferList(buf) {
5182
- if (!(this instanceof BufferList)) {
5183
- return new BufferList(buf);
5184
- }
5185
- BufferList._init.call(this, buf);
5186
- }
5187
- BufferList._init = function _init(buf) {
5188
- Object.defineProperty(this, symbol, { value: true });
5189
- this._bufs = [];
5190
- this.length = 0;
5191
- if (buf) {
5192
- this.append(buf);
5193
- }
5194
- };
5195
- BufferList.prototype._new = function _new(buf) {
5196
- return new BufferList(buf);
5197
- };
5198
- BufferList.prototype._offset = function _offset(offset) {
5199
- if (offset === 0) {
5200
- return [0, 0];
5201
- }
5202
- let tot = 0;
5203
- for (let i = 0; i < this._bufs.length; i++) {
5204
- const _t = tot + this._bufs[i].length;
5205
- if (offset < _t || i === this._bufs.length - 1) {
5206
- return [i, offset - tot];
5207
- }
5208
- tot = _t;
5209
- }
5210
- };
5211
- BufferList.prototype._reverseOffset = function(blOffset) {
5212
- const bufferId = blOffset[0];
5213
- let offset = blOffset[1];
5214
- for (let i = 0; i < bufferId; i++) {
5215
- offset += this._bufs[i].length;
5216
- }
5217
- return offset;
5218
- };
5219
- BufferList.prototype.get = function get(index) {
5220
- if (index > this.length || index < 0) {
5221
- return void 0;
5222
- }
5223
- const offset = this._offset(index);
5224
- return this._bufs[offset[0]][offset[1]];
5225
- };
5226
- BufferList.prototype.slice = function slice(start, end) {
5227
- if (typeof start === "number" && start < 0) {
5228
- start += this.length;
5229
- }
5230
- if (typeof end === "number" && end < 0) {
5231
- end += this.length;
5232
- }
5233
- return this.copy(null, 0, start, end);
5234
- };
5235
- BufferList.prototype.copy = function copy(dst, dstStart, srcStart, srcEnd) {
5236
- if (typeof srcStart !== "number" || srcStart < 0) {
5237
- srcStart = 0;
5238
- }
5239
- if (typeof srcEnd !== "number" || srcEnd > this.length) {
5240
- srcEnd = this.length;
5241
- }
5242
- if (srcStart >= this.length) {
5243
- return dst || Buffer2.alloc(0);
5244
- }
5245
- if (srcEnd <= 0) {
5246
- return dst || Buffer2.alloc(0);
5247
- }
5248
- const copy2 = !!dst;
5249
- const off = this._offset(srcStart);
5250
- const len = srcEnd - srcStart;
5251
- let bytes = len;
5252
- let bufoff = copy2 && dstStart || 0;
5253
- let start = off[1];
5254
- if (srcStart === 0 && srcEnd === this.length) {
5255
- if (!copy2) {
5256
- return this._bufs.length === 1 ? this._bufs[0] : Buffer2.concat(this._bufs, this.length);
5257
- }
5258
- for (let i = 0; i < this._bufs.length; i++) {
5259
- this._bufs[i].copy(dst, bufoff);
5260
- bufoff += this._bufs[i].length;
5261
- }
5262
- return dst;
5263
- }
5264
- if (bytes <= this._bufs[off[0]].length - start) {
5265
- return copy2 ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) : this._bufs[off[0]].slice(start, start + bytes);
5266
- }
5267
- if (!copy2) {
5268
- dst = Buffer2.allocUnsafe(len);
5269
- }
5270
- for (let i = off[0]; i < this._bufs.length; i++) {
5271
- const l = this._bufs[i].length - start;
5272
- if (bytes > l) {
5273
- this._bufs[i].copy(dst, bufoff, start);
5274
- bufoff += l;
5275
- } else {
5276
- this._bufs[i].copy(dst, bufoff, start, start + bytes);
5277
- bufoff += l;
5278
- break;
5279
- }
5280
- bytes -= l;
5281
- if (start) {
5282
- start = 0;
5283
- }
5284
- }
5285
- if (dst.length > bufoff) return dst.slice(0, bufoff);
5286
- return dst;
5287
- };
5288
- BufferList.prototype.shallowSlice = function shallowSlice(start, end) {
5289
- start = start || 0;
5290
- end = typeof end !== "number" ? this.length : end;
5291
- if (start < 0) {
5292
- start += this.length;
5293
- }
5294
- if (end < 0) {
5295
- end += this.length;
5296
- }
5297
- if (start === end) {
5298
- return this._new();
5299
- }
5300
- const startOffset = this._offset(start);
5301
- const endOffset = this._offset(end);
5302
- const buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1);
5303
- if (endOffset[1] === 0) {
5304
- buffers.pop();
5305
- } else {
5306
- buffers[buffers.length - 1] = buffers[buffers.length - 1].slice(0, endOffset[1]);
5307
- }
5308
- if (startOffset[1] !== 0) {
5309
- buffers[0] = buffers[0].slice(startOffset[1]);
5310
- }
5311
- return this._new(buffers);
5312
- };
5313
- BufferList.prototype.toString = function toString(encoding, start, end) {
5314
- return this.slice(start, end).toString(encoding);
5315
- };
5316
- BufferList.prototype.consume = function consume(bytes) {
5317
- bytes = Math.trunc(bytes);
5318
- if (Number.isNaN(bytes) || bytes <= 0) return this;
5319
- while (this._bufs.length) {
5320
- if (bytes >= this._bufs[0].length) {
5321
- bytes -= this._bufs[0].length;
5322
- this.length -= this._bufs[0].length;
5323
- this._bufs.shift();
5324
- } else {
5325
- this._bufs[0] = this._bufs[0].slice(bytes);
5326
- this.length -= bytes;
5327
- break;
5328
- }
5329
- }
5330
- return this;
5331
- };
5332
- BufferList.prototype.duplicate = function duplicate() {
5333
- const copy = this._new();
5334
- for (let i = 0; i < this._bufs.length; i++) {
5335
- copy.append(this._bufs[i]);
5336
- }
5337
- return copy;
5338
- };
5339
- BufferList.prototype.append = function append(buf) {
5340
- if (buf == null) {
5341
- return this;
5342
- }
5343
- if (buf.buffer) {
5344
- this._appendBuffer(Buffer2.from(buf.buffer, buf.byteOffset, buf.byteLength));
5345
- } else if (Array.isArray(buf)) {
5346
- for (let i = 0; i < buf.length; i++) {
5347
- this.append(buf[i]);
5348
- }
5349
- } else if (this._isBufferList(buf)) {
5350
- for (let i = 0; i < buf._bufs.length; i++) {
5351
- this.append(buf._bufs[i]);
5352
- }
5353
- } else {
5354
- if (typeof buf === "number") {
5355
- buf = buf.toString();
5356
- }
5357
- this._appendBuffer(Buffer2.from(buf));
5358
- }
5359
- return this;
5360
- };
5361
- BufferList.prototype._appendBuffer = function appendBuffer(buf) {
5362
- this._bufs.push(buf);
5363
- this.length += buf.length;
5364
- };
5365
- BufferList.prototype.indexOf = function(search, offset, encoding) {
5366
- if (encoding === void 0 && typeof offset === "string") {
5367
- encoding = offset;
5368
- offset = void 0;
5369
- }
5370
- if (typeof search === "function" || Array.isArray(search)) {
5371
- throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');
5372
- } else if (typeof search === "number") {
5373
- search = Buffer2.from([search]);
5374
- } else if (typeof search === "string") {
5375
- search = Buffer2.from(search, encoding);
5376
- } else if (this._isBufferList(search)) {
5377
- search = search.slice();
5378
- } else if (Array.isArray(search.buffer)) {
5379
- search = Buffer2.from(search.buffer, search.byteOffset, search.byteLength);
5380
- } else if (!Buffer2.isBuffer(search)) {
5381
- search = Buffer2.from(search);
5382
- }
5383
- offset = Number(offset || 0);
5384
- if (isNaN(offset)) {
5385
- offset = 0;
5386
- }
5387
- if (offset < 0) {
5388
- offset = this.length + offset;
5389
- }
5390
- if (offset < 0) {
5391
- offset = 0;
5392
- }
5393
- if (search.length === 0) {
5394
- return offset > this.length ? this.length : offset;
5395
- }
5396
- const blOffset = this._offset(offset);
5397
- let blIndex = blOffset[0];
5398
- let buffOffset = blOffset[1];
5399
- for (; blIndex < this._bufs.length; blIndex++) {
5400
- const buff = this._bufs[blIndex];
5401
- while (buffOffset < buff.length) {
5402
- const availableWindow = buff.length - buffOffset;
5403
- if (availableWindow >= search.length) {
5404
- const nativeSearchResult = buff.indexOf(search, buffOffset);
5405
- if (nativeSearchResult !== -1) {
5406
- return this._reverseOffset([blIndex, nativeSearchResult]);
5407
- }
5408
- buffOffset = buff.length - search.length + 1;
5409
- } else {
5410
- const revOffset = this._reverseOffset([blIndex, buffOffset]);
5411
- if (this._match(revOffset, search)) {
5412
- return revOffset;
5413
- }
5414
- buffOffset++;
5415
- }
5416
- }
5417
- buffOffset = 0;
5418
- }
5419
- return -1;
5420
- };
5421
- BufferList.prototype._match = function(offset, search) {
5422
- if (this.length - offset < search.length) {
5423
- return false;
5424
- }
5425
- for (let searchOffset = 0; searchOffset < search.length; searchOffset++) {
5426
- if (this.get(offset + searchOffset) !== search[searchOffset]) {
5427
- return false;
5428
- }
5429
- }
5430
- return true;
5431
- };
5432
- (function() {
5433
- const methods = {
5434
- readDoubleBE: 8,
5435
- readDoubleLE: 8,
5436
- readFloatBE: 4,
5437
- readFloatLE: 4,
5438
- readInt32BE: 4,
5439
- readInt32LE: 4,
5440
- readUInt32BE: 4,
5441
- readUInt32LE: 4,
5442
- readInt16BE: 2,
5443
- readInt16LE: 2,
5444
- readUInt16BE: 2,
5445
- readUInt16LE: 2,
5446
- readInt8: 1,
5447
- readUInt8: 1,
5448
- readIntBE: null,
5449
- readIntLE: null,
5450
- readUIntBE: null,
5451
- readUIntLE: null
5452
- };
5453
- for (const m in methods) {
5454
- (function(m2) {
5455
- if (methods[m2] === null) {
5456
- BufferList.prototype[m2] = function(offset, byteLength) {
5457
- return this.slice(offset, offset + byteLength)[m2](0, byteLength);
5458
- };
5459
- } else {
5460
- BufferList.prototype[m2] = function(offset = 0) {
5461
- return this.slice(offset, offset + methods[m2])[m2](0);
5462
- };
5463
- }
5464
- })(m);
5465
- }
5466
- })();
5467
- BufferList.prototype._isBufferList = function _isBufferList(b) {
5468
- return b instanceof BufferList || BufferList.isBufferList(b);
5469
- };
5470
- BufferList.isBufferList = function isBufferList(b) {
5471
- return b != null && b[symbol];
5472
- };
5473
- module2.exports = BufferList;
5474
- }
5475
- });
5476
-
5477
- // ../../node_modules/.pnpm/bl@4.1.0/node_modules/bl/bl.js
5478
- var require_bl = __commonJS({
5479
- "../../node_modules/.pnpm/bl@4.1.0/node_modules/bl/bl.js"(exports2, module2) {
5480
- "use strict";
5481
- var DuplexStream = require_readable().Duplex;
5482
- var inherits = require_inherits();
5483
- var BufferList = require_BufferList();
5484
- function BufferListStream(callback) {
5485
- if (!(this instanceof BufferListStream)) {
5486
- return new BufferListStream(callback);
5487
- }
5488
- if (typeof callback === "function") {
5489
- this._callback = callback;
5490
- const piper = function piper2(err) {
5491
- if (this._callback) {
5492
- this._callback(err);
5493
- this._callback = null;
5494
- }
5495
- }.bind(this);
5496
- this.on("pipe", function onPipe(src) {
5497
- src.on("error", piper);
5498
- });
5499
- this.on("unpipe", function onUnpipe(src) {
5500
- src.removeListener("error", piper);
5501
- });
5502
- callback = null;
5503
- }
5504
- BufferList._init.call(this, callback);
5505
- DuplexStream.call(this);
5506
- }
5507
- inherits(BufferListStream, DuplexStream);
5508
- Object.assign(BufferListStream.prototype, BufferList.prototype);
5509
- BufferListStream.prototype._new = function _new(callback) {
5510
- return new BufferListStream(callback);
5511
- };
5512
- BufferListStream.prototype._write = function _write(buf, encoding, callback) {
5513
- this._appendBuffer(buf);
5514
- if (typeof callback === "function") {
5515
- callback();
5516
- }
5517
- };
5518
- BufferListStream.prototype._read = function _read(size) {
5519
- if (!this.length) {
5520
- return this.push(null);
5521
- }
5522
- size = Math.min(size, this.length);
5523
- this.push(this.slice(0, size));
5524
- this.consume(size);
5525
- };
5526
- BufferListStream.prototype.end = function end(chunk) {
5527
- DuplexStream.prototype.end.call(this, chunk);
5528
- if (this._callback) {
5529
- this._callback(null, this.slice());
5530
- this._callback = null;
5531
- }
5532
- };
5533
- BufferListStream.prototype._destroy = function _destroy(err, cb) {
5534
- this._bufs.length = 0;
5535
- this.length = 0;
5536
- cb(err);
5537
- };
5538
- BufferListStream.prototype._isBufferList = function _isBufferList(b) {
5539
- return b instanceof BufferListStream || b instanceof BufferList || BufferListStream.isBufferList(b);
5540
- };
5541
- BufferListStream.isBufferList = BufferList.isBufferList;
5542
- module2.exports = BufferListStream;
5543
- module2.exports.BufferListStream = BufferListStream;
5544
- module2.exports.BufferList = BufferList;
5545
- }
5546
- });
5547
-
5548
- // ../../node_modules/.pnpm/tar-stream@2.2.0/node_modules/tar-stream/headers.js
5549
- var require_headers = __commonJS({
5550
- "../../node_modules/.pnpm/tar-stream@2.2.0/node_modules/tar-stream/headers.js"(exports2) {
5551
- var alloc = Buffer.alloc;
5552
- var ZEROS = "0000000000000000000";
5553
- var SEVENS = "7777777777777777777";
5554
- var ZERO_OFFSET = "0".charCodeAt(0);
5555
- var USTAR_MAGIC = Buffer.from("ustar\0", "binary");
5556
- var USTAR_VER = Buffer.from("00", "binary");
5557
- var GNU_MAGIC = Buffer.from("ustar ", "binary");
5558
- var GNU_VER = Buffer.from(" \0", "binary");
5559
- var MASK = parseInt("7777", 8);
5560
- var MAGIC_OFFSET = 257;
5561
- var VERSION_OFFSET = 263;
5562
- var clamp = function(index, len, defaultValue) {
5563
- if (typeof index !== "number") return defaultValue;
5564
- index = ~~index;
5565
- if (index >= len) return len;
5566
- if (index >= 0) return index;
5567
- index += len;
5568
- if (index >= 0) return index;
5569
- return 0;
5570
- };
5571
- var toType = function(flag) {
5572
- switch (flag) {
5573
- case 0:
5574
- return "file";
5575
- case 1:
5576
- return "link";
5577
- case 2:
5578
- return "symlink";
5579
- case 3:
5580
- return "character-device";
5581
- case 4:
5582
- return "block-device";
5583
- case 5:
5584
- return "directory";
5585
- case 6:
5586
- return "fifo";
5587
- case 7:
5588
- return "contiguous-file";
5589
- case 72:
5590
- return "pax-header";
5591
- case 55:
5592
- return "pax-global-header";
5593
- case 27:
5594
- return "gnu-long-link-path";
5595
- case 28:
5596
- case 30:
5597
- return "gnu-long-path";
5598
- }
5599
- return null;
5600
- };
5601
- var toTypeflag = function(flag) {
5602
- switch (flag) {
5603
- case "file":
5604
- return 0;
5605
- case "link":
5606
- return 1;
5607
- case "symlink":
5608
- return 2;
5609
- case "character-device":
5610
- return 3;
5611
- case "block-device":
5612
- return 4;
5613
- case "directory":
5614
- return 5;
5615
- case "fifo":
5616
- return 6;
5617
- case "contiguous-file":
5618
- return 7;
5619
- case "pax-header":
5620
- return 72;
5621
- }
5622
- return 0;
5623
- };
5624
- var indexOf = function(block, num, offset, end) {
5625
- for (; offset < end; offset++) {
5626
- if (block[offset] === num) return offset;
5627
- }
5628
- return end;
5629
- };
5630
- var cksum = function(block) {
5631
- var sum = 8 * 32;
5632
- for (var i = 0; i < 148; i++) sum += block[i];
5633
- for (var j = 156; j < 512; j++) sum += block[j];
5634
- return sum;
5635
- };
5636
- var encodeOct = function(val, n) {
5637
- val = val.toString(8);
5638
- if (val.length > n) return SEVENS.slice(0, n) + " ";
5639
- else return ZEROS.slice(0, n - val.length) + val + " ";
5640
- };
5641
- function parse256(buf) {
5642
- var positive;
5643
- if (buf[0] === 128) positive = true;
5644
- else if (buf[0] === 255) positive = false;
5645
- else return null;
5646
- var tuple = [];
5647
- for (var i = buf.length - 1; i > 0; i--) {
5648
- var byte = buf[i];
5649
- if (positive) tuple.push(byte);
5650
- else tuple.push(255 - byte);
5651
- }
5652
- var sum = 0;
5653
- var l = tuple.length;
5654
- for (i = 0; i < l; i++) {
5655
- sum += tuple[i] * Math.pow(256, i);
5656
- }
5657
- return positive ? sum : -1 * sum;
5658
- }
5659
- var decodeOct = function(val, offset, length) {
5660
- val = val.slice(offset, offset + length);
5661
- offset = 0;
5662
- if (val[offset] & 128) {
5663
- return parse256(val);
5664
- } else {
5665
- while (offset < val.length && val[offset] === 32) offset++;
5666
- var end = clamp(indexOf(val, 32, offset, val.length), val.length, val.length);
5667
- while (offset < end && val[offset] === 0) offset++;
5668
- if (end === offset) return 0;
5669
- return parseInt(val.slice(offset, end).toString(), 8);
5670
- }
5671
- };
5672
- var decodeStr = function(val, offset, length, encoding) {
5673
- return val.slice(offset, indexOf(val, 0, offset, offset + length)).toString(encoding);
5674
- };
5675
- var addLength = function(str) {
5676
- var len = Buffer.byteLength(str);
5677
- var digits = Math.floor(Math.log(len) / Math.log(10)) + 1;
5678
- if (len + digits >= Math.pow(10, digits)) digits++;
5679
- return len + digits + str;
5680
- };
5681
- exports2.decodeLongPath = function(buf, encoding) {
5682
- return decodeStr(buf, 0, buf.length, encoding);
5683
- };
5684
- exports2.encodePax = function(opts) {
5685
- var result = "";
5686
- if (opts.name) result += addLength(" path=" + opts.name + "\n");
5687
- if (opts.linkname) result += addLength(" linkpath=" + opts.linkname + "\n");
5688
- var pax = opts.pax;
5689
- if (pax) {
5690
- for (var key in pax) {
5691
- result += addLength(" " + key + "=" + pax[key] + "\n");
5692
- }
5693
- }
5694
- return Buffer.from(result);
5695
- };
5696
- exports2.decodePax = function(buf) {
5697
- var result = {};
5698
- while (buf.length) {
5699
- var i = 0;
5700
- while (i < buf.length && buf[i] !== 32) i++;
5701
- var len = parseInt(buf.slice(0, i).toString(), 10);
5702
- if (!len) return result;
5703
- var b = buf.slice(i + 1, len - 1).toString();
5704
- var keyIndex = b.indexOf("=");
5705
- if (keyIndex === -1) return result;
5706
- result[b.slice(0, keyIndex)] = b.slice(keyIndex + 1);
5707
- buf = buf.slice(len);
5708
- }
5709
- return result;
5710
- };
5711
- exports2.encode = function(opts) {
5712
- var buf = alloc(512);
5713
- var name = opts.name;
5714
- var prefix = "";
5715
- if (opts.typeflag === 5 && name[name.length - 1] !== "/") name += "/";
5716
- if (Buffer.byteLength(name) !== name.length) return null;
5717
- while (Buffer.byteLength(name) > 100) {
5718
- var i = name.indexOf("/");
5719
- if (i === -1) return null;
5720
- prefix += prefix ? "/" + name.slice(0, i) : name.slice(0, i);
5721
- name = name.slice(i + 1);
5722
- }
5723
- if (Buffer.byteLength(name) > 100 || Buffer.byteLength(prefix) > 155) return null;
5724
- if (opts.linkname && Buffer.byteLength(opts.linkname) > 100) return null;
5725
- buf.write(name);
5726
- buf.write(encodeOct(opts.mode & MASK, 6), 100);
5727
- buf.write(encodeOct(opts.uid, 6), 108);
5728
- buf.write(encodeOct(opts.gid, 6), 116);
5729
- buf.write(encodeOct(opts.size, 11), 124);
5730
- buf.write(encodeOct(opts.mtime.getTime() / 1e3 | 0, 11), 136);
5731
- buf[156] = ZERO_OFFSET + toTypeflag(opts.type);
5732
- if (opts.linkname) buf.write(opts.linkname, 157);
5733
- USTAR_MAGIC.copy(buf, MAGIC_OFFSET);
5734
- USTAR_VER.copy(buf, VERSION_OFFSET);
5735
- if (opts.uname) buf.write(opts.uname, 265);
5736
- if (opts.gname) buf.write(opts.gname, 297);
5737
- buf.write(encodeOct(opts.devmajor || 0, 6), 329);
5738
- buf.write(encodeOct(opts.devminor || 0, 6), 337);
5739
- if (prefix) buf.write(prefix, 345);
5740
- buf.write(encodeOct(cksum(buf), 6), 148);
5741
- return buf;
5742
- };
5743
- exports2.decode = function(buf, filenameEncoding, allowUnknownFormat) {
5744
- var typeflag = buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET;
5745
- var name = decodeStr(buf, 0, 100, filenameEncoding);
5746
- var mode = decodeOct(buf, 100, 8);
5747
- var uid = decodeOct(buf, 108, 8);
5748
- var gid = decodeOct(buf, 116, 8);
5749
- var size = decodeOct(buf, 124, 12);
5750
- var mtime = decodeOct(buf, 136, 12);
5751
- var type = toType(typeflag);
5752
- var linkname = buf[157] === 0 ? null : decodeStr(buf, 157, 100, filenameEncoding);
5753
- var uname = decodeStr(buf, 265, 32);
5754
- var gname = decodeStr(buf, 297, 32);
5755
- var devmajor = decodeOct(buf, 329, 8);
5756
- var devminor = decodeOct(buf, 337, 8);
5757
- var c = cksum(buf);
5758
- if (c === 8 * 32) return null;
5759
- if (c !== decodeOct(buf, 148, 8)) throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");
5760
- if (USTAR_MAGIC.compare(buf, MAGIC_OFFSET, MAGIC_OFFSET + 6) === 0) {
5761
- if (buf[345]) name = decodeStr(buf, 345, 155, filenameEncoding) + "/" + name;
5762
- } else if (GNU_MAGIC.compare(buf, MAGIC_OFFSET, MAGIC_OFFSET + 6) === 0 && GNU_VER.compare(buf, VERSION_OFFSET, VERSION_OFFSET + 2) === 0) {
5763
- } else {
5764
- if (!allowUnknownFormat) {
5765
- throw new Error("Invalid tar header: unknown format.");
5766
- }
5767
- }
5768
- if (typeflag === 0 && name && name[name.length - 1] === "/") typeflag = 5;
5769
- return {
5770
- name,
5771
- mode,
5772
- uid,
5773
- gid,
5774
- size,
5775
- mtime: new Date(1e3 * mtime),
5776
- type,
5777
- linkname,
5778
- uname,
5779
- gname,
5780
- devmajor,
5781
- devminor
5782
- };
5783
- };
5784
- }
5785
- });
5786
-
5787
- // ../../node_modules/.pnpm/tar-stream@2.2.0/node_modules/tar-stream/extract.js
5788
- var require_extract = __commonJS({
5789
- "../../node_modules/.pnpm/tar-stream@2.2.0/node_modules/tar-stream/extract.js"(exports2, module2) {
5790
- var util = require("util");
5791
- var bl = require_bl();
5792
- var headers = require_headers();
5793
- var Writable = require_readable().Writable;
5794
- var PassThrough = require_readable().PassThrough;
5795
- var noop = function() {
5796
- };
5797
- var overflow = function(size) {
5798
- size &= 511;
5799
- return size && 512 - size;
5800
- };
5801
- var emptyStream = function(self2, offset) {
5802
- var s = new Source(self2, offset);
5803
- s.end();
5804
- return s;
5805
- };
5806
- var mixinPax = function(header, pax) {
5807
- if (pax.path) header.name = pax.path;
5808
- if (pax.linkpath) header.linkname = pax.linkpath;
5809
- if (pax.size) header.size = parseInt(pax.size, 10);
5810
- header.pax = pax;
5811
- return header;
5812
- };
5813
- var Source = function(self2, offset) {
5814
- this._parent = self2;
5815
- this.offset = offset;
5816
- PassThrough.call(this, { autoDestroy: false });
5817
- };
5818
- util.inherits(Source, PassThrough);
5819
- Source.prototype.destroy = function(err) {
5820
- this._parent.destroy(err);
5821
- };
5822
- var Extract = function(opts) {
5823
- if (!(this instanceof Extract)) return new Extract(opts);
5824
- Writable.call(this, opts);
5825
- opts = opts || {};
5826
- this._offset = 0;
5827
- this._buffer = bl();
5828
- this._missing = 0;
5829
- this._partial = false;
5830
- this._onparse = noop;
5831
- this._header = null;
5832
- this._stream = null;
5833
- this._overflow = null;
5834
- this._cb = null;
5835
- this._locked = false;
5836
- this._destroyed = false;
5837
- this._pax = null;
5838
- this._paxGlobal = null;
5839
- this._gnuLongPath = null;
5840
- this._gnuLongLinkPath = null;
5841
- var self2 = this;
5842
- var b = self2._buffer;
5843
- var oncontinue = function() {
5844
- self2._continue();
5845
- };
5846
- var onunlock = function(err) {
5847
- self2._locked = false;
5848
- if (err) return self2.destroy(err);
5849
- if (!self2._stream) oncontinue();
5850
- };
5851
- var onstreamend = function() {
5852
- self2._stream = null;
5853
- var drain = overflow(self2._header.size);
5854
- if (drain) self2._parse(drain, ondrain);
5855
- else self2._parse(512, onheader);
5856
- if (!self2._locked) oncontinue();
5857
- };
5858
- var ondrain = function() {
5859
- self2._buffer.consume(overflow(self2._header.size));
5860
- self2._parse(512, onheader);
5861
- oncontinue();
5862
- };
5863
- var onpaxglobalheader = function() {
5864
- var size = self2._header.size;
5865
- self2._paxGlobal = headers.decodePax(b.slice(0, size));
5866
- b.consume(size);
5867
- onstreamend();
5868
- };
5869
- var onpaxheader = function() {
5870
- var size = self2._header.size;
5871
- self2._pax = headers.decodePax(b.slice(0, size));
5872
- if (self2._paxGlobal) self2._pax = Object.assign({}, self2._paxGlobal, self2._pax);
5873
- b.consume(size);
5874
- onstreamend();
5875
- };
5876
- var ongnulongpath = function() {
5877
- var size = self2._header.size;
5878
- this._gnuLongPath = headers.decodeLongPath(b.slice(0, size), opts.filenameEncoding);
5879
- b.consume(size);
5880
- onstreamend();
5881
- };
5882
- var ongnulonglinkpath = function() {
5883
- var size = self2._header.size;
5884
- this._gnuLongLinkPath = headers.decodeLongPath(b.slice(0, size), opts.filenameEncoding);
5885
- b.consume(size);
5886
- onstreamend();
5887
- };
5888
- var onheader = function() {
5889
- var offset = self2._offset;
5890
- var header;
5891
- try {
5892
- header = self2._header = headers.decode(b.slice(0, 512), opts.filenameEncoding, opts.allowUnknownFormat);
5893
- } catch (err) {
5894
- self2.emit("error", err);
5895
- }
5896
- b.consume(512);
5897
- if (!header) {
5898
- self2._parse(512, onheader);
5899
- oncontinue();
5900
- return;
5901
- }
5902
- if (header.type === "gnu-long-path") {
5903
- self2._parse(header.size, ongnulongpath);
5904
- oncontinue();
5905
- return;
5906
- }
5907
- if (header.type === "gnu-long-link-path") {
5908
- self2._parse(header.size, ongnulonglinkpath);
5909
- oncontinue();
5910
- return;
5911
- }
5912
- if (header.type === "pax-global-header") {
5913
- self2._parse(header.size, onpaxglobalheader);
5914
- oncontinue();
5915
- return;
5916
- }
5917
- if (header.type === "pax-header") {
5918
- self2._parse(header.size, onpaxheader);
5919
- oncontinue();
5920
- return;
5921
- }
5922
- if (self2._gnuLongPath) {
5923
- header.name = self2._gnuLongPath;
5924
- self2._gnuLongPath = null;
5925
- }
5926
- if (self2._gnuLongLinkPath) {
5927
- header.linkname = self2._gnuLongLinkPath;
5928
- self2._gnuLongLinkPath = null;
5929
- }
5930
- if (self2._pax) {
5931
- self2._header = header = mixinPax(header, self2._pax);
5932
- self2._pax = null;
5933
- }
5934
- self2._locked = true;
5935
- if (!header.size || header.type === "directory") {
5936
- self2._parse(512, onheader);
5937
- self2.emit("entry", header, emptyStream(self2, offset), onunlock);
5938
- return;
5939
- }
5940
- self2._stream = new Source(self2, offset);
5941
- self2.emit("entry", header, self2._stream, onunlock);
5942
- self2._parse(header.size, onstreamend);
5943
- oncontinue();
5944
- };
5945
- this._onheader = onheader;
5946
- this._parse(512, onheader);
5947
- };
5948
- util.inherits(Extract, Writable);
5949
- Extract.prototype.destroy = function(err) {
5950
- if (this._destroyed) return;
5951
- this._destroyed = true;
5952
- if (err) this.emit("error", err);
5953
- this.emit("close");
5954
- if (this._stream) this._stream.emit("close");
5955
- };
5956
- Extract.prototype._parse = function(size, onparse) {
5957
- if (this._destroyed) return;
5958
- this._offset += size;
5959
- this._missing = size;
5960
- if (onparse === this._onheader) this._partial = false;
5961
- this._onparse = onparse;
5962
- };
5963
- Extract.prototype._continue = function() {
5964
- if (this._destroyed) return;
5965
- var cb = this._cb;
5966
- this._cb = noop;
5967
- if (this._overflow) this._write(this._overflow, void 0, cb);
5968
- else cb();
5969
- };
5970
- Extract.prototype._write = function(data, enc, cb) {
5971
- if (this._destroyed) return;
5972
- var s = this._stream;
5973
- var b = this._buffer;
5974
- var missing = this._missing;
5975
- if (data.length) this._partial = true;
5976
- if (data.length < missing) {
5977
- this._missing -= data.length;
5978
- this._overflow = null;
5979
- if (s) return s.write(data, cb);
5980
- b.append(data);
5981
- return cb();
5982
- }
5983
- this._cb = cb;
5984
- this._missing = 0;
5985
- var overflow2 = null;
5986
- if (data.length > missing) {
5987
- overflow2 = data.slice(missing);
5988
- data = data.slice(0, missing);
5989
- }
5990
- if (s) s.end(data);
5991
- else b.append(data);
5992
- this._overflow = overflow2;
5993
- this._onparse();
5994
- };
5995
- Extract.prototype._final = function(cb) {
5996
- if (this._partial) return this.destroy(new Error("Unexpected end of data"));
5997
- cb();
5998
- };
5999
- module2.exports = Extract;
6000
- }
6001
- });
6002
-
6003
- // ../../node_modules/.pnpm/fs-constants@1.0.0/node_modules/fs-constants/index.js
6004
- var require_fs_constants = __commonJS({
6005
- "../../node_modules/.pnpm/fs-constants@1.0.0/node_modules/fs-constants/index.js"(exports2, module2) {
6006
- module2.exports = require("fs").constants || require("constants");
6007
- }
6008
- });
6009
-
6010
- // ../../node_modules/.pnpm/wrappy@1.0.2/node_modules/wrappy/wrappy.js
6011
- var require_wrappy = __commonJS({
6012
- "../../node_modules/.pnpm/wrappy@1.0.2/node_modules/wrappy/wrappy.js"(exports2, module2) {
6013
- module2.exports = wrappy;
6014
- function wrappy(fn, cb) {
6015
- if (fn && cb) return wrappy(fn)(cb);
6016
- if (typeof fn !== "function")
6017
- throw new TypeError("need wrapper function");
6018
- Object.keys(fn).forEach(function(k) {
6019
- wrapper[k] = fn[k];
6020
- });
6021
- return wrapper;
6022
- function wrapper() {
6023
- var args = new Array(arguments.length);
6024
- for (var i = 0; i < args.length; i++) {
6025
- args[i] = arguments[i];
6026
- }
6027
- var ret = fn.apply(this, args);
6028
- var cb2 = args[args.length - 1];
6029
- if (typeof ret === "function" && ret !== cb2) {
6030
- Object.keys(cb2).forEach(function(k) {
6031
- ret[k] = cb2[k];
6032
- });
6033
- }
6034
- return ret;
6035
- }
6036
- }
6037
- }
6038
- });
6039
-
6040
- // ../../node_modules/.pnpm/once@1.4.0/node_modules/once/once.js
6041
- var require_once = __commonJS({
6042
- "../../node_modules/.pnpm/once@1.4.0/node_modules/once/once.js"(exports2, module2) {
6043
- var wrappy = require_wrappy();
6044
- module2.exports = wrappy(once);
6045
- module2.exports.strict = wrappy(onceStrict);
6046
- once.proto = once(function() {
6047
- Object.defineProperty(Function.prototype, "once", {
6048
- value: function() {
6049
- return once(this);
6050
- },
6051
- configurable: true
6052
- });
6053
- Object.defineProperty(Function.prototype, "onceStrict", {
6054
- value: function() {
6055
- return onceStrict(this);
6056
- },
6057
- configurable: true
6058
- });
6059
- });
6060
- function once(fn) {
6061
- var f = function() {
6062
- if (f.called) return f.value;
6063
- f.called = true;
6064
- return f.value = fn.apply(this, arguments);
6065
- };
6066
- f.called = false;
6067
- return f;
6068
- }
6069
- function onceStrict(fn) {
6070
- var f = function() {
6071
- if (f.called)
6072
- throw new Error(f.onceError);
6073
- f.called = true;
6074
- return f.value = fn.apply(this, arguments);
6075
- };
6076
- var name = fn.name || "Function wrapped with `once`";
6077
- f.onceError = name + " shouldn't be called more than once";
6078
- f.called = false;
6079
- return f;
6080
- }
2275
+ var line = location.line, column = location.column;
2276
+ if (line < 0 || line >= this.offsets.length) {
2277
+ return null;
2278
+ }
2279
+ if (column < 0 || column > this.lengthOfLine(line)) {
2280
+ return null;
2281
+ }
2282
+ return this.offsets[line] + column;
2283
+ };
2284
+ LinesAndColumns2.prototype.lengthOfLine = function(line) {
2285
+ var offset = this.offsets[line];
2286
+ var nextOffset = line === this.offsets.length - 1 ? this.length : this.offsets[line + 1];
2287
+ return nextOffset - offset;
2288
+ };
2289
+ return LinesAndColumns2;
2290
+ })()
2291
+ );
2292
+ exports2.LinesAndColumns = LinesAndColumns;
6081
2293
  }
6082
2294
  });
6083
2295
 
6084
- // ../../node_modules/.pnpm/end-of-stream@1.4.5/node_modules/end-of-stream/index.js
6085
- var require_end_of_stream2 = __commonJS({
6086
- "../../node_modules/.pnpm/end-of-stream@1.4.5/node_modules/end-of-stream/index.js"(exports2, module2) {
6087
- var once = require_once();
6088
- var noop = function() {
6089
- };
6090
- var qnt = global.Bare ? queueMicrotask : process.nextTick.bind(process);
6091
- var isRequest = function(stream) {
6092
- return stream.setHeader && typeof stream.abort === "function";
2296
+ // ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
2297
+ var require_picocolors = __commonJS({
2298
+ "../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports2, module2) {
2299
+ var p = process || {};
2300
+ var argv = p.argv || [];
2301
+ var env = p.env || {};
2302
+ var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
2303
+ var formatter = (open, close, replace = open) => (input) => {
2304
+ let string = "" + input, index = string.indexOf(close, open.length);
2305
+ return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
6093
2306
  };
6094
- var isChildProcess = function(stream) {
6095
- return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3;
2307
+ var replaceClose = (string, close, replace, index) => {
2308
+ let result = "", cursor = 0;
2309
+ do {
2310
+ result += string.substring(cursor, index) + replace;
2311
+ cursor = index + close.length;
2312
+ index = string.indexOf(close, cursor);
2313
+ } while (~index);
2314
+ return result + string.substring(cursor);
6096
2315
  };
6097
- var eos = function(stream, opts, callback) {
6098
- if (typeof opts === "function") return eos(stream, null, opts);
6099
- if (!opts) opts = {};
6100
- callback = once(callback || noop);
6101
- var ws = stream._writableState;
6102
- var rs = stream._readableState;
6103
- var readable = opts.readable || opts.readable !== false && stream.readable;
6104
- var writable = opts.writable || opts.writable !== false && stream.writable;
6105
- var cancelled = false;
6106
- var onlegacyfinish = function() {
6107
- if (!stream.writable) onfinish();
6108
- };
6109
- var onfinish = function() {
6110
- writable = false;
6111
- if (!readable) callback.call(stream);
6112
- };
6113
- var onend = function() {
6114
- readable = false;
6115
- if (!writable) callback.call(stream);
6116
- };
6117
- var onexit = function(exitCode) {
6118
- callback.call(stream, exitCode ? new Error("exited with error code: " + exitCode) : null);
6119
- };
6120
- var onerror = function(err) {
6121
- callback.call(stream, err);
6122
- };
6123
- var onclose = function() {
6124
- qnt(onclosenexttick);
6125
- };
6126
- var onclosenexttick = function() {
6127
- if (cancelled) return;
6128
- if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error("premature close"));
6129
- if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error("premature close"));
6130
- };
6131
- var onrequest = function() {
6132
- stream.req.on("finish", onfinish);
6133
- };
6134
- if (isRequest(stream)) {
6135
- stream.on("complete", onfinish);
6136
- stream.on("abort", onclose);
6137
- if (stream.req) onrequest();
6138
- else stream.on("request", onrequest);
6139
- } else if (writable && !ws) {
6140
- stream.on("end", onlegacyfinish);
6141
- stream.on("close", onlegacyfinish);
6142
- }
6143
- if (isChildProcess(stream)) stream.on("exit", onexit);
6144
- stream.on("end", onend);
6145
- stream.on("finish", onfinish);
6146
- if (opts.error !== false) stream.on("error", onerror);
6147
- stream.on("close", onclose);
6148
- return function() {
6149
- cancelled = true;
6150
- stream.removeListener("complete", onfinish);
6151
- stream.removeListener("abort", onclose);
6152
- stream.removeListener("request", onrequest);
6153
- if (stream.req) stream.req.removeListener("finish", onfinish);
6154
- stream.removeListener("end", onlegacyfinish);
6155
- stream.removeListener("close", onlegacyfinish);
6156
- stream.removeListener("finish", onfinish);
6157
- stream.removeListener("exit", onexit);
6158
- stream.removeListener("end", onend);
6159
- stream.removeListener("error", onerror);
6160
- stream.removeListener("close", onclose);
2316
+ var createColors = (enabled = isColorSupported) => {
2317
+ let f = enabled ? formatter : () => String;
2318
+ return {
2319
+ isColorSupported: enabled,
2320
+ reset: f("\x1B[0m", "\x1B[0m"),
2321
+ bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
2322
+ dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
2323
+ italic: f("\x1B[3m", "\x1B[23m"),
2324
+ underline: f("\x1B[4m", "\x1B[24m"),
2325
+ inverse: f("\x1B[7m", "\x1B[27m"),
2326
+ hidden: f("\x1B[8m", "\x1B[28m"),
2327
+ strikethrough: f("\x1B[9m", "\x1B[29m"),
2328
+ black: f("\x1B[30m", "\x1B[39m"),
2329
+ red: f("\x1B[31m", "\x1B[39m"),
2330
+ green: f("\x1B[32m", "\x1B[39m"),
2331
+ yellow: f("\x1B[33m", "\x1B[39m"),
2332
+ blue: f("\x1B[34m", "\x1B[39m"),
2333
+ magenta: f("\x1B[35m", "\x1B[39m"),
2334
+ cyan: f("\x1B[36m", "\x1B[39m"),
2335
+ white: f("\x1B[37m", "\x1B[39m"),
2336
+ gray: f("\x1B[90m", "\x1B[39m"),
2337
+ bgBlack: f("\x1B[40m", "\x1B[49m"),
2338
+ bgRed: f("\x1B[41m", "\x1B[49m"),
2339
+ bgGreen: f("\x1B[42m", "\x1B[49m"),
2340
+ bgYellow: f("\x1B[43m", "\x1B[49m"),
2341
+ bgBlue: f("\x1B[44m", "\x1B[49m"),
2342
+ bgMagenta: f("\x1B[45m", "\x1B[49m"),
2343
+ bgCyan: f("\x1B[46m", "\x1B[49m"),
2344
+ bgWhite: f("\x1B[47m", "\x1B[49m"),
2345
+ blackBright: f("\x1B[90m", "\x1B[39m"),
2346
+ redBright: f("\x1B[91m", "\x1B[39m"),
2347
+ greenBright: f("\x1B[92m", "\x1B[39m"),
2348
+ yellowBright: f("\x1B[93m", "\x1B[39m"),
2349
+ blueBright: f("\x1B[94m", "\x1B[39m"),
2350
+ magentaBright: f("\x1B[95m", "\x1B[39m"),
2351
+ cyanBright: f("\x1B[96m", "\x1B[39m"),
2352
+ whiteBright: f("\x1B[97m", "\x1B[39m"),
2353
+ bgBlackBright: f("\x1B[100m", "\x1B[49m"),
2354
+ bgRedBright: f("\x1B[101m", "\x1B[49m"),
2355
+ bgGreenBright: f("\x1B[102m", "\x1B[49m"),
2356
+ bgYellowBright: f("\x1B[103m", "\x1B[49m"),
2357
+ bgBlueBright: f("\x1B[104m", "\x1B[49m"),
2358
+ bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
2359
+ bgCyanBright: f("\x1B[106m", "\x1B[49m"),
2360
+ bgWhiteBright: f("\x1B[107m", "\x1B[49m")
6161
2361
  };
6162
2362
  };
6163
- module2.exports = eos;
2363
+ module2.exports = createColors();
2364
+ module2.exports.createColors = createColors;
6164
2365
  }
6165
2366
  });
6166
2367
 
6167
- // ../../node_modules/.pnpm/tar-stream@2.2.0/node_modules/tar-stream/pack.js
6168
- var require_pack = __commonJS({
6169
- "../../node_modules/.pnpm/tar-stream@2.2.0/node_modules/tar-stream/pack.js"(exports2, module2) {
6170
- var constants = require_fs_constants();
6171
- var eos = require_end_of_stream2();
6172
- var inherits = require_inherits();
6173
- var alloc = Buffer.alloc;
6174
- var Readable = require_readable().Readable;
6175
- var Writable = require_readable().Writable;
6176
- var StringDecoder = require("string_decoder").StringDecoder;
6177
- var headers = require_headers();
6178
- var DMODE = parseInt("755", 8);
6179
- var FMODE = parseInt("644", 8);
6180
- var END_OF_TAR = alloc(1024);
6181
- var noop = function() {
6182
- };
6183
- var overflow = function(self2, size) {
6184
- size &= 511;
6185
- if (size) self2.push(END_OF_TAR.slice(0, 512 - size));
6186
- };
6187
- function modeToType(mode) {
6188
- switch (mode & constants.S_IFMT) {
6189
- case constants.S_IFBLK:
6190
- return "block-device";
6191
- case constants.S_IFCHR:
6192
- return "character-device";
6193
- case constants.S_IFDIR:
6194
- return "directory";
6195
- case constants.S_IFIFO:
6196
- return "fifo";
6197
- case constants.S_IFLNK:
6198
- return "symlink";
6199
- }
6200
- return "file";
6201
- }
6202
- var Sink = function(to) {
6203
- Writable.call(this);
6204
- this.written = 0;
6205
- this._to = to;
6206
- this._destroyed = false;
6207
- };
6208
- inherits(Sink, Writable);
6209
- Sink.prototype._write = function(data, enc, cb) {
6210
- this.written += data.length;
6211
- if (this._to.push(data)) return cb();
6212
- this._to._drain = cb;
6213
- };
6214
- Sink.prototype.destroy = function() {
6215
- if (this._destroyed) return;
6216
- this._destroyed = true;
6217
- this.emit("close");
6218
- };
6219
- var LinkSink = function() {
6220
- Writable.call(this);
6221
- this.linkname = "";
6222
- this._decoder = new StringDecoder("utf-8");
6223
- this._destroyed = false;
6224
- };
6225
- inherits(LinkSink, Writable);
6226
- LinkSink.prototype._write = function(data, enc, cb) {
6227
- this.linkname += this._decoder.write(data);
6228
- cb();
6229
- };
6230
- LinkSink.prototype.destroy = function() {
6231
- if (this._destroyed) return;
6232
- this._destroyed = true;
6233
- this.emit("close");
6234
- };
6235
- var Void = function() {
6236
- Writable.call(this);
6237
- this._destroyed = false;
6238
- };
6239
- inherits(Void, Writable);
6240
- Void.prototype._write = function(data, enc, cb) {
6241
- cb(new Error("No body allowed for this entry"));
6242
- };
6243
- Void.prototype.destroy = function() {
6244
- if (this._destroyed) return;
6245
- this._destroyed = true;
6246
- this.emit("close");
6247
- };
6248
- var Pack = function(opts) {
6249
- if (!(this instanceof Pack)) return new Pack(opts);
6250
- Readable.call(this, opts);
6251
- this._drain = noop;
6252
- this._finalized = false;
6253
- this._finalizing = false;
6254
- this._destroyed = false;
6255
- this._stream = null;
6256
- };
6257
- inherits(Pack, Readable);
6258
- Pack.prototype.entry = function(header, buffer, callback) {
6259
- if (this._stream) throw new Error("already piping an entry");
6260
- if (this._finalized || this._destroyed) return;
6261
- if (typeof buffer === "function") {
6262
- callback = buffer;
6263
- buffer = null;
6264
- }
6265
- if (!callback) callback = noop;
6266
- var self2 = this;
6267
- if (!header.size || header.type === "symlink") header.size = 0;
6268
- if (!header.type) header.type = modeToType(header.mode);
6269
- if (!header.mode) header.mode = header.type === "directory" ? DMODE : FMODE;
6270
- if (!header.uid) header.uid = 0;
6271
- if (!header.gid) header.gid = 0;
6272
- if (!header.mtime) header.mtime = /* @__PURE__ */ new Date();
6273
- if (typeof buffer === "string") buffer = Buffer.from(buffer);
6274
- if (Buffer.isBuffer(buffer)) {
6275
- header.size = buffer.length;
6276
- this._encode(header);
6277
- var ok = this.push(buffer);
6278
- overflow(self2, header.size);
6279
- if (ok) process.nextTick(callback);
6280
- else this._drain = callback;
6281
- return new Void();
6282
- }
6283
- if (header.type === "symlink" && !header.linkname) {
6284
- var linkSink = new LinkSink();
6285
- eos(linkSink, function(err) {
6286
- if (err) {
6287
- self2.destroy();
6288
- return callback(err);
6289
- }
6290
- header.linkname = linkSink.linkname;
6291
- self2._encode(header);
6292
- callback();
6293
- });
6294
- return linkSink;
6295
- }
6296
- this._encode(header);
6297
- if (header.type !== "file" && header.type !== "contiguous-file") {
6298
- process.nextTick(callback);
6299
- return new Void();
6300
- }
6301
- var sink = new Sink(this);
6302
- this._stream = sink;
6303
- eos(sink, function(err) {
6304
- self2._stream = null;
6305
- if (err) {
6306
- self2.destroy();
6307
- return callback(err);
6308
- }
6309
- if (sink.written !== header.size) {
6310
- self2.destroy();
6311
- return callback(new Error("size mismatch"));
6312
- }
6313
- overflow(self2, header.size);
6314
- if (self2._finalizing) self2.finalize();
6315
- callback();
6316
- });
6317
- return sink;
2368
+ // ../../node_modules/.pnpm/nx@23.0.1_@swc-node+register@1.10.9_@swc+core@1.7.26_@swc+helpers@0.5.13__@swc+types@0._96b4efa0a233a5d0734cc4d2a2af3f20/node_modules/nx/dist/src/utils/code-frames.js
2369
+ var require_code_frames = __commonJS({
2370
+ "../../node_modules/.pnpm/nx@23.0.1_@swc-node+register@1.10.9_@swc+core@1.7.26_@swc+helpers@0.5.13__@swc+types@0._96b4efa0a233a5d0734cc4d2a2af3f20/node_modules/nx/dist/src/utils/code-frames.js"(exports2) {
2371
+ "use strict";
2372
+ Object.defineProperty(exports2, "__esModule", { value: true });
2373
+ exports2.codeFrameColumns = codeFrameColumns;
2374
+ var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
2375
+ var pc = tslib_1.__importStar(require_picocolors());
2376
+ var defs = {
2377
+ gutter: pc.gray,
2378
+ marker: (text) => pc.red(pc.bold(text)),
2379
+ message: (text) => pc.red(pc.bold(text))
6318
2380
  };
6319
- Pack.prototype.finalize = function() {
6320
- if (this._stream) {
6321
- this._finalizing = true;
6322
- return;
2381
+ var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
2382
+ function getMarkerLines(loc, source, opts = {}) {
2383
+ const startLoc = {
2384
+ column: 0,
2385
+ line: -1,
2386
+ ...loc.start
2387
+ };
2388
+ const endLoc = {
2389
+ ...startLoc,
2390
+ ...loc.end
2391
+ };
2392
+ const { linesAbove = 2, linesBelow = 3 } = opts || {};
2393
+ const startLine = startLoc.line;
2394
+ const startColumn = startLoc.column;
2395
+ const endLine = endLoc.line;
2396
+ const endColumn = endLoc.column;
2397
+ let start = Math.max(startLine - (linesAbove + 1), 0);
2398
+ let end = Math.min(source.length, endLine + linesBelow);
2399
+ if (startLine === -1) {
2400
+ start = 0;
6323
2401
  }
6324
- if (this._finalized) return;
6325
- this._finalized = true;
6326
- this.push(END_OF_TAR);
6327
- this.push(null);
6328
- };
6329
- Pack.prototype.destroy = function(err) {
6330
- if (this._destroyed) return;
6331
- this._destroyed = true;
6332
- if (err) this.emit("error", err);
6333
- this.emit("close");
6334
- if (this._stream && this._stream.destroy) this._stream.destroy();
6335
- };
6336
- Pack.prototype._encode = function(header) {
6337
- if (!header.pax) {
6338
- var buf = headers.encode(header);
6339
- if (buf) {
6340
- this.push(buf);
6341
- return;
2402
+ if (endLine === -1) {
2403
+ end = source.length;
2404
+ }
2405
+ const lineDiff = endLine - startLine;
2406
+ const markerLines = {};
2407
+ if (lineDiff) {
2408
+ for (let i = 0; i <= lineDiff; i++) {
2409
+ const lineNumber = i + startLine;
2410
+ if (!startColumn) {
2411
+ markerLines[lineNumber] = true;
2412
+ } else if (i === 0) {
2413
+ const sourceLength = source[lineNumber - 1].length;
2414
+ markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
2415
+ } else if (i === lineDiff) {
2416
+ markerLines[lineNumber] = [0, endColumn];
2417
+ } else {
2418
+ const sourceLength = source[lineNumber - i].length;
2419
+ markerLines[lineNumber] = [0, sourceLength];
2420
+ }
2421
+ }
2422
+ } else {
2423
+ if (startColumn === endColumn) {
2424
+ if (startColumn) {
2425
+ markerLines[startLine] = [startColumn, 0];
2426
+ } else {
2427
+ markerLines[startLine] = true;
2428
+ }
2429
+ } else {
2430
+ markerLines[startLine] = [startColumn, endColumn - startColumn];
6342
2431
  }
6343
2432
  }
6344
- this._encodePax(header);
6345
- };
6346
- Pack.prototype._encodePax = function(header) {
6347
- var paxHeader = headers.encodePax({
6348
- name: header.name,
6349
- linkname: header.linkname,
6350
- pax: header.pax
6351
- });
6352
- var newHeader = {
6353
- name: "PaxHeader",
6354
- mode: header.mode,
6355
- uid: header.uid,
6356
- gid: header.gid,
6357
- size: paxHeader.length,
6358
- mtime: header.mtime,
6359
- type: "pax-header",
6360
- linkname: header.linkname && "PaxHeader",
6361
- uname: header.uname,
6362
- gname: header.gname,
6363
- devmajor: header.devmajor,
6364
- devminor: header.devminor
6365
- };
6366
- this.push(headers.encode(newHeader));
6367
- this.push(paxHeader);
6368
- overflow(this, paxHeader.length);
6369
- newHeader.size = header.size;
6370
- newHeader.type = header.type;
6371
- this.push(headers.encode(newHeader));
6372
- };
6373
- Pack.prototype._read = function(n) {
6374
- var drain = this._drain;
6375
- this._drain = noop;
6376
- drain();
6377
- };
6378
- module2.exports = Pack;
2433
+ return { start, end, markerLines };
2434
+ }
2435
+ function codeFrameColumns(rawLines, loc, opts = {}) {
2436
+ const lines = rawLines.split(NEWLINE);
2437
+ const { start, end, markerLines } = getMarkerLines(loc, lines, opts);
2438
+ const numberMaxWidth = String(end).length;
2439
+ const highlightedLines = opts.highlight ? opts.highlight(rawLines) : rawLines;
2440
+ let frame = highlightedLines.split(NEWLINE).slice(start, end).map((line, index) => {
2441
+ const number = start + 1 + index;
2442
+ const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
2443
+ const gutter = ` ${paddedNumber} | `;
2444
+ const hasMarker = markerLines[number];
2445
+ if (hasMarker) {
2446
+ let markerLine = "";
2447
+ if (Array.isArray(hasMarker)) {
2448
+ const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
2449
+ const numberOfMarkers = hasMarker[1] || 1;
2450
+ markerLine = [
2451
+ "\n ",
2452
+ defs.gutter(gutter.replace(/\d/g, " ")),
2453
+ markerSpacing,
2454
+ defs.marker("^").repeat(numberOfMarkers)
2455
+ ].join("");
2456
+ }
2457
+ return [defs.marker(">"), defs.gutter(gutter), line, markerLine].join("");
2458
+ } else {
2459
+ return ` ${defs.gutter(gutter)}${line}`;
2460
+ }
2461
+ }).join("\n");
2462
+ return pc.reset(frame);
2463
+ }
6379
2464
  }
6380
2465
  });
6381
2466
 
6382
- // ../../node_modules/.pnpm/tar-stream@2.2.0/node_modules/tar-stream/index.js
6383
- var require_tar_stream = __commonJS({
6384
- "../../node_modules/.pnpm/tar-stream@2.2.0/node_modules/tar-stream/index.js"(exports2) {
6385
- exports2.extract = require_extract();
6386
- exports2.pack = require_pack();
2467
+ // ../../node_modules/.pnpm/nx@23.0.1_@swc-node+register@1.10.9_@swc+core@1.7.26_@swc+helpers@0.5.13__@swc+types@0._96b4efa0a233a5d0734cc4d2a2af3f20/node_modules/nx/dist/src/utils/json.js
2468
+ var require_json = __commonJS({
2469
+ "../../node_modules/.pnpm/nx@23.0.1_@swc-node+register@1.10.9_@swc+core@1.7.26_@swc+helpers@0.5.13__@swc+types@0._96b4efa0a233a5d0734cc4d2a2af3f20/node_modules/nx/dist/src/utils/json.js"(exports2) {
2470
+ "use strict";
2471
+ Object.defineProperty(exports2, "__esModule", { value: true });
2472
+ exports2.stripJsonComments = void 0;
2473
+ exports2.parseJson = parseJson;
2474
+ exports2.serializeJson = serializeJson;
2475
+ var jsonc_parser_1 = (init_main(), __toCommonJS(main_exports));
2476
+ Object.defineProperty(exports2, "stripJsonComments", { enumerable: true, get: function() {
2477
+ return jsonc_parser_1.stripComments;
2478
+ } });
2479
+ var lines_and_columns_1 = require_build();
2480
+ var code_frames_1 = require_code_frames();
2481
+ function parseJson(input, options) {
2482
+ try {
2483
+ if (options?.expectComments !== true) {
2484
+ return JSON.parse(input);
2485
+ }
2486
+ } catch {
2487
+ }
2488
+ options = { allowTrailingComma: true, ...options };
2489
+ const errors = [];
2490
+ const result = (0, jsonc_parser_1.parse)(input, errors, options);
2491
+ if (errors.length > 0) {
2492
+ throw new Error(formatParseError(input, errors[0]));
2493
+ }
2494
+ return result;
2495
+ }
2496
+ function formatParseError(input, parseError) {
2497
+ const { error, offset, length } = parseError;
2498
+ let { line, column } = new lines_and_columns_1.LinesAndColumns(input).locationForIndex(offset);
2499
+ line++;
2500
+ column++;
2501
+ return `${(0, jsonc_parser_1.printParseErrorCode)(error)} in JSON at ${line}:${column}
2502
+ ` + (0, code_frames_1.codeFrameColumns)(input, {
2503
+ start: { line, column },
2504
+ end: { line, column: column + length }
2505
+ }) + "\n";
2506
+ }
2507
+ function serializeJson(input, options) {
2508
+ return JSON.stringify(input, null, options?.spaces ?? 2);
2509
+ }
6387
2510
  }
6388
2511
  });
6389
2512
 
@@ -9175,9 +5298,9 @@ var require_js_yaml = __commonJS({
9175
5298
  }
9176
5299
  });
9177
5300
 
9178
- // ../../node_modules/.pnpm/nx@22.7.5_@swc-node+register@1.10.9_@swc+core@1.7.26_@swc+helpers@0.5.13__@swc+types@0._8bd88bec35363f4dee6e8456b6c0b9be/node_modules/nx/dist/src/utils/fileutils.js
5301
+ // ../../node_modules/.pnpm/nx@23.0.1_@swc-node+register@1.10.9_@swc+core@1.7.26_@swc+helpers@0.5.13__@swc+types@0._96b4efa0a233a5d0734cc4d2a2af3f20/node_modules/nx/dist/src/utils/fileutils.js
9179
5302
  var require_fileutils = __commonJS({
9180
- "../../node_modules/.pnpm/nx@22.7.5_@swc-node+register@1.10.9_@swc+core@1.7.26_@swc+helpers@0.5.13__@swc+types@0._8bd88bec35363f4dee6e8456b6c0b9be/node_modules/nx/dist/src/utils/fileutils.js"(exports2) {
5303
+ "../../node_modules/.pnpm/nx@23.0.1_@swc-node+register@1.10.9_@swc+core@1.7.26_@swc+helpers@0.5.13__@swc+types@0._96b4efa0a233a5d0734cc4d2a2af3f20/node_modules/nx/dist/src/utils/fileutils.js"(exports2) {
9181
5304
  "use strict";
9182
5305
  Object.defineProperty(exports2, "__esModule", { value: true });
9183
5306
  exports2.readJsonFile = readJsonFile;
@@ -9188,15 +5311,11 @@ var require_fileutils = __commonJS({
9188
5311
  exports2.fileExists = fileExists;
9189
5312
  exports2.createDirectory = createDirectory;
9190
5313
  exports2.isRelativePath = isRelativePath;
9191
- exports2.extractFileFromTarball = extractFileFromTarball;
9192
5314
  exports2.readFileIfExisting = readFileIfExisting;
9193
- var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
9194
5315
  var json_1 = require_json();
9195
5316
  var node_fs_1 = require("fs");
9196
5317
  var promises_1 = require("fs/promises");
9197
5318
  var path_1 = require("path");
9198
- var tar = tslib_1.__importStar(require_tar_stream());
9199
- var zlib_1 = require("zlib");
9200
5319
  function readJsonFile(path, options) {
9201
5320
  const content = (0, node_fs_1.readFileSync)(path, "utf-8");
9202
5321
  if (options) {
@@ -9248,44 +5367,15 @@ var require_fileutils = __commonJS({
9248
5367
  function isRelativePath(path) {
9249
5368
  return path === "." || path === ".." || path.startsWith("./") || path.startsWith("../");
9250
5369
  }
9251
- async function extractFileFromTarball(tarballPath, file, destinationFilePath) {
9252
- return new Promise((resolve, reject) => {
9253
- (0, node_fs_1.mkdirSync)((0, path_1.dirname)(destinationFilePath), { recursive: true });
9254
- var tarExtractStream = tar.extract();
9255
- const destinationFileStream = (0, node_fs_1.createWriteStream)(destinationFilePath);
9256
- let isFileExtracted = false;
9257
- tarExtractStream.on("entry", function(header, stream, next) {
9258
- if (header.name === file) {
9259
- stream.pipe(destinationFileStream);
9260
- stream.on("end", () => {
9261
- isFileExtracted = true;
9262
- });
9263
- destinationFileStream.on("close", () => {
9264
- resolve(destinationFilePath);
9265
- });
9266
- }
9267
- stream.on("end", function() {
9268
- next();
9269
- });
9270
- stream.resume();
9271
- });
9272
- tarExtractStream.on("finish", function() {
9273
- if (!isFileExtracted) {
9274
- reject();
9275
- }
9276
- });
9277
- (0, node_fs_1.createReadStream)(tarballPath).pipe((0, zlib_1.createGunzip)()).pipe(tarExtractStream);
9278
- });
9279
- }
9280
5370
  function readFileIfExisting(path) {
9281
5371
  return (0, node_fs_1.existsSync)(path) ? (0, node_fs_1.readFileSync)(path, "utf-8") : "";
9282
5372
  }
9283
5373
  }
9284
5374
  });
9285
5375
 
9286
- // ../../node_modules/.pnpm/nx@22.7.5_@swc-node+register@1.10.9_@swc+core@1.7.26_@swc+helpers@0.5.13__@swc+types@0._8bd88bec35363f4dee6e8456b6c0b9be/node_modules/nx/dist/src/utils/workspace-root.js
5376
+ // ../../node_modules/.pnpm/nx@23.0.1_@swc-node+register@1.10.9_@swc+core@1.7.26_@swc+helpers@0.5.13__@swc+types@0._96b4efa0a233a5d0734cc4d2a2af3f20/node_modules/nx/dist/src/utils/workspace-root.js
9287
5377
  var require_workspace_root = __commonJS({
9288
- "../../node_modules/.pnpm/nx@22.7.5_@swc-node+register@1.10.9_@swc+core@1.7.26_@swc+helpers@0.5.13__@swc+types@0._8bd88bec35363f4dee6e8456b6c0b9be/node_modules/nx/dist/src/utils/workspace-root.js"(exports2) {
5378
+ "../../node_modules/.pnpm/nx@23.0.1_@swc-node+register@1.10.9_@swc+core@1.7.26_@swc+helpers@0.5.13__@swc+types@0._96b4efa0a233a5d0734cc4d2a2af3f20/node_modules/nx/dist/src/utils/workspace-root.js"(exports2) {
9289
5379
  "use strict";
9290
5380
  Object.defineProperty(exports2, "__esModule", { value: true });
9291
5381
  exports2.workspaceRoot = void 0;
@@ -9319,9 +5409,9 @@ var require_workspace_root = __commonJS({
9319
5409
  }
9320
5410
  });
9321
5411
 
9322
- // ../../node_modules/.pnpm/nx@22.7.5_@swc-node+register@1.10.9_@swc+core@1.7.26_@swc+helpers@0.5.13__@swc+types@0._8bd88bec35363f4dee6e8456b6c0b9be/node_modules/nx/dist/src/utils/find-workspace-root.js
5412
+ // ../../node_modules/.pnpm/nx@23.0.1_@swc-node+register@1.10.9_@swc+core@1.7.26_@swc+helpers@0.5.13__@swc+types@0._96b4efa0a233a5d0734cc4d2a2af3f20/node_modules/nx/dist/src/utils/find-workspace-root.js
9323
5413
  var require_find_workspace_root = __commonJS({
9324
- "../../node_modules/.pnpm/nx@22.7.5_@swc-node+register@1.10.9_@swc+core@1.7.26_@swc+helpers@0.5.13__@swc+types@0._8bd88bec35363f4dee6e8456b6c0b9be/node_modules/nx/dist/src/utils/find-workspace-root.js"(exports2) {
5414
+ "../../node_modules/.pnpm/nx@23.0.1_@swc-node+register@1.10.9_@swc+core@1.7.26_@swc+helpers@0.5.13__@swc+types@0._96b4efa0a233a5d0734cc4d2a2af3f20/node_modules/nx/dist/src/utils/find-workspace-root.js"(exports2) {
9325
5415
  "use strict";
9326
5416
  Object.defineProperty(exports2, "__esModule", { value: true });
9327
5417
  exports2.findWorkspaceRoot = findWorkspaceRoot2;
@@ -9898,8 +5988,3 @@ ${error.message}`,
9898
5988
  stopwatch();
9899
5989
  }
9900
5990
  })();
9901
- /*! Bundled license information:
9902
-
9903
- safe-buffer/index.js:
9904
- (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
9905
- */