storybook 10.1.6 → 10.1.7

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 (58) hide show
  1. package/dist/_node-chunks/{builder-manager-IP6Y4NMN.js → builder-manager-EHXLCHEO.js} +12 -12
  2. package/dist/_node-chunks/{camelcase-GHUGWSTC.js → camelcase-HUGZEXJE.js} +7 -7
  3. package/dist/_node-chunks/{chunk-YKVDPPMP.js → chunk-53EBCYFK.js} +6 -6
  4. package/dist/_node-chunks/{chunk-OIIAKMWN.js → chunk-54YSFB4H.js} +7 -7
  5. package/dist/_node-chunks/{chunk-FZPYAEAL.js → chunk-73HUTZ5T.js} +7 -7
  6. package/dist/_node-chunks/{chunk-QAHNTAID.js → chunk-AHASM5XJ.js} +6 -6
  7. package/dist/_node-chunks/{chunk-LJZQUQY3.js → chunk-BISROKGA.js} +7 -7
  8. package/dist/_node-chunks/{chunk-6IODXQ5I.js → chunk-BW4TJAUQ.js} +6 -6
  9. package/dist/_node-chunks/{chunk-T4NL27CC.js → chunk-DEZK7IC2.js} +20 -20
  10. package/dist/_node-chunks/chunk-EMGZAS45.js +23 -0
  11. package/dist/_node-chunks/{chunk-KPTRKV7Y.js → chunk-ESCHL7QO.js} +8 -8
  12. package/dist/_node-chunks/{chunk-BV46V7UA.js → chunk-H5UMVQS5.js} +13 -13
  13. package/dist/_node-chunks/{chunk-MTQLLXLU.js → chunk-HKD3GHK3.js} +9 -9
  14. package/dist/_node-chunks/{chunk-NDRJR464.js → chunk-IFLLI53E.js} +10 -10
  15. package/dist/_node-chunks/{chunk-4E7PJV6F.js → chunk-JRNN3ATQ.js} +6 -6
  16. package/dist/_node-chunks/{chunk-IIIZ5MXT.js → chunk-JU44GIHO.js} +13 -13
  17. package/dist/_node-chunks/{chunk-7SZ6I5FR.js → chunk-M25PLVWJ.js} +76 -19
  18. package/dist/_node-chunks/{chunk-MBCK5AH4.js → chunk-PFZ3OEEN.js} +6 -6
  19. package/dist/_node-chunks/chunk-R2CXAJYG.js +18 -0
  20. package/dist/_node-chunks/{chunk-2LMXIXHU.js → chunk-SMIB2SPY.js} +6 -6
  21. package/dist/_node-chunks/{chunk-ZZGFJUT5.js → chunk-TPDTDPSP.js} +6 -6
  22. package/dist/_node-chunks/{chunk-M4UXZ375.js → chunk-U4FRSSGR.js} +7 -7
  23. package/dist/_node-chunks/{chunk-CQ7X72BT.js → chunk-VE2GP7PV.js} +7 -7
  24. package/dist/_node-chunks/chunk-W65P47D7.js +61 -0
  25. package/dist/_node-chunks/{chunk-MZPY44R3.js → chunk-XLHRIY7O.js} +7 -7
  26. package/dist/_node-chunks/{chunk-32COQDL3.js → chunk-XUGGNSQV.js} +7 -7
  27. package/dist/_node-chunks/{chunk-WIXJW6LA.js → chunk-ZER2HR4Q.js} +7 -7
  28. package/dist/_node-chunks/{chunk-6X7LVWWF.js → chunk-ZQ4AATPT.js} +9 -9
  29. package/dist/_node-chunks/{chunk-V4R3AYR4.js → chunk-ZRQQOUXA.js} +8 -8
  30. package/dist/_node-chunks/{dist-N6JBF72Y.js → dist-I5B62EXZ.js} +9 -9
  31. package/dist/_node-chunks/{globby-EBHKFBTA.js → globby-VVFDARVQ.js} +9 -9
  32. package/dist/_node-chunks/{lib-VKFW2NW5.js → lib-YVG6LAMI.js} +7 -7
  33. package/dist/_node-chunks/{mdx-N42X6CFJ-GUFWY7P5.js → mdx-N42X6CFJ-7PJHUHEH.js} +8 -8
  34. package/dist/_node-chunks/{p-limit-5QMUSCN6.js → p-limit-IZNWVCKJ.js} +7 -7
  35. package/dist/babel/index.js +10 -10
  36. package/dist/bin/core.js +12 -12
  37. package/dist/bin/dispatcher.js +11 -11
  38. package/dist/bin/loader.js +9 -9
  39. package/dist/cli/index.d.ts +0 -1
  40. package/dist/cli/index.js +18 -18
  41. package/dist/common/index.js +19 -19
  42. package/dist/core-server/index.js +257 -631
  43. package/dist/core-server/presets/common-override-preset.js +9 -9
  44. package/dist/core-server/presets/common-preset.js +26 -28
  45. package/dist/csf-tools/index.js +9 -9
  46. package/dist/manager/globals-runtime.js +1 -1
  47. package/dist/manager-api/index.js +1 -1
  48. package/dist/mocking-utils/index.js +8 -8
  49. package/dist/node-logger/index.js +9 -9
  50. package/dist/preview-api/index.d.ts +68 -67
  51. package/dist/server-errors.js +11 -11
  52. package/dist/telemetry/index.d.ts +9 -2
  53. package/dist/telemetry/index.js +27 -25
  54. package/package.json +2 -2
  55. package/dist/_node-chunks/chunk-5AYMJEEI.js +0 -23
  56. package/dist/_node-chunks/chunk-IMSWW5XU.js +0 -72
  57. package/dist/_node-chunks/chunk-PUOD3HAQ.js +0 -18
  58. package/dist/_node-chunks/chunk-ZQTC4IMW.js +0 -61
@@ -1,17 +1,17 @@
1
- import CJS_COMPAT_NODE_URL_u12tm8drdom from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_u12tm8drdom from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_u12tm8drdom from "node:module";
1
+ import CJS_COMPAT_NODE_URL_hei8jvah5rp from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_hei8jvah5rp from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_hei8jvah5rp from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_u12tm8drdom.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_u12tm8drdom.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_u12tm8drdom.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_hei8jvah5rp.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_hei8jvah5rp.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_hei8jvah5rp.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
11
  // ------------------------------------------------------------
12
12
  import {
13
13
  StatusTypeIdMismatchError
14
- } from "../_node-chunks/chunk-NDRJR464.js";
14
+ } from "../_node-chunks/chunk-IFLLI53E.js";
15
15
  import {
16
16
  debounce,
17
17
  getErrorLevel,
@@ -21,66 +21,65 @@ import {
21
21
  sendTelemetryError,
22
22
  useStatics,
23
23
  withTelemetry
24
- } from "../_node-chunks/chunk-BV46V7UA.js";
25
- import "../_node-chunks/chunk-OIIAKMWN.js";
24
+ } from "../_node-chunks/chunk-H5UMVQS5.js";
25
+ import "../_node-chunks/chunk-54YSFB4H.js";
26
26
  import {
27
27
  detectPnp
28
- } from "../_node-chunks/chunk-5AYMJEEI.js";
28
+ } from "../_node-chunks/chunk-EMGZAS45.js";
29
29
  import {
30
30
  StorybookError
31
- } from "../_node-chunks/chunk-4E7PJV6F.js";
31
+ } from "../_node-chunks/chunk-JRNN3ATQ.js";
32
32
  import {
33
33
  telemetry
34
- } from "../_node-chunks/chunk-7SZ6I5FR.js";
35
- import "../_node-chunks/chunk-PUOD3HAQ.js";
34
+ } from "../_node-chunks/chunk-M25PLVWJ.js";
35
+ import "../_node-chunks/chunk-R2CXAJYG.js";
36
36
  import {
37
37
  optionalEnvToBoolean,
38
38
  require_cross_spawn,
39
39
  resolveImport,
40
40
  supportedExtensions,
41
41
  userOrAutoTitleFromSpecifier
42
- } from "../_node-chunks/chunk-T4NL27CC.js";
43
- import "../_node-chunks/chunk-ZQTC4IMW.js";
44
- import "../_node-chunks/chunk-WIXJW6LA.js";
42
+ } from "../_node-chunks/chunk-DEZK7IC2.js";
43
+ import "../_node-chunks/chunk-W65P47D7.js";
44
+ import "../_node-chunks/chunk-ZER2HR4Q.js";
45
45
  import {
46
46
  require_pretty_hrtime
47
- } from "../_node-chunks/chunk-V4R3AYR4.js";
48
- import "../_node-chunks/chunk-IMSWW5XU.js";
49
- import "../_node-chunks/chunk-6X7LVWWF.js";
47
+ } from "../_node-chunks/chunk-ZRQQOUXA.js";
48
+ import "../_node-chunks/chunk-ZQ4AATPT.js";
50
49
  import {
51
50
  invariant,
52
51
  up2 as up
53
- } from "../_node-chunks/chunk-ZZGFJUT5.js";
52
+ } from "../_node-chunks/chunk-TPDTDPSP.js";
54
53
  import {
55
54
  importModule,
56
55
  resolvePackageDir
57
- } from "../_node-chunks/chunk-MZPY44R3.js";
58
- import "../_node-chunks/chunk-QAHNTAID.js";
56
+ } from "../_node-chunks/chunk-XLHRIY7O.js";
57
+ import "../_node-chunks/chunk-AHASM5XJ.js";
59
58
  import {
60
59
  dirname,
61
60
  join,
62
61
  relative,
63
62
  resolve
64
- } from "../_node-chunks/chunk-MBCK5AH4.js";
65
- import "../_node-chunks/chunk-M4UXZ375.js";
63
+ } from "../_node-chunks/chunk-PFZ3OEEN.js";
64
+ import "../_node-chunks/chunk-U4FRSSGR.js";
66
65
  import {
67
66
  slash
68
- } from "../_node-chunks/chunk-2LMXIXHU.js";
67
+ } from "../_node-chunks/chunk-SMIB2SPY.js";
69
68
  import {
70
69
  require_dist
71
- } from "../_node-chunks/chunk-CQ7X72BT.js";
70
+ } from "../_node-chunks/chunk-VE2GP7PV.js";
72
71
  import {
73
72
  require_lib,
74
73
  require_src
75
- } from "../_node-chunks/chunk-32COQDL3.js";
74
+ } from "../_node-chunks/chunk-XUGGNSQV.js";
76
75
  import {
77
76
  require_picocolors
78
- } from "../_node-chunks/chunk-FZPYAEAL.js";
77
+ } from "../_node-chunks/chunk-73HUTZ5T.js";
79
78
  import {
80
79
  __commonJS,
81
80
  __require,
82
81
  __toESM
83
- } from "../_node-chunks/chunk-YKVDPPMP.js";
82
+ } from "../_node-chunks/chunk-53EBCYFK.js";
84
83
 
85
84
  // ../node_modules/tsconfig-paths/lib/filesystem.js
86
85
  var require_filesystem = __commonJS({
@@ -88,12 +87,12 @@ var require_filesystem = __commonJS({
88
87
  "use strict";
89
88
  Object.defineProperty(exports, "__esModule", { value: !0 });
90
89
  exports.removeExtension = exports.fileExistsAsync = exports.readJsonFromDiskAsync = exports.readJsonFromDiskSync = exports.fileExistsSync = void 0;
91
- var fs6 = __require("fs");
92
- function fileExistsSync(path3) {
93
- if (!fs6.existsSync(path3))
90
+ var fs = __require("fs");
91
+ function fileExistsSync(path2) {
92
+ if (!fs.existsSync(path2))
94
93
  return !1;
95
94
  try {
96
- var stats = fs6.statSync(path3);
95
+ var stats = fs.statSync(path2);
97
96
  return stats.isFile();
98
97
  } catch {
99
98
  return !1;
@@ -101,12 +100,12 @@ var require_filesystem = __commonJS({
101
100
  }
102
101
  exports.fileExistsSync = fileExistsSync;
103
102
  function readJsonFromDiskSync(packageJsonPath) {
104
- if (fs6.existsSync(packageJsonPath))
103
+ if (fs.existsSync(packageJsonPath))
105
104
  return __require(packageJsonPath);
106
105
  }
107
106
  exports.readJsonFromDiskSync = readJsonFromDiskSync;
108
- function readJsonFromDiskAsync(path3, callback) {
109
- fs6.readFile(path3, "utf8", function(err, result) {
107
+ function readJsonFromDiskAsync(path2, callback) {
108
+ fs.readFile(path2, "utf8", function(err, result) {
110
109
  if (err || !result)
111
110
  return callback();
112
111
  var json = JSON.parse(result);
@@ -114,16 +113,16 @@ var require_filesystem = __commonJS({
114
113
  });
115
114
  }
116
115
  exports.readJsonFromDiskAsync = readJsonFromDiskAsync;
117
- function fileExistsAsync(path22, callback2) {
118
- fs6.stat(path22, function(err, stats) {
116
+ function fileExistsAsync(path2, callback2) {
117
+ fs.stat(path2, function(err, stats) {
119
118
  if (err)
120
119
  return callback2(void 0, !1);
121
120
  callback2(void 0, stats ? stats.isFile() : !1);
122
121
  });
123
122
  }
124
123
  exports.fileExistsAsync = fileExistsAsync;
125
- function removeExtension(path3) {
126
- return path3.substring(0, path3.lastIndexOf(".")) || path3;
124
+ function removeExtension(path2) {
125
+ return path2.substring(0, path2.lastIndexOf(".")) || path2;
127
126
  }
128
127
  exports.removeExtension = removeExtension;
129
128
  }
@@ -135,14 +134,14 @@ var require_mapping_entry = __commonJS({
135
134
  "use strict";
136
135
  Object.defineProperty(exports, "__esModule", { value: !0 });
137
136
  exports.getAbsoluteMappingEntries = void 0;
138
- var path3 = __require("path");
137
+ var path2 = __require("path");
139
138
  function getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll) {
140
139
  for (var sortedKeys = sortByLongestPrefix(Object.keys(paths)), absolutePaths = [], _i = 0, sortedKeys_1 = sortedKeys; _i < sortedKeys_1.length; _i++) {
141
140
  var key = sortedKeys_1[_i];
142
141
  absolutePaths.push({
143
142
  pattern: key,
144
143
  paths: paths[key].map(function(pathToResolve) {
145
- return path3.resolve(absoluteBaseUrl, pathToResolve);
144
+ return path2.resolve(absoluteBaseUrl, pathToResolve);
146
145
  })
147
146
  });
148
147
  }
@@ -170,7 +169,7 @@ var require_try_path = __commonJS({
170
169
  "use strict";
171
170
  Object.defineProperty(exports, "__esModule", { value: !0 });
172
171
  exports.exhaustiveTypeException = exports.getStrippedPath = exports.getPathsToTry = void 0;
173
- var path3 = __require("path"), path_1 = __require("path"), filesystem_1 = require_filesystem();
172
+ var path2 = __require("path"), path_1 = __require("path"), filesystem_1 = require_filesystem();
174
173
  function getPathsToTry(extensions, absolutePathMappings, requestedModule) {
175
174
  if (!(!absolutePathMappings || !requestedModule || requestedModule[0] === ".")) {
176
175
  for (var pathsToTry = [], _i = 0, absolutePathMappings_1 = absolutePathMappings; _i < absolutePathMappings_1.length; _i++) {
@@ -182,9 +181,9 @@ var require_try_path = __commonJS({
182
181
  return { type: "extension", path: physicalPath + e };
183
182
  })), pathsToTry.push({
184
183
  type: "package",
185
- path: path3.join(physicalPath, "/package.json")
184
+ path: path2.join(physicalPath, "/package.json")
186
185
  });
187
- var indexPath = path3.join(physicalPath, "/index");
186
+ var indexPath = path2.join(physicalPath, "/index");
188
187
  pathsToTry.push.apply(pathsToTry, extensions.map(function(e) {
189
188
  return { type: "index", path: indexPath + e };
190
189
  }));
@@ -226,7 +225,7 @@ var require_match_path_sync = __commonJS({
226
225
  "use strict";
227
226
  Object.defineProperty(exports, "__esModule", { value: !0 });
228
227
  exports.matchFromAbsolutePaths = exports.createMatchPath = void 0;
229
- var path3 = __require("path"), Filesystem = require_filesystem(), MappingEntry = require_mapping_entry(), TryPath = require_try_path();
228
+ var path2 = __require("path"), Filesystem = require_filesystem(), MappingEntry = require_mapping_entry(), TryPath = require_try_path();
230
229
  function createMatchPath2(absoluteBaseUrl, paths, mainFields, addMatchAll) {
231
230
  mainFields === void 0 && (mainFields = ["main"]), addMatchAll === void 0 && (addMatchAll = !0);
232
231
  var absolutePaths = MappingEntry.getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll);
@@ -248,7 +247,7 @@ var require_match_path_sync = __commonJS({
248
247
  return obj[key];
249
248
  }, packageJson);
250
249
  if (candidateMapping && typeof candidateMapping == "string") {
251
- var candidateFilePath = path3.join(path3.dirname(packageJsonPath), candidateMapping);
250
+ var candidateFilePath = path2.join(path2.dirname(packageJsonPath), candidateMapping);
252
251
  if (fileExists2(candidateFilePath))
253
252
  return candidateFilePath;
254
253
  }
@@ -281,7 +280,7 @@ var require_match_path_async = __commonJS({
281
280
  "use strict";
282
281
  Object.defineProperty(exports, "__esModule", { value: !0 });
283
282
  exports.matchFromAbsolutePathsAsync = exports.createMatchPathAsync = void 0;
284
- var path3 = __require("path"), TryPath = require_try_path(), MappingEntry = require_mapping_entry(), Filesystem = require_filesystem();
283
+ var path2 = __require("path"), TryPath = require_try_path(), MappingEntry = require_mapping_entry(), Filesystem = require_filesystem();
285
284
  function createMatchPathAsync(absoluteBaseUrl, paths, mainFields, addMatchAll) {
286
285
  mainFields === void 0 && (mainFields = ["main"]), addMatchAll === void 0 && (addMatchAll = !0);
287
286
  var absolutePaths = MappingEntry.getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll);
@@ -308,7 +307,7 @@ var require_match_path_async = __commonJS({
308
307
  }, packageJson);
309
308
  if (typeof mainFieldMapping != "string")
310
309
  return tryNext();
311
- var mappedFilePath = path3.join(path3.dirname(packageJsonPath), mainFieldMapping);
310
+ var mappedFilePath = path2.join(path2.dirname(packageJsonPath), mainFieldMapping);
312
311
  fileExistsAsync(mappedFilePath, function(err, exists) {
313
312
  return err ? doneCallback(err) : exists ? doneCallback(void 0, mappedFilePath) : tryNext();
314
313
  });
@@ -354,7 +353,7 @@ var require_tsconfig_loader = __commonJS({
354
353
  };
355
354
  Object.defineProperty(exports, "__esModule", { value: !0 });
356
355
  exports.loadTsconfig = exports.walkForTsConfig = exports.tsConfigLoader = void 0;
357
- var path3 = __require("path"), fs6 = __require("fs"), JSON5 = require_lib(), StripBom = require_strip_bom();
356
+ var path2 = __require("path"), fs = __require("fs"), JSON5 = require_lib(), StripBom = require_strip_bom();
358
357
  function tsConfigLoader(_a) {
359
358
  var getEnv = _a.getEnv, cwd = _a.cwd, _b = _a.loadSync, loadSync = _b === void 0 ? loadSyncDefault : _b, TS_NODE_PROJECT = getEnv("TS_NODE_PROJECT"), TS_NODE_BASEURL = getEnv("TS_NODE_BASEURL"), loadResult = loadSync(cwd, TS_NODE_PROJECT, TS_NODE_BASEURL);
360
359
  return loadResult;
@@ -377,29 +376,29 @@ var require_tsconfig_loader = __commonJS({
377
376
  }
378
377
  function resolveConfigPath(cwd, filename) {
379
378
  if (filename) {
380
- var absolutePath = fs6.lstatSync(filename).isDirectory() ? path3.resolve(filename, "./tsconfig.json") : path3.resolve(cwd, filename);
379
+ var absolutePath = fs.lstatSync(filename).isDirectory() ? path2.resolve(filename, "./tsconfig.json") : path2.resolve(cwd, filename);
381
380
  return absolutePath;
382
381
  }
383
- if (fs6.statSync(cwd).isFile())
384
- return path3.resolve(cwd);
382
+ if (fs.statSync(cwd).isFile())
383
+ return path2.resolve(cwd);
385
384
  var configAbsolutePath = walkForTsConfig(cwd);
386
- return configAbsolutePath ? path3.resolve(configAbsolutePath) : void 0;
385
+ return configAbsolutePath ? path2.resolve(configAbsolutePath) : void 0;
387
386
  }
388
387
  function walkForTsConfig(directory, readdirSync2) {
389
- readdirSync2 === void 0 && (readdirSync2 = fs6.readdirSync);
388
+ readdirSync2 === void 0 && (readdirSync2 = fs.readdirSync);
390
389
  for (var files = readdirSync2(directory), filesToCheck = ["tsconfig.json", "jsconfig.json"], _i = 0, filesToCheck_1 = filesToCheck; _i < filesToCheck_1.length; _i++) {
391
390
  var fileToCheck = filesToCheck_1[_i];
392
391
  if (files.indexOf(fileToCheck) !== -1)
393
- return path3.join(directory, fileToCheck);
392
+ return path2.join(directory, fileToCheck);
394
393
  }
395
- var parentDirectory = path3.dirname(directory);
394
+ var parentDirectory = path2.dirname(directory);
396
395
  if (directory !== parentDirectory)
397
396
  return walkForTsConfig(parentDirectory, readdirSync2);
398
397
  }
399
398
  exports.walkForTsConfig = walkForTsConfig;
400
399
  function loadTsconfig(configFilePath, existsSync3, readFileSync) {
401
- if (existsSync3 === void 0 && (existsSync3 = fs6.existsSync), readFileSync === void 0 && (readFileSync = function(filename) {
402
- return fs6.readFileSync(filename, "utf8");
400
+ if (existsSync3 === void 0 && (existsSync3 = fs.existsSync), readFileSync === void 0 && (readFileSync = function(filename) {
401
+ return fs.readFileSync(filename, "utf8");
403
402
  }), !!existsSync3(configFilePath)) {
404
403
  var configString = readFileSync(configFilePath), cleanedJson = StripBom(configString), config;
405
404
  try {
@@ -421,12 +420,12 @@ var require_tsconfig_loader = __commonJS({
421
420
  function loadTsconfigFromExtends(configFilePath, extendedConfigValue, existsSync3, readFileSync) {
422
421
  var _a;
423
422
  typeof extendedConfigValue == "string" && extendedConfigValue.indexOf(".json") === -1 && (extendedConfigValue += ".json");
424
- var currentDir = path3.dirname(configFilePath), extendedConfigPath = path3.join(currentDir, extendedConfigValue);
425
- extendedConfigValue.indexOf("/") !== -1 && extendedConfigValue.indexOf(".") !== -1 && !existsSync3(extendedConfigPath) && (extendedConfigPath = path3.join(currentDir, "node_modules", extendedConfigValue));
423
+ var currentDir = path2.dirname(configFilePath), extendedConfigPath = path2.join(currentDir, extendedConfigValue);
424
+ extendedConfigValue.indexOf("/") !== -1 && extendedConfigValue.indexOf(".") !== -1 && !existsSync3(extendedConfigPath) && (extendedConfigPath = path2.join(currentDir, "node_modules", extendedConfigValue));
426
425
  var config = loadTsconfig(extendedConfigPath, existsSync3, readFileSync) || {};
427
426
  if (!((_a = config.compilerOptions) === null || _a === void 0) && _a.baseUrl) {
428
- var extendsDir = path3.dirname(extendedConfigValue);
429
- config.compilerOptions.baseUrl = path3.join(extendsDir, config.compilerOptions.baseUrl);
427
+ var extendsDir = path2.dirname(extendedConfigValue);
428
+ config.compilerOptions.baseUrl = path2.join(extendsDir, config.compilerOptions.baseUrl);
430
429
  }
431
430
  return config;
432
431
  }
@@ -442,7 +441,7 @@ var require_config_loader = __commonJS({
442
441
  "use strict";
443
442
  Object.defineProperty(exports, "__esModule", { value: !0 });
444
443
  exports.configLoader = exports.loadConfig = void 0;
445
- var TsConfigLoader2 = require_tsconfig_loader(), path3 = __require("path");
444
+ var TsConfigLoader2 = require_tsconfig_loader(), path2 = __require("path");
446
445
  function loadConfig3(cwd) {
447
446
  return cwd === void 0 && (cwd = process.cwd()), configLoader({ cwd });
448
447
  }
@@ -450,7 +449,7 @@ var require_config_loader = __commonJS({
450
449
  function configLoader(_a) {
451
450
  var cwd = _a.cwd, explicitParams = _a.explicitParams, _b = _a.tsConfigLoader, tsConfigLoader = _b === void 0 ? TsConfigLoader2.tsConfigLoader : _b;
452
451
  if (explicitParams) {
453
- var absoluteBaseUrl = path3.isAbsolute(explicitParams.baseUrl) ? explicitParams.baseUrl : path3.join(cwd, explicitParams.baseUrl);
452
+ var absoluteBaseUrl = path2.isAbsolute(explicitParams.baseUrl) ? explicitParams.baseUrl : path2.join(cwd, explicitParams.baseUrl);
454
453
  return {
455
454
  resultType: "success",
456
455
  configFileAbsolutePath: "",
@@ -471,7 +470,7 @@ var require_config_loader = __commonJS({
471
470
  resultType: "success",
472
471
  configFileAbsolutePath: loadResult.tsConfigPath,
473
472
  baseUrl: loadResult.baseUrl,
474
- absoluteBaseUrl: path3.resolve(path3.dirname(loadResult.tsConfigPath), loadResult.baseUrl || ""),
473
+ absoluteBaseUrl: path2.resolve(path2.dirname(loadResult.tsConfigPath), loadResult.baseUrl || ""),
475
474
  paths: loadResult.paths || {},
476
475
  addMatchAll: loadResult.baseUrl !== void 0
477
476
  } : {
@@ -1400,7 +1399,7 @@ var require_src2 = __commonJS({
1400
1399
  // ../node_modules/graceful-fs/polyfills.js
1401
1400
  var require_polyfills = __commonJS({
1402
1401
  "../node_modules/graceful-fs/polyfills.js"(exports, module) {
1403
- var constants = __require("constants"), origCwd = process.cwd, cwd = null, platform2 = process.env.GRACEFUL_FS_PLATFORM || process.platform;
1402
+ var constants = __require("constants"), origCwd = process.cwd, cwd = null, platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
1404
1403
  process.cwd = function() {
1405
1404
  return cwd || (cwd = origCwd.call(process)), cwd;
1406
1405
  };
@@ -1413,20 +1412,20 @@ var require_polyfills = __commonJS({
1413
1412
  }, Object.setPrototypeOf && Object.setPrototypeOf(process.chdir, chdir));
1414
1413
  var chdir;
1415
1414
  module.exports = patch;
1416
- function patch(fs6) {
1417
- constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./) && patchLchmod(fs6), fs6.lutimes || patchLutimes(fs6), fs6.chown = chownFix(fs6.chown), fs6.fchown = chownFix(fs6.fchown), fs6.lchown = chownFix(fs6.lchown), fs6.chmod = chmodFix(fs6.chmod), fs6.fchmod = chmodFix(fs6.fchmod), fs6.lchmod = chmodFix(fs6.lchmod), fs6.chownSync = chownFixSync(fs6.chownSync), fs6.fchownSync = chownFixSync(fs6.fchownSync), fs6.lchownSync = chownFixSync(fs6.lchownSync), fs6.chmodSync = chmodFixSync(fs6.chmodSync), fs6.fchmodSync = chmodFixSync(fs6.fchmodSync), fs6.lchmodSync = chmodFixSync(fs6.lchmodSync), fs6.stat = statFix(fs6.stat), fs6.fstat = statFix(fs6.fstat), fs6.lstat = statFix(fs6.lstat), fs6.statSync = statFixSync(fs6.statSync), fs6.fstatSync = statFixSync(fs6.fstatSync), fs6.lstatSync = statFixSync(fs6.lstatSync), fs6.chmod && !fs6.lchmod && (fs6.lchmod = function(path3, mode, cb) {
1415
+ function patch(fs) {
1416
+ constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./) && patchLchmod(fs), fs.lutimes || patchLutimes(fs), fs.chown = chownFix(fs.chown), fs.fchown = chownFix(fs.fchown), fs.lchown = chownFix(fs.lchown), fs.chmod = chmodFix(fs.chmod), fs.fchmod = chmodFix(fs.fchmod), fs.lchmod = chmodFix(fs.lchmod), fs.chownSync = chownFixSync(fs.chownSync), fs.fchownSync = chownFixSync(fs.fchownSync), fs.lchownSync = chownFixSync(fs.lchownSync), fs.chmodSync = chmodFixSync(fs.chmodSync), fs.fchmodSync = chmodFixSync(fs.fchmodSync), fs.lchmodSync = chmodFixSync(fs.lchmodSync), fs.stat = statFix(fs.stat), fs.fstat = statFix(fs.fstat), fs.lstat = statFix(fs.lstat), fs.statSync = statFixSync(fs.statSync), fs.fstatSync = statFixSync(fs.fstatSync), fs.lstatSync = statFixSync(fs.lstatSync), fs.chmod && !fs.lchmod && (fs.lchmod = function(path2, mode, cb) {
1418
1417
  cb && process.nextTick(cb);
1419
- }, fs6.lchmodSync = function() {
1420
- }), fs6.chown && !fs6.lchown && (fs6.lchown = function(path3, uid, gid, cb) {
1418
+ }, fs.lchmodSync = function() {
1419
+ }), fs.chown && !fs.lchown && (fs.lchown = function(path2, uid, gid, cb) {
1421
1420
  cb && process.nextTick(cb);
1422
- }, fs6.lchownSync = function() {
1423
- }), platform2 === "win32" && (fs6.rename = typeof fs6.rename != "function" ? fs6.rename : (function(fs$rename) {
1421
+ }, fs.lchownSync = function() {
1422
+ }), platform === "win32" && (fs.rename = typeof fs.rename != "function" ? fs.rename : (function(fs$rename) {
1424
1423
  function rename(from, to, cb) {
1425
1424
  var start = Date.now(), backoff = 0;
1426
1425
  fs$rename(from, to, function CB(er) {
1427
1426
  if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
1428
1427
  setTimeout(function() {
1429
- fs6.stat(to, function(stater, st) {
1428
+ fs.stat(to, function(stater, st) {
1430
1429
  stater && stater.code === "ENOENT" ? fs$rename(from, to, CB) : cb(er);
1431
1430
  });
1432
1431
  }, backoff), backoff < 100 && (backoff += 10);
@@ -1436,25 +1435,25 @@ var require_polyfills = __commonJS({
1436
1435
  });
1437
1436
  }
1438
1437
  return Object.setPrototypeOf && Object.setPrototypeOf(rename, fs$rename), rename;
1439
- })(fs6.rename)), fs6.read = typeof fs6.read != "function" ? fs6.read : (function(fs$read) {
1438
+ })(fs.rename)), fs.read = typeof fs.read != "function" ? fs.read : (function(fs$read) {
1440
1439
  function read(fd, buffer, offset, length, position, callback_) {
1441
1440
  var callback;
1442
1441
  if (callback_ && typeof callback_ == "function") {
1443
1442
  var eagCounter = 0;
1444
1443
  callback = function(er, _, __) {
1445
1444
  if (er && er.code === "EAGAIN" && eagCounter < 10)
1446
- return eagCounter++, fs$read.call(fs6, fd, buffer, offset, length, position, callback);
1445
+ return eagCounter++, fs$read.call(fs, fd, buffer, offset, length, position, callback);
1447
1446
  callback_.apply(this, arguments);
1448
1447
  };
1449
1448
  }
1450
- return fs$read.call(fs6, fd, buffer, offset, length, position, callback);
1449
+ return fs$read.call(fs, fd, buffer, offset, length, position, callback);
1451
1450
  }
1452
1451
  return Object.setPrototypeOf && Object.setPrototypeOf(read, fs$read), read;
1453
- })(fs6.read), fs6.readSync = typeof fs6.readSync != "function" ? fs6.readSync : /* @__PURE__ */ (function(fs$readSync) {
1452
+ })(fs.read), fs.readSync = typeof fs.readSync != "function" ? fs.readSync : /* @__PURE__ */ (function(fs$readSync) {
1454
1453
  return function(fd, buffer, offset, length, position) {
1455
1454
  for (var eagCounter = 0; ; )
1456
1455
  try {
1457
- return fs$readSync.call(fs6, fd, buffer, offset, length, position);
1456
+ return fs$readSync.call(fs, fd, buffer, offset, length, position);
1458
1457
  } catch (er) {
1459
1458
  if (er.code === "EAGAIN" && eagCounter < 10) {
1460
1459
  eagCounter++;
@@ -1463,11 +1462,11 @@ var require_polyfills = __commonJS({
1463
1462
  throw er;
1464
1463
  }
1465
1464
  };
1466
- })(fs6.readSync);
1467
- function patchLchmod(fs7) {
1468
- fs7.lchmod = function(path3, mode, callback) {
1469
- fs7.open(
1470
- path3,
1465
+ })(fs.readSync);
1466
+ function patchLchmod(fs2) {
1467
+ fs2.lchmod = function(path2, mode, callback) {
1468
+ fs2.open(
1469
+ path2,
1471
1470
  constants.O_WRONLY | constants.O_SYMLINK,
1472
1471
  mode,
1473
1472
  function(err, fd) {
@@ -1475,64 +1474,64 @@ var require_polyfills = __commonJS({
1475
1474
  callback && callback(err);
1476
1475
  return;
1477
1476
  }
1478
- fs7.fchmod(fd, mode, function(err2) {
1479
- fs7.close(fd, function(err22) {
1477
+ fs2.fchmod(fd, mode, function(err2) {
1478
+ fs2.close(fd, function(err22) {
1480
1479
  callback && callback(err2 || err22);
1481
1480
  });
1482
1481
  });
1483
1482
  }
1484
1483
  );
1485
- }, fs7.lchmodSync = function(path3, mode) {
1486
- var fd = fs7.openSync(path3, constants.O_WRONLY | constants.O_SYMLINK, mode), threw = !0, ret;
1484
+ }, fs2.lchmodSync = function(path2, mode) {
1485
+ var fd = fs2.openSync(path2, constants.O_WRONLY | constants.O_SYMLINK, mode), threw = !0, ret;
1487
1486
  try {
1488
- ret = fs7.fchmodSync(fd, mode), threw = !1;
1487
+ ret = fs2.fchmodSync(fd, mode), threw = !1;
1489
1488
  } finally {
1490
1489
  if (threw)
1491
1490
  try {
1492
- fs7.closeSync(fd);
1491
+ fs2.closeSync(fd);
1493
1492
  } catch {
1494
1493
  }
1495
1494
  else
1496
- fs7.closeSync(fd);
1495
+ fs2.closeSync(fd);
1497
1496
  }
1498
1497
  return ret;
1499
1498
  };
1500
1499
  }
1501
- function patchLutimes(fs7) {
1502
- constants.hasOwnProperty("O_SYMLINK") && fs7.futimes ? (fs7.lutimes = function(path3, at, mt, cb) {
1503
- fs7.open(path3, constants.O_SYMLINK, function(er, fd) {
1500
+ function patchLutimes(fs2) {
1501
+ constants.hasOwnProperty("O_SYMLINK") && fs2.futimes ? (fs2.lutimes = function(path2, at, mt, cb) {
1502
+ fs2.open(path2, constants.O_SYMLINK, function(er, fd) {
1504
1503
  if (er) {
1505
1504
  cb && cb(er);
1506
1505
  return;
1507
1506
  }
1508
- fs7.futimes(fd, at, mt, function(er2) {
1509
- fs7.close(fd, function(er22) {
1507
+ fs2.futimes(fd, at, mt, function(er2) {
1508
+ fs2.close(fd, function(er22) {
1510
1509
  cb && cb(er2 || er22);
1511
1510
  });
1512
1511
  });
1513
1512
  });
1514
- }, fs7.lutimesSync = function(path3, at, mt) {
1515
- var fd = fs7.openSync(path3, constants.O_SYMLINK), ret, threw = !0;
1513
+ }, fs2.lutimesSync = function(path2, at, mt) {
1514
+ var fd = fs2.openSync(path2, constants.O_SYMLINK), ret, threw = !0;
1516
1515
  try {
1517
- ret = fs7.futimesSync(fd, at, mt), threw = !1;
1516
+ ret = fs2.futimesSync(fd, at, mt), threw = !1;
1518
1517
  } finally {
1519
1518
  if (threw)
1520
1519
  try {
1521
- fs7.closeSync(fd);
1520
+ fs2.closeSync(fd);
1522
1521
  } catch {
1523
1522
  }
1524
1523
  else
1525
- fs7.closeSync(fd);
1524
+ fs2.closeSync(fd);
1526
1525
  }
1527
1526
  return ret;
1528
- }) : fs7.futimes && (fs7.lutimes = function(_a, _b, _c, cb) {
1527
+ }) : fs2.futimes && (fs2.lutimes = function(_a, _b, _c, cb) {
1529
1528
  cb && process.nextTick(cb);
1530
- }, fs7.lutimesSync = function() {
1529
+ }, fs2.lutimesSync = function() {
1531
1530
  });
1532
1531
  }
1533
1532
  function chmodFix(orig) {
1534
1533
  return orig && function(target, mode, cb) {
1535
- return orig.call(fs6, target, mode, function(er) {
1534
+ return orig.call(fs, target, mode, function(er) {
1536
1535
  chownErOk(er) && (er = null), cb && cb.apply(this, arguments);
1537
1536
  });
1538
1537
  };
@@ -1540,7 +1539,7 @@ var require_polyfills = __commonJS({
1540
1539
  function chmodFixSync(orig) {
1541
1540
  return orig && function(target, mode) {
1542
1541
  try {
1543
- return orig.call(fs6, target, mode);
1542
+ return orig.call(fs, target, mode);
1544
1543
  } catch (er) {
1545
1544
  if (!chownErOk(er)) throw er;
1546
1545
  }
@@ -1548,7 +1547,7 @@ var require_polyfills = __commonJS({
1548
1547
  }
1549
1548
  function chownFix(orig) {
1550
1549
  return orig && function(target, uid, gid, cb) {
1551
- return orig.call(fs6, target, uid, gid, function(er) {
1550
+ return orig.call(fs, target, uid, gid, function(er) {
1552
1551
  chownErOk(er) && (er = null), cb && cb.apply(this, arguments);
1553
1552
  });
1554
1553
  };
@@ -1556,7 +1555,7 @@ var require_polyfills = __commonJS({
1556
1555
  function chownFixSync(orig) {
1557
1556
  return orig && function(target, uid, gid) {
1558
1557
  try {
1559
- return orig.call(fs6, target, uid, gid);
1558
+ return orig.call(fs, target, uid, gid);
1560
1559
  } catch (er) {
1561
1560
  if (!chownErOk(er)) throw er;
1562
1561
  }
@@ -1568,12 +1567,12 @@ var require_polyfills = __commonJS({
1568
1567
  function callback(er, stats) {
1569
1568
  stats && (stats.uid < 0 && (stats.uid += 4294967296), stats.gid < 0 && (stats.gid += 4294967296)), cb && cb.apply(this, arguments);
1570
1569
  }
1571
- return options ? orig.call(fs6, target, options, callback) : orig.call(fs6, target, callback);
1570
+ return options ? orig.call(fs, target, options, callback) : orig.call(fs, target, callback);
1572
1571
  };
1573
1572
  }
1574
1573
  function statFixSync(orig) {
1575
1574
  return orig && function(target, options) {
1576
- var stats = options ? orig.call(fs6, target, options) : orig.call(fs6, target);
1575
+ var stats = options ? orig.call(fs, target, options) : orig.call(fs, target);
1577
1576
  return stats && (stats.uid < 0 && (stats.uid += 4294967296), stats.gid < 0 && (stats.gid += 4294967296)), stats;
1578
1577
  };
1579
1578
  }
@@ -1592,16 +1591,16 @@ var require_legacy_streams = __commonJS({
1592
1591
  "../node_modules/graceful-fs/legacy-streams.js"(exports, module) {
1593
1592
  var Stream = __require("stream").Stream;
1594
1593
  module.exports = legacy;
1595
- function legacy(fs6) {
1594
+ function legacy(fs) {
1596
1595
  return {
1597
1596
  ReadStream,
1598
1597
  WriteStream
1599
1598
  };
1600
- function ReadStream(path3, options) {
1601
- if (!(this instanceof ReadStream)) return new ReadStream(path3, options);
1599
+ function ReadStream(path2, options) {
1600
+ if (!(this instanceof ReadStream)) return new ReadStream(path2, options);
1602
1601
  Stream.call(this);
1603
1602
  var self2 = this;
1604
- this.path = path3, this.fd = null, this.readable = !0, this.paused = !1, this.flags = "r", this.mode = 438, this.bufferSize = 64 * 1024, options = options || {};
1603
+ this.path = path2, this.fd = null, this.readable = !0, this.paused = !1, this.flags = "r", this.mode = 438, this.bufferSize = 64 * 1024, options = options || {};
1605
1604
  for (var keys = Object.keys(options), index = 0, length = keys.length; index < length; index++) {
1606
1605
  var key = keys[index];
1607
1606
  this[key] = options[key];
@@ -1623,7 +1622,7 @@ var require_legacy_streams = __commonJS({
1623
1622
  });
1624
1623
  return;
1625
1624
  }
1626
- fs6.open(this.path, this.flags, this.mode, function(err, fd) {
1625
+ fs.open(this.path, this.flags, this.mode, function(err, fd) {
1627
1626
  if (err) {
1628
1627
  self2.emit("error", err), self2.readable = !1;
1629
1628
  return;
@@ -1631,9 +1630,9 @@ var require_legacy_streams = __commonJS({
1631
1630
  self2.fd = fd, self2.emit("open", fd), self2._read();
1632
1631
  });
1633
1632
  }
1634
- function WriteStream(path3, options) {
1635
- if (!(this instanceof WriteStream)) return new WriteStream(path3, options);
1636
- Stream.call(this), this.path = path3, this.fd = null, this.writable = !0, this.flags = "w", this.encoding = "binary", this.mode = 438, this.bytesWritten = 0, options = options || {};
1633
+ function WriteStream(path2, options) {
1634
+ if (!(this instanceof WriteStream)) return new WriteStream(path2, options);
1635
+ Stream.call(this), this.path = path2, this.fd = null, this.writable = !0, this.flags = "w", this.encoding = "binary", this.mode = 438, this.bytesWritten = 0, options = options || {};
1637
1636
  for (var keys = Object.keys(options), index = 0, length = keys.length; index < length; index++) {
1638
1637
  var key = keys[index];
1639
1638
  this[key] = options[key];
@@ -1645,7 +1644,7 @@ var require_legacy_streams = __commonJS({
1645
1644
  throw new Error("start must be >= zero");
1646
1645
  this.pos = this.start;
1647
1646
  }
1648
- this.busy = !1, this._queue = [], this.fd === null && (this._open = fs6.open, this._queue.push([this._open, this.path, this.flags, this.mode, void 0]), this.flush());
1647
+ this.busy = !1, this._queue = [], this.fd === null && (this._open = fs.open, this._queue.push([this._open, this.path, this.flags, this.mode, void 0]), this.flush());
1649
1648
  }
1650
1649
  }
1651
1650
  }
@@ -1676,7 +1675,7 @@ var require_clone = __commonJS({
1676
1675
  // ../node_modules/graceful-fs/graceful-fs.js
1677
1676
  var require_graceful_fs = __commonJS({
1678
1677
  "../node_modules/graceful-fs/graceful-fs.js"(exports, module) {
1679
- var fs6 = __require("fs"), polyfills = require_polyfills(), legacy = require_legacy_streams(), clone = require_clone(), util = __require("util"), gracefulQueue, previousSymbol;
1678
+ var fs = __require("fs"), polyfills = require_polyfills(), legacy = require_legacy_streams(), clone = require_clone(), util = __require("util"), gracefulQueue, previousSymbol;
1680
1679
  typeof Symbol == "function" && typeof Symbol.for == "function" ? (gracefulQueue = Symbol.for("graceful-fs.queue"), previousSymbol = Symbol.for("graceful-fs.previous")) : (gracefulQueue = "___graceful-fs.queue", previousSymbol = "___graceful-fs.previous");
1681
1680
  function noop() {
1682
1681
  }
@@ -1693,63 +1692,63 @@ var require_graceful_fs = __commonJS({
1693
1692
  m = "GFS4: " + m.split(/\n/).join(`
1694
1693
  GFS4: `), console.error(m);
1695
1694
  });
1696
- fs6[gracefulQueue] || (queue = global[gracefulQueue] || [], publishQueue(fs6, queue), fs6.close = (function(fs$close) {
1695
+ fs[gracefulQueue] || (queue = global[gracefulQueue] || [], publishQueue(fs, queue), fs.close = (function(fs$close) {
1697
1696
  function close(fd, cb) {
1698
- return fs$close.call(fs6, fd, function(err) {
1697
+ return fs$close.call(fs, fd, function(err) {
1699
1698
  err || resetQueue(), typeof cb == "function" && cb.apply(this, arguments);
1700
1699
  });
1701
1700
  }
1702
1701
  return Object.defineProperty(close, previousSymbol, {
1703
1702
  value: fs$close
1704
1703
  }), close;
1705
- })(fs6.close), fs6.closeSync = (function(fs$closeSync) {
1704
+ })(fs.close), fs.closeSync = (function(fs$closeSync) {
1706
1705
  function closeSync(fd) {
1707
- fs$closeSync.apply(fs6, arguments), resetQueue();
1706
+ fs$closeSync.apply(fs, arguments), resetQueue();
1708
1707
  }
1709
1708
  return Object.defineProperty(closeSync, previousSymbol, {
1710
1709
  value: fs$closeSync
1711
1710
  }), closeSync;
1712
- })(fs6.closeSync), /\bgfs4\b/i.test(process.env.NODE_DEBUG || "") && process.on("exit", function() {
1713
- debug(fs6[gracefulQueue]), __require("assert").equal(fs6[gracefulQueue].length, 0);
1711
+ })(fs.closeSync), /\bgfs4\b/i.test(process.env.NODE_DEBUG || "") && process.on("exit", function() {
1712
+ debug(fs[gracefulQueue]), __require("assert").equal(fs[gracefulQueue].length, 0);
1714
1713
  }));
1715
1714
  var queue;
1716
- global[gracefulQueue] || publishQueue(global, fs6[gracefulQueue]);
1717
- module.exports = patch(clone(fs6));
1718
- process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs6.__patched && (module.exports = patch(fs6), fs6.__patched = !0);
1719
- function patch(fs7) {
1720
- polyfills(fs7), fs7.gracefulify = patch, fs7.createReadStream = createReadStream, fs7.createWriteStream = createWriteStream2;
1721
- var fs$readFile = fs7.readFile;
1722
- fs7.readFile = readFile5;
1723
- function readFile5(path3, options, cb) {
1724
- return typeof options == "function" && (cb = options, options = null), go$readFile(path3, options, cb);
1725
- function go$readFile(path4, options2, cb2, startTime) {
1726
- return fs$readFile(path4, options2, function(err) {
1727
- err && (err.code === "EMFILE" || err.code === "ENFILE") ? enqueue([go$readFile, [path4, options2, cb2], err, startTime || Date.now(), Date.now()]) : typeof cb2 == "function" && cb2.apply(this, arguments);
1715
+ global[gracefulQueue] || publishQueue(global, fs[gracefulQueue]);
1716
+ module.exports = patch(clone(fs));
1717
+ process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched && (module.exports = patch(fs), fs.__patched = !0);
1718
+ function patch(fs2) {
1719
+ polyfills(fs2), fs2.gracefulify = patch, fs2.createReadStream = createReadStream, fs2.createWriteStream = createWriteStream2;
1720
+ var fs$readFile = fs2.readFile;
1721
+ fs2.readFile = readFile5;
1722
+ function readFile5(path2, options, cb) {
1723
+ return typeof options == "function" && (cb = options, options = null), go$readFile(path2, options, cb);
1724
+ function go$readFile(path3, options2, cb2, startTime) {
1725
+ return fs$readFile(path3, options2, function(err) {
1726
+ err && (err.code === "EMFILE" || err.code === "ENFILE") ? enqueue([go$readFile, [path3, options2, cb2], err, startTime || Date.now(), Date.now()]) : typeof cb2 == "function" && cb2.apply(this, arguments);
1728
1727
  });
1729
1728
  }
1730
1729
  }
1731
- var fs$writeFile = fs7.writeFile;
1732
- fs7.writeFile = writeFile5;
1733
- function writeFile5(path3, data, options, cb) {
1734
- return typeof options == "function" && (cb = options, options = null), go$writeFile(path3, data, options, cb);
1735
- function go$writeFile(path4, data2, options2, cb2, startTime) {
1736
- return fs$writeFile(path4, data2, options2, function(err) {
1737
- err && (err.code === "EMFILE" || err.code === "ENFILE") ? enqueue([go$writeFile, [path4, data2, options2, cb2], err, startTime || Date.now(), Date.now()]) : typeof cb2 == "function" && cb2.apply(this, arguments);
1730
+ var fs$writeFile = fs2.writeFile;
1731
+ fs2.writeFile = writeFile5;
1732
+ function writeFile5(path2, data, options, cb) {
1733
+ return typeof options == "function" && (cb = options, options = null), go$writeFile(path2, data, options, cb);
1734
+ function go$writeFile(path3, data2, options2, cb2, startTime) {
1735
+ return fs$writeFile(path3, data2, options2, function(err) {
1736
+ err && (err.code === "EMFILE" || err.code === "ENFILE") ? enqueue([go$writeFile, [path3, data2, options2, cb2], err, startTime || Date.now(), Date.now()]) : typeof cb2 == "function" && cb2.apply(this, arguments);
1738
1737
  });
1739
1738
  }
1740
1739
  }
1741
- var fs$appendFile = fs7.appendFile;
1742
- fs$appendFile && (fs7.appendFile = appendFile);
1743
- function appendFile(path3, data, options, cb) {
1744
- return typeof options == "function" && (cb = options, options = null), go$appendFile(path3, data, options, cb);
1745
- function go$appendFile(path4, data2, options2, cb2, startTime) {
1746
- return fs$appendFile(path4, data2, options2, function(err) {
1747
- err && (err.code === "EMFILE" || err.code === "ENFILE") ? enqueue([go$appendFile, [path4, data2, options2, cb2], err, startTime || Date.now(), Date.now()]) : typeof cb2 == "function" && cb2.apply(this, arguments);
1740
+ var fs$appendFile = fs2.appendFile;
1741
+ fs$appendFile && (fs2.appendFile = appendFile);
1742
+ function appendFile(path2, data, options, cb) {
1743
+ return typeof options == "function" && (cb = options, options = null), go$appendFile(path2, data, options, cb);
1744
+ function go$appendFile(path3, data2, options2, cb2, startTime) {
1745
+ return fs$appendFile(path3, data2, options2, function(err) {
1746
+ err && (err.code === "EMFILE" || err.code === "ENFILE") ? enqueue([go$appendFile, [path3, data2, options2, cb2], err, startTime || Date.now(), Date.now()]) : typeof cb2 == "function" && cb2.apply(this, arguments);
1748
1747
  });
1749
1748
  }
1750
1749
  }
1751
- var fs$copyFile = fs7.copyFile;
1752
- fs$copyFile && (fs7.copyFile = copyFile);
1750
+ var fs$copyFile = fs2.copyFile;
1751
+ fs$copyFile && (fs2.copyFile = copyFile);
1753
1752
  function copyFile(src, dest, flags, cb) {
1754
1753
  return typeof flags == "function" && (cb = flags, flags = 0), go$copyFile(src, dest, flags, cb);
1755
1754
  function go$copyFile(src2, dest2, flags2, cb2, startTime) {
@@ -1758,32 +1757,32 @@ GFS4: `), console.error(m);
1758
1757
  });
1759
1758
  }
1760
1759
  }
1761
- var fs$readdir = fs7.readdir;
1762
- fs7.readdir = readdir;
1760
+ var fs$readdir = fs2.readdir;
1761
+ fs2.readdir = readdir;
1763
1762
  var noReaddirOptionVersions = /^v[0-5]\./;
1764
- function readdir(path3, options, cb) {
1763
+ function readdir(path2, options, cb) {
1765
1764
  typeof options == "function" && (cb = options, options = null);
1766
- var go$readdir = noReaddirOptionVersions.test(process.version) ? function(path4, options2, cb2, startTime) {
1767
- return fs$readdir(path4, fs$readdirCallback(
1768
- path4,
1765
+ var go$readdir = noReaddirOptionVersions.test(process.version) ? function(path3, options2, cb2, startTime) {
1766
+ return fs$readdir(path3, fs$readdirCallback(
1767
+ path3,
1769
1768
  options2,
1770
1769
  cb2,
1771
1770
  startTime
1772
1771
  ));
1773
- } : function(path4, options2, cb2, startTime) {
1774
- return fs$readdir(path4, options2, fs$readdirCallback(
1775
- path4,
1772
+ } : function(path3, options2, cb2, startTime) {
1773
+ return fs$readdir(path3, options2, fs$readdirCallback(
1774
+ path3,
1776
1775
  options2,
1777
1776
  cb2,
1778
1777
  startTime
1779
1778
  ));
1780
1779
  };
1781
- return go$readdir(path3, options, cb);
1782
- function fs$readdirCallback(path4, options2, cb2, startTime) {
1780
+ return go$readdir(path2, options, cb);
1781
+ function fs$readdirCallback(path3, options2, cb2, startTime) {
1783
1782
  return function(err, files) {
1784
1783
  err && (err.code === "EMFILE" || err.code === "ENFILE") ? enqueue([
1785
1784
  go$readdir,
1786
- [path4, options2, cb2],
1785
+ [path3, options2, cb2],
1787
1786
  err,
1788
1787
  startTime || Date.now(),
1789
1788
  Date.now()
@@ -1792,13 +1791,13 @@ GFS4: `), console.error(m);
1792
1791
  }
1793
1792
  }
1794
1793
  if (process.version.substr(0, 4) === "v0.8") {
1795
- var legStreams = legacy(fs7);
1794
+ var legStreams = legacy(fs2);
1796
1795
  ReadStream = legStreams.ReadStream, WriteStream = legStreams.WriteStream;
1797
1796
  }
1798
- var fs$ReadStream = fs7.ReadStream;
1797
+ var fs$ReadStream = fs2.ReadStream;
1799
1798
  fs$ReadStream && (ReadStream.prototype = Object.create(fs$ReadStream.prototype), ReadStream.prototype.open = ReadStream$open);
1800
- var fs$WriteStream = fs7.WriteStream;
1801
- fs$WriteStream && (WriteStream.prototype = Object.create(fs$WriteStream.prototype), WriteStream.prototype.open = WriteStream$open), Object.defineProperty(fs7, "ReadStream", {
1799
+ var fs$WriteStream = fs2.WriteStream;
1800
+ fs$WriteStream && (WriteStream.prototype = Object.create(fs$WriteStream.prototype), WriteStream.prototype.open = WriteStream$open), Object.defineProperty(fs2, "ReadStream", {
1802
1801
  get: function() {
1803
1802
  return ReadStream;
1804
1803
  },
@@ -1807,7 +1806,7 @@ GFS4: `), console.error(m);
1807
1806
  },
1808
1807
  enumerable: !0,
1809
1808
  configurable: !0
1810
- }), Object.defineProperty(fs7, "WriteStream", {
1809
+ }), Object.defineProperty(fs2, "WriteStream", {
1811
1810
  get: function() {
1812
1811
  return WriteStream;
1813
1812
  },
@@ -1818,7 +1817,7 @@ GFS4: `), console.error(m);
1818
1817
  configurable: !0
1819
1818
  });
1820
1819
  var FileReadStream = ReadStream;
1821
- Object.defineProperty(fs7, "FileReadStream", {
1820
+ Object.defineProperty(fs2, "FileReadStream", {
1822
1821
  get: function() {
1823
1822
  return FileReadStream;
1824
1823
  },
@@ -1829,7 +1828,7 @@ GFS4: `), console.error(m);
1829
1828
  configurable: !0
1830
1829
  });
1831
1830
  var FileWriteStream = WriteStream;
1832
- Object.defineProperty(fs7, "FileWriteStream", {
1831
+ Object.defineProperty(fs2, "FileWriteStream", {
1833
1832
  get: function() {
1834
1833
  return FileWriteStream;
1835
1834
  },
@@ -1839,54 +1838,54 @@ GFS4: `), console.error(m);
1839
1838
  enumerable: !0,
1840
1839
  configurable: !0
1841
1840
  });
1842
- function ReadStream(path3, options) {
1841
+ function ReadStream(path2, options) {
1843
1842
  return this instanceof ReadStream ? (fs$ReadStream.apply(this, arguments), this) : ReadStream.apply(Object.create(ReadStream.prototype), arguments);
1844
1843
  }
1845
1844
  function ReadStream$open() {
1846
1845
  var that = this;
1847
- open2(that.path, that.flags, that.mode, function(err, fd) {
1846
+ open3(that.path, that.flags, that.mode, function(err, fd) {
1848
1847
  err ? (that.autoClose && that.destroy(), that.emit("error", err)) : (that.fd = fd, that.emit("open", fd), that.read());
1849
1848
  });
1850
1849
  }
1851
- function WriteStream(path3, options) {
1850
+ function WriteStream(path2, options) {
1852
1851
  return this instanceof WriteStream ? (fs$WriteStream.apply(this, arguments), this) : WriteStream.apply(Object.create(WriteStream.prototype), arguments);
1853
1852
  }
1854
1853
  function WriteStream$open() {
1855
1854
  var that = this;
1856
- open2(that.path, that.flags, that.mode, function(err, fd) {
1855
+ open3(that.path, that.flags, that.mode, function(err, fd) {
1857
1856
  err ? (that.destroy(), that.emit("error", err)) : (that.fd = fd, that.emit("open", fd));
1858
1857
  });
1859
1858
  }
1860
- function createReadStream(path3, options) {
1861
- return new fs7.ReadStream(path3, options);
1859
+ function createReadStream(path2, options) {
1860
+ return new fs2.ReadStream(path2, options);
1862
1861
  }
1863
- function createWriteStream2(path3, options) {
1864
- return new fs7.WriteStream(path3, options);
1862
+ function createWriteStream2(path2, options) {
1863
+ return new fs2.WriteStream(path2, options);
1865
1864
  }
1866
- var fs$open = fs7.open;
1867
- fs7.open = open2;
1868
- function open2(path3, flags, mode, cb) {
1869
- return typeof mode == "function" && (cb = mode, mode = null), go$open(path3, flags, mode, cb);
1870
- function go$open(path4, flags2, mode2, cb2, startTime) {
1871
- return fs$open(path4, flags2, mode2, function(err, fd) {
1872
- err && (err.code === "EMFILE" || err.code === "ENFILE") ? enqueue([go$open, [path4, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]) : typeof cb2 == "function" && cb2.apply(this, arguments);
1865
+ var fs$open = fs2.open;
1866
+ fs2.open = open3;
1867
+ function open3(path2, flags, mode, cb) {
1868
+ return typeof mode == "function" && (cb = mode, mode = null), go$open(path2, flags, mode, cb);
1869
+ function go$open(path3, flags2, mode2, cb2, startTime) {
1870
+ return fs$open(path3, flags2, mode2, function(err, fd) {
1871
+ err && (err.code === "EMFILE" || err.code === "ENFILE") ? enqueue([go$open, [path3, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]) : typeof cb2 == "function" && cb2.apply(this, arguments);
1873
1872
  });
1874
1873
  }
1875
1874
  }
1876
- return fs7;
1875
+ return fs2;
1877
1876
  }
1878
1877
  function enqueue(elem) {
1879
- debug("ENQUEUE", elem[0].name, elem[1]), fs6[gracefulQueue].push(elem), retry();
1878
+ debug("ENQUEUE", elem[0].name, elem[1]), fs[gracefulQueue].push(elem), retry();
1880
1879
  }
1881
1880
  var retryTimer;
1882
1881
  function resetQueue() {
1883
- for (var now = Date.now(), i = 0; i < fs6[gracefulQueue].length; ++i)
1884
- fs6[gracefulQueue][i].length > 2 && (fs6[gracefulQueue][i][3] = now, fs6[gracefulQueue][i][4] = now);
1882
+ for (var now = Date.now(), i = 0; i < fs[gracefulQueue].length; ++i)
1883
+ fs[gracefulQueue][i].length > 2 && (fs[gracefulQueue][i][3] = now, fs[gracefulQueue][i][4] = now);
1885
1884
  retry();
1886
1885
  }
1887
1886
  function retry() {
1888
- if (clearTimeout(retryTimer), retryTimer = void 0, fs6[gracefulQueue].length !== 0) {
1889
- var elem = fs6[gracefulQueue].shift(), fn = elem[0], args = elem[1], err = elem[2], startTime = elem[3], lastTime = elem[4];
1887
+ if (clearTimeout(retryTimer), retryTimer = void 0, fs[gracefulQueue].length !== 0) {
1888
+ var elem = fs[gracefulQueue].shift(), fn = elem[0], args = elem[1], err = elem[2], startTime = elem[3], lastTime = elem[4];
1890
1889
  if (startTime === void 0)
1891
1890
  debug("RETRY", fn.name, args), fn.apply(null, args);
1892
1891
  else if (Date.now() - startTime >= 6e4) {
@@ -1895,7 +1894,7 @@ GFS4: `), console.error(m);
1895
1894
  typeof cb == "function" && cb.call(null, err);
1896
1895
  } else {
1897
1896
  var sinceAttempt = Date.now() - lastTime, sinceStart = Math.max(lastTime - startTime, 1), desiredDelay = Math.min(sinceStart * 1.2, 100);
1898
- sinceAttempt >= desiredDelay ? (debug("RETRY", fn.name, args), fn.apply(null, args.concat([startTime]))) : fs6[gracefulQueue].push(elem);
1897
+ sinceAttempt >= desiredDelay ? (debug("RETRY", fn.name, args), fn.apply(null, args.concat([startTime]))) : fs[gracefulQueue].push(elem);
1899
1898
  }
1900
1899
  retryTimer === void 0 && (retryTimer = setTimeout(retry, 0));
1901
1900
  }
@@ -1907,7 +1906,7 @@ GFS4: `), console.error(m);
1907
1906
  var require_reducePlan = __commonJS({
1908
1907
  "../node_modules/watchpack/lib/reducePlan.js"(exports, module) {
1909
1908
  "use strict";
1910
- var path3 = __require("path");
1909
+ var path2 = __require("path");
1911
1910
  module.exports = (plan, limit) => {
1912
1911
  let treeMap = /* @__PURE__ */ new Map();
1913
1912
  for (let [filePath, value] of plan)
@@ -1921,7 +1920,7 @@ var require_reducePlan = __commonJS({
1921
1920
  });
1922
1921
  let currentCount = treeMap.size;
1923
1922
  for (let node of treeMap.values()) {
1924
- let parentPath = path3.dirname(node.filePath);
1923
+ let parentPath = path2.dirname(node.filePath);
1925
1924
  if (parentPath !== node.filePath) {
1926
1925
  let parent = treeMap.get(parentPath);
1927
1926
  if (parent === void 0)
@@ -1986,14 +1985,14 @@ var require_reducePlan = __commonJS({
1986
1985
  var require_watchEventSource = __commonJS({
1987
1986
  "../node_modules/watchpack/lib/watchEventSource.js"(exports) {
1988
1987
  "use strict";
1989
- var fs6 = __require("fs"), path3 = __require("path"), { EventEmitter } = __require("events"), reducePlan = require_reducePlan(), IS_OSX = __require("os").platform() === "darwin", IS_WIN = __require("os").platform() === "win32", SUPPORTS_RECURSIVE_WATCHING = IS_OSX || IS_WIN, watcherLimit = +process.env.WATCHPACK_WATCHER_LIMIT || (IS_OSX ? 20 : 1e4), recursiveWatcherLogging = !!process.env.WATCHPACK_RECURSIVE_WATCHER_LOGGING, isBatch = !1, watcherCount = 0, pendingWatchers = /* @__PURE__ */ new Map(), recursiveWatchers = /* @__PURE__ */ new Map(), directWatchers = /* @__PURE__ */ new Map(), underlyingWatcher = /* @__PURE__ */ new Map();
1988
+ var fs = __require("fs"), path2 = __require("path"), { EventEmitter } = __require("events"), reducePlan = require_reducePlan(), IS_OSX = __require("os").platform() === "darwin", IS_WIN = __require("os").platform() === "win32", SUPPORTS_RECURSIVE_WATCHING = IS_OSX || IS_WIN, watcherLimit = +process.env.WATCHPACK_WATCHER_LIMIT || (IS_OSX ? 20 : 1e4), recursiveWatcherLogging = !!process.env.WATCHPACK_RECURSIVE_WATCHER_LOGGING, isBatch = !1, watcherCount = 0, pendingWatchers = /* @__PURE__ */ new Map(), recursiveWatchers = /* @__PURE__ */ new Map(), directWatchers = /* @__PURE__ */ new Map(), underlyingWatcher = /* @__PURE__ */ new Map();
1990
1989
  function createEPERMError(filePath) {
1991
1990
  let error = new Error(`Operation not permitted: ${filePath}`);
1992
1991
  return error.code = "EPERM", error;
1993
1992
  }
1994
1993
  function createHandleChangeEvent(watcher, filePath, handleChangeEvent) {
1995
1994
  return (type, filename) => {
1996
- if (type === "rename" && path3.isAbsolute(filename) && path3.basename(filename) === path3.basename(filePath)) {
1995
+ if (type === "rename" && path2.isAbsolute(filename) && path2.basename(filename) === path2.basename(filePath)) {
1997
1996
  IS_OSX || watcher.emit("error", createEPERMError(filename));
1998
1997
  return;
1999
1998
  }
@@ -2004,7 +2003,7 @@ var require_watchEventSource = __commonJS({
2004
2003
  constructor(filePath) {
2005
2004
  this.filePath = filePath, this.watchers = /* @__PURE__ */ new Set(), this.watcher = void 0;
2006
2005
  try {
2007
- let watcher = fs6.watch(filePath);
2006
+ let watcher = fs.watch(filePath);
2008
2007
  this.watcher = watcher;
2009
2008
  let handleChangeEvent = createHandleChangeEvent(
2010
2009
  watcher,
@@ -2039,18 +2038,18 @@ var require_watchEventSource = __commonJS({
2039
2038
  constructor(rootPath) {
2040
2039
  this.rootPath = rootPath, this.mapWatcherToPath = /* @__PURE__ */ new Map(), this.mapPathToWatchers = /* @__PURE__ */ new Map(), this.watcher = void 0;
2041
2040
  try {
2042
- let watcher = fs6.watch(rootPath, {
2041
+ let watcher = fs.watch(rootPath, {
2043
2042
  recursive: !0
2044
2043
  });
2045
2044
  this.watcher = watcher, watcher.on("change", (type, filename) => {
2046
2045
  if (filename) {
2047
- let dir = path3.dirname(filename), watchers = this.mapPathToWatchers.get(dir);
2046
+ let dir = path2.dirname(filename), watchers = this.mapPathToWatchers.get(dir);
2048
2047
  if (recursiveWatcherLogging && process.stderr.write(
2049
2048
  `[watchpack] dispatch ${type} event in recursive watcher (${this.rootPath}) for '${filename}' to ${watchers ? watchers.size : 0} watchers
2050
2049
  `
2051
2050
  ), watchers === void 0) return;
2052
2051
  for (let w of watchers)
2053
- w.emit("change", type, path3.basename(filename));
2052
+ w.emit("change", type, path2.basename(filename));
2054
2053
  } else {
2055
2054
  recursiveWatcherLogging && process.stderr.write(
2056
2055
  `[watchpack] dispatch ${type} event in recursive watcher (${this.rootPath}) to all watchers
@@ -2135,7 +2134,7 @@ var require_watchEventSource = __commonJS({
2135
2134
  }
2136
2135
  for (let watcher of recursiveWatchers.values())
2137
2136
  for (let [w, subpath] of watcher.getWatchers())
2138
- addWatcher(w, path3.join(watcher.rootPath, subpath));
2137
+ addWatcher(w, path2.join(watcher.rootPath, subpath));
2139
2138
  for (let watcher of directWatchers.values())
2140
2139
  for (let w of watcher.getWatchers())
2141
2140
  addWatcher(w, watcher.filePath);
@@ -2173,7 +2172,7 @@ var require_watchEventSource = __commonJS({
2173
2172
  let recursiveWatcher = recursiveWatchers.get(current);
2174
2173
  if (recursiveWatcher !== void 0)
2175
2174
  return recursiveWatcher.add(filePath, watcher), watcher;
2176
- let parent = path3.dirname(current);
2175
+ let parent = path2.dirname(current);
2177
2176
  if (parent === current) break;
2178
2177
  current = parent;
2179
2178
  }
@@ -2197,7 +2196,7 @@ var require_watchEventSource = __commonJS({
2197
2196
  var require_DirectoryWatcher = __commonJS({
2198
2197
  "../node_modules/watchpack/lib/DirectoryWatcher.js"(exports, module) {
2199
2198
  "use strict";
2200
- var EventEmitter = __require("events").EventEmitter, fs6 = require_graceful_fs(), path3 = __require("path"), watchEventSource = require_watchEventSource(), EXISTANCE_ONLY_TIME_ENTRY = Object.freeze({}), FS_ACCURACY = 2e3, IS_OSX = __require("os").platform() === "darwin", IS_WIN = __require("os").platform() === "win32", WATCHPACK_POLLING = process.env.WATCHPACK_POLLING, FORCE_POLLING = `${+WATCHPACK_POLLING}` === WATCHPACK_POLLING ? +WATCHPACK_POLLING : !!WATCHPACK_POLLING && WATCHPACK_POLLING !== "false";
2199
+ var EventEmitter = __require("events").EventEmitter, fs = require_graceful_fs(), path2 = __require("path"), watchEventSource = require_watchEventSource(), EXISTANCE_ONLY_TIME_ENTRY = Object.freeze({}), FS_ACCURACY = 2e3, IS_OSX = __require("os").platform() === "darwin", IS_WIN = __require("os").platform() === "win32", WATCHPACK_POLLING = process.env.WATCHPACK_POLLING, FORCE_POLLING = `${+WATCHPACK_POLLING}` === WATCHPACK_POLLING ? +WATCHPACK_POLLING : !!WATCHPACK_POLLING && WATCHPACK_POLLING !== "false";
2201
2200
  function withoutCase(str) {
2202
2201
  return str.toLowerCase();
2203
2202
  }
@@ -2233,8 +2232,8 @@ var require_DirectoryWatcher = __commonJS({
2233
2232
  this.onWatcherError(err);
2234
2233
  }
2235
2234
  }
2236
- forEachWatcher(path4, fn) {
2237
- let watchers = this.watchers.get(withoutCase(path4));
2235
+ forEachWatcher(path3, fn) {
2236
+ let watchers = this.watchers.get(withoutCase(path3));
2238
2237
  if (watchers !== void 0)
2239
2238
  for (let w of watchers)
2240
2239
  fn(w);
@@ -2361,18 +2360,18 @@ var require_DirectoryWatcher = __commonJS({
2361
2360
  this.doScan(!1);
2362
2361
  return;
2363
2362
  }
2364
- let filePath = path3.join(this.path, filename);
2363
+ let filePath = path2.join(this.path, filename);
2365
2364
  if (!this.ignored(filePath))
2366
2365
  if (this._activeEvents.get(filename) === void 0) {
2367
2366
  this._activeEvents.set(filename, !1);
2368
2367
  let checkStats = () => {
2369
- this.closed || (this._activeEvents.set(filename, !1), fs6.lstat(filePath, (err, stats) => {
2368
+ this.closed || (this._activeEvents.set(filename, !1), fs.lstat(filePath, (err, stats) => {
2370
2369
  if (!this.closed) {
2371
2370
  if (this._activeEvents.get(filename) === !0) {
2372
2371
  process.nextTick(checkStats);
2373
2372
  return;
2374
2373
  }
2375
- this._activeEvents.delete(filename), err && (err.code !== "ENOENT" && err.code !== "EPERM" && err.code !== "EBUSY" ? this.onStatsError(err) : filename === path3.basename(this.path) && (fs6.existsSync(this.path) || this.onDirectoryRemoved("stat failed"))), this.lastWatchEvent = Date.now(), stats ? stats.isDirectory() ? this.setDirectory(
2374
+ this._activeEvents.delete(filename), err && (err.code !== "ENOENT" && err.code !== "EPERM" && err.code !== "EBUSY" ? this.onStatsError(err) : filename === path2.basename(this.path) && (fs.existsSync(this.path) || this.onDirectoryRemoved("stat failed"))), this.lastWatchEvent = Date.now(), stats ? stats.isDirectory() ? this.setDirectory(
2376
2375
  filePath,
2377
2376
  +stats.birthtime || 1,
2378
2377
  !1,
@@ -2415,8 +2414,8 @@ var require_DirectoryWatcher = __commonJS({
2415
2414
  }
2416
2415
  watchInParentDirectory() {
2417
2416
  if (!this.parentWatcher) {
2418
- let parentDir = path3.dirname(this.path);
2419
- if (path3.dirname(parentDir) === parentDir) return;
2417
+ let parentDir = path2.dirname(this.path);
2418
+ if (path2.dirname(parentDir) === parentDir) return;
2420
2419
  this.parentWatcher = this.watcherManager.watchFile(this.path, 1), this.parentWatcher.on("change", (mtime, type) => {
2421
2420
  this.closed || ((!IS_OSX || this.polledWatching) && this.parentWatcher && (this.parentWatcher.close(), this.parentWatcher = null), this.watcher || (this.createWatcher(), this.doScan(!1), this.forEachWatcher(
2422
2421
  this.path,
@@ -2433,7 +2432,7 @@ var require_DirectoryWatcher = __commonJS({
2433
2432
  return;
2434
2433
  }
2435
2434
  this.scanning = !0, this.timeout && (clearTimeout(this.timeout), this.timeout = void 0), process.nextTick(() => {
2436
- this.closed || fs6.readdir(this.path, (err, items) => {
2435
+ this.closed || fs.readdir(this.path, (err, items) => {
2437
2436
  if (this.closed) return;
2438
2437
  if (err) {
2439
2438
  if (err.code === "ENOENT" || err.code === "EPERM" ? this.onDirectoryRemoved("scan readdir failed") : this.onScanError(err), this.initialScan = !1, this.initialScanFinished = Date.now(), initial)
@@ -2447,7 +2446,7 @@ var require_DirectoryWatcher = __commonJS({
2447
2446
  return;
2448
2447
  }
2449
2448
  let itemPaths = new Set(
2450
- items.map((item) => path3.join(this.path, item.normalize("NFC")))
2449
+ items.map((item) => path2.join(this.path, item.normalize("NFC")))
2451
2450
  );
2452
2451
  for (let file of this.files.keys())
2453
2452
  itemPaths.has(file) || this.setMissing(file, initial, "scan (missing)");
@@ -2475,7 +2474,7 @@ var require_DirectoryWatcher = __commonJS({
2475
2474
  }
2476
2475
  });
2477
2476
  for (let itemPath of itemPaths)
2478
- fs6.lstat(itemPath, (err2, stats) => {
2477
+ fs.lstat(itemPath, (err2, stats) => {
2479
2478
  if (!this.closed) {
2480
2479
  if (err2) {
2481
2480
  err2.code === "ENOENT" || err2.code === "EPERM" || err2.code === "EACCES" || err2.code === "EBUSY" || // TODO https://github.com/libuv/libuv/pull/4566
@@ -2517,8 +2516,8 @@ var require_DirectoryWatcher = __commonJS({
2517
2516
  if (!this.initialScan)
2518
2517
  for (let watchers of this.watchers.values())
2519
2518
  for (let watcher of watchers) {
2520
- let path4 = watcher.path;
2521
- Object.prototype.hasOwnProperty.call(obj, path4) || (obj[path4] = null);
2519
+ let path3 = watcher.path;
2520
+ Object.prototype.hasOwnProperty.call(obj, path3) || (obj[path3] = null);
2522
2521
  }
2523
2522
  return obj;
2524
2523
  }
@@ -2546,8 +2545,8 @@ var require_DirectoryWatcher = __commonJS({
2546
2545
  if (!this.initialScan)
2547
2546
  for (let watchers of this.watchers.values())
2548
2547
  for (let watcher of watchers) {
2549
- let path4 = watcher.path;
2550
- fileTimestamps.has(path4) || fileTimestamps.set(path4, null);
2548
+ let path3 = watcher.path;
2549
+ fileTimestamps.has(path3) || fileTimestamps.set(path3, null);
2551
2550
  }
2552
2551
  return safeTime;
2553
2552
  }
@@ -2575,7 +2574,7 @@ var require_DirectoryWatcher = __commonJS({
2575
2574
  var require_getWatcherManager = __commonJS({
2576
2575
  "../node_modules/watchpack/lib/getWatcherManager.js"(exports, module) {
2577
2576
  "use strict";
2578
- var path3 = __require("path"), DirectoryWatcher = require_DirectoryWatcher(), WatcherManager = class {
2577
+ var path2 = __require("path"), DirectoryWatcher = require_DirectoryWatcher(), WatcherManager = class {
2579
2578
  constructor(options) {
2580
2579
  this.options = options, this.directoryWatchers = /* @__PURE__ */ new Map();
2581
2580
  }
@@ -2590,7 +2589,7 @@ var require_getWatcherManager = __commonJS({
2590
2589
  return watcher;
2591
2590
  }
2592
2591
  watchFile(p, startTime) {
2593
- let directory = path3.dirname(p);
2592
+ let directory = path2.dirname(p);
2594
2593
  return directory === p ? null : this.getDirectoryWatcher(directory).watch(p, startTime);
2595
2594
  }
2596
2595
  watchDirectory(directory, startTime) {
@@ -2611,7 +2610,7 @@ var require_getWatcherManager = __commonJS({
2611
2610
  var require_LinkResolver = __commonJS({
2612
2611
  "../node_modules/watchpack/lib/LinkResolver.js"(exports, module) {
2613
2612
  "use strict";
2614
- var fs6 = __require("fs"), path3 = __require("path"), EXPECTED_ERRORS = /* @__PURE__ */ new Set(["EINVAL", "ENOENT"]);
2613
+ var fs = __require("fs"), path2 = __require("path"), EXPECTED_ERRORS = /* @__PURE__ */ new Set(["EINVAL", "ENOENT"]);
2615
2614
  process.platform === "win32" && EXPECTED_ERRORS.add("UNKNOWN");
2616
2615
  var LinkResolver = class {
2617
2616
  constructor() {
@@ -2625,18 +2624,18 @@ var require_LinkResolver = __commonJS({
2625
2624
  let cacheEntry = this.cache.get(file);
2626
2625
  if (cacheEntry !== void 0)
2627
2626
  return cacheEntry;
2628
- let parent = path3.dirname(file);
2627
+ let parent = path2.dirname(file);
2629
2628
  if (parent === file) {
2630
2629
  let result = Object.freeze([file]);
2631
2630
  return this.cache.set(file, result), result;
2632
2631
  }
2633
2632
  let parentResolved = this.resolve(parent), realFile = file;
2634
2633
  if (parentResolved[0] !== parent) {
2635
- let basename4 = path3.basename(file);
2636
- realFile = path3.resolve(parentResolved[0], basename4);
2634
+ let basename4 = path2.basename(file);
2635
+ realFile = path2.resolve(parentResolved[0], basename4);
2637
2636
  }
2638
2637
  try {
2639
- let linkContent = fs6.readlinkSync(realFile), resolvedLink = path3.resolve(parentResolved[0], linkContent), linkResolved = this.resolve(resolvedLink), result;
2638
+ let linkContent = fs.readlinkSync(realFile), resolvedLink = path2.resolve(parentResolved[0], linkContent), linkResolved = this.resolve(resolvedLink), result;
2640
2639
  if (linkResolved.length > 1 && parentResolved.length > 1) {
2641
2640
  let resultSet = new Set(linkResolved);
2642
2641
  resultSet.add(realFile);
@@ -2826,7 +2825,7 @@ var require_watchpack = __commonJS({
2826
2825
  missing = EMPTY_ARRAY,
2827
2826
  startTime
2828
2827
  } = arg1, this.paused = !1;
2829
- let fileWatchers = this.fileWatchers, directoryWatchers = this.directoryWatchers, ignored = this.watcherOptions.ignored, filter = (path3) => !ignored(path3), addToMap = (map, key, item) => {
2828
+ let fileWatchers = this.fileWatchers, directoryWatchers = this.directoryWatchers, ignored = this.watcherOptions.ignored, filter = (path2) => !ignored(path2), addToMap = (map, key, item) => {
2830
2829
  let list = map.get(key);
2831
2830
  list === void 0 ? map.set(key, item) : Array.isArray(list) ? list.push(item) : map.set(key, [list, item]);
2832
2831
  }, fileWatchersNeeded = /* @__PURE__ */ new Map(), directoryWatchersNeeded = /* @__PURE__ */ new Map(), missingFiles = /* @__PURE__ */ new Set();
@@ -3878,15 +3877,15 @@ var require_dist2 = __commonJS({
3878
3877
  return result == "0" && 1 / value == -INFINITY2 ? "-0" : result;
3879
3878
  }
3880
3879
  var toKey_default = toKey;
3881
- function baseGet(object, path3) {
3882
- path3 = castPath_default(path3, object);
3883
- for (var index = 0, length = path3.length; object != null && index < length; )
3884
- object = object[toKey_default(path3[index++])];
3880
+ function baseGet(object, path2) {
3881
+ path2 = castPath_default(path2, object);
3882
+ for (var index = 0, length = path2.length; object != null && index < length; )
3883
+ object = object[toKey_default(path2[index++])];
3885
3884
  return index && index == length ? object : void 0;
3886
3885
  }
3887
3886
  var baseGet_default = baseGet;
3888
- function get(object, path3, defaultValue) {
3889
- var result = object == null ? void 0 : baseGet_default(object, path3);
3887
+ function get(object, path2, defaultValue) {
3888
+ var result = object == null ? void 0 : baseGet_default(object, path2);
3890
3889
  return result === void 0 ? defaultValue : result;
3891
3890
  }
3892
3891
  var get_default = get, eventProperties = [
@@ -4055,13 +4054,13 @@ var require_dist2 = __commonJS({
4055
4054
  var require_address = __commonJS({
4056
4055
  "../node_modules/address/lib/address.js"(exports, module) {
4057
4056
  "use strict";
4058
- var os3 = __require("os"), fs6 = __require("fs"), child = __require("child_process"), DEFAULT_RESOLV_FILE = "/etc/resolv.conf";
4057
+ var os2 = __require("os"), fs = __require("fs"), child = __require("child_process"), DEFAULT_RESOLV_FILE = "/etc/resolv.conf";
4059
4058
  function getInterfaceName() {
4060
- var val = "eth", platform2 = os3.platform();
4061
- return platform2 === "darwin" ? val = "en" : platform2 === "win32" && (val = null), val;
4059
+ var val = "eth", platform = os2.platform();
4060
+ return platform === "darwin" ? val = "en" : platform === "win32" && (val = null), val;
4062
4061
  }
4063
4062
  function getIfconfigCMD() {
4064
- return os3.platform() === "win32" ? "ipconfig/all" : "/sbin/ifconfig";
4063
+ return os2.platform() === "win32" ? "ipconfig/all" : "/sbin/ifconfig";
4065
4064
  }
4066
4065
  function matchName(actualFamily, expectedFamily) {
4067
4066
  return expectedFamily === "IPv4" ? actualFamily === "IPv4" || actualFamily === 4 : expectedFamily === "IPv6" ? actualFamily === "IPv6" || actualFamily === 6 : actualFamily === expectedFamily;
@@ -4078,7 +4077,7 @@ var require_address = __commonJS({
4078
4077
  });
4079
4078
  }
4080
4079
  address.interface = function(family, name) {
4081
- var interfaces = os3.networkInterfaces(), noName = !name;
4080
+ var interfaces = os2.networkInterfaces(), noName = !name;
4082
4081
  name = name || getInterfaceName(), family = family || "IPv4";
4083
4082
  for (var i = -1; i < 8; i++) {
4084
4083
  var interfaceName = name + (i >= 0 ? i : ""), items = interfaces[interfaceName];
@@ -4143,7 +4142,7 @@ var require_address = __commonJS({
4143
4142
  };
4144
4143
  var DNS_SERVER_RE = /^nameserver\s+(\d+\.\d+\.\d+\.\d+)$/i;
4145
4144
  address.dns = function(filepath, callback) {
4146
- typeof filepath == "function" && (callback = filepath, filepath = null), filepath = filepath || DEFAULT_RESOLV_FILE, fs6.readFile(filepath, "utf8", function(err, content) {
4145
+ typeof filepath == "function" && (callback = filepath, filepath = null), filepath = filepath || DEFAULT_RESOLV_FILE, fs.readFile(filepath, "utf8", function(err, content) {
4147
4146
  if (err)
4148
4147
  return callback(err);
4149
4148
  var servers = [];
@@ -5147,7 +5146,7 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
5147
5146
  let cacheKey = this.getFindMatchingFilesCacheKey(specifier, workingDir, ignoreWarnings), cached = this.findMatchingFilesCache.get(cacheKey);
5148
5147
  if (cached)
5149
5148
  return cached;
5150
- let pathToSubIndex = {}, fullGlob = slash(join2(specifier.directory, specifier.files)), { globby } = await import("../_node-chunks/globby-EBHKFBTA.js"), files = await globby(fullGlob, {
5149
+ let pathToSubIndex = {}, fullGlob = slash(join2(specifier.directory, specifier.files)), { globby } = await import("../_node-chunks/globby-VVFDARVQ.js"), files = await globby(fullGlob, {
5151
5150
  absolute: !0,
5152
5151
  cwd: workingDir,
5153
5152
  ...commonGlobOptions(fullGlob)
@@ -5336,7 +5335,7 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
5336
5335
  async extractDocs(specifier, absolutePath, projectTags = []) {
5337
5336
  let relativePath = relative2(this.options.workingDir, absolutePath);
5338
5337
  try {
5339
- let normalizedPath = normalizeStoryPath(relativePath), importPath = slash(normalizedPath), content = await readFile(absolutePath, { encoding: "utf8" }), { analyze } = await import("../_node-chunks/dist-N6JBF72Y.js"), result = await analyze(content);
5338
+ let normalizedPath = normalizeStoryPath(relativePath), importPath = slash(normalizedPath), content = await readFile(absolutePath, { encoding: "utf8" }), { analyze } = await import("../_node-chunks/dist-I5B62EXZ.js"), result = await analyze(content);
5340
5339
  if (result.isTemplate)
5341
5340
  return !1;
5342
5341
  let absoluteImports = result.imports.map(
@@ -5596,7 +5595,7 @@ function print(p) {
5596
5595
  // src/core-server/utils/get-builders.ts
5597
5596
  import { MissingBuilderError } from "storybook/internal/server-errors";
5598
5597
  async function getManagerBuilder() {
5599
- return await import("../_node-chunks/builder-manager-IP6Y4NMN.js");
5598
+ return await import("../_node-chunks/builder-manager-EHXLCHEO.js");
5600
5599
  }
5601
5600
  async function getPreviewBuilder(resolvedPreviewBuilder) {
5602
5601
  return await importModule(resolvedPreviewBuilder);
@@ -5696,7 +5695,7 @@ function watchStorySpecifiers(specifiers, options, onInvalidate) {
5696
5695
  // files can be e.g. '**/foo/*/*.js' so we just want the last bit,
5697
5696
  // because the directory could already be within the files part (e.g. './x/foo/bar')
5698
5697
  basename2(specifier.files)
5699
- ), { globby } = await import("../_node-chunks/globby-EBHKFBTA.js");
5698
+ ), { globby } = await import("../_node-chunks/globby-VVFDARVQ.js");
5700
5699
  (await globby(slash(dirGlob), commonGlobOptions2(dirGlob))).forEach((filePath) => {
5701
5700
  let fileImportPath = toImportPath(filePath);
5702
5701
  specifier.importPathMatcher.exec(fileImportPath) && onInvalidate(specifier, fileImportPath, removed);
@@ -5744,8 +5743,8 @@ function useStoriesJson({
5744
5743
  let maybeInvalidate = debounce(() => serverChannel.emit(STORY_INDEX_INVALIDATED), DEBOUNCE, {
5745
5744
  edges: ["leading", "trailing"]
5746
5745
  });
5747
- watchStorySpecifiers(normalizedStories, { workingDir }, async (specifier, path3, removed) => {
5748
- (await initializedStoryIndexGenerator).invalidate(specifier, path3, removed), maybeInvalidate();
5746
+ watchStorySpecifiers(normalizedStories, { workingDir }, async (specifier, path2, removed) => {
5747
+ (await initializedStoryIndexGenerator).invalidate(specifier, path2, removed), maybeInvalidate();
5749
5748
  }), configDir && watchConfig(configDir, async (filePath) => {
5750
5749
  basename3(filePath).startsWith("preview") && ((await initializedStoryIndexGenerator).invalidateAll(), maybeInvalidate());
5751
5750
  }), app.use("/index.json", async (req, res) => {
@@ -6100,8 +6099,8 @@ var mount = (fn) => fn instanceof Polka ? fn.attach : fn, Polka = class _Polka e
6100
6099
  return (this.server = this.server || http.createServer()).on("request", this.attach), this.server.listen.apply(this.server, arguments), this;
6101
6100
  }
6102
6101
  handler(req, res, next) {
6103
- let info = this.parse(req), path3 = info.pathname, obj = this.find(req.method, req.path = path3);
6104
- if (req.url = path3 + info.search, req.originalUrl = req.originalUrl || req.url, req.query = info.query || {}, req.search = info.search, req.params = obj.params, path3.length > 1 && path3.indexOf("%", 1) !== -1)
6102
+ let info = this.parse(req), path2 = info.pathname, obj = this.find(req.method, req.path = path2);
6103
+ if (req.url = path2 + info.search, req.originalUrl = req.originalUrl || req.url, req.query = info.query || {}, req.search = info.search, req.params = obj.params, path2.length > 1 && path2.indexOf("%", 1) !== -1)
6105
6104
  for (let k in req.params)
6106
6105
  try {
6107
6106
  req.params[k] = decodeURIComponent(req.params[k]);
@@ -6631,389 +6630,16 @@ async function getMiddleware(configDir) {
6631
6630
  };
6632
6631
  }
6633
6632
 
6634
- // src/core-server/utils/open-browser/open-in-browser.ts
6635
- import { logger as logger5 } from "storybook/internal/node-logger";
6636
-
6637
- // ../node_modules/open/index.js
6638
- import process7 from "node:process";
6639
- import { Buffer as Buffer2 } from "node:buffer";
6640
- import path2 from "node:path";
6641
- import { fileURLToPath } from "node:url";
6642
- import { promisify as promisify5 } from "node:util";
6643
- import childProcess from "node:child_process";
6644
- import fs5, { constants as fsConstants2 } from "node:fs/promises";
6645
-
6646
- // ../node_modules/wsl-utils/index.js
6647
- import process3 from "node:process";
6648
- import fs4, { constants as fsConstants } from "node:fs/promises";
6649
-
6650
- // ../node_modules/is-wsl/index.js
6651
- import process2 from "node:process";
6652
- import os from "node:os";
6653
- import fs3 from "node:fs";
6654
-
6655
- // ../node_modules/is-inside-container/index.js
6656
- import fs2 from "node:fs";
6657
-
6658
- // ../node_modules/is-inside-container/node_modules/is-docker/index.js
6659
- import fs from "node:fs";
6660
- var isDockerCached;
6661
- function hasDockerEnv() {
6662
- try {
6663
- return fs.statSync("/.dockerenv"), !0;
6664
- } catch {
6665
- return !1;
6666
- }
6667
- }
6668
- function hasDockerCGroup() {
6669
- try {
6670
- return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
6671
- } catch {
6672
- return !1;
6673
- }
6674
- }
6675
- function isDocker() {
6676
- return isDockerCached === void 0 && (isDockerCached = hasDockerEnv() || hasDockerCGroup()), isDockerCached;
6677
- }
6678
-
6679
- // ../node_modules/is-inside-container/index.js
6680
- var cachedResult, hasContainerEnv = () => {
6681
- try {
6682
- return fs2.statSync("/run/.containerenv"), !0;
6683
- } catch {
6684
- return !1;
6685
- }
6686
- };
6687
- function isInsideContainer() {
6688
- return cachedResult === void 0 && (cachedResult = hasContainerEnv() || isDocker()), cachedResult;
6689
- }
6690
-
6691
- // ../node_modules/is-wsl/index.js
6692
- var isWsl = () => {
6693
- if (process2.platform !== "linux")
6694
- return !1;
6695
- if (os.release().toLowerCase().includes("microsoft"))
6696
- return !isInsideContainer();
6697
- try {
6698
- return fs3.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : !1;
6699
- } catch {
6700
- return !1;
6701
- }
6702
- }, is_wsl_default = process2.env.__IS_WSL_TEST__ ? isWsl : isWsl();
6703
-
6704
- // ../node_modules/wsl-utils/index.js
6705
- var wslDrivesMountPoint = /* @__PURE__ */ (() => {
6706
- let defaultMountPoint = "/mnt/", mountPoint;
6707
- return async function() {
6708
- if (mountPoint)
6709
- return mountPoint;
6710
- let configFilePath = "/etc/wsl.conf", isConfigFileExists = !1;
6711
- try {
6712
- await fs4.access(configFilePath, fsConstants.F_OK), isConfigFileExists = !0;
6713
- } catch {
6714
- }
6715
- if (!isConfigFileExists)
6716
- return defaultMountPoint;
6717
- let configContent = await fs4.readFile(configFilePath, { encoding: "utf8" }), configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
6718
- return configMountPoint ? (mountPoint = configMountPoint.groups.mountPoint.trim(), mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`, mountPoint) : defaultMountPoint;
6719
- };
6720
- })(), powerShellPathFromWsl = async () => `${await wslDrivesMountPoint()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`, powerShellPath = async () => is_wsl_default ? powerShellPathFromWsl() : `${process3.env.SYSTEMROOT || process3.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
6721
-
6722
- // ../node_modules/define-lazy-prop/index.js
6723
- function defineLazyProperty(object, propertyName, valueGetter) {
6724
- let define = (value) => Object.defineProperty(object, propertyName, { value, enumerable: !0, writable: !0 });
6725
- return Object.defineProperty(object, propertyName, {
6726
- configurable: !0,
6727
- enumerable: !0,
6728
- get() {
6729
- let result = valueGetter();
6730
- return define(result), result;
6731
- },
6732
- set(value) {
6733
- define(value);
6734
- }
6735
- }), object;
6736
- }
6737
-
6738
- // ../node_modules/default-browser/index.js
6739
- import { promisify as promisify4 } from "node:util";
6740
- import process6 from "node:process";
6741
- import { execFile as execFile4 } from "node:child_process";
6742
-
6743
- // ../node_modules/default-browser-id/index.js
6744
- import { promisify } from "node:util";
6745
- import process4 from "node:process";
6746
- import { execFile } from "node:child_process";
6747
- var execFileAsync = promisify(execFile);
6748
- async function defaultBrowserId() {
6749
- if (process4.platform !== "darwin")
6750
- throw new Error("macOS only");
6751
- let { stdout } = await execFileAsync("defaults", ["read", "com.apple.LaunchServices/com.apple.launchservices.secure", "LSHandlers"]), browserId = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout)?.groups.id ?? "com.apple.Safari";
6752
- return browserId === "com.apple.safari" ? "com.apple.Safari" : browserId;
6753
- }
6754
-
6755
- // ../node_modules/run-applescript/index.js
6756
- import process5 from "node:process";
6757
- import { promisify as promisify2 } from "node:util";
6758
- import { execFile as execFile2, execFileSync } from "node:child_process";
6759
- var execFileAsync2 = promisify2(execFile2);
6760
- async function runAppleScript(script, { humanReadableOutput = !0, signal } = {}) {
6761
- if (process5.platform !== "darwin")
6762
- throw new Error("macOS only");
6763
- let outputArguments = humanReadableOutput ? [] : ["-ss"], execOptions = {};
6764
- signal && (execOptions.signal = signal);
6765
- let { stdout } = await execFileAsync2("osascript", ["-e", script, outputArguments], execOptions);
6766
- return stdout.trim();
6767
- }
6768
-
6769
- // ../node_modules/bundle-name/index.js
6770
- async function bundleName(bundleId) {
6771
- return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string
6772
- tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
6773
- }
6774
-
6775
- // ../node_modules/default-browser/windows.js
6776
- import { promisify as promisify3 } from "node:util";
6777
- import { execFile as execFile3 } from "node:child_process";
6778
- var execFileAsync3 = promisify3(execFile3), windowsBrowserProgIds = {
6779
- MSEdgeHTM: { name: "Edge", id: "com.microsoft.edge" },
6780
- // The missing `L` is correct.
6781
- MSEdgeBHTML: { name: "Edge Beta", id: "com.microsoft.edge.beta" },
6782
- MSEdgeDHTML: { name: "Edge Dev", id: "com.microsoft.edge.dev" },
6783
- AppXq0fevzme2pys62n3e0fbqa7peapykr8v: { name: "Edge", id: "com.microsoft.edge.old" },
6784
- ChromeHTML: { name: "Chrome", id: "com.google.chrome" },
6785
- ChromeBHTML: { name: "Chrome Beta", id: "com.google.chrome.beta" },
6786
- ChromeDHTML: { name: "Chrome Dev", id: "com.google.chrome.dev" },
6787
- ChromiumHTM: { name: "Chromium", id: "org.chromium.Chromium" },
6788
- BraveHTML: { name: "Brave", id: "com.brave.Browser" },
6789
- BraveBHTML: { name: "Brave Beta", id: "com.brave.Browser.beta" },
6790
- BraveDHTML: { name: "Brave Dev", id: "com.brave.Browser.dev" },
6791
- BraveSSHTM: { name: "Brave Nightly", id: "com.brave.Browser.nightly" },
6792
- FirefoxURL: { name: "Firefox", id: "org.mozilla.firefox" },
6793
- OperaStable: { name: "Opera", id: "com.operasoftware.Opera" },
6794
- VivaldiHTM: { name: "Vivaldi", id: "com.vivaldi.Vivaldi" },
6795
- "IE.HTTP": { name: "Internet Explorer", id: "com.microsoft.ie" }
6796
- }, _windowsBrowserProgIdMap = new Map(Object.entries(windowsBrowserProgIds)), UnknownBrowserError = class extends Error {
6797
- };
6798
- async function defaultBrowser(_execFileAsync = execFileAsync3) {
6799
- let { stdout } = await _execFileAsync("reg", [
6800
- "QUERY",
6801
- " HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
6802
- "/v",
6803
- "ProgId"
6804
- ]), match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout);
6805
- if (!match)
6806
- throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);
6807
- let { id } = match.groups, browser = windowsBrowserProgIds[id];
6808
- if (!browser)
6809
- throw new UnknownBrowserError(`Unknown browser ID: ${id}`);
6810
- return browser;
6811
- }
6812
-
6813
- // ../node_modules/default-browser/index.js
6814
- var execFileAsync4 = promisify4(execFile4), titleize = (string) => string.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x) => x.toUpperCase());
6815
- async function defaultBrowser2() {
6816
- if (process6.platform === "darwin") {
6817
- let id = await defaultBrowserId();
6818
- return { name: await bundleName(id), id };
6819
- }
6820
- if (process6.platform === "linux") {
6821
- let { stdout } = await execFileAsync4("xdg-mime", ["query", "default", "x-scheme-handler/http"]), id = stdout.trim();
6822
- return { name: titleize(id.replace(/.desktop$/, "").replace("-", " ")), id };
6823
- }
6824
- if (process6.platform === "win32")
6825
- return defaultBrowser();
6826
- throw new Error("Only macOS, Linux, and Windows are supported");
6827
- }
6828
-
6829
- // ../node_modules/open/index.js
6830
- var execFile5 = promisify5(childProcess.execFile), __dirname2 = path2.dirname(fileURLToPath(import.meta.url)), localXdgOpenPath = path2.join(__dirname2, "xdg-open"), { platform, arch } = process7;
6831
- async function getWindowsDefaultBrowserFromWsl() {
6832
- let powershellPath = await powerShellPath(), rawCommand = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`, encodedCommand = Buffer2.from(rawCommand, "utf16le").toString("base64"), { stdout } = await execFile5(
6833
- powershellPath,
6834
- [
6835
- "-NoProfile",
6836
- "-NonInteractive",
6837
- "-ExecutionPolicy",
6838
- "Bypass",
6839
- "-EncodedCommand",
6840
- encodedCommand
6841
- ],
6842
- { encoding: "utf8" }
6843
- ), progId = stdout.trim(), browserMap = {
6844
- ChromeHTML: "com.google.chrome",
6845
- BraveHTML: "com.brave.Browser",
6846
- MSEdgeHTM: "com.microsoft.edge",
6847
- FirefoxURL: "org.mozilla.firefox"
6848
- };
6849
- return browserMap[progId] ? { id: browserMap[progId] } : {};
6850
- }
6851
- var pTryEach = async (array, mapper) => {
6852
- let latestError;
6853
- for (let item of array)
6854
- try {
6855
- return await mapper(item);
6856
- } catch (error) {
6857
- latestError = error;
6858
- }
6859
- throw latestError;
6860
- }, baseOpen = async (options) => {
6861
- if (options = {
6862
- wait: !1,
6863
- background: !1,
6864
- newInstance: !1,
6865
- allowNonzeroExitCode: !1,
6866
- ...options
6867
- }, Array.isArray(options.app))
6868
- return pTryEach(options.app, (singleApp) => baseOpen({
6869
- ...options,
6870
- app: singleApp
6871
- }));
6872
- let { name: app, arguments: appArguments = [] } = options.app ?? {};
6873
- if (appArguments = [...appArguments], Array.isArray(app))
6874
- return pTryEach(app, (appName) => baseOpen({
6875
- ...options,
6876
- app: {
6877
- name: appName,
6878
- arguments: appArguments
6879
- }
6880
- }));
6881
- if (app === "browser" || app === "browserPrivate") {
6882
- let ids = {
6883
- "com.google.chrome": "chrome",
6884
- "google-chrome.desktop": "chrome",
6885
- "com.brave.Browser": "brave",
6886
- "org.mozilla.firefox": "firefox",
6887
- "firefox.desktop": "firefox",
6888
- "com.microsoft.msedge": "edge",
6889
- "com.microsoft.edge": "edge",
6890
- "com.microsoft.edgemac": "edge",
6891
- "microsoft-edge.desktop": "edge"
6892
- }, flags = {
6893
- chrome: "--incognito",
6894
- brave: "--incognito",
6895
- firefox: "--private-window",
6896
- edge: "--inPrivate"
6897
- }, browser = is_wsl_default ? await getWindowsDefaultBrowserFromWsl() : await defaultBrowser2();
6898
- if (browser.id in ids) {
6899
- let browserName = ids[browser.id];
6900
- return app === "browserPrivate" && appArguments.push(flags[browserName]), baseOpen({
6901
- ...options,
6902
- app: {
6903
- name: apps[browserName],
6904
- arguments: appArguments
6905
- }
6906
- });
6907
- }
6908
- throw new Error(`${browser.name} is not supported as a default browser`);
6909
- }
6910
- let command, cliArguments = [], childProcessOptions = {};
6911
- if (platform === "darwin")
6912
- command = "open", options.wait && cliArguments.push("--wait-apps"), options.background && cliArguments.push("--background"), options.newInstance && cliArguments.push("--new"), app && cliArguments.push("-a", app);
6913
- else if (platform === "win32" || is_wsl_default && !isInsideContainer() && !app) {
6914
- command = await powerShellPath(), cliArguments.push(
6915
- "-NoProfile",
6916
- "-NonInteractive",
6917
- "-ExecutionPolicy",
6918
- "Bypass",
6919
- "-EncodedCommand"
6920
- ), is_wsl_default || (childProcessOptions.windowsVerbatimArguments = !0);
6921
- let encodedArguments = ["Start"];
6922
- options.wait && encodedArguments.push("-Wait"), app ? (encodedArguments.push(`"\`"${app}\`""`), options.target && appArguments.push(options.target)) : options.target && encodedArguments.push(`"${options.target}"`), appArguments.length > 0 && (appArguments = appArguments.map((argument) => `"\`"${argument}\`""`), encodedArguments.push("-ArgumentList", appArguments.join(","))), options.target = Buffer2.from(encodedArguments.join(" "), "utf16le").toString("base64");
6923
- } else {
6924
- if (app)
6925
- command = app;
6926
- else {
6927
- let isBundled = !__dirname2 || __dirname2 === "/", exeLocalXdgOpen = !1;
6928
- try {
6929
- await fs5.access(localXdgOpenPath, fsConstants2.X_OK), exeLocalXdgOpen = !0;
6930
- } catch {
6931
- }
6932
- command = process7.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
6933
- }
6934
- appArguments.length > 0 && cliArguments.push(...appArguments), options.wait || (childProcessOptions.stdio = "ignore", childProcessOptions.detached = !0);
6935
- }
6936
- platform === "darwin" && appArguments.length > 0 && cliArguments.push("--args", ...appArguments), options.target && cliArguments.push(options.target);
6937
- let subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);
6938
- return options.wait ? new Promise((resolve4, reject) => {
6939
- subprocess.once("error", reject), subprocess.once("close", (exitCode) => {
6940
- if (!options.allowNonzeroExitCode && exitCode > 0) {
6941
- reject(new Error(`Exited with code ${exitCode}`));
6942
- return;
6943
- }
6944
- resolve4(subprocess);
6945
- });
6946
- }) : (subprocess.unref(), subprocess);
6947
- }, open = (target, options) => {
6948
- if (typeof target != "string")
6949
- throw new TypeError("Expected a `target`");
6950
- return baseOpen({
6951
- ...options,
6952
- target
6953
- });
6954
- };
6955
- function detectArchBinary(binary) {
6956
- if (typeof binary == "string" || Array.isArray(binary))
6957
- return binary;
6958
- let { [arch]: archBinary } = binary;
6959
- if (!archBinary)
6960
- throw new Error(`${arch} is not supported`);
6961
- return archBinary;
6962
- }
6963
- function detectPlatformBinary({ [platform]: platformBinary }, { wsl }) {
6964
- if (wsl && is_wsl_default)
6965
- return detectArchBinary(wsl);
6966
- if (!platformBinary)
6967
- throw new Error(`${platform} is not supported`);
6968
- return detectArchBinary(platformBinary);
6969
- }
6970
- var apps = {};
6971
- defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
6972
- darwin: "google chrome",
6973
- win32: "chrome",
6974
- linux: ["google-chrome", "google-chrome-stable", "chromium"]
6975
- }, {
6976
- wsl: {
6977
- ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
6978
- x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
6979
- }
6980
- }));
6981
- defineLazyProperty(apps, "brave", () => detectPlatformBinary({
6982
- darwin: "brave browser",
6983
- win32: "brave",
6984
- linux: ["brave-browser", "brave"]
6985
- }, {
6986
- wsl: {
6987
- ia32: "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",
6988
- x64: ["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe", "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]
6989
- }
6990
- }));
6991
- defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
6992
- darwin: "firefox",
6993
- win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
6994
- linux: "firefox"
6995
- }, {
6996
- wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"
6997
- }));
6998
- defineLazyProperty(apps, "edge", () => detectPlatformBinary({
6999
- darwin: "microsoft edge",
7000
- win32: "msedge",
7001
- linux: ["microsoft-edge", "microsoft-edge-dev"]
7002
- }, {
7003
- wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
7004
- }));
7005
- defineLazyProperty(apps, "browser", () => "browser");
7006
- defineLazyProperty(apps, "browserPrivate", () => "browserPrivate");
7007
- var open_default = open;
7008
-
7009
6633
  // src/core-server/utils/open-browser/open-in-browser.ts
7010
6634
  var import_ts_dedent4 = __toESM(require_dist(), 1);
6635
+ import { logger as logger5 } from "storybook/internal/node-logger";
6636
+ import open2 from "open";
7011
6637
 
7012
6638
  // src/core-server/utils/open-browser/opener.ts
7013
- var import_cross_spawn = __toESM(require_cross_spawn(), 1);
6639
+ var import_cross_spawn = __toESM(require_cross_spawn(), 1), import_picocolors5 = __toESM(require_picocolors(), 1);
7014
6640
  import { execSync } from "node:child_process";
7015
6641
  import { join as join6 } from "node:path";
7016
- var import_picocolors5 = __toESM(require_picocolors(), 1);
6642
+ import open from "open";
7017
6643
  var OSX_CHROME = "google chrome", Actions = Object.freeze({
7018
6644
  NONE: 0,
7019
6645
  BROWSER: 1,
@@ -7066,7 +6692,7 @@ function startBrowserProcess(browser, url, args) {
7066
6692
  }
7067
6693
  process.platform === "darwin" && browser === "open" && (browser = void 0), typeof browser == "string" && args.length > 0 && (browser = [browser].concat(args));
7068
6694
  try {
7069
- return open_default(url, { app: browser, wait: !1, url: !0 }).catch(() => {
6695
+ return open(url, { app: browser, wait: !1, url: !0 }).catch(() => {
7070
6696
  }), !0;
7071
6697
  } catch {
7072
6698
  return !1;
@@ -7098,7 +6724,7 @@ async function openInBrowser(address) {
7098
6724
  errorOccured = !0;
7099
6725
  }
7100
6726
  try {
7101
- errorOccured && (await open_default(address), errorOccured = !1);
6727
+ errorOccured && (await open2(address), errorOccured = !1);
7102
6728
  } catch {
7103
6729
  errorOccured = !0;
7104
6730
  }
@@ -7111,7 +6737,7 @@ async function openInBrowser(address) {
7111
6737
 
7112
6738
  // src/core-server/utils/server-address.ts
7113
6739
  var import_detect_port = __toESM(require_detect_port2(), 1);
7114
- import os2 from "node:os";
6740
+ import os from "node:os";
7115
6741
  import { logger as logger6 } from "storybook/internal/node-logger";
7116
6742
  function getServerAddresses(port, host, proto, initialPath) {
7117
6743
  let address = new URL(`${proto}://localhost:${port}/`), networkAddress = new URL(`${proto}://${host || getLocalIp()}:${port}/`);
@@ -7129,7 +6755,7 @@ function getServerAddresses(port, host, proto, initialPath) {
7129
6755
  var getServerPort = (port, { exactPort } = {}) => (0, import_detect_port.default)(port).then((freePort) => (freePort !== port && exactPort && process.exit(-1), freePort)).catch((error) => {
7130
6756
  logger6.error(error), process.exit(-1);
7131
6757
  }), getServerChannelUrl = (port, { https: https2 }) => `${https2 ? "wss" : "ws"}://localhost:${port}/storybook-server-channel`, getLocalIp = () => {
7132
- let allFilteredIps = Object.values(os2.networkInterfaces()).flat().filter((ip) => ip && ip.family === "IPv4" && !ip.internal);
6758
+ let allFilteredIps = Object.values(os.networkInterfaces()).flat().filter((ip) => ip && ip.family === "IPv4" && !ip.internal);
7133
6759
  return allFilteredIps.length ? allFilteredIps[0]?.address : "0.0.0.0";
7134
6760
  };
7135
6761
 
@@ -7471,14 +7097,14 @@ async function warnWhenUsingArgTypesRegex(previewConfigPath, config) {
7471
7097
  { filename: previewConfigPath },
7472
7098
  { code: previewContent, ast: babelParse(previewContent) }
7473
7099
  ).path.traverse({
7474
- Identifier: (path3) => {
7475
- if (path3.node.name === "argTypesRegex") {
7100
+ Identifier: (path2) => {
7101
+ if (path2.node.name === "argTypesRegex") {
7476
7102
  let message = import_ts_dedent7.dedent`
7477
7103
  ${import_picocolors9.default.bold("Attention")}: We've detected that you're using ${import_picocolors9.default.cyan(
7478
7104
  "actions.argTypesRegex"
7479
7105
  )} together with the visual test addon:
7480
7106
 
7481
- ${path3.buildCodeFrameError(previewConfigPath).message}
7107
+ ${path2.buildCodeFrameError(previewConfigPath).message}
7482
7108
 
7483
7109
  We recommend removing the ${import_picocolors9.default.cyan(
7484
7110
  "argTypesRegex"