storybook 10.0.0-beta.3 → 10.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/_node-chunks/{builder-manager-DXAEQZJB.js → builder-manager-IKHPPPFE.js} +13 -13
  2. package/dist/_node-chunks/{camelcase-CMMT6PHY.js → camelcase-O2O7JODG.js} +7 -7
  3. package/dist/_node-chunks/{chunk-ICETGZAR.js → chunk-3J7DQ6TI.js} +7 -7
  4. package/dist/_node-chunks/{chunk-RUCPXDO3.js → chunk-4FMOVB65.js} +8 -8
  5. package/dist/_node-chunks/{chunk-EVY6P65U.js → chunk-4VGW2SQA.js} +7 -7
  6. package/dist/_node-chunks/{chunk-ICFGNVW7.js → chunk-5OILJTZE.js} +7 -7
  7. package/dist/_node-chunks/{chunk-4TGAX5W7.js → chunk-6COBULLV.js} +7 -7
  8. package/dist/_node-chunks/{chunk-EI44VA3U.js → chunk-7IIAUEWB.js} +8 -8
  9. package/dist/_node-chunks/{chunk-DNOOZ2LS.js → chunk-AC3BNULF.js} +552 -717
  10. package/dist/_node-chunks/{chunk-6Z44ODDR.js → chunk-AXFNB3AN.js} +7 -7
  11. package/dist/_node-chunks/chunk-CHJLO2LV.js +62 -0
  12. package/dist/_node-chunks/{chunk-PK6SVDYW.js → chunk-DCHFG5TX.js} +7 -7
  13. package/dist/_node-chunks/{chunk-R6TLLF24.js → chunk-FWFQ2GU7.js} +6 -6
  14. package/dist/_node-chunks/{chunk-3SUJKLRV.js → chunk-HAVE6SGK.js} +7 -7
  15. package/dist/_node-chunks/{chunk-CNKVQCQJ.js → chunk-IB5AEYPX.js} +7 -7
  16. package/dist/_node-chunks/{chunk-PAZJQ2GH.js → chunk-JECCFKKM.js} +7 -7
  17. package/dist/_node-chunks/{chunk-SHXAIHPO.js → chunk-JP4LEAXM.js} +7 -7
  18. package/dist/_node-chunks/chunk-JSSBBVU5.js +79 -0
  19. package/dist/_node-chunks/chunk-MNG223PY.js +18 -0
  20. package/dist/_node-chunks/{chunk-XRAB2RZN.js → chunk-MOO2Y4GI.js} +6 -6
  21. package/dist/_node-chunks/{chunk-7EGB7ALG.js → chunk-N3GFXZDP.js} +7 -7
  22. package/dist/_node-chunks/{chunk-AKW5OJ2T.js → chunk-NF3GXIEK.js} +9 -9
  23. package/dist/_node-chunks/{chunk-BV4J7FF6.js → chunk-NOSGJ5PL.js} +7 -7
  24. package/dist/_node-chunks/{chunk-WRSYICUI.js → chunk-OL2HWCBH.js} +7 -7
  25. package/dist/_node-chunks/{chunk-KQXC7XVZ.js → chunk-SF2IETZ2.js} +29 -81
  26. package/dist/_node-chunks/{chunk-LRQFELIZ.js → chunk-TBAIXCHN.js} +8 -8
  27. package/dist/_node-chunks/{chunk-QI3AVWUV.js → chunk-TTQRDWDJ.js} +12 -12
  28. package/dist/_node-chunks/{chunk-MVPVYHBT.js → chunk-TYGVOW7L.js} +7 -7
  29. package/dist/_node-chunks/{chunk-IA7M33LK.js → chunk-USDZSU5L.js} +7 -7
  30. package/dist/_node-chunks/chunk-XA4TAMUS.js +4966 -0
  31. package/dist/_node-chunks/{chunk-PA26PSV2.js → chunk-XT6O5CVI.js} +7 -7
  32. package/dist/_node-chunks/{chunk-TL5RNPZW.js → chunk-YJHXEN7U.js} +10 -10
  33. package/dist/_node-chunks/{chunk-5XVEWBRA.js → chunk-YRPXGWKW.js} +8 -8
  34. package/dist/_node-chunks/{default-browser-id-2X5XLPPS.js → default-browser-id-J4OIAAJ5.js} +7 -7
  35. package/dist/_node-chunks/{dist-JSBOOVQK.js → dist-BMKSKYDI.js} +9 -9
  36. package/dist/_node-chunks/{globby-YYTLHNUO.js → globby-DASPUXWI.js} +9 -9
  37. package/dist/_node-chunks/{lib-DJHADRPZ.js → lib-L6BIH4EV.js} +7 -7
  38. package/dist/_node-chunks/{mdx-N42X6CFJ-WT6XCDU6.js → mdx-N42X6CFJ-2COTUDSL.js} +8 -8
  39. package/dist/_node-chunks/{p-limit-HTXI4SGX.js → p-limit-HVR3I7TJ.js} +76 -10
  40. package/dist/_node-chunks/{plugin-NNRMQ2YK.js → plugin-2XPSFYWZ.js} +10 -10
  41. package/dist/_node-chunks/{plugin-W22F3FQV.js → plugin-FZOHPRK7.js} +10 -10
  42. package/dist/_node-chunks/{webpack-inject-mocker-runtime-plugin-VFNVWMAM.js → webpack-inject-mocker-runtime-plugin-FGQM2EPC.js} +10 -10
  43. package/dist/_node-chunks/{webpack-mock-plugin-Q4ED2M25.js → webpack-mock-plugin-4HOAIYSX.js} +9 -9
  44. package/dist/babel/index.js +11 -11
  45. package/dist/bin/core.js +11 -11
  46. package/dist/bin/dispatcher.js +11 -11
  47. package/dist/bin/loader.js +8 -8
  48. package/dist/cli/index.d.ts +1 -1
  49. package/dist/cli/index.js +29 -30
  50. package/dist/common/index.d.ts +3 -1
  51. package/dist/common/index.js +23 -22
  52. package/dist/core-server/index.js +38 -39
  53. package/dist/core-server/presets/common-override-preset.js +9 -9
  54. package/dist/core-server/presets/common-preset.js +22 -22
  55. package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +9 -9
  56. package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +10 -10
  57. package/dist/csf-tools/index.js +9 -9
  58. package/dist/manager/globals-runtime.js +1 -1
  59. package/dist/manager-api/index.js +1 -1
  60. package/dist/node-logger/index.js +13 -14
  61. package/dist/preview-api/index.d.ts +67 -68
  62. package/dist/server-errors.js +10 -10
  63. package/dist/telemetry/index.js +24 -25
  64. package/package.json +2 -6
  65. package/dist/_node-chunks/chunk-ALWVSNSK.js +0 -62
  66. package/dist/_node-chunks/chunk-MHNUEOON.js +0 -87
  67. package/dist/_node-chunks/chunk-VDFQYNPZ.js +0 -266
  68. package/dist/_node-chunks/chunk-WELIADWR.js +0 -2377
  69. package/dist/_node-chunks/chunk-YRXKNGPR.js +0 -18
@@ -0,0 +1,4966 @@
1
+ import CJS_COMPAT_NODE_URL_bdftjtsviyb from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_bdftjtsviyb from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_bdftjtsviyb from "node:module";
4
+
5
+ var __filename = CJS_COMPAT_NODE_URL_bdftjtsviyb.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_bdftjtsviyb.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_bdftjtsviyb.createRequire(import.meta.url);
8
+
9
+ // ------------------------------------------------------------
10
+ // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
+ // ------------------------------------------------------------
12
+ import {
13
+ any,
14
+ up,
15
+ up2
16
+ } from "./chunk-JSSBBVU5.js";
17
+ import {
18
+ __commonJS,
19
+ __name,
20
+ __require,
21
+ __toESM
22
+ } from "./chunk-MOO2Y4GI.js";
23
+
24
+ // ../node_modules/tinyglobby/node_modules/fdir/dist/utils.js
25
+ var require_utils = __commonJS({
26
+ "../node_modules/tinyglobby/node_modules/fdir/dist/utils.js"(exports) {
27
+ "use strict";
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.normalizePath = exports.isRootDirectory = exports.convertSlashes = exports.cleanPath = void 0;
30
+ var path_1 = __require("path");
31
+ function cleanPath(path4) {
32
+ let normalized = (0, path_1.normalize)(path4);
33
+ if (normalized.length > 1 && normalized[normalized.length - 1] === path_1.sep)
34
+ normalized = normalized.substring(0, normalized.length - 1);
35
+ return normalized;
36
+ }
37
+ __name(cleanPath, "cleanPath");
38
+ exports.cleanPath = cleanPath;
39
+ var SLASHES_REGEX = /[\\/]/g;
40
+ function convertSlashes(path4, separator) {
41
+ return path4.replace(SLASHES_REGEX, separator);
42
+ }
43
+ __name(convertSlashes, "convertSlashes");
44
+ exports.convertSlashes = convertSlashes;
45
+ var WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i;
46
+ function isRootDirectory(path4) {
47
+ return path4 === "/" || WINDOWS_ROOT_DIR_REGEX.test(path4);
48
+ }
49
+ __name(isRootDirectory, "isRootDirectory");
50
+ exports.isRootDirectory = isRootDirectory;
51
+ function normalizePath(path4, options) {
52
+ const { resolvePaths, normalizePath: normalizePath2, pathSeparator } = options;
53
+ const pathNeedsCleaning = process.platform === "win32" && path4.includes("/") || path4.startsWith(".");
54
+ if (resolvePaths)
55
+ path4 = (0, path_1.resolve)(path4);
56
+ if (normalizePath2 || pathNeedsCleaning)
57
+ path4 = cleanPath(path4);
58
+ if (path4 === ".")
59
+ return "";
60
+ const needsSeperator = path4[path4.length - 1] !== pathSeparator;
61
+ return convertSlashes(needsSeperator ? path4 + pathSeparator : path4, pathSeparator);
62
+ }
63
+ __name(normalizePath, "normalizePath");
64
+ exports.normalizePath = normalizePath;
65
+ }
66
+ });
67
+
68
+ // ../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/join-path.js
69
+ var require_join_path = __commonJS({
70
+ "../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/join-path.js"(exports) {
71
+ "use strict";
72
+ Object.defineProperty(exports, "__esModule", { value: true });
73
+ exports.build = exports.joinDirectoryPath = exports.joinPathWithBasePath = void 0;
74
+ var path_1 = __require("path");
75
+ var utils_1 = require_utils();
76
+ function joinPathWithBasePath(filename, directoryPath) {
77
+ return directoryPath + filename;
78
+ }
79
+ __name(joinPathWithBasePath, "joinPathWithBasePath");
80
+ exports.joinPathWithBasePath = joinPathWithBasePath;
81
+ function joinPathWithRelativePath(root, options) {
82
+ return function(filename, directoryPath) {
83
+ const sameRoot = directoryPath.startsWith(root);
84
+ if (sameRoot)
85
+ return directoryPath.replace(root, "") + filename;
86
+ else
87
+ return (0, utils_1.convertSlashes)((0, path_1.relative)(root, directoryPath), options.pathSeparator) + options.pathSeparator + filename;
88
+ };
89
+ }
90
+ __name(joinPathWithRelativePath, "joinPathWithRelativePath");
91
+ function joinPath(filename) {
92
+ return filename;
93
+ }
94
+ __name(joinPath, "joinPath");
95
+ function joinDirectoryPath(filename, directoryPath, separator) {
96
+ return directoryPath + filename + separator;
97
+ }
98
+ __name(joinDirectoryPath, "joinDirectoryPath");
99
+ exports.joinDirectoryPath = joinDirectoryPath;
100
+ function build(root, options) {
101
+ const { relativePaths, includeBasePath } = options;
102
+ return relativePaths && root ? joinPathWithRelativePath(root, options) : includeBasePath ? joinPathWithBasePath : joinPath;
103
+ }
104
+ __name(build, "build");
105
+ exports.build = build;
106
+ }
107
+ });
108
+
109
+ // ../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/push-directory.js
110
+ var require_push_directory = __commonJS({
111
+ "../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/push-directory.js"(exports) {
112
+ "use strict";
113
+ Object.defineProperty(exports, "__esModule", { value: true });
114
+ exports.build = void 0;
115
+ function pushDirectoryWithRelativePath(root) {
116
+ return function(directoryPath, paths) {
117
+ paths.push(directoryPath.substring(root.length) || ".");
118
+ };
119
+ }
120
+ __name(pushDirectoryWithRelativePath, "pushDirectoryWithRelativePath");
121
+ function pushDirectoryFilterWithRelativePath(root) {
122
+ return function(directoryPath, paths, filters) {
123
+ const relativePath = directoryPath.substring(root.length) || ".";
124
+ if (filters.every((filter) => filter(relativePath, true))) {
125
+ paths.push(relativePath);
126
+ }
127
+ };
128
+ }
129
+ __name(pushDirectoryFilterWithRelativePath, "pushDirectoryFilterWithRelativePath");
130
+ var pushDirectory = /* @__PURE__ */ __name((directoryPath, paths) => {
131
+ paths.push(directoryPath || ".");
132
+ }, "pushDirectory");
133
+ var pushDirectoryFilter = /* @__PURE__ */ __name((directoryPath, paths, filters) => {
134
+ const path4 = directoryPath || ".";
135
+ if (filters.every((filter) => filter(path4, true))) {
136
+ paths.push(path4);
137
+ }
138
+ }, "pushDirectoryFilter");
139
+ var empty = /* @__PURE__ */ __name(() => {
140
+ }, "empty");
141
+ function build(root, options) {
142
+ const { includeDirs, filters, relativePaths } = options;
143
+ if (!includeDirs)
144
+ return empty;
145
+ if (relativePaths)
146
+ return filters && filters.length ? pushDirectoryFilterWithRelativePath(root) : pushDirectoryWithRelativePath(root);
147
+ return filters && filters.length ? pushDirectoryFilter : pushDirectory;
148
+ }
149
+ __name(build, "build");
150
+ exports.build = build;
151
+ }
152
+ });
153
+
154
+ // ../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/push-file.js
155
+ var require_push_file = __commonJS({
156
+ "../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/push-file.js"(exports) {
157
+ "use strict";
158
+ Object.defineProperty(exports, "__esModule", { value: true });
159
+ exports.build = void 0;
160
+ var pushFileFilterAndCount = /* @__PURE__ */ __name((filename, _paths, counts, filters) => {
161
+ if (filters.every((filter) => filter(filename, false)))
162
+ counts.files++;
163
+ }, "pushFileFilterAndCount");
164
+ var pushFileFilter = /* @__PURE__ */ __name((filename, paths, _counts, filters) => {
165
+ if (filters.every((filter) => filter(filename, false)))
166
+ paths.push(filename);
167
+ }, "pushFileFilter");
168
+ var pushFileCount = /* @__PURE__ */ __name((_filename, _paths, counts, _filters) => {
169
+ counts.files++;
170
+ }, "pushFileCount");
171
+ var pushFile = /* @__PURE__ */ __name((filename, paths) => {
172
+ paths.push(filename);
173
+ }, "pushFile");
174
+ var empty = /* @__PURE__ */ __name(() => {
175
+ }, "empty");
176
+ function build(options) {
177
+ const { excludeFiles, filters, onlyCounts } = options;
178
+ if (excludeFiles)
179
+ return empty;
180
+ if (filters && filters.length) {
181
+ return onlyCounts ? pushFileFilterAndCount : pushFileFilter;
182
+ } else if (onlyCounts) {
183
+ return pushFileCount;
184
+ } else {
185
+ return pushFile;
186
+ }
187
+ }
188
+ __name(build, "build");
189
+ exports.build = build;
190
+ }
191
+ });
192
+
193
+ // ../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/get-array.js
194
+ var require_get_array = __commonJS({
195
+ "../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/get-array.js"(exports) {
196
+ "use strict";
197
+ Object.defineProperty(exports, "__esModule", { value: true });
198
+ exports.build = void 0;
199
+ var getArray = /* @__PURE__ */ __name((paths) => {
200
+ return paths;
201
+ }, "getArray");
202
+ var getArrayGroup = /* @__PURE__ */ __name(() => {
203
+ return [""].slice(0, 0);
204
+ }, "getArrayGroup");
205
+ function build(options) {
206
+ return options.group ? getArrayGroup : getArray;
207
+ }
208
+ __name(build, "build");
209
+ exports.build = build;
210
+ }
211
+ });
212
+
213
+ // ../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/group-files.js
214
+ var require_group_files = __commonJS({
215
+ "../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/group-files.js"(exports) {
216
+ "use strict";
217
+ Object.defineProperty(exports, "__esModule", { value: true });
218
+ exports.build = void 0;
219
+ var groupFiles = /* @__PURE__ */ __name((groups, directory, files) => {
220
+ groups.push({ directory, files, dir: directory });
221
+ }, "groupFiles");
222
+ var empty = /* @__PURE__ */ __name(() => {
223
+ }, "empty");
224
+ function build(options) {
225
+ return options.group ? groupFiles : empty;
226
+ }
227
+ __name(build, "build");
228
+ exports.build = build;
229
+ }
230
+ });
231
+
232
+ // ../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/resolve-symlink.js
233
+ var require_resolve_symlink = __commonJS({
234
+ "../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/resolve-symlink.js"(exports) {
235
+ "use strict";
236
+ var __importDefault = exports && exports.__importDefault || function(mod) {
237
+ return mod && mod.__esModule ? mod : { "default": mod };
238
+ };
239
+ Object.defineProperty(exports, "__esModule", { value: true });
240
+ exports.build = void 0;
241
+ var fs_1 = __importDefault(__require("fs"));
242
+ var path_1 = __require("path");
243
+ var resolveSymlinksAsync = /* @__PURE__ */ __name(function(path4, state, callback) {
244
+ const { queue, options: { suppressErrors } } = state;
245
+ queue.enqueue();
246
+ fs_1.default.realpath(path4, (error, resolvedPath) => {
247
+ if (error)
248
+ return queue.dequeue(suppressErrors ? null : error, state);
249
+ fs_1.default.stat(resolvedPath, (error2, stat) => {
250
+ if (error2)
251
+ return queue.dequeue(suppressErrors ? null : error2, state);
252
+ if (stat.isDirectory() && isRecursive(path4, resolvedPath, state))
253
+ return queue.dequeue(null, state);
254
+ callback(stat, resolvedPath);
255
+ queue.dequeue(null, state);
256
+ });
257
+ });
258
+ }, "resolveSymlinksAsync");
259
+ var resolveSymlinks = /* @__PURE__ */ __name(function(path4, state, callback) {
260
+ const { queue, options: { suppressErrors } } = state;
261
+ queue.enqueue();
262
+ try {
263
+ const resolvedPath = fs_1.default.realpathSync(path4);
264
+ const stat = fs_1.default.statSync(resolvedPath);
265
+ if (stat.isDirectory() && isRecursive(path4, resolvedPath, state))
266
+ return;
267
+ callback(stat, resolvedPath);
268
+ } catch (e) {
269
+ if (!suppressErrors)
270
+ throw e;
271
+ }
272
+ }, "resolveSymlinks");
273
+ function build(options, isSynchronous) {
274
+ if (!options.resolveSymlinks || options.excludeSymlinks)
275
+ return null;
276
+ return isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
277
+ }
278
+ __name(build, "build");
279
+ exports.build = build;
280
+ function isRecursive(path4, resolved, state) {
281
+ if (state.options.useRealPaths)
282
+ return isRecursiveUsingRealPaths(resolved, state);
283
+ let parent = (0, path_1.dirname)(path4);
284
+ let depth = 1;
285
+ while (parent !== state.root && depth < 2) {
286
+ const resolvedPath = state.symlinks.get(parent);
287
+ const isSameRoot = !!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath));
288
+ if (isSameRoot)
289
+ depth++;
290
+ else
291
+ parent = (0, path_1.dirname)(parent);
292
+ }
293
+ state.symlinks.set(path4, resolved);
294
+ return depth > 1;
295
+ }
296
+ __name(isRecursive, "isRecursive");
297
+ function isRecursiveUsingRealPaths(resolved, state) {
298
+ return state.visited.includes(resolved + state.options.pathSeparator);
299
+ }
300
+ __name(isRecursiveUsingRealPaths, "isRecursiveUsingRealPaths");
301
+ }
302
+ });
303
+
304
+ // ../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/invoke-callback.js
305
+ var require_invoke_callback = __commonJS({
306
+ "../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/invoke-callback.js"(exports) {
307
+ "use strict";
308
+ Object.defineProperty(exports, "__esModule", { value: true });
309
+ exports.build = void 0;
310
+ var onlyCountsSync = /* @__PURE__ */ __name((state) => {
311
+ return state.counts;
312
+ }, "onlyCountsSync");
313
+ var groupsSync = /* @__PURE__ */ __name((state) => {
314
+ return state.groups;
315
+ }, "groupsSync");
316
+ var defaultSync = /* @__PURE__ */ __name((state) => {
317
+ return state.paths;
318
+ }, "defaultSync");
319
+ var limitFilesSync = /* @__PURE__ */ __name((state) => {
320
+ return state.paths.slice(0, state.options.maxFiles);
321
+ }, "limitFilesSync");
322
+ var onlyCountsAsync = /* @__PURE__ */ __name((state, error, callback) => {
323
+ report(error, callback, state.counts, state.options.suppressErrors);
324
+ return null;
325
+ }, "onlyCountsAsync");
326
+ var defaultAsync = /* @__PURE__ */ __name((state, error, callback) => {
327
+ report(error, callback, state.paths, state.options.suppressErrors);
328
+ return null;
329
+ }, "defaultAsync");
330
+ var limitFilesAsync = /* @__PURE__ */ __name((state, error, callback) => {
331
+ report(error, callback, state.paths.slice(0, state.options.maxFiles), state.options.suppressErrors);
332
+ return null;
333
+ }, "limitFilesAsync");
334
+ var groupsAsync = /* @__PURE__ */ __name((state, error, callback) => {
335
+ report(error, callback, state.groups, state.options.suppressErrors);
336
+ return null;
337
+ }, "groupsAsync");
338
+ function report(error, callback, output, suppressErrors) {
339
+ if (error && !suppressErrors)
340
+ callback(error, output);
341
+ else
342
+ callback(null, output);
343
+ }
344
+ __name(report, "report");
345
+ function build(options, isSynchronous) {
346
+ const { onlyCounts, group, maxFiles } = options;
347
+ if (onlyCounts)
348
+ return isSynchronous ? onlyCountsSync : onlyCountsAsync;
349
+ else if (group)
350
+ return isSynchronous ? groupsSync : groupsAsync;
351
+ else if (maxFiles)
352
+ return isSynchronous ? limitFilesSync : limitFilesAsync;
353
+ else
354
+ return isSynchronous ? defaultSync : defaultAsync;
355
+ }
356
+ __name(build, "build");
357
+ exports.build = build;
358
+ }
359
+ });
360
+
361
+ // ../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/walk-directory.js
362
+ var require_walk_directory = __commonJS({
363
+ "../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/walk-directory.js"(exports) {
364
+ "use strict";
365
+ var __importDefault = exports && exports.__importDefault || function(mod) {
366
+ return mod && mod.__esModule ? mod : { "default": mod };
367
+ };
368
+ Object.defineProperty(exports, "__esModule", { value: true });
369
+ exports.build = void 0;
370
+ var fs_1 = __importDefault(__require("fs"));
371
+ var readdirOpts = { withFileTypes: true };
372
+ var walkAsync = /* @__PURE__ */ __name((state, crawlPath, directoryPath, currentDepth, callback) => {
373
+ state.queue.enqueue();
374
+ if (currentDepth < 0)
375
+ return state.queue.dequeue(null, state);
376
+ state.visited.push(crawlPath);
377
+ state.counts.directories++;
378
+ fs_1.default.readdir(crawlPath || ".", readdirOpts, (error, entries = []) => {
379
+ callback(entries, directoryPath, currentDepth);
380
+ state.queue.dequeue(state.options.suppressErrors ? null : error, state);
381
+ });
382
+ }, "walkAsync");
383
+ var walkSync = /* @__PURE__ */ __name((state, crawlPath, directoryPath, currentDepth, callback) => {
384
+ if (currentDepth < 0)
385
+ return;
386
+ state.visited.push(crawlPath);
387
+ state.counts.directories++;
388
+ let entries = [];
389
+ try {
390
+ entries = fs_1.default.readdirSync(crawlPath || ".", readdirOpts);
391
+ } catch (e) {
392
+ if (!state.options.suppressErrors)
393
+ throw e;
394
+ }
395
+ callback(entries, directoryPath, currentDepth);
396
+ }, "walkSync");
397
+ function build(isSynchronous) {
398
+ return isSynchronous ? walkSync : walkAsync;
399
+ }
400
+ __name(build, "build");
401
+ exports.build = build;
402
+ }
403
+ });
404
+
405
+ // ../node_modules/tinyglobby/node_modules/fdir/dist/api/queue.js
406
+ var require_queue = __commonJS({
407
+ "../node_modules/tinyglobby/node_modules/fdir/dist/api/queue.js"(exports) {
408
+ "use strict";
409
+ Object.defineProperty(exports, "__esModule", { value: true });
410
+ exports.Queue = void 0;
411
+ var Queue = class {
412
+ static {
413
+ __name(this, "Queue");
414
+ }
415
+ onQueueEmpty;
416
+ count = 0;
417
+ constructor(onQueueEmpty) {
418
+ this.onQueueEmpty = onQueueEmpty;
419
+ }
420
+ enqueue() {
421
+ this.count++;
422
+ return this.count;
423
+ }
424
+ dequeue(error, output) {
425
+ if (this.onQueueEmpty && (--this.count <= 0 || error)) {
426
+ this.onQueueEmpty(error, output);
427
+ if (error) {
428
+ output.controller.abort();
429
+ this.onQueueEmpty = void 0;
430
+ }
431
+ }
432
+ }
433
+ };
434
+ exports.Queue = Queue;
435
+ }
436
+ });
437
+
438
+ // ../node_modules/tinyglobby/node_modules/fdir/dist/api/counter.js
439
+ var require_counter = __commonJS({
440
+ "../node_modules/tinyglobby/node_modules/fdir/dist/api/counter.js"(exports) {
441
+ "use strict";
442
+ Object.defineProperty(exports, "__esModule", { value: true });
443
+ exports.Counter = void 0;
444
+ var Counter = class {
445
+ static {
446
+ __name(this, "Counter");
447
+ }
448
+ _files = 0;
449
+ _directories = 0;
450
+ set files(num) {
451
+ this._files = num;
452
+ }
453
+ get files() {
454
+ return this._files;
455
+ }
456
+ set directories(num) {
457
+ this._directories = num;
458
+ }
459
+ get directories() {
460
+ return this._directories;
461
+ }
462
+ /**
463
+ * @deprecated use `directories` instead
464
+ */
465
+ /* c8 ignore next 3 */
466
+ get dirs() {
467
+ return this._directories;
468
+ }
469
+ };
470
+ exports.Counter = Counter;
471
+ }
472
+ });
473
+
474
+ // ../node_modules/tinyglobby/node_modules/fdir/dist/api/walker.js
475
+ var require_walker = __commonJS({
476
+ "../node_modules/tinyglobby/node_modules/fdir/dist/api/walker.js"(exports) {
477
+ "use strict";
478
+ var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
479
+ if (k2 === void 0) k2 = k;
480
+ var desc = Object.getOwnPropertyDescriptor(m, k);
481
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
482
+ desc = { enumerable: true, get: /* @__PURE__ */ __name(function() {
483
+ return m[k];
484
+ }, "get") };
485
+ }
486
+ Object.defineProperty(o, k2, desc);
487
+ } : function(o, m, k, k2) {
488
+ if (k2 === void 0) k2 = k;
489
+ o[k2] = m[k];
490
+ });
491
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
492
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
493
+ } : function(o, v) {
494
+ o["default"] = v;
495
+ });
496
+ var __importStar = exports && exports.__importStar || function(mod) {
497
+ if (mod && mod.__esModule) return mod;
498
+ var result = {};
499
+ if (mod != null) {
500
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
501
+ }
502
+ __setModuleDefault(result, mod);
503
+ return result;
504
+ };
505
+ Object.defineProperty(exports, "__esModule", { value: true });
506
+ exports.Walker = void 0;
507
+ var path_1 = __require("path");
508
+ var utils_1 = require_utils();
509
+ var joinPath = __importStar(require_join_path());
510
+ var pushDirectory = __importStar(require_push_directory());
511
+ var pushFile = __importStar(require_push_file());
512
+ var getArray = __importStar(require_get_array());
513
+ var groupFiles = __importStar(require_group_files());
514
+ var resolveSymlink = __importStar(require_resolve_symlink());
515
+ var invokeCallback = __importStar(require_invoke_callback());
516
+ var walkDirectory = __importStar(require_walk_directory());
517
+ var queue_1 = require_queue();
518
+ var counter_1 = require_counter();
519
+ var Walker = class {
520
+ static {
521
+ __name(this, "Walker");
522
+ }
523
+ root;
524
+ isSynchronous;
525
+ state;
526
+ joinPath;
527
+ pushDirectory;
528
+ pushFile;
529
+ getArray;
530
+ groupFiles;
531
+ resolveSymlink;
532
+ walkDirectory;
533
+ callbackInvoker;
534
+ constructor(root, options, callback) {
535
+ this.isSynchronous = !callback;
536
+ this.callbackInvoker = invokeCallback.build(options, this.isSynchronous);
537
+ this.root = (0, utils_1.normalizePath)(root, options);
538
+ this.state = {
539
+ root: (0, utils_1.isRootDirectory)(this.root) ? this.root : this.root.slice(0, -1),
540
+ // Perf: we explicitly tell the compiler to optimize for String arrays
541
+ paths: [""].slice(0, 0),
542
+ groups: [],
543
+ counts: new counter_1.Counter(),
544
+ options,
545
+ queue: new queue_1.Queue((error, state) => this.callbackInvoker(state, error, callback)),
546
+ symlinks: /* @__PURE__ */ new Map(),
547
+ visited: [""].slice(0, 0),
548
+ controller: new AbortController()
549
+ };
550
+ this.joinPath = joinPath.build(this.root, options);
551
+ this.pushDirectory = pushDirectory.build(this.root, options);
552
+ this.pushFile = pushFile.build(options);
553
+ this.getArray = getArray.build(options);
554
+ this.groupFiles = groupFiles.build(options);
555
+ this.resolveSymlink = resolveSymlink.build(options, this.isSynchronous);
556
+ this.walkDirectory = walkDirectory.build(this.isSynchronous);
557
+ }
558
+ start() {
559
+ this.pushDirectory(this.root, this.state.paths, this.state.options.filters);
560
+ this.walkDirectory(this.state, this.root, this.root, this.state.options.maxDepth, this.walk);
561
+ return this.isSynchronous ? this.callbackInvoker(this.state, null) : null;
562
+ }
563
+ walk = /* @__PURE__ */ __name((entries, directoryPath, depth) => {
564
+ const { paths, options: { filters, resolveSymlinks, excludeSymlinks, exclude, maxFiles, signal, useRealPaths, pathSeparator }, controller } = this.state;
565
+ if (controller.signal.aborted || signal && signal.aborted || maxFiles && paths.length > maxFiles)
566
+ return;
567
+ const files = this.getArray(this.state.paths);
568
+ for (let i = 0; i < entries.length; ++i) {
569
+ const entry = entries[i];
570
+ if (entry.isFile() || entry.isSymbolicLink() && !resolveSymlinks && !excludeSymlinks) {
571
+ const filename = this.joinPath(entry.name, directoryPath);
572
+ this.pushFile(filename, files, this.state.counts, filters);
573
+ } else if (entry.isDirectory()) {
574
+ let path4 = joinPath.joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
575
+ if (exclude && exclude(entry.name, path4))
576
+ continue;
577
+ this.pushDirectory(path4, paths, filters);
578
+ this.walkDirectory(this.state, path4, path4, depth - 1, this.walk);
579
+ } else if (this.resolveSymlink && entry.isSymbolicLink()) {
580
+ let path4 = joinPath.joinPathWithBasePath(entry.name, directoryPath);
581
+ this.resolveSymlink(path4, this.state, (stat, resolvedPath) => {
582
+ if (stat.isDirectory()) {
583
+ resolvedPath = (0, utils_1.normalizePath)(resolvedPath, this.state.options);
584
+ if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path4 + pathSeparator))
585
+ return;
586
+ this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path4 + pathSeparator, depth - 1, this.walk);
587
+ } else {
588
+ resolvedPath = useRealPaths ? resolvedPath : path4;
589
+ const filename = (0, path_1.basename)(resolvedPath);
590
+ const directoryPath2 = (0, utils_1.normalizePath)((0, path_1.dirname)(resolvedPath), this.state.options);
591
+ resolvedPath = this.joinPath(filename, directoryPath2);
592
+ this.pushFile(resolvedPath, files, this.state.counts, filters);
593
+ }
594
+ });
595
+ }
596
+ }
597
+ this.groupFiles(this.state.groups, directoryPath, files);
598
+ }, "walk");
599
+ };
600
+ exports.Walker = Walker;
601
+ }
602
+ });
603
+
604
+ // ../node_modules/tinyglobby/node_modules/fdir/dist/api/async.js
605
+ var require_async = __commonJS({
606
+ "../node_modules/tinyglobby/node_modules/fdir/dist/api/async.js"(exports) {
607
+ "use strict";
608
+ Object.defineProperty(exports, "__esModule", { value: true });
609
+ exports.callback = exports.promise = void 0;
610
+ var walker_1 = require_walker();
611
+ function promise(root, options) {
612
+ return new Promise((resolve2, reject) => {
613
+ callback(root, options, (err, output) => {
614
+ if (err)
615
+ return reject(err);
616
+ resolve2(output);
617
+ });
618
+ });
619
+ }
620
+ __name(promise, "promise");
621
+ exports.promise = promise;
622
+ function callback(root, options, callback2) {
623
+ let walker = new walker_1.Walker(root, options, callback2);
624
+ walker.start();
625
+ }
626
+ __name(callback, "callback");
627
+ exports.callback = callback;
628
+ }
629
+ });
630
+
631
+ // ../node_modules/tinyglobby/node_modules/fdir/dist/api/sync.js
632
+ var require_sync = __commonJS({
633
+ "../node_modules/tinyglobby/node_modules/fdir/dist/api/sync.js"(exports) {
634
+ "use strict";
635
+ Object.defineProperty(exports, "__esModule", { value: true });
636
+ exports.sync = void 0;
637
+ var walker_1 = require_walker();
638
+ function sync(root, options) {
639
+ const walker = new walker_1.Walker(root, options);
640
+ return walker.start();
641
+ }
642
+ __name(sync, "sync");
643
+ exports.sync = sync;
644
+ }
645
+ });
646
+
647
+ // ../node_modules/tinyglobby/node_modules/fdir/dist/builder/api-builder.js
648
+ var require_api_builder = __commonJS({
649
+ "../node_modules/tinyglobby/node_modules/fdir/dist/builder/api-builder.js"(exports) {
650
+ "use strict";
651
+ Object.defineProperty(exports, "__esModule", { value: true });
652
+ exports.APIBuilder = void 0;
653
+ var async_1 = require_async();
654
+ var sync_1 = require_sync();
655
+ var APIBuilder = class {
656
+ static {
657
+ __name(this, "APIBuilder");
658
+ }
659
+ root;
660
+ options;
661
+ constructor(root, options) {
662
+ this.root = root;
663
+ this.options = options;
664
+ }
665
+ withPromise() {
666
+ return (0, async_1.promise)(this.root, this.options);
667
+ }
668
+ withCallback(cb) {
669
+ (0, async_1.callback)(this.root, this.options, cb);
670
+ }
671
+ sync() {
672
+ return (0, sync_1.sync)(this.root, this.options);
673
+ }
674
+ };
675
+ exports.APIBuilder = APIBuilder;
676
+ }
677
+ });
678
+
679
+ // ../node_modules/tinyglobby/node_modules/picomatch/lib/constants.js
680
+ var require_constants = __commonJS({
681
+ "../node_modules/tinyglobby/node_modules/picomatch/lib/constants.js"(exports, module) {
682
+ "use strict";
683
+ var WIN_SLASH = "\\\\/";
684
+ var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
685
+ var DOT_LITERAL = "\\.";
686
+ var PLUS_LITERAL = "\\+";
687
+ var QMARK_LITERAL = "\\?";
688
+ var SLASH_LITERAL = "\\/";
689
+ var ONE_CHAR = "(?=.)";
690
+ var QMARK = "[^/]";
691
+ var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
692
+ var START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
693
+ var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
694
+ var NO_DOT = `(?!${DOT_LITERAL})`;
695
+ var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
696
+ var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
697
+ var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
698
+ var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
699
+ var STAR = `${QMARK}*?`;
700
+ var SEP = "/";
701
+ var POSIX_CHARS = {
702
+ DOT_LITERAL,
703
+ PLUS_LITERAL,
704
+ QMARK_LITERAL,
705
+ SLASH_LITERAL,
706
+ ONE_CHAR,
707
+ QMARK,
708
+ END_ANCHOR,
709
+ DOTS_SLASH,
710
+ NO_DOT,
711
+ NO_DOTS,
712
+ NO_DOT_SLASH,
713
+ NO_DOTS_SLASH,
714
+ QMARK_NO_DOT,
715
+ STAR,
716
+ START_ANCHOR,
717
+ SEP
718
+ };
719
+ var WINDOWS_CHARS = {
720
+ ...POSIX_CHARS,
721
+ SLASH_LITERAL: `[${WIN_SLASH}]`,
722
+ QMARK: WIN_NO_SLASH,
723
+ STAR: `${WIN_NO_SLASH}*?`,
724
+ DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
725
+ NO_DOT: `(?!${DOT_LITERAL})`,
726
+ NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
727
+ NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
728
+ NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
729
+ QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
730
+ START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
731
+ END_ANCHOR: `(?:[${WIN_SLASH}]|$)`,
732
+ SEP: "\\"
733
+ };
734
+ var POSIX_REGEX_SOURCE = {
735
+ alnum: "a-zA-Z0-9",
736
+ alpha: "a-zA-Z",
737
+ ascii: "\\x00-\\x7F",
738
+ blank: " \\t",
739
+ cntrl: "\\x00-\\x1F\\x7F",
740
+ digit: "0-9",
741
+ graph: "\\x21-\\x7E",
742
+ lower: "a-z",
743
+ print: "\\x20-\\x7E ",
744
+ punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
745
+ space: " \\t\\r\\n\\v\\f",
746
+ upper: "A-Z",
747
+ word: "A-Za-z0-9_",
748
+ xdigit: "A-Fa-f0-9"
749
+ };
750
+ module.exports = {
751
+ MAX_LENGTH: 1024 * 64,
752
+ POSIX_REGEX_SOURCE,
753
+ // regular expressions
754
+ REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
755
+ REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
756
+ REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
757
+ REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
758
+ REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
759
+ REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
760
+ // Replace globs with equivalent patterns to reduce parsing time.
761
+ REPLACEMENTS: {
762
+ "***": "*",
763
+ "**/**": "**",
764
+ "**/**/**": "**"
765
+ },
766
+ // Digits
767
+ CHAR_0: 48,
768
+ /* 0 */
769
+ CHAR_9: 57,
770
+ /* 9 */
771
+ // Alphabet chars.
772
+ CHAR_UPPERCASE_A: 65,
773
+ /* A */
774
+ CHAR_LOWERCASE_A: 97,
775
+ /* a */
776
+ CHAR_UPPERCASE_Z: 90,
777
+ /* Z */
778
+ CHAR_LOWERCASE_Z: 122,
779
+ /* z */
780
+ CHAR_LEFT_PARENTHESES: 40,
781
+ /* ( */
782
+ CHAR_RIGHT_PARENTHESES: 41,
783
+ /* ) */
784
+ CHAR_ASTERISK: 42,
785
+ /* * */
786
+ // Non-alphabetic chars.
787
+ CHAR_AMPERSAND: 38,
788
+ /* & */
789
+ CHAR_AT: 64,
790
+ /* @ */
791
+ CHAR_BACKWARD_SLASH: 92,
792
+ /* \ */
793
+ CHAR_CARRIAGE_RETURN: 13,
794
+ /* \r */
795
+ CHAR_CIRCUMFLEX_ACCENT: 94,
796
+ /* ^ */
797
+ CHAR_COLON: 58,
798
+ /* : */
799
+ CHAR_COMMA: 44,
800
+ /* , */
801
+ CHAR_DOT: 46,
802
+ /* . */
803
+ CHAR_DOUBLE_QUOTE: 34,
804
+ /* " */
805
+ CHAR_EQUAL: 61,
806
+ /* = */
807
+ CHAR_EXCLAMATION_MARK: 33,
808
+ /* ! */
809
+ CHAR_FORM_FEED: 12,
810
+ /* \f */
811
+ CHAR_FORWARD_SLASH: 47,
812
+ /* / */
813
+ CHAR_GRAVE_ACCENT: 96,
814
+ /* ` */
815
+ CHAR_HASH: 35,
816
+ /* # */
817
+ CHAR_HYPHEN_MINUS: 45,
818
+ /* - */
819
+ CHAR_LEFT_ANGLE_BRACKET: 60,
820
+ /* < */
821
+ CHAR_LEFT_CURLY_BRACE: 123,
822
+ /* { */
823
+ CHAR_LEFT_SQUARE_BRACKET: 91,
824
+ /* [ */
825
+ CHAR_LINE_FEED: 10,
826
+ /* \n */
827
+ CHAR_NO_BREAK_SPACE: 160,
828
+ /* \u00A0 */
829
+ CHAR_PERCENT: 37,
830
+ /* % */
831
+ CHAR_PLUS: 43,
832
+ /* + */
833
+ CHAR_QUESTION_MARK: 63,
834
+ /* ? */
835
+ CHAR_RIGHT_ANGLE_BRACKET: 62,
836
+ /* > */
837
+ CHAR_RIGHT_CURLY_BRACE: 125,
838
+ /* } */
839
+ CHAR_RIGHT_SQUARE_BRACKET: 93,
840
+ /* ] */
841
+ CHAR_SEMICOLON: 59,
842
+ /* ; */
843
+ CHAR_SINGLE_QUOTE: 39,
844
+ /* ' */
845
+ CHAR_SPACE: 32,
846
+ /* */
847
+ CHAR_TAB: 9,
848
+ /* \t */
849
+ CHAR_UNDERSCORE: 95,
850
+ /* _ */
851
+ CHAR_VERTICAL_LINE: 124,
852
+ /* | */
853
+ CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
854
+ /* \uFEFF */
855
+ /**
856
+ * Create EXTGLOB_CHARS
857
+ */
858
+ extglobChars(chars) {
859
+ return {
860
+ "!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` },
861
+ "?": { type: "qmark", open: "(?:", close: ")?" },
862
+ "+": { type: "plus", open: "(?:", close: ")+" },
863
+ "*": { type: "star", open: "(?:", close: ")*" },
864
+ "@": { type: "at", open: "(?:", close: ")" }
865
+ };
866
+ },
867
+ /**
868
+ * Create GLOB_CHARS
869
+ */
870
+ globChars(win32) {
871
+ return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
872
+ }
873
+ };
874
+ }
875
+ });
876
+
877
+ // ../node_modules/tinyglobby/node_modules/picomatch/lib/utils.js
878
+ var require_utils2 = __commonJS({
879
+ "../node_modules/tinyglobby/node_modules/picomatch/lib/utils.js"(exports) {
880
+ "use strict";
881
+ var {
882
+ REGEX_BACKSLASH,
883
+ REGEX_REMOVE_BACKSLASH,
884
+ REGEX_SPECIAL_CHARS,
885
+ REGEX_SPECIAL_CHARS_GLOBAL
886
+ } = require_constants();
887
+ exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
888
+ exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
889
+ exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str);
890
+ exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
891
+ exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
892
+ exports.isWindows = () => {
893
+ if (typeof navigator !== "undefined" && navigator.platform) {
894
+ const platform = navigator.platform.toLowerCase();
895
+ return platform === "win32" || platform === "windows";
896
+ }
897
+ if (typeof process !== "undefined" && process.platform) {
898
+ return process.platform === "win32";
899
+ }
900
+ return false;
901
+ };
902
+ exports.removeBackslashes = (str) => {
903
+ return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
904
+ return match === "\\" ? "" : match;
905
+ });
906
+ };
907
+ exports.escapeLast = (input, char, lastIdx) => {
908
+ const idx = input.lastIndexOf(char, lastIdx);
909
+ if (idx === -1) return input;
910
+ if (input[idx - 1] === "\\") return exports.escapeLast(input, char, idx - 1);
911
+ return `${input.slice(0, idx)}\\${input.slice(idx)}`;
912
+ };
913
+ exports.removePrefix = (input, state = {}) => {
914
+ let output = input;
915
+ if (output.startsWith("./")) {
916
+ output = output.slice(2);
917
+ state.prefix = "./";
918
+ }
919
+ return output;
920
+ };
921
+ exports.wrapOutput = (input, state = {}, options = {}) => {
922
+ const prepend = options.contains ? "" : "^";
923
+ const append = options.contains ? "" : "$";
924
+ let output = `${prepend}(?:${input})${append}`;
925
+ if (state.negated === true) {
926
+ output = `(?:^(?!${output}).*$)`;
927
+ }
928
+ return output;
929
+ };
930
+ exports.basename = (path4, { windows } = {}) => {
931
+ const segs = path4.split(windows ? /[\\/]/ : "/");
932
+ const last = segs[segs.length - 1];
933
+ if (last === "") {
934
+ return segs[segs.length - 2];
935
+ }
936
+ return last;
937
+ };
938
+ }
939
+ });
940
+
941
+ // ../node_modules/tinyglobby/node_modules/picomatch/lib/scan.js
942
+ var require_scan = __commonJS({
943
+ "../node_modules/tinyglobby/node_modules/picomatch/lib/scan.js"(exports, module) {
944
+ "use strict";
945
+ var utils = require_utils2();
946
+ var {
947
+ CHAR_ASTERISK,
948
+ /* * */
949
+ CHAR_AT,
950
+ /* @ */
951
+ CHAR_BACKWARD_SLASH,
952
+ /* \ */
953
+ CHAR_COMMA,
954
+ /* , */
955
+ CHAR_DOT,
956
+ /* . */
957
+ CHAR_EXCLAMATION_MARK,
958
+ /* ! */
959
+ CHAR_FORWARD_SLASH,
960
+ /* / */
961
+ CHAR_LEFT_CURLY_BRACE,
962
+ /* { */
963
+ CHAR_LEFT_PARENTHESES,
964
+ /* ( */
965
+ CHAR_LEFT_SQUARE_BRACKET,
966
+ /* [ */
967
+ CHAR_PLUS,
968
+ /* + */
969
+ CHAR_QUESTION_MARK,
970
+ /* ? */
971
+ CHAR_RIGHT_CURLY_BRACE,
972
+ /* } */
973
+ CHAR_RIGHT_PARENTHESES,
974
+ /* ) */
975
+ CHAR_RIGHT_SQUARE_BRACKET
976
+ /* ] */
977
+ } = require_constants();
978
+ var isPathSeparator = /* @__PURE__ */ __name((code) => {
979
+ return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
980
+ }, "isPathSeparator");
981
+ var depth = /* @__PURE__ */ __name((token) => {
982
+ if (token.isPrefix !== true) {
983
+ token.depth = token.isGlobstar ? Infinity : 1;
984
+ }
985
+ }, "depth");
986
+ var scan = /* @__PURE__ */ __name((input, options) => {
987
+ const opts = options || {};
988
+ const length = input.length - 1;
989
+ const scanToEnd = opts.parts === true || opts.scanToEnd === true;
990
+ const slashes = [];
991
+ const tokens = [];
992
+ const parts = [];
993
+ let str = input;
994
+ let index = -1;
995
+ let start = 0;
996
+ let lastIndex = 0;
997
+ let isBrace = false;
998
+ let isBracket = false;
999
+ let isGlob = false;
1000
+ let isExtglob = false;
1001
+ let isGlobstar = false;
1002
+ let braceEscaped = false;
1003
+ let backslashes = false;
1004
+ let negated = false;
1005
+ let negatedExtglob = false;
1006
+ let finished = false;
1007
+ let braces = 0;
1008
+ let prev;
1009
+ let code;
1010
+ let token = { value: "", depth: 0, isGlob: false };
1011
+ const eos = /* @__PURE__ */ __name(() => index >= length, "eos");
1012
+ const peek = /* @__PURE__ */ __name(() => str.charCodeAt(index + 1), "peek");
1013
+ const advance = /* @__PURE__ */ __name(() => {
1014
+ prev = code;
1015
+ return str.charCodeAt(++index);
1016
+ }, "advance");
1017
+ while (index < length) {
1018
+ code = advance();
1019
+ let next;
1020
+ if (code === CHAR_BACKWARD_SLASH) {
1021
+ backslashes = token.backslashes = true;
1022
+ code = advance();
1023
+ if (code === CHAR_LEFT_CURLY_BRACE) {
1024
+ braceEscaped = true;
1025
+ }
1026
+ continue;
1027
+ }
1028
+ if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
1029
+ braces++;
1030
+ while (eos() !== true && (code = advance())) {
1031
+ if (code === CHAR_BACKWARD_SLASH) {
1032
+ backslashes = token.backslashes = true;
1033
+ advance();
1034
+ continue;
1035
+ }
1036
+ if (code === CHAR_LEFT_CURLY_BRACE) {
1037
+ braces++;
1038
+ continue;
1039
+ }
1040
+ if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
1041
+ isBrace = token.isBrace = true;
1042
+ isGlob = token.isGlob = true;
1043
+ finished = true;
1044
+ if (scanToEnd === true) {
1045
+ continue;
1046
+ }
1047
+ break;
1048
+ }
1049
+ if (braceEscaped !== true && code === CHAR_COMMA) {
1050
+ isBrace = token.isBrace = true;
1051
+ isGlob = token.isGlob = true;
1052
+ finished = true;
1053
+ if (scanToEnd === true) {
1054
+ continue;
1055
+ }
1056
+ break;
1057
+ }
1058
+ if (code === CHAR_RIGHT_CURLY_BRACE) {
1059
+ braces--;
1060
+ if (braces === 0) {
1061
+ braceEscaped = false;
1062
+ isBrace = token.isBrace = true;
1063
+ finished = true;
1064
+ break;
1065
+ }
1066
+ }
1067
+ }
1068
+ if (scanToEnd === true) {
1069
+ continue;
1070
+ }
1071
+ break;
1072
+ }
1073
+ if (code === CHAR_FORWARD_SLASH) {
1074
+ slashes.push(index);
1075
+ tokens.push(token);
1076
+ token = { value: "", depth: 0, isGlob: false };
1077
+ if (finished === true) continue;
1078
+ if (prev === CHAR_DOT && index === start + 1) {
1079
+ start += 2;
1080
+ continue;
1081
+ }
1082
+ lastIndex = index + 1;
1083
+ continue;
1084
+ }
1085
+ if (opts.noext !== true) {
1086
+ const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK;
1087
+ if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
1088
+ isGlob = token.isGlob = true;
1089
+ isExtglob = token.isExtglob = true;
1090
+ finished = true;
1091
+ if (code === CHAR_EXCLAMATION_MARK && index === start) {
1092
+ negatedExtglob = true;
1093
+ }
1094
+ if (scanToEnd === true) {
1095
+ while (eos() !== true && (code = advance())) {
1096
+ if (code === CHAR_BACKWARD_SLASH) {
1097
+ backslashes = token.backslashes = true;
1098
+ code = advance();
1099
+ continue;
1100
+ }
1101
+ if (code === CHAR_RIGHT_PARENTHESES) {
1102
+ isGlob = token.isGlob = true;
1103
+ finished = true;
1104
+ break;
1105
+ }
1106
+ }
1107
+ continue;
1108
+ }
1109
+ break;
1110
+ }
1111
+ }
1112
+ if (code === CHAR_ASTERISK) {
1113
+ if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
1114
+ isGlob = token.isGlob = true;
1115
+ finished = true;
1116
+ if (scanToEnd === true) {
1117
+ continue;
1118
+ }
1119
+ break;
1120
+ }
1121
+ if (code === CHAR_QUESTION_MARK) {
1122
+ isGlob = token.isGlob = true;
1123
+ finished = true;
1124
+ if (scanToEnd === true) {
1125
+ continue;
1126
+ }
1127
+ break;
1128
+ }
1129
+ if (code === CHAR_LEFT_SQUARE_BRACKET) {
1130
+ while (eos() !== true && (next = advance())) {
1131
+ if (next === CHAR_BACKWARD_SLASH) {
1132
+ backslashes = token.backslashes = true;
1133
+ advance();
1134
+ continue;
1135
+ }
1136
+ if (next === CHAR_RIGHT_SQUARE_BRACKET) {
1137
+ isBracket = token.isBracket = true;
1138
+ isGlob = token.isGlob = true;
1139
+ finished = true;
1140
+ break;
1141
+ }
1142
+ }
1143
+ if (scanToEnd === true) {
1144
+ continue;
1145
+ }
1146
+ break;
1147
+ }
1148
+ if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
1149
+ negated = token.negated = true;
1150
+ start++;
1151
+ continue;
1152
+ }
1153
+ if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
1154
+ isGlob = token.isGlob = true;
1155
+ if (scanToEnd === true) {
1156
+ while (eos() !== true && (code = advance())) {
1157
+ if (code === CHAR_LEFT_PARENTHESES) {
1158
+ backslashes = token.backslashes = true;
1159
+ code = advance();
1160
+ continue;
1161
+ }
1162
+ if (code === CHAR_RIGHT_PARENTHESES) {
1163
+ finished = true;
1164
+ break;
1165
+ }
1166
+ }
1167
+ continue;
1168
+ }
1169
+ break;
1170
+ }
1171
+ if (isGlob === true) {
1172
+ finished = true;
1173
+ if (scanToEnd === true) {
1174
+ continue;
1175
+ }
1176
+ break;
1177
+ }
1178
+ }
1179
+ if (opts.noext === true) {
1180
+ isExtglob = false;
1181
+ isGlob = false;
1182
+ }
1183
+ let base = str;
1184
+ let prefix = "";
1185
+ let glob = "";
1186
+ if (start > 0) {
1187
+ prefix = str.slice(0, start);
1188
+ str = str.slice(start);
1189
+ lastIndex -= start;
1190
+ }
1191
+ if (base && isGlob === true && lastIndex > 0) {
1192
+ base = str.slice(0, lastIndex);
1193
+ glob = str.slice(lastIndex);
1194
+ } else if (isGlob === true) {
1195
+ base = "";
1196
+ glob = str;
1197
+ } else {
1198
+ base = str;
1199
+ }
1200
+ if (base && base !== "" && base !== "/" && base !== str) {
1201
+ if (isPathSeparator(base.charCodeAt(base.length - 1))) {
1202
+ base = base.slice(0, -1);
1203
+ }
1204
+ }
1205
+ if (opts.unescape === true) {
1206
+ if (glob) glob = utils.removeBackslashes(glob);
1207
+ if (base && backslashes === true) {
1208
+ base = utils.removeBackslashes(base);
1209
+ }
1210
+ }
1211
+ const state = {
1212
+ prefix,
1213
+ input,
1214
+ start,
1215
+ base,
1216
+ glob,
1217
+ isBrace,
1218
+ isBracket,
1219
+ isGlob,
1220
+ isExtglob,
1221
+ isGlobstar,
1222
+ negated,
1223
+ negatedExtglob
1224
+ };
1225
+ if (opts.tokens === true) {
1226
+ state.maxDepth = 0;
1227
+ if (!isPathSeparator(code)) {
1228
+ tokens.push(token);
1229
+ }
1230
+ state.tokens = tokens;
1231
+ }
1232
+ if (opts.parts === true || opts.tokens === true) {
1233
+ let prevIndex;
1234
+ for (let idx = 0; idx < slashes.length; idx++) {
1235
+ const n = prevIndex ? prevIndex + 1 : start;
1236
+ const i = slashes[idx];
1237
+ const value = input.slice(n, i);
1238
+ if (opts.tokens) {
1239
+ if (idx === 0 && start !== 0) {
1240
+ tokens[idx].isPrefix = true;
1241
+ tokens[idx].value = prefix;
1242
+ } else {
1243
+ tokens[idx].value = value;
1244
+ }
1245
+ depth(tokens[idx]);
1246
+ state.maxDepth += tokens[idx].depth;
1247
+ }
1248
+ if (idx !== 0 || value !== "") {
1249
+ parts.push(value);
1250
+ }
1251
+ prevIndex = i;
1252
+ }
1253
+ if (prevIndex && prevIndex + 1 < input.length) {
1254
+ const value = input.slice(prevIndex + 1);
1255
+ parts.push(value);
1256
+ if (opts.tokens) {
1257
+ tokens[tokens.length - 1].value = value;
1258
+ depth(tokens[tokens.length - 1]);
1259
+ state.maxDepth += tokens[tokens.length - 1].depth;
1260
+ }
1261
+ }
1262
+ state.slashes = slashes;
1263
+ state.parts = parts;
1264
+ }
1265
+ return state;
1266
+ }, "scan");
1267
+ module.exports = scan;
1268
+ }
1269
+ });
1270
+
1271
+ // ../node_modules/tinyglobby/node_modules/picomatch/lib/parse.js
1272
+ var require_parse = __commonJS({
1273
+ "../node_modules/tinyglobby/node_modules/picomatch/lib/parse.js"(exports, module) {
1274
+ "use strict";
1275
+ var constants3 = require_constants();
1276
+ var utils = require_utils2();
1277
+ var {
1278
+ MAX_LENGTH,
1279
+ POSIX_REGEX_SOURCE,
1280
+ REGEX_NON_SPECIAL_CHARS,
1281
+ REGEX_SPECIAL_CHARS_BACKREF,
1282
+ REPLACEMENTS
1283
+ } = constants3;
1284
+ var expandRange = /* @__PURE__ */ __name((args, options) => {
1285
+ if (typeof options.expandRange === "function") {
1286
+ return options.expandRange(...args, options);
1287
+ }
1288
+ args.sort();
1289
+ const value = `[${args.join("-")}]`;
1290
+ try {
1291
+ new RegExp(value);
1292
+ } catch (ex) {
1293
+ return args.map((v) => utils.escapeRegex(v)).join("..");
1294
+ }
1295
+ return value;
1296
+ }, "expandRange");
1297
+ var syntaxError = /* @__PURE__ */ __name((type, char) => {
1298
+ return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
1299
+ }, "syntaxError");
1300
+ var parse = /* @__PURE__ */ __name((input, options) => {
1301
+ if (typeof input !== "string") {
1302
+ throw new TypeError("Expected a string");
1303
+ }
1304
+ input = REPLACEMENTS[input] || input;
1305
+ const opts = { ...options };
1306
+ const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
1307
+ let len = input.length;
1308
+ if (len > max) {
1309
+ throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
1310
+ }
1311
+ const bos = { type: "bos", value: "", output: opts.prepend || "" };
1312
+ const tokens = [bos];
1313
+ const capture = opts.capture ? "" : "?:";
1314
+ const PLATFORM_CHARS = constants3.globChars(opts.windows);
1315
+ const EXTGLOB_CHARS = constants3.extglobChars(PLATFORM_CHARS);
1316
+ const {
1317
+ DOT_LITERAL,
1318
+ PLUS_LITERAL,
1319
+ SLASH_LITERAL,
1320
+ ONE_CHAR,
1321
+ DOTS_SLASH,
1322
+ NO_DOT,
1323
+ NO_DOT_SLASH,
1324
+ NO_DOTS_SLASH,
1325
+ QMARK,
1326
+ QMARK_NO_DOT,
1327
+ STAR,
1328
+ START_ANCHOR
1329
+ } = PLATFORM_CHARS;
1330
+ const globstar = /* @__PURE__ */ __name((opts2) => {
1331
+ return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
1332
+ }, "globstar");
1333
+ const nodot = opts.dot ? "" : NO_DOT;
1334
+ const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
1335
+ let star = opts.bash === true ? globstar(opts) : STAR;
1336
+ if (opts.capture) {
1337
+ star = `(${star})`;
1338
+ }
1339
+ if (typeof opts.noext === "boolean") {
1340
+ opts.noextglob = opts.noext;
1341
+ }
1342
+ const state = {
1343
+ input,
1344
+ index: -1,
1345
+ start: 0,
1346
+ dot: opts.dot === true,
1347
+ consumed: "",
1348
+ output: "",
1349
+ prefix: "",
1350
+ backtrack: false,
1351
+ negated: false,
1352
+ brackets: 0,
1353
+ braces: 0,
1354
+ parens: 0,
1355
+ quotes: 0,
1356
+ globstar: false,
1357
+ tokens
1358
+ };
1359
+ input = utils.removePrefix(input, state);
1360
+ len = input.length;
1361
+ const extglobs = [];
1362
+ const braces = [];
1363
+ const stack = [];
1364
+ let prev = bos;
1365
+ let value;
1366
+ const eos = /* @__PURE__ */ __name(() => state.index === len - 1, "eos");
1367
+ const peek = state.peek = (n = 1) => input[state.index + n];
1368
+ const advance = state.advance = () => input[++state.index] || "";
1369
+ const remaining = /* @__PURE__ */ __name(() => input.slice(state.index + 1), "remaining");
1370
+ const consume = /* @__PURE__ */ __name((value2 = "", num = 0) => {
1371
+ state.consumed += value2;
1372
+ state.index += num;
1373
+ }, "consume");
1374
+ const append = /* @__PURE__ */ __name((token) => {
1375
+ state.output += token.output != null ? token.output : token.value;
1376
+ consume(token.value);
1377
+ }, "append");
1378
+ const negate = /* @__PURE__ */ __name(() => {
1379
+ let count = 1;
1380
+ while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
1381
+ advance();
1382
+ state.start++;
1383
+ count++;
1384
+ }
1385
+ if (count % 2 === 0) {
1386
+ return false;
1387
+ }
1388
+ state.negated = true;
1389
+ state.start++;
1390
+ return true;
1391
+ }, "negate");
1392
+ const increment = /* @__PURE__ */ __name((type) => {
1393
+ state[type]++;
1394
+ stack.push(type);
1395
+ }, "increment");
1396
+ const decrement = /* @__PURE__ */ __name((type) => {
1397
+ state[type]--;
1398
+ stack.pop();
1399
+ }, "decrement");
1400
+ const push = /* @__PURE__ */ __name((tok) => {
1401
+ if (prev.type === "globstar") {
1402
+ const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
1403
+ const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
1404
+ if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
1405
+ state.output = state.output.slice(0, -prev.output.length);
1406
+ prev.type = "star";
1407
+ prev.value = "*";
1408
+ prev.output = star;
1409
+ state.output += prev.output;
1410
+ }
1411
+ }
1412
+ if (extglobs.length && tok.type !== "paren") {
1413
+ extglobs[extglobs.length - 1].inner += tok.value;
1414
+ }
1415
+ if (tok.value || tok.output) append(tok);
1416
+ if (prev && prev.type === "text" && tok.type === "text") {
1417
+ prev.output = (prev.output || prev.value) + tok.value;
1418
+ prev.value += tok.value;
1419
+ return;
1420
+ }
1421
+ tok.prev = prev;
1422
+ tokens.push(tok);
1423
+ prev = tok;
1424
+ }, "push");
1425
+ const extglobOpen = /* @__PURE__ */ __name((type, value2) => {
1426
+ const token = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" };
1427
+ token.prev = prev;
1428
+ token.parens = state.parens;
1429
+ token.output = state.output;
1430
+ const output = (opts.capture ? "(" : "") + token.open;
1431
+ increment("parens");
1432
+ push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
1433
+ push({ type: "paren", extglob: true, value: advance(), output });
1434
+ extglobs.push(token);
1435
+ }, "extglobOpen");
1436
+ const extglobClose = /* @__PURE__ */ __name((token) => {
1437
+ let output = token.close + (opts.capture ? ")" : "");
1438
+ let rest;
1439
+ if (token.type === "negate") {
1440
+ let extglobStar = star;
1441
+ if (token.inner && token.inner.length > 1 && token.inner.includes("/")) {
1442
+ extglobStar = globstar(opts);
1443
+ }
1444
+ if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
1445
+ output = token.close = `)$))${extglobStar}`;
1446
+ }
1447
+ if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
1448
+ const expression = parse(rest, { ...options, fastpaths: false }).output;
1449
+ output = token.close = `)${expression})${extglobStar})`;
1450
+ }
1451
+ if (token.prev.type === "bos") {
1452
+ state.negatedExtglob = true;
1453
+ }
1454
+ }
1455
+ push({ type: "paren", extglob: true, value, output });
1456
+ decrement("parens");
1457
+ }, "extglobClose");
1458
+ if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
1459
+ let backslashes = false;
1460
+ let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
1461
+ if (first === "\\") {
1462
+ backslashes = true;
1463
+ return m;
1464
+ }
1465
+ if (first === "?") {
1466
+ if (esc) {
1467
+ return esc + first + (rest ? QMARK.repeat(rest.length) : "");
1468
+ }
1469
+ if (index === 0) {
1470
+ return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
1471
+ }
1472
+ return QMARK.repeat(chars.length);
1473
+ }
1474
+ if (first === ".") {
1475
+ return DOT_LITERAL.repeat(chars.length);
1476
+ }
1477
+ if (first === "*") {
1478
+ if (esc) {
1479
+ return esc + first + (rest ? star : "");
1480
+ }
1481
+ return star;
1482
+ }
1483
+ return esc ? m : `\\${m}`;
1484
+ });
1485
+ if (backslashes === true) {
1486
+ if (opts.unescape === true) {
1487
+ output = output.replace(/\\/g, "");
1488
+ } else {
1489
+ output = output.replace(/\\+/g, (m) => {
1490
+ return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
1491
+ });
1492
+ }
1493
+ }
1494
+ if (output === input && opts.contains === true) {
1495
+ state.output = input;
1496
+ return state;
1497
+ }
1498
+ state.output = utils.wrapOutput(output, state, options);
1499
+ return state;
1500
+ }
1501
+ while (!eos()) {
1502
+ value = advance();
1503
+ if (value === "\0") {
1504
+ continue;
1505
+ }
1506
+ if (value === "\\") {
1507
+ const next = peek();
1508
+ if (next === "/" && opts.bash !== true) {
1509
+ continue;
1510
+ }
1511
+ if (next === "." || next === ";") {
1512
+ continue;
1513
+ }
1514
+ if (!next) {
1515
+ value += "\\";
1516
+ push({ type: "text", value });
1517
+ continue;
1518
+ }
1519
+ const match = /^\\+/.exec(remaining());
1520
+ let slashes = 0;
1521
+ if (match && match[0].length > 2) {
1522
+ slashes = match[0].length;
1523
+ state.index += slashes;
1524
+ if (slashes % 2 !== 0) {
1525
+ value += "\\";
1526
+ }
1527
+ }
1528
+ if (opts.unescape === true) {
1529
+ value = advance();
1530
+ } else {
1531
+ value += advance();
1532
+ }
1533
+ if (state.brackets === 0) {
1534
+ push({ type: "text", value });
1535
+ continue;
1536
+ }
1537
+ }
1538
+ if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
1539
+ if (opts.posix !== false && value === ":") {
1540
+ const inner = prev.value.slice(1);
1541
+ if (inner.includes("[")) {
1542
+ prev.posix = true;
1543
+ if (inner.includes(":")) {
1544
+ const idx = prev.value.lastIndexOf("[");
1545
+ const pre = prev.value.slice(0, idx);
1546
+ const rest2 = prev.value.slice(idx + 2);
1547
+ const posix2 = POSIX_REGEX_SOURCE[rest2];
1548
+ if (posix2) {
1549
+ prev.value = pre + posix2;
1550
+ state.backtrack = true;
1551
+ advance();
1552
+ if (!bos.output && tokens.indexOf(prev) === 1) {
1553
+ bos.output = ONE_CHAR;
1554
+ }
1555
+ continue;
1556
+ }
1557
+ }
1558
+ }
1559
+ }
1560
+ if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") {
1561
+ value = `\\${value}`;
1562
+ }
1563
+ if (value === "]" && (prev.value === "[" || prev.value === "[^")) {
1564
+ value = `\\${value}`;
1565
+ }
1566
+ if (opts.posix === true && value === "!" && prev.value === "[") {
1567
+ value = "^";
1568
+ }
1569
+ prev.value += value;
1570
+ append({ value });
1571
+ continue;
1572
+ }
1573
+ if (state.quotes === 1 && value !== '"') {
1574
+ value = utils.escapeRegex(value);
1575
+ prev.value += value;
1576
+ append({ value });
1577
+ continue;
1578
+ }
1579
+ if (value === '"') {
1580
+ state.quotes = state.quotes === 1 ? 0 : 1;
1581
+ if (opts.keepQuotes === true) {
1582
+ push({ type: "text", value });
1583
+ }
1584
+ continue;
1585
+ }
1586
+ if (value === "(") {
1587
+ increment("parens");
1588
+ push({ type: "paren", value });
1589
+ continue;
1590
+ }
1591
+ if (value === ")") {
1592
+ if (state.parens === 0 && opts.strictBrackets === true) {
1593
+ throw new SyntaxError(syntaxError("opening", "("));
1594
+ }
1595
+ const extglob = extglobs[extglobs.length - 1];
1596
+ if (extglob && state.parens === extglob.parens + 1) {
1597
+ extglobClose(extglobs.pop());
1598
+ continue;
1599
+ }
1600
+ push({ type: "paren", value, output: state.parens ? ")" : "\\)" });
1601
+ decrement("parens");
1602
+ continue;
1603
+ }
1604
+ if (value === "[") {
1605
+ if (opts.nobracket === true || !remaining().includes("]")) {
1606
+ if (opts.nobracket !== true && opts.strictBrackets === true) {
1607
+ throw new SyntaxError(syntaxError("closing", "]"));
1608
+ }
1609
+ value = `\\${value}`;
1610
+ } else {
1611
+ increment("brackets");
1612
+ }
1613
+ push({ type: "bracket", value });
1614
+ continue;
1615
+ }
1616
+ if (value === "]") {
1617
+ if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
1618
+ push({ type: "text", value, output: `\\${value}` });
1619
+ continue;
1620
+ }
1621
+ if (state.brackets === 0) {
1622
+ if (opts.strictBrackets === true) {
1623
+ throw new SyntaxError(syntaxError("opening", "["));
1624
+ }
1625
+ push({ type: "text", value, output: `\\${value}` });
1626
+ continue;
1627
+ }
1628
+ decrement("brackets");
1629
+ const prevValue = prev.value.slice(1);
1630
+ if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) {
1631
+ value = `/${value}`;
1632
+ }
1633
+ prev.value += value;
1634
+ append({ value });
1635
+ if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
1636
+ continue;
1637
+ }
1638
+ const escaped = utils.escapeRegex(prev.value);
1639
+ state.output = state.output.slice(0, -prev.value.length);
1640
+ if (opts.literalBrackets === true) {
1641
+ state.output += escaped;
1642
+ prev.value = escaped;
1643
+ continue;
1644
+ }
1645
+ prev.value = `(${capture}${escaped}|${prev.value})`;
1646
+ state.output += prev.value;
1647
+ continue;
1648
+ }
1649
+ if (value === "{" && opts.nobrace !== true) {
1650
+ increment("braces");
1651
+ const open = {
1652
+ type: "brace",
1653
+ value,
1654
+ output: "(",
1655
+ outputIndex: state.output.length,
1656
+ tokensIndex: state.tokens.length
1657
+ };
1658
+ braces.push(open);
1659
+ push(open);
1660
+ continue;
1661
+ }
1662
+ if (value === "}") {
1663
+ const brace = braces[braces.length - 1];
1664
+ if (opts.nobrace === true || !brace) {
1665
+ push({ type: "text", value, output: value });
1666
+ continue;
1667
+ }
1668
+ let output = ")";
1669
+ if (brace.dots === true) {
1670
+ const arr = tokens.slice();
1671
+ const range = [];
1672
+ for (let i = arr.length - 1; i >= 0; i--) {
1673
+ tokens.pop();
1674
+ if (arr[i].type === "brace") {
1675
+ break;
1676
+ }
1677
+ if (arr[i].type !== "dots") {
1678
+ range.unshift(arr[i].value);
1679
+ }
1680
+ }
1681
+ output = expandRange(range, opts);
1682
+ state.backtrack = true;
1683
+ }
1684
+ if (brace.comma !== true && brace.dots !== true) {
1685
+ const out = state.output.slice(0, brace.outputIndex);
1686
+ const toks = state.tokens.slice(brace.tokensIndex);
1687
+ brace.value = brace.output = "\\{";
1688
+ value = output = "\\}";
1689
+ state.output = out;
1690
+ for (const t of toks) {
1691
+ state.output += t.output || t.value;
1692
+ }
1693
+ }
1694
+ push({ type: "brace", value, output });
1695
+ decrement("braces");
1696
+ braces.pop();
1697
+ continue;
1698
+ }
1699
+ if (value === "|") {
1700
+ if (extglobs.length > 0) {
1701
+ extglobs[extglobs.length - 1].conditions++;
1702
+ }
1703
+ push({ type: "text", value });
1704
+ continue;
1705
+ }
1706
+ if (value === ",") {
1707
+ let output = value;
1708
+ const brace = braces[braces.length - 1];
1709
+ if (brace && stack[stack.length - 1] === "braces") {
1710
+ brace.comma = true;
1711
+ output = "|";
1712
+ }
1713
+ push({ type: "comma", value, output });
1714
+ continue;
1715
+ }
1716
+ if (value === "/") {
1717
+ if (prev.type === "dot" && state.index === state.start + 1) {
1718
+ state.start = state.index + 1;
1719
+ state.consumed = "";
1720
+ state.output = "";
1721
+ tokens.pop();
1722
+ prev = bos;
1723
+ continue;
1724
+ }
1725
+ push({ type: "slash", value, output: SLASH_LITERAL });
1726
+ continue;
1727
+ }
1728
+ if (value === ".") {
1729
+ if (state.braces > 0 && prev.type === "dot") {
1730
+ if (prev.value === ".") prev.output = DOT_LITERAL;
1731
+ const brace = braces[braces.length - 1];
1732
+ prev.type = "dots";
1733
+ prev.output += value;
1734
+ prev.value += value;
1735
+ brace.dots = true;
1736
+ continue;
1737
+ }
1738
+ if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
1739
+ push({ type: "text", value, output: DOT_LITERAL });
1740
+ continue;
1741
+ }
1742
+ push({ type: "dot", value, output: DOT_LITERAL });
1743
+ continue;
1744
+ }
1745
+ if (value === "?") {
1746
+ const isGroup = prev && prev.value === "(";
1747
+ if (!isGroup && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
1748
+ extglobOpen("qmark", value);
1749
+ continue;
1750
+ }
1751
+ if (prev && prev.type === "paren") {
1752
+ const next = peek();
1753
+ let output = value;
1754
+ if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) {
1755
+ output = `\\${value}`;
1756
+ }
1757
+ push({ type: "text", value, output });
1758
+ continue;
1759
+ }
1760
+ if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
1761
+ push({ type: "qmark", value, output: QMARK_NO_DOT });
1762
+ continue;
1763
+ }
1764
+ push({ type: "qmark", value, output: QMARK });
1765
+ continue;
1766
+ }
1767
+ if (value === "!") {
1768
+ if (opts.noextglob !== true && peek() === "(") {
1769
+ if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
1770
+ extglobOpen("negate", value);
1771
+ continue;
1772
+ }
1773
+ }
1774
+ if (opts.nonegate !== true && state.index === 0) {
1775
+ negate();
1776
+ continue;
1777
+ }
1778
+ }
1779
+ if (value === "+") {
1780
+ if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
1781
+ extglobOpen("plus", value);
1782
+ continue;
1783
+ }
1784
+ if (prev && prev.value === "(" || opts.regex === false) {
1785
+ push({ type: "plus", value, output: PLUS_LITERAL });
1786
+ continue;
1787
+ }
1788
+ if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
1789
+ push({ type: "plus", value });
1790
+ continue;
1791
+ }
1792
+ push({ type: "plus", value: PLUS_LITERAL });
1793
+ continue;
1794
+ }
1795
+ if (value === "@") {
1796
+ if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
1797
+ push({ type: "at", extglob: true, value, output: "" });
1798
+ continue;
1799
+ }
1800
+ push({ type: "text", value });
1801
+ continue;
1802
+ }
1803
+ if (value !== "*") {
1804
+ if (value === "$" || value === "^") {
1805
+ value = `\\${value}`;
1806
+ }
1807
+ const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
1808
+ if (match) {
1809
+ value += match[0];
1810
+ state.index += match[0].length;
1811
+ }
1812
+ push({ type: "text", value });
1813
+ continue;
1814
+ }
1815
+ if (prev && (prev.type === "globstar" || prev.star === true)) {
1816
+ prev.type = "star";
1817
+ prev.star = true;
1818
+ prev.value += value;
1819
+ prev.output = star;
1820
+ state.backtrack = true;
1821
+ state.globstar = true;
1822
+ consume(value);
1823
+ continue;
1824
+ }
1825
+ let rest = remaining();
1826
+ if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
1827
+ extglobOpen("star", value);
1828
+ continue;
1829
+ }
1830
+ if (prev.type === "star") {
1831
+ if (opts.noglobstar === true) {
1832
+ consume(value);
1833
+ continue;
1834
+ }
1835
+ const prior = prev.prev;
1836
+ const before = prior.prev;
1837
+ const isStart = prior.type === "slash" || prior.type === "bos";
1838
+ const afterStar = before && (before.type === "star" || before.type === "globstar");
1839
+ if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
1840
+ push({ type: "star", value, output: "" });
1841
+ continue;
1842
+ }
1843
+ const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
1844
+ const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
1845
+ if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
1846
+ push({ type: "star", value, output: "" });
1847
+ continue;
1848
+ }
1849
+ while (rest.slice(0, 3) === "/**") {
1850
+ const after = input[state.index + 4];
1851
+ if (after && after !== "/") {
1852
+ break;
1853
+ }
1854
+ rest = rest.slice(3);
1855
+ consume("/**", 3);
1856
+ }
1857
+ if (prior.type === "bos" && eos()) {
1858
+ prev.type = "globstar";
1859
+ prev.value += value;
1860
+ prev.output = globstar(opts);
1861
+ state.output = prev.output;
1862
+ state.globstar = true;
1863
+ consume(value);
1864
+ continue;
1865
+ }
1866
+ if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
1867
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
1868
+ prior.output = `(?:${prior.output}`;
1869
+ prev.type = "globstar";
1870
+ prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
1871
+ prev.value += value;
1872
+ state.globstar = true;
1873
+ state.output += prior.output + prev.output;
1874
+ consume(value);
1875
+ continue;
1876
+ }
1877
+ if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
1878
+ const end = rest[1] !== void 0 ? "|$" : "";
1879
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
1880
+ prior.output = `(?:${prior.output}`;
1881
+ prev.type = "globstar";
1882
+ prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
1883
+ prev.value += value;
1884
+ state.output += prior.output + prev.output;
1885
+ state.globstar = true;
1886
+ consume(value + advance());
1887
+ push({ type: "slash", value: "/", output: "" });
1888
+ continue;
1889
+ }
1890
+ if (prior.type === "bos" && rest[0] === "/") {
1891
+ prev.type = "globstar";
1892
+ prev.value += value;
1893
+ prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
1894
+ state.output = prev.output;
1895
+ state.globstar = true;
1896
+ consume(value + advance());
1897
+ push({ type: "slash", value: "/", output: "" });
1898
+ continue;
1899
+ }
1900
+ state.output = state.output.slice(0, -prev.output.length);
1901
+ prev.type = "globstar";
1902
+ prev.output = globstar(opts);
1903
+ prev.value += value;
1904
+ state.output += prev.output;
1905
+ state.globstar = true;
1906
+ consume(value);
1907
+ continue;
1908
+ }
1909
+ const token = { type: "star", value, output: star };
1910
+ if (opts.bash === true) {
1911
+ token.output = ".*?";
1912
+ if (prev.type === "bos" || prev.type === "slash") {
1913
+ token.output = nodot + token.output;
1914
+ }
1915
+ push(token);
1916
+ continue;
1917
+ }
1918
+ if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
1919
+ token.output = value;
1920
+ push(token);
1921
+ continue;
1922
+ }
1923
+ if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
1924
+ if (prev.type === "dot") {
1925
+ state.output += NO_DOT_SLASH;
1926
+ prev.output += NO_DOT_SLASH;
1927
+ } else if (opts.dot === true) {
1928
+ state.output += NO_DOTS_SLASH;
1929
+ prev.output += NO_DOTS_SLASH;
1930
+ } else {
1931
+ state.output += nodot;
1932
+ prev.output += nodot;
1933
+ }
1934
+ if (peek() !== "*") {
1935
+ state.output += ONE_CHAR;
1936
+ prev.output += ONE_CHAR;
1937
+ }
1938
+ }
1939
+ push(token);
1940
+ }
1941
+ while (state.brackets > 0) {
1942
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
1943
+ state.output = utils.escapeLast(state.output, "[");
1944
+ decrement("brackets");
1945
+ }
1946
+ while (state.parens > 0) {
1947
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", ")"));
1948
+ state.output = utils.escapeLast(state.output, "(");
1949
+ decrement("parens");
1950
+ }
1951
+ while (state.braces > 0) {
1952
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "}"));
1953
+ state.output = utils.escapeLast(state.output, "{");
1954
+ decrement("braces");
1955
+ }
1956
+ if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
1957
+ push({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` });
1958
+ }
1959
+ if (state.backtrack === true) {
1960
+ state.output = "";
1961
+ for (const token of state.tokens) {
1962
+ state.output += token.output != null ? token.output : token.value;
1963
+ if (token.suffix) {
1964
+ state.output += token.suffix;
1965
+ }
1966
+ }
1967
+ }
1968
+ return state;
1969
+ }, "parse");
1970
+ parse.fastpaths = (input, options) => {
1971
+ const opts = { ...options };
1972
+ const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
1973
+ const len = input.length;
1974
+ if (len > max) {
1975
+ throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
1976
+ }
1977
+ input = REPLACEMENTS[input] || input;
1978
+ const {
1979
+ DOT_LITERAL,
1980
+ SLASH_LITERAL,
1981
+ ONE_CHAR,
1982
+ DOTS_SLASH,
1983
+ NO_DOT,
1984
+ NO_DOTS,
1985
+ NO_DOTS_SLASH,
1986
+ STAR,
1987
+ START_ANCHOR
1988
+ } = constants3.globChars(opts.windows);
1989
+ const nodot = opts.dot ? NO_DOTS : NO_DOT;
1990
+ const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
1991
+ const capture = opts.capture ? "" : "?:";
1992
+ const state = { negated: false, prefix: "" };
1993
+ let star = opts.bash === true ? ".*?" : STAR;
1994
+ if (opts.capture) {
1995
+ star = `(${star})`;
1996
+ }
1997
+ const globstar = /* @__PURE__ */ __name((opts2) => {
1998
+ if (opts2.noglobstar === true) return star;
1999
+ return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
2000
+ }, "globstar");
2001
+ const create = /* @__PURE__ */ __name((str) => {
2002
+ switch (str) {
2003
+ case "*":
2004
+ return `${nodot}${ONE_CHAR}${star}`;
2005
+ case ".*":
2006
+ return `${DOT_LITERAL}${ONE_CHAR}${star}`;
2007
+ case "*.*":
2008
+ return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
2009
+ case "*/*":
2010
+ return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
2011
+ case "**":
2012
+ return nodot + globstar(opts);
2013
+ case "**/*":
2014
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
2015
+ case "**/*.*":
2016
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
2017
+ case "**/.*":
2018
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
2019
+ default: {
2020
+ const match = /^(.*?)\.(\w+)$/.exec(str);
2021
+ if (!match) return;
2022
+ const source2 = create(match[1]);
2023
+ if (!source2) return;
2024
+ return source2 + DOT_LITERAL + match[2];
2025
+ }
2026
+ }
2027
+ }, "create");
2028
+ const output = utils.removePrefix(input, state);
2029
+ let source = create(output);
2030
+ if (source && opts.strictSlashes !== true) {
2031
+ source += `${SLASH_LITERAL}?`;
2032
+ }
2033
+ return source;
2034
+ };
2035
+ module.exports = parse;
2036
+ }
2037
+ });
2038
+
2039
+ // ../node_modules/tinyglobby/node_modules/picomatch/lib/picomatch.js
2040
+ var require_picomatch = __commonJS({
2041
+ "../node_modules/tinyglobby/node_modules/picomatch/lib/picomatch.js"(exports, module) {
2042
+ "use strict";
2043
+ var scan = require_scan();
2044
+ var parse = require_parse();
2045
+ var utils = require_utils2();
2046
+ var constants3 = require_constants();
2047
+ var isObject = /* @__PURE__ */ __name((val) => val && typeof val === "object" && !Array.isArray(val), "isObject");
2048
+ var picomatch2 = /* @__PURE__ */ __name((glob, options, returnState = false) => {
2049
+ if (Array.isArray(glob)) {
2050
+ const fns = glob.map((input) => picomatch2(input, options, returnState));
2051
+ const arrayMatcher = /* @__PURE__ */ __name((str) => {
2052
+ for (const isMatch of fns) {
2053
+ const state2 = isMatch(str);
2054
+ if (state2) return state2;
2055
+ }
2056
+ return false;
2057
+ }, "arrayMatcher");
2058
+ return arrayMatcher;
2059
+ }
2060
+ const isState = isObject(glob) && glob.tokens && glob.input;
2061
+ if (glob === "" || typeof glob !== "string" && !isState) {
2062
+ throw new TypeError("Expected pattern to be a non-empty string");
2063
+ }
2064
+ const opts = options || {};
2065
+ const posix2 = opts.windows;
2066
+ const regex = isState ? picomatch2.compileRe(glob, options) : picomatch2.makeRe(glob, options, false, true);
2067
+ const state = regex.state;
2068
+ delete regex.state;
2069
+ let isIgnored = /* @__PURE__ */ __name(() => false, "isIgnored");
2070
+ if (opts.ignore) {
2071
+ const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
2072
+ isIgnored = picomatch2(opts.ignore, ignoreOpts, returnState);
2073
+ }
2074
+ const matcher = /* @__PURE__ */ __name((input, returnObject = false) => {
2075
+ const { isMatch, match, output } = picomatch2.test(input, regex, options, { glob, posix: posix2 });
2076
+ const result = { glob, state, regex, posix: posix2, input, output, match, isMatch };
2077
+ if (typeof opts.onResult === "function") {
2078
+ opts.onResult(result);
2079
+ }
2080
+ if (isMatch === false) {
2081
+ result.isMatch = false;
2082
+ return returnObject ? result : false;
2083
+ }
2084
+ if (isIgnored(input)) {
2085
+ if (typeof opts.onIgnore === "function") {
2086
+ opts.onIgnore(result);
2087
+ }
2088
+ result.isMatch = false;
2089
+ return returnObject ? result : false;
2090
+ }
2091
+ if (typeof opts.onMatch === "function") {
2092
+ opts.onMatch(result);
2093
+ }
2094
+ return returnObject ? result : true;
2095
+ }, "matcher");
2096
+ if (returnState) {
2097
+ matcher.state = state;
2098
+ }
2099
+ return matcher;
2100
+ }, "picomatch");
2101
+ picomatch2.test = (input, regex, options, { glob, posix: posix2 } = {}) => {
2102
+ if (typeof input !== "string") {
2103
+ throw new TypeError("Expected input to be a string");
2104
+ }
2105
+ if (input === "") {
2106
+ return { isMatch: false, output: "" };
2107
+ }
2108
+ const opts = options || {};
2109
+ const format = opts.format || (posix2 ? utils.toPosixSlashes : null);
2110
+ let match = input === glob;
2111
+ let output = match && format ? format(input) : input;
2112
+ if (match === false) {
2113
+ output = format ? format(input) : input;
2114
+ match = output === glob;
2115
+ }
2116
+ if (match === false || opts.capture === true) {
2117
+ if (opts.matchBase === true || opts.basename === true) {
2118
+ match = picomatch2.matchBase(input, regex, options, posix2);
2119
+ } else {
2120
+ match = regex.exec(output);
2121
+ }
2122
+ }
2123
+ return { isMatch: Boolean(match), match, output };
2124
+ };
2125
+ picomatch2.matchBase = (input, glob, options) => {
2126
+ const regex = glob instanceof RegExp ? glob : picomatch2.makeRe(glob, options);
2127
+ return regex.test(utils.basename(input));
2128
+ };
2129
+ picomatch2.isMatch = (str, patterns, options) => picomatch2(patterns, options)(str);
2130
+ picomatch2.parse = (pattern, options) => {
2131
+ if (Array.isArray(pattern)) return pattern.map((p) => picomatch2.parse(p, options));
2132
+ return parse(pattern, { ...options, fastpaths: false });
2133
+ };
2134
+ picomatch2.scan = (input, options) => scan(input, options);
2135
+ picomatch2.compileRe = (state, options, returnOutput = false, returnState = false) => {
2136
+ if (returnOutput === true) {
2137
+ return state.output;
2138
+ }
2139
+ const opts = options || {};
2140
+ const prepend = opts.contains ? "" : "^";
2141
+ const append = opts.contains ? "" : "$";
2142
+ let source = `${prepend}(?:${state.output})${append}`;
2143
+ if (state && state.negated === true) {
2144
+ source = `^(?!${source}).*$`;
2145
+ }
2146
+ const regex = picomatch2.toRegex(source, options);
2147
+ if (returnState === true) {
2148
+ regex.state = state;
2149
+ }
2150
+ return regex;
2151
+ };
2152
+ picomatch2.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
2153
+ if (!input || typeof input !== "string") {
2154
+ throw new TypeError("Expected a non-empty string");
2155
+ }
2156
+ let parsed = { negated: false, fastpaths: true };
2157
+ if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
2158
+ parsed.output = parse.fastpaths(input, options);
2159
+ }
2160
+ if (!parsed.output) {
2161
+ parsed = parse(input, options);
2162
+ }
2163
+ return picomatch2.compileRe(parsed, options, returnOutput, returnState);
2164
+ };
2165
+ picomatch2.toRegex = (source, options) => {
2166
+ try {
2167
+ const opts = options || {};
2168
+ return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
2169
+ } catch (err) {
2170
+ if (options && options.debug === true) throw err;
2171
+ return /$^/;
2172
+ }
2173
+ };
2174
+ picomatch2.constants = constants3;
2175
+ module.exports = picomatch2;
2176
+ }
2177
+ });
2178
+
2179
+ // ../node_modules/tinyglobby/node_modules/picomatch/index.js
2180
+ var require_picomatch2 = __commonJS({
2181
+ "../node_modules/tinyglobby/node_modules/picomatch/index.js"(exports, module) {
2182
+ "use strict";
2183
+ var pico = require_picomatch();
2184
+ var utils = require_utils2();
2185
+ function picomatch2(glob, options, returnState = false) {
2186
+ if (options && (options.windows === null || options.windows === void 0)) {
2187
+ options = { ...options, windows: utils.isWindows() };
2188
+ }
2189
+ return pico(glob, options, returnState);
2190
+ }
2191
+ __name(picomatch2, "picomatch");
2192
+ Object.assign(picomatch2, pico);
2193
+ module.exports = picomatch2;
2194
+ }
2195
+ });
2196
+
2197
+ // ../node_modules/tinyglobby/node_modules/fdir/dist/builder/index.js
2198
+ var require_builder = __commonJS({
2199
+ "../node_modules/tinyglobby/node_modules/fdir/dist/builder/index.js"(exports) {
2200
+ "use strict";
2201
+ Object.defineProperty(exports, "__esModule", { value: true });
2202
+ exports.Builder = void 0;
2203
+ var path_1 = __require("path");
2204
+ var api_builder_1 = require_api_builder();
2205
+ var pm = null;
2206
+ try {
2207
+ __require.resolve("picomatch");
2208
+ pm = require_picomatch2();
2209
+ } catch (_e) {
2210
+ }
2211
+ var Builder = class {
2212
+ static {
2213
+ __name(this, "Builder");
2214
+ }
2215
+ globCache = {};
2216
+ options = {
2217
+ maxDepth: Infinity,
2218
+ suppressErrors: true,
2219
+ pathSeparator: path_1.sep,
2220
+ filters: []
2221
+ };
2222
+ globFunction;
2223
+ constructor(options) {
2224
+ this.options = { ...this.options, ...options };
2225
+ this.globFunction = this.options.globFunction;
2226
+ }
2227
+ group() {
2228
+ this.options.group = true;
2229
+ return this;
2230
+ }
2231
+ withPathSeparator(separator) {
2232
+ this.options.pathSeparator = separator;
2233
+ return this;
2234
+ }
2235
+ withBasePath() {
2236
+ this.options.includeBasePath = true;
2237
+ return this;
2238
+ }
2239
+ withRelativePaths() {
2240
+ this.options.relativePaths = true;
2241
+ return this;
2242
+ }
2243
+ withDirs() {
2244
+ this.options.includeDirs = true;
2245
+ return this;
2246
+ }
2247
+ withMaxDepth(depth) {
2248
+ this.options.maxDepth = depth;
2249
+ return this;
2250
+ }
2251
+ withMaxFiles(limit) {
2252
+ this.options.maxFiles = limit;
2253
+ return this;
2254
+ }
2255
+ withFullPaths() {
2256
+ this.options.resolvePaths = true;
2257
+ this.options.includeBasePath = true;
2258
+ return this;
2259
+ }
2260
+ withErrors() {
2261
+ this.options.suppressErrors = false;
2262
+ return this;
2263
+ }
2264
+ withSymlinks({ resolvePaths = true } = {}) {
2265
+ this.options.resolveSymlinks = true;
2266
+ this.options.useRealPaths = resolvePaths;
2267
+ return this.withFullPaths();
2268
+ }
2269
+ withAbortSignal(signal) {
2270
+ this.options.signal = signal;
2271
+ return this;
2272
+ }
2273
+ normalize() {
2274
+ this.options.normalizePath = true;
2275
+ return this;
2276
+ }
2277
+ filter(predicate) {
2278
+ this.options.filters.push(predicate);
2279
+ return this;
2280
+ }
2281
+ onlyDirs() {
2282
+ this.options.excludeFiles = true;
2283
+ this.options.includeDirs = true;
2284
+ return this;
2285
+ }
2286
+ exclude(predicate) {
2287
+ this.options.exclude = predicate;
2288
+ return this;
2289
+ }
2290
+ onlyCounts() {
2291
+ this.options.onlyCounts = true;
2292
+ return this;
2293
+ }
2294
+ crawl(root) {
2295
+ return new api_builder_1.APIBuilder(root || ".", this.options);
2296
+ }
2297
+ withGlobFunction(fn) {
2298
+ this.globFunction = fn;
2299
+ return this;
2300
+ }
2301
+ /**
2302
+ * @deprecated Pass options using the constructor instead:
2303
+ * ```ts
2304
+ * new fdir(options).crawl("/path/to/root");
2305
+ * ```
2306
+ * This method will be removed in v7.0
2307
+ */
2308
+ /* c8 ignore next 4 */
2309
+ crawlWithOptions(root, options) {
2310
+ this.options = { ...this.options, ...options };
2311
+ return new api_builder_1.APIBuilder(root || ".", this.options);
2312
+ }
2313
+ glob(...patterns) {
2314
+ if (this.globFunction) {
2315
+ return this.globWithOptions(patterns);
2316
+ }
2317
+ return this.globWithOptions(patterns, ...[{ dot: true }]);
2318
+ }
2319
+ globWithOptions(patterns, ...options) {
2320
+ const globFn = this.globFunction || pm;
2321
+ if (!globFn) {
2322
+ throw new Error("Please specify a glob function to use glob matching.");
2323
+ }
2324
+ var isMatch = this.globCache[patterns.join("\0")];
2325
+ if (!isMatch) {
2326
+ isMatch = globFn(patterns, ...options);
2327
+ this.globCache[patterns.join("\0")] = isMatch;
2328
+ }
2329
+ this.options.filters.push((path4) => isMatch(path4));
2330
+ return this;
2331
+ }
2332
+ };
2333
+ exports.Builder = Builder;
2334
+ }
2335
+ });
2336
+
2337
+ // ../node_modules/tinyglobby/node_modules/fdir/dist/types.js
2338
+ var require_types = __commonJS({
2339
+ "../node_modules/tinyglobby/node_modules/fdir/dist/types.js"(exports) {
2340
+ "use strict";
2341
+ Object.defineProperty(exports, "__esModule", { value: true });
2342
+ }
2343
+ });
2344
+
2345
+ // ../node_modules/tinyglobby/node_modules/fdir/dist/index.js
2346
+ var require_dist = __commonJS({
2347
+ "../node_modules/tinyglobby/node_modules/fdir/dist/index.js"(exports) {
2348
+ "use strict";
2349
+ var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
2350
+ if (k2 === void 0) k2 = k;
2351
+ var desc = Object.getOwnPropertyDescriptor(m, k);
2352
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
2353
+ desc = { enumerable: true, get: /* @__PURE__ */ __name(function() {
2354
+ return m[k];
2355
+ }, "get") };
2356
+ }
2357
+ Object.defineProperty(o, k2, desc);
2358
+ } : function(o, m, k, k2) {
2359
+ if (k2 === void 0) k2 = k;
2360
+ o[k2] = m[k];
2361
+ });
2362
+ var __exportStar = exports && exports.__exportStar || function(m, exports2) {
2363
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) __createBinding(exports2, m, p);
2364
+ };
2365
+ Object.defineProperty(exports, "__esModule", { value: true });
2366
+ exports.fdir = void 0;
2367
+ var builder_1 = require_builder();
2368
+ Object.defineProperty(exports, "fdir", { enumerable: true, get: /* @__PURE__ */ __name(function() {
2369
+ return builder_1.Builder;
2370
+ }, "get") });
2371
+ __exportStar(require_types(), exports);
2372
+ }
2373
+ });
2374
+
2375
+ // ../node_modules/isexe/windows.js
2376
+ var require_windows = __commonJS({
2377
+ "../node_modules/isexe/windows.js"(exports, module) {
2378
+ module.exports = isexe;
2379
+ isexe.sync = sync;
2380
+ var fs = __require("fs");
2381
+ function checkPathExt(path4, options) {
2382
+ var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
2383
+ if (!pathext) {
2384
+ return true;
2385
+ }
2386
+ pathext = pathext.split(";");
2387
+ if (pathext.indexOf("") !== -1) {
2388
+ return true;
2389
+ }
2390
+ for (var i = 0; i < pathext.length; i++) {
2391
+ var p = pathext[i].toLowerCase();
2392
+ if (p && path4.substr(-p.length).toLowerCase() === p) {
2393
+ return true;
2394
+ }
2395
+ }
2396
+ return false;
2397
+ }
2398
+ __name(checkPathExt, "checkPathExt");
2399
+ function checkStat(stat, path4, options) {
2400
+ if (!stat.isSymbolicLink() && !stat.isFile()) {
2401
+ return false;
2402
+ }
2403
+ return checkPathExt(path4, options);
2404
+ }
2405
+ __name(checkStat, "checkStat");
2406
+ function isexe(path4, options, cb) {
2407
+ fs.stat(path4, function(er, stat) {
2408
+ cb(er, er ? false : checkStat(stat, path4, options));
2409
+ });
2410
+ }
2411
+ __name(isexe, "isexe");
2412
+ function sync(path4, options) {
2413
+ return checkStat(fs.statSync(path4), path4, options);
2414
+ }
2415
+ __name(sync, "sync");
2416
+ }
2417
+ });
2418
+
2419
+ // ../node_modules/isexe/mode.js
2420
+ var require_mode = __commonJS({
2421
+ "../node_modules/isexe/mode.js"(exports, module) {
2422
+ module.exports = isexe;
2423
+ isexe.sync = sync;
2424
+ var fs = __require("fs");
2425
+ function isexe(path4, options, cb) {
2426
+ fs.stat(path4, function(er, stat) {
2427
+ cb(er, er ? false : checkStat(stat, options));
2428
+ });
2429
+ }
2430
+ __name(isexe, "isexe");
2431
+ function sync(path4, options) {
2432
+ return checkStat(fs.statSync(path4), options);
2433
+ }
2434
+ __name(sync, "sync");
2435
+ function checkStat(stat, options) {
2436
+ return stat.isFile() && checkMode(stat, options);
2437
+ }
2438
+ __name(checkStat, "checkStat");
2439
+ function checkMode(stat, options) {
2440
+ var mod = stat.mode;
2441
+ var uid = stat.uid;
2442
+ var gid = stat.gid;
2443
+ var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
2444
+ var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
2445
+ var u = parseInt("100", 8);
2446
+ var g = parseInt("010", 8);
2447
+ var o = parseInt("001", 8);
2448
+ var ug = u | g;
2449
+ var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
2450
+ return ret;
2451
+ }
2452
+ __name(checkMode, "checkMode");
2453
+ }
2454
+ });
2455
+
2456
+ // ../node_modules/isexe/index.js
2457
+ var require_isexe = __commonJS({
2458
+ "../node_modules/isexe/index.js"(exports, module) {
2459
+ var fs = __require("fs");
2460
+ var core;
2461
+ if (process.platform === "win32" || global.TESTING_WINDOWS) {
2462
+ core = require_windows();
2463
+ } else {
2464
+ core = require_mode();
2465
+ }
2466
+ module.exports = isexe;
2467
+ isexe.sync = sync;
2468
+ function isexe(path4, options, cb) {
2469
+ if (typeof options === "function") {
2470
+ cb = options;
2471
+ options = {};
2472
+ }
2473
+ if (!cb) {
2474
+ if (typeof Promise !== "function") {
2475
+ throw new TypeError("callback not provided");
2476
+ }
2477
+ return new Promise(function(resolve2, reject) {
2478
+ isexe(path4, options || {}, function(er, is) {
2479
+ if (er) {
2480
+ reject(er);
2481
+ } else {
2482
+ resolve2(is);
2483
+ }
2484
+ });
2485
+ });
2486
+ }
2487
+ core(path4, options || {}, function(er, is) {
2488
+ if (er) {
2489
+ if (er.code === "EACCES" || options && options.ignoreErrors) {
2490
+ er = null;
2491
+ is = false;
2492
+ }
2493
+ }
2494
+ cb(er, is);
2495
+ });
2496
+ }
2497
+ __name(isexe, "isexe");
2498
+ function sync(path4, options) {
2499
+ try {
2500
+ return core.sync(path4, options || {});
2501
+ } catch (er) {
2502
+ if (options && options.ignoreErrors || er.code === "EACCES") {
2503
+ return false;
2504
+ } else {
2505
+ throw er;
2506
+ }
2507
+ }
2508
+ }
2509
+ __name(sync, "sync");
2510
+ }
2511
+ });
2512
+
2513
+ // ../node_modules/which/which.js
2514
+ var require_which = __commonJS({
2515
+ "../node_modules/which/which.js"(exports, module) {
2516
+ var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
2517
+ var path4 = __require("path");
2518
+ var COLON = isWindows ? ";" : ":";
2519
+ var isexe = require_isexe();
2520
+ var getNotFoundError = /* @__PURE__ */ __name((cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" }), "getNotFoundError");
2521
+ var getPathInfo = /* @__PURE__ */ __name((cmd, opt) => {
2522
+ const colon = opt.colon || COLON;
2523
+ const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
2524
+ // windows always checks the cwd first
2525
+ ...isWindows ? [process.cwd()] : [],
2526
+ ...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
2527
+ "").split(colon)
2528
+ ];
2529
+ const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
2530
+ const pathExt = isWindows ? pathExtExe.split(colon) : [""];
2531
+ if (isWindows) {
2532
+ if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
2533
+ pathExt.unshift("");
2534
+ }
2535
+ return {
2536
+ pathEnv,
2537
+ pathExt,
2538
+ pathExtExe
2539
+ };
2540
+ }, "getPathInfo");
2541
+ var which = /* @__PURE__ */ __name((cmd, opt, cb) => {
2542
+ if (typeof opt === "function") {
2543
+ cb = opt;
2544
+ opt = {};
2545
+ }
2546
+ if (!opt)
2547
+ opt = {};
2548
+ const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
2549
+ const found = [];
2550
+ const step = /* @__PURE__ */ __name((i) => new Promise((resolve2, reject) => {
2551
+ if (i === pathEnv.length)
2552
+ return opt.all && found.length ? resolve2(found) : reject(getNotFoundError(cmd));
2553
+ const ppRaw = pathEnv[i];
2554
+ const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
2555
+ const pCmd = path4.join(pathPart, cmd);
2556
+ const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
2557
+ resolve2(subStep(p, i, 0));
2558
+ }), "step");
2559
+ const subStep = /* @__PURE__ */ __name((p, i, ii) => new Promise((resolve2, reject) => {
2560
+ if (ii === pathExt.length)
2561
+ return resolve2(step(i + 1));
2562
+ const ext = pathExt[ii];
2563
+ isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
2564
+ if (!er && is) {
2565
+ if (opt.all)
2566
+ found.push(p + ext);
2567
+ else
2568
+ return resolve2(p + ext);
2569
+ }
2570
+ return resolve2(subStep(p, i, ii + 1));
2571
+ });
2572
+ }), "subStep");
2573
+ return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
2574
+ }, "which");
2575
+ var whichSync = /* @__PURE__ */ __name((cmd, opt) => {
2576
+ opt = opt || {};
2577
+ const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
2578
+ const found = [];
2579
+ for (let i = 0; i < pathEnv.length; i++) {
2580
+ const ppRaw = pathEnv[i];
2581
+ const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
2582
+ const pCmd = path4.join(pathPart, cmd);
2583
+ const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
2584
+ for (let j = 0; j < pathExt.length; j++) {
2585
+ const cur = p + pathExt[j];
2586
+ try {
2587
+ const is = isexe.sync(cur, { pathExt: pathExtExe });
2588
+ if (is) {
2589
+ if (opt.all)
2590
+ found.push(cur);
2591
+ else
2592
+ return cur;
2593
+ }
2594
+ } catch (ex) {
2595
+ }
2596
+ }
2597
+ }
2598
+ if (opt.all && found.length)
2599
+ return found;
2600
+ if (opt.nothrow)
2601
+ return null;
2602
+ throw getNotFoundError(cmd);
2603
+ }, "whichSync");
2604
+ module.exports = which;
2605
+ which.sync = whichSync;
2606
+ }
2607
+ });
2608
+
2609
+ // ../node_modules/path-key/index.js
2610
+ var require_path_key = __commonJS({
2611
+ "../node_modules/path-key/index.js"(exports, module) {
2612
+ "use strict";
2613
+ var pathKey2 = /* @__PURE__ */ __name((options = {}) => {
2614
+ const environment = options.env || process.env;
2615
+ const platform = options.platform || process.platform;
2616
+ if (platform !== "win32") {
2617
+ return "PATH";
2618
+ }
2619
+ return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
2620
+ }, "pathKey");
2621
+ module.exports = pathKey2;
2622
+ module.exports.default = pathKey2;
2623
+ }
2624
+ });
2625
+
2626
+ // ../node_modules/cross-spawn/lib/util/resolveCommand.js
2627
+ var require_resolveCommand = __commonJS({
2628
+ "../node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
2629
+ "use strict";
2630
+ var path4 = __require("path");
2631
+ var which = require_which();
2632
+ var getPathKey = require_path_key();
2633
+ function resolveCommandAttempt(parsed, withoutPathExt) {
2634
+ const env = parsed.options.env || process.env;
2635
+ const cwd = process.cwd();
2636
+ const hasCustomCwd = parsed.options.cwd != null;
2637
+ const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
2638
+ if (shouldSwitchCwd) {
2639
+ try {
2640
+ process.chdir(parsed.options.cwd);
2641
+ } catch (err) {
2642
+ }
2643
+ }
2644
+ let resolved;
2645
+ try {
2646
+ resolved = which.sync(parsed.command, {
2647
+ path: env[getPathKey({ env })],
2648
+ pathExt: withoutPathExt ? path4.delimiter : void 0
2649
+ });
2650
+ } catch (e) {
2651
+ } finally {
2652
+ if (shouldSwitchCwd) {
2653
+ process.chdir(cwd);
2654
+ }
2655
+ }
2656
+ if (resolved) {
2657
+ resolved = path4.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
2658
+ }
2659
+ return resolved;
2660
+ }
2661
+ __name(resolveCommandAttempt, "resolveCommandAttempt");
2662
+ function resolveCommand(parsed) {
2663
+ return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
2664
+ }
2665
+ __name(resolveCommand, "resolveCommand");
2666
+ module.exports = resolveCommand;
2667
+ }
2668
+ });
2669
+
2670
+ // ../node_modules/cross-spawn/lib/util/escape.js
2671
+ var require_escape = __commonJS({
2672
+ "../node_modules/cross-spawn/lib/util/escape.js"(exports, module) {
2673
+ "use strict";
2674
+ var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
2675
+ function escapeCommand(arg) {
2676
+ arg = arg.replace(metaCharsRegExp, "^$1");
2677
+ return arg;
2678
+ }
2679
+ __name(escapeCommand, "escapeCommand");
2680
+ function escapeArgument(arg, doubleEscapeMetaChars) {
2681
+ arg = `${arg}`;
2682
+ arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
2683
+ arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
2684
+ arg = `"${arg}"`;
2685
+ arg = arg.replace(metaCharsRegExp, "^$1");
2686
+ if (doubleEscapeMetaChars) {
2687
+ arg = arg.replace(metaCharsRegExp, "^$1");
2688
+ }
2689
+ return arg;
2690
+ }
2691
+ __name(escapeArgument, "escapeArgument");
2692
+ module.exports.command = escapeCommand;
2693
+ module.exports.argument = escapeArgument;
2694
+ }
2695
+ });
2696
+
2697
+ // ../node_modules/shebang-regex/index.js
2698
+ var require_shebang_regex = __commonJS({
2699
+ "../node_modules/shebang-regex/index.js"(exports, module) {
2700
+ "use strict";
2701
+ module.exports = /^#!(.*)/;
2702
+ }
2703
+ });
2704
+
2705
+ // ../node_modules/shebang-command/index.js
2706
+ var require_shebang_command = __commonJS({
2707
+ "../node_modules/shebang-command/index.js"(exports, module) {
2708
+ "use strict";
2709
+ var shebangRegex = require_shebang_regex();
2710
+ module.exports = (string = "") => {
2711
+ const match = string.match(shebangRegex);
2712
+ if (!match) {
2713
+ return null;
2714
+ }
2715
+ const [path4, argument] = match[0].replace(/#! ?/, "").split(" ");
2716
+ const binary = path4.split("/").pop();
2717
+ if (binary === "env") {
2718
+ return argument;
2719
+ }
2720
+ return argument ? `${binary} ${argument}` : binary;
2721
+ };
2722
+ }
2723
+ });
2724
+
2725
+ // ../node_modules/cross-spawn/lib/util/readShebang.js
2726
+ var require_readShebang = __commonJS({
2727
+ "../node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
2728
+ "use strict";
2729
+ var fs = __require("fs");
2730
+ var shebangCommand = require_shebang_command();
2731
+ function readShebang(command) {
2732
+ const size = 150;
2733
+ const buffer = Buffer.alloc(size);
2734
+ let fd;
2735
+ try {
2736
+ fd = fs.openSync(command, "r");
2737
+ fs.readSync(fd, buffer, 0, size, 0);
2738
+ fs.closeSync(fd);
2739
+ } catch (e) {
2740
+ }
2741
+ return shebangCommand(buffer.toString());
2742
+ }
2743
+ __name(readShebang, "readShebang");
2744
+ module.exports = readShebang;
2745
+ }
2746
+ });
2747
+
2748
+ // ../node_modules/cross-spawn/lib/parse.js
2749
+ var require_parse2 = __commonJS({
2750
+ "../node_modules/cross-spawn/lib/parse.js"(exports, module) {
2751
+ "use strict";
2752
+ var path4 = __require("path");
2753
+ var resolveCommand = require_resolveCommand();
2754
+ var escape = require_escape();
2755
+ var readShebang = require_readShebang();
2756
+ var isWin2 = process.platform === "win32";
2757
+ var isExecutableRegExp = /\.(?:com|exe)$/i;
2758
+ var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
2759
+ function detectShebang(parsed) {
2760
+ parsed.file = resolveCommand(parsed);
2761
+ const shebang = parsed.file && readShebang(parsed.file);
2762
+ if (shebang) {
2763
+ parsed.args.unshift(parsed.file);
2764
+ parsed.command = shebang;
2765
+ return resolveCommand(parsed);
2766
+ }
2767
+ return parsed.file;
2768
+ }
2769
+ __name(detectShebang, "detectShebang");
2770
+ function parseNonShell(parsed) {
2771
+ if (!isWin2) {
2772
+ return parsed;
2773
+ }
2774
+ const commandFile = detectShebang(parsed);
2775
+ const needsShell = !isExecutableRegExp.test(commandFile);
2776
+ if (parsed.options.forceShell || needsShell) {
2777
+ const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
2778
+ parsed.command = path4.normalize(parsed.command);
2779
+ parsed.command = escape.command(parsed.command);
2780
+ parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
2781
+ const shellCommand = [parsed.command].concat(parsed.args).join(" ");
2782
+ parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
2783
+ parsed.command = process.env.comspec || "cmd.exe";
2784
+ parsed.options.windowsVerbatimArguments = true;
2785
+ }
2786
+ return parsed;
2787
+ }
2788
+ __name(parseNonShell, "parseNonShell");
2789
+ function parse(command, args, options) {
2790
+ if (args && !Array.isArray(args)) {
2791
+ options = args;
2792
+ args = null;
2793
+ }
2794
+ args = args ? args.slice(0) : [];
2795
+ options = Object.assign({}, options);
2796
+ const parsed = {
2797
+ command,
2798
+ args,
2799
+ options,
2800
+ file: void 0,
2801
+ original: {
2802
+ command,
2803
+ args
2804
+ }
2805
+ };
2806
+ return options.shell ? parsed : parseNonShell(parsed);
2807
+ }
2808
+ __name(parse, "parse");
2809
+ module.exports = parse;
2810
+ }
2811
+ });
2812
+
2813
+ // ../node_modules/cross-spawn/lib/enoent.js
2814
+ var require_enoent = __commonJS({
2815
+ "../node_modules/cross-spawn/lib/enoent.js"(exports, module) {
2816
+ "use strict";
2817
+ var isWin2 = process.platform === "win32";
2818
+ function notFoundError(original, syscall) {
2819
+ return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
2820
+ code: "ENOENT",
2821
+ errno: "ENOENT",
2822
+ syscall: `${syscall} ${original.command}`,
2823
+ path: original.command,
2824
+ spawnargs: original.args
2825
+ });
2826
+ }
2827
+ __name(notFoundError, "notFoundError");
2828
+ function hookChildProcess(cp, parsed) {
2829
+ if (!isWin2) {
2830
+ return;
2831
+ }
2832
+ const originalEmit = cp.emit;
2833
+ cp.emit = function(name, arg1) {
2834
+ if (name === "exit") {
2835
+ const err = verifyENOENT(arg1, parsed);
2836
+ if (err) {
2837
+ return originalEmit.call(cp, "error", err);
2838
+ }
2839
+ }
2840
+ return originalEmit.apply(cp, arguments);
2841
+ };
2842
+ }
2843
+ __name(hookChildProcess, "hookChildProcess");
2844
+ function verifyENOENT(status, parsed) {
2845
+ if (isWin2 && status === 1 && !parsed.file) {
2846
+ return notFoundError(parsed.original, "spawn");
2847
+ }
2848
+ return null;
2849
+ }
2850
+ __name(verifyENOENT, "verifyENOENT");
2851
+ function verifyENOENTSync(status, parsed) {
2852
+ if (isWin2 && status === 1 && !parsed.file) {
2853
+ return notFoundError(parsed.original, "spawnSync");
2854
+ }
2855
+ return null;
2856
+ }
2857
+ __name(verifyENOENTSync, "verifyENOENTSync");
2858
+ module.exports = {
2859
+ hookChildProcess,
2860
+ verifyENOENT,
2861
+ verifyENOENTSync,
2862
+ notFoundError
2863
+ };
2864
+ }
2865
+ });
2866
+
2867
+ // ../node_modules/cross-spawn/index.js
2868
+ var require_cross_spawn = __commonJS({
2869
+ "../node_modules/cross-spawn/index.js"(exports, module) {
2870
+ "use strict";
2871
+ var cp = __require("child_process");
2872
+ var parse = require_parse2();
2873
+ var enoent = require_enoent();
2874
+ function spawn(command, args, options) {
2875
+ const parsed = parse(command, args, options);
2876
+ const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
2877
+ enoent.hookChildProcess(spawned, parsed);
2878
+ return spawned;
2879
+ }
2880
+ __name(spawn, "spawn");
2881
+ function spawnSync(command, args, options) {
2882
+ const parsed = parse(command, args, options);
2883
+ const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
2884
+ result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
2885
+ return result;
2886
+ }
2887
+ __name(spawnSync, "spawnSync");
2888
+ module.exports = spawn;
2889
+ module.exports.spawn = spawn;
2890
+ module.exports.sync = spawnSync;
2891
+ module.exports._parse = parse;
2892
+ module.exports._enoent = enoent;
2893
+ }
2894
+ });
2895
+
2896
+ // ../node_modules/merge-stream/index.js
2897
+ var require_merge_stream = __commonJS({
2898
+ "../node_modules/merge-stream/index.js"(exports, module) {
2899
+ "use strict";
2900
+ var { PassThrough } = __require("stream");
2901
+ module.exports = function() {
2902
+ var sources = [];
2903
+ var output = new PassThrough({ objectMode: true });
2904
+ output.setMaxListeners(0);
2905
+ output.add = add;
2906
+ output.isEmpty = isEmpty;
2907
+ output.on("unpipe", remove);
2908
+ Array.prototype.slice.call(arguments).forEach(add);
2909
+ return output;
2910
+ function add(source) {
2911
+ if (Array.isArray(source)) {
2912
+ source.forEach(add);
2913
+ return this;
2914
+ }
2915
+ sources.push(source);
2916
+ source.once("end", remove.bind(null, source));
2917
+ source.once("error", output.emit.bind(output, "error"));
2918
+ source.pipe(output, { end: false });
2919
+ return this;
2920
+ }
2921
+ __name(add, "add");
2922
+ function isEmpty() {
2923
+ return sources.length == 0;
2924
+ }
2925
+ __name(isEmpty, "isEmpty");
2926
+ function remove(source) {
2927
+ sources = sources.filter(function(it) {
2928
+ return it !== source;
2929
+ });
2930
+ if (!sources.length && output.readable) {
2931
+ output.end();
2932
+ }
2933
+ }
2934
+ __name(remove, "remove");
2935
+ };
2936
+ }
2937
+ });
2938
+
2939
+ // src/common/utils/paths.ts
2940
+ import { join, relative, resolve, sep } from "node:path";
2941
+
2942
+ // ../node_modules/tinyglobby/dist/index.mjs
2943
+ var import_fdir = __toESM(require_dist(), 1);
2944
+ var import_picomatch = __toESM(require_picomatch2(), 1);
2945
+ import path, { posix } from "path";
2946
+ var ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
2947
+ function getPartialMatcher(patterns, options) {
2948
+ const patternsCount = patterns.length;
2949
+ const patternsParts = Array(patternsCount);
2950
+ const regexes = Array(patternsCount);
2951
+ for (let i = 0; i < patternsCount; i++) {
2952
+ const parts = splitPattern(patterns[i]);
2953
+ patternsParts[i] = parts;
2954
+ const partsCount = parts.length;
2955
+ const partRegexes = Array(partsCount);
2956
+ for (let j = 0; j < partsCount; j++) partRegexes[j] = import_picomatch.default.makeRe(parts[j], options);
2957
+ regexes[i] = partRegexes;
2958
+ }
2959
+ return (input) => {
2960
+ const inputParts = input.split("/");
2961
+ if (inputParts[0] === ".." && ONLY_PARENT_DIRECTORIES.test(input)) return true;
2962
+ for (let i = 0; i < patterns.length; i++) {
2963
+ const patternParts = patternsParts[i];
2964
+ const regex = regexes[i];
2965
+ const inputPatternCount = inputParts.length;
2966
+ const minParts = Math.min(inputPatternCount, patternParts.length);
2967
+ let j = 0;
2968
+ while (j < minParts) {
2969
+ const part = patternParts[j];
2970
+ if (part.includes("/")) return true;
2971
+ const match = regex[j].test(inputParts[j]);
2972
+ if (!match) break;
2973
+ if (part === "**") return true;
2974
+ j++;
2975
+ }
2976
+ if (j === inputPatternCount) return true;
2977
+ }
2978
+ return false;
2979
+ };
2980
+ }
2981
+ __name(getPartialMatcher, "getPartialMatcher");
2982
+ var splitPatternOptions = { parts: true };
2983
+ function splitPattern(path$1) {
2984
+ var _result$parts;
2985
+ const result = import_picomatch.default.scan(path$1, splitPatternOptions);
2986
+ return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path$1];
2987
+ }
2988
+ __name(splitPattern, "splitPattern");
2989
+ var isWin = process.platform === "win32";
2990
+ var POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g;
2991
+ var WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g;
2992
+ var escapePosixPath = /* @__PURE__ */ __name((path$1) => path$1.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&"), "escapePosixPath");
2993
+ var escapeWin32Path = /* @__PURE__ */ __name((path$1) => path$1.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&"), "escapeWin32Path");
2994
+ var escapePath = isWin ? escapeWin32Path : escapePosixPath;
2995
+ function isDynamicPattern(pattern, options) {
2996
+ if ((options === null || options === void 0 ? void 0 : options.caseSensitiveMatch) === false) return true;
2997
+ const scan = import_picomatch.default.scan(pattern);
2998
+ return scan.isGlob || scan.negated;
2999
+ }
3000
+ __name(isDynamicPattern, "isDynamicPattern");
3001
+ function log(...tasks) {
3002
+ console.log(`[tinyglobby ${(/* @__PURE__ */ new Date()).toLocaleTimeString("es")}]`, ...tasks);
3003
+ }
3004
+ __name(log, "log");
3005
+ var PARENT_DIRECTORY = /^(\/?\.\.)+/;
3006
+ var ESCAPING_BACKSLASHES = /\\(?=[()[\]{}!*+?@|])/g;
3007
+ var BACKSLASHES = /\\/g;
3008
+ function normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {
3009
+ let result = pattern;
3010
+ if (pattern.endsWith("/")) result = pattern.slice(0, -1);
3011
+ if (!result.endsWith("*") && expandDirectories) result += "/**";
3012
+ const escapedCwd = escapePath(cwd);
3013
+ if (path.isAbsolute(result.replace(ESCAPING_BACKSLASHES, ""))) result = posix.relative(escapedCwd, result);
3014
+ else result = posix.normalize(result);
3015
+ const parentDirectoryMatch = PARENT_DIRECTORY.exec(result);
3016
+ const parts = splitPattern(result);
3017
+ if (parentDirectoryMatch === null || parentDirectoryMatch === void 0 ? void 0 : parentDirectoryMatch[0]) {
3018
+ const n = (parentDirectoryMatch[0].length + 1) / 3;
3019
+ let i = 0;
3020
+ const cwdParts = escapedCwd.split("/");
3021
+ while (i < n && parts[i + n] === cwdParts[cwdParts.length + i - n]) {
3022
+ result = result.slice(0, (n - i - 1) * 3) + result.slice((n - i) * 3 + parts[i + n].length + 1) || ".";
3023
+ i++;
3024
+ }
3025
+ const potentialRoot = posix.join(cwd, parentDirectoryMatch[0].slice(i * 3));
3026
+ if (!potentialRoot.startsWith(".") && props.root.length > potentialRoot.length) {
3027
+ props.root = potentialRoot;
3028
+ props.depthOffset = -n + i;
3029
+ }
3030
+ }
3031
+ if (!isIgnore && props.depthOffset >= 0) {
3032
+ var _props$commonPath;
3033
+ (_props$commonPath = props.commonPath) !== null && _props$commonPath !== void 0 || (props.commonPath = parts);
3034
+ const newCommonPath = [];
3035
+ const length = Math.min(props.commonPath.length, parts.length);
3036
+ for (let i = 0; i < length; i++) {
3037
+ const part = parts[i];
3038
+ if (part === "**" && !parts[i + 1]) {
3039
+ newCommonPath.pop();
3040
+ break;
3041
+ }
3042
+ if (part !== props.commonPath[i] || isDynamicPattern(part) || i === parts.length - 1) break;
3043
+ newCommonPath.push(part);
3044
+ }
3045
+ props.depthOffset = newCommonPath.length;
3046
+ props.commonPath = newCommonPath;
3047
+ props.root = newCommonPath.length > 0 ? path.posix.join(cwd, ...newCommonPath) : cwd;
3048
+ }
3049
+ return result;
3050
+ }
3051
+ __name(normalizePattern, "normalizePattern");
3052
+ function processPatterns({ patterns, ignore = [], expandDirectories = true }, cwd, props) {
3053
+ if (typeof patterns === "string") patterns = [patterns];
3054
+ else if (!patterns) patterns = ["**/*"];
3055
+ if (typeof ignore === "string") ignore = [ignore];
3056
+ const matchPatterns = [];
3057
+ const ignorePatterns = [];
3058
+ for (const pattern of ignore) {
3059
+ if (!pattern) continue;
3060
+ if (pattern[0] !== "!" || pattern[1] === "(") ignorePatterns.push(normalizePattern(pattern, expandDirectories, cwd, props, true));
3061
+ }
3062
+ for (const pattern of patterns) {
3063
+ if (!pattern) continue;
3064
+ if (pattern[0] !== "!" || pattern[1] === "(") matchPatterns.push(normalizePattern(pattern, expandDirectories, cwd, props, false));
3065
+ else if (pattern[1] !== "!" || pattern[2] === "(") ignorePatterns.push(normalizePattern(pattern.slice(1), expandDirectories, cwd, props, true));
3066
+ }
3067
+ return {
3068
+ match: matchPatterns,
3069
+ ignore: ignorePatterns
3070
+ };
3071
+ }
3072
+ __name(processPatterns, "processPatterns");
3073
+ function getRelativePath(path$1, cwd, root) {
3074
+ return posix.relative(cwd, `${root}/${path$1}`) || ".";
3075
+ }
3076
+ __name(getRelativePath, "getRelativePath");
3077
+ function processPath(path$1, cwd, root, isDirectory, absolute) {
3078
+ const relativePath = absolute ? path$1.slice(root === "/" ? 1 : root.length + 1) || "." : path$1;
3079
+ if (root === cwd) return isDirectory && relativePath !== "." ? relativePath.slice(0, -1) : relativePath;
3080
+ return getRelativePath(relativePath, cwd, root);
3081
+ }
3082
+ __name(processPath, "processPath");
3083
+ function formatPaths(paths, cwd, root) {
3084
+ for (let i = paths.length - 1; i >= 0; i--) {
3085
+ const path$1 = paths[i];
3086
+ paths[i] = getRelativePath(path$1, cwd, root) + (!path$1 || path$1.endsWith("/") ? "/" : "");
3087
+ }
3088
+ return paths;
3089
+ }
3090
+ __name(formatPaths, "formatPaths");
3091
+ function crawl(options, cwd, sync) {
3092
+ if (process.env.TINYGLOBBY_DEBUG) options.debug = true;
3093
+ if (options.debug) log("globbing with options:", options, "cwd:", cwd);
3094
+ if (Array.isArray(options.patterns) && options.patterns.length === 0) return sync ? [] : Promise.resolve([]);
3095
+ const props = {
3096
+ root: cwd,
3097
+ commonPath: null,
3098
+ depthOffset: 0
3099
+ };
3100
+ const processed = processPatterns(options, cwd, props);
3101
+ const nocase = options.caseSensitiveMatch === false;
3102
+ if (options.debug) log("internal processing patterns:", processed);
3103
+ const matcher = (0, import_picomatch.default)(processed.match, {
3104
+ dot: options.dot,
3105
+ nocase,
3106
+ ignore: processed.ignore
3107
+ });
3108
+ const ignore = (0, import_picomatch.default)(processed.ignore, {
3109
+ dot: options.dot,
3110
+ nocase
3111
+ });
3112
+ const partialMatcher = getPartialMatcher(processed.match, {
3113
+ dot: options.dot,
3114
+ nocase
3115
+ });
3116
+ const fdirOptions = {
3117
+ filters: [options.debug ? (p, isDirectory) => {
3118
+ const path$1 = processPath(p, cwd, props.root, isDirectory, options.absolute);
3119
+ const matches = matcher(path$1);
3120
+ if (matches) log(`matched ${path$1}`);
3121
+ return matches;
3122
+ } : (p, isDirectory) => matcher(processPath(p, cwd, props.root, isDirectory, options.absolute))],
3123
+ exclude: options.debug ? (_, p) => {
3124
+ const relativePath = processPath(p, cwd, props.root, true, true);
3125
+ const skipped = relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath);
3126
+ if (skipped) log(`skipped ${p}`);
3127
+ else log(`crawling ${p}`);
3128
+ return skipped;
3129
+ } : (_, p) => {
3130
+ const relativePath = processPath(p, cwd, props.root, true, true);
3131
+ return relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath);
3132
+ },
3133
+ pathSeparator: "/",
3134
+ relativePaths: true,
3135
+ resolveSymlinks: true
3136
+ };
3137
+ if (options.deep !== void 0) fdirOptions.maxDepth = Math.round(options.deep - props.depthOffset);
3138
+ if (options.absolute) {
3139
+ fdirOptions.relativePaths = false;
3140
+ fdirOptions.resolvePaths = true;
3141
+ fdirOptions.includeBasePath = true;
3142
+ }
3143
+ if (options.followSymbolicLinks === false) {
3144
+ fdirOptions.resolveSymlinks = false;
3145
+ fdirOptions.excludeSymlinks = true;
3146
+ }
3147
+ if (options.onlyDirectories) {
3148
+ fdirOptions.excludeFiles = true;
3149
+ fdirOptions.includeDirs = true;
3150
+ } else if (options.onlyFiles === false) fdirOptions.includeDirs = true;
3151
+ props.root = props.root.replace(BACKSLASHES, "");
3152
+ const root = props.root;
3153
+ if (options.debug) log("internal properties:", props);
3154
+ const api = new import_fdir.fdir(fdirOptions).crawl(root);
3155
+ if (cwd === root || options.absolute) return sync ? api.sync() : api.withPromise();
3156
+ return sync ? formatPaths(api.sync(), cwd, root) : api.withPromise().then((paths) => formatPaths(paths, cwd, root));
3157
+ }
3158
+ __name(crawl, "crawl");
3159
+ function globSync(patternsOrOptions, options) {
3160
+ if (patternsOrOptions && (options === null || options === void 0 ? void 0 : options.patterns)) throw new Error("Cannot pass patterns as both an argument and an option");
3161
+ const opts = Array.isArray(patternsOrOptions) || typeof patternsOrOptions === "string" ? {
3162
+ ...options,
3163
+ patterns: patternsOrOptions
3164
+ } : patternsOrOptions;
3165
+ const cwd = opts.cwd ? path.resolve(opts.cwd).replace(BACKSLASHES, "/") : process.cwd().replace(BACKSLASHES, "/");
3166
+ return crawl(opts, cwd, true);
3167
+ }
3168
+ __name(globSync, "globSync");
3169
+
3170
+ // src/common/js-package-manager/constants.ts
3171
+ var NPM_LOCKFILE = "package-lock.json";
3172
+ var PNPM_LOCKFILE = "pnpm-lock.yaml";
3173
+ var YARN_LOCKFILE = "yarn.lock";
3174
+ var BUN_LOCKFILE = "bun.lock";
3175
+ var BUN_LOCKFILE_BINARY = "bun.lockb";
3176
+ var LOCK_FILES = [
3177
+ NPM_LOCKFILE,
3178
+ PNPM_LOCKFILE,
3179
+ YARN_LOCKFILE,
3180
+ BUN_LOCKFILE,
3181
+ BUN_LOCKFILE_BINARY
3182
+ ];
3183
+
3184
+ // src/common/utils/paths.ts
3185
+ var projectRoot;
3186
+ var getProjectRoot = /* @__PURE__ */ __name(() => {
3187
+ if (projectRoot) {
3188
+ return projectRoot;
3189
+ }
3190
+ if (process.env.STORYBOOK_PROJECT_ROOT) {
3191
+ return process.env.STORYBOOK_PROJECT_ROOT;
3192
+ }
3193
+ try {
3194
+ const found = up2(".git") || up2(".svn") || up2(".hg");
3195
+ if (found) {
3196
+ projectRoot = join(found, "..");
3197
+ return projectRoot;
3198
+ }
3199
+ } catch (e) {
3200
+ process.stdout.write(`
3201
+ error searching for repository root: ${e}
3202
+ `);
3203
+ }
3204
+ try {
3205
+ const found = any(LOCK_FILES);
3206
+ if (found) {
3207
+ projectRoot = join(found, "..");
3208
+ return projectRoot;
3209
+ }
3210
+ } catch (e) {
3211
+ process.stdout.write(`
3212
+ error searching for lock file: ${e}
3213
+ `);
3214
+ }
3215
+ try {
3216
+ const [basePath, rest] = __dirname.split(`${sep}node_modules${sep}`, 2);
3217
+ if (rest && !basePath.includes(`${sep}npm-cache${sep}`) && !relative(basePath, process.cwd()).startsWith("..")) {
3218
+ projectRoot = basePath;
3219
+ return projectRoot;
3220
+ }
3221
+ } catch (e) {
3222
+ process.stdout.write(`
3223
+ error searching for splitDirname: ${e}
3224
+ `);
3225
+ }
3226
+ projectRoot = process.cwd();
3227
+ return projectRoot;
3228
+ }, "getProjectRoot");
3229
+ var invalidateProjectRootCache = /* @__PURE__ */ __name(() => {
3230
+ projectRoot = void 0;
3231
+ }, "invalidateProjectRootCache");
3232
+ var findFilesUp = /* @__PURE__ */ __name((matchers, baseDir = process.cwd()) => {
3233
+ const matchingFiles = [];
3234
+ for (const directory of up(baseDir, { last: getProjectRoot() })) {
3235
+ matchingFiles.push(...globSync(matchers, { cwd: directory, absolute: true }));
3236
+ }
3237
+ return matchingFiles;
3238
+ }, "findFilesUp");
3239
+ var nodePathsToArray = /* @__PURE__ */ __name((nodePath) => nodePath.split(process.platform === "win32" ? ";" : ":").filter(Boolean).map((p) => resolve("./", p)), "nodePathsToArray");
3240
+ var relativePattern = /^\.{1,2}([/\\]|$)/;
3241
+ function normalizeStoryPath(filename) {
3242
+ if (relativePattern.test(filename)) {
3243
+ return filename;
3244
+ }
3245
+ return `.${sep}${filename}`;
3246
+ }
3247
+ __name(normalizeStoryPath, "normalizeStoryPath");
3248
+
3249
+ // src/common/utils/envs.ts
3250
+ async function loadEnvs(options = {}) {
3251
+ const { getEnvironment } = await import("./lib-L6BIH4EV.js");
3252
+ const defaultNodeEnv = options.production ? "production" : "development";
3253
+ const env = {
3254
+ // eslint-disable-next-line @typescript-eslint/dot-notation
3255
+ NODE_ENV: process.env.NODE_ENV || defaultNodeEnv,
3256
+ NODE_PATH: process.env["NODE_PATH"] || "",
3257
+ STORYBOOK: process.env["STORYBOOK"] || "true",
3258
+ // This is to support CRA's public folder feature.
3259
+ // In production we set this to dot(.) to allow the browser to access these assets
3260
+ // even when deployed inside a subpath. (like in GitHub pages)
3261
+ // In development this is just empty as we always serves from the root.
3262
+ PUBLIC_URL: options.production ? "." : ""
3263
+ };
3264
+ Object.keys(process.env).filter((name) => /^STORYBOOK_/.test(name)).forEach((name) => {
3265
+ env[name] = process.env[name];
3266
+ });
3267
+ const base = Object.entries(env).reduce(
3268
+ (acc, [k, v]) => Object.assign(acc, { [k]: JSON.stringify(v) }),
3269
+ {}
3270
+ );
3271
+ const { stringified, raw } = getEnvironment({ nodeEnv: env["NODE_ENV"] });
3272
+ const fullRaw = { ...env, ...raw };
3273
+ fullRaw.NODE_PATH = nodePathsToArray(fullRaw.NODE_PATH || "");
3274
+ return {
3275
+ stringified: { ...base, ...stringified },
3276
+ raw: fullRaw
3277
+ };
3278
+ }
3279
+ __name(loadEnvs, "loadEnvs");
3280
+ var stringifyEnvs = /* @__PURE__ */ __name((raw) => Object.entries(raw).reduce((acc, [key, value]) => {
3281
+ acc[key] = JSON.stringify(value);
3282
+ return acc;
3283
+ }, {}), "stringifyEnvs");
3284
+ var stringifyProcessEnvs = /* @__PURE__ */ __name((raw) => {
3285
+ const envs = Object.entries(raw).reduce((acc, [key, value]) => {
3286
+ acc[`process.env.${key}`] = JSON.stringify(value);
3287
+ return acc;
3288
+ }, {});
3289
+ return envs;
3290
+ }, "stringifyProcessEnvs");
3291
+ var optionalEnvToBoolean = /* @__PURE__ */ __name((input) => {
3292
+ if (input === void 0) {
3293
+ return void 0;
3294
+ }
3295
+ if (input.toUpperCase() === "FALSE" || input === "0") {
3296
+ return false;
3297
+ }
3298
+ if (input.toUpperCase() === "TRUE" || input === "1") {
3299
+ return true;
3300
+ }
3301
+ return Boolean(input);
3302
+ }, "optionalEnvToBoolean");
3303
+ function isCI() {
3304
+ return optionalEnvToBoolean(process.env.CI);
3305
+ }
3306
+ __name(isCI, "isCI");
3307
+
3308
+ // node_modules/execa/index.js
3309
+ var import_cross_spawn = __toESM(require_cross_spawn(), 1);
3310
+ import { Buffer as Buffer3 } from "node:buffer";
3311
+ import path3 from "node:path";
3312
+ import childProcess from "node:child_process";
3313
+ import process6 from "node:process";
3314
+
3315
+ // ../node_modules/strip-final-newline/index.js
3316
+ function stripFinalNewline(input) {
3317
+ const LF = typeof input === "string" ? "\n" : "\n".charCodeAt();
3318
+ const CR = typeof input === "string" ? "\r" : "\r".charCodeAt();
3319
+ if (input[input.length - 1] === LF) {
3320
+ input = input.slice(0, -1);
3321
+ }
3322
+ if (input[input.length - 1] === CR) {
3323
+ input = input.slice(0, -1);
3324
+ }
3325
+ return input;
3326
+ }
3327
+ __name(stripFinalNewline, "stripFinalNewline");
3328
+
3329
+ // node_modules/npm-run-path/index.js
3330
+ import process2 from "node:process";
3331
+ import path2 from "node:path";
3332
+ import { fileURLToPath } from "node:url";
3333
+
3334
+ // node_modules/path-key/index.js
3335
+ function pathKey(options = {}) {
3336
+ const {
3337
+ env = process.env,
3338
+ platform = process.platform
3339
+ } = options;
3340
+ if (platform !== "win32") {
3341
+ return "PATH";
3342
+ }
3343
+ return Object.keys(env).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
3344
+ }
3345
+ __name(pathKey, "pathKey");
3346
+
3347
+ // node_modules/npm-run-path/index.js
3348
+ var npmRunPath = /* @__PURE__ */ __name(({
3349
+ cwd = process2.cwd(),
3350
+ path: pathOption = process2.env[pathKey()],
3351
+ preferLocal = true,
3352
+ execPath = process2.execPath,
3353
+ addExecPath = true
3354
+ } = {}) => {
3355
+ const cwdString = cwd instanceof URL ? fileURLToPath(cwd) : cwd;
3356
+ const cwdPath = path2.resolve(cwdString);
3357
+ const result = [];
3358
+ if (preferLocal) {
3359
+ applyPreferLocal(result, cwdPath);
3360
+ }
3361
+ if (addExecPath) {
3362
+ applyExecPath(result, execPath, cwdPath);
3363
+ }
3364
+ return [...result, pathOption].join(path2.delimiter);
3365
+ }, "npmRunPath");
3366
+ var applyPreferLocal = /* @__PURE__ */ __name((result, cwdPath) => {
3367
+ let previous;
3368
+ while (previous !== cwdPath) {
3369
+ result.push(path2.join(cwdPath, "node_modules/.bin"));
3370
+ previous = cwdPath;
3371
+ cwdPath = path2.resolve(cwdPath, "..");
3372
+ }
3373
+ }, "applyPreferLocal");
3374
+ var applyExecPath = /* @__PURE__ */ __name((result, execPath, cwdPath) => {
3375
+ const execPathString = execPath instanceof URL ? fileURLToPath(execPath) : execPath;
3376
+ result.push(path2.resolve(cwdPath, execPathString, ".."));
3377
+ }, "applyExecPath");
3378
+ var npmRunPathEnv = /* @__PURE__ */ __name(({ env = process2.env, ...options } = {}) => {
3379
+ env = { ...env };
3380
+ const pathName = pathKey({ env });
3381
+ options.path = env[pathName];
3382
+ env[pathName] = npmRunPath(options);
3383
+ return env;
3384
+ }, "npmRunPathEnv");
3385
+
3386
+ // node_modules/mimic-fn/index.js
3387
+ var copyProperty = /* @__PURE__ */ __name((to, from, property, ignoreNonConfigurable) => {
3388
+ if (property === "length" || property === "prototype") {
3389
+ return;
3390
+ }
3391
+ if (property === "arguments" || property === "caller") {
3392
+ return;
3393
+ }
3394
+ const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
3395
+ const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
3396
+ if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
3397
+ return;
3398
+ }
3399
+ Object.defineProperty(to, property, fromDescriptor);
3400
+ }, "copyProperty");
3401
+ var canCopyProperty = /* @__PURE__ */ __name(function(toDescriptor, fromDescriptor) {
3402
+ return toDescriptor === void 0 || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
3403
+ }, "canCopyProperty");
3404
+ var changePrototype = /* @__PURE__ */ __name((to, from) => {
3405
+ const fromPrototype = Object.getPrototypeOf(from);
3406
+ if (fromPrototype === Object.getPrototypeOf(to)) {
3407
+ return;
3408
+ }
3409
+ Object.setPrototypeOf(to, fromPrototype);
3410
+ }, "changePrototype");
3411
+ var wrappedToString = /* @__PURE__ */ __name((withName, fromBody) => `/* Wrapped ${withName}*/
3412
+ ${fromBody}`, "wrappedToString");
3413
+ var toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, "toString");
3414
+ var toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name");
3415
+ var changeToString = /* @__PURE__ */ __name((to, from, name) => {
3416
+ const withName = name === "" ? "" : `with ${name.trim()}() `;
3417
+ const newToString = wrappedToString.bind(null, withName, from.toString());
3418
+ Object.defineProperty(newToString, "name", toStringName);
3419
+ Object.defineProperty(to, "toString", { ...toStringDescriptor, value: newToString });
3420
+ }, "changeToString");
3421
+ function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) {
3422
+ const { name } = to;
3423
+ for (const property of Reflect.ownKeys(from)) {
3424
+ copyProperty(to, from, property, ignoreNonConfigurable);
3425
+ }
3426
+ changePrototype(to, from);
3427
+ changeToString(to, from, name);
3428
+ return to;
3429
+ }
3430
+ __name(mimicFunction, "mimicFunction");
3431
+
3432
+ // node_modules/onetime/index.js
3433
+ var calledFunctions = /* @__PURE__ */ new WeakMap();
3434
+ var onetime = /* @__PURE__ */ __name((function_, options = {}) => {
3435
+ if (typeof function_ !== "function") {
3436
+ throw new TypeError("Expected a function");
3437
+ }
3438
+ let returnValue;
3439
+ let callCount = 0;
3440
+ const functionName = function_.displayName || function_.name || "<anonymous>";
3441
+ const onetime2 = /* @__PURE__ */ __name(function(...arguments_) {
3442
+ calledFunctions.set(onetime2, ++callCount);
3443
+ if (callCount === 1) {
3444
+ returnValue = function_.apply(this, arguments_);
3445
+ function_ = null;
3446
+ } else if (options.throw === true) {
3447
+ throw new Error(`Function \`${functionName}\` can only be called once`);
3448
+ }
3449
+ return returnValue;
3450
+ }, "onetime");
3451
+ mimicFunction(onetime2, function_);
3452
+ calledFunctions.set(onetime2, callCount);
3453
+ return onetime2;
3454
+ }, "onetime");
3455
+ onetime.callCount = (function_) => {
3456
+ if (!calledFunctions.has(function_)) {
3457
+ throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
3458
+ }
3459
+ return calledFunctions.get(function_);
3460
+ };
3461
+ var onetime_default = onetime;
3462
+
3463
+ // node_modules/execa/lib/error.js
3464
+ import process3 from "node:process";
3465
+
3466
+ // node_modules/human-signals/build/src/main.js
3467
+ import { constants as constants2 } from "node:os";
3468
+
3469
+ // node_modules/human-signals/build/src/realtime.js
3470
+ var getRealtimeSignals = /* @__PURE__ */ __name(() => {
3471
+ const length = SIGRTMAX - SIGRTMIN + 1;
3472
+ return Array.from({ length }, getRealtimeSignal);
3473
+ }, "getRealtimeSignals");
3474
+ var getRealtimeSignal = /* @__PURE__ */ __name((value, index) => ({
3475
+ name: `SIGRT${index + 1}`,
3476
+ number: SIGRTMIN + index,
3477
+ action: "terminate",
3478
+ description: "Application-specific signal (realtime)",
3479
+ standard: "posix"
3480
+ }), "getRealtimeSignal");
3481
+ var SIGRTMIN = 34;
3482
+ var SIGRTMAX = 64;
3483
+
3484
+ // node_modules/human-signals/build/src/signals.js
3485
+ import { constants } from "node:os";
3486
+
3487
+ // node_modules/human-signals/build/src/core.js
3488
+ var SIGNALS = [
3489
+ {
3490
+ name: "SIGHUP",
3491
+ number: 1,
3492
+ action: "terminate",
3493
+ description: "Terminal closed",
3494
+ standard: "posix"
3495
+ },
3496
+ {
3497
+ name: "SIGINT",
3498
+ number: 2,
3499
+ action: "terminate",
3500
+ description: "User interruption with CTRL-C",
3501
+ standard: "ansi"
3502
+ },
3503
+ {
3504
+ name: "SIGQUIT",
3505
+ number: 3,
3506
+ action: "core",
3507
+ description: "User interruption with CTRL-\\",
3508
+ standard: "posix"
3509
+ },
3510
+ {
3511
+ name: "SIGILL",
3512
+ number: 4,
3513
+ action: "core",
3514
+ description: "Invalid machine instruction",
3515
+ standard: "ansi"
3516
+ },
3517
+ {
3518
+ name: "SIGTRAP",
3519
+ number: 5,
3520
+ action: "core",
3521
+ description: "Debugger breakpoint",
3522
+ standard: "posix"
3523
+ },
3524
+ {
3525
+ name: "SIGABRT",
3526
+ number: 6,
3527
+ action: "core",
3528
+ description: "Aborted",
3529
+ standard: "ansi"
3530
+ },
3531
+ {
3532
+ name: "SIGIOT",
3533
+ number: 6,
3534
+ action: "core",
3535
+ description: "Aborted",
3536
+ standard: "bsd"
3537
+ },
3538
+ {
3539
+ name: "SIGBUS",
3540
+ number: 7,
3541
+ action: "core",
3542
+ description: "Bus error due to misaligned, non-existing address or paging error",
3543
+ standard: "bsd"
3544
+ },
3545
+ {
3546
+ name: "SIGEMT",
3547
+ number: 7,
3548
+ action: "terminate",
3549
+ description: "Command should be emulated but is not implemented",
3550
+ standard: "other"
3551
+ },
3552
+ {
3553
+ name: "SIGFPE",
3554
+ number: 8,
3555
+ action: "core",
3556
+ description: "Floating point arithmetic error",
3557
+ standard: "ansi"
3558
+ },
3559
+ {
3560
+ name: "SIGKILL",
3561
+ number: 9,
3562
+ action: "terminate",
3563
+ description: "Forced termination",
3564
+ standard: "posix",
3565
+ forced: true
3566
+ },
3567
+ {
3568
+ name: "SIGUSR1",
3569
+ number: 10,
3570
+ action: "terminate",
3571
+ description: "Application-specific signal",
3572
+ standard: "posix"
3573
+ },
3574
+ {
3575
+ name: "SIGSEGV",
3576
+ number: 11,
3577
+ action: "core",
3578
+ description: "Segmentation fault",
3579
+ standard: "ansi"
3580
+ },
3581
+ {
3582
+ name: "SIGUSR2",
3583
+ number: 12,
3584
+ action: "terminate",
3585
+ description: "Application-specific signal",
3586
+ standard: "posix"
3587
+ },
3588
+ {
3589
+ name: "SIGPIPE",
3590
+ number: 13,
3591
+ action: "terminate",
3592
+ description: "Broken pipe or socket",
3593
+ standard: "posix"
3594
+ },
3595
+ {
3596
+ name: "SIGALRM",
3597
+ number: 14,
3598
+ action: "terminate",
3599
+ description: "Timeout or timer",
3600
+ standard: "posix"
3601
+ },
3602
+ {
3603
+ name: "SIGTERM",
3604
+ number: 15,
3605
+ action: "terminate",
3606
+ description: "Termination",
3607
+ standard: "ansi"
3608
+ },
3609
+ {
3610
+ name: "SIGSTKFLT",
3611
+ number: 16,
3612
+ action: "terminate",
3613
+ description: "Stack is empty or overflowed",
3614
+ standard: "other"
3615
+ },
3616
+ {
3617
+ name: "SIGCHLD",
3618
+ number: 17,
3619
+ action: "ignore",
3620
+ description: "Child process terminated, paused or unpaused",
3621
+ standard: "posix"
3622
+ },
3623
+ {
3624
+ name: "SIGCLD",
3625
+ number: 17,
3626
+ action: "ignore",
3627
+ description: "Child process terminated, paused or unpaused",
3628
+ standard: "other"
3629
+ },
3630
+ {
3631
+ name: "SIGCONT",
3632
+ number: 18,
3633
+ action: "unpause",
3634
+ description: "Unpaused",
3635
+ standard: "posix",
3636
+ forced: true
3637
+ },
3638
+ {
3639
+ name: "SIGSTOP",
3640
+ number: 19,
3641
+ action: "pause",
3642
+ description: "Paused",
3643
+ standard: "posix",
3644
+ forced: true
3645
+ },
3646
+ {
3647
+ name: "SIGTSTP",
3648
+ number: 20,
3649
+ action: "pause",
3650
+ description: 'Paused using CTRL-Z or "suspend"',
3651
+ standard: "posix"
3652
+ },
3653
+ {
3654
+ name: "SIGTTIN",
3655
+ number: 21,
3656
+ action: "pause",
3657
+ description: "Background process cannot read terminal input",
3658
+ standard: "posix"
3659
+ },
3660
+ {
3661
+ name: "SIGBREAK",
3662
+ number: 21,
3663
+ action: "terminate",
3664
+ description: "User interruption with CTRL-BREAK",
3665
+ standard: "other"
3666
+ },
3667
+ {
3668
+ name: "SIGTTOU",
3669
+ number: 22,
3670
+ action: "pause",
3671
+ description: "Background process cannot write to terminal output",
3672
+ standard: "posix"
3673
+ },
3674
+ {
3675
+ name: "SIGURG",
3676
+ number: 23,
3677
+ action: "ignore",
3678
+ description: "Socket received out-of-band data",
3679
+ standard: "bsd"
3680
+ },
3681
+ {
3682
+ name: "SIGXCPU",
3683
+ number: 24,
3684
+ action: "core",
3685
+ description: "Process timed out",
3686
+ standard: "bsd"
3687
+ },
3688
+ {
3689
+ name: "SIGXFSZ",
3690
+ number: 25,
3691
+ action: "core",
3692
+ description: "File too big",
3693
+ standard: "bsd"
3694
+ },
3695
+ {
3696
+ name: "SIGVTALRM",
3697
+ number: 26,
3698
+ action: "terminate",
3699
+ description: "Timeout or timer",
3700
+ standard: "bsd"
3701
+ },
3702
+ {
3703
+ name: "SIGPROF",
3704
+ number: 27,
3705
+ action: "terminate",
3706
+ description: "Timeout or timer",
3707
+ standard: "bsd"
3708
+ },
3709
+ {
3710
+ name: "SIGWINCH",
3711
+ number: 28,
3712
+ action: "ignore",
3713
+ description: "Terminal window size changed",
3714
+ standard: "bsd"
3715
+ },
3716
+ {
3717
+ name: "SIGIO",
3718
+ number: 29,
3719
+ action: "terminate",
3720
+ description: "I/O is available",
3721
+ standard: "other"
3722
+ },
3723
+ {
3724
+ name: "SIGPOLL",
3725
+ number: 29,
3726
+ action: "terminate",
3727
+ description: "Watched event",
3728
+ standard: "other"
3729
+ },
3730
+ {
3731
+ name: "SIGINFO",
3732
+ number: 29,
3733
+ action: "ignore",
3734
+ description: "Request for process information",
3735
+ standard: "other"
3736
+ },
3737
+ {
3738
+ name: "SIGPWR",
3739
+ number: 30,
3740
+ action: "terminate",
3741
+ description: "Device running out of power",
3742
+ standard: "systemv"
3743
+ },
3744
+ {
3745
+ name: "SIGSYS",
3746
+ number: 31,
3747
+ action: "core",
3748
+ description: "Invalid system call",
3749
+ standard: "other"
3750
+ },
3751
+ {
3752
+ name: "SIGUNUSED",
3753
+ number: 31,
3754
+ action: "terminate",
3755
+ description: "Invalid system call",
3756
+ standard: "other"
3757
+ }
3758
+ ];
3759
+
3760
+ // node_modules/human-signals/build/src/signals.js
3761
+ var getSignals = /* @__PURE__ */ __name(() => {
3762
+ const realtimeSignals = getRealtimeSignals();
3763
+ const signals2 = [...SIGNALS, ...realtimeSignals].map(normalizeSignal);
3764
+ return signals2;
3765
+ }, "getSignals");
3766
+ var normalizeSignal = /* @__PURE__ */ __name(({
3767
+ name,
3768
+ number: defaultNumber,
3769
+ description,
3770
+ action,
3771
+ forced = false,
3772
+ standard
3773
+ }) => {
3774
+ const {
3775
+ signals: { [name]: constantSignal }
3776
+ } = constants;
3777
+ const supported = constantSignal !== void 0;
3778
+ const number = supported ? constantSignal : defaultNumber;
3779
+ return { name, number, description, supported, action, forced, standard };
3780
+ }, "normalizeSignal");
3781
+
3782
+ // node_modules/human-signals/build/src/main.js
3783
+ var getSignalsByName = /* @__PURE__ */ __name(() => {
3784
+ const signals2 = getSignals();
3785
+ return Object.fromEntries(signals2.map(getSignalByName));
3786
+ }, "getSignalsByName");
3787
+ var getSignalByName = /* @__PURE__ */ __name(({
3788
+ name,
3789
+ number,
3790
+ description,
3791
+ supported,
3792
+ action,
3793
+ forced,
3794
+ standard
3795
+ }) => [name, { name, number, description, supported, action, forced, standard }], "getSignalByName");
3796
+ var signalsByName = getSignalsByName();
3797
+ var getSignalsByNumber = /* @__PURE__ */ __name(() => {
3798
+ const signals2 = getSignals();
3799
+ const length = SIGRTMAX + 1;
3800
+ const signalsA = Array.from(
3801
+ { length },
3802
+ (value, number) => getSignalByNumber(number, signals2)
3803
+ );
3804
+ return Object.assign({}, ...signalsA);
3805
+ }, "getSignalsByNumber");
3806
+ var getSignalByNumber = /* @__PURE__ */ __name((number, signals2) => {
3807
+ const signal = findSignalByNumber(number, signals2);
3808
+ if (signal === void 0) {
3809
+ return {};
3810
+ }
3811
+ const { name, description, supported, action, forced, standard } = signal;
3812
+ return {
3813
+ [number]: {
3814
+ name,
3815
+ number,
3816
+ description,
3817
+ supported,
3818
+ action,
3819
+ forced,
3820
+ standard
3821
+ }
3822
+ };
3823
+ }, "getSignalByNumber");
3824
+ var findSignalByNumber = /* @__PURE__ */ __name((number, signals2) => {
3825
+ const signal = signals2.find(({ name }) => constants2.signals[name] === number);
3826
+ if (signal !== void 0) {
3827
+ return signal;
3828
+ }
3829
+ return signals2.find((signalA) => signalA.number === number);
3830
+ }, "findSignalByNumber");
3831
+ var signalsByNumber = getSignalsByNumber();
3832
+
3833
+ // node_modules/execa/lib/error.js
3834
+ var getErrorPrefix = /* @__PURE__ */ __name(({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled }) => {
3835
+ if (timedOut) {
3836
+ return `timed out after ${timeout} milliseconds`;
3837
+ }
3838
+ if (isCanceled) {
3839
+ return "was canceled";
3840
+ }
3841
+ if (errorCode !== void 0) {
3842
+ return `failed with ${errorCode}`;
3843
+ }
3844
+ if (signal !== void 0) {
3845
+ return `was killed with ${signal} (${signalDescription})`;
3846
+ }
3847
+ if (exitCode !== void 0) {
3848
+ return `failed with exit code ${exitCode}`;
3849
+ }
3850
+ return "failed";
3851
+ }, "getErrorPrefix");
3852
+ var makeError = /* @__PURE__ */ __name(({
3853
+ stdout,
3854
+ stderr,
3855
+ all,
3856
+ error,
3857
+ signal,
3858
+ exitCode,
3859
+ command,
3860
+ escapedCommand,
3861
+ timedOut,
3862
+ isCanceled,
3863
+ killed,
3864
+ parsed: { options: { timeout, cwd = process3.cwd() } }
3865
+ }) => {
3866
+ exitCode = exitCode === null ? void 0 : exitCode;
3867
+ signal = signal === null ? void 0 : signal;
3868
+ const signalDescription = signal === void 0 ? void 0 : signalsByName[signal].description;
3869
+ const errorCode = error && error.code;
3870
+ const prefix = getErrorPrefix({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled });
3871
+ const execaMessage = `Command ${prefix}: ${command}`;
3872
+ const isError = Object.prototype.toString.call(error) === "[object Error]";
3873
+ const shortMessage = isError ? `${execaMessage}
3874
+ ${error.message}` : execaMessage;
3875
+ const message = [shortMessage, stderr, stdout].filter(Boolean).join("\n");
3876
+ if (isError) {
3877
+ error.originalMessage = error.message;
3878
+ error.message = message;
3879
+ } else {
3880
+ error = new Error(message);
3881
+ }
3882
+ error.shortMessage = shortMessage;
3883
+ error.command = command;
3884
+ error.escapedCommand = escapedCommand;
3885
+ error.exitCode = exitCode;
3886
+ error.signal = signal;
3887
+ error.signalDescription = signalDescription;
3888
+ error.stdout = stdout;
3889
+ error.stderr = stderr;
3890
+ error.cwd = cwd;
3891
+ if (all !== void 0) {
3892
+ error.all = all;
3893
+ }
3894
+ if ("bufferedData" in error) {
3895
+ delete error.bufferedData;
3896
+ }
3897
+ error.failed = true;
3898
+ error.timedOut = Boolean(timedOut);
3899
+ error.isCanceled = isCanceled;
3900
+ error.killed = killed && !timedOut;
3901
+ return error;
3902
+ }, "makeError");
3903
+
3904
+ // node_modules/execa/lib/stdio.js
3905
+ var aliases = ["stdin", "stdout", "stderr"];
3906
+ var hasAlias = /* @__PURE__ */ __name((options) => aliases.some((alias) => options[alias] !== void 0), "hasAlias");
3907
+ var normalizeStdio = /* @__PURE__ */ __name((options) => {
3908
+ if (!options) {
3909
+ return;
3910
+ }
3911
+ const { stdio } = options;
3912
+ if (stdio === void 0) {
3913
+ return aliases.map((alias) => options[alias]);
3914
+ }
3915
+ if (hasAlias(options)) {
3916
+ throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map((alias) => `\`${alias}\``).join(", ")}`);
3917
+ }
3918
+ if (typeof stdio === "string") {
3919
+ return stdio;
3920
+ }
3921
+ if (!Array.isArray(stdio)) {
3922
+ throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
3923
+ }
3924
+ const length = Math.max(stdio.length, aliases.length);
3925
+ return Array.from({ length }, (value, index) => stdio[index]);
3926
+ }, "normalizeStdio");
3927
+
3928
+ // node_modules/execa/lib/kill.js
3929
+ import os from "node:os";
3930
+
3931
+ // node_modules/signal-exit/dist/mjs/signals.js
3932
+ var signals = [];
3933
+ signals.push("SIGHUP", "SIGINT", "SIGTERM");
3934
+ if (process.platform !== "win32") {
3935
+ signals.push(
3936
+ "SIGALRM",
3937
+ "SIGABRT",
3938
+ "SIGVTALRM",
3939
+ "SIGXCPU",
3940
+ "SIGXFSZ",
3941
+ "SIGUSR2",
3942
+ "SIGTRAP",
3943
+ "SIGSYS",
3944
+ "SIGQUIT",
3945
+ "SIGIOT"
3946
+ // should detect profiler and enable/disable accordingly.
3947
+ // see #21
3948
+ // 'SIGPROF'
3949
+ );
3950
+ }
3951
+ if (process.platform === "linux") {
3952
+ signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
3953
+ }
3954
+
3955
+ // node_modules/signal-exit/dist/mjs/index.js
3956
+ var processOk = /* @__PURE__ */ __name((process7) => !!process7 && typeof process7 === "object" && typeof process7.removeListener === "function" && typeof process7.emit === "function" && typeof process7.reallyExit === "function" && typeof process7.listeners === "function" && typeof process7.kill === "function" && typeof process7.pid === "number" && typeof process7.on === "function", "processOk");
3957
+ var kExitEmitter = Symbol.for("signal-exit emitter");
3958
+ var global2 = globalThis;
3959
+ var ObjectDefineProperty = Object.defineProperty.bind(Object);
3960
+ var Emitter = class {
3961
+ static {
3962
+ __name(this, "Emitter");
3963
+ }
3964
+ emitted = {
3965
+ afterExit: false,
3966
+ exit: false
3967
+ };
3968
+ listeners = {
3969
+ afterExit: [],
3970
+ exit: []
3971
+ };
3972
+ count = 0;
3973
+ id = Math.random();
3974
+ constructor() {
3975
+ if (global2[kExitEmitter]) {
3976
+ return global2[kExitEmitter];
3977
+ }
3978
+ ObjectDefineProperty(global2, kExitEmitter, {
3979
+ value: this,
3980
+ writable: false,
3981
+ enumerable: false,
3982
+ configurable: false
3983
+ });
3984
+ }
3985
+ on(ev, fn) {
3986
+ this.listeners[ev].push(fn);
3987
+ }
3988
+ removeListener(ev, fn) {
3989
+ const list = this.listeners[ev];
3990
+ const i = list.indexOf(fn);
3991
+ if (i === -1) {
3992
+ return;
3993
+ }
3994
+ if (i === 0 && list.length === 1) {
3995
+ list.length = 0;
3996
+ } else {
3997
+ list.splice(i, 1);
3998
+ }
3999
+ }
4000
+ emit(ev, code, signal) {
4001
+ if (this.emitted[ev]) {
4002
+ return false;
4003
+ }
4004
+ this.emitted[ev] = true;
4005
+ let ret = false;
4006
+ for (const fn of this.listeners[ev]) {
4007
+ ret = fn(code, signal) === true || ret;
4008
+ }
4009
+ if (ev === "exit") {
4010
+ ret = this.emit("afterExit", code, signal) || ret;
4011
+ }
4012
+ return ret;
4013
+ }
4014
+ };
4015
+ var SignalExitBase = class {
4016
+ static {
4017
+ __name(this, "SignalExitBase");
4018
+ }
4019
+ };
4020
+ var signalExitWrap = /* @__PURE__ */ __name((handler) => {
4021
+ return {
4022
+ onExit(cb, opts) {
4023
+ return handler.onExit(cb, opts);
4024
+ },
4025
+ load() {
4026
+ return handler.load();
4027
+ },
4028
+ unload() {
4029
+ return handler.unload();
4030
+ }
4031
+ };
4032
+ }, "signalExitWrap");
4033
+ var SignalExitFallback = class extends SignalExitBase {
4034
+ static {
4035
+ __name(this, "SignalExitFallback");
4036
+ }
4037
+ onExit() {
4038
+ return () => {
4039
+ };
4040
+ }
4041
+ load() {
4042
+ }
4043
+ unload() {
4044
+ }
4045
+ };
4046
+ var SignalExit = class extends SignalExitBase {
4047
+ static {
4048
+ __name(this, "SignalExit");
4049
+ }
4050
+ // "SIGHUP" throws an `ENOSYS` error on Windows,
4051
+ // so use a supported signal instead
4052
+ /* c8 ignore start */
4053
+ #hupSig = process4.platform === "win32" ? "SIGINT" : "SIGHUP";
4054
+ /* c8 ignore stop */
4055
+ #emitter = new Emitter();
4056
+ #process;
4057
+ #originalProcessEmit;
4058
+ #originalProcessReallyExit;
4059
+ #sigListeners = {};
4060
+ #loaded = false;
4061
+ constructor(process7) {
4062
+ super();
4063
+ this.#process = process7;
4064
+ this.#sigListeners = {};
4065
+ for (const sig of signals) {
4066
+ this.#sigListeners[sig] = () => {
4067
+ const listeners = this.#process.listeners(sig);
4068
+ let { count } = this.#emitter;
4069
+ const p = process7;
4070
+ if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
4071
+ count += p.__signal_exit_emitter__.count;
4072
+ }
4073
+ if (listeners.length === count) {
4074
+ this.unload();
4075
+ const ret = this.#emitter.emit("exit", null, sig);
4076
+ const s = sig === "SIGHUP" ? this.#hupSig : sig;
4077
+ if (!ret)
4078
+ process7.kill(process7.pid, s);
4079
+ }
4080
+ };
4081
+ }
4082
+ this.#originalProcessReallyExit = process7.reallyExit;
4083
+ this.#originalProcessEmit = process7.emit;
4084
+ }
4085
+ onExit(cb, opts) {
4086
+ if (!processOk(this.#process)) {
4087
+ return () => {
4088
+ };
4089
+ }
4090
+ if (this.#loaded === false) {
4091
+ this.load();
4092
+ }
4093
+ const ev = opts?.alwaysLast ? "afterExit" : "exit";
4094
+ this.#emitter.on(ev, cb);
4095
+ return () => {
4096
+ this.#emitter.removeListener(ev, cb);
4097
+ if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) {
4098
+ this.unload();
4099
+ }
4100
+ };
4101
+ }
4102
+ load() {
4103
+ if (this.#loaded) {
4104
+ return;
4105
+ }
4106
+ this.#loaded = true;
4107
+ this.#emitter.count += 1;
4108
+ for (const sig of signals) {
4109
+ try {
4110
+ const fn = this.#sigListeners[sig];
4111
+ if (fn)
4112
+ this.#process.on(sig, fn);
4113
+ } catch (_) {
4114
+ }
4115
+ }
4116
+ this.#process.emit = (ev, ...a) => {
4117
+ return this.#processEmit(ev, ...a);
4118
+ };
4119
+ this.#process.reallyExit = (code) => {
4120
+ return this.#processReallyExit(code);
4121
+ };
4122
+ }
4123
+ unload() {
4124
+ if (!this.#loaded) {
4125
+ return;
4126
+ }
4127
+ this.#loaded = false;
4128
+ signals.forEach((sig) => {
4129
+ const listener = this.#sigListeners[sig];
4130
+ if (!listener) {
4131
+ throw new Error("Listener not defined for signal: " + sig);
4132
+ }
4133
+ try {
4134
+ this.#process.removeListener(sig, listener);
4135
+ } catch (_) {
4136
+ }
4137
+ });
4138
+ this.#process.emit = this.#originalProcessEmit;
4139
+ this.#process.reallyExit = this.#originalProcessReallyExit;
4140
+ this.#emitter.count -= 1;
4141
+ }
4142
+ #processReallyExit(code) {
4143
+ if (!processOk(this.#process)) {
4144
+ return 0;
4145
+ }
4146
+ this.#process.exitCode = code || 0;
4147
+ this.#emitter.emit("exit", this.#process.exitCode, null);
4148
+ return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
4149
+ }
4150
+ #processEmit(ev, ...args) {
4151
+ const og = this.#originalProcessEmit;
4152
+ if (ev === "exit" && processOk(this.#process)) {
4153
+ if (typeof args[0] === "number") {
4154
+ this.#process.exitCode = args[0];
4155
+ }
4156
+ const ret = og.call(this.#process, ev, ...args);
4157
+ this.#emitter.emit("exit", this.#process.exitCode, null);
4158
+ return ret;
4159
+ } else {
4160
+ return og.call(this.#process, ev, ...args);
4161
+ }
4162
+ }
4163
+ };
4164
+ var process4 = globalThis.process;
4165
+ var {
4166
+ /**
4167
+ * Called when the process is exiting, whether via signal, explicit
4168
+ * exit, or running out of stuff to do.
4169
+ *
4170
+ * If the global process object is not suitable for instrumentation,
4171
+ * then this will be a no-op.
4172
+ *
4173
+ * Returns a function that may be used to unload signal-exit.
4174
+ */
4175
+ onExit,
4176
+ /**
4177
+ * Load the listeners. Likely you never need to call this, unless
4178
+ * doing a rather deep integration with signal-exit functionality.
4179
+ * Mostly exposed for the benefit of testing.
4180
+ *
4181
+ * @internal
4182
+ */
4183
+ load,
4184
+ /**
4185
+ * Unload the listeners. Likely you never need to call this, unless
4186
+ * doing a rather deep integration with signal-exit functionality.
4187
+ * Mostly exposed for the benefit of testing.
4188
+ *
4189
+ * @internal
4190
+ */
4191
+ unload
4192
+ } = signalExitWrap(processOk(process4) ? new SignalExit(process4) : new SignalExitFallback());
4193
+
4194
+ // node_modules/execa/lib/kill.js
4195
+ var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5;
4196
+ var spawnedKill = /* @__PURE__ */ __name((kill, signal = "SIGTERM", options = {}) => {
4197
+ const killResult = kill(signal);
4198
+ setKillTimeout(kill, signal, options, killResult);
4199
+ return killResult;
4200
+ }, "spawnedKill");
4201
+ var setKillTimeout = /* @__PURE__ */ __name((kill, signal, options, killResult) => {
4202
+ if (!shouldForceKill(signal, options, killResult)) {
4203
+ return;
4204
+ }
4205
+ const timeout = getForceKillAfterTimeout(options);
4206
+ const t = setTimeout(() => {
4207
+ kill("SIGKILL");
4208
+ }, timeout);
4209
+ if (t.unref) {
4210
+ t.unref();
4211
+ }
4212
+ }, "setKillTimeout");
4213
+ var shouldForceKill = /* @__PURE__ */ __name((signal, { forceKillAfterTimeout }, killResult) => isSigterm(signal) && forceKillAfterTimeout !== false && killResult, "shouldForceKill");
4214
+ var isSigterm = /* @__PURE__ */ __name((signal) => signal === os.constants.signals.SIGTERM || typeof signal === "string" && signal.toUpperCase() === "SIGTERM", "isSigterm");
4215
+ var getForceKillAfterTimeout = /* @__PURE__ */ __name(({ forceKillAfterTimeout = true }) => {
4216
+ if (forceKillAfterTimeout === true) {
4217
+ return DEFAULT_FORCE_KILL_TIMEOUT;
4218
+ }
4219
+ if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) {
4220
+ throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`);
4221
+ }
4222
+ return forceKillAfterTimeout;
4223
+ }, "getForceKillAfterTimeout");
4224
+ var spawnedCancel = /* @__PURE__ */ __name((spawned, context) => {
4225
+ const killResult = spawned.kill();
4226
+ if (killResult) {
4227
+ context.isCanceled = true;
4228
+ }
4229
+ }, "spawnedCancel");
4230
+ var timeoutKill = /* @__PURE__ */ __name((spawned, signal, reject) => {
4231
+ spawned.kill(signal);
4232
+ reject(Object.assign(new Error("Timed out"), { timedOut: true, signal }));
4233
+ }, "timeoutKill");
4234
+ var setupTimeout = /* @__PURE__ */ __name((spawned, { timeout, killSignal = "SIGTERM" }, spawnedPromise) => {
4235
+ if (timeout === 0 || timeout === void 0) {
4236
+ return spawnedPromise;
4237
+ }
4238
+ let timeoutId;
4239
+ const timeoutPromise = new Promise((resolve2, reject) => {
4240
+ timeoutId = setTimeout(() => {
4241
+ timeoutKill(spawned, killSignal, reject);
4242
+ }, timeout);
4243
+ });
4244
+ const safeSpawnedPromise = spawnedPromise.finally(() => {
4245
+ clearTimeout(timeoutId);
4246
+ });
4247
+ return Promise.race([timeoutPromise, safeSpawnedPromise]);
4248
+ }, "setupTimeout");
4249
+ var validateTimeout = /* @__PURE__ */ __name(({ timeout }) => {
4250
+ if (timeout !== void 0 && (!Number.isFinite(timeout) || timeout < 0)) {
4251
+ throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`);
4252
+ }
4253
+ }, "validateTimeout");
4254
+ var setExitHandler = /* @__PURE__ */ __name(async (spawned, { cleanup, detached }, timedPromise) => {
4255
+ if (!cleanup || detached) {
4256
+ return timedPromise;
4257
+ }
4258
+ const removeExitHandler = onExit(() => {
4259
+ spawned.kill();
4260
+ });
4261
+ return timedPromise.finally(() => {
4262
+ removeExitHandler();
4263
+ });
4264
+ }, "setExitHandler");
4265
+
4266
+ // node_modules/execa/lib/pipe.js
4267
+ import { createWriteStream } from "node:fs";
4268
+ import { ChildProcess } from "node:child_process";
4269
+
4270
+ // node_modules/is-stream/index.js
4271
+ function isStream(stream) {
4272
+ return stream !== null && typeof stream === "object" && typeof stream.pipe === "function";
4273
+ }
4274
+ __name(isStream, "isStream");
4275
+ function isWritableStream(stream) {
4276
+ return isStream(stream) && stream.writable !== false && typeof stream._write === "function" && typeof stream._writableState === "object";
4277
+ }
4278
+ __name(isWritableStream, "isWritableStream");
4279
+
4280
+ // node_modules/execa/lib/pipe.js
4281
+ var isExecaChildProcess = /* @__PURE__ */ __name((target) => target instanceof ChildProcess && typeof target.then === "function", "isExecaChildProcess");
4282
+ var pipeToTarget = /* @__PURE__ */ __name((spawned, streamName, target) => {
4283
+ if (typeof target === "string") {
4284
+ spawned[streamName].pipe(createWriteStream(target));
4285
+ return spawned;
4286
+ }
4287
+ if (isWritableStream(target)) {
4288
+ spawned[streamName].pipe(target);
4289
+ return spawned;
4290
+ }
4291
+ if (!isExecaChildProcess(target)) {
4292
+ throw new TypeError("The second argument must be a string, a stream or an Execa child process.");
4293
+ }
4294
+ if (!isWritableStream(target.stdin)) {
4295
+ throw new TypeError("The target child process's stdin must be available.");
4296
+ }
4297
+ spawned[streamName].pipe(target.stdin);
4298
+ return target;
4299
+ }, "pipeToTarget");
4300
+ var addPipeMethods = /* @__PURE__ */ __name((spawned) => {
4301
+ if (spawned.stdout !== null) {
4302
+ spawned.pipeStdout = pipeToTarget.bind(void 0, spawned, "stdout");
4303
+ }
4304
+ if (spawned.stderr !== null) {
4305
+ spawned.pipeStderr = pipeToTarget.bind(void 0, spawned, "stderr");
4306
+ }
4307
+ if (spawned.all !== void 0) {
4308
+ spawned.pipeAll = pipeToTarget.bind(void 0, spawned, "all");
4309
+ }
4310
+ }, "addPipeMethods");
4311
+
4312
+ // node_modules/execa/lib/stream.js
4313
+ import { createReadStream, readFileSync } from "node:fs";
4314
+ import { setTimeout as setTimeout2 } from "node:timers/promises";
4315
+
4316
+ // node_modules/get-stream/source/contents.js
4317
+ var getStreamContents = /* @__PURE__ */ __name(async (stream, { init, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, finalize }, { maxBuffer = Number.POSITIVE_INFINITY } = {}) => {
4318
+ if (!isAsyncIterable(stream)) {
4319
+ throw new Error("The first argument must be a Readable, a ReadableStream, or an async iterable.");
4320
+ }
4321
+ const state = init();
4322
+ state.length = 0;
4323
+ try {
4324
+ for await (const chunk of stream) {
4325
+ const chunkType = getChunkType(chunk);
4326
+ const convertedChunk = convertChunk[chunkType](chunk, state);
4327
+ appendChunk({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer });
4328
+ }
4329
+ appendFinalChunk({ state, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer });
4330
+ return finalize(state);
4331
+ } catch (error) {
4332
+ error.bufferedData = finalize(state);
4333
+ throw error;
4334
+ }
4335
+ }, "getStreamContents");
4336
+ var appendFinalChunk = /* @__PURE__ */ __name(({ state, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer }) => {
4337
+ const convertedChunk = getFinalChunk(state);
4338
+ if (convertedChunk !== void 0) {
4339
+ appendChunk({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer });
4340
+ }
4341
+ }, "appendFinalChunk");
4342
+ var appendChunk = /* @__PURE__ */ __name(({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer }) => {
4343
+ const chunkSize = getSize(convertedChunk);
4344
+ const newLength = state.length + chunkSize;
4345
+ if (newLength <= maxBuffer) {
4346
+ addNewChunk(convertedChunk, state, addChunk, newLength);
4347
+ return;
4348
+ }
4349
+ const truncatedChunk = truncateChunk(convertedChunk, maxBuffer - state.length);
4350
+ if (truncatedChunk !== void 0) {
4351
+ addNewChunk(truncatedChunk, state, addChunk, maxBuffer);
4352
+ }
4353
+ throw new MaxBufferError();
4354
+ }, "appendChunk");
4355
+ var addNewChunk = /* @__PURE__ */ __name((convertedChunk, state, addChunk, newLength) => {
4356
+ state.contents = addChunk(convertedChunk, state, newLength);
4357
+ state.length = newLength;
4358
+ }, "addNewChunk");
4359
+ var isAsyncIterable = /* @__PURE__ */ __name((stream) => typeof stream === "object" && stream !== null && typeof stream[Symbol.asyncIterator] === "function", "isAsyncIterable");
4360
+ var getChunkType = /* @__PURE__ */ __name((chunk) => {
4361
+ const typeOfChunk = typeof chunk;
4362
+ if (typeOfChunk === "string") {
4363
+ return "string";
4364
+ }
4365
+ if (typeOfChunk !== "object" || chunk === null) {
4366
+ return "others";
4367
+ }
4368
+ if (globalThis.Buffer?.isBuffer(chunk)) {
4369
+ return "buffer";
4370
+ }
4371
+ const prototypeName = objectToString.call(chunk);
4372
+ if (prototypeName === "[object ArrayBuffer]") {
4373
+ return "arrayBuffer";
4374
+ }
4375
+ if (prototypeName === "[object DataView]") {
4376
+ return "dataView";
4377
+ }
4378
+ if (Number.isInteger(chunk.byteLength) && Number.isInteger(chunk.byteOffset) && objectToString.call(chunk.buffer) === "[object ArrayBuffer]") {
4379
+ return "typedArray";
4380
+ }
4381
+ return "others";
4382
+ }, "getChunkType");
4383
+ var { toString: objectToString } = Object.prototype;
4384
+ var MaxBufferError = class extends Error {
4385
+ static {
4386
+ __name(this, "MaxBufferError");
4387
+ }
4388
+ name = "MaxBufferError";
4389
+ constructor() {
4390
+ super("maxBuffer exceeded");
4391
+ }
4392
+ };
4393
+
4394
+ // node_modules/get-stream/source/utils.js
4395
+ var identity = /* @__PURE__ */ __name((value) => value, "identity");
4396
+ var noop = /* @__PURE__ */ __name(() => void 0, "noop");
4397
+ var getContentsProp = /* @__PURE__ */ __name(({ contents }) => contents, "getContentsProp");
4398
+ var throwObjectStream = /* @__PURE__ */ __name((chunk) => {
4399
+ throw new Error(`Streams in object mode are not supported: ${String(chunk)}`);
4400
+ }, "throwObjectStream");
4401
+ var getLengthProp = /* @__PURE__ */ __name((convertedChunk) => convertedChunk.length, "getLengthProp");
4402
+
4403
+ // node_modules/get-stream/source/array-buffer.js
4404
+ async function getStreamAsArrayBuffer(stream, options) {
4405
+ return getStreamContents(stream, arrayBufferMethods, options);
4406
+ }
4407
+ __name(getStreamAsArrayBuffer, "getStreamAsArrayBuffer");
4408
+ var initArrayBuffer = /* @__PURE__ */ __name(() => ({ contents: new ArrayBuffer(0) }), "initArrayBuffer");
4409
+ var useTextEncoder = /* @__PURE__ */ __name((chunk) => textEncoder.encode(chunk), "useTextEncoder");
4410
+ var textEncoder = new TextEncoder();
4411
+ var useUint8Array = /* @__PURE__ */ __name((chunk) => new Uint8Array(chunk), "useUint8Array");
4412
+ var useUint8ArrayWithOffset = /* @__PURE__ */ __name((chunk) => new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength), "useUint8ArrayWithOffset");
4413
+ var truncateArrayBufferChunk = /* @__PURE__ */ __name((convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize), "truncateArrayBufferChunk");
4414
+ var addArrayBufferChunk = /* @__PURE__ */ __name((convertedChunk, { contents, length: previousLength }, length) => {
4415
+ const newContents = hasArrayBufferResize() ? resizeArrayBuffer(contents, length) : resizeArrayBufferSlow(contents, length);
4416
+ new Uint8Array(newContents).set(convertedChunk, previousLength);
4417
+ return newContents;
4418
+ }, "addArrayBufferChunk");
4419
+ var resizeArrayBufferSlow = /* @__PURE__ */ __name((contents, length) => {
4420
+ if (length <= contents.byteLength) {
4421
+ return contents;
4422
+ }
4423
+ const arrayBuffer = new ArrayBuffer(getNewContentsLength(length));
4424
+ new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);
4425
+ return arrayBuffer;
4426
+ }, "resizeArrayBufferSlow");
4427
+ var resizeArrayBuffer = /* @__PURE__ */ __name((contents, length) => {
4428
+ if (length <= contents.maxByteLength) {
4429
+ contents.resize(length);
4430
+ return contents;
4431
+ }
4432
+ const arrayBuffer = new ArrayBuffer(length, { maxByteLength: getNewContentsLength(length) });
4433
+ new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);
4434
+ return arrayBuffer;
4435
+ }, "resizeArrayBuffer");
4436
+ var getNewContentsLength = /* @__PURE__ */ __name((length) => SCALE_FACTOR ** Math.ceil(Math.log(length) / Math.log(SCALE_FACTOR)), "getNewContentsLength");
4437
+ var SCALE_FACTOR = 2;
4438
+ var finalizeArrayBuffer = /* @__PURE__ */ __name(({ contents, length }) => hasArrayBufferResize() ? contents : contents.slice(0, length), "finalizeArrayBuffer");
4439
+ var hasArrayBufferResize = /* @__PURE__ */ __name(() => "resize" in ArrayBuffer.prototype, "hasArrayBufferResize");
4440
+ var arrayBufferMethods = {
4441
+ init: initArrayBuffer,
4442
+ convertChunk: {
4443
+ string: useTextEncoder,
4444
+ buffer: useUint8Array,
4445
+ arrayBuffer: useUint8Array,
4446
+ dataView: useUint8ArrayWithOffset,
4447
+ typedArray: useUint8ArrayWithOffset,
4448
+ others: throwObjectStream
4449
+ },
4450
+ getSize: getLengthProp,
4451
+ truncateChunk: truncateArrayBufferChunk,
4452
+ addChunk: addArrayBufferChunk,
4453
+ getFinalChunk: noop,
4454
+ finalize: finalizeArrayBuffer
4455
+ };
4456
+
4457
+ // node_modules/get-stream/source/buffer.js
4458
+ async function getStreamAsBuffer(stream, options) {
4459
+ if (!("Buffer" in globalThis)) {
4460
+ throw new Error("getStreamAsBuffer() is only supported in Node.js");
4461
+ }
4462
+ try {
4463
+ return arrayBufferToNodeBuffer(await getStreamAsArrayBuffer(stream, options));
4464
+ } catch (error) {
4465
+ if (error.bufferedData !== void 0) {
4466
+ error.bufferedData = arrayBufferToNodeBuffer(error.bufferedData);
4467
+ }
4468
+ throw error;
4469
+ }
4470
+ }
4471
+ __name(getStreamAsBuffer, "getStreamAsBuffer");
4472
+ var arrayBufferToNodeBuffer = /* @__PURE__ */ __name((arrayBuffer) => globalThis.Buffer.from(arrayBuffer), "arrayBufferToNodeBuffer");
4473
+
4474
+ // node_modules/get-stream/source/string.js
4475
+ async function getStreamAsString(stream, options) {
4476
+ return getStreamContents(stream, stringMethods, options);
4477
+ }
4478
+ __name(getStreamAsString, "getStreamAsString");
4479
+ var initString = /* @__PURE__ */ __name(() => ({ contents: "", textDecoder: new TextDecoder() }), "initString");
4480
+ var useTextDecoder = /* @__PURE__ */ __name((chunk, { textDecoder }) => textDecoder.decode(chunk, { stream: true }), "useTextDecoder");
4481
+ var addStringChunk = /* @__PURE__ */ __name((convertedChunk, { contents }) => contents + convertedChunk, "addStringChunk");
4482
+ var truncateStringChunk = /* @__PURE__ */ __name((convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize), "truncateStringChunk");
4483
+ var getFinalStringChunk = /* @__PURE__ */ __name(({ textDecoder }) => {
4484
+ const finalChunk = textDecoder.decode();
4485
+ return finalChunk === "" ? void 0 : finalChunk;
4486
+ }, "getFinalStringChunk");
4487
+ var stringMethods = {
4488
+ init: initString,
4489
+ convertChunk: {
4490
+ string: identity,
4491
+ buffer: useTextDecoder,
4492
+ arrayBuffer: useTextDecoder,
4493
+ dataView: useTextDecoder,
4494
+ typedArray: useTextDecoder,
4495
+ others: throwObjectStream
4496
+ },
4497
+ getSize: getLengthProp,
4498
+ truncateChunk: truncateStringChunk,
4499
+ addChunk: addStringChunk,
4500
+ getFinalChunk: getFinalStringChunk,
4501
+ finalize: getContentsProp
4502
+ };
4503
+
4504
+ // node_modules/execa/lib/stream.js
4505
+ var import_merge_stream = __toESM(require_merge_stream(), 1);
4506
+ var validateInputOptions = /* @__PURE__ */ __name((input) => {
4507
+ if (input !== void 0) {
4508
+ throw new TypeError("The `input` and `inputFile` options cannot be both set.");
4509
+ }
4510
+ }, "validateInputOptions");
4511
+ var getInputSync = /* @__PURE__ */ __name(({ input, inputFile }) => {
4512
+ if (typeof inputFile !== "string") {
4513
+ return input;
4514
+ }
4515
+ validateInputOptions(input);
4516
+ return readFileSync(inputFile);
4517
+ }, "getInputSync");
4518
+ var handleInputSync = /* @__PURE__ */ __name((options) => {
4519
+ const input = getInputSync(options);
4520
+ if (isStream(input)) {
4521
+ throw new TypeError("The `input` option cannot be a stream in sync mode");
4522
+ }
4523
+ return input;
4524
+ }, "handleInputSync");
4525
+ var getInput = /* @__PURE__ */ __name(({ input, inputFile }) => {
4526
+ if (typeof inputFile !== "string") {
4527
+ return input;
4528
+ }
4529
+ validateInputOptions(input);
4530
+ return createReadStream(inputFile);
4531
+ }, "getInput");
4532
+ var handleInput = /* @__PURE__ */ __name((spawned, options) => {
4533
+ const input = getInput(options);
4534
+ if (input === void 0) {
4535
+ return;
4536
+ }
4537
+ if (isStream(input)) {
4538
+ input.pipe(spawned.stdin);
4539
+ } else {
4540
+ spawned.stdin.end(input);
4541
+ }
4542
+ }, "handleInput");
4543
+ var makeAllStream = /* @__PURE__ */ __name((spawned, { all }) => {
4544
+ if (!all || !spawned.stdout && !spawned.stderr) {
4545
+ return;
4546
+ }
4547
+ const mixed = (0, import_merge_stream.default)();
4548
+ if (spawned.stdout) {
4549
+ mixed.add(spawned.stdout);
4550
+ }
4551
+ if (spawned.stderr) {
4552
+ mixed.add(spawned.stderr);
4553
+ }
4554
+ return mixed;
4555
+ }, "makeAllStream");
4556
+ var getBufferedData = /* @__PURE__ */ __name(async (stream, streamPromise) => {
4557
+ if (!stream || streamPromise === void 0) {
4558
+ return;
4559
+ }
4560
+ await setTimeout2(0);
4561
+ stream.destroy();
4562
+ try {
4563
+ return await streamPromise;
4564
+ } catch (error) {
4565
+ return error.bufferedData;
4566
+ }
4567
+ }, "getBufferedData");
4568
+ var getStreamPromise = /* @__PURE__ */ __name((stream, { encoding, buffer, maxBuffer }) => {
4569
+ if (!stream || !buffer) {
4570
+ return;
4571
+ }
4572
+ if (encoding === "utf8" || encoding === "utf-8") {
4573
+ return getStreamAsString(stream, { maxBuffer });
4574
+ }
4575
+ if (encoding === null || encoding === "buffer") {
4576
+ return getStreamAsBuffer(stream, { maxBuffer });
4577
+ }
4578
+ return applyEncoding(stream, maxBuffer, encoding);
4579
+ }, "getStreamPromise");
4580
+ var applyEncoding = /* @__PURE__ */ __name(async (stream, maxBuffer, encoding) => {
4581
+ const buffer = await getStreamAsBuffer(stream, { maxBuffer });
4582
+ return buffer.toString(encoding);
4583
+ }, "applyEncoding");
4584
+ var getSpawnedResult = /* @__PURE__ */ __name(async ({ stdout, stderr, all }, { encoding, buffer, maxBuffer }, processDone) => {
4585
+ const stdoutPromise = getStreamPromise(stdout, { encoding, buffer, maxBuffer });
4586
+ const stderrPromise = getStreamPromise(stderr, { encoding, buffer, maxBuffer });
4587
+ const allPromise = getStreamPromise(all, { encoding, buffer, maxBuffer: maxBuffer * 2 });
4588
+ try {
4589
+ return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]);
4590
+ } catch (error) {
4591
+ return Promise.all([
4592
+ { error, signal: error.signal, timedOut: error.timedOut },
4593
+ getBufferedData(stdout, stdoutPromise),
4594
+ getBufferedData(stderr, stderrPromise),
4595
+ getBufferedData(all, allPromise)
4596
+ ]);
4597
+ }
4598
+ }, "getSpawnedResult");
4599
+
4600
+ // node_modules/execa/lib/promise.js
4601
+ var nativePromisePrototype = (async () => {
4602
+ })().constructor.prototype;
4603
+ var descriptors = ["then", "catch", "finally"].map((property) => [
4604
+ property,
4605
+ Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property)
4606
+ ]);
4607
+ var mergePromise = /* @__PURE__ */ __name((spawned, promise) => {
4608
+ for (const [property, descriptor] of descriptors) {
4609
+ const value = typeof promise === "function" ? (...args) => Reflect.apply(descriptor.value, promise(), args) : descriptor.value.bind(promise);
4610
+ Reflect.defineProperty(spawned, property, { ...descriptor, value });
4611
+ }
4612
+ }, "mergePromise");
4613
+ var getSpawnedPromise = /* @__PURE__ */ __name((spawned) => new Promise((resolve2, reject) => {
4614
+ spawned.on("exit", (exitCode, signal) => {
4615
+ resolve2({ exitCode, signal });
4616
+ });
4617
+ spawned.on("error", (error) => {
4618
+ reject(error);
4619
+ });
4620
+ if (spawned.stdin) {
4621
+ spawned.stdin.on("error", (error) => {
4622
+ reject(error);
4623
+ });
4624
+ }
4625
+ }), "getSpawnedPromise");
4626
+
4627
+ // node_modules/execa/lib/command.js
4628
+ import { Buffer as Buffer2 } from "node:buffer";
4629
+ import { ChildProcess as ChildProcess2 } from "node:child_process";
4630
+ var normalizeArgs = /* @__PURE__ */ __name((file, args = []) => {
4631
+ if (!Array.isArray(args)) {
4632
+ return [file];
4633
+ }
4634
+ return [file, ...args];
4635
+ }, "normalizeArgs");
4636
+ var NO_ESCAPE_REGEXP = /^[\w.-]+$/;
4637
+ var escapeArg = /* @__PURE__ */ __name((arg) => {
4638
+ if (typeof arg !== "string" || NO_ESCAPE_REGEXP.test(arg)) {
4639
+ return arg;
4640
+ }
4641
+ return `"${arg.replaceAll('"', '\\"')}"`;
4642
+ }, "escapeArg");
4643
+ var joinCommand = /* @__PURE__ */ __name((file, args) => normalizeArgs(file, args).join(" "), "joinCommand");
4644
+ var getEscapedCommand = /* @__PURE__ */ __name((file, args) => normalizeArgs(file, args).map((arg) => escapeArg(arg)).join(" "), "getEscapedCommand");
4645
+ var SPACES_REGEXP = / +/g;
4646
+ var parseCommand = /* @__PURE__ */ __name((command) => {
4647
+ const tokens = [];
4648
+ for (const token of command.trim().split(SPACES_REGEXP)) {
4649
+ const previousToken = tokens.at(-1);
4650
+ if (previousToken && previousToken.endsWith("\\")) {
4651
+ tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`;
4652
+ } else {
4653
+ tokens.push(token);
4654
+ }
4655
+ }
4656
+ return tokens;
4657
+ }, "parseCommand");
4658
+ var parseExpression = /* @__PURE__ */ __name((expression) => {
4659
+ const typeOfExpression = typeof expression;
4660
+ if (typeOfExpression === "string") {
4661
+ return expression;
4662
+ }
4663
+ if (typeOfExpression === "number") {
4664
+ return String(expression);
4665
+ }
4666
+ if (typeOfExpression === "object" && expression !== null && !(expression instanceof ChildProcess2) && "stdout" in expression) {
4667
+ const typeOfStdout = typeof expression.stdout;
4668
+ if (typeOfStdout === "string") {
4669
+ return expression.stdout;
4670
+ }
4671
+ if (Buffer2.isBuffer(expression.stdout)) {
4672
+ return expression.stdout.toString();
4673
+ }
4674
+ throw new TypeError(`Unexpected "${typeOfStdout}" stdout in template expression`);
4675
+ }
4676
+ throw new TypeError(`Unexpected "${typeOfExpression}" in template expression`);
4677
+ }, "parseExpression");
4678
+ var concatTokens = /* @__PURE__ */ __name((tokens, nextTokens, isNew) => isNew || tokens.length === 0 || nextTokens.length === 0 ? [...tokens, ...nextTokens] : [
4679
+ ...tokens.slice(0, -1),
4680
+ `${tokens.at(-1)}${nextTokens[0]}`,
4681
+ ...nextTokens.slice(1)
4682
+ ], "concatTokens");
4683
+ var parseTemplate = /* @__PURE__ */ __name(({ templates, expressions, tokens, index, template }) => {
4684
+ const templateString = template ?? templates.raw[index];
4685
+ const templateTokens = templateString.split(SPACES_REGEXP).filter(Boolean);
4686
+ const newTokens = concatTokens(
4687
+ tokens,
4688
+ templateTokens,
4689
+ templateString.startsWith(" ")
4690
+ );
4691
+ if (index === expressions.length) {
4692
+ return newTokens;
4693
+ }
4694
+ const expression = expressions[index];
4695
+ const expressionTokens = Array.isArray(expression) ? expression.map((expression2) => parseExpression(expression2)) : [parseExpression(expression)];
4696
+ return concatTokens(
4697
+ newTokens,
4698
+ expressionTokens,
4699
+ templateString.endsWith(" ")
4700
+ );
4701
+ }, "parseTemplate");
4702
+ var parseTemplates = /* @__PURE__ */ __name((templates, expressions) => {
4703
+ let tokens = [];
4704
+ for (const [index, template] of templates.entries()) {
4705
+ tokens = parseTemplate({ templates, expressions, tokens, index, template });
4706
+ }
4707
+ return tokens;
4708
+ }, "parseTemplates");
4709
+
4710
+ // node_modules/execa/lib/verbose.js
4711
+ import { debuglog } from "node:util";
4712
+ import process5 from "node:process";
4713
+ var verboseDefault = debuglog("execa").enabled;
4714
+ var padField = /* @__PURE__ */ __name((field, padding) => String(field).padStart(padding, "0"), "padField");
4715
+ var getTimestamp = /* @__PURE__ */ __name(() => {
4716
+ const date = /* @__PURE__ */ new Date();
4717
+ return `${padField(date.getHours(), 2)}:${padField(date.getMinutes(), 2)}:${padField(date.getSeconds(), 2)}.${padField(date.getMilliseconds(), 3)}`;
4718
+ }, "getTimestamp");
4719
+ var logCommand = /* @__PURE__ */ __name((escapedCommand, { verbose }) => {
4720
+ if (!verbose) {
4721
+ return;
4722
+ }
4723
+ process5.stderr.write(`[${getTimestamp()}] ${escapedCommand}
4724
+ `);
4725
+ }, "logCommand");
4726
+
4727
+ // node_modules/execa/index.js
4728
+ var DEFAULT_MAX_BUFFER = 1e3 * 1e3 * 100;
4729
+ var getEnv = /* @__PURE__ */ __name(({ env: envOption, extendEnv, preferLocal, localDir, execPath }) => {
4730
+ const env = extendEnv ? { ...process6.env, ...envOption } : envOption;
4731
+ if (preferLocal) {
4732
+ return npmRunPathEnv({ env, cwd: localDir, execPath });
4733
+ }
4734
+ return env;
4735
+ }, "getEnv");
4736
+ var handleArguments = /* @__PURE__ */ __name((file, args, options = {}) => {
4737
+ const parsed = import_cross_spawn.default._parse(file, args, options);
4738
+ file = parsed.command;
4739
+ args = parsed.args;
4740
+ options = parsed.options;
4741
+ options = {
4742
+ maxBuffer: DEFAULT_MAX_BUFFER,
4743
+ buffer: true,
4744
+ stripFinalNewline: true,
4745
+ extendEnv: true,
4746
+ preferLocal: false,
4747
+ localDir: options.cwd || process6.cwd(),
4748
+ execPath: process6.execPath,
4749
+ encoding: "utf8",
4750
+ reject: true,
4751
+ cleanup: true,
4752
+ all: false,
4753
+ windowsHide: true,
4754
+ verbose: verboseDefault,
4755
+ ...options
4756
+ };
4757
+ options.env = getEnv(options);
4758
+ options.stdio = normalizeStdio(options);
4759
+ if (process6.platform === "win32" && path3.basename(file, ".exe") === "cmd") {
4760
+ args.unshift("/q");
4761
+ }
4762
+ return { file, args, options, parsed };
4763
+ }, "handleArguments");
4764
+ var handleOutput = /* @__PURE__ */ __name((options, value, error) => {
4765
+ if (typeof value !== "string" && !Buffer3.isBuffer(value)) {
4766
+ return error === void 0 ? void 0 : "";
4767
+ }
4768
+ if (options.stripFinalNewline) {
4769
+ return stripFinalNewline(value);
4770
+ }
4771
+ return value;
4772
+ }, "handleOutput");
4773
+ function execa(file, args, options) {
4774
+ const parsed = handleArguments(file, args, options);
4775
+ const command = joinCommand(file, args);
4776
+ const escapedCommand = getEscapedCommand(file, args);
4777
+ logCommand(escapedCommand, parsed.options);
4778
+ validateTimeout(parsed.options);
4779
+ let spawned;
4780
+ try {
4781
+ spawned = childProcess.spawn(parsed.file, parsed.args, parsed.options);
4782
+ } catch (error) {
4783
+ const dummySpawned = new childProcess.ChildProcess();
4784
+ const errorPromise = Promise.reject(makeError({
4785
+ error,
4786
+ stdout: "",
4787
+ stderr: "",
4788
+ all: "",
4789
+ command,
4790
+ escapedCommand,
4791
+ parsed,
4792
+ timedOut: false,
4793
+ isCanceled: false,
4794
+ killed: false
4795
+ }));
4796
+ mergePromise(dummySpawned, errorPromise);
4797
+ return dummySpawned;
4798
+ }
4799
+ const spawnedPromise = getSpawnedPromise(spawned);
4800
+ const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise);
4801
+ const processDone = setExitHandler(spawned, parsed.options, timedPromise);
4802
+ const context = { isCanceled: false };
4803
+ spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned));
4804
+ spawned.cancel = spawnedCancel.bind(null, spawned, context);
4805
+ const handlePromise = /* @__PURE__ */ __name(async () => {
4806
+ const [{ error, exitCode, signal, timedOut }, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone);
4807
+ const stdout = handleOutput(parsed.options, stdoutResult);
4808
+ const stderr = handleOutput(parsed.options, stderrResult);
4809
+ const all = handleOutput(parsed.options, allResult);
4810
+ if (error || exitCode !== 0 || signal !== null) {
4811
+ const returnedError = makeError({
4812
+ error,
4813
+ exitCode,
4814
+ signal,
4815
+ stdout,
4816
+ stderr,
4817
+ all,
4818
+ command,
4819
+ escapedCommand,
4820
+ parsed,
4821
+ timedOut,
4822
+ isCanceled: context.isCanceled || (parsed.options.signal ? parsed.options.signal.aborted : false),
4823
+ killed: spawned.killed
4824
+ });
4825
+ if (!parsed.options.reject) {
4826
+ return returnedError;
4827
+ }
4828
+ throw returnedError;
4829
+ }
4830
+ return {
4831
+ command,
4832
+ escapedCommand,
4833
+ exitCode: 0,
4834
+ stdout,
4835
+ stderr,
4836
+ all,
4837
+ failed: false,
4838
+ timedOut: false,
4839
+ isCanceled: false,
4840
+ killed: false
4841
+ };
4842
+ }, "handlePromise");
4843
+ const handlePromiseOnce = onetime_default(handlePromise);
4844
+ handleInput(spawned, parsed.options);
4845
+ spawned.all = makeAllStream(spawned, parsed.options);
4846
+ addPipeMethods(spawned);
4847
+ mergePromise(spawned, handlePromiseOnce);
4848
+ return spawned;
4849
+ }
4850
+ __name(execa, "execa");
4851
+ function execaSync(file, args, options) {
4852
+ const parsed = handleArguments(file, args, options);
4853
+ const command = joinCommand(file, args);
4854
+ const escapedCommand = getEscapedCommand(file, args);
4855
+ logCommand(escapedCommand, parsed.options);
4856
+ const input = handleInputSync(parsed.options);
4857
+ let result;
4858
+ try {
4859
+ result = childProcess.spawnSync(parsed.file, parsed.args, { ...parsed.options, input });
4860
+ } catch (error) {
4861
+ throw makeError({
4862
+ error,
4863
+ stdout: "",
4864
+ stderr: "",
4865
+ all: "",
4866
+ command,
4867
+ escapedCommand,
4868
+ parsed,
4869
+ timedOut: false,
4870
+ isCanceled: false,
4871
+ killed: false
4872
+ });
4873
+ }
4874
+ const stdout = handleOutput(parsed.options, result.stdout, result.error);
4875
+ const stderr = handleOutput(parsed.options, result.stderr, result.error);
4876
+ if (result.error || result.status !== 0 || result.signal !== null) {
4877
+ const error = makeError({
4878
+ stdout,
4879
+ stderr,
4880
+ error: result.error,
4881
+ signal: result.signal,
4882
+ exitCode: result.status,
4883
+ command,
4884
+ escapedCommand,
4885
+ parsed,
4886
+ timedOut: result.error && result.error.code === "ETIMEDOUT",
4887
+ isCanceled: false,
4888
+ killed: result.signal !== null
4889
+ });
4890
+ if (!parsed.options.reject) {
4891
+ return error;
4892
+ }
4893
+ throw error;
4894
+ }
4895
+ return {
4896
+ command,
4897
+ escapedCommand,
4898
+ exitCode: 0,
4899
+ stdout,
4900
+ stderr,
4901
+ failed: false,
4902
+ timedOut: false,
4903
+ isCanceled: false,
4904
+ killed: false
4905
+ };
4906
+ }
4907
+ __name(execaSync, "execaSync");
4908
+ var normalizeScriptStdin = /* @__PURE__ */ __name(({ input, inputFile, stdio }) => input === void 0 && inputFile === void 0 && stdio === void 0 ? { stdin: "inherit" } : {}, "normalizeScriptStdin");
4909
+ var normalizeScriptOptions = /* @__PURE__ */ __name((options = {}) => ({
4910
+ preferLocal: true,
4911
+ ...normalizeScriptStdin(options),
4912
+ ...options
4913
+ }), "normalizeScriptOptions");
4914
+ function create$(options) {
4915
+ function $2(templatesOrOptions, ...expressions) {
4916
+ if (!Array.isArray(templatesOrOptions)) {
4917
+ return create$({ ...options, ...templatesOrOptions });
4918
+ }
4919
+ const [file, ...args] = parseTemplates(templatesOrOptions, expressions);
4920
+ return execa(file, args, normalizeScriptOptions(options));
4921
+ }
4922
+ __name($2, "$");
4923
+ $2.sync = (templates, ...expressions) => {
4924
+ if (!Array.isArray(templates)) {
4925
+ throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");
4926
+ }
4927
+ const [file, ...args] = parseTemplates(templates, expressions);
4928
+ return execaSync(file, args, normalizeScriptOptions(options));
4929
+ };
4930
+ return $2;
4931
+ }
4932
+ __name(create$, "create$");
4933
+ var $ = create$();
4934
+ function execaCommand(command, options) {
4935
+ const [file, ...args] = parseCommand(command);
4936
+ return execa(file, args, options);
4937
+ }
4938
+ __name(execaCommand, "execaCommand");
4939
+ function execaCommandSync(command, options) {
4940
+ const [file, ...args] = parseCommand(command);
4941
+ return execaSync(file, args, options);
4942
+ }
4943
+ __name(execaCommandSync, "execaCommandSync");
4944
+
4945
+ export {
4946
+ NPM_LOCKFILE,
4947
+ PNPM_LOCKFILE,
4948
+ YARN_LOCKFILE,
4949
+ BUN_LOCKFILE,
4950
+ BUN_LOCKFILE_BINARY,
4951
+ getProjectRoot,
4952
+ invalidateProjectRootCache,
4953
+ findFilesUp,
4954
+ nodePathsToArray,
4955
+ normalizeStoryPath,
4956
+ loadEnvs,
4957
+ stringifyEnvs,
4958
+ stringifyProcessEnvs,
4959
+ optionalEnvToBoolean,
4960
+ isCI,
4961
+ require_cross_spawn,
4962
+ execa,
4963
+ execaSync,
4964
+ execaCommand,
4965
+ execaCommandSync
4966
+ };