@vercel/python 13.0.4 → 14.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -5,6 +5,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
9
  var __commonJS = (cb, mod) => function __require() {
9
10
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
11
  };
@@ -29,6 +30,32 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
30
  mod
30
31
  ));
31
32
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
33
+ var __publicField = (obj, key, value) => {
34
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
35
+ return value;
36
+ };
37
+ var __accessCheck = (obj, member, msg) => {
38
+ if (!member.has(obj))
39
+ throw TypeError("Cannot " + msg);
40
+ };
41
+ var __privateGet = (obj, member, getter) => {
42
+ __accessCheck(obj, member, "read from private field");
43
+ return getter ? getter.call(obj) : member.get(obj);
44
+ };
45
+ var __privateAdd = (obj, member, value) => {
46
+ if (member.has(obj))
47
+ throw TypeError("Cannot add the same private member more than once");
48
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
49
+ };
50
+ var __privateSet = (obj, member, value, setter) => {
51
+ __accessCheck(obj, member, "write to private field");
52
+ setter ? setter.call(obj, value) : member.set(obj, value);
53
+ return value;
54
+ };
55
+ var __privateMethod = (obj, member, method) => {
56
+ __accessCheck(obj, member, "access private method");
57
+ return method;
58
+ };
32
59
 
33
60
  // ../../node_modules/.pnpm/nice-try@1.0.5/node_modules/nice-try/src/index.js
34
61
  var require_src = __commonJS({
@@ -49,7 +76,7 @@ var require_windows = __commonJS({
49
76
  module2.exports = isexe;
50
77
  isexe.sync = sync;
51
78
  var fs19 = require("fs");
52
- function checkPathExt(path, options) {
79
+ function checkPathExt(path2, options) {
53
80
  var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
54
81
  if (!pathext) {
55
82
  return true;
@@ -60,25 +87,25 @@ var require_windows = __commonJS({
60
87
  }
61
88
  for (var i = 0; i < pathext.length; i++) {
62
89
  var p = pathext[i].toLowerCase();
63
- if (p && path.substr(-p.length).toLowerCase() === p) {
90
+ if (p && path2.substr(-p.length).toLowerCase() === p) {
64
91
  return true;
65
92
  }
66
93
  }
67
94
  return false;
68
95
  }
69
- function checkStat(stat, path, options) {
96
+ function checkStat(stat, path2, options) {
70
97
  if (!stat.isSymbolicLink() && !stat.isFile()) {
71
98
  return false;
72
99
  }
73
- return checkPathExt(path, options);
100
+ return checkPathExt(path2, options);
74
101
  }
75
- function isexe(path, options, cb) {
76
- fs19.stat(path, function(er, stat) {
77
- cb(er, er ? false : checkStat(stat, path, options));
102
+ function isexe(path2, options, cb) {
103
+ fs19.stat(path2, function(er, stat) {
104
+ cb(er, er ? false : checkStat(stat, path2, options));
78
105
  });
79
106
  }
80
- function sync(path, options) {
81
- return checkStat(fs19.statSync(path), path, options);
107
+ function sync(path2, options) {
108
+ return checkStat(fs19.statSync(path2), path2, options);
82
109
  }
83
110
  }
84
111
  });
@@ -89,13 +116,13 @@ var require_mode = __commonJS({
89
116
  module2.exports = isexe;
90
117
  isexe.sync = sync;
91
118
  var fs19 = require("fs");
92
- function isexe(path, options, cb) {
93
- fs19.stat(path, function(er, stat) {
119
+ function isexe(path2, options, cb) {
120
+ fs19.stat(path2, function(er, stat) {
94
121
  cb(er, er ? false : checkStat(stat, options));
95
122
  });
96
123
  }
97
- function sync(path, options) {
98
- return checkStat(fs19.statSync(path), options);
124
+ function sync(path2, options) {
125
+ return checkStat(fs19.statSync(path2), options);
99
126
  }
100
127
  function checkStat(stat, options) {
101
128
  return stat.isFile() && checkMode(stat, options);
@@ -128,7 +155,7 @@ var require_isexe = __commonJS({
128
155
  }
129
156
  module2.exports = isexe;
130
157
  isexe.sync = sync;
131
- function isexe(path, options, cb) {
158
+ function isexe(path2, options, cb) {
132
159
  if (typeof options === "function") {
133
160
  cb = options;
134
161
  options = {};
@@ -138,7 +165,7 @@ var require_isexe = __commonJS({
138
165
  throw new TypeError("callback not provided");
139
166
  }
140
167
  return new Promise(function(resolve4, reject) {
141
- isexe(path, options || {}, function(er, is) {
168
+ isexe(path2, options || {}, function(er, is) {
142
169
  if (er) {
143
170
  reject(er);
144
171
  } else {
@@ -147,7 +174,7 @@ var require_isexe = __commonJS({
147
174
  });
148
175
  });
149
176
  }
150
- core(path, options || {}, function(er, is) {
177
+ core(path2, options || {}, function(er, is) {
151
178
  if (er) {
152
179
  if (er.code === "EACCES" || options && options.ignoreErrors) {
153
180
  er = null;
@@ -157,9 +184,9 @@ var require_isexe = __commonJS({
157
184
  cb(er, is);
158
185
  });
159
186
  }
160
- function sync(path, options) {
187
+ function sync(path2, options) {
161
188
  try {
162
- return core.sync(path, options || {});
189
+ return core.sync(path2, options || {});
163
190
  } catch (er) {
164
191
  if (options && options.ignoreErrors || er.code === "EACCES") {
165
192
  return false;
@@ -177,7 +204,7 @@ var require_which = __commonJS({
177
204
  module2.exports = which2;
178
205
  which2.sync = whichSync;
179
206
  var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
180
- var path = require("path");
207
+ var path2 = require("path");
181
208
  var COLON = isWindows ? ";" : ":";
182
209
  var isexe = require_isexe();
183
210
  function getNotFoundError(cmd) {
@@ -226,7 +253,7 @@ var require_which = __commonJS({
226
253
  var pathPart = pathEnv[i];
227
254
  if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
228
255
  pathPart = pathPart.slice(1, -1);
229
- var p = path.join(pathPart, cmd);
256
+ var p = path2.join(pathPart, cmd);
230
257
  if (!pathPart && /^\.[\\\/]/.test(cmd)) {
231
258
  p = cmd.slice(0, 2) + p;
232
259
  }
@@ -234,13 +261,13 @@ var require_which = __commonJS({
234
261
  (function E(ii, ll) {
235
262
  if (ii === ll)
236
263
  return F(i + 1, l);
237
- var ext = pathExt[ii];
238
- isexe(p + ext, { pathExt: pathExtExe }, function(er, is) {
264
+ var ext2 = pathExt[ii];
265
+ isexe(p + ext2, { pathExt: pathExtExe }, function(er, is) {
239
266
  if (!er && is) {
240
267
  if (opt.all)
241
- found.push(p + ext);
268
+ found.push(p + ext2);
242
269
  else
243
- return cb(null, p + ext);
270
+ return cb(null, p + ext2);
244
271
  }
245
272
  return E(ii + 1, ll);
246
273
  });
@@ -258,7 +285,7 @@ var require_which = __commonJS({
258
285
  var pathPart = pathEnv[i];
259
286
  if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
260
287
  pathPart = pathPart.slice(1, -1);
261
- var p = path.join(pathPart, cmd);
288
+ var p = path2.join(pathPart, cmd);
262
289
  if (!pathPart && /^\.[\\\/]/.test(cmd)) {
263
290
  p = cmd.slice(0, 2) + p;
264
291
  }
@@ -306,7 +333,7 @@ var require_path_key = __commonJS({
306
333
  var require_resolveCommand = __commonJS({
307
334
  "../../node_modules/.pnpm/cross-spawn@6.0.5/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module2) {
308
335
  "use strict";
309
- var path = require("path");
336
+ var path2 = require("path");
310
337
  var which2 = require_which();
311
338
  var pathKey = require_path_key()();
312
339
  function resolveCommandAttempt(parsed, withoutPathExt) {
@@ -322,14 +349,14 @@ var require_resolveCommand = __commonJS({
322
349
  try {
323
350
  resolved = which2.sync(parsed.command, {
324
351
  path: (parsed.options.env || process.env)[pathKey],
325
- pathExt: withoutPathExt ? path.delimiter : void 0
352
+ pathExt: withoutPathExt ? path2.delimiter : void 0
326
353
  });
327
354
  } catch (e) {
328
355
  } finally {
329
356
  process.chdir(cwd);
330
357
  }
331
358
  if (resolved) {
332
- resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
359
+ resolved = path2.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
333
360
  }
334
361
  return resolved;
335
362
  }
@@ -379,11 +406,11 @@ var require_shebang_command = __commonJS({
379
406
  "use strict";
380
407
  var shebangRegex = require_shebang_regex();
381
408
  module2.exports = function(str) {
382
- var match = str.match(shebangRegex);
383
- if (!match) {
409
+ var match2 = str.match(shebangRegex);
410
+ if (!match2) {
384
411
  return null;
385
412
  }
386
- var arr = match[0].replace(/#! ?/, "").split(" ");
413
+ var arr = match2[0].replace(/#! ?/, "").split(" ");
387
414
  var bin = arr[0].split("/").pop();
388
415
  var arg = arr[1];
389
416
  return bin === "env" ? arg : bin + (arg ? " " + arg : "");
@@ -809,10 +836,10 @@ var require_semver = __commonJS({
809
836
  }
810
837
  }
811
838
  exports.compareIdentifiers = compareIdentifiers;
812
- var numeric = /^[0-9]+$/;
839
+ var numeric2 = /^[0-9]+$/;
813
840
  function compareIdentifiers(a, b) {
814
- var anum = numeric.test(a);
815
- var bnum = numeric.test(b);
841
+ var anum = numeric2.test(a);
842
+ var bnum = numeric2.test(b);
816
843
  if (anum && bnum) {
817
844
  a = +a;
818
845
  b = +b;
@@ -875,12 +902,12 @@ var require_semver = __commonJS({
875
902
  function neq(a, b, loose) {
876
903
  return compare(a, b, loose) !== 0;
877
904
  }
878
- exports.gte = gte;
879
- function gte(a, b, loose) {
905
+ exports.gte = gte2;
906
+ function gte2(a, b, loose) {
880
907
  return compare(a, b, loose) >= 0;
881
908
  }
882
- exports.lte = lte;
883
- function lte(a, b, loose) {
909
+ exports.lte = lte2;
910
+ function lte2(a, b, loose) {
884
911
  return compare(a, b, loose) <= 0;
885
912
  }
886
913
  exports.cmp = cmp;
@@ -907,11 +934,11 @@ var require_semver = __commonJS({
907
934
  case ">":
908
935
  return gt(a, b, loose);
909
936
  case ">=":
910
- return gte(a, b, loose);
937
+ return gte2(a, b, loose);
911
938
  case "<":
912
939
  return lt(a, b, loose);
913
940
  case "<=":
914
- return lte(a, b, loose);
941
+ return lte2(a, b, loose);
915
942
  default:
916
943
  throw new TypeError("Invalid operator: " + op);
917
944
  }
@@ -1003,32 +1030,32 @@ var require_semver = __commonJS({
1003
1030
  return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan;
1004
1031
  };
1005
1032
  exports.Range = Range;
1006
- function Range(range, options) {
1033
+ function Range(range2, options) {
1007
1034
  if (!options || typeof options !== "object") {
1008
1035
  options = {
1009
1036
  loose: !!options,
1010
1037
  includePrerelease: false
1011
1038
  };
1012
1039
  }
1013
- if (range instanceof Range) {
1014
- if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
1015
- return range;
1040
+ if (range2 instanceof Range) {
1041
+ if (range2.loose === !!options.loose && range2.includePrerelease === !!options.includePrerelease) {
1042
+ return range2;
1016
1043
  } else {
1017
- return new Range(range.raw, options);
1044
+ return new Range(range2.raw, options);
1018
1045
  }
1019
1046
  }
1020
- if (range instanceof Comparator) {
1021
- return new Range(range.value, options);
1047
+ if (range2 instanceof Comparator) {
1048
+ return new Range(range2.value, options);
1022
1049
  }
1023
1050
  if (!(this instanceof Range)) {
1024
- return new Range(range, options);
1051
+ return new Range(range2, options);
1025
1052
  }
1026
1053
  this.options = options;
1027
1054
  this.loose = !!options.loose;
1028
1055
  this.includePrerelease = !!options.includePrerelease;
1029
- this.raw = range.trim().split(/\s+/).join(" ");
1030
- this.set = this.raw.split("||").map(function(range2) {
1031
- return this.parseRange(range2.trim());
1056
+ this.raw = range2.trim().split(/\s+/).join(" ");
1057
+ this.set = this.raw.split("||").map(function(range3) {
1058
+ return this.parseRange(range3.trim());
1032
1059
  }, this).filter(function(c) {
1033
1060
  return c.length;
1034
1061
  });
@@ -1046,17 +1073,17 @@ var require_semver = __commonJS({
1046
1073
  Range.prototype.toString = function() {
1047
1074
  return this.range;
1048
1075
  };
1049
- Range.prototype.parseRange = function(range) {
1076
+ Range.prototype.parseRange = function(range2) {
1050
1077
  var loose = this.options.loose;
1051
1078
  var hr = loose ? safeRe[HYPHENRANGELOOSE] : safeRe[HYPHENRANGE];
1052
- range = range.replace(hr, hyphenReplace);
1053
- debug18("hyphen replace", range);
1054
- range = range.replace(safeRe[COMPARATORTRIM], comparatorTrimReplace);
1055
- debug18("comparator trim", range, safeRe[COMPARATORTRIM]);
1056
- range = range.replace(safeRe[TILDETRIM], tildeTrimReplace);
1057
- range = range.replace(safeRe[CARETTRIM], caretTrimReplace);
1079
+ range2 = range2.replace(hr, hyphenReplace);
1080
+ debug18("hyphen replace", range2);
1081
+ range2 = range2.replace(safeRe[COMPARATORTRIM], comparatorTrimReplace);
1082
+ debug18("comparator trim", range2, safeRe[COMPARATORTRIM]);
1083
+ range2 = range2.replace(safeRe[TILDETRIM], tildeTrimReplace);
1084
+ range2 = range2.replace(safeRe[CARETTRIM], caretTrimReplace);
1058
1085
  var compRe = loose ? safeRe[COMPARATORLOOSE] : safeRe[COMPARATOR];
1059
- var set = range.split(" ").map(function(comp) {
1086
+ var set = range2.split(" ").map(function(comp) {
1060
1087
  return parseComparator(comp, this.options);
1061
1088
  }, this).join(" ").split(/\s+/);
1062
1089
  if (this.options.loose) {
@@ -1069,13 +1096,13 @@ var require_semver = __commonJS({
1069
1096
  }, this);
1070
1097
  return set;
1071
1098
  };
1072
- Range.prototype.intersects = function(range, options) {
1073
- if (!(range instanceof Range)) {
1099
+ Range.prototype.intersects = function(range2, options) {
1100
+ if (!(range2 instanceof Range)) {
1074
1101
  throw new TypeError("a Range is required");
1075
1102
  }
1076
1103
  return this.set.some(function(thisComparators) {
1077
1104
  return thisComparators.every(function(thisComparator) {
1078
- return range.set.some(function(rangeComparators) {
1105
+ return range2.set.some(function(rangeComparators) {
1079
1106
  return rangeComparators.every(function(rangeComparator) {
1080
1107
  return thisComparator.intersects(rangeComparator, options);
1081
1108
  });
@@ -1084,8 +1111,8 @@ var require_semver = __commonJS({
1084
1111
  });
1085
1112
  };
1086
1113
  exports.toComparators = toComparators;
1087
- function toComparators(range, options) {
1088
- return new Range(range, options).set.map(function(comp) {
1114
+ function toComparators(range2, options) {
1115
+ return new Range(range2, options).set.map(function(comp) {
1089
1116
  return comp.map(function(c) {
1090
1117
  return c.value;
1091
1118
  }).join(" ").trim().split(" ");
@@ -1302,20 +1329,20 @@ var require_semver = __commonJS({
1302
1329
  return true;
1303
1330
  }
1304
1331
  exports.satisfies = satisfies;
1305
- function satisfies(version2, range, options) {
1332
+ function satisfies(version2, range2, options) {
1306
1333
  try {
1307
- range = new Range(range, options);
1334
+ range2 = new Range(range2, options);
1308
1335
  } catch (er) {
1309
1336
  return false;
1310
1337
  }
1311
- return range.test(version2);
1338
+ return range2.test(version2);
1312
1339
  }
1313
1340
  exports.maxSatisfying = maxSatisfying;
1314
- function maxSatisfying(versions, range, options) {
1341
+ function maxSatisfying(versions, range2, options) {
1315
1342
  var max = null;
1316
1343
  var maxSV = null;
1317
1344
  try {
1318
- var rangeObj = new Range(range, options);
1345
+ var rangeObj = new Range(range2, options);
1319
1346
  } catch (er) {
1320
1347
  return null;
1321
1348
  }
@@ -1330,11 +1357,11 @@ var require_semver = __commonJS({
1330
1357
  return max;
1331
1358
  }
1332
1359
  exports.minSatisfying = minSatisfying;
1333
- function minSatisfying(versions, range, options) {
1360
+ function minSatisfying(versions, range2, options) {
1334
1361
  var min = null;
1335
1362
  var minSV = null;
1336
1363
  try {
1337
- var rangeObj = new Range(range, options);
1364
+ var rangeObj = new Range(range2, options);
1338
1365
  } catch (er) {
1339
1366
  return null;
1340
1367
  }
@@ -1349,19 +1376,19 @@ var require_semver = __commonJS({
1349
1376
  return min;
1350
1377
  }
1351
1378
  exports.minVersion = minVersion;
1352
- function minVersion(range, loose) {
1353
- range = new Range(range, loose);
1379
+ function minVersion(range2, loose) {
1380
+ range2 = new Range(range2, loose);
1354
1381
  var minver = new SemVer("0.0.0");
1355
- if (range.test(minver)) {
1382
+ if (range2.test(minver)) {
1356
1383
  return minver;
1357
1384
  }
1358
1385
  minver = new SemVer("0.0.0-0");
1359
- if (range.test(minver)) {
1386
+ if (range2.test(minver)) {
1360
1387
  return minver;
1361
1388
  }
1362
1389
  minver = null;
1363
- for (var i2 = 0; i2 < range.set.length; ++i2) {
1364
- var comparators = range.set[i2];
1390
+ for (var i2 = 0; i2 < range2.set.length; ++i2) {
1391
+ var comparators = range2.set[i2];
1365
1392
  comparators.forEach(function(comparator) {
1366
1393
  var compver = new SemVer(comparator.semver.version);
1367
1394
  switch (comparator.operator) {
@@ -1386,43 +1413,43 @@ var require_semver = __commonJS({
1386
1413
  }
1387
1414
  });
1388
1415
  }
1389
- if (minver && range.test(minver)) {
1416
+ if (minver && range2.test(minver)) {
1390
1417
  return minver;
1391
1418
  }
1392
1419
  return null;
1393
1420
  }
1394
1421
  exports.validRange = validRange;
1395
- function validRange(range, options) {
1422
+ function validRange(range2, options) {
1396
1423
  try {
1397
- return new Range(range, options).range || "*";
1424
+ return new Range(range2, options).range || "*";
1398
1425
  } catch (er) {
1399
1426
  return null;
1400
1427
  }
1401
1428
  }
1402
1429
  exports.ltr = ltr;
1403
- function ltr(version2, range, options) {
1404
- return outside(version2, range, "<", options);
1430
+ function ltr(version2, range2, options) {
1431
+ return outside(version2, range2, "<", options);
1405
1432
  }
1406
1433
  exports.gtr = gtr;
1407
- function gtr(version2, range, options) {
1408
- return outside(version2, range, ">", options);
1434
+ function gtr(version2, range2, options) {
1435
+ return outside(version2, range2, ">", options);
1409
1436
  }
1410
1437
  exports.outside = outside;
1411
- function outside(version2, range, hilo, options) {
1438
+ function outside(version2, range2, hilo, options) {
1412
1439
  version2 = new SemVer(version2, options);
1413
- range = new Range(range, options);
1440
+ range2 = new Range(range2, options);
1414
1441
  var gtfn, ltefn, ltfn, comp, ecomp;
1415
1442
  switch (hilo) {
1416
1443
  case ">":
1417
1444
  gtfn = gt;
1418
- ltefn = lte;
1445
+ ltefn = lte2;
1419
1446
  ltfn = lt;
1420
1447
  comp = ">";
1421
1448
  ecomp = ">=";
1422
1449
  break;
1423
1450
  case "<":
1424
1451
  gtfn = lt;
1425
- ltefn = gte;
1452
+ ltefn = gte2;
1426
1453
  ltfn = gt;
1427
1454
  comp = "<";
1428
1455
  ecomp = "<=";
@@ -1430,11 +1457,11 @@ var require_semver = __commonJS({
1430
1457
  default:
1431
1458
  throw new TypeError('Must provide a hilo val of "<" or ">"');
1432
1459
  }
1433
- if (satisfies(version2, range, options)) {
1460
+ if (satisfies(version2, range2, options)) {
1434
1461
  return false;
1435
1462
  }
1436
- for (var i2 = 0; i2 < range.set.length; ++i2) {
1437
- var comparators = range.set[i2];
1463
+ for (var i2 = 0; i2 < range2.set.length; ++i2) {
1464
+ var comparators = range2.set[i2];
1438
1465
  var high = null;
1439
1466
  var low = null;
1440
1467
  comparators.forEach(function(comparator) {
@@ -1479,11 +1506,11 @@ var require_semver = __commonJS({
1479
1506
  if (typeof version2 !== "string") {
1480
1507
  return null;
1481
1508
  }
1482
- var match = version2.match(safeRe[COERCE]);
1483
- if (match == null) {
1509
+ var match2 = version2.match(safeRe[COERCE]);
1510
+ if (match2 == null) {
1484
1511
  return null;
1485
1512
  }
1486
- return parse2(match[1] + "." + (match[2] || "0") + "." + (match[3] || "0"));
1513
+ return parse2(match2[1] + "." + (match2[2] || "0") + "." + (match2[3] || "0"));
1487
1514
  }
1488
1515
  }
1489
1516
  });
@@ -1492,10 +1519,10 @@ var require_semver = __commonJS({
1492
1519
  var require_parse = __commonJS({
1493
1520
  "../../node_modules/.pnpm/cross-spawn@6.0.5/node_modules/cross-spawn/lib/parse.js"(exports, module2) {
1494
1521
  "use strict";
1495
- var path = require("path");
1522
+ var path2 = require("path");
1496
1523
  var niceTry = require_src();
1497
1524
  var resolveCommand = require_resolveCommand();
1498
- var escape = require_escape();
1525
+ var escape2 = require_escape();
1499
1526
  var readShebang = require_readShebang();
1500
1527
  var semver2 = require_semver();
1501
1528
  var isWin3 = process.platform === "win32";
@@ -1520,9 +1547,9 @@ var require_parse = __commonJS({
1520
1547
  const needsShell = !isExecutableRegExp.test(commandFile);
1521
1548
  if (parsed.options.forceShell || needsShell) {
1522
1549
  const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
1523
- parsed.command = path.normalize(parsed.command);
1524
- parsed.command = escape.command(parsed.command);
1525
- parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
1550
+ parsed.command = path2.normalize(parsed.command);
1551
+ parsed.command = escape2.command(parsed.command);
1552
+ parsed.args = parsed.args.map((arg) => escape2.argument(arg, needsDoubleEscapeMetaChars));
1526
1553
  const shellCommand = [parsed.command].concat(parsed.args).join(" ");
1527
1554
  parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
1528
1555
  parsed.command = process.env.comspec || "cmd.exe";
@@ -1673,7 +1700,7 @@ var require_strip_eof = __commonJS({
1673
1700
  var require_npm_run_path = __commonJS({
1674
1701
  "../../node_modules/.pnpm/npm-run-path@2.0.2/node_modules/npm-run-path/index.js"(exports, module2) {
1675
1702
  "use strict";
1676
- var path = require("path");
1703
+ var path2 = require("path");
1677
1704
  var pathKey = require_path_key();
1678
1705
  module2.exports = (opts) => {
1679
1706
  opts = Object.assign({
@@ -1681,24 +1708,24 @@ var require_npm_run_path = __commonJS({
1681
1708
  path: process.env[pathKey()]
1682
1709
  }, opts);
1683
1710
  let prev;
1684
- let pth = path.resolve(opts.cwd);
1711
+ let pth = path2.resolve(opts.cwd);
1685
1712
  const ret = [];
1686
1713
  while (prev !== pth) {
1687
- ret.push(path.join(pth, "node_modules/.bin"));
1714
+ ret.push(path2.join(pth, "node_modules/.bin"));
1688
1715
  prev = pth;
1689
- pth = path.resolve(pth, "..");
1716
+ pth = path2.resolve(pth, "..");
1690
1717
  }
1691
- ret.push(path.dirname(process.execPath));
1692
- return ret.concat(opts.path).join(path.delimiter);
1718
+ ret.push(path2.dirname(process.execPath));
1719
+ return ret.concat(opts.path).join(path2.delimiter);
1693
1720
  };
1694
1721
  module2.exports.env = (opts) => {
1695
1722
  opts = Object.assign({
1696
1723
  env: process.env
1697
1724
  }, opts);
1698
1725
  const env = Object.assign({}, opts.env);
1699
- const path2 = pathKey({ env });
1700
- opts.path = env[path2];
1701
- env[path2] = module2.exports(opts);
1726
+ const path3 = pathKey({ env });
1727
+ opts.path = env[path3];
1728
+ env[path3] = module2.exports(opts);
1702
1729
  return env;
1703
1730
  };
1704
1731
  }
@@ -2360,7 +2387,7 @@ var require_stdio = __commonJS({
2360
2387
  var require_execa = __commonJS({
2361
2388
  "../../node_modules/.pnpm/execa@1.0.0/node_modules/execa/index.js"(exports, module2) {
2362
2389
  "use strict";
2363
- var path = require("path");
2390
+ var path2 = require("path");
2364
2391
  var childProcess = require("child_process");
2365
2392
  var crossSpawn = require_cross_spawn();
2366
2393
  var stripEof = require_strip_eof();
@@ -2413,7 +2440,7 @@ var require_execa = __commonJS({
2413
2440
  if (opts.detached) {
2414
2441
  opts.cleanup = false;
2415
2442
  }
2416
- if (process.platform === "win32" && path.basename(parsed.command) === "cmd.exe") {
2443
+ if (process.platform === "win32" && path2.basename(parsed.command) === "cmd.exe") {
2417
2444
  parsed.args.unshift("/q");
2418
2445
  }
2419
2446
  return {
@@ -2964,7 +2991,7 @@ var require_specifier = __commonJS({
2964
2991
  RANGE_PATTERN,
2965
2992
  parse: parse2,
2966
2993
  satisfies,
2967
- filter,
2994
+ filter: filter2,
2968
2995
  validRange,
2969
2996
  maxSatisfying,
2970
2997
  minSatisfying
@@ -2975,7 +3002,7 @@ var require_specifier = __commonJS({
2975
3002
  if (!ranges.trim()) {
2976
3003
  return [];
2977
3004
  }
2978
- const specifiers = ranges.split(",").map((range) => rangeRegex.exec(range.trim()) || {}).map(({ groups }) => {
3005
+ const specifiers = ranges.split(",").map((range2) => rangeRegex.exec(range2.trim()) || {}).map(({ groups }) => {
2979
3006
  if (!groups) {
2980
3007
  return null;
2981
3008
  }
@@ -3007,19 +3034,19 @@ var require_specifier = __commonJS({
3007
3034
  }
3008
3035
  return specifiers;
3009
3036
  }
3010
- function filter(versions, specifier, options = {}) {
3037
+ function filter2(versions, specifier, options = {}) {
3011
3038
  const filtered = pick(versions, specifier, options);
3012
3039
  if (filtered.length === 0 && options.prereleases === void 0) {
3013
3040
  return pick(versions, specifier, { prereleases: true });
3014
3041
  }
3015
3042
  return filtered;
3016
3043
  }
3017
- function maxSatisfying(versions, range, options) {
3018
- const found = filter(versions, range, options).sort(Operator.compare);
3044
+ function maxSatisfying(versions, range2, options) {
3045
+ const found = filter2(versions, range2, options).sort(Operator.compare);
3019
3046
  return found.length === 0 ? null : found[found.length - 1];
3020
3047
  }
3021
- function minSatisfying(versions, range, options) {
3022
- const found = filter(versions, range, options).sort(Operator.compare);
3048
+ function minSatisfying(versions, range2, options) {
3049
+ const found = filter2(versions, range2, options).sort(Operator.compare);
3023
3050
  return found.length === 0 ? null : found[0];
3024
3051
  }
3025
3052
  function pick(versions, specifier, options) {
@@ -3255,7 +3282,7 @@ var require_pep440 = __commonJS({
3255
3282
  var { valid: valid2, clean, explain, parse: parse2 } = require_version();
3256
3283
  var { lt, le, eq, ne, ge: ge2, gt, compare, rcompare } = require_operator();
3257
3284
  var {
3258
- filter,
3285
+ filter: filter2,
3259
3286
  maxSatisfying,
3260
3287
  minSatisfying,
3261
3288
  RANGE_PATTERN,
@@ -3282,7 +3309,7 @@ var require_pep440 = __commonJS({
3282
3309
  compare,
3283
3310
  rcompare,
3284
3311
  // range
3285
- filter,
3312
+ filter: filter2,
3286
3313
  maxSatisfying,
3287
3314
  minSatisfying,
3288
3315
  RANGE_PATTERN,
@@ -3301,9 +3328,9 @@ var require_pep440 = __commonJS({
3301
3328
  var require_lib = __commonJS({
3302
3329
  "../../node_modules/.pnpm/which@3.0.0/node_modules/which/lib/index.js"(exports, module2) {
3303
3330
  var isexe = require_isexe();
3304
- var { join: join21, delimiter: delimiter2, sep: sep5, posix } = require("path");
3331
+ var { join: join21, delimiter: delimiter2, sep: sep6, posix } = require("path");
3305
3332
  var isWindows = process.platform === "win32";
3306
- var rSlash = new RegExp(`[${posix.sep}${sep5 === posix.sep ? "" : sep5}]`.replace(/(\\)/g, "\\$1"));
3333
+ var rSlash = new RegExp(`[${posix.sep}${sep6 === posix.sep ? "" : sep6}]`.replace(/(\\)/g, "\\$1"));
3307
3334
  var rRel = new RegExp(`^\\.${rSlash.source}`);
3308
3335
  var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
3309
3336
  var getPathInfo = (cmd, {
@@ -3337,8 +3364,8 @@ var require_lib = __commonJS({
3337
3364
  const found = [];
3338
3365
  for (const envPart of pathEnv) {
3339
3366
  const p = getPathPart(envPart, cmd);
3340
- for (const ext of pathExt) {
3341
- const withExt = p + ext;
3367
+ for (const ext2 of pathExt) {
3368
+ const withExt = p + ext2;
3342
3369
  const is = await isexe(withExt, { pathExt: pathExtExe, ignoreErrors: true });
3343
3370
  if (is) {
3344
3371
  if (!opt.all) {
@@ -3361,8 +3388,8 @@ var require_lib = __commonJS({
3361
3388
  const found = [];
3362
3389
  for (const pathEnvPart of pathEnv) {
3363
3390
  const p = getPathPart(pathEnvPart, cmd);
3364
- for (const ext of pathExt) {
3365
- const withExt = p + ext;
3391
+ for (const ext2 of pathExt) {
3392
+ const withExt = p + ext2;
3366
3393
  const is = isexe.sync(withExt, { pathExt: pathExtExe, ignoreErrors: true });
3367
3394
  if (is) {
3368
3395
  if (!opt.all) {
@@ -3806,10 +3833,10 @@ var require_semver2 = __commonJS({
3806
3833
  }
3807
3834
  }
3808
3835
  exports.compareIdentifiers = compareIdentifiers;
3809
- var numeric = /^[0-9]+$/;
3836
+ var numeric2 = /^[0-9]+$/;
3810
3837
  function compareIdentifiers(a, b) {
3811
- var anum = numeric.test(a);
3812
- var bnum = numeric.test(b);
3838
+ var anum = numeric2.test(a);
3839
+ var bnum = numeric2.test(b);
3813
3840
  if (anum && bnum) {
3814
3841
  a = +a;
3815
3842
  b = +b;
@@ -3878,12 +3905,12 @@ var require_semver2 = __commonJS({
3878
3905
  function neq(a, b, loose) {
3879
3906
  return compare(a, b, loose) !== 0;
3880
3907
  }
3881
- exports.gte = gte;
3882
- function gte(a, b, loose) {
3908
+ exports.gte = gte2;
3909
+ function gte2(a, b, loose) {
3883
3910
  return compare(a, b, loose) >= 0;
3884
3911
  }
3885
- exports.lte = lte;
3886
- function lte(a, b, loose) {
3912
+ exports.lte = lte2;
3913
+ function lte2(a, b, loose) {
3887
3914
  return compare(a, b, loose) <= 0;
3888
3915
  }
3889
3916
  exports.cmp = cmp;
@@ -3910,11 +3937,11 @@ var require_semver2 = __commonJS({
3910
3937
  case ">":
3911
3938
  return gt(a, b, loose);
3912
3939
  case ">=":
3913
- return gte(a, b, loose);
3940
+ return gte2(a, b, loose);
3914
3941
  case "<":
3915
3942
  return lt(a, b, loose);
3916
3943
  case "<=":
3917
- return lte(a, b, loose);
3944
+ return lte2(a, b, loose);
3918
3945
  default:
3919
3946
  throw new TypeError("Invalid operator: " + op);
3920
3947
  }
@@ -4016,32 +4043,32 @@ var require_semver2 = __commonJS({
4016
4043
  return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan;
4017
4044
  };
4018
4045
  exports.Range = Range;
4019
- function Range(range, options) {
4046
+ function Range(range2, options) {
4020
4047
  if (!options || typeof options !== "object") {
4021
4048
  options = {
4022
4049
  loose: !!options,
4023
4050
  includePrerelease: false
4024
4051
  };
4025
4052
  }
4026
- if (range instanceof Range) {
4027
- if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
4028
- return range;
4053
+ if (range2 instanceof Range) {
4054
+ if (range2.loose === !!options.loose && range2.includePrerelease === !!options.includePrerelease) {
4055
+ return range2;
4029
4056
  } else {
4030
- return new Range(range.raw, options);
4057
+ return new Range(range2.raw, options);
4031
4058
  }
4032
4059
  }
4033
- if (range instanceof Comparator) {
4034
- return new Range(range.value, options);
4060
+ if (range2 instanceof Comparator) {
4061
+ return new Range(range2.value, options);
4035
4062
  }
4036
4063
  if (!(this instanceof Range)) {
4037
- return new Range(range, options);
4064
+ return new Range(range2, options);
4038
4065
  }
4039
4066
  this.options = options;
4040
4067
  this.loose = !!options.loose;
4041
4068
  this.includePrerelease = !!options.includePrerelease;
4042
- this.raw = range.trim().split(/\s+/).join(" ");
4043
- this.set = this.raw.split("||").map(function(range2) {
4044
- return this.parseRange(range2.trim());
4069
+ this.raw = range2.trim().split(/\s+/).join(" ");
4070
+ this.set = this.raw.split("||").map(function(range3) {
4071
+ return this.parseRange(range3.trim());
4045
4072
  }, this).filter(function(c) {
4046
4073
  return c.length;
4047
4074
  });
@@ -4059,18 +4086,18 @@ var require_semver2 = __commonJS({
4059
4086
  Range.prototype.toString = function() {
4060
4087
  return this.range;
4061
4088
  };
4062
- Range.prototype.parseRange = function(range) {
4089
+ Range.prototype.parseRange = function(range2) {
4063
4090
  var loose = this.options.loose;
4064
4091
  var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE];
4065
- range = range.replace(hr, hyphenReplace);
4066
- debug18("hyphen replace", range);
4067
- range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace);
4068
- debug18("comparator trim", range, safeRe[t.COMPARATORTRIM]);
4069
- range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace);
4070
- range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace);
4071
- range = range.split(/\s+/).join(" ");
4092
+ range2 = range2.replace(hr, hyphenReplace);
4093
+ debug18("hyphen replace", range2);
4094
+ range2 = range2.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace);
4095
+ debug18("comparator trim", range2, safeRe[t.COMPARATORTRIM]);
4096
+ range2 = range2.replace(safeRe[t.TILDETRIM], tildeTrimReplace);
4097
+ range2 = range2.replace(safeRe[t.CARETTRIM], caretTrimReplace);
4098
+ range2 = range2.split(/\s+/).join(" ");
4072
4099
  var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR];
4073
- var set = range.split(" ").map(function(comp) {
4100
+ var set = range2.split(" ").map(function(comp) {
4074
4101
  return parseComparator(comp, this.options);
4075
4102
  }, this).join(" ").split(/\s+/);
4076
4103
  if (this.options.loose) {
@@ -4083,12 +4110,12 @@ var require_semver2 = __commonJS({
4083
4110
  }, this);
4084
4111
  return set;
4085
4112
  };
4086
- Range.prototype.intersects = function(range, options) {
4087
- if (!(range instanceof Range)) {
4113
+ Range.prototype.intersects = function(range2, options) {
4114
+ if (!(range2 instanceof Range)) {
4088
4115
  throw new TypeError("a Range is required");
4089
4116
  }
4090
4117
  return this.set.some(function(thisComparators) {
4091
- return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) {
4118
+ return isSatisfiable(thisComparators, options) && range2.set.some(function(rangeComparators) {
4092
4119
  return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) {
4093
4120
  return rangeComparators.every(function(rangeComparator) {
4094
4121
  return thisComparator.intersects(rangeComparator, options);
@@ -4110,8 +4137,8 @@ var require_semver2 = __commonJS({
4110
4137
  return result;
4111
4138
  }
4112
4139
  exports.toComparators = toComparators;
4113
- function toComparators(range, options) {
4114
- return new Range(range, options).set.map(function(comp) {
4140
+ function toComparators(range2, options) {
4141
+ return new Range(range2, options).set.map(function(comp) {
4115
4142
  return comp.map(function(c) {
4116
4143
  return c.value;
4117
4144
  }).join(" ").trim().split(" ");
@@ -4333,20 +4360,20 @@ var require_semver2 = __commonJS({
4333
4360
  return true;
4334
4361
  }
4335
4362
  exports.satisfies = satisfies;
4336
- function satisfies(version2, range, options) {
4363
+ function satisfies(version2, range2, options) {
4337
4364
  try {
4338
- range = new Range(range, options);
4365
+ range2 = new Range(range2, options);
4339
4366
  } catch (er) {
4340
4367
  return false;
4341
4368
  }
4342
- return range.test(version2);
4369
+ return range2.test(version2);
4343
4370
  }
4344
4371
  exports.maxSatisfying = maxSatisfying;
4345
- function maxSatisfying(versions, range, options) {
4372
+ function maxSatisfying(versions, range2, options) {
4346
4373
  var max = null;
4347
4374
  var maxSV = null;
4348
4375
  try {
4349
- var rangeObj = new Range(range, options);
4376
+ var rangeObj = new Range(range2, options);
4350
4377
  } catch (er) {
4351
4378
  return null;
4352
4379
  }
@@ -4361,11 +4388,11 @@ var require_semver2 = __commonJS({
4361
4388
  return max;
4362
4389
  }
4363
4390
  exports.minSatisfying = minSatisfying;
4364
- function minSatisfying(versions, range, options) {
4391
+ function minSatisfying(versions, range2, options) {
4365
4392
  var min = null;
4366
4393
  var minSV = null;
4367
4394
  try {
4368
- var rangeObj = new Range(range, options);
4395
+ var rangeObj = new Range(range2, options);
4369
4396
  } catch (er) {
4370
4397
  return null;
4371
4398
  }
@@ -4380,19 +4407,19 @@ var require_semver2 = __commonJS({
4380
4407
  return min;
4381
4408
  }
4382
4409
  exports.minVersion = minVersion;
4383
- function minVersion(range, loose) {
4384
- range = new Range(range, loose);
4410
+ function minVersion(range2, loose) {
4411
+ range2 = new Range(range2, loose);
4385
4412
  var minver = new SemVer("0.0.0");
4386
- if (range.test(minver)) {
4413
+ if (range2.test(minver)) {
4387
4414
  return minver;
4388
4415
  }
4389
4416
  minver = new SemVer("0.0.0-0");
4390
- if (range.test(minver)) {
4417
+ if (range2.test(minver)) {
4391
4418
  return minver;
4392
4419
  }
4393
4420
  minver = null;
4394
- for (var i2 = 0; i2 < range.set.length; ++i2) {
4395
- var comparators = range.set[i2];
4421
+ for (var i2 = 0; i2 < range2.set.length; ++i2) {
4422
+ var comparators = range2.set[i2];
4396
4423
  comparators.forEach(function(comparator) {
4397
4424
  var compver = new SemVer(comparator.semver.version);
4398
4425
  switch (comparator.operator) {
@@ -4417,43 +4444,43 @@ var require_semver2 = __commonJS({
4417
4444
  }
4418
4445
  });
4419
4446
  }
4420
- if (minver && range.test(minver)) {
4447
+ if (minver && range2.test(minver)) {
4421
4448
  return minver;
4422
4449
  }
4423
4450
  return null;
4424
4451
  }
4425
4452
  exports.validRange = validRange;
4426
- function validRange(range, options) {
4453
+ function validRange(range2, options) {
4427
4454
  try {
4428
- return new Range(range, options).range || "*";
4455
+ return new Range(range2, options).range || "*";
4429
4456
  } catch (er) {
4430
4457
  return null;
4431
4458
  }
4432
4459
  }
4433
4460
  exports.ltr = ltr;
4434
- function ltr(version2, range, options) {
4435
- return outside(version2, range, "<", options);
4461
+ function ltr(version2, range2, options) {
4462
+ return outside(version2, range2, "<", options);
4436
4463
  }
4437
4464
  exports.gtr = gtr;
4438
- function gtr(version2, range, options) {
4439
- return outside(version2, range, ">", options);
4465
+ function gtr(version2, range2, options) {
4466
+ return outside(version2, range2, ">", options);
4440
4467
  }
4441
4468
  exports.outside = outside;
4442
- function outside(version2, range, hilo, options) {
4469
+ function outside(version2, range2, hilo, options) {
4443
4470
  version2 = new SemVer(version2, options);
4444
- range = new Range(range, options);
4471
+ range2 = new Range(range2, options);
4445
4472
  var gtfn, ltefn, ltfn, comp, ecomp;
4446
4473
  switch (hilo) {
4447
4474
  case ">":
4448
4475
  gtfn = gt;
4449
- ltefn = lte;
4476
+ ltefn = lte2;
4450
4477
  ltfn = lt;
4451
4478
  comp = ">";
4452
4479
  ecomp = ">=";
4453
4480
  break;
4454
4481
  case "<":
4455
4482
  gtfn = lt;
4456
- ltefn = gte;
4483
+ ltefn = gte2;
4457
4484
  ltfn = gt;
4458
4485
  comp = "<";
4459
4486
  ecomp = "<=";
@@ -4461,11 +4488,11 @@ var require_semver2 = __commonJS({
4461
4488
  default:
4462
4489
  throw new TypeError('Must provide a hilo val of "<" or ">"');
4463
4490
  }
4464
- if (satisfies(version2, range, options)) {
4491
+ if (satisfies(version2, range2, options)) {
4465
4492
  return false;
4466
4493
  }
4467
- for (var i2 = 0; i2 < range.set.length; ++i2) {
4468
- var comparators = range.set[i2];
4494
+ for (var i2 = 0; i2 < range2.set.length; ++i2) {
4495
+ var comparators = range2.set[i2];
4469
4496
  var high = null;
4470
4497
  var low = null;
4471
4498
  comparators.forEach(function(comparator) {
@@ -4514,23 +4541,23 @@ var require_semver2 = __commonJS({
4514
4541
  return null;
4515
4542
  }
4516
4543
  options = options || {};
4517
- var match = null;
4544
+ var match2 = null;
4518
4545
  if (!options.rtl) {
4519
- match = version2.match(safeRe[t.COERCE]);
4546
+ match2 = version2.match(safeRe[t.COERCE]);
4520
4547
  } else {
4521
4548
  var next;
4522
- while ((next = safeRe[t.COERCERTL].exec(version2)) && (!match || match.index + match[0].length !== version2.length)) {
4523
- if (!match || next.index + next[0].length !== match.index + match[0].length) {
4524
- match = next;
4549
+ while ((next = safeRe[t.COERCERTL].exec(version2)) && (!match2 || match2.index + match2[0].length !== version2.length)) {
4550
+ if (!match2 || next.index + next[0].length !== match2.index + match2[0].length) {
4551
+ match2 = next;
4525
4552
  }
4526
4553
  safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length;
4527
4554
  }
4528
4555
  safeRe[t.COERCERTL].lastIndex = -1;
4529
4556
  }
4530
- if (match === null) {
4557
+ if (match2 === null) {
4531
4558
  return null;
4532
4559
  }
4533
- return parse2(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options);
4560
+ return parse2(match2[2] + "." + (match2[3] || "0") + "." + (match2[4] || "0"), options);
4534
4561
  }
4535
4562
  }
4536
4563
  });
@@ -4566,16 +4593,16 @@ var require_filesystem = __commonJS({
4566
4593
  var LDD_PATH = "/usr/bin/ldd";
4567
4594
  var SELF_PATH = "/proc/self/exe";
4568
4595
  var MAX_LENGTH = 2048;
4569
- var readFileSync2 = (path) => {
4570
- const fd = fs19.openSync(path, "r");
4596
+ var readFileSync2 = (path2) => {
4597
+ const fd = fs19.openSync(path2, "r");
4571
4598
  const buffer = Buffer.alloc(MAX_LENGTH);
4572
4599
  const bytesRead = fs19.readSync(fd, buffer, 0, MAX_LENGTH, 0);
4573
4600
  fs19.close(fd, () => {
4574
4601
  });
4575
4602
  return buffer.subarray(0, bytesRead);
4576
4603
  };
4577
- var readFile2 = (path) => new Promise((resolve4, reject) => {
4578
- fs19.open(path, "r", (err, fd) => {
4604
+ var readFile2 = (path2) => new Promise((resolve4, reject) => {
4605
+ fs19.open(path2, "r", (err, fd) => {
4579
4606
  if (err) {
4580
4607
  reject(err);
4581
4608
  } else {
@@ -4694,11 +4721,11 @@ var require_detect_libc = __commonJS({
4694
4721
  }
4695
4722
  return null;
4696
4723
  };
4697
- var familyFromInterpreterPath = (path) => {
4698
- if (path) {
4699
- if (path.includes("/ld-musl-")) {
4724
+ var familyFromInterpreterPath = (path2) => {
4725
+ if (path2) {
4726
+ if (path2.includes("/ld-musl-")) {
4700
4727
  return MUSL2;
4701
- } else if (path.includes("/ld-linux-")) {
4728
+ } else if (path2.includes("/ld-linux-")) {
4702
4729
  return GLIBC;
4703
4730
  }
4704
4731
  }
@@ -4745,8 +4772,8 @@ var require_detect_libc = __commonJS({
4745
4772
  cachedFamilyInterpreter = null;
4746
4773
  try {
4747
4774
  const selfContent = await readFile2(SELF_PATH);
4748
- const path = interpreterPath(selfContent);
4749
- cachedFamilyInterpreter = familyFromInterpreterPath(path);
4775
+ const path2 = interpreterPath(selfContent);
4776
+ cachedFamilyInterpreter = familyFromInterpreterPath(path2);
4750
4777
  } catch (e) {
4751
4778
  }
4752
4779
  return cachedFamilyInterpreter;
@@ -4758,8 +4785,8 @@ var require_detect_libc = __commonJS({
4758
4785
  cachedFamilyInterpreter = null;
4759
4786
  try {
4760
4787
  const selfContent = readFileSync2(SELF_PATH);
4761
- const path = interpreterPath(selfContent);
4762
- cachedFamilyInterpreter = familyFromInterpreterPath(path);
4788
+ const path2 = interpreterPath(selfContent);
4789
+ cachedFamilyInterpreter = familyFromInterpreterPath(path2);
4763
4790
  } catch (e) {
4764
4791
  }
4765
4792
  return cachedFamilyInterpreter;
@@ -5029,10 +5056,1591 @@ __export(src_exports, {
5029
5056
  module.exports = __toCommonJS(src_exports);
5030
5057
  var import_assert = __toESM(require("assert"));
5031
5058
  var import_fs20 = __toESM(require("fs"));
5059
+
5060
+ // ../../node_modules/.pnpm/@isaacs+balanced-match@4.0.1/node_modules/@isaacs/balanced-match/dist/esm/index.js
5061
+ var balanced = (a, b, str) => {
5062
+ const ma = a instanceof RegExp ? maybeMatch(a, str) : a;
5063
+ const mb = b instanceof RegExp ? maybeMatch(b, str) : b;
5064
+ const r = ma !== null && mb != null && range(ma, mb, str);
5065
+ return r && {
5066
+ start: r[0],
5067
+ end: r[1],
5068
+ pre: str.slice(0, r[0]),
5069
+ body: str.slice(r[0] + ma.length, r[1]),
5070
+ post: str.slice(r[1] + mb.length)
5071
+ };
5072
+ };
5073
+ var maybeMatch = (reg, str) => {
5074
+ const m = str.match(reg);
5075
+ return m ? m[0] : null;
5076
+ };
5077
+ var range = (a, b, str) => {
5078
+ let begs, beg, left, right = void 0, result;
5079
+ let ai = str.indexOf(a);
5080
+ let bi = str.indexOf(b, ai + 1);
5081
+ let i = ai;
5082
+ if (ai >= 0 && bi > 0) {
5083
+ if (a === b) {
5084
+ return [ai, bi];
5085
+ }
5086
+ begs = [];
5087
+ left = str.length;
5088
+ while (i >= 0 && !result) {
5089
+ if (i === ai) {
5090
+ begs.push(i);
5091
+ ai = str.indexOf(a, i + 1);
5092
+ } else if (begs.length === 1) {
5093
+ const r = begs.pop();
5094
+ if (r !== void 0)
5095
+ result = [r, bi];
5096
+ } else {
5097
+ beg = begs.pop();
5098
+ if (beg !== void 0 && beg < left) {
5099
+ left = beg;
5100
+ right = bi;
5101
+ }
5102
+ bi = str.indexOf(b, i + 1);
5103
+ }
5104
+ i = ai < bi && ai >= 0 ? ai : bi;
5105
+ }
5106
+ if (begs.length && right !== void 0) {
5107
+ result = [left, right];
5108
+ }
5109
+ }
5110
+ return result;
5111
+ };
5112
+
5113
+ // ../../node_modules/.pnpm/@isaacs+brace-expansion@5.0.1/node_modules/@isaacs/brace-expansion/dist/esm/index.js
5114
+ var escSlash = "\0SLASH" + Math.random() + "\0";
5115
+ var escOpen = "\0OPEN" + Math.random() + "\0";
5116
+ var escClose = "\0CLOSE" + Math.random() + "\0";
5117
+ var escComma = "\0COMMA" + Math.random() + "\0";
5118
+ var escPeriod = "\0PERIOD" + Math.random() + "\0";
5119
+ var escSlashPattern = new RegExp(escSlash, "g");
5120
+ var escOpenPattern = new RegExp(escOpen, "g");
5121
+ var escClosePattern = new RegExp(escClose, "g");
5122
+ var escCommaPattern = new RegExp(escComma, "g");
5123
+ var escPeriodPattern = new RegExp(escPeriod, "g");
5124
+ var slashPattern = /\\\\/g;
5125
+ var openPattern = /\\{/g;
5126
+ var closePattern = /\\}/g;
5127
+ var commaPattern = /\\,/g;
5128
+ var periodPattern = /\\./g;
5129
+ var EXPANSION_MAX = 1e5;
5130
+ function numeric(str) {
5131
+ return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
5132
+ }
5133
+ function escapeBraces(str) {
5134
+ return str.replace(slashPattern, escSlash).replace(openPattern, escOpen).replace(closePattern, escClose).replace(commaPattern, escComma).replace(periodPattern, escPeriod);
5135
+ }
5136
+ function unescapeBraces(str) {
5137
+ return str.replace(escSlashPattern, "\\").replace(escOpenPattern, "{").replace(escClosePattern, "}").replace(escCommaPattern, ",").replace(escPeriodPattern, ".");
5138
+ }
5139
+ function parseCommaParts(str) {
5140
+ if (!str) {
5141
+ return [""];
5142
+ }
5143
+ const parts = [];
5144
+ const m = balanced("{", "}", str);
5145
+ if (!m) {
5146
+ return str.split(",");
5147
+ }
5148
+ const { pre, body, post } = m;
5149
+ const p = pre.split(",");
5150
+ p[p.length - 1] += "{" + body + "}";
5151
+ const postParts = parseCommaParts(post);
5152
+ if (post.length) {
5153
+ ;
5154
+ p[p.length - 1] += postParts.shift();
5155
+ p.push.apply(p, postParts);
5156
+ }
5157
+ parts.push.apply(parts, p);
5158
+ return parts;
5159
+ }
5160
+ function expand(str, options = {}) {
5161
+ if (!str) {
5162
+ return [];
5163
+ }
5164
+ const { max = EXPANSION_MAX } = options;
5165
+ if (str.slice(0, 2) === "{}") {
5166
+ str = "\\{\\}" + str.slice(2);
5167
+ }
5168
+ return expand_(escapeBraces(str), max, true).map(unescapeBraces);
5169
+ }
5170
+ function embrace(str) {
5171
+ return "{" + str + "}";
5172
+ }
5173
+ function isPadded(el) {
5174
+ return /^-?0\d/.test(el);
5175
+ }
5176
+ function lte(i, y) {
5177
+ return i <= y;
5178
+ }
5179
+ function gte(i, y) {
5180
+ return i >= y;
5181
+ }
5182
+ function expand_(str, max, isTop) {
5183
+ const expansions = [];
5184
+ const m = balanced("{", "}", str);
5185
+ if (!m)
5186
+ return [str];
5187
+ const pre = m.pre;
5188
+ const post = m.post.length ? expand_(m.post, max, false) : [""];
5189
+ if (/\$$/.test(m.pre)) {
5190
+ for (let k = 0; k < post.length && k < max; k++) {
5191
+ const expansion = pre + "{" + m.body + "}" + post[k];
5192
+ expansions.push(expansion);
5193
+ }
5194
+ } else {
5195
+ const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
5196
+ const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
5197
+ const isSequence = isNumericSequence || isAlphaSequence;
5198
+ const isOptions = m.body.indexOf(",") >= 0;
5199
+ if (!isSequence && !isOptions) {
5200
+ if (m.post.match(/,(?!,).*\}/)) {
5201
+ str = m.pre + "{" + m.body + escClose + m.post;
5202
+ return expand_(str, max, true);
5203
+ }
5204
+ return [str];
5205
+ }
5206
+ let n;
5207
+ if (isSequence) {
5208
+ n = m.body.split(/\.\./);
5209
+ } else {
5210
+ n = parseCommaParts(m.body);
5211
+ if (n.length === 1 && n[0] !== void 0) {
5212
+ n = expand_(n[0], max, false).map(embrace);
5213
+ if (n.length === 1) {
5214
+ return post.map((p) => m.pre + n[0] + p);
5215
+ }
5216
+ }
5217
+ }
5218
+ let N;
5219
+ if (isSequence && n[0] !== void 0 && n[1] !== void 0) {
5220
+ const x = numeric(n[0]);
5221
+ const y = numeric(n[1]);
5222
+ const width = Math.max(n[0].length, n[1].length);
5223
+ let incr = n.length === 3 && n[2] !== void 0 ? Math.abs(numeric(n[2])) : 1;
5224
+ let test = lte;
5225
+ const reverse = y < x;
5226
+ if (reverse) {
5227
+ incr *= -1;
5228
+ test = gte;
5229
+ }
5230
+ const pad = n.some(isPadded);
5231
+ N = [];
5232
+ for (let i = x; test(i, y); i += incr) {
5233
+ let c;
5234
+ if (isAlphaSequence) {
5235
+ c = String.fromCharCode(i);
5236
+ if (c === "\\") {
5237
+ c = "";
5238
+ }
5239
+ } else {
5240
+ c = String(i);
5241
+ if (pad) {
5242
+ const need = width - c.length;
5243
+ if (need > 0) {
5244
+ const z = new Array(need + 1).join("0");
5245
+ if (i < 0) {
5246
+ c = "-" + z + c.slice(1);
5247
+ } else {
5248
+ c = z + c;
5249
+ }
5250
+ }
5251
+ }
5252
+ }
5253
+ N.push(c);
5254
+ }
5255
+ } else {
5256
+ N = [];
5257
+ for (let j = 0; j < n.length; j++) {
5258
+ N.push.apply(N, expand_(n[j], max, false));
5259
+ }
5260
+ }
5261
+ for (let j = 0; j < N.length; j++) {
5262
+ for (let k = 0; k < post.length && expansions.length < max; k++) {
5263
+ const expansion = pre + N[j] + post[k];
5264
+ if (!isTop || isSequence || expansion) {
5265
+ expansions.push(expansion);
5266
+ }
5267
+ }
5268
+ }
5269
+ }
5270
+ return expansions;
5271
+ }
5272
+
5273
+ // ../../node_modules/.pnpm/minimatch@10.1.1/node_modules/minimatch/dist/esm/assert-valid-pattern.js
5274
+ var MAX_PATTERN_LENGTH = 1024 * 64;
5275
+ var assertValidPattern = (pattern) => {
5276
+ if (typeof pattern !== "string") {
5277
+ throw new TypeError("invalid pattern");
5278
+ }
5279
+ if (pattern.length > MAX_PATTERN_LENGTH) {
5280
+ throw new TypeError("pattern is too long");
5281
+ }
5282
+ };
5283
+
5284
+ // ../../node_modules/.pnpm/minimatch@10.1.1/node_modules/minimatch/dist/esm/brace-expressions.js
5285
+ var posixClasses = {
5286
+ "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
5287
+ "[:alpha:]": ["\\p{L}\\p{Nl}", true],
5288
+ "[:ascii:]": ["\\x00-\\x7f", false],
5289
+ "[:blank:]": ["\\p{Zs}\\t", true],
5290
+ "[:cntrl:]": ["\\p{Cc}", true],
5291
+ "[:digit:]": ["\\p{Nd}", true],
5292
+ "[:graph:]": ["\\p{Z}\\p{C}", true, true],
5293
+ "[:lower:]": ["\\p{Ll}", true],
5294
+ "[:print:]": ["\\p{C}", true],
5295
+ "[:punct:]": ["\\p{P}", true],
5296
+ "[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", true],
5297
+ "[:upper:]": ["\\p{Lu}", true],
5298
+ "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true],
5299
+ "[:xdigit:]": ["A-Fa-f0-9", false]
5300
+ };
5301
+ var braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&");
5302
+ var regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
5303
+ var rangesToString = (ranges) => ranges.join("");
5304
+ var parseClass = (glob2, position) => {
5305
+ const pos = position;
5306
+ if (glob2.charAt(pos) !== "[") {
5307
+ throw new Error("not in a brace expression");
5308
+ }
5309
+ const ranges = [];
5310
+ const negs = [];
5311
+ let i = pos + 1;
5312
+ let sawStart = false;
5313
+ let uflag = false;
5314
+ let escaping = false;
5315
+ let negate = false;
5316
+ let endPos = pos;
5317
+ let rangeStart = "";
5318
+ WHILE:
5319
+ while (i < glob2.length) {
5320
+ const c = glob2.charAt(i);
5321
+ if ((c === "!" || c === "^") && i === pos + 1) {
5322
+ negate = true;
5323
+ i++;
5324
+ continue;
5325
+ }
5326
+ if (c === "]" && sawStart && !escaping) {
5327
+ endPos = i + 1;
5328
+ break;
5329
+ }
5330
+ sawStart = true;
5331
+ if (c === "\\") {
5332
+ if (!escaping) {
5333
+ escaping = true;
5334
+ i++;
5335
+ continue;
5336
+ }
5337
+ }
5338
+ if (c === "[" && !escaping) {
5339
+ for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
5340
+ if (glob2.startsWith(cls, i)) {
5341
+ if (rangeStart) {
5342
+ return ["$.", false, glob2.length - pos, true];
5343
+ }
5344
+ i += cls.length;
5345
+ if (neg)
5346
+ negs.push(unip);
5347
+ else
5348
+ ranges.push(unip);
5349
+ uflag = uflag || u;
5350
+ continue WHILE;
5351
+ }
5352
+ }
5353
+ }
5354
+ escaping = false;
5355
+ if (rangeStart) {
5356
+ if (c > rangeStart) {
5357
+ ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c));
5358
+ } else if (c === rangeStart) {
5359
+ ranges.push(braceEscape(c));
5360
+ }
5361
+ rangeStart = "";
5362
+ i++;
5363
+ continue;
5364
+ }
5365
+ if (glob2.startsWith("-]", i + 1)) {
5366
+ ranges.push(braceEscape(c + "-"));
5367
+ i += 2;
5368
+ continue;
5369
+ }
5370
+ if (glob2.startsWith("-", i + 1)) {
5371
+ rangeStart = c;
5372
+ i += 2;
5373
+ continue;
5374
+ }
5375
+ ranges.push(braceEscape(c));
5376
+ i++;
5377
+ }
5378
+ if (endPos < i) {
5379
+ return ["", false, 0, false];
5380
+ }
5381
+ if (!ranges.length && !negs.length) {
5382
+ return ["$.", false, glob2.length - pos, true];
5383
+ }
5384
+ if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) {
5385
+ const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
5386
+ return [regexpEscape(r), false, endPos - pos, false];
5387
+ }
5388
+ const sranges = "[" + (negate ? "^" : "") + rangesToString(ranges) + "]";
5389
+ const snegs = "[" + (negate ? "" : "^") + rangesToString(negs) + "]";
5390
+ const comb = ranges.length && negs.length ? "(" + sranges + "|" + snegs + ")" : ranges.length ? sranges : snegs;
5391
+ return [comb, uflag, endPos - pos, true];
5392
+ };
5393
+
5394
+ // ../../node_modules/.pnpm/minimatch@10.1.1/node_modules/minimatch/dist/esm/unescape.js
5395
+ var unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true } = {}) => {
5396
+ if (magicalBraces) {
5397
+ return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
5398
+ }
5399
+ return windowsPathsNoEscape ? s.replace(/\[([^\/\\{}])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, "$1$2").replace(/\\([^\/{}])/g, "$1");
5400
+ };
5401
+
5402
+ // ../../node_modules/.pnpm/minimatch@10.1.1/node_modules/minimatch/dist/esm/ast.js
5403
+ var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
5404
+ var isExtglobType = (c) => types.has(c);
5405
+ var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
5406
+ var startNoDot = "(?!\\.)";
5407
+ var addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
5408
+ var justDots = /* @__PURE__ */ new Set(["..", "."]);
5409
+ var reSpecials = new Set("().*{}+?[]^$\\!");
5410
+ var regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
5411
+ var qmark = "[^/]";
5412
+ var star = qmark + "*?";
5413
+ var starNoEmpty = qmark + "+?";
5414
+ var _root, _hasMagic, _uflag, _parts, _parent, _parentIndex, _negs, _filledNegs, _options, _toString, _emptyExt, _fillNegs, fillNegs_fn, _parseAST, parseAST_fn, _partsToRegExp, partsToRegExp_fn, _parseGlob, parseGlob_fn;
5415
+ var _AST = class _AST {
5416
+ constructor(type, parent, options = {}) {
5417
+ __privateAdd(this, _fillNegs);
5418
+ __privateAdd(this, _partsToRegExp);
5419
+ __publicField(this, "type");
5420
+ __privateAdd(this, _root, void 0);
5421
+ __privateAdd(this, _hasMagic, void 0);
5422
+ __privateAdd(this, _uflag, false);
5423
+ __privateAdd(this, _parts, []);
5424
+ __privateAdd(this, _parent, void 0);
5425
+ __privateAdd(this, _parentIndex, void 0);
5426
+ __privateAdd(this, _negs, void 0);
5427
+ __privateAdd(this, _filledNegs, false);
5428
+ __privateAdd(this, _options, void 0);
5429
+ __privateAdd(this, _toString, void 0);
5430
+ // set to true if it's an extglob with no children
5431
+ // (which really means one child of '')
5432
+ __privateAdd(this, _emptyExt, false);
5433
+ this.type = type;
5434
+ if (type)
5435
+ __privateSet(this, _hasMagic, true);
5436
+ __privateSet(this, _parent, parent);
5437
+ __privateSet(this, _root, __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _root) : this);
5438
+ __privateSet(this, _options, __privateGet(this, _root) === this ? options : __privateGet(__privateGet(this, _root), _options));
5439
+ __privateSet(this, _negs, __privateGet(this, _root) === this ? [] : __privateGet(__privateGet(this, _root), _negs));
5440
+ if (type === "!" && !__privateGet(__privateGet(this, _root), _filledNegs))
5441
+ __privateGet(this, _negs).push(this);
5442
+ __privateSet(this, _parentIndex, __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _parts).length : 0);
5443
+ }
5444
+ get hasMagic() {
5445
+ if (__privateGet(this, _hasMagic) !== void 0)
5446
+ return __privateGet(this, _hasMagic);
5447
+ for (const p of __privateGet(this, _parts)) {
5448
+ if (typeof p === "string")
5449
+ continue;
5450
+ if (p.type || p.hasMagic)
5451
+ return __privateSet(this, _hasMagic, true);
5452
+ }
5453
+ return __privateGet(this, _hasMagic);
5454
+ }
5455
+ // reconstructs the pattern
5456
+ toString() {
5457
+ if (__privateGet(this, _toString) !== void 0)
5458
+ return __privateGet(this, _toString);
5459
+ if (!this.type) {
5460
+ return __privateSet(this, _toString, __privateGet(this, _parts).map((p) => String(p)).join(""));
5461
+ } else {
5462
+ return __privateSet(this, _toString, this.type + "(" + __privateGet(this, _parts).map((p) => String(p)).join("|") + ")");
5463
+ }
5464
+ }
5465
+ push(...parts) {
5466
+ for (const p of parts) {
5467
+ if (p === "")
5468
+ continue;
5469
+ if (typeof p !== "string" && !(p instanceof _AST && __privateGet(p, _parent) === this)) {
5470
+ throw new Error("invalid part: " + p);
5471
+ }
5472
+ __privateGet(this, _parts).push(p);
5473
+ }
5474
+ }
5475
+ toJSON() {
5476
+ const ret = this.type === null ? __privateGet(this, _parts).slice().map((p) => typeof p === "string" ? p : p.toJSON()) : [this.type, ...__privateGet(this, _parts).map((p) => p.toJSON())];
5477
+ if (this.isStart() && !this.type)
5478
+ ret.unshift([]);
5479
+ if (this.isEnd() && (this === __privateGet(this, _root) || __privateGet(__privateGet(this, _root), _filledNegs) && __privateGet(this, _parent)?.type === "!")) {
5480
+ ret.push({});
5481
+ }
5482
+ return ret;
5483
+ }
5484
+ isStart() {
5485
+ if (__privateGet(this, _root) === this)
5486
+ return true;
5487
+ if (!__privateGet(this, _parent)?.isStart())
5488
+ return false;
5489
+ if (__privateGet(this, _parentIndex) === 0)
5490
+ return true;
5491
+ const p = __privateGet(this, _parent);
5492
+ for (let i = 0; i < __privateGet(this, _parentIndex); i++) {
5493
+ const pp = __privateGet(p, _parts)[i];
5494
+ if (!(pp instanceof _AST && pp.type === "!")) {
5495
+ return false;
5496
+ }
5497
+ }
5498
+ return true;
5499
+ }
5500
+ isEnd() {
5501
+ if (__privateGet(this, _root) === this)
5502
+ return true;
5503
+ if (__privateGet(this, _parent)?.type === "!")
5504
+ return true;
5505
+ if (!__privateGet(this, _parent)?.isEnd())
5506
+ return false;
5507
+ if (!this.type)
5508
+ return __privateGet(this, _parent)?.isEnd();
5509
+ const pl = __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _parts).length : 0;
5510
+ return __privateGet(this, _parentIndex) === pl - 1;
5511
+ }
5512
+ copyIn(part) {
5513
+ if (typeof part === "string")
5514
+ this.push(part);
5515
+ else
5516
+ this.push(part.clone(this));
5517
+ }
5518
+ clone(parent) {
5519
+ const c = new _AST(this.type, parent);
5520
+ for (const p of __privateGet(this, _parts)) {
5521
+ c.copyIn(p);
5522
+ }
5523
+ return c;
5524
+ }
5525
+ static fromGlob(pattern, options = {}) {
5526
+ var _a;
5527
+ const ast = new _AST(null, void 0, options);
5528
+ __privateMethod(_a = _AST, _parseAST, parseAST_fn).call(_a, pattern, ast, 0, options);
5529
+ return ast;
5530
+ }
5531
+ // returns the regular expression if there's magic, or the unescaped
5532
+ // string if not.
5533
+ toMMPattern() {
5534
+ if (this !== __privateGet(this, _root))
5535
+ return __privateGet(this, _root).toMMPattern();
5536
+ const glob2 = this.toString();
5537
+ const [re, body, hasMagic, uflag] = this.toRegExpSource();
5538
+ const anyMagic = hasMagic || __privateGet(this, _hasMagic) || __privateGet(this, _options).nocase && !__privateGet(this, _options).nocaseMagicOnly && glob2.toUpperCase() !== glob2.toLowerCase();
5539
+ if (!anyMagic) {
5540
+ return body;
5541
+ }
5542
+ const flags = (__privateGet(this, _options).nocase ? "i" : "") + (uflag ? "u" : "");
5543
+ return Object.assign(new RegExp(`^${re}$`, flags), {
5544
+ _src: re,
5545
+ _glob: glob2
5546
+ });
5547
+ }
5548
+ get options() {
5549
+ return __privateGet(this, _options);
5550
+ }
5551
+ // returns the string match, the regexp source, whether there's magic
5552
+ // in the regexp (so a regular expression is required) and whether or
5553
+ // not the uflag is needed for the regular expression (for posix classes)
5554
+ // TODO: instead of injecting the start/end at this point, just return
5555
+ // the BODY of the regexp, along with the start/end portions suitable
5556
+ // for binding the start/end in either a joined full-path makeRe context
5557
+ // (where we bind to (^|/), or a standalone matchPart context (where
5558
+ // we bind to ^, and not /). Otherwise slashes get duped!
5559
+ //
5560
+ // In part-matching mode, the start is:
5561
+ // - if not isStart: nothing
5562
+ // - if traversal possible, but not allowed: ^(?!\.\.?$)
5563
+ // - if dots allowed or not possible: ^
5564
+ // - if dots possible and not allowed: ^(?!\.)
5565
+ // end is:
5566
+ // - if not isEnd(): nothing
5567
+ // - else: $
5568
+ //
5569
+ // In full-path matching mode, we put the slash at the START of the
5570
+ // pattern, so start is:
5571
+ // - if first pattern: same as part-matching mode
5572
+ // - if not isStart(): nothing
5573
+ // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
5574
+ // - if dots allowed or not possible: /
5575
+ // - if dots possible and not allowed: /(?!\.)
5576
+ // end is:
5577
+ // - if last pattern, same as part-matching mode
5578
+ // - else nothing
5579
+ //
5580
+ // Always put the (?:$|/) on negated tails, though, because that has to be
5581
+ // there to bind the end of the negated pattern portion, and it's easier to
5582
+ // just stick it in now rather than try to inject it later in the middle of
5583
+ // the pattern.
5584
+ //
5585
+ // We can just always return the same end, and leave it up to the caller
5586
+ // to know whether it's going to be used joined or in parts.
5587
+ // And, if the start is adjusted slightly, can do the same there:
5588
+ // - if not isStart: nothing
5589
+ // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
5590
+ // - if dots allowed or not possible: (?:/|^)
5591
+ // - if dots possible and not allowed: (?:/|^)(?!\.)
5592
+ //
5593
+ // But it's better to have a simpler binding without a conditional, for
5594
+ // performance, so probably better to return both start options.
5595
+ //
5596
+ // Then the caller just ignores the end if it's not the first pattern,
5597
+ // and the start always gets applied.
5598
+ //
5599
+ // But that's always going to be $ if it's the ending pattern, or nothing,
5600
+ // so the caller can just attach $ at the end of the pattern when building.
5601
+ //
5602
+ // So the todo is:
5603
+ // - better detect what kind of start is needed
5604
+ // - return both flavors of starting pattern
5605
+ // - attach $ at the end of the pattern when creating the actual RegExp
5606
+ //
5607
+ // Ah, but wait, no, that all only applies to the root when the first pattern
5608
+ // is not an extglob. If the first pattern IS an extglob, then we need all
5609
+ // that dot prevention biz to live in the extglob portions, because eg
5610
+ // +(*|.x*) can match .xy but not .yx.
5611
+ //
5612
+ // So, return the two flavors if it's #root and the first child is not an
5613
+ // AST, otherwise leave it to the child AST to handle it, and there,
5614
+ // use the (?:^|/) style of start binding.
5615
+ //
5616
+ // Even simplified further:
5617
+ // - Since the start for a join is eg /(?!\.) and the start for a part
5618
+ // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
5619
+ // or start or whatever) and prepend ^ or / at the Regexp construction.
5620
+ toRegExpSource(allowDot) {
5621
+ const dot = allowDot ?? !!__privateGet(this, _options).dot;
5622
+ if (__privateGet(this, _root) === this)
5623
+ __privateMethod(this, _fillNegs, fillNegs_fn).call(this);
5624
+ if (!this.type) {
5625
+ const noEmpty = this.isStart() && this.isEnd() && !__privateGet(this, _parts).some((s) => typeof s !== "string");
5626
+ const src = __privateGet(this, _parts).map((p) => {
5627
+ var _a;
5628
+ const [re, _, hasMagic, uflag] = typeof p === "string" ? __privateMethod(_a = _AST, _parseGlob, parseGlob_fn).call(_a, p, __privateGet(this, _hasMagic), noEmpty) : p.toRegExpSource(allowDot);
5629
+ __privateSet(this, _hasMagic, __privateGet(this, _hasMagic) || hasMagic);
5630
+ __privateSet(this, _uflag, __privateGet(this, _uflag) || uflag);
5631
+ return re;
5632
+ }).join("");
5633
+ let start2 = "";
5634
+ if (this.isStart()) {
5635
+ if (typeof __privateGet(this, _parts)[0] === "string") {
5636
+ const dotTravAllowed = __privateGet(this, _parts).length === 1 && justDots.has(__privateGet(this, _parts)[0]);
5637
+ if (!dotTravAllowed) {
5638
+ const aps = addPatternStart;
5639
+ const needNoTrav = (
5640
+ // dots are allowed, and the pattern starts with [ or .
5641
+ dot && aps.has(src.charAt(0)) || // the pattern starts with \., and then [ or .
5642
+ src.startsWith("\\.") && aps.has(src.charAt(2)) || // the pattern starts with \.\., and then [ or .
5643
+ src.startsWith("\\.\\.") && aps.has(src.charAt(4))
5644
+ );
5645
+ const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
5646
+ start2 = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : "";
5647
+ }
5648
+ }
5649
+ }
5650
+ let end = "";
5651
+ if (this.isEnd() && __privateGet(__privateGet(this, _root), _filledNegs) && __privateGet(this, _parent)?.type === "!") {
5652
+ end = "(?:$|\\/)";
5653
+ }
5654
+ const final2 = start2 + src + end;
5655
+ return [
5656
+ final2,
5657
+ unescape(src),
5658
+ __privateSet(this, _hasMagic, !!__privateGet(this, _hasMagic)),
5659
+ __privateGet(this, _uflag)
5660
+ ];
5661
+ }
5662
+ const repeated = this.type === "*" || this.type === "+";
5663
+ const start = this.type === "!" ? "(?:(?!(?:" : "(?:";
5664
+ let body = __privateMethod(this, _partsToRegExp, partsToRegExp_fn).call(this, dot);
5665
+ if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
5666
+ const s = this.toString();
5667
+ __privateSet(this, _parts, [s]);
5668
+ this.type = null;
5669
+ __privateSet(this, _hasMagic, void 0);
5670
+ return [s, unescape(this.toString()), false, false];
5671
+ }
5672
+ let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : __privateMethod(this, _partsToRegExp, partsToRegExp_fn).call(this, true);
5673
+ if (bodyDotAllowed === body) {
5674
+ bodyDotAllowed = "";
5675
+ }
5676
+ if (bodyDotAllowed) {
5677
+ body = `(?:${body})(?:${bodyDotAllowed})*?`;
5678
+ }
5679
+ let final = "";
5680
+ if (this.type === "!" && __privateGet(this, _emptyExt)) {
5681
+ final = (this.isStart() && !dot ? startNoDot : "") + starNoEmpty;
5682
+ } else {
5683
+ const close = this.type === "!" ? (
5684
+ // !() must match something,but !(x) can match ''
5685
+ "))" + (this.isStart() && !dot && !allowDot ? startNoDot : "") + star + ")"
5686
+ ) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && bodyDotAllowed ? ")" : this.type === "*" && bodyDotAllowed ? `)?` : `)${this.type}`;
5687
+ final = start + body + close;
5688
+ }
5689
+ return [
5690
+ final,
5691
+ unescape(body),
5692
+ __privateSet(this, _hasMagic, !!__privateGet(this, _hasMagic)),
5693
+ __privateGet(this, _uflag)
5694
+ ];
5695
+ }
5696
+ };
5697
+ _root = new WeakMap();
5698
+ _hasMagic = new WeakMap();
5699
+ _uflag = new WeakMap();
5700
+ _parts = new WeakMap();
5701
+ _parent = new WeakMap();
5702
+ _parentIndex = new WeakMap();
5703
+ _negs = new WeakMap();
5704
+ _filledNegs = new WeakMap();
5705
+ _options = new WeakMap();
5706
+ _toString = new WeakMap();
5707
+ _emptyExt = new WeakMap();
5708
+ _fillNegs = new WeakSet();
5709
+ fillNegs_fn = function() {
5710
+ if (this !== __privateGet(this, _root))
5711
+ throw new Error("should only call on root");
5712
+ if (__privateGet(this, _filledNegs))
5713
+ return this;
5714
+ this.toString();
5715
+ __privateSet(this, _filledNegs, true);
5716
+ let n;
5717
+ while (n = __privateGet(this, _negs).pop()) {
5718
+ if (n.type !== "!")
5719
+ continue;
5720
+ let p = n;
5721
+ let pp = __privateGet(p, _parent);
5722
+ while (pp) {
5723
+ for (let i = __privateGet(p, _parentIndex) + 1; !pp.type && i < __privateGet(pp, _parts).length; i++) {
5724
+ for (const part of __privateGet(n, _parts)) {
5725
+ if (typeof part === "string") {
5726
+ throw new Error("string part in extglob AST??");
5727
+ }
5728
+ part.copyIn(__privateGet(pp, _parts)[i]);
5729
+ }
5730
+ }
5731
+ p = pp;
5732
+ pp = __privateGet(p, _parent);
5733
+ }
5734
+ }
5735
+ return this;
5736
+ };
5737
+ _parseAST = new WeakSet();
5738
+ parseAST_fn = function(str, ast, pos, opt) {
5739
+ var _a, _b;
5740
+ let escaping = false;
5741
+ let inBrace = false;
5742
+ let braceStart = -1;
5743
+ let braceNeg = false;
5744
+ if (ast.type === null) {
5745
+ let i2 = pos;
5746
+ let acc2 = "";
5747
+ while (i2 < str.length) {
5748
+ const c = str.charAt(i2++);
5749
+ if (escaping || c === "\\") {
5750
+ escaping = !escaping;
5751
+ acc2 += c;
5752
+ continue;
5753
+ }
5754
+ if (inBrace) {
5755
+ if (i2 === braceStart + 1) {
5756
+ if (c === "^" || c === "!") {
5757
+ braceNeg = true;
5758
+ }
5759
+ } else if (c === "]" && !(i2 === braceStart + 2 && braceNeg)) {
5760
+ inBrace = false;
5761
+ }
5762
+ acc2 += c;
5763
+ continue;
5764
+ } else if (c === "[") {
5765
+ inBrace = true;
5766
+ braceStart = i2;
5767
+ braceNeg = false;
5768
+ acc2 += c;
5769
+ continue;
5770
+ }
5771
+ if (!opt.noext && isExtglobType(c) && str.charAt(i2) === "(") {
5772
+ ast.push(acc2);
5773
+ acc2 = "";
5774
+ const ext2 = new _AST(c, ast);
5775
+ i2 = __privateMethod(_a = _AST, _parseAST, parseAST_fn).call(_a, str, ext2, i2, opt);
5776
+ ast.push(ext2);
5777
+ continue;
5778
+ }
5779
+ acc2 += c;
5780
+ }
5781
+ ast.push(acc2);
5782
+ return i2;
5783
+ }
5784
+ let i = pos + 1;
5785
+ let part = new _AST(null, ast);
5786
+ const parts = [];
5787
+ let acc = "";
5788
+ while (i < str.length) {
5789
+ const c = str.charAt(i++);
5790
+ if (escaping || c === "\\") {
5791
+ escaping = !escaping;
5792
+ acc += c;
5793
+ continue;
5794
+ }
5795
+ if (inBrace) {
5796
+ if (i === braceStart + 1) {
5797
+ if (c === "^" || c === "!") {
5798
+ braceNeg = true;
5799
+ }
5800
+ } else if (c === "]" && !(i === braceStart + 2 && braceNeg)) {
5801
+ inBrace = false;
5802
+ }
5803
+ acc += c;
5804
+ continue;
5805
+ } else if (c === "[") {
5806
+ inBrace = true;
5807
+ braceStart = i;
5808
+ braceNeg = false;
5809
+ acc += c;
5810
+ continue;
5811
+ }
5812
+ if (isExtglobType(c) && str.charAt(i) === "(") {
5813
+ part.push(acc);
5814
+ acc = "";
5815
+ const ext2 = new _AST(c, part);
5816
+ part.push(ext2);
5817
+ i = __privateMethod(_b = _AST, _parseAST, parseAST_fn).call(_b, str, ext2, i, opt);
5818
+ continue;
5819
+ }
5820
+ if (c === "|") {
5821
+ part.push(acc);
5822
+ acc = "";
5823
+ parts.push(part);
5824
+ part = new _AST(null, ast);
5825
+ continue;
5826
+ }
5827
+ if (c === ")") {
5828
+ if (acc === "" && __privateGet(ast, _parts).length === 0) {
5829
+ __privateSet(ast, _emptyExt, true);
5830
+ }
5831
+ part.push(acc);
5832
+ acc = "";
5833
+ ast.push(...parts, part);
5834
+ return i;
5835
+ }
5836
+ acc += c;
5837
+ }
5838
+ ast.type = null;
5839
+ __privateSet(ast, _hasMagic, void 0);
5840
+ __privateSet(ast, _parts, [str.substring(pos - 1)]);
5841
+ return i;
5842
+ };
5843
+ _partsToRegExp = new WeakSet();
5844
+ partsToRegExp_fn = function(dot) {
5845
+ return __privateGet(this, _parts).map((p) => {
5846
+ if (typeof p === "string") {
5847
+ throw new Error("string type in extglob ast??");
5848
+ }
5849
+ const [re, _, _hasMagic2, uflag] = p.toRegExpSource(dot);
5850
+ __privateSet(this, _uflag, __privateGet(this, _uflag) || uflag);
5851
+ return re;
5852
+ }).filter((p) => !(this.isStart() && this.isEnd()) || !!p).join("|");
5853
+ };
5854
+ _parseGlob = new WeakSet();
5855
+ parseGlob_fn = function(glob2, hasMagic, noEmpty = false) {
5856
+ let escaping = false;
5857
+ let re = "";
5858
+ let uflag = false;
5859
+ for (let i = 0; i < glob2.length; i++) {
5860
+ const c = glob2.charAt(i);
5861
+ if (escaping) {
5862
+ escaping = false;
5863
+ re += (reSpecials.has(c) ? "\\" : "") + c;
5864
+ continue;
5865
+ }
5866
+ if (c === "\\") {
5867
+ if (i === glob2.length - 1) {
5868
+ re += "\\\\";
5869
+ } else {
5870
+ escaping = true;
5871
+ }
5872
+ continue;
5873
+ }
5874
+ if (c === "[") {
5875
+ const [src, needUflag, consumed, magic] = parseClass(glob2, i);
5876
+ if (consumed) {
5877
+ re += src;
5878
+ uflag = uflag || needUflag;
5879
+ i += consumed - 1;
5880
+ hasMagic = hasMagic || magic;
5881
+ continue;
5882
+ }
5883
+ }
5884
+ if (c === "*") {
5885
+ re += noEmpty && glob2 === "*" ? starNoEmpty : star;
5886
+ hasMagic = true;
5887
+ continue;
5888
+ }
5889
+ if (c === "?") {
5890
+ re += qmark;
5891
+ hasMagic = true;
5892
+ continue;
5893
+ }
5894
+ re += regExpEscape(c);
5895
+ }
5896
+ return [re, unescape(glob2), !!hasMagic, uflag];
5897
+ };
5898
+ __privateAdd(_AST, _parseAST);
5899
+ __privateAdd(_AST, _parseGlob);
5900
+ var AST = _AST;
5901
+
5902
+ // ../../node_modules/.pnpm/minimatch@10.1.1/node_modules/minimatch/dist/esm/escape.js
5903
+ var escape = (s, { windowsPathsNoEscape = false, magicalBraces = false } = {}) => {
5904
+ if (magicalBraces) {
5905
+ return windowsPathsNoEscape ? s.replace(/[?*()[\]{}]/g, "[$&]") : s.replace(/[?*()[\]\\{}]/g, "\\$&");
5906
+ }
5907
+ return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
5908
+ };
5909
+
5910
+ // ../../node_modules/.pnpm/minimatch@10.1.1/node_modules/minimatch/dist/esm/index.js
5911
+ var minimatch = (p, pattern, options = {}) => {
5912
+ assertValidPattern(pattern);
5913
+ if (!options.nocomment && pattern.charAt(0) === "#") {
5914
+ return false;
5915
+ }
5916
+ return new Minimatch(pattern, options).match(p);
5917
+ };
5918
+ var starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
5919
+ var starDotExtTest = (ext2) => (f) => !f.startsWith(".") && f.endsWith(ext2);
5920
+ var starDotExtTestDot = (ext2) => (f) => f.endsWith(ext2);
5921
+ var starDotExtTestNocase = (ext2) => {
5922
+ ext2 = ext2.toLowerCase();
5923
+ return (f) => !f.startsWith(".") && f.toLowerCase().endsWith(ext2);
5924
+ };
5925
+ var starDotExtTestNocaseDot = (ext2) => {
5926
+ ext2 = ext2.toLowerCase();
5927
+ return (f) => f.toLowerCase().endsWith(ext2);
5928
+ };
5929
+ var starDotStarRE = /^\*+\.\*+$/;
5930
+ var starDotStarTest = (f) => !f.startsWith(".") && f.includes(".");
5931
+ var starDotStarTestDot = (f) => f !== "." && f !== ".." && f.includes(".");
5932
+ var dotStarRE = /^\.\*+$/;
5933
+ var dotStarTest = (f) => f !== "." && f !== ".." && f.startsWith(".");
5934
+ var starRE = /^\*+$/;
5935
+ var starTest = (f) => f.length !== 0 && !f.startsWith(".");
5936
+ var starTestDot = (f) => f.length !== 0 && f !== "." && f !== "..";
5937
+ var qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
5938
+ var qmarksTestNocase = ([$0, ext2 = ""]) => {
5939
+ const noext = qmarksTestNoExt([$0]);
5940
+ if (!ext2)
5941
+ return noext;
5942
+ ext2 = ext2.toLowerCase();
5943
+ return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
5944
+ };
5945
+ var qmarksTestNocaseDot = ([$0, ext2 = ""]) => {
5946
+ const noext = qmarksTestNoExtDot([$0]);
5947
+ if (!ext2)
5948
+ return noext;
5949
+ ext2 = ext2.toLowerCase();
5950
+ return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
5951
+ };
5952
+ var qmarksTestDot = ([$0, ext2 = ""]) => {
5953
+ const noext = qmarksTestNoExtDot([$0]);
5954
+ return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
5955
+ };
5956
+ var qmarksTest = ([$0, ext2 = ""]) => {
5957
+ const noext = qmarksTestNoExt([$0]);
5958
+ return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
5959
+ };
5960
+ var qmarksTestNoExt = ([$0]) => {
5961
+ const len = $0.length;
5962
+ return (f) => f.length === len && !f.startsWith(".");
5963
+ };
5964
+ var qmarksTestNoExtDot = ([$0]) => {
5965
+ const len = $0.length;
5966
+ return (f) => f.length === len && f !== "." && f !== "..";
5967
+ };
5968
+ var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
5969
+ var path = {
5970
+ win32: { sep: "\\" },
5971
+ posix: { sep: "/" }
5972
+ };
5973
+ var sep = defaultPlatform === "win32" ? path.win32.sep : path.posix.sep;
5974
+ minimatch.sep = sep;
5975
+ var GLOBSTAR = Symbol("globstar **");
5976
+ minimatch.GLOBSTAR = GLOBSTAR;
5977
+ var qmark2 = "[^/]";
5978
+ var star2 = qmark2 + "*?";
5979
+ var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
5980
+ var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
5981
+ var filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
5982
+ minimatch.filter = filter;
5983
+ var ext = (a, b = {}) => Object.assign({}, a, b);
5984
+ var defaults = (def) => {
5985
+ if (!def || typeof def !== "object" || !Object.keys(def).length) {
5986
+ return minimatch;
5987
+ }
5988
+ const orig = minimatch;
5989
+ const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
5990
+ return Object.assign(m, {
5991
+ Minimatch: class Minimatch extends orig.Minimatch {
5992
+ constructor(pattern, options = {}) {
5993
+ super(pattern, ext(def, options));
5994
+ }
5995
+ static defaults(options) {
5996
+ return orig.defaults(ext(def, options)).Minimatch;
5997
+ }
5998
+ },
5999
+ AST: class AST extends orig.AST {
6000
+ /* c8 ignore start */
6001
+ constructor(type, parent, options = {}) {
6002
+ super(type, parent, ext(def, options));
6003
+ }
6004
+ /* c8 ignore stop */
6005
+ static fromGlob(pattern, options = {}) {
6006
+ return orig.AST.fromGlob(pattern, ext(def, options));
6007
+ }
6008
+ },
6009
+ unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
6010
+ escape: (s, options = {}) => orig.escape(s, ext(def, options)),
6011
+ filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
6012
+ defaults: (options) => orig.defaults(ext(def, options)),
6013
+ makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
6014
+ braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
6015
+ match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
6016
+ sep: orig.sep,
6017
+ GLOBSTAR
6018
+ });
6019
+ };
6020
+ minimatch.defaults = defaults;
6021
+ var braceExpand = (pattern, options = {}) => {
6022
+ assertValidPattern(pattern);
6023
+ if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
6024
+ return [pattern];
6025
+ }
6026
+ return expand(pattern);
6027
+ };
6028
+ minimatch.braceExpand = braceExpand;
6029
+ var makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
6030
+ minimatch.makeRe = makeRe;
6031
+ var match = (list, pattern, options = {}) => {
6032
+ const mm = new Minimatch(pattern, options);
6033
+ list = list.filter((f) => mm.match(f));
6034
+ if (mm.options.nonull && !list.length) {
6035
+ list.push(pattern);
6036
+ }
6037
+ return list;
6038
+ };
6039
+ minimatch.match = match;
6040
+ var globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
6041
+ var regExpEscape2 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
6042
+ var Minimatch = class {
6043
+ constructor(pattern, options = {}) {
6044
+ __publicField(this, "options");
6045
+ __publicField(this, "set");
6046
+ __publicField(this, "pattern");
6047
+ __publicField(this, "windowsPathsNoEscape");
6048
+ __publicField(this, "nonegate");
6049
+ __publicField(this, "negate");
6050
+ __publicField(this, "comment");
6051
+ __publicField(this, "empty");
6052
+ __publicField(this, "preserveMultipleSlashes");
6053
+ __publicField(this, "partial");
6054
+ __publicField(this, "globSet");
6055
+ __publicField(this, "globParts");
6056
+ __publicField(this, "nocase");
6057
+ __publicField(this, "isWindows");
6058
+ __publicField(this, "platform");
6059
+ __publicField(this, "windowsNoMagicRoot");
6060
+ __publicField(this, "regexp");
6061
+ assertValidPattern(pattern);
6062
+ options = options || {};
6063
+ this.options = options;
6064
+ this.pattern = pattern;
6065
+ this.platform = options.platform || defaultPlatform;
6066
+ this.isWindows = this.platform === "win32";
6067
+ this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
6068
+ if (this.windowsPathsNoEscape) {
6069
+ this.pattern = this.pattern.replace(/\\/g, "/");
6070
+ }
6071
+ this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
6072
+ this.regexp = null;
6073
+ this.negate = false;
6074
+ this.nonegate = !!options.nonegate;
6075
+ this.comment = false;
6076
+ this.empty = false;
6077
+ this.partial = !!options.partial;
6078
+ this.nocase = !!this.options.nocase;
6079
+ this.windowsNoMagicRoot = options.windowsNoMagicRoot !== void 0 ? options.windowsNoMagicRoot : !!(this.isWindows && this.nocase);
6080
+ this.globSet = [];
6081
+ this.globParts = [];
6082
+ this.set = [];
6083
+ this.make();
6084
+ }
6085
+ hasMagic() {
6086
+ if (this.options.magicalBraces && this.set.length > 1) {
6087
+ return true;
6088
+ }
6089
+ for (const pattern of this.set) {
6090
+ for (const part of pattern) {
6091
+ if (typeof part !== "string")
6092
+ return true;
6093
+ }
6094
+ }
6095
+ return false;
6096
+ }
6097
+ debug(..._) {
6098
+ }
6099
+ make() {
6100
+ const pattern = this.pattern;
6101
+ const options = this.options;
6102
+ if (!options.nocomment && pattern.charAt(0) === "#") {
6103
+ this.comment = true;
6104
+ return;
6105
+ }
6106
+ if (!pattern) {
6107
+ this.empty = true;
6108
+ return;
6109
+ }
6110
+ this.parseNegate();
6111
+ this.globSet = [...new Set(this.braceExpand())];
6112
+ if (options.debug) {
6113
+ this.debug = (...args) => console.error(...args);
6114
+ }
6115
+ this.debug(this.pattern, this.globSet);
6116
+ const rawGlobParts = this.globSet.map((s) => this.slashSplit(s));
6117
+ this.globParts = this.preprocess(rawGlobParts);
6118
+ this.debug(this.pattern, this.globParts);
6119
+ let set = this.globParts.map((s, _, __) => {
6120
+ if (this.isWindows && this.windowsNoMagicRoot) {
6121
+ const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]);
6122
+ const isDrive = /^[a-z]:/i.test(s[0]);
6123
+ if (isUNC) {
6124
+ return [...s.slice(0, 4), ...s.slice(4).map((ss) => this.parse(ss))];
6125
+ } else if (isDrive) {
6126
+ return [s[0], ...s.slice(1).map((ss) => this.parse(ss))];
6127
+ }
6128
+ }
6129
+ return s.map((ss) => this.parse(ss));
6130
+ });
6131
+ this.debug(this.pattern, set);
6132
+ this.set = set.filter((s) => s.indexOf(false) === -1);
6133
+ if (this.isWindows) {
6134
+ for (let i = 0; i < this.set.length; i++) {
6135
+ const p = this.set[i];
6136
+ if (p[0] === "" && p[1] === "" && this.globParts[i][2] === "?" && typeof p[3] === "string" && /^[a-z]:$/i.test(p[3])) {
6137
+ p[2] = "?";
6138
+ }
6139
+ }
6140
+ }
6141
+ this.debug(this.pattern, this.set);
6142
+ }
6143
+ // various transforms to equivalent pattern sets that are
6144
+ // faster to process in a filesystem walk. The goal is to
6145
+ // eliminate what we can, and push all ** patterns as far
6146
+ // to the right as possible, even if it increases the number
6147
+ // of patterns that we have to process.
6148
+ preprocess(globParts) {
6149
+ if (this.options.noglobstar) {
6150
+ for (let i = 0; i < globParts.length; i++) {
6151
+ for (let j = 0; j < globParts[i].length; j++) {
6152
+ if (globParts[i][j] === "**") {
6153
+ globParts[i][j] = "*";
6154
+ }
6155
+ }
6156
+ }
6157
+ }
6158
+ const { optimizationLevel = 1 } = this.options;
6159
+ if (optimizationLevel >= 2) {
6160
+ globParts = this.firstPhasePreProcess(globParts);
6161
+ globParts = this.secondPhasePreProcess(globParts);
6162
+ } else if (optimizationLevel >= 1) {
6163
+ globParts = this.levelOneOptimize(globParts);
6164
+ } else {
6165
+ globParts = this.adjascentGlobstarOptimize(globParts);
6166
+ }
6167
+ return globParts;
6168
+ }
6169
+ // just get rid of adjascent ** portions
6170
+ adjascentGlobstarOptimize(globParts) {
6171
+ return globParts.map((parts) => {
6172
+ let gs = -1;
6173
+ while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
6174
+ let i = gs;
6175
+ while (parts[i + 1] === "**") {
6176
+ i++;
6177
+ }
6178
+ if (i !== gs) {
6179
+ parts.splice(gs, i - gs);
6180
+ }
6181
+ }
6182
+ return parts;
6183
+ });
6184
+ }
6185
+ // get rid of adjascent ** and resolve .. portions
6186
+ levelOneOptimize(globParts) {
6187
+ return globParts.map((parts) => {
6188
+ parts = parts.reduce((set, part) => {
6189
+ const prev = set[set.length - 1];
6190
+ if (part === "**" && prev === "**") {
6191
+ return set;
6192
+ }
6193
+ if (part === "..") {
6194
+ if (prev && prev !== ".." && prev !== "." && prev !== "**") {
6195
+ set.pop();
6196
+ return set;
6197
+ }
6198
+ }
6199
+ set.push(part);
6200
+ return set;
6201
+ }, []);
6202
+ return parts.length === 0 ? [""] : parts;
6203
+ });
6204
+ }
6205
+ levelTwoFileOptimize(parts) {
6206
+ if (!Array.isArray(parts)) {
6207
+ parts = this.slashSplit(parts);
6208
+ }
6209
+ let didSomething = false;
6210
+ do {
6211
+ didSomething = false;
6212
+ if (!this.preserveMultipleSlashes) {
6213
+ for (let i = 1; i < parts.length - 1; i++) {
6214
+ const p = parts[i];
6215
+ if (i === 1 && p === "" && parts[0] === "")
6216
+ continue;
6217
+ if (p === "." || p === "") {
6218
+ didSomething = true;
6219
+ parts.splice(i, 1);
6220
+ i--;
6221
+ }
6222
+ }
6223
+ if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
6224
+ didSomething = true;
6225
+ parts.pop();
6226
+ }
6227
+ }
6228
+ let dd = 0;
6229
+ while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
6230
+ const p = parts[dd - 1];
6231
+ if (p && p !== "." && p !== ".." && p !== "**") {
6232
+ didSomething = true;
6233
+ parts.splice(dd - 1, 2);
6234
+ dd -= 2;
6235
+ }
6236
+ }
6237
+ } while (didSomething);
6238
+ return parts.length === 0 ? [""] : parts;
6239
+ }
6240
+ // First phase: single-pattern processing
6241
+ // <pre> is 1 or more portions
6242
+ // <rest> is 1 or more portions
6243
+ // <p> is any portion other than ., .., '', or **
6244
+ // <e> is . or ''
6245
+ //
6246
+ // **/.. is *brutal* for filesystem walking performance, because
6247
+ // it effectively resets the recursive walk each time it occurs,
6248
+ // and ** cannot be reduced out by a .. pattern part like a regexp
6249
+ // or most strings (other than .., ., and '') can be.
6250
+ //
6251
+ // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
6252
+ // <pre>/<e>/<rest> -> <pre>/<rest>
6253
+ // <pre>/<p>/../<rest> -> <pre>/<rest>
6254
+ // **/**/<rest> -> **/<rest>
6255
+ //
6256
+ // **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
6257
+ // this WOULD be allowed if ** did follow symlinks, or * didn't
6258
+ firstPhasePreProcess(globParts) {
6259
+ let didSomething = false;
6260
+ do {
6261
+ didSomething = false;
6262
+ for (let parts of globParts) {
6263
+ let gs = -1;
6264
+ while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
6265
+ let gss = gs;
6266
+ while (parts[gss + 1] === "**") {
6267
+ gss++;
6268
+ }
6269
+ if (gss > gs) {
6270
+ parts.splice(gs + 1, gss - gs);
6271
+ }
6272
+ let next = parts[gs + 1];
6273
+ const p = parts[gs + 2];
6274
+ const p2 = parts[gs + 3];
6275
+ if (next !== "..")
6276
+ continue;
6277
+ if (!p || p === "." || p === ".." || !p2 || p2 === "." || p2 === "..") {
6278
+ continue;
6279
+ }
6280
+ didSomething = true;
6281
+ parts.splice(gs, 1);
6282
+ const other = parts.slice(0);
6283
+ other[gs] = "**";
6284
+ globParts.push(other);
6285
+ gs--;
6286
+ }
6287
+ if (!this.preserveMultipleSlashes) {
6288
+ for (let i = 1; i < parts.length - 1; i++) {
6289
+ const p = parts[i];
6290
+ if (i === 1 && p === "" && parts[0] === "")
6291
+ continue;
6292
+ if (p === "." || p === "") {
6293
+ didSomething = true;
6294
+ parts.splice(i, 1);
6295
+ i--;
6296
+ }
6297
+ }
6298
+ if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
6299
+ didSomething = true;
6300
+ parts.pop();
6301
+ }
6302
+ }
6303
+ let dd = 0;
6304
+ while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
6305
+ const p = parts[dd - 1];
6306
+ if (p && p !== "." && p !== ".." && p !== "**") {
6307
+ didSomething = true;
6308
+ const needDot = dd === 1 && parts[dd + 1] === "**";
6309
+ const splin = needDot ? ["."] : [];
6310
+ parts.splice(dd - 1, 2, ...splin);
6311
+ if (parts.length === 0)
6312
+ parts.push("");
6313
+ dd -= 2;
6314
+ }
6315
+ }
6316
+ }
6317
+ } while (didSomething);
6318
+ return globParts;
6319
+ }
6320
+ // second phase: multi-pattern dedupes
6321
+ // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
6322
+ // {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
6323
+ // {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
6324
+ //
6325
+ // {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
6326
+ // ^-- not valid because ** doens't follow symlinks
6327
+ secondPhasePreProcess(globParts) {
6328
+ for (let i = 0; i < globParts.length - 1; i++) {
6329
+ for (let j = i + 1; j < globParts.length; j++) {
6330
+ const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
6331
+ if (matched) {
6332
+ globParts[i] = [];
6333
+ globParts[j] = matched;
6334
+ break;
6335
+ }
6336
+ }
6337
+ }
6338
+ return globParts.filter((gs) => gs.length);
6339
+ }
6340
+ partsMatch(a, b, emptyGSMatch = false) {
6341
+ let ai = 0;
6342
+ let bi = 0;
6343
+ let result = [];
6344
+ let which2 = "";
6345
+ while (ai < a.length && bi < b.length) {
6346
+ if (a[ai] === b[bi]) {
6347
+ result.push(which2 === "b" ? b[bi] : a[ai]);
6348
+ ai++;
6349
+ bi++;
6350
+ } else if (emptyGSMatch && a[ai] === "**" && b[bi] === a[ai + 1]) {
6351
+ result.push(a[ai]);
6352
+ ai++;
6353
+ } else if (emptyGSMatch && b[bi] === "**" && a[ai] === b[bi + 1]) {
6354
+ result.push(b[bi]);
6355
+ bi++;
6356
+ } else if (a[ai] === "*" && b[bi] && (this.options.dot || !b[bi].startsWith(".")) && b[bi] !== "**") {
6357
+ if (which2 === "b")
6358
+ return false;
6359
+ which2 = "a";
6360
+ result.push(a[ai]);
6361
+ ai++;
6362
+ bi++;
6363
+ } else if (b[bi] === "*" && a[ai] && (this.options.dot || !a[ai].startsWith(".")) && a[ai] !== "**") {
6364
+ if (which2 === "a")
6365
+ return false;
6366
+ which2 = "b";
6367
+ result.push(b[bi]);
6368
+ ai++;
6369
+ bi++;
6370
+ } else {
6371
+ return false;
6372
+ }
6373
+ }
6374
+ return a.length === b.length && result;
6375
+ }
6376
+ parseNegate() {
6377
+ if (this.nonegate)
6378
+ return;
6379
+ const pattern = this.pattern;
6380
+ let negate = false;
6381
+ let negateOffset = 0;
6382
+ for (let i = 0; i < pattern.length && pattern.charAt(i) === "!"; i++) {
6383
+ negate = !negate;
6384
+ negateOffset++;
6385
+ }
6386
+ if (negateOffset)
6387
+ this.pattern = pattern.slice(negateOffset);
6388
+ this.negate = negate;
6389
+ }
6390
+ // set partial to true to test if, for example,
6391
+ // "/a/b" matches the start of "/*/b/*/d"
6392
+ // Partial means, if you run out of file before you run
6393
+ // out of pattern, then that's fine, as long as all
6394
+ // the parts match.
6395
+ matchOne(file, pattern, partial = false) {
6396
+ const options = this.options;
6397
+ if (this.isWindows) {
6398
+ const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
6399
+ const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
6400
+ const patternDrive = typeof pattern[0] === "string" && /^[a-z]:$/i.test(pattern[0]);
6401
+ const patternUNC = !patternDrive && pattern[0] === "" && pattern[1] === "" && pattern[2] === "?" && typeof pattern[3] === "string" && /^[a-z]:$/i.test(pattern[3]);
6402
+ const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0;
6403
+ const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0;
6404
+ if (typeof fdi === "number" && typeof pdi === "number") {
6405
+ const [fd, pd] = [file[fdi], pattern[pdi]];
6406
+ if (fd.toLowerCase() === pd.toLowerCase()) {
6407
+ pattern[pdi] = fd;
6408
+ if (pdi > fdi) {
6409
+ pattern = pattern.slice(pdi);
6410
+ } else if (fdi > pdi) {
6411
+ file = file.slice(fdi);
6412
+ }
6413
+ }
6414
+ }
6415
+ }
6416
+ const { optimizationLevel = 1 } = this.options;
6417
+ if (optimizationLevel >= 2) {
6418
+ file = this.levelTwoFileOptimize(file);
6419
+ }
6420
+ this.debug("matchOne", this, { file, pattern });
6421
+ this.debug("matchOne", file.length, pattern.length);
6422
+ for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
6423
+ this.debug("matchOne loop");
6424
+ var p = pattern[pi];
6425
+ var f = file[fi];
6426
+ this.debug(pattern, p, f);
6427
+ if (p === false) {
6428
+ return false;
6429
+ }
6430
+ if (p === GLOBSTAR) {
6431
+ this.debug("GLOBSTAR", [pattern, p, f]);
6432
+ var fr = fi;
6433
+ var pr = pi + 1;
6434
+ if (pr === pl) {
6435
+ this.debug("** at the end");
6436
+ for (; fi < fl; fi++) {
6437
+ if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
6438
+ return false;
6439
+ }
6440
+ return true;
6441
+ }
6442
+ while (fr < fl) {
6443
+ var swallowee = file[fr];
6444
+ this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
6445
+ if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
6446
+ this.debug("globstar found match!", fr, fl, swallowee);
6447
+ return true;
6448
+ } else {
6449
+ if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
6450
+ this.debug("dot detected!", file, fr, pattern, pr);
6451
+ break;
6452
+ }
6453
+ this.debug("globstar swallow a segment, and continue");
6454
+ fr++;
6455
+ }
6456
+ }
6457
+ if (partial) {
6458
+ this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
6459
+ if (fr === fl) {
6460
+ return true;
6461
+ }
6462
+ }
6463
+ return false;
6464
+ }
6465
+ let hit;
6466
+ if (typeof p === "string") {
6467
+ hit = f === p;
6468
+ this.debug("string match", p, f, hit);
6469
+ } else {
6470
+ hit = p.test(f);
6471
+ this.debug("pattern match", p, f, hit);
6472
+ }
6473
+ if (!hit)
6474
+ return false;
6475
+ }
6476
+ if (fi === fl && pi === pl) {
6477
+ return true;
6478
+ } else if (fi === fl) {
6479
+ return partial;
6480
+ } else if (pi === pl) {
6481
+ return fi === fl - 1 && file[fi] === "";
6482
+ } else {
6483
+ throw new Error("wtf?");
6484
+ }
6485
+ }
6486
+ braceExpand() {
6487
+ return braceExpand(this.pattern, this.options);
6488
+ }
6489
+ parse(pattern) {
6490
+ assertValidPattern(pattern);
6491
+ const options = this.options;
6492
+ if (pattern === "**")
6493
+ return GLOBSTAR;
6494
+ if (pattern === "")
6495
+ return "";
6496
+ let m;
6497
+ let fastTest = null;
6498
+ if (m = pattern.match(starRE)) {
6499
+ fastTest = options.dot ? starTestDot : starTest;
6500
+ } else if (m = pattern.match(starDotExtRE)) {
6501
+ fastTest = (options.nocase ? options.dot ? starDotExtTestNocaseDot : starDotExtTestNocase : options.dot ? starDotExtTestDot : starDotExtTest)(m[1]);
6502
+ } else if (m = pattern.match(qmarksRE)) {
6503
+ fastTest = (options.nocase ? options.dot ? qmarksTestNocaseDot : qmarksTestNocase : options.dot ? qmarksTestDot : qmarksTest)(m);
6504
+ } else if (m = pattern.match(starDotStarRE)) {
6505
+ fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
6506
+ } else if (m = pattern.match(dotStarRE)) {
6507
+ fastTest = dotStarTest;
6508
+ }
6509
+ const re = AST.fromGlob(pattern, this.options).toMMPattern();
6510
+ if (fastTest && typeof re === "object") {
6511
+ Reflect.defineProperty(re, "test", { value: fastTest });
6512
+ }
6513
+ return re;
6514
+ }
6515
+ makeRe() {
6516
+ if (this.regexp || this.regexp === false)
6517
+ return this.regexp;
6518
+ const set = this.set;
6519
+ if (!set.length) {
6520
+ this.regexp = false;
6521
+ return this.regexp;
6522
+ }
6523
+ const options = this.options;
6524
+ const twoStar = options.noglobstar ? star2 : options.dot ? twoStarDot : twoStarNoDot;
6525
+ const flags = new Set(options.nocase ? ["i"] : []);
6526
+ let re = set.map((pattern) => {
6527
+ const pp = pattern.map((p) => {
6528
+ if (p instanceof RegExp) {
6529
+ for (const f of p.flags.split(""))
6530
+ flags.add(f);
6531
+ }
6532
+ return typeof p === "string" ? regExpEscape2(p) : p === GLOBSTAR ? GLOBSTAR : p._src;
6533
+ });
6534
+ pp.forEach((p, i) => {
6535
+ const next = pp[i + 1];
6536
+ const prev = pp[i - 1];
6537
+ if (p !== GLOBSTAR || prev === GLOBSTAR) {
6538
+ return;
6539
+ }
6540
+ if (prev === void 0) {
6541
+ if (next !== void 0 && next !== GLOBSTAR) {
6542
+ pp[i + 1] = "(?:\\/|" + twoStar + "\\/)?" + next;
6543
+ } else {
6544
+ pp[i] = twoStar;
6545
+ }
6546
+ } else if (next === void 0) {
6547
+ pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + ")?";
6548
+ } else if (next !== GLOBSTAR) {
6549
+ pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next;
6550
+ pp[i + 1] = GLOBSTAR;
6551
+ }
6552
+ });
6553
+ const filtered = pp.filter((p) => p !== GLOBSTAR);
6554
+ if (this.partial && filtered.length >= 1) {
6555
+ const prefixes = [];
6556
+ for (let i = 1; i <= filtered.length; i++) {
6557
+ prefixes.push(filtered.slice(0, i).join("/"));
6558
+ }
6559
+ return "(?:" + prefixes.join("|") + ")";
6560
+ }
6561
+ return filtered.join("/");
6562
+ }).join("|");
6563
+ const [open, close] = set.length > 1 ? ["(?:", ")"] : ["", ""];
6564
+ re = "^" + open + re + close + "$";
6565
+ if (this.partial) {
6566
+ re = "^(?:\\/|" + open + re.slice(1, -1) + close + ")$";
6567
+ }
6568
+ if (this.negate)
6569
+ re = "^(?!" + re + ").+$";
6570
+ try {
6571
+ this.regexp = new RegExp(re, [...flags].join(""));
6572
+ } catch (ex) {
6573
+ this.regexp = false;
6574
+ }
6575
+ return this.regexp;
6576
+ }
6577
+ slashSplit(p) {
6578
+ if (this.preserveMultipleSlashes) {
6579
+ return p.split("/");
6580
+ } else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
6581
+ return ["", ...p.split(/\/+/)];
6582
+ } else {
6583
+ return p.split(/\/+/);
6584
+ }
6585
+ }
6586
+ match(f, partial = this.partial) {
6587
+ this.debug("match", f, this.pattern);
6588
+ if (this.comment) {
6589
+ return false;
6590
+ }
6591
+ if (this.empty) {
6592
+ return f === "";
6593
+ }
6594
+ if (f === "/" && partial) {
6595
+ return true;
6596
+ }
6597
+ const options = this.options;
6598
+ if (this.isWindows) {
6599
+ f = f.split("\\").join("/");
6600
+ }
6601
+ const ff = this.slashSplit(f);
6602
+ this.debug(this.pattern, "split", ff);
6603
+ const set = this.set;
6604
+ this.debug(this.pattern, "set", set);
6605
+ let filename = ff[ff.length - 1];
6606
+ if (!filename) {
6607
+ for (let i = ff.length - 2; !filename && i >= 0; i--) {
6608
+ filename = ff[i];
6609
+ }
6610
+ }
6611
+ for (let i = 0; i < set.length; i++) {
6612
+ const pattern = set[i];
6613
+ let file = ff;
6614
+ if (options.matchBase && pattern.length === 1) {
6615
+ file = [filename];
6616
+ }
6617
+ const hit = this.matchOne(file, pattern, partial);
6618
+ if (hit) {
6619
+ if (options.flipNegate) {
6620
+ return true;
6621
+ }
6622
+ return !this.negate;
6623
+ }
6624
+ }
6625
+ if (options.flipNegate) {
6626
+ return false;
6627
+ }
6628
+ return this.negate;
6629
+ }
6630
+ static defaults(def) {
6631
+ return minimatch.defaults(def).Minimatch;
6632
+ }
6633
+ };
6634
+ minimatch.AST = AST;
6635
+ minimatch.Minimatch = Minimatch;
6636
+ minimatch.escape = escape;
6637
+ minimatch.unescape = unescape;
6638
+
6639
+ // src/index.ts
5032
6640
  var import_path21 = require("path");
5033
6641
 
5034
6642
  // src/package-versions.ts
5035
- var VERCEL_RUNTIME_VERSION = "0.22.1";
6643
+ var VERCEL_RUNTIME_VERSION = "0.23.0";
5036
6644
  var VERCEL_WORKERS_VERSION = "0.0.25";
5037
6645
 
5038
6646
  // src/conditional-vendoring.ts
@@ -5899,8 +7507,8 @@ function createVenvEnv(venvPath, baseEnv = process.env, uvCacheDir) {
5899
7507
  async function readVenvPythonVersion(pyvenvCfgPath) {
5900
7508
  try {
5901
7509
  const content = await import_fs3.default.promises.readFile(pyvenvCfgPath, "utf-8");
5902
- const match = content.match(/^version\s*=\s*(\d+)\.(\d+)/m);
5903
- return match ? `${match[1]}.${match[2]}` : null;
7510
+ const match2 = content.match(/^version\s*=\s*(\d+)\.(\d+)/m);
7511
+ return match2 ? `${match2[1]}.${match2[2]}` : null;
5904
7512
  } catch {
5905
7513
  return null;
5906
7514
  }
@@ -7202,11 +8810,11 @@ async function getPackagesReachableOnPlatform(lockFile, projectName, pythonMajor
7202
8810
  }
7203
8811
  return visited;
7204
8812
  }
7205
- async function calculateBundleSize(files, filter) {
8813
+ async function calculateBundleSize(files, filter2) {
7206
8814
  let knownSize = 0;
7207
8815
  const statPromises = [];
7208
8816
  for (const filePath of Object.keys(files)) {
7209
- if (filter && !filter(filePath))
8817
+ if (filter2 && !filter2(filePath))
7210
8818
  continue;
7211
8819
  const file = files[filePath];
7212
8820
  if ("fsPath" in file && file.fsPath) {
@@ -7646,11 +9254,11 @@ Add this to your pyproject.toml:
7646
9254
  entrypoint = "${moduleAttr}"`;
7647
9255
  }
7648
9256
  async function resolveModuleAttrEntrypoint(workPath, value) {
7649
- const match = value.match(/([A-Za-z_][\w.]*)\s*:\s*([A-Za-z_][\w]*)/);
7650
- if (!match)
9257
+ const match2 = value.match(/([A-Za-z_][\w.]*)\s*:\s*([A-Za-z_][\w]*)/);
9258
+ if (!match2)
7651
9259
  return null;
7652
- const modulePath = match[1];
7653
- const variableName = match[2];
9260
+ const modulePath = match2[1];
9261
+ const variableName = match2[2];
7654
9262
  const relPath = modulePath.replace(/\./g, "/");
7655
9263
  const candidates = [`${relPath}.py`, `${relPath}/__init__.py`];
7656
9264
  for (const candidate of candidates) {
@@ -7700,11 +9308,11 @@ async function getPyprojectEntrypointWithDiagnostics(workPath) {
7700
9308
  const appScript = scripts?.app;
7701
9309
  if (typeof appScript !== "string")
7702
9310
  return { entrypoint: null };
7703
- const match = appScript.match(/([A-Za-z_][\w.]*)\s*:\s*([A-Za-z_][\w]*)/);
7704
- if (!match)
9311
+ const match2 = appScript.match(/([A-Za-z_][\w.]*)\s*:\s*([A-Za-z_][\w]*)/);
9312
+ if (!match2)
7705
9313
  return { entrypoint: null, appScript };
7706
- const modulePath = match[1];
7707
- const variableName = match[2];
9314
+ const modulePath = match2[1];
9315
+ const variableName = match2[2];
7708
9316
  const relPath = modulePath.replace(/\./g, "/");
7709
9317
  const candidates = [`${relPath}.py`, `${relPath}/__init__.py`];
7710
9318
  for (const candidate of candidates) {
@@ -8105,14 +9713,14 @@ var import_fs10 = __toESM(require("fs"));
8105
9713
  var MODULE_ATTR_RE = /^([A-Za-z_][\w]*(?:\.[A-Za-z_][\w]*)*):([A-Za-z_][\w]*)$/;
8106
9714
  var MODULE_RE = /^[A-Za-z_][\w]*(?:\.[A-Za-z_][\w]*)*$/;
8107
9715
  function parseModuleEntrypoint(value) {
8108
- const match = MODULE_ATTR_RE.exec(value);
8109
- if (!match) {
9716
+ const match2 = MODULE_ATTR_RE.exec(value);
9717
+ if (!match2) {
8110
9718
  return null;
8111
9719
  }
8112
9720
  return {
8113
- moduleName: match[1],
8114
- variableName: match[2],
8115
- filePath: `${match[1].replace(/\./g, "/")}.py`
9721
+ moduleName: match2[1],
9722
+ variableName: match2[2],
9723
+ filePath: `${match2[1].replace(/\./g, "/")}.py`
8116
9724
  };
8117
9725
  }
8118
9726
  function parseBareModuleEntrypoint(value) {
@@ -8402,13 +10010,13 @@ async function getApschedulerPreviewConfig(workPath) {
8402
10010
  '"tool.vercel.apscheduler.previews.idle_timeout" must be a duration such as "30m"'
8403
10011
  );
8404
10012
  }
8405
- const match = /^([1-9]\d*)([smhd])$/.exec(rawPreviews.idle_timeout);
8406
- if (!match) {
10013
+ const match2 = /^([1-9]\d*)([smhd])$/.exec(rawPreviews.idle_timeout);
10014
+ if (!match2) {
8407
10015
  throw apschedulerError(
8408
10016
  '"tool.vercel.apscheduler.previews.idle_timeout" must be a positive duration using s, m, h, or d (for example "30m")'
8409
10017
  );
8410
10018
  }
8411
- const idleTimeoutSeconds = Number(match[1]) * APSCHEDULER_DURATION_UNITS[match[2]];
10019
+ const idleTimeoutSeconds = Number(match2[1]) * APSCHEDULER_DURATION_UNITS[match2[2]];
8412
10020
  if (!Number.isSafeInteger(idleTimeoutSeconds)) {
8413
10021
  throw apschedulerError(
8414
10022
  '"tool.vercel.apscheduler.previews.idle_timeout" is too large'
@@ -8632,7 +10240,7 @@ function parseLegacyTopics(name, value) {
8632
10240
  return value;
8633
10241
  }
8634
10242
  function parseLegacyTriggerDefaults(subscriber, config) {
8635
- const defaults = {};
10243
+ const defaults2 = {};
8636
10244
  for (const {
8637
10245
  field,
8638
10246
  output,
@@ -8648,9 +10256,9 @@ function parseLegacyTriggerDefaults(subscriber, config) {
8648
10256
  `subscriber "${subscriber}" field "${field}" must be ${expected}`
8649
10257
  );
8650
10258
  }
8651
- defaults[output] = value;
10259
+ defaults2[output] = value;
8652
10260
  }
8653
- return defaults;
10261
+ return defaults2;
8654
10262
  }
8655
10263
  function parseTopicPatterns(name, value) {
8656
10264
  if (value === void 0) {
@@ -8859,7 +10467,7 @@ function parseIntrospectedSubscription(kind, subscriberName, index, value) {
8859
10467
  };
8860
10468
  }
8861
10469
  function parseTriggerDefaults(label, subscription) {
8862
- const defaults = {};
10470
+ const defaults2 = {};
8863
10471
  for (const { field, output, isValid, expected } of TRIGGER_NUMBER_FIELDS) {
8864
10472
  const value = subscription[field];
8865
10473
  if (value === void 0 || value === null) {
@@ -8868,9 +10476,9 @@ function parseTriggerDefaults(label, subscription) {
8868
10476
  if (typeof value !== "number" || !isValid(value)) {
8869
10477
  throw subscriberError(`${label} field "${field}" must be ${expected}`);
8870
10478
  }
8871
- defaults[output] = value;
10479
+ defaults2[output] = value;
8872
10480
  }
8873
- return defaults;
10481
+ return defaults2;
8874
10482
  }
8875
10483
  function getQueueWildcardPrefix(pattern) {
8876
10484
  if (pattern.endsWith("*")) {
@@ -11590,28 +13198,40 @@ function getTargetPlatform(isDev) {
11590
13198
  }
11591
13199
  return { uvPlatform: UV_LINUX_TARGET, architecture: "x86_64" };
11592
13200
  }
11593
- async function getPythonLambdaOptions({
11594
- config,
11595
- entrypoint
11596
- }) {
11597
- if (!config?.functions) {
11598
- return {};
13201
+ function getMatchingFunction(config, entrypoint) {
13202
+ if (!config?.functions || !entrypoint) {
13203
+ return;
11599
13204
  }
11600
13205
  const sources = /* @__PURE__ */ new Set([entrypoint]);
11601
13206
  if (entrypoint.endsWith(".py")) {
11602
13207
  sources.add(entrypoint.slice(0, -".py".length));
11603
13208
  }
11604
13209
  for (const sourceFile of sources) {
11605
- const lambdaOptions = await (0, import_build_utils24.getLambdaOptionsFromFunction)({
11606
- sourceFile,
11607
- config
11608
- });
11609
- if (Object.keys(lambdaOptions).length > 0) {
11610
- delete lambdaOptions.architecture;
11611
- return lambdaOptions;
13210
+ for (const [pattern, functionConfig] of Object.entries(config.functions)) {
13211
+ if (sourceFile === pattern || minimatch(sourceFile, pattern)) {
13212
+ return { sourceFile, functionConfig };
13213
+ }
11612
13214
  }
11613
13215
  }
11614
- return {};
13216
+ return;
13217
+ }
13218
+ function normalizeGlobs(value) {
13219
+ return Array.isArray(value) ? value.filter((item) => typeof item === "string") : typeof value === "string" ? [value] : [];
13220
+ }
13221
+ async function getPythonLambdaOptions({
13222
+ config,
13223
+ entrypoint
13224
+ }) {
13225
+ const match2 = getMatchingFunction(config, entrypoint);
13226
+ if (!match2) {
13227
+ return {};
13228
+ }
13229
+ const lambdaOptions = await (0, import_build_utils24.getLambdaOptionsFromFunction)({
13230
+ sourceFile: match2.sourceFile,
13231
+ config
13232
+ });
13233
+ delete lambdaOptions.architecture;
13234
+ return lambdaOptions;
11615
13235
  }
11616
13236
  async function installInjectedPackage({
11617
13237
  name,
@@ -12199,7 +13819,18 @@ var build = async ({
12199
13819
  );
12200
13820
  }
12201
13821
  }
12202
- const excludeFilesPatterns = typeof config?.excludeFiles === "string" ? [config.excludeFiles] : Array.isArray(config?.excludeFiles) ? config.excludeFiles : [];
13822
+ const functionConfig = getMatchingFunction(
13823
+ config,
13824
+ entrypoint
13825
+ )?.functionConfig;
13826
+ const includeFilesPatterns = [
13827
+ ...normalizeGlobs(config?.includeFiles),
13828
+ ...normalizeGlobs(functionConfig?.includeFiles)
13829
+ ];
13830
+ const excludeFilesPatterns = [
13831
+ ...normalizeGlobs(config?.excludeFiles),
13832
+ ...normalizeGlobs(functionConfig?.excludeFiles)
13833
+ ];
12203
13834
  const cdnBundle = getFastAPICdnBundle(
12204
13835
  fastapiStatic?.collectedMounts ?? [],
12205
13836
  workPath,
@@ -12214,6 +13845,9 @@ var build = async ({
12214
13845
  ]
12215
13846
  };
12216
13847
  const files = await (0, import_build_utils24.glob)("**", globOptions);
13848
+ for (const pattern of includeFilesPatterns) {
13849
+ Object.assign(files, await (0, import_build_utils24.glob)(pattern, workPath));
13850
+ }
12217
13851
  Object.assign(files, cdnBundle.directoryStubs);
12218
13852
  const appPythonSourceFiles = Object.keys(files).filter((file) => file.endsWith(".py")).map((file) => (0, import_path21.join)(workPath, file)).sort();
12219
13853
  if (djangoStatic?.manifestRelPath) {
@@ -12739,7 +14373,8 @@ var build = async ({
12739
14373
  ...shadowingRoutes,
12740
14374
  { handle: "filesystem" },
12741
14375
  ...queueRoutes,
12742
- ...fallbackRoutes,
14376
+ ...fallbackRoutes.length > 0 ? [{ handle: "miss" }, ...fallbackRoutes] : [],
14377
+ { handle: "rewrite" },
12743
14378
  // This route matches the resolved destination after rewrites. Copy
12744
14379
  // that path into the runtime request before dispatching the shared
12745
14380
  // framework Lambda so application routing observes the rewrite.