vite 4.3.2 → 4.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of vite might be problematic. Click here for more details.

@@ -2,6 +2,7 @@ import fs$l, { promises as promises$2 } from 'node:fs';
2
2
  import fsp from 'node:fs/promises';
3
3
  import path$o, { dirname as dirname$2, join as join$2, posix as posix$1, isAbsolute as isAbsolute$2, relative as relative$2, basename as basename$2, extname as extname$1 } from 'node:path';
4
4
  import { fileURLToPath, URL as URL$3, URLSearchParams, parse as parse$i, pathToFileURL } from 'node:url';
5
+ import { promisify as promisify$4, format as format$2, inspect } from 'node:util';
5
6
  import { performance as performance$1 } from 'node:perf_hooks';
6
7
  import { createRequire as createRequire$1, builtinModules } from 'node:module';
7
8
  import require$$0$3 from 'tty';
@@ -25,7 +26,6 @@ import { promises } from 'node:dns';
25
26
  import { CLIENT_ENTRY, OPTIMIZABLE_ENTRY_RE, wildcardHosts, loopbackHosts, VALID_ID_PREFIX, NULL_BYTE_PLACEHOLDER, FS_PREFIX, CLIENT_PUBLIC_PATH, ENV_PUBLIC_PATH, ENV_ENTRY, DEFAULT_MAIN_FIELDS, DEFAULT_EXTENSIONS as DEFAULT_EXTENSIONS$1, SPECIAL_QUERY_RE, DEP_VERSION_RE, CSS_LANGS_RE, KNOWN_ASSET_TYPES, CLIENT_DIR, JS_TYPES_RE, ESBUILD_MODULES_TARGET, VERSION as VERSION$1, VITE_PACKAGE_DIR, DEFAULT_DEV_PORT, DEFAULT_PREVIEW_PORT, DEFAULT_ASSETS_RE, DEFAULT_CONFIG_FILES } from '../constants.js';
26
27
  import require$$5$1 from 'crypto';
27
28
  import { Buffer as Buffer$1 } from 'node:buffer';
28
- import { promisify as promisify$4, format as format$2, inspect } from 'node:util';
29
29
  import require$$0$8, { createRequire as createRequire$2 } from 'module';
30
30
  import assert$1 from 'node:assert';
31
31
  import process$1 from 'node:process';
@@ -84,11 +84,7 @@ function getAugmentedNamespace(n) {
84
84
  return a;
85
85
  }
86
86
 
87
- var picocolorsExports = {};
88
- var picocolors = {
89
- get exports(){ return picocolorsExports; },
90
- set exports(v){ picocolorsExports = v; },
91
- };
87
+ var picocolors = {exports: {}};
92
88
 
93
89
  let tty = require$$0$3;
94
90
 
@@ -147,7 +143,10 @@ let createColors = (enabled = isColorSupported) => ({
147
143
  });
148
144
 
149
145
  picocolors.exports = createColors();
150
- picocolorsExports.createColors = createColors;
146
+ picocolors.exports.createColors = createColors;
147
+
148
+ var picocolorsExports = picocolors.exports;
149
+ var colors$1 = /*@__PURE__*/getDefaultExportFromCjs(picocolorsExports);
151
150
 
152
151
  function matches$1(pattern, importee) {
153
152
  if (pattern instanceof RegExp) {
@@ -429,12 +428,6 @@ function walk$4(ast, { enter, leave }) {
429
428
  return instance.visit(ast, null);
430
429
  }
431
430
 
432
- var picomatchExports = {};
433
- var picomatch$5 = {
434
- get exports(){ return picomatchExports; },
435
- set exports(v){ picomatchExports = v; },
436
- };
437
-
438
431
  var utils$k = {};
439
432
 
440
433
  const path$n = require$$0$4;
@@ -678,7 +671,7 @@ var constants$6 = {
678
671
  output = `(?:^(?!${output}).*$)`;
679
672
  }
680
673
  return output;
681
- };
674
+ };
682
675
  } (utils$k));
683
676
 
684
677
  const utils$j = utils$k;
@@ -2183,9 +2176,9 @@ const isObject$4 = val => val && typeof val === 'object' && !Array.isArray(val);
2183
2176
  * @api public
2184
2177
  */
2185
2178
 
2186
- const picomatch$4 = (glob, options, returnState = false) => {
2179
+ const picomatch$5 = (glob, options, returnState = false) => {
2187
2180
  if (Array.isArray(glob)) {
2188
- const fns = glob.map(input => picomatch$4(input, options, returnState));
2181
+ const fns = glob.map(input => picomatch$5(input, options, returnState));
2189
2182
  const arrayMatcher = str => {
2190
2183
  for (const isMatch of fns) {
2191
2184
  const state = isMatch(str);
@@ -2205,8 +2198,8 @@ const picomatch$4 = (glob, options, returnState = false) => {
2205
2198
  const opts = options || {};
2206
2199
  const posix = utils$h.isWindows(options);
2207
2200
  const regex = isState
2208
- ? picomatch$4.compileRe(glob, options)
2209
- : picomatch$4.makeRe(glob, options, false, true);
2201
+ ? picomatch$5.compileRe(glob, options)
2202
+ : picomatch$5.makeRe(glob, options, false, true);
2210
2203
 
2211
2204
  const state = regex.state;
2212
2205
  delete regex.state;
@@ -2214,11 +2207,11 @@ const picomatch$4 = (glob, options, returnState = false) => {
2214
2207
  let isIgnored = () => false;
2215
2208
  if (opts.ignore) {
2216
2209
  const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
2217
- isIgnored = picomatch$4(opts.ignore, ignoreOpts, returnState);
2210
+ isIgnored = picomatch$5(opts.ignore, ignoreOpts, returnState);
2218
2211
  }
2219
2212
 
2220
2213
  const matcher = (input, returnObject = false) => {
2221
- const { isMatch, match, output } = picomatch$4.test(input, regex, options, { glob, posix });
2214
+ const { isMatch, match, output } = picomatch$5.test(input, regex, options, { glob, posix });
2222
2215
  const result = { glob, state, regex, posix, input, output, match, isMatch };
2223
2216
 
2224
2217
  if (typeof opts.onResult === 'function') {
@@ -2268,7 +2261,7 @@ const picomatch$4 = (glob, options, returnState = false) => {
2268
2261
  * @api public
2269
2262
  */
2270
2263
 
2271
- picomatch$4.test = (input, regex, options, { glob, posix } = {}) => {
2264
+ picomatch$5.test = (input, regex, options, { glob, posix } = {}) => {
2272
2265
  if (typeof input !== 'string') {
2273
2266
  throw new TypeError('Expected input to be a string');
2274
2267
  }
@@ -2289,7 +2282,7 @@ picomatch$4.test = (input, regex, options, { glob, posix } = {}) => {
2289
2282
 
2290
2283
  if (match === false || opts.capture === true) {
2291
2284
  if (opts.matchBase === true || opts.basename === true) {
2292
- match = picomatch$4.matchBase(input, regex, options, posix);
2285
+ match = picomatch$5.matchBase(input, regex, options, posix);
2293
2286
  } else {
2294
2287
  match = regex.exec(output);
2295
2288
  }
@@ -2312,8 +2305,8 @@ picomatch$4.test = (input, regex, options, { glob, posix } = {}) => {
2312
2305
  * @api public
2313
2306
  */
2314
2307
 
2315
- picomatch$4.matchBase = (input, glob, options, posix = utils$h.isWindows(options)) => {
2316
- const regex = glob instanceof RegExp ? glob : picomatch$4.makeRe(glob, options);
2308
+ picomatch$5.matchBase = (input, glob, options, posix = utils$h.isWindows(options)) => {
2309
+ const regex = glob instanceof RegExp ? glob : picomatch$5.makeRe(glob, options);
2317
2310
  return regex.test(path$m.basename(input));
2318
2311
  };
2319
2312
 
@@ -2334,7 +2327,7 @@ picomatch$4.matchBase = (input, glob, options, posix = utils$h.isWindows(options
2334
2327
  * @api public
2335
2328
  */
2336
2329
 
2337
- picomatch$4.isMatch = (str, patterns, options) => picomatch$4(patterns, options)(str);
2330
+ picomatch$5.isMatch = (str, patterns, options) => picomatch$5(patterns, options)(str);
2338
2331
 
2339
2332
  /**
2340
2333
  * Parse a glob pattern to create the source string for a regular
@@ -2350,8 +2343,8 @@ picomatch$4.isMatch = (str, patterns, options) => picomatch$4(patterns, options)
2350
2343
  * @api public
2351
2344
  */
2352
2345
 
2353
- picomatch$4.parse = (pattern, options) => {
2354
- if (Array.isArray(pattern)) return pattern.map(p => picomatch$4.parse(p, options));
2346
+ picomatch$5.parse = (pattern, options) => {
2347
+ if (Array.isArray(pattern)) return pattern.map(p => picomatch$5.parse(p, options));
2355
2348
  return parse$g(pattern, { ...options, fastpaths: false });
2356
2349
  };
2357
2350
 
@@ -2382,7 +2375,7 @@ picomatch$4.parse = (pattern, options) => {
2382
2375
  * @api public
2383
2376
  */
2384
2377
 
2385
- picomatch$4.scan = (input, options) => scan$1(input, options);
2378
+ picomatch$5.scan = (input, options) => scan$1(input, options);
2386
2379
 
2387
2380
  /**
2388
2381
  * Compile a regular expression from the `state` object returned by the
@@ -2396,7 +2389,7 @@ picomatch$4.scan = (input, options) => scan$1(input, options);
2396
2389
  * @api public
2397
2390
  */
2398
2391
 
2399
- picomatch$4.compileRe = (state, options, returnOutput = false, returnState = false) => {
2392
+ picomatch$5.compileRe = (state, options, returnOutput = false, returnState = false) => {
2400
2393
  if (returnOutput === true) {
2401
2394
  return state.output;
2402
2395
  }
@@ -2410,7 +2403,7 @@ picomatch$4.compileRe = (state, options, returnOutput = false, returnState = fal
2410
2403
  source = `^(?!${source}).*$`;
2411
2404
  }
2412
2405
 
2413
- const regex = picomatch$4.toRegex(source, options);
2406
+ const regex = picomatch$5.toRegex(source, options);
2414
2407
  if (returnState === true) {
2415
2408
  regex.state = state;
2416
2409
  }
@@ -2437,7 +2430,7 @@ picomatch$4.compileRe = (state, options, returnOutput = false, returnState = fal
2437
2430
  * @api public
2438
2431
  */
2439
2432
 
2440
- picomatch$4.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
2433
+ picomatch$5.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
2441
2434
  if (!input || typeof input !== 'string') {
2442
2435
  throw new TypeError('Expected a non-empty string');
2443
2436
  }
@@ -2452,7 +2445,7 @@ picomatch$4.makeRe = (input, options = {}, returnOutput = false, returnState = f
2452
2445
  parsed = parse$g(input, options);
2453
2446
  }
2454
2447
 
2455
- return picomatch$4.compileRe(parsed, options, returnOutput, returnState);
2448
+ return picomatch$5.compileRe(parsed, options, returnOutput, returnState);
2456
2449
  };
2457
2450
 
2458
2451
  /**
@@ -2472,7 +2465,7 @@ picomatch$4.makeRe = (input, options = {}, returnOutput = false, returnState = f
2472
2465
  * @api public
2473
2466
  */
2474
2467
 
2475
- picomatch$4.toRegex = (source, options) => {
2468
+ picomatch$5.toRegex = (source, options) => {
2476
2469
  try {
2477
2470
  const opts = options || {};
2478
2471
  return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
@@ -2487,20 +2480,17 @@ picomatch$4.toRegex = (source, options) => {
2487
2480
  * @return {Object}
2488
2481
  */
2489
2482
 
2490
- picomatch$4.constants = constants$4;
2483
+ picomatch$5.constants = constants$4;
2491
2484
 
2492
2485
  /**
2493
2486
  * Expose "picomatch"
2494
2487
  */
2495
2488
 
2496
- var picomatch_1 = picomatch$4;
2497
-
2498
- (function (module) {
2489
+ var picomatch_1 = picomatch$5;
2499
2490
 
2500
- module.exports = picomatch_1;
2501
- } (picomatch$5));
2491
+ var picomatch$3 = picomatch_1;
2502
2492
 
2503
- var picomatch$3 = /*@__PURE__*/getDefaultExportFromCjs(picomatchExports);
2493
+ var picomatch$4 = /*@__PURE__*/getDefaultExportFromCjs(picomatch$3);
2504
2494
 
2505
2495
  const extractors = {
2506
2496
  ArrayPattern(names, param) {
@@ -2680,7 +2670,7 @@ const createFilter$1 = function createFilter(include, exclude, options) {
2680
2670
  test: (what) => {
2681
2671
  // this refactor is a tad overly verbose but makes for easy debugging
2682
2672
  const pattern = getMatcherString(id, resolutionBase);
2683
- const fn = picomatch$3(pattern, { dot: true });
2673
+ const fn = picomatch$4(pattern, { dot: true });
2684
2674
  const result = fn(what);
2685
2675
  return result;
2686
2676
  }
@@ -2836,6 +2826,8 @@ var commondir = function (basedir, relfiles) {
2836
2826
  return res.length > 1 ? res.join('/') : '/'
2837
2827
  };
2838
2828
 
2829
+ var getCommonDir = /*@__PURE__*/getDefaultExportFromCjs(commondir);
2830
+
2839
2831
  var old$1 = {};
2840
2832
 
2841
2833
  // Copyright Joyent, Inc. and other Node contributors.
@@ -4374,22 +4366,14 @@ let Minimatch$1 = class Minimatch {
4374
4366
 
4375
4367
  minimatch$1.Minimatch = Minimatch$1;
4376
4368
 
4377
- var inheritsExports = {};
4378
- var inherits = {
4379
- get exports(){ return inheritsExports; },
4380
- set exports(v){ inheritsExports = v; },
4381
- };
4369
+ var inherits = {exports: {}};
4382
4370
 
4383
- var inherits_browserExports = {};
4384
- var inherits_browser = {
4385
- get exports(){ return inherits_browserExports; },
4386
- set exports(v){ inherits_browserExports = v; },
4387
- };
4371
+ var inherits_browser = {exports: {}};
4388
4372
 
4389
4373
  var hasRequiredInherits_browser;
4390
4374
 
4391
4375
  function requireInherits_browser () {
4392
- if (hasRequiredInherits_browser) return inherits_browserExports;
4376
+ if (hasRequiredInherits_browser) return inherits_browser.exports;
4393
4377
  hasRequiredInherits_browser = 1;
4394
4378
  if (typeof Object.create === 'function') {
4395
4379
  // implementation from standard node.js 'util' module
@@ -4418,20 +4402,20 @@ function requireInherits_browser () {
4418
4402
  }
4419
4403
  };
4420
4404
  }
4421
- return inherits_browserExports;
4405
+ return inherits_browser.exports;
4422
4406
  }
4423
4407
 
4424
- (function (module) {
4425
- try {
4426
- var util = require('util');
4427
- /* istanbul ignore next */
4428
- if (typeof util.inherits !== 'function') throw '';
4429
- module.exports = util.inherits;
4430
- } catch (e) {
4431
- /* istanbul ignore next */
4432
- module.exports = requireInherits_browser();
4433
- }
4434
- } (inherits));
4408
+ try {
4409
+ var util$2 = require('util');
4410
+ /* istanbul ignore next */
4411
+ if (typeof util$2.inherits !== 'function') throw '';
4412
+ inherits.exports = util$2.inherits;
4413
+ } catch (e) {
4414
+ /* istanbul ignore next */
4415
+ inherits.exports = requireInherits_browser();
4416
+ }
4417
+
4418
+ var inheritsExports = inherits.exports;
4435
4419
 
4436
4420
  var common$c = {};
4437
4421
 
@@ -5199,15 +5183,11 @@ function wrappy$2 (fn, cb) {
5199
5183
  }
5200
5184
  }
5201
5185
 
5202
- var onceExports = {};
5203
- var once$2 = {
5204
- get exports(){ return onceExports; },
5205
- set exports(v){ onceExports = v; },
5206
- };
5186
+ var once$2 = {exports: {}};
5207
5187
 
5208
5188
  var wrappy$1 = wrappy_1;
5209
5189
  once$2.exports = wrappy$1(once$1);
5210
- onceExports.strict = wrappy$1(onceStrict);
5190
+ once$2.exports.strict = wrappy$1(onceStrict);
5211
5191
 
5212
5192
  once$1.proto = once$1(function () {
5213
5193
  Object.defineProperty(Function.prototype, 'once', {
@@ -5248,6 +5228,8 @@ function onceStrict (fn) {
5248
5228
  return f
5249
5229
  }
5250
5230
 
5231
+ var onceExports = once$2.exports;
5232
+
5251
5233
  var wrappy = wrappy_1;
5252
5234
  var reqs = Object.create(null);
5253
5235
  var once = onceExports;
@@ -6098,7 +6080,7 @@ function requireGlob () {
6098
6080
  }
6099
6081
 
6100
6082
  var globExports = requireGlob();
6101
- var glob = /*@__PURE__*/getDefaultExportFromCjs(globExports);
6083
+ var glob$1 = /*@__PURE__*/getDefaultExportFromCjs(globExports);
6102
6084
 
6103
6085
  const comma = ','.charCodeAt(0);
6104
6086
  const semicolon = ';'.charCodeAt(0);
@@ -7431,7 +7413,7 @@ function isReference(node, parent) {
7431
7413
  return false;
7432
7414
  }
7433
7415
 
7434
- var version$3 = "24.0.1";
7416
+ var version$3 = "24.1.0";
7435
7417
  var peerDependencies = {
7436
7418
  rollup: "^2.68.0||^3.0.0"
7437
7419
  };
@@ -7596,7 +7578,7 @@ function getDynamicRequireModules(patterns, dynamicRequireRoot) {
7596
7578
  isNegated
7597
7579
  ? dynamicRequireModules.delete(targetPath)
7598
7580
  : dynamicRequireModules.set(targetPath, resolvedPath);
7599
- for (const path of glob.sync(isNegated ? pattern.substr(1) : pattern)) {
7581
+ for (const path of glob$1.sync(isNegated ? pattern.substr(1) : pattern)) {
7600
7582
  const resolvedPath = resolve$3(path);
7601
7583
  const requirePath = normalizePathSlashes(resolvedPath);
7602
7584
  if (isDirectory(resolvedPath)) {
@@ -7611,7 +7593,7 @@ function getDynamicRequireModules(patterns, dynamicRequireRoot) {
7611
7593
  }
7612
7594
  }
7613
7595
  return {
7614
- commonDir: dirNames.size ? commondir([...dirNames, dynamicRequireRoot]) : null,
7596
+ commonDir: dirNames.size ? getCommonDir([...dirNames, dynamicRequireRoot]) : null,
7615
7597
  dynamicRequireModules
7616
7598
  };
7617
7599
  }
@@ -7835,13 +7817,16 @@ async function getStaticRequireProxy(id, requireReturnsDefault, loadModule) {
7835
7817
  } = await loadModule({ id });
7836
7818
  if (!commonjsMeta) {
7837
7819
  return getUnknownRequireProxy(id, requireReturnsDefault);
7838
- } else if (commonjsMeta.isCommonJS) {
7820
+ }
7821
+ if (commonjsMeta.isCommonJS) {
7839
7822
  return `export { __moduleExports as default } from ${JSON.stringify(id)};`;
7840
- } else if (!requireReturnsDefault) {
7823
+ }
7824
+ if (!requireReturnsDefault) {
7841
7825
  return `import { getAugmentedNamespace } from "${HELPERS_ID}"; import * as ${name} from ${JSON.stringify(
7842
7826
  id
7843
7827
  )}; export default /*@__PURE__*/getAugmentedNamespace(${name});`;
7844
- } else if (
7828
+ }
7829
+ if (
7845
7830
  requireReturnsDefault !== true &&
7846
7831
  (requireReturnsDefault === 'namespace' ||
7847
7832
  !commonjsMeta.hasDefaultExport ||
@@ -8331,11 +8316,16 @@ function getKeypath(node) {
8331
8316
 
8332
8317
  const KEY_COMPILED_ESM = '__esModule';
8333
8318
 
8334
- function isDefineCompiledEsm(node) {
8319
+ function getDefineCompiledEsmType(node) {
8320
+ const definedPropertyWithExports = getDefinePropertyCallName(node, 'exports');
8335
8321
  const definedProperty =
8336
- getDefinePropertyCallName(node, 'exports') || getDefinePropertyCallName(node, 'module.exports');
8322
+ definedPropertyWithExports || getDefinePropertyCallName(node, 'module.exports');
8337
8323
  if (definedProperty && definedProperty.key === KEY_COMPILED_ESM) {
8338
- return isTruthy(definedProperty.value);
8324
+ return isTruthy(definedProperty.value)
8325
+ ? definedPropertyWithExports
8326
+ ? 'exports'
8327
+ : 'module'
8328
+ : false;
8339
8329
  }
8340
8330
  return false;
8341
8331
  }
@@ -8379,20 +8369,6 @@ function isShorthandProperty(parent) {
8379
8369
  return parent && parent.type === 'Property' && parent.shorthand;
8380
8370
  }
8381
8371
 
8382
- function hasDefineEsmProperty(node) {
8383
- return node.properties.some((property) => {
8384
- if (
8385
- property.type === 'Property' &&
8386
- property.key.type === 'Identifier' &&
8387
- property.key.name === '__esModule' &&
8388
- isTruthy(property.value)
8389
- ) {
8390
- return true;
8391
- }
8392
- return false;
8393
- });
8394
- }
8395
-
8396
8372
  function wrapCode(magicString, uses, moduleName, exportsName, indentExclusionRanges) {
8397
8373
  const args = [];
8398
8374
  const passedArgs = [];
@@ -8402,19 +8378,22 @@ function wrapCode(magicString, uses, moduleName, exportsName, indentExclusionRan
8402
8378
  }
8403
8379
  if (uses.exports) {
8404
8380
  args.push('exports');
8405
- passedArgs.push(exportsName);
8381
+ passedArgs.push(uses.module ? `${moduleName}.exports` : exportsName);
8406
8382
  }
8407
8383
  magicString
8408
8384
  .trim()
8409
8385
  .indent('\t', { exclude: indentExclusionRanges })
8410
8386
  .prepend(`(function (${args.join(', ')}) {\n`)
8411
- .append(`\n} (${passedArgs.join(', ')}));`);
8387
+ // For some reason, this line is only indented correctly when using a
8388
+ // require-wrapper if we have this leading space
8389
+ .append(` \n} (${passedArgs.join(', ')}));`);
8412
8390
  }
8413
8391
 
8414
8392
  function rewriteExportsAndGetExportsBlock(
8415
8393
  magicString,
8416
8394
  moduleName,
8417
8395
  exportsName,
8396
+ exportedExportsName,
8418
8397
  wrapped,
8419
8398
  moduleExportsAssignments,
8420
8399
  firstTopLevelModuleExportsAssignment,
@@ -8425,7 +8404,6 @@ function rewriteExportsAndGetExportsBlock(
8425
8404
  code,
8426
8405
  HELPERS_NAME,
8427
8406
  exportMode,
8428
- detectWrappedDefault,
8429
8407
  defaultIsModuleExports,
8430
8408
  usesRequireWrapper,
8431
8409
  requireName
@@ -8453,17 +8431,20 @@ function rewriteExportsAndGetExportsBlock(
8453
8431
  exportDeclarations,
8454
8432
  moduleExportsAssignments,
8455
8433
  firstTopLevelModuleExportsAssignment,
8456
- exportsName
8434
+ exportsName,
8435
+ defaultIsModuleExports,
8436
+ HELPERS_NAME
8457
8437
  );
8458
8438
  } else {
8459
- exports.push(`${exportsName} as __moduleExports`);
8439
+ if (exportMode === 'module') {
8440
+ exportDeclarations.push(`var ${exportedExportsName} = ${moduleName}.exports`);
8441
+ exports.push(`${exportedExportsName} as __moduleExports`);
8442
+ } else {
8443
+ exports.push(`${exportsName} as __moduleExports`);
8444
+ }
8460
8445
  if (wrapped) {
8461
- getExportsWhenWrapping(
8462
- exportDeclarations,
8463
- exportsName,
8464
- detectWrappedDefault,
8465
- HELPERS_NAME,
8466
- defaultIsModuleExports
8446
+ exportDeclarations.push(
8447
+ getDefaultExportDeclaration(exportedExportsName, defaultIsModuleExports, HELPERS_NAME)
8467
8448
  );
8468
8449
  } else {
8469
8450
  getExports(
@@ -8476,17 +8457,19 @@ function rewriteExportsAndGetExportsBlock(
8476
8457
  topLevelAssignments,
8477
8458
  moduleName,
8478
8459
  exportsName,
8460
+ exportedExportsName,
8479
8461
  defineCompiledEsmExpressions,
8480
8462
  HELPERS_NAME,
8481
- defaultIsModuleExports
8463
+ defaultIsModuleExports,
8464
+ exportMode
8482
8465
  );
8483
8466
  }
8484
8467
  }
8485
8468
  if (exports.length) {
8486
- exportDeclarations.push(`export { ${exports.join(', ')} };`);
8469
+ exportDeclarations.push(`export { ${exports.join(', ')} }`);
8487
8470
  }
8488
8471
 
8489
- return `\n\n${exportDeclarations.join('\n')}`;
8472
+ return `\n\n${exportDeclarations.join(';\n')};`;
8490
8473
  }
8491
8474
 
8492
8475
  function getExportsWhenUsingRequireWrapper(
@@ -8501,35 +8484,32 @@ function getExportsWhenUsingRequireWrapper(
8501
8484
  requireName,
8502
8485
  defineCompiledEsmExpressions
8503
8486
  ) {
8504
- if (!wrapped) {
8505
- if (exportMode === 'replace') {
8506
- for (const { left } of moduleExportsAssignments) {
8507
- magicString.overwrite(left.start, left.end, exportsName);
8508
- }
8509
- } else {
8510
- // Collect and rewrite module.exports assignments
8511
- for (const { left } of moduleExportsAssignments) {
8512
- magicString.overwrite(left.start, left.end, `${moduleName}.exports`);
8513
- }
8514
- // Collect and rewrite named exports
8515
- for (const [exportName, { nodes }] of exportsAssignmentsByName) {
8516
- for (const node of nodes) {
8517
- magicString.overwrite(node.start, node.left.end, `${exportsName}.${exportName}`);
8518
- }
8519
- }
8520
- // Collect and rewrite exports.__esModule assignments
8521
- for (const expression of defineCompiledEsmExpressions) {
8522
- const moduleExportsExpression =
8523
- expression.type === 'CallExpression' ? expression.arguments[0] : expression.left.object;
8487
+ exports.push(`${requireName} as __require`);
8488
+ if (wrapped) return;
8489
+ if (exportMode === 'replace') {
8490
+ rewriteModuleExportsAssignments(magicString, moduleExportsAssignments, exportsName);
8491
+ } else {
8492
+ rewriteModuleExportsAssignments(magicString, moduleExportsAssignments, `${moduleName}.exports`);
8493
+ // Collect and rewrite named exports
8494
+ for (const [exportName, { nodes }] of exportsAssignmentsByName) {
8495
+ for (const { node, type } of nodes) {
8524
8496
  magicString.overwrite(
8525
- moduleExportsExpression.start,
8526
- moduleExportsExpression.end,
8527
- exportsName
8497
+ node.start,
8498
+ node.left.end,
8499
+ `${
8500
+ exportMode === 'module' && type === 'module' ? `${moduleName}.exports` : exportsName
8501
+ }.${exportName}`
8528
8502
  );
8529
8503
  }
8530
8504
  }
8505
+ replaceDefineCompiledEsmExpressionsAndGetIfRestorable(
8506
+ defineCompiledEsmExpressions,
8507
+ magicString,
8508
+ exportMode,
8509
+ moduleName,
8510
+ exportsName
8511
+ );
8531
8512
  }
8532
- exports.push(`${requireName} as __require`);
8533
8513
  }
8534
8514
 
8535
8515
  function getExportsForReplacedModuleExports(
@@ -8538,34 +8518,30 @@ function getExportsForReplacedModuleExports(
8538
8518
  exportDeclarations,
8539
8519
  moduleExportsAssignments,
8540
8520
  firstTopLevelModuleExportsAssignment,
8541
- exportsName
8521
+ exportsName,
8522
+ defaultIsModuleExports,
8523
+ HELPERS_NAME
8542
8524
  ) {
8543
8525
  for (const { left } of moduleExportsAssignments) {
8544
8526
  magicString.overwrite(left.start, left.end, exportsName);
8545
8527
  }
8546
8528
  magicString.prependRight(firstTopLevelModuleExportsAssignment.left.start, 'var ');
8547
8529
  exports.push(`${exportsName} as __moduleExports`);
8548
- exportDeclarations.push(`export default ${exportsName};`);
8549
- }
8550
-
8551
- function getExportsWhenWrapping(
8552
- exportDeclarations,
8553
- exportsName,
8554
- detectWrappedDefault,
8555
- HELPERS_NAME,
8556
- defaultIsModuleExports
8557
- ) {
8558
8530
  exportDeclarations.push(
8559
- `export default ${
8560
- detectWrappedDefault && defaultIsModuleExports === 'auto'
8561
- ? `/*@__PURE__*/${HELPERS_NAME}.getDefaultExportFromCjs(${exportsName})`
8562
- : defaultIsModuleExports === false
8563
- ? `${exportsName}.default`
8564
- : exportsName
8565
- };`
8531
+ getDefaultExportDeclaration(exportsName, defaultIsModuleExports, HELPERS_NAME)
8566
8532
  );
8567
8533
  }
8568
8534
 
8535
+ function getDefaultExportDeclaration(exportedExportsName, defaultIsModuleExports, HELPERS_NAME) {
8536
+ return `export default ${
8537
+ defaultIsModuleExports === true
8538
+ ? exportedExportsName
8539
+ : defaultIsModuleExports === false
8540
+ ? `${exportedExportsName}.default`
8541
+ : `/*@__PURE__*/${HELPERS_NAME}.getDefaultExportFromCjs(${exportedExportsName})`
8542
+ }`;
8543
+ }
8544
+
8569
8545
  function getExports(
8570
8546
  magicString,
8571
8547
  exports,
@@ -8576,9 +8552,11 @@ function getExports(
8576
8552
  topLevelAssignments,
8577
8553
  moduleName,
8578
8554
  exportsName,
8555
+ exportedExportsName,
8579
8556
  defineCompiledEsmExpressions,
8580
8557
  HELPERS_NAME,
8581
- defaultIsModuleExports
8558
+ defaultIsModuleExports,
8559
+ exportMode
8582
8560
  ) {
8583
8561
  let deconflictedDefaultExportName;
8584
8562
  // Collect and rewrite module.exports assignments
@@ -8590,8 +8568,10 @@ function getExports(
8590
8568
  for (const [exportName, { nodes }] of exportsAssignmentsByName) {
8591
8569
  const deconflicted = deconflictedExportNames[exportName];
8592
8570
  let needsDeclaration = true;
8593
- for (const node of nodes) {
8594
- let replacement = `${deconflicted} = ${exportsName}.${exportName}`;
8571
+ for (const { node, type } of nodes) {
8572
+ let replacement = `${deconflicted} = ${
8573
+ exportMode === 'module' && type === 'module' ? `${moduleName}.exports` : exportsName
8574
+ }.${exportName}`;
8595
8575
  if (needsDeclaration && topLevelAssignments.has(node)) {
8596
8576
  replacement = `var ${replacement}`;
8597
8577
  needsDeclaration = false;
@@ -8609,24 +8589,60 @@ function getExports(
8609
8589
  }
8610
8590
  }
8611
8591
 
8612
- // Collect and rewrite exports.__esModule assignments
8613
- let isRestorableCompiledEsm = false;
8614
- for (const expression of defineCompiledEsmExpressions) {
8615
- isRestorableCompiledEsm = true;
8616
- const moduleExportsExpression =
8617
- expression.type === 'CallExpression' ? expression.arguments[0] : expression.left.object;
8618
- magicString.overwrite(moduleExportsExpression.start, moduleExportsExpression.end, exportsName);
8619
- }
8592
+ const isRestorableCompiledEsm = replaceDefineCompiledEsmExpressionsAndGetIfRestorable(
8593
+ defineCompiledEsmExpressions,
8594
+ magicString,
8595
+ exportMode,
8596
+ moduleName,
8597
+ exportsName
8598
+ );
8620
8599
 
8621
- if (!isRestorableCompiledEsm || defaultIsModuleExports === true) {
8622
- exports.push(`${exportsName} as default`);
8623
- } else if (moduleExportsAssignments.length === 0 || defaultIsModuleExports === false) {
8624
- exports.push(`${deconflictedDefaultExportName || exportsName} as default`);
8600
+ if (
8601
+ defaultIsModuleExports === false ||
8602
+ (defaultIsModuleExports === 'auto' &&
8603
+ isRestorableCompiledEsm &&
8604
+ moduleExportsAssignments.length === 0)
8605
+ ) {
8606
+ // If there is no deconflictedDefaultExportName, then we use the namespace as
8607
+ // fallback because there can be no "default" property on the namespace
8608
+ exports.push(`${deconflictedDefaultExportName || exportedExportsName} as default`);
8609
+ } else if (
8610
+ defaultIsModuleExports === true ||
8611
+ (!isRestorableCompiledEsm && moduleExportsAssignments.length === 0)
8612
+ ) {
8613
+ exports.push(`${exportedExportsName} as default`);
8625
8614
  } else {
8626
8615
  exportDeclarations.push(
8627
- `export default /*@__PURE__*/${HELPERS_NAME}.getDefaultExportFromCjs(${exportsName});`
8616
+ getDefaultExportDeclaration(exportedExportsName, defaultIsModuleExports, HELPERS_NAME)
8617
+ );
8618
+ }
8619
+ }
8620
+
8621
+ function rewriteModuleExportsAssignments(magicString, moduleExportsAssignments, exportsName) {
8622
+ for (const { left } of moduleExportsAssignments) {
8623
+ magicString.overwrite(left.start, left.end, exportsName);
8624
+ }
8625
+ }
8626
+
8627
+ function replaceDefineCompiledEsmExpressionsAndGetIfRestorable(
8628
+ defineCompiledEsmExpressions,
8629
+ magicString,
8630
+ exportMode,
8631
+ moduleName,
8632
+ exportsName
8633
+ ) {
8634
+ let isRestorableCompiledEsm = false;
8635
+ for (const { node, type } of defineCompiledEsmExpressions) {
8636
+ isRestorableCompiledEsm = true;
8637
+ const moduleExportsExpression =
8638
+ node.type === 'CallExpression' ? node.arguments[0] : node.left.object;
8639
+ magicString.overwrite(
8640
+ moduleExportsExpression.start,
8641
+ moduleExportsExpression.end,
8642
+ exportMode === 'module' && type === 'module' ? `${moduleName}.exports` : exportsName
8628
8643
  );
8629
8644
  }
8645
+ return isRestorableCompiledEsm;
8630
8646
  }
8631
8647
 
8632
8648
  function isRequireExpression(node, scope) {
@@ -8717,19 +8733,18 @@ function getRequireHandlers() {
8717
8733
  commonjsMeta
8718
8734
  ) {
8719
8735
  const imports = [];
8720
- imports.push(`import * as ${helpersName} from "${HELPERS_ID}";`);
8736
+ imports.push(`import * as ${helpersName} from "${HELPERS_ID}"`);
8721
8737
  if (dynamicRequireName) {
8722
8738
  imports.push(
8723
8739
  `import { ${
8724
8740
  isDynamicRequireModulesEnabled ? CREATE_COMMONJS_REQUIRE_EXPORT : COMMONJS_REQUIRE_EXPORT
8725
- } as ${dynamicRequireName} } from "${DYNAMIC_MODULES_ID}";`
8741
+ } as ${dynamicRequireName} } from "${DYNAMIC_MODULES_ID}"`
8726
8742
  );
8727
8743
  }
8728
8744
  if (exportMode === 'module') {
8729
8745
  imports.push(
8730
- `import { __module as ${moduleName}, exports as ${exportsName} } from ${JSON.stringify(
8731
- wrapId$1(id, MODULE_SUFFIX)
8732
- )}`
8746
+ `import { __module as ${moduleName} } from ${JSON.stringify(wrapId$1(id, MODULE_SUFFIX))}`,
8747
+ `var ${exportsName} = ${moduleName}.exports`
8733
8748
  );
8734
8749
  } else if (exportMode === 'exports') {
8735
8750
  imports.push(
@@ -8755,7 +8770,7 @@ function getRequireHandlers() {
8755
8770
  getIgnoreTryCatchRequireStatementMode,
8756
8771
  magicString
8757
8772
  );
8758
- return imports.length ? `${imports.join('\n')}\n\n` : '';
8773
+ return imports.length ? `${imports.join(';\n')};\n\n` : '';
8759
8774
  }
8760
8775
 
8761
8776
  return {
@@ -8815,9 +8830,9 @@ function processRequireExpressions(
8815
8830
  }
8816
8831
  if (needsImport) {
8817
8832
  if (isCommonJS === IS_WRAPPED_COMMONJS) {
8818
- imports.push(`import { __require as ${name} } from ${JSON.stringify(resolvedId)};`);
8833
+ imports.push(`import { __require as ${name} } from ${JSON.stringify(resolvedId)}`);
8819
8834
  } else {
8820
- imports.push(`import ${usesRequired ? `${name} from ` : ''}${JSON.stringify(resolvedId)};`);
8835
+ imports.push(`import ${usesRequired ? `${name} from ` : ''}${JSON.stringify(resolvedId)}`);
8821
8836
  }
8822
8837
  }
8823
8838
  }
@@ -8842,6 +8857,14 @@ const exportsPattern = /^(?:module\.)?exports(?:\.([a-zA-Z_$][a-zA-Z_$0-9]*))?$/
8842
8857
 
8843
8858
  const functionType = /^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/;
8844
8859
 
8860
+ // There are three different types of CommonJS modules, described by their
8861
+ // "exportMode":
8862
+ // - exports: Only assignments to (module.)exports properties
8863
+ // - replace: A single assignment to module.exports itself
8864
+ // - module: Anything else
8865
+ // Special cases:
8866
+ // - usesRequireWrapper
8867
+ // - isWrapped
8845
8868
  async function transformCommonjs(
8846
8869
  parse,
8847
8870
  code,
@@ -8878,7 +8901,6 @@ async function transformCommonjs(
8878
8901
  let programDepth = 0;
8879
8902
  let currentTryBlockEnd = null;
8880
8903
  let shouldWrap = false;
8881
- let reexports = false;
8882
8904
 
8883
8905
  const globals = new Set();
8884
8906
  // A conditionalNode is a node for which execution is not guaranteed. If such a node is a require
@@ -8952,31 +8974,20 @@ async function transformCommonjs(
8952
8974
  } else if (!firstTopLevelModuleExportsAssignment) {
8953
8975
  firstTopLevelModuleExportsAssignment = node;
8954
8976
  }
8955
-
8956
- if (defaultIsModuleExports === false) {
8957
- shouldWrap = true;
8958
- } else if (defaultIsModuleExports === 'auto') {
8959
- if (node.right.type === 'ObjectExpression') {
8960
- if (hasDefineEsmProperty(node.right)) {
8961
- shouldWrap = true;
8962
- }
8963
- } else if (isRequireExpression(node.right, scope)) {
8964
- shouldWrap = true;
8965
- reexports = true;
8966
- }
8967
- }
8968
8977
  } else if (exportName === KEY_COMPILED_ESM) {
8969
8978
  if (programDepth > 3) {
8970
8979
  shouldWrap = true;
8971
8980
  } else {
8972
- topLevelDefineCompiledEsmExpressions.push(node);
8981
+ // The "type" is either "module" or "exports" to discern
8982
+ // assignments to module.exports vs exports if needed
8983
+ topLevelDefineCompiledEsmExpressions.push({ node, type: flattened.name });
8973
8984
  }
8974
8985
  } else {
8975
8986
  const exportsAssignments = exportsAssignmentsByName.get(exportName) || {
8976
8987
  nodes: [],
8977
8988
  scopes: new Set()
8978
8989
  };
8979
- exportsAssignments.nodes.push(node);
8990
+ exportsAssignments.nodes.push({ node, type: flattened.name });
8980
8991
  exportsAssignments.scopes.add(scope);
8981
8992
  exportsAccessScopes.add(scope);
8982
8993
  exportsAssignmentsByName.set(exportName, exportsAssignments);
@@ -8993,11 +9004,12 @@ async function transformCommonjs(
8993
9004
  }
8994
9005
  return;
8995
9006
  case 'CallExpression': {
8996
- if (isDefineCompiledEsm(node)) {
9007
+ const defineCompiledEsmType = getDefineCompiledEsmType(node);
9008
+ if (defineCompiledEsmType) {
8997
9009
  if (programDepth === 3 && parent.type === 'ExpressionStatement') {
8998
9010
  // skip special handling for [module.]exports until we know we render this
8999
9011
  skippedNodes.add(node.arguments[0]);
9000
- topLevelDefineCompiledEsmExpressions.push(node);
9012
+ topLevelDefineCompiledEsmExpressions.push({ node, type: defineCompiledEsmType });
9001
9013
  } else {
9002
9014
  shouldWrap = true;
9003
9015
  }
@@ -9015,6 +9027,7 @@ async function transformCommonjs(
9015
9027
  uses.require = true;
9016
9028
  const requireNode = node.callee.object;
9017
9029
  replacedDynamicRequires.push(requireNode);
9030
+ skippedNodes.add(node.callee);
9018
9031
  return;
9019
9032
  }
9020
9033
 
@@ -9257,11 +9270,6 @@ async function transformCommonjs(
9257
9270
 
9258
9271
  // We cannot wrap ES/mixed modules
9259
9272
  shouldWrap = !isEsModule && (shouldWrap || (uses.exports && moduleExportsAssignments.length > 0));
9260
- const detectWrappedDefault =
9261
- shouldWrap &&
9262
- (reexports ||
9263
- topLevelDefineCompiledEsmExpressions.length > 0 ||
9264
- code.indexOf('__esModule') >= 0);
9265
9273
 
9266
9274
  if (
9267
9275
  !(
@@ -9299,6 +9307,9 @@ async function transformCommonjs(
9299
9307
  ? 'exports'
9300
9308
  : 'module';
9301
9309
 
9310
+ const exportedExportsName =
9311
+ exportMode === 'module' ? deconflict([], globals, `${nameBase}Exports`) : exportsName;
9312
+
9302
9313
  const importBlock = await rewriteRequireExpressionsAndGetImportBlock(
9303
9314
  magicString,
9304
9315
  topLevelDeclarations,
@@ -9323,6 +9334,7 @@ async function transformCommonjs(
9323
9334
  magicString,
9324
9335
  moduleName,
9325
9336
  exportsName,
9337
+ exportedExportsName,
9326
9338
  shouldWrap,
9327
9339
  moduleExportsAssignments,
9328
9340
  firstTopLevelModuleExportsAssignment,
@@ -9333,7 +9345,6 @@ async function transformCommonjs(
9333
9345
  code,
9334
9346
  helpersName,
9335
9347
  exportMode,
9336
- detectWrappedDefault,
9337
9348
  defaultIsModuleExports,
9338
9349
  usesRequireWrapper,
9339
9350
  requireName
@@ -9347,15 +9358,16 @@ async function transformCommonjs(
9347
9358
  magicString.trim().indent('\t', {
9348
9359
  exclude: indentExclusionRanges
9349
9360
  });
9361
+ const exported = exportMode === 'module' ? `${moduleName}.exports` : exportsName;
9350
9362
  magicString.prepend(
9351
9363
  `var ${isRequiredName};
9352
9364
 
9353
9365
  function ${requireName} () {
9354
- \tif (${isRequiredName}) return ${exportsName};
9366
+ \tif (${isRequiredName}) return ${exported};
9355
9367
  \t${isRequiredName} = 1;
9356
9368
  `
9357
9369
  ).append(`
9358
- \treturn ${exportsName};
9370
+ \treturn ${exported};
9359
9371
  }`);
9360
9372
  if (exportMode === 'replace') {
9361
9373
  magicString.prepend(`var ${exportsName};\n`);
@@ -9585,15 +9597,9 @@ function commonjs(options = {}) {
9585
9597
  }
9586
9598
 
9587
9599
  if (isWrappedId(id, MODULE_SUFFIX)) {
9588
- const module = getName(unwrapId$1(id, MODULE_SUFFIX));
9589
- const moduleExports = `${module}Exports`;
9600
+ const name = getName(unwrapId$1(id, MODULE_SUFFIX));
9590
9601
  return {
9591
- code: `var ${moduleExports} = {};
9592
- var ${module} = {
9593
- get exports(){ return ${moduleExports}; },
9594
- set exports(v){ ${moduleExports} = v; },
9595
- };
9596
- export {${module} as __module, ${moduleExports} as exports}`,
9602
+ code: `var ${name} = {exports: {}}; export {${name} as __module}`,
9597
9603
  meta: { commonjs: { isCommonJS: false } }
9598
9604
  };
9599
9605
  }
@@ -9917,11 +9923,11 @@ function stripFilename(path) {
9917
9923
  return path.slice(0, index + 1);
9918
9924
  }
9919
9925
 
9920
- const COLUMN = 0;
9921
- const SOURCES_INDEX = 1;
9922
- const SOURCE_LINE = 2;
9923
- const SOURCE_COLUMN = 3;
9924
- const NAMES_INDEX = 4;
9926
+ const COLUMN$1 = 0;
9927
+ const SOURCES_INDEX$1 = 1;
9928
+ const SOURCE_LINE$1 = 2;
9929
+ const SOURCE_COLUMN$1 = 3;
9930
+ const NAMES_INDEX$1 = 4;
9925
9931
 
9926
9932
  function maybeSort(mappings, owned) {
9927
9933
  const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);
@@ -9945,7 +9951,7 @@ function nextUnsortedSegmentLine(mappings, start) {
9945
9951
  }
9946
9952
  function isSorted(line) {
9947
9953
  for (let j = 1; j < line.length; j++) {
9948
- if (line[j][COLUMN] < line[j - 1][COLUMN]) {
9954
+ if (line[j][COLUMN$1] < line[j - 1][COLUMN$1]) {
9949
9955
  return false;
9950
9956
  }
9951
9957
  }
@@ -9957,7 +9963,7 @@ function sortSegments(line, owned) {
9957
9963
  return line.sort(sortComparator);
9958
9964
  }
9959
9965
  function sortComparator(a, b) {
9960
- return a[COLUMN] - b[COLUMN];
9966
+ return a[COLUMN$1] - b[COLUMN$1];
9961
9967
  }
9962
9968
 
9963
9969
  let found = false;
@@ -9980,7 +9986,7 @@ let found = false;
9980
9986
  function binarySearch(haystack, needle, low, high) {
9981
9987
  while (low <= high) {
9982
9988
  const mid = low + ((high - low) >> 1);
9983
- const cmp = haystack[mid][COLUMN] - needle;
9989
+ const cmp = haystack[mid][COLUMN$1] - needle;
9984
9990
  if (cmp === 0) {
9985
9991
  found = true;
9986
9992
  return mid;
@@ -9997,14 +10003,14 @@ function binarySearch(haystack, needle, low, high) {
9997
10003
  }
9998
10004
  function upperBound(haystack, needle, index) {
9999
10005
  for (let i = index + 1; i < haystack.length; index = i++) {
10000
- if (haystack[i][COLUMN] !== needle)
10006
+ if (haystack[i][COLUMN$1] !== needle)
10001
10007
  break;
10002
10008
  }
10003
10009
  return index;
10004
10010
  }
10005
10011
  function lowerBound(haystack, needle, index) {
10006
10012
  for (let i = index - 1; i >= 0; index = i--) {
10007
- if (haystack[i][COLUMN] !== needle)
10013
+ if (haystack[i][COLUMN$1] !== needle)
10008
10014
  break;
10009
10015
  }
10010
10016
  return index;
@@ -10026,7 +10032,7 @@ function memoizedBinarySearch(haystack, needle, state, key) {
10026
10032
  let high = haystack.length - 1;
10027
10033
  if (key === lastKey) {
10028
10034
  if (needle === lastNeedle) {
10029
- found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle;
10035
+ found = lastIndex !== -1 && haystack[lastIndex][COLUMN$1] === needle;
10030
10036
  return lastIndex;
10031
10037
  }
10032
10038
  if (needle >= lastNeedle) {
@@ -10123,7 +10129,7 @@ class TraceMap {
10123
10129
  if (segment.length === 1)
10124
10130
  return OMapping(null, null, null, null);
10125
10131
  const { names, resolvedSources } = map;
10126
- return OMapping(resolvedSources[segment[SOURCES_INDEX]], segment[SOURCE_LINE] + 1, segment[SOURCE_COLUMN], segment.length === 5 ? names[segment[NAMES_INDEX]] : null);
10132
+ return OMapping(resolvedSources[segment[SOURCES_INDEX$1]], segment[SOURCE_LINE$1] + 1, segment[SOURCE_COLUMN$1], segment.length === 5 ? names[segment[NAMES_INDEX$1]] : null);
10127
10133
  };
10128
10134
  })();
10129
10135
  function OMapping(source, line, column, name) {
@@ -10176,11 +10182,19 @@ class SetArray {
10176
10182
  };
10177
10183
  })();
10178
10184
 
10185
+ const COLUMN = 0;
10186
+ const SOURCES_INDEX = 1;
10187
+ const SOURCE_LINE = 2;
10188
+ const SOURCE_COLUMN = 3;
10189
+ const NAMES_INDEX = 4;
10190
+
10191
+ const NO_NAME = -1;
10179
10192
  /**
10180
- * A low-level API to associate a generated position with an original source position. Line and
10181
- * column here are 0-based, unlike `addMapping`.
10193
+ * Same as `addSegment`, but will only add the segment if it generates useful information in the
10194
+ * resulting map. This only works correctly if segments are added **in order**, meaning you should
10195
+ * not add a segment with a lower generated line/column than one that came before.
10182
10196
  */
10183
- let addSegment;
10197
+ let maybeAddSegment;
10184
10198
  /**
10185
10199
  * Adds/removes the content of the source file to the source map.
10186
10200
  */
@@ -10189,12 +10203,14 @@ let setSourceContent;
10189
10203
  * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects
10190
10204
  * a sourcemap, or to JSON.stringify.
10191
10205
  */
10192
- let decodedMap;
10206
+ let toDecodedMap;
10193
10207
  /**
10194
10208
  * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects
10195
10209
  * a sourcemap, or to JSON.stringify.
10196
10210
  */
10197
- let encodedMap;
10211
+ let toEncodedMap;
10212
+ // This split declaration is only so that terser can elminiate the static initialization block.
10213
+ let addSegmentInternal;
10198
10214
  /**
10199
10215
  * Provides the state to generate a sourcemap.
10200
10216
  */
@@ -10209,32 +10225,19 @@ class GenMapping {
10209
10225
  }
10210
10226
  }
10211
10227
  (() => {
10212
- addSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name) => {
10213
- const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map;
10214
- const line = getLine(mappings, genLine);
10215
- if (source == null) {
10216
- const seg = [genColumn];
10217
- const index = getColumnIndex(line, genColumn, seg);
10218
- return insert(line, index, seg);
10219
- }
10220
- const sourcesIndex = put(sources, source);
10221
- const seg = name
10222
- ? [genColumn, sourcesIndex, sourceLine, sourceColumn, put(names, name)]
10223
- : [genColumn, sourcesIndex, sourceLine, sourceColumn];
10224
- const index = getColumnIndex(line, genColumn, seg);
10225
- if (sourcesIndex === sourcesContent.length)
10226
- sourcesContent[sourcesIndex] = null;
10227
- insert(line, index, seg);
10228
+ maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => {
10229
+ return addSegmentInternal(true, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content);
10228
10230
  };
10229
10231
  setSourceContent = (map, source, content) => {
10230
10232
  const { _sources: sources, _sourcesContent: sourcesContent } = map;
10231
10233
  sourcesContent[put(sources, source)] = content;
10232
10234
  };
10233
- decodedMap = (map) => {
10235
+ toDecodedMap = (map) => {
10234
10236
  const { file, sourceRoot, _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map;
10237
+ removeEmptyFinalLines(mappings);
10235
10238
  return {
10236
10239
  version: 3,
10237
- file,
10240
+ file: file || undefined,
10238
10241
  names: names.array,
10239
10242
  sourceRoot: sourceRoot || undefined,
10240
10243
  sources: sources.array,
@@ -10242,10 +10245,31 @@ class GenMapping {
10242
10245
  mappings,
10243
10246
  };
10244
10247
  };
10245
- encodedMap = (map) => {
10246
- const decoded = decodedMap(map);
10248
+ toEncodedMap = (map) => {
10249
+ const decoded = toDecodedMap(map);
10247
10250
  return Object.assign(Object.assign({}, decoded), { mappings: encode$1(decoded.mappings) });
10248
10251
  };
10252
+ // Internal helpers
10253
+ addSegmentInternal = (skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => {
10254
+ const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map;
10255
+ const line = getLine(mappings, genLine);
10256
+ const index = getColumnIndex(line, genColumn);
10257
+ if (!source) {
10258
+ if (skipable && skipSourceless(line, index))
10259
+ return;
10260
+ return insert(line, index, [genColumn]);
10261
+ }
10262
+ const sourcesIndex = put(sources, source);
10263
+ const namesIndex = name ? put(names, name) : NO_NAME;
10264
+ if (sourcesIndex === sourcesContent.length)
10265
+ sourcesContent[sourcesIndex] = content !== null && content !== void 0 ? content : null;
10266
+ if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {
10267
+ return;
10268
+ }
10269
+ return insert(line, index, name
10270
+ ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]
10271
+ : [genColumn, sourcesIndex, sourceLine, sourceColumn]);
10272
+ };
10249
10273
  })();
10250
10274
  function getLine(mappings, index) {
10251
10275
  for (let i = mappings.length; i <= index; i++) {
@@ -10253,63 +10277,63 @@ function getLine(mappings, index) {
10253
10277
  }
10254
10278
  return mappings[index];
10255
10279
  }
10256
- function getColumnIndex(line, column, seg) {
10280
+ function getColumnIndex(line, genColumn) {
10257
10281
  let index = line.length;
10258
- for (let i = index - 1; i >= 0; i--, index--) {
10282
+ for (let i = index - 1; i >= 0; index = i--) {
10259
10283
  const current = line[i];
10260
- const col = current[0];
10261
- if (col > column)
10262
- continue;
10263
- if (col < column)
10264
- break;
10265
- const cmp = compare$1(current, seg);
10266
- if (cmp === 0)
10267
- return index;
10268
- if (cmp < 0)
10284
+ if (genColumn >= current[COLUMN])
10269
10285
  break;
10270
10286
  }
10271
10287
  return index;
10272
10288
  }
10273
- function compare$1(a, b) {
10274
- let cmp = compareNum(a.length, b.length);
10275
- if (cmp !== 0)
10276
- return cmp;
10277
- // We've already checked genColumn
10278
- if (a.length === 1)
10279
- return 0;
10280
- cmp = compareNum(a[1], b[1]);
10281
- if (cmp !== 0)
10282
- return cmp;
10283
- cmp = compareNum(a[2], b[2]);
10284
- if (cmp !== 0)
10285
- return cmp;
10286
- cmp = compareNum(a[3], b[3]);
10287
- if (cmp !== 0)
10288
- return cmp;
10289
- if (a.length === 4)
10290
- return 0;
10291
- return compareNum(a[4], b[4]);
10292
- }
10293
- function compareNum(a, b) {
10294
- return a - b;
10295
- }
10296
10289
  function insert(array, index, value) {
10297
- if (index === -1)
10298
- return;
10299
10290
  for (let i = array.length; i > index; i--) {
10300
10291
  array[i] = array[i - 1];
10301
10292
  }
10302
10293
  array[index] = value;
10303
10294
  }
10295
+ function removeEmptyFinalLines(mappings) {
10296
+ const { length } = mappings;
10297
+ let len = length;
10298
+ for (let i = len - 1; i >= 0; len = i, i--) {
10299
+ if (mappings[i].length > 0)
10300
+ break;
10301
+ }
10302
+ if (len < length)
10303
+ mappings.length = len;
10304
+ }
10305
+ function skipSourceless(line, index) {
10306
+ // The start of a line is already sourceless, so adding a sourceless segment to the beginning
10307
+ // doesn't generate any useful information.
10308
+ if (index === 0)
10309
+ return true;
10310
+ const prev = line[index - 1];
10311
+ // If the previous segment is also sourceless, then adding another sourceless segment doesn't
10312
+ // genrate any new information. Else, this segment will end the source/named segment and point to
10313
+ // a sourceless position, which is useful.
10314
+ return prev.length === 1;
10315
+ }
10316
+ function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) {
10317
+ // A source/named segment at the start of a line gives position at that genColumn
10318
+ if (index === 0)
10319
+ return false;
10320
+ const prev = line[index - 1];
10321
+ // If the previous segment is sourceless, then we're transitioning to a source.
10322
+ if (prev.length === 1)
10323
+ return false;
10324
+ // If the previous segment maps to the exact same source position, then this segment doesn't
10325
+ // provide any new position information.
10326
+ return (sourcesIndex === prev[SOURCES_INDEX] &&
10327
+ sourceLine === prev[SOURCE_LINE] &&
10328
+ sourceColumn === prev[SOURCE_COLUMN] &&
10329
+ namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME));
10330
+ }
10304
10331
 
10305
- const SOURCELESS_MAPPING = {
10306
- source: null,
10307
- column: null,
10308
- line: null,
10309
- name: null,
10310
- content: null,
10311
- };
10332
+ const SOURCELESS_MAPPING = /* #__PURE__ */ SegmentObject('', -1, -1, '', null);
10312
10333
  const EMPTY_SOURCES = [];
10334
+ function SegmentObject(source, line, column, name, content) {
10335
+ return { source, line, column, name, content };
10336
+ }
10313
10337
  function Source(map, sources, source, content) {
10314
10338
  return {
10315
10339
  map,
@@ -10337,15 +10361,14 @@ function OriginalSource(source, content) {
10337
10361
  * resolving each mapping in terms of the original source files.
10338
10362
  */
10339
10363
  function traceMappings(tree) {
10364
+ // TODO: Eventually support sourceRoot, which has to be removed because the sources are already
10365
+ // fully resolved. We'll need to make sources relative to the sourceRoot before adding them.
10340
10366
  const gen = new GenMapping({ file: tree.map.file });
10341
10367
  const { sources: rootSources, map } = tree;
10342
10368
  const rootNames = map.names;
10343
10369
  const rootMappings = decodedMappings(map);
10344
10370
  for (let i = 0; i < rootMappings.length; i++) {
10345
10371
  const segments = rootMappings[i];
10346
- let lastSource = null;
10347
- let lastSourceLine = null;
10348
- let lastSourceColumn = null;
10349
10372
  for (let j = 0; j < segments.length; j++) {
10350
10373
  const segment = segments[j];
10351
10374
  const genCol = segment[0];
@@ -10360,18 +10383,9 @@ function traceMappings(tree) {
10360
10383
  if (traced == null)
10361
10384
  continue;
10362
10385
  }
10363
- // So we traced a segment down into its original source file. Now push a
10364
- // new segment pointing to this location.
10365
10386
  const { column, line, name, content, source } = traced;
10366
- if (line === lastSourceLine && column === lastSourceColumn && source === lastSource) {
10367
- continue;
10368
- }
10369
- lastSourceLine = line;
10370
- lastSourceColumn = column;
10371
- lastSource = source;
10372
- // Sigh, TypeScript can't figure out source/line/column are either all null, or all non-null...
10373
- addSegment(gen, i, genCol, source, line, column, name);
10374
- if (content != null)
10387
+ maybeAddSegment(gen, i, genCol, source, line, column, name);
10388
+ if (source && content != null)
10375
10389
  setSourceContent(gen, source, content);
10376
10390
  }
10377
10391
  }
@@ -10383,7 +10397,7 @@ function traceMappings(tree) {
10383
10397
  */
10384
10398
  function originalPositionFor(source, line, column, name) {
10385
10399
  if (!source.map) {
10386
- return { column, line, name, source: source.source, content: source.content };
10400
+ return SegmentObject(source.source, line, column, name, source.content);
10387
10401
  }
10388
10402
  const segment = traceSegment(source.map, line, column);
10389
10403
  // If we couldn't find a segment, then this doesn't exist in the sourcemap.
@@ -10464,7 +10478,7 @@ function build$2(map, loader, importer, importerDepth) {
10464
10478
  */
10465
10479
  let SourceMap$1 = class SourceMap {
10466
10480
  constructor(map, options) {
10467
- const out = options.decodedMappings ? decodedMap(map) : encodedMap(map);
10481
+ const out = options.decodedMappings ? toDecodedMap(map) : toEncodedMap(map);
10468
10482
  this.version = out.version; // SourceMap spec says this should be first.
10469
10483
  this.file = out.file;
10470
10484
  this.mappings = out.mappings;
@@ -10501,17 +10515,9 @@ function remapping(input, loader, options) {
10501
10515
  return new SourceMap$1(traceMappings(tree), opts);
10502
10516
  }
10503
10517
 
10504
- var srcExports$1 = {};
10505
- var src$2 = {
10506
- get exports(){ return srcExports$1; },
10507
- set exports(v){ srcExports$1 = v; },
10508
- };
10518
+ var src$2 = {exports: {}};
10509
10519
 
10510
- var browserExports$1 = {};
10511
- var browser$2 = {
10512
- get exports(){ return browserExports$1; },
10513
- set exports(v){ browserExports$1 = v; },
10514
- };
10520
+ var browser$2 = {exports: {}};
10515
10521
 
10516
10522
  /**
10517
10523
  * Helpers.
@@ -10971,7 +10977,7 @@ function requireCommon () {
10971
10977
  var hasRequiredBrowser$1;
10972
10978
 
10973
10979
  function requireBrowser$1 () {
10974
- if (hasRequiredBrowser$1) return browserExports$1;
10980
+ if (hasRequiredBrowser$1) return browser$2.exports;
10975
10981
  hasRequiredBrowser$1 = 1;
10976
10982
  (function (module, exports) {
10977
10983
  /**
@@ -11240,16 +11246,12 @@ function requireBrowser$1 () {
11240
11246
  } catch (error) {
11241
11247
  return '[UnexpectedJSONParseError]: ' + error.message;
11242
11248
  }
11243
- };
11244
- } (browser$2, browserExports$1));
11245
- return browserExports$1;
11249
+ };
11250
+ } (browser$2, browser$2.exports));
11251
+ return browser$2.exports;
11246
11252
  }
11247
11253
 
11248
- var nodeExports$1 = {};
11249
- var node$1 = {
11250
- get exports(){ return nodeExports$1; },
11251
- set exports(v){ nodeExports$1 = v; },
11252
- };
11254
+ var node$1 = {exports: {}};
11253
11255
 
11254
11256
  /**
11255
11257
  * Module dependencies.
@@ -11258,7 +11260,7 @@ var node$1 = {
11258
11260
  var hasRequiredNode$1;
11259
11261
 
11260
11262
  function requireNode$1 () {
11261
- if (hasRequiredNode$1) return nodeExports$1;
11263
+ if (hasRequiredNode$1) return node$1.exports;
11262
11264
  hasRequiredNode$1 = 1;
11263
11265
  (function (module, exports) {
11264
11266
  const tty = require$$0$3;
@@ -11519,9 +11521,9 @@ function requireNode$1 () {
11519
11521
  formatters.O = function (v) {
11520
11522
  this.inspectOpts.colors = this.useColors;
11521
11523
  return util.inspect(v, this.inspectOpts);
11522
- };
11523
- } (node$1, nodeExports$1));
11524
- return nodeExports$1;
11524
+ };
11525
+ } (node$1, node$1.exports));
11526
+ return node$1.exports;
11525
11527
  }
11526
11528
 
11527
11529
  /**
@@ -11529,14 +11531,13 @@ function requireNode$1 () {
11529
11531
  * treat as a browser.
11530
11532
  */
11531
11533
 
11532
- (function (module) {
11533
- if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
11534
- module.exports = requireBrowser$1();
11535
- } else {
11536
- module.exports = requireNode$1();
11537
- }
11538
- } (src$2));
11534
+ if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
11535
+ src$2.exports = requireBrowser$1();
11536
+ } else {
11537
+ src$2.exports = requireNode$1();
11538
+ }
11539
11539
 
11540
+ var srcExports$1 = src$2.exports;
11540
11541
  var debug$g = /*@__PURE__*/getDefaultExportFromCjs(srcExports$1);
11541
11542
 
11542
11543
  // eslint-disable-next-line @typescript-eslint/consistent-type-imports
@@ -12001,13 +12002,13 @@ function timeFrom(start, subtract = 0) {
12001
12002
  const time = performance$1.now() - start - subtract;
12002
12003
  const timeString = (time.toFixed(2) + `ms`).padEnd(5, ' ');
12003
12004
  if (time < 10) {
12004
- return picocolorsExports.green(timeString);
12005
+ return colors$1.green(timeString);
12005
12006
  }
12006
12007
  else if (time < 50) {
12007
- return picocolorsExports.yellow(timeString);
12008
+ return colors$1.yellow(timeString);
12008
12009
  }
12009
12010
  else {
12010
- return picocolorsExports.red(timeString);
12011
+ return colors$1.red(timeString);
12011
12012
  }
12012
12013
  }
12013
12014
  /**
@@ -12018,10 +12019,10 @@ function prettifyUrl(url, root) {
12018
12019
  const isAbsoluteFile = url.startsWith(root);
12019
12020
  if (isAbsoluteFile || url.startsWith(FS_PREFIX)) {
12020
12021
  const file = path$o.relative(root, isAbsoluteFile ? url : fsPathFromId(url));
12021
- return picocolorsExports.dim(file);
12022
+ return colors$1.dim(file);
12022
12023
  }
12023
12024
  else {
12024
- return picocolorsExports.dim(url);
12025
+ return colors$1.dim(url);
12025
12026
  }
12026
12027
  }
12027
12028
  function isObject$2(value) {
@@ -12741,11 +12742,11 @@ function createLogger(level = 'info', options = {}) {
12741
12742
  const format = () => {
12742
12743
  if (options.timestamp) {
12743
12744
  const tag = type === 'info'
12744
- ? picocolorsExports.cyan(picocolorsExports.bold(prefix))
12745
+ ? colors$1.cyan(colors$1.bold(prefix))
12745
12746
  : type === 'warn'
12746
- ? picocolorsExports.yellow(picocolorsExports.bold(prefix))
12747
- : picocolorsExports.red(picocolorsExports.bold(prefix));
12748
- return `${picocolorsExports.dim(new Date().toLocaleTimeString())} ${tag} ${msg}`;
12747
+ ? colors$1.yellow(colors$1.bold(prefix))
12748
+ : colors$1.red(colors$1.bold(prefix));
12749
+ return `${colors$1.dim(new Date().toLocaleTimeString())} ${tag} ${msg}`;
12749
12750
  }
12750
12751
  else {
12751
12752
  return msg;
@@ -12758,7 +12759,7 @@ function createLogger(level = 'info', options = {}) {
12758
12759
  if (type === lastType && msg === lastMsg) {
12759
12760
  sameCount++;
12760
12761
  clear();
12761
- console[method](format(), picocolorsExports.yellow(`(x${sameCount + 1})`));
12762
+ console[method](format(), colors$1.yellow(`(x${sameCount + 1})`));
12762
12763
  }
12763
12764
  else {
12764
12765
  sameCount = 0;
@@ -12808,24 +12809,24 @@ function createLogger(level = 'info', options = {}) {
12808
12809
  return logger;
12809
12810
  }
12810
12811
  function printServerUrls(urls, optionsHost, info) {
12811
- const colorUrl = (url) => picocolorsExports.cyan(url.replace(/:(\d+)\//, (_, port) => `:${picocolorsExports.bold(port)}/`));
12812
+ const colorUrl = (url) => colors$1.cyan(url.replace(/:(\d+)\//, (_, port) => `:${colors$1.bold(port)}/`));
12812
12813
  for (const url of urls.local) {
12813
- info(` ${picocolorsExports.green('➜')} ${picocolorsExports.bold('Local')}: ${colorUrl(url)}`);
12814
+ info(` ${colors$1.green('➜')} ${colors$1.bold('Local')}: ${colorUrl(url)}`);
12814
12815
  }
12815
12816
  for (const url of urls.network) {
12816
- info(` ${picocolorsExports.green('➜')} ${picocolorsExports.bold('Network')}: ${colorUrl(url)}`);
12817
+ info(` ${colors$1.green('➜')} ${colors$1.bold('Network')}: ${colorUrl(url)}`);
12817
12818
  }
12818
12819
  if (urls.network.length === 0 && optionsHost === undefined) {
12819
- info(picocolorsExports.dim(` ${picocolorsExports.green('➜')} ${picocolorsExports.bold('Network')}: use `) +
12820
- picocolorsExports.bold('--host') +
12821
- picocolorsExports.dim(' to expose'));
12820
+ info(colors$1.dim(` ${colors$1.green('➜')} ${colors$1.bold('Network')}: use `) +
12821
+ colors$1.bold('--host') +
12822
+ colors$1.dim(' to expose'));
12822
12823
  }
12823
12824
  }
12824
12825
 
12825
12826
  const groups = [
12826
- { name: 'Assets', color: picocolorsExports.green },
12827
- { name: 'CSS', color: picocolorsExports.magenta },
12828
- { name: 'JS', color: picocolorsExports.cyan },
12827
+ { name: 'Assets', color: colors$1.green },
12828
+ { name: 'CSS', color: colors$1.magenta },
12829
+ { name: 'JS', color: colors$1.cyan },
12829
12830
  ];
12830
12831
  const COMPRESSIBLE_ASSETS_RE = /\.(?:html|json|svg|txt|xml|xhtml)$/;
12831
12832
  function buildReporterPlugin(config) {
@@ -12861,7 +12862,7 @@ function buildReporterPlugin(config) {
12861
12862
  return compressed.length;
12862
12863
  }
12863
12864
  const logTransform = throttle((id) => {
12864
- writeLine(`transforming (${transformedCount}) ${picocolorsExports.dim(path$o.relative(config.root, id))}`);
12865
+ writeLine(`transforming (${transformedCount}) ${colors$1.dim(path$o.relative(config.root, id))}`);
12865
12866
  });
12866
12867
  return {
12867
12868
  name: 'vite:reporter',
@@ -12894,7 +12895,7 @@ function buildReporterPlugin(config) {
12894
12895
  process.stdout.clearLine(0);
12895
12896
  process.stdout.cursorTo(0);
12896
12897
  }
12897
- config.logger.info(`${picocolorsExports.green(`✓`)} ${transformedCount} modules transformed.`);
12898
+ config.logger.info(`${colors$1.green(`✓`)} ${transformedCount} modules transformed.`);
12898
12899
  }
12899
12900
  },
12900
12901
  renderStart() {
@@ -12981,21 +12982,21 @@ function buildReporterPlugin(config) {
12981
12982
  const isLarge = group.name === 'JS' && entry.size / 1000 > chunkLimit;
12982
12983
  if (isLarge)
12983
12984
  hasLargeChunks = true;
12984
- const sizeColor = isLarge ? picocolorsExports.yellow : picocolorsExports.dim;
12985
- let log = picocolorsExports.dim(relativeOutDir + '/');
12985
+ const sizeColor = isLarge ? colors$1.yellow : colors$1.dim;
12986
+ let log = colors$1.dim(relativeOutDir + '/');
12986
12987
  log +=
12987
12988
  !config.build.lib && entry.name.startsWith(assetsDir)
12988
- ? picocolorsExports.dim(assetsDir) +
12989
+ ? colors$1.dim(assetsDir) +
12989
12990
  group.color(entry.name
12990
12991
  .slice(assetsDir.length)
12991
12992
  .padEnd(longest + 2 - assetsDir.length))
12992
12993
  : group.color(entry.name.padEnd(longest + 2));
12993
- log += picocolorsExports.bold(sizeColor(displaySize(entry.size).padStart(sizePad)));
12994
+ log += colors$1.bold(sizeColor(displaySize(entry.size).padStart(sizePad)));
12994
12995
  if (entry.compressedSize) {
12995
- log += picocolorsExports.dim(` │ gzip: ${displaySize(entry.compressedSize).padStart(compressPad)}`);
12996
+ log += colors$1.dim(` │ gzip: ${displaySize(entry.compressedSize).padStart(compressPad)}`);
12996
12997
  }
12997
12998
  if (entry.mapSize) {
12998
- log += picocolorsExports.dim(` │ map: ${displaySize(entry.mapSize).padStart(mapPad)}`);
12999
+ log += colors$1.dim(` │ map: ${displaySize(entry.mapSize).padStart(mapPad)}`);
12999
13000
  }
13000
13001
  config.logger.info(log);
13001
13002
  }
@@ -13010,7 +13011,7 @@ function buildReporterPlugin(config) {
13010
13011
  config.build.minify &&
13011
13012
  !config.build.lib &&
13012
13013
  !config.build.ssr) {
13013
- config.logger.warn(picocolorsExports.yellow(`\n(!) Some chunks are larger than ${chunkLimit} kBs after minification. Consider:\n` +
13014
+ config.logger.warn(colors$1.yellow(`\n(!) Some chunks are larger than ${chunkLimit} kBs after minification. Consider:\n` +
13014
13015
  `- Using dynamic import() to code-split the application\n` +
13015
13016
  `- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks\n` +
13016
13017
  `- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.`));
@@ -13018,7 +13019,7 @@ function buildReporterPlugin(config) {
13018
13019
  },
13019
13020
  closeBundle() {
13020
13021
  if (shouldLogInfo && !config.build.watch) {
13021
- config.logger.info(`${picocolorsExports.green(`✓ built in ${displayTime(Date.now() - startTime)}`)}`);
13022
+ config.logger.info(`${colors$1.green(`✓ built in ${displayTime(Date.now() - startTime)}`)}`);
13022
13023
  }
13023
13024
  },
13024
13025
  };
@@ -14010,7 +14011,7 @@ function resolveEsbuildTranspileOptions(config, format) {
14010
14011
  }
14011
14012
  }
14012
14013
  function prettifyMessage(m, code) {
14013
- let res = picocolorsExports.yellow(m.text);
14014
+ let res = colors$1.yellow(m.text);
14014
14015
  if (m.location) {
14015
14016
  const lines = code.split(/\r?\n/g);
14016
14017
  const line = Number(m.location.line);
@@ -14049,7 +14050,7 @@ async function initTSConfckParseOptions(workspaceRoot) {
14049
14050
  })),
14050
14051
  resolveWithEmptyIfConfigNotFound: true,
14051
14052
  };
14052
- debug$f?.(timeFrom(start), 'tsconfck init', picocolorsExports.dim(workspaceRoot));
14053
+ debug$f?.(timeFrom(start), 'tsconfck init', colors$1.dim(workspaceRoot));
14053
14054
  return options;
14054
14055
  }
14055
14056
  async function loadTsconfigJsonForFile(filename) {
@@ -14340,6 +14341,8 @@ var jsonStableStringify = function (obj, opts) {
14340
14341
  }({ '': obj }, '', obj, 0));
14341
14342
  };
14342
14343
 
14344
+ var jsonStableStringify$1 = /*@__PURE__*/getDefaultExportFromCjs(jsonStableStringify);
14345
+
14343
14346
  const mimes$1 = {
14344
14347
  "ez": "application/andrew-inset",
14345
14348
  "aw": "application/applixware",
@@ -16119,7 +16122,7 @@ async function fileToBuiltUrl(id, config, pluginContext, skipPublicCheck = false
16119
16122
  content.length < Number(config.build.assetsInlineLimit) &&
16120
16123
  !isGitLfsPlaceholder(content))) {
16121
16124
  if (config.build.lib && isGitLfsPlaceholder(content)) {
16122
- config.logger.warn(picocolorsExports.yellow(`Inlined file ${id} was not downloaded via Git LFS`));
16125
+ config.logger.warn(colors$1.yellow(`Inlined file ${id} was not downloaded via Git LFS`));
16123
16126
  }
16124
16127
  const mimeType = lookup(file) ?? 'application/octet-stream';
16125
16128
  // base64 inlined as a string
@@ -16269,7 +16272,7 @@ function manifestPlugin(config) {
16269
16272
  ? config.build.manifest
16270
16273
  : 'manifest.json',
16271
16274
  type: 'asset',
16272
- source: jsonStableStringify(manifest, { space: 2 }),
16275
+ source: jsonStableStringify$1(manifest, { space: 2 }),
16273
16276
  });
16274
16277
  }
16275
16278
  },
@@ -16322,10 +16325,10 @@ function dataURIPlugin() {
16322
16325
  };
16323
16326
  }
16324
16327
 
16325
- /* es-module-lexer 1.2.0 */
16326
- const A=1===new Uint8Array(new Uint16Array([1]).buffer)[0];function parse$e(E,g="@"){if(!C)return init.then((()=>parse$e(E)));const I=E.length+1,o=(C.__heap_base.value||C.__heap_base)+4*I-C.memory.buffer.byteLength;o>0&&C.memory.grow(Math.ceil(o/65536));const K=C.sa(I-1);if((A?B:Q)(E,new Uint16Array(C.memory.buffer,K,I)),!C.parse())throw Object.assign(new Error(`Parse error ${g}:${E.slice(0,C.e()).split("\n").length}:${C.e()-E.lastIndexOf("\n",C.e()-1)}`),{idx:C.e()});const D=[],k=[];for(;C.ri();){const A=C.is(),Q=C.ie(),B=C.ai(),g=C.id(),I=C.ss(),o=C.se();let K;C.ip()&&(K=J(E.slice(-1===g?A-1:A,-1===g?Q+1:Q))),D.push({n:K,s:A,e:Q,ss:I,se:o,d:g,a:B});}for(;C.re();){const A=C.es(),Q=C.ee(),B=C.els(),g=C.ele(),I=E.slice(A,Q),o=I[0],K=B<0?void 0:E.slice(B,g),D=K?K[0]:"";k.push({s:A,e:Q,ls:B,le:g,n:'"'===o||"'"===o?J(I):I,ln:'"'===D||"'"===D?J(K):K});}function J(A){try{return (0, eval)(A)}catch(A){}}return [D,k,!!C.f()]}function Q(A,Q){const B=A.length;let C=0;for(;C<B;){const B=A.charCodeAt(C);Q[C++]=(255&B)<<8|B>>>8;}}function B(A,Q){const B=A.length;let C=0;for(;C<B;)Q[C]=A.charCodeAt(C++);}let C;const init=WebAssembly.compile((E="AGFzbQEAAAABKghgAX8Bf2AEf39/fwBgAAF/YAAAYAF/AGADf39/AX9gAn9/AX9gAn9/AAMvLgABAQICAgICAgICAgICAgICAgIAAwMDBAQAAAADAAAAAAMDAAUGAAAABwAGAgUEBQFwAQEBBQMBAAEGDwJ/AUGw8gALfwBBsPIACwdwEwZtZW1vcnkCAAJzYQAAAWUAAwJpcwAEAmllAAUCc3MABgJzZQAHAmFpAAgCaWQACQJpcAAKAmVzAAsCZWUADANlbHMADQNlbGUADgJyaQAPAnJlABABZgARBXBhcnNlABILX19oZWFwX2Jhc2UDAQrAOy5oAQF/QQAgADYC9AlBACgC0AkiASAAQQF0aiIAQQA7AQBBACAAQQJ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IQAgA0F2ag4EAgEBAgELIABBBGohAAwACwtBACACNgKgChAiQQAPC0EAIAI2AqAKQd0AC0kBA39BACEDAkAgAkUNAAJAA0AgAC0AACIEIAEtAAAiBUcNASABQQFqIQEgAEEBaiEAIAJBf2oiAg0ADAILCyAEIAVrIQMLIAMLC+IBAgBBgAgLxAEAAHgAcABvAHIAdABtAHAAbwByAHQAZQB0AGEAcgBvAG0AdQBuAGMAdABpAG8AbgBzAHMAZQByAHQAdgBvAHkAaQBlAGQAZQBsAGUAYwBvAG4AdABpAG4AaQBuAHMAdABhAG4AdAB5AGIAcgBlAGEAcgBlAHQAdQByAGQAZQBiAHUAZwBnAGUAYQB3AGEAaQB0AGgAcgB3AGgAaQBsAGUAZgBvAHIAaQBmAGMAYQB0AGMAZgBpAG4AYQBsAGwAZQBsAHMAAEHECQsQAQAAAAIAAAAABAAAMDkAAA==","undefined"!=typeof Buffer?Buffer.from(E,"base64"):Uint8Array.from(atob(E),(A=>A.charCodeAt(0))))).then(WebAssembly.instantiate).then((({exports:A})=>{C=A;}));var E;
16328
+ /* es-module-lexer 1.2.1 */
16329
+ const A=1===new Uint8Array(new Uint16Array([1]).buffer)[0];function parse$e(E,g="@"){if(!C)return init.then((()=>parse$e(E)));const I=E.length+1,o=(C.__heap_base.value||C.__heap_base)+4*I-C.memory.buffer.byteLength;o>0&&C.memory.grow(Math.ceil(o/65536));const D=C.sa(I-1);if((A?B:Q)(E,new Uint16Array(C.memory.buffer,D,I)),!C.parse())throw Object.assign(new Error(`Parse error ${g}:${E.slice(0,C.e()).split("\n").length}:${C.e()-E.lastIndexOf("\n",C.e()-1)}`),{idx:C.e()});const K=[],k=[];for(;C.ri();){const A=C.is(),Q=C.ie(),B=C.ai(),g=C.id(),I=C.ss(),o=C.se();let D;C.ip()&&(D=J(E.slice(-1===g?A-1:A,-1===g?Q+1:Q))),K.push({n:D,s:A,e:Q,ss:I,se:o,d:g,a:B});}for(;C.re();){const A=C.es(),Q=C.ee(),B=C.els(),g=C.ele(),I=E.slice(A,Q),o=I[0],D=B<0?void 0:E.slice(B,g),K=D?D[0]:"";k.push({s:A,e:Q,ls:B,le:g,n:'"'===o||"'"===o?J(I):I,ln:'"'===K||"'"===K?J(D):D});}function J(A){try{return (0, eval)(A)}catch(A){}}return [K,k,!!C.f()]}function Q(A,Q){const B=A.length;let C=0;for(;C<B;){const B=A.charCodeAt(C);Q[C++]=(255&B)<<8|B>>>8;}}function B(A,Q){const B=A.length;let C=0;for(;C<B;)Q[C]=A.charCodeAt(C++);}let C;const init=WebAssembly.compile((E="AGFzbQEAAAABKghgAX8Bf2AEf39/fwBgAAF/YAAAYAF/AGADf39/AX9gAn9/AX9gAn9/AAMvLgABAQICAgICAgICAgICAgICAgIAAwMDBAQAAAADAAAAAAMDAAUGAAAABwAGAgUEBQFwAQEBBQMBAAEGDwJ/AUGw8gALfwBBsPIACwdwEwZtZW1vcnkCAAJzYQAAAWUAAwJpcwAEAmllAAUCc3MABgJzZQAHAmFpAAgCaWQACQJpcAAKAmVzAAsCZWUADANlbHMADQNlbGUADgJyaQAPAnJlABABZgARBXBhcnNlABILX19oZWFwX2Jhc2UDAQqHPC5oAQF/QQAgADYC9AlBACgC0AkiASAAQQF0aiIAQQA7AQBBACAAQQJqIgA2AvgJQQAgADYC/AlBAEEANgLUCUEAQQA2AuQJQQBBADYC3AlBAEEANgLYCUEAQQA2AuwJQQBBADYC4AkgAQufAQEDf0EAKALkCSEEQQBBACgC/AkiBTYC5AlBACAENgLoCUEAIAVBIGo2AvwJIARBHGpB1AkgBBsgBTYCAEEAKALICSEEQQAoAsQJIQYgBSABNgIAIAUgADYCCCAFIAIgAkECakEAIAYgA0YbIAQgA0YbNgIMIAUgAzYCFCAFQQA2AhAgBSACNgIEIAVBADYCHCAFQQAoAsQJIANGOgAYC1YBAX9BACgC7AkiBEEQakHYCSAEG0EAKAL8CSIENgIAQQAgBDYC7AlBACAEQRRqNgL8CSAEQQA2AhAgBCADNgIMIAQgAjYCCCAEIAE2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AcwB0AGEAbgB0AHkAYgByAGUAYQByAGUAdAB1AHIAZABlAGIAdQBnAGcAZQBhAHcAYQBpAHQAaAByAHcAaABpAGwAZQBmAG8AcgBpAGYAYwBhAHQAYwBmAGkAbgBhAGwAbABlAGwAcwAAQcQJCxABAAAAAgAAAAAEAAAwOQAA","undefined"!=typeof Buffer?Buffer.from(E,"base64"):Uint8Array.from(atob(E),(A=>A.charCodeAt(0))))).then(WebAssembly.instantiate).then((({exports:A})=>{C=A;}));var E;
16327
16330
 
16328
- var convertSourceMap = {};
16331
+ var convertSourceMap$1 = {};
16329
16332
 
16330
16333
  (function (exports) {
16331
16334
 
@@ -16559,8 +16562,10 @@ var convertSourceMap = {};
16559
16562
  exports.generateMapFileComment = function (file, options) {
16560
16563
  var data = 'sourceMappingURL=' + file;
16561
16564
  return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data;
16562
- };
16563
- } (convertSourceMap));
16565
+ };
16566
+ } (convertSourceMap$1));
16567
+
16568
+ var convertSourceMap = /*@__PURE__*/getDefaultExportFromCjs(convertSourceMap$1);
16564
16569
 
16565
16570
  const debug$e = createDebugger('vite:sourcemap', {
16566
16571
  onlyWhenFocused: true,
@@ -16641,7 +16646,7 @@ function applySourcemapIgnoreList(map, sourcemapPath, sourcemapIgnoreList, logge
16641
16646
  }
16642
16647
  }
16643
16648
 
16644
- function e(e,n,r){throw new Error(r?`No known conditions for "${n}" specifier in "${e}" package`:`Missing "${n}" specifier in "${e}" package`)}function n(n,i,o,f){let s,u,l=r(n,o),c=function(e){let n=new Set(["default",...e.conditions||[]]);return e.unsafe||n.add(e.require?"require":"import"),e.unsafe||n.add(e.browser?"browser":"node"),n}(f||{}),a=i[l];if(void 0===a){let e,n,r,t;for(t in i)n&&t.length<n.length||("/"===t[t.length-1]&&l.startsWith(t)?(u=l.substring(t.length),n=t):t.length>1&&(r=t.indexOf("*",2),~r&&(e=RegExp("^"+t.substring(0,r)+"(.*)"+t.substring(1+r)).exec(l),e&&e[1]&&(u=e[1],n=t))));a=i[n];}return a||e(n,l),s=t(a,c),s||e(n,l,1),u&&function(e,n){let r,t=0,i=e.length,o=/[*]/g,f=/[/]$/;for(;t<i;t++)e[t]=o.test(r=e[t])?r.replace(o,n):f.test(r)?r+n:r;}(s,u),s}function r(e,n,r){if(e===n||"."===n)return ".";let t=e+"/",i=t.length,o=n.slice(0,i)===t,f=o?n.slice(i):n;return "#"===f[0]?f:o||!r?"./"===f.slice(0,2)?f:"./"+f:f}function t(e,n,r){if(e){if("string"==typeof e)return r&&r.add(e),[e];let i,o;if(Array.isArray(e)){for(o=r||new Set,i=0;i<e.length;i++)t(e[i],n,o);if(!r&&o.size)return [...o]}else for(i in e)if(n.has(i))return t(e[i],n,r)}}function o(e,r,t){let i,o=e.exports;if(o){if("string"==typeof o)o={".":o};else for(i in o){"."!==i[0]&&(o={".":o});break}return n(e.name,o,r||".",t)}}function f(e,r,t){if(e.imports)return n(e.name,e.imports,r,t)}
16649
+ function e(e,n,r){throw new Error(r?`No known conditions for "${n}" specifier in "${e}" package`:`Missing "${n}" specifier in "${e}" package`)}function n(n,i,o,f){let s,u,l=r(n,o),c=function(e){let n=new Set(["default",...e.conditions||[]]);return e.unsafe||n.add(e.require?"require":"import"),e.unsafe||n.add(e.browser?"browser":"node"),n}(f||{}),a=i[l];if(void 0===a){let e,n,r,t;for(t in i)n&&t.length<n.length||("/"===t[t.length-1]&&l.startsWith(t)?(u=l.substring(t.length),n=t):t.length>1&&(r=t.indexOf("*",1),~r&&(e=RegExp("^"+t.substring(0,r)+"(.*)"+t.substring(1+r)).exec(l),e&&e[1]&&(u=e[1],n=t))));a=i[n];}return a||e(n,l),s=t(a,c),s||e(n,l,1),u&&function(e,n){let r,t=0,i=e.length,o=/[*]/g,f=/[/]$/;for(;t<i;t++)e[t]=o.test(r=e[t])?r.replace(o,n):f.test(r)?r+n:r;}(s,u),s}function r(e,n,r){if(e===n||"."===n)return ".";let t=e+"/",i=t.length,o=n.slice(0,i)===t,f=o?n.slice(i):n;return "#"===f[0]?f:o||!r?"./"===f.slice(0,2)?f:"./"+f:f}function t(e,n,r){if(e){if("string"==typeof e)return r&&r.add(e),[e];let i,o;if(Array.isArray(e)){for(o=r||new Set,i=0;i<e.length;i++)t(e[i],n,o);if(!r&&o.size)return [...o]}else for(i in e)if(n.has(i))return t(e[i],n,r)}}function o(e,r,t){let i,o=e.exports;if(o){if("string"==typeof o)o={".":o};else for(i in o){"."!==i[0]&&(o={".":o});break}return n(e.name,o,r||".",t)}}function f(e,r,t){if(e.imports)return n(e.name,e.imports,r,t)}
16645
16650
 
16646
16651
  // This file was generated. Do not modify manually!
16647
16652
  var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
@@ -22773,7 +22778,7 @@ function resolvePlugin(resolveOptions) {
22773
22778
  // We don't need to resolve these paths since they are already resolved
22774
22779
  // always return here even if res doesn't exist since /@fs/ is explicit
22775
22780
  // if the file doesn't exist it should be a 404.
22776
- debug$d?.(`[@fs] ${picocolorsExports.cyan(id)} -> ${picocolorsExports.dim(res)}`);
22781
+ debug$d?.(`[@fs] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
22777
22782
  return ensureVersionQuery(res, id, options, depsOptimizer);
22778
22783
  }
22779
22784
  // URL
@@ -22781,7 +22786,7 @@ function resolvePlugin(resolveOptions) {
22781
22786
  if (asSrc && id[0] === '/' && (rootInRoot || !id.startsWith(root))) {
22782
22787
  const fsPath = path$o.resolve(root, id.slice(1));
22783
22788
  if ((res = tryFsResolve(fsPath, options))) {
22784
- debug$d?.(`[url] ${picocolorsExports.cyan(id)} -> ${picocolorsExports.dim(res)}`);
22789
+ debug$d?.(`[url] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
22785
22790
  return ensureVersionQuery(res, id, options, depsOptimizer);
22786
22791
  }
22787
22792
  }
@@ -22811,7 +22816,7 @@ function resolvePlugin(resolveOptions) {
22811
22816
  }
22812
22817
  if ((res = tryFsResolve(fsPath, options))) {
22813
22818
  res = ensureVersionQuery(res, id, options, depsOptimizer);
22814
- debug$d?.(`[relative] ${picocolorsExports.cyan(id)} -> ${picocolorsExports.dim(res)}`);
22819
+ debug$d?.(`[relative] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
22815
22820
  // If this isn't a script imported from a .html file, include side effects
22816
22821
  // hints so the non-used code is properly tree-shaken during build time.
22817
22822
  if (!options.idOnly &&
@@ -22834,14 +22839,14 @@ function resolvePlugin(resolveOptions) {
22834
22839
  const basedir = importer ? path$o.dirname(importer) : process.cwd();
22835
22840
  const fsPath = path$o.resolve(basedir, id);
22836
22841
  if ((res = tryFsResolve(fsPath, options))) {
22837
- debug$d?.(`[drive-relative] ${picocolorsExports.cyan(id)} -> ${picocolorsExports.dim(res)}`);
22842
+ debug$d?.(`[drive-relative] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
22838
22843
  return ensureVersionQuery(res, id, options, depsOptimizer);
22839
22844
  }
22840
22845
  }
22841
22846
  // absolute fs paths
22842
22847
  if (isNonDriveRelativeAbsolutePath(id) &&
22843
22848
  (res = tryFsResolve(id, options))) {
22844
- debug$d?.(`[fs] ${picocolorsExports.cyan(id)} -> ${picocolorsExports.dim(res)}`);
22849
+ debug$d?.(`[fs] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
22845
22850
  return ensureVersionQuery(res, id, options, depsOptimizer);
22846
22851
  }
22847
22852
  // external
@@ -22888,7 +22893,7 @@ function resolvePlugin(resolveOptions) {
22888
22893
  else {
22889
22894
  if (!asSrc) {
22890
22895
  debug$d?.(`externalized node built-in "${id}" to empty module. ` +
22891
- `(imported by: ${picocolorsExports.white(picocolorsExports.dim(importer))})`);
22896
+ `(imported by: ${colors$1.white(colors$1.dim(importer))})`);
22892
22897
  }
22893
22898
  else if (isProduction) {
22894
22899
  this.warn(`Module "${id}" has been externalized for browser compatibility, imported by "${importer}". ` +
@@ -22900,7 +22905,7 @@ function resolvePlugin(resolveOptions) {
22900
22905
  }
22901
22906
  }
22902
22907
  }
22903
- debug$d?.(`[fallthrough] ${picocolorsExports.dim(id)}`);
22908
+ debug$d?.(`[fallthrough] ${colors$1.dim(id)}`);
22904
22909
  },
22905
22910
  load(id) {
22906
22911
  if (id.startsWith(browserExternalId)) {
@@ -23143,8 +23148,13 @@ function tryNodeResolve(id, importer, options, targetWeb, depsOptimizer, ssr = f
23143
23148
  }
23144
23149
  let resolvedId = id;
23145
23150
  if (deepMatch && !pkg?.data.exports && path$o.extname(id) !== resolvedExt) {
23146
- resolvedId = resolved.id.slice(resolved.id.indexOf(id));
23147
- debug$d?.(`[processResult] ${picocolorsExports.cyan(id)} -> ${picocolorsExports.dim(resolvedId)}`);
23151
+ // id date-fns/locale
23152
+ // resolve.id ...date-fns/esm/locale/index.js
23153
+ const index = resolved.id.indexOf(id);
23154
+ if (index > -1) {
23155
+ resolvedId = resolved.id.slice(index);
23156
+ debug$d?.(`[processResult] ${colors$1.cyan(id)} -> ${colors$1.dim(resolvedId)}`);
23157
+ }
23148
23158
  }
23149
23159
  return { ...resolved, id: resolvedId, external: true };
23150
23160
  };
@@ -23176,7 +23186,8 @@ function tryNodeResolve(id, importer, options, targetWeb, depsOptimizer, ssr = f
23176
23186
  exclude = options.ssrConfig?.optimizeDeps?.exclude;
23177
23187
  include = options.ssrConfig?.optimizeDeps?.include;
23178
23188
  }
23179
- const skipOptimization = !isJsType ||
23189
+ const skipOptimization = depsOptimizer?.options.noDiscovery ||
23190
+ !isJsType ||
23180
23191
  (importer && isInNodeModules(importer)) ||
23181
23192
  exclude?.includes(pkgId) ||
23182
23193
  exclude?.includes(id) ||
@@ -23358,7 +23369,7 @@ function resolvePackageEntry(id, { dir, data, setResolvedCache, getResolvedCache
23358
23369
  const entryPointPath = path$o.join(dir, entry);
23359
23370
  const resolvedEntryPoint = tryFsResolve(entryPointPath, options, true, true, skipPackageJson);
23360
23371
  if (resolvedEntryPoint) {
23361
- debug$d?.(`[package entry] ${picocolorsExports.cyan(id)} -> ${picocolorsExports.dim(resolvedEntryPoint)}`);
23372
+ debug$d?.(`[package entry] ${colors$1.cyan(id)} -> ${colors$1.dim(resolvedEntryPoint)}`);
23362
23373
  setResolvedCache('.', resolvedEntryPoint, targetWeb);
23363
23374
  return resolvedEntryPoint;
23364
23375
  }
@@ -23444,7 +23455,7 @@ function resolveDeepImport(id, { webResolvedImports, setResolvedCache, getResolv
23444
23455
  const resolved = tryFsResolve(path$o.join(dir, relativeId), options, !exportsField, // try index only if no exports field
23445
23456
  targetWeb);
23446
23457
  if (resolved) {
23447
- debug$d?.(`[node/deep-import] ${picocolorsExports.cyan(id)} -> ${picocolorsExports.dim(resolved)}`);
23458
+ debug$d?.(`[node/deep-import] ${colors$1.cyan(id)} -> ${colors$1.dim(resolved)}`);
23448
23459
  setResolvedCache(id, resolved, targetWeb);
23449
23460
  return resolved;
23450
23461
  }
@@ -23461,7 +23472,7 @@ function tryResolveBrowserMapping(id, importer, options, isFilePath, externalize
23461
23472
  if ((res = bareImportRE.test(browserMappedPath)
23462
23473
  ? tryNodeResolve(browserMappedPath, importer, options, true)?.id
23463
23474
  : tryFsResolve(path$o.join(pkg.dir, browserMappedPath), options))) {
23464
- debug$d?.(`[browser mapped] ${picocolorsExports.cyan(id)} -> ${picocolorsExports.dim(res)}`);
23475
+ debug$d?.(`[browser mapped] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
23465
23476
  let result = { id: res };
23466
23477
  if (options.idOnly) {
23467
23478
  return result;
@@ -24193,7 +24204,7 @@ var utils$f = {};
24193
24204
  };
24194
24205
  flat(args);
24195
24206
  return result;
24196
- };
24207
+ };
24197
24208
  } (utils$f));
24198
24209
 
24199
24210
  const utils$e = utils$f;
@@ -25502,7 +25513,7 @@ var braces_1 = braces$2;
25502
25513
 
25503
25514
  const util = require$$0$6;
25504
25515
  const braces$1 = braces_1;
25505
- const picomatch$2 = picomatchExports;
25516
+ const picomatch$2 = picomatch$3;
25506
25517
  const utils$b = utils$k;
25507
25518
  const isEmptyString = val => val === '' || val === './';
25508
25519
 
@@ -25966,6 +25977,8 @@ micromatch$1.braceExpand = (pattern, options) => {
25966
25977
 
25967
25978
  var micromatch_1 = micromatch$1;
25968
25979
 
25980
+ var micromatch$2 = /*@__PURE__*/getDefaultExportFromCjs(micromatch_1);
25981
+
25969
25982
  Object.defineProperty(pattern$1, "__esModule", { value: true });
25970
25983
  pattern$1.matchAny = pattern$1.convertPatternsToRe = pattern$1.makeRe = pattern$1.getPatternParts = pattern$1.expandBraceExpansion = pattern$1.expandPatternsWithBraceExpansion = pattern$1.isAffectDepthOfReadingPattern = pattern$1.endsWithSlashGlobStar = pattern$1.hasGlobStar = pattern$1.getBaseDirectory = pattern$1.isPatternRelatedToParentDirectory = pattern$1.getPatternsOutsideCurrentDirectory = pattern$1.getPatternsInsideCurrentDirectory = pattern$1.getPositivePatterns = pattern$1.getNegativePatterns = pattern$1.isPositivePattern = pattern$1.isNegativePattern = pattern$1.convertToNegativePattern = pattern$1.convertToPositivePattern = pattern$1.isDynamicPattern = pattern$1.isStaticPattern = void 0;
25971
25984
  const path$f = require$$0$4;
@@ -26530,7 +26543,7 @@ var fs$f = {};
26530
26543
  }
26531
26544
  return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
26532
26545
  }
26533
- exports.createFileSystemAdapter = createFileSystemAdapter;
26546
+ exports.createFileSystemAdapter = createFileSystemAdapter;
26534
26547
  } (fs$f));
26535
26548
 
26536
26549
  Object.defineProperty(settings$3, "__esModule", { value: true });
@@ -26883,7 +26896,7 @@ var fs$b = {};
26883
26896
  }
26884
26897
  return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
26885
26898
  }
26886
- exports.createFileSystemAdapter = createFileSystemAdapter;
26899
+ exports.createFileSystemAdapter = createFileSystemAdapter;
26887
26900
  } (fs$b));
26888
26901
 
26889
26902
  Object.defineProperty(settings$2, "__esModule", { value: true });
@@ -26936,11 +26949,7 @@ function getSettings$1(settingsOrOptions = {}) {
26936
26949
  return new settings_1$2.default(settingsOrOptions);
26937
26950
  }
26938
26951
 
26939
- var queueExports = {};
26940
- var queue = {
26941
- get exports(){ return queueExports; },
26942
- set exports(v){ queueExports = v; },
26943
- };
26952
+ var queue = {exports: {}};
26944
26953
 
26945
26954
  function reusify$1 (Constructor) {
26946
26955
  var head = new Constructor();
@@ -27254,7 +27263,9 @@ function queueAsPromised (context, worker, concurrency) {
27254
27263
  }
27255
27264
 
27256
27265
  queue.exports = fastqueue;
27257
- queueExports.promise = queueAsPromised;
27266
+ queue.exports.promise = queueAsPromised;
27267
+
27268
+ var queueExports = queue.exports;
27258
27269
 
27259
27270
  var common$7 = {};
27260
27271
 
@@ -28232,7 +28243,7 @@ var settings = {};
28232
28243
  return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods);
28233
28244
  }
28234
28245
  }
28235
- exports.default = Settings;
28246
+ exports.default = Settings;
28236
28247
  } (settings));
28237
28248
 
28238
28249
  const taskManager = tasks;
@@ -28303,6 +28314,8 @@ function assertPatternsInput(input) {
28303
28314
  }
28304
28315
  var out = FastGlob;
28305
28316
 
28317
+ var glob = /*@__PURE__*/getDefaultExportFromCjs(out);
28318
+
28306
28319
  const debug$c = createDebugger('vite:ssr-external');
28307
28320
  /**
28308
28321
  * Converts "parent > child" syntax to just "child"
@@ -28664,7 +28677,7 @@ function optimizedDepsPlugin(config) {
28664
28677
  }
28665
28678
  }
28666
28679
  }
28667
- debug$b?.(`load ${picocolorsExports.cyan(file)}`);
28680
+ debug$b?.(`load ${colors$1.cyan(file)}`);
28668
28681
  // Load the file from the cache instead of waiting for other plugin
28669
28682
  // load hooks to avoid race conditions, once processing is resolved,
28670
28683
  // we are sure that the file has been properly save to disk
@@ -28727,7 +28740,7 @@ function optimizedDepsBuildPlugin(config) {
28727
28740
  const info = optimizedDepInfoFromFile(depsOptimizer.metadata, file);
28728
28741
  if (info) {
28729
28742
  await info.processing;
28730
- debug$b?.(`load ${picocolorsExports.cyan(file)}`);
28743
+ debug$b?.(`load ${colors$1.cyan(file)}`);
28731
28744
  }
28732
28745
  else {
28733
28746
  throw new Error(`Something unexpected happened while optimizing "${id}".`);
@@ -29004,7 +29017,7 @@ var dist = {};
29004
29017
  },
29005
29018
  };
29006
29019
  }
29007
- exports.lilconfigSync = lilconfigSync;
29020
+ exports.lilconfigSync = lilconfigSync;
29008
29021
  } (dist));
29009
29022
 
29010
29023
  const ALIAS = Symbol.for('yaml.alias');
@@ -32842,7 +32855,7 @@ function resolveEnd(end, offset, reqSpace, onError) {
32842
32855
  }
32843
32856
 
32844
32857
  const blockMsg = 'Block collections are not allowed within flow collections';
32845
- const isBlock = (token) => token && (token.type === 'block-map' || token.type === 'block-seq');
32858
+ const isBlock$1 = (token) => token && (token.type === 'block-map' || token.type === 'block-seq');
32846
32859
  function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onError) {
32847
32860
  const isMap = fc.start.source === '{';
32848
32861
  const fcName = isMap ? 'flow map' : 'flow sequence';
@@ -32925,7 +32938,7 @@ function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onErr
32925
32938
  : composeEmptyNode(ctx, props.end, sep, null, props, onError);
32926
32939
  coll.items.push(valueNode);
32927
32940
  offset = valueNode.range[2];
32928
- if (isBlock(value))
32941
+ if (isBlock$1(value))
32929
32942
  onError(valueNode.range, 'BLOCK_IN_FLOW', blockMsg);
32930
32943
  }
32931
32944
  else {
@@ -32935,7 +32948,7 @@ function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onErr
32935
32948
  const keyNode = key
32936
32949
  ? composeNode(ctx, key, props, onError)
32937
32950
  : composeEmptyNode(ctx, keyStart, start, null, props, onError);
32938
- if (isBlock(key))
32951
+ if (isBlock$1(key))
32939
32952
  onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg);
32940
32953
  // value properties
32941
32954
  const valueProps = resolveProps(sep ?? [], {
@@ -32974,7 +32987,7 @@ function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onErr
32974
32987
  ? composeEmptyNode(ctx, valueProps.end, sep, null, valueProps, onError)
32975
32988
  : null;
32976
32989
  if (valueNode) {
32977
- if (isBlock(value))
32990
+ if (isBlock$1(value))
32978
32991
  onError(valueNode.range, 'BLOCK_IN_FLOW', blockMsg);
32979
32992
  }
32980
32993
  else if (valueProps.comment) {
@@ -36556,6 +36569,8 @@ const rc = withTypeScriptLoader((ctx, path, options) => {
36556
36569
  */
36557
36570
  var src$1 = rc;
36558
36571
 
36572
+ var postcssrc = /*@__PURE__*/getDefaultExportFromCjs(src$1);
36573
+
36559
36574
  function stripLiteralAcorn(code) {
36560
36575
  const FILL = " ";
36561
36576
  let result = "";
@@ -36621,11 +36636,7 @@ function stripLiteral(code) {
36621
36636
  }
36622
36637
  }
36623
36638
 
36624
- var mainExports = {};
36625
- var main$1 = {
36626
- get exports(){ return mainExports; },
36627
- set exports(v){ mainExports = v; },
36628
- };
36639
+ var main$1 = {exports: {}};
36629
36640
 
36630
36641
  var name = "dotenv";
36631
36642
  var version$1 = "16.0.3";
@@ -36810,8 +36821,8 @@ const DotenvModule = {
36810
36821
  parse: parse$9
36811
36822
  };
36812
36823
 
36813
- mainExports.config = DotenvModule.config;
36814
- var parse_1$1 = mainExports.parse = DotenvModule.parse;
36824
+ main$1.exports.config = DotenvModule.config;
36825
+ var parse_1$1 = main$1.exports.parse = DotenvModule.parse;
36815
36826
  main$1.exports = DotenvModule;
36816
36827
 
36817
36828
  function _interpolate (envValue, environment, config) {
@@ -37585,7 +37596,7 @@ function preImportMapHook(config) {
37585
37596
  return;
37586
37597
  if (importMapAppendIndex < importMapIndex) {
37587
37598
  const relativeHtml = normalizePath$3(path$o.relative(config.root, ctx.filename));
37588
- config.logger.warnOnce(picocolorsExports.yellow(picocolorsExports.bold(`(!) <script type="importmap"> should come before <script type="module"> and <link rel="modulepreload"> in /${relativeHtml}`)));
37599
+ config.logger.warnOnce(colors$1.yellow(colors$1.bold(`(!) <script type="importmap"> should come before <script type="module"> and <link rel="modulepreload"> in /${relativeHtml}`)));
37589
37600
  }
37590
37601
  };
37591
37602
  }
@@ -37629,7 +37640,7 @@ function htmlEnvHook(config) {
37629
37640
  else {
37630
37641
  if (envPrefix.some((prefix) => key.startsWith(prefix))) {
37631
37642
  const relativeHtml = normalizePath$3(path$o.relative(config.root, ctx.filename));
37632
- config.logger.warn(picocolorsExports.yellow(picocolorsExports.bold(`(!) ${text} is not defined in env variables found in /${relativeHtml}. ` +
37643
+ config.logger.warn(colors$1.yellow(colors$1.bold(`(!) ${text} is not defined in env variables found in /${relativeHtml}. ` +
37633
37644
  `Is the variable mistyped?`)));
37634
37645
  }
37635
37646
  return text;
@@ -38422,7 +38433,7 @@ async function compileCSS(id, code, config, urlReplacer) {
38422
38433
  // but we've shimmed to remove the `resolve` dep to cut on bundle size.
38423
38434
  // warn here to provide a better error message.
38424
38435
  if (!path$o.isAbsolute(id)) {
38425
- config.logger.error(picocolorsExports.red(`Unable to resolve \`@import "${id}"\` from ${basedir}`));
38436
+ config.logger.error(colors$1.red(`Unable to resolve \`@import "${id}"\` from ${basedir}`));
38426
38437
  }
38427
38438
  return id;
38428
38439
  },
@@ -38498,10 +38509,10 @@ async function compileCSS(id, code, config, urlReplacer) {
38498
38509
  else if (message.type === 'dir-dependency') {
38499
38510
  // https://github.com/postcss/postcss/blob/main/docs/guidelines/plugin.md#3-dependencies
38500
38511
  const { dir, glob: globPattern = '**' } = message;
38501
- const pattern = out.escapePath(normalizePath$3(path$o.resolve(path$o.dirname(id), dir))) +
38512
+ const pattern = glob.escapePath(normalizePath$3(path$o.resolve(path$o.dirname(id), dir))) +
38502
38513
  `/` +
38503
38514
  globPattern;
38504
- const files = out.sync(pattern, {
38515
+ const files = glob.sync(pattern, {
38505
38516
  ignore: ['**/node_modules/**'],
38506
38517
  });
38507
38518
  for (let i = 0; i < files.length; i++) {
@@ -38516,7 +38527,7 @@ async function compileCSS(id, code, config, urlReplacer) {
38516
38527
  column: message.column,
38517
38528
  })}`;
38518
38529
  }
38519
- config.logger.warn(picocolorsExports.yellow(msg));
38530
+ config.logger.warn(colors$1.yellow(msg));
38520
38531
  }
38521
38532
  }
38522
38533
  }
@@ -38563,8 +38574,8 @@ function createCachedImport(imp) {
38563
38574
  return cached;
38564
38575
  };
38565
38576
  }
38566
- const importPostcssImport = createCachedImport(() => import('./dep-e3f470e2.js').then(function (n) { return n.i; }));
38567
- const importPostcssModules = createCachedImport(() => import('./dep-11cf3f0f.js').then(function (n) { return n.i; }));
38577
+ const importPostcssImport = createCachedImport(() => import('./dep-524177e3.js').then(function (n) { return n.i; }));
38578
+ const importPostcssModules = createCachedImport(() => import('./dep-53740c38.js').then(function (n) { return n.i; }));
38568
38579
  const importPostcss = createCachedImport(() => import('postcss'));
38569
38580
  /**
38570
38581
  * @experimental
@@ -38628,7 +38639,7 @@ async function resolvePostcssConfig(config) {
38628
38639
  }
38629
38640
  else {
38630
38641
  const searchPath = typeof inlineOptions === 'string' ? inlineOptions : config.root;
38631
- result = src$1({}, searchPath).catch((e) => {
38642
+ result = postcssrc({}, searchPath).catch((e) => {
38632
38643
  if (!/No PostCSS Config found/.test(e.message)) {
38633
38644
  if (e instanceof Error) {
38634
38645
  const { name, message, stack } = e;
@@ -38775,7 +38786,7 @@ async function minifyCSS(css, config) {
38775
38786
  });
38776
38787
  if (warnings.length) {
38777
38788
  const msgs = await formatMessages(warnings, { kind: 'warning' });
38778
- config.logger.warn(picocolorsExports.yellow(`warnings when minifying css:\n${msgs.join('\n')}`));
38789
+ config.logger.warn(colors$1.yellow(`warnings when minifying css:\n${msgs.join('\n')}`));
38779
38790
  }
38780
38791
  return code;
38781
38792
  }
@@ -39490,7 +39501,7 @@ base.MethodDefinition = base.PropertyDefinition = base.Property = function (node
39490
39501
  if (node.value) { c(node.value, st, "Expression"); }
39491
39502
  };
39492
39503
 
39493
- const { isMatch: isMatch$1, scan } = micromatch_1;
39504
+ const { isMatch: isMatch$1, scan } = micromatch$2;
39494
39505
  function getAffectedGlobModules(file, server) {
39495
39506
  const modules = [];
39496
39507
  for (const [id, allGlobs] of server._importGlobMap) {
@@ -39723,7 +39734,7 @@ async function transformGlobImport(code, id, root, resolveId, isProduction, rest
39723
39734
  const s = new MagicString(code);
39724
39735
  const staticImports = (await Promise.all(matches.map(async ({ globs, globsResolved, isRelative, options, index, start, end, }) => {
39725
39736
  const cwd = getCommonBase(globsResolved) ?? root;
39726
- const files = (await out(globsResolved, {
39737
+ const files = (await glob(globsResolved, {
39727
39738
  cwd,
39728
39739
  absolute: true,
39729
39740
  dot: !!options.exhaustive,
@@ -39837,7 +39848,7 @@ async function transformGlobImport(code, id, root, resolveId, isProduction, rest
39837
39848
  function globSafePath(path) {
39838
39849
  // slash path to ensure \ is converted to / as \ could lead to a double escape scenario
39839
39850
  // see https://github.com/mrmlnc/fast-glob#advanced-syntax
39840
- return out.escapePath(normalizePath$3(path));
39851
+ return glob.escapePath(normalizePath$3(path));
39841
39852
  }
39842
39853
  function lastNthChar(str, n) {
39843
39854
  return str.charAt(str.length - 1 - n);
@@ -39925,20 +39936,20 @@ async function handleHMRUpdate(file, server, configOnly) {
39925
39936
  (fileName === '.env' || fileName.startsWith('.env.'));
39926
39937
  if (isConfig || isConfigDependency || isEnv) {
39927
39938
  // auto restart server
39928
- debugHmr?.(`[config change] ${picocolorsExports.dim(shortFile)}`);
39929
- config.logger.info(picocolorsExports.green(`${path$o.relative(process.cwd(), file)} changed, restarting server...`), { clear: true, timestamp: true });
39939
+ debugHmr?.(`[config change] ${colors$1.dim(shortFile)}`);
39940
+ config.logger.info(colors$1.green(`${path$o.relative(process.cwd(), file)} changed, restarting server...`), { clear: true, timestamp: true });
39930
39941
  try {
39931
39942
  await server.restart();
39932
39943
  }
39933
39944
  catch (e) {
39934
- config.logger.error(picocolorsExports.red(e));
39945
+ config.logger.error(colors$1.red(e));
39935
39946
  }
39936
39947
  return;
39937
39948
  }
39938
39949
  if (configOnly) {
39939
39950
  return;
39940
39951
  }
39941
- debugHmr?.(`[file change] ${picocolorsExports.dim(shortFile)}`);
39952
+ debugHmr?.(`[file change] ${colors$1.dim(shortFile)}`);
39942
39953
  // (dev only) the client itself cannot be hot updated.
39943
39954
  if (file.startsWith(normalizedClientDir)) {
39944
39955
  ws.send({
@@ -39966,7 +39977,7 @@ async function handleHMRUpdate(file, server, configOnly) {
39966
39977
  if (!hmrContext.modules.length) {
39967
39978
  // html file cannot be hot updated
39968
39979
  if (file.endsWith('.html')) {
39969
- config.logger.info(picocolorsExports.green(`page reload `) + picocolorsExports.dim(shortFile), {
39980
+ config.logger.info(colors$1.green(`page reload `) + colors$1.dim(shortFile), {
39970
39981
  clear: true,
39971
39982
  timestamp: true,
39972
39983
  });
@@ -39979,7 +39990,7 @@ async function handleHMRUpdate(file, server, configOnly) {
39979
39990
  }
39980
39991
  else {
39981
39992
  // loaded but not in the module graph, probably not js
39982
- debugHmr?.(`[no modules matched] ${picocolorsExports.dim(shortFile)}`);
39993
+ debugHmr?.(`[no modules matched] ${colors$1.dim(shortFile)}`);
39983
39994
  }
39984
39995
  return;
39985
39996
  }
@@ -40012,7 +40023,7 @@ function updateModules(file, modules, timestamp, { config, ws, moduleGraph }, af
40012
40023
  })));
40013
40024
  }
40014
40025
  if (needFullReload) {
40015
- config.logger.info(picocolorsExports.green(`page reload `) + picocolorsExports.dim(file), {
40026
+ config.logger.info(colors$1.green(`page reload `) + colors$1.dim(file), {
40016
40027
  clear: !afterInvalidation,
40017
40028
  timestamp: true,
40018
40029
  });
@@ -40022,11 +40033,11 @@ function updateModules(file, modules, timestamp, { config, ws, moduleGraph }, af
40022
40033
  return;
40023
40034
  }
40024
40035
  if (updates.length === 0) {
40025
- debugHmr?.(picocolorsExports.yellow(`no update happened `) + picocolorsExports.dim(file));
40036
+ debugHmr?.(colors$1.yellow(`no update happened `) + colors$1.dim(file));
40026
40037
  return;
40027
40038
  }
40028
- config.logger.info(picocolorsExports.green(`hmr update `) +
40029
- picocolorsExports.dim([...new Set(updates.map((u) => u.path))].join(', ')), { clear: !afterInvalidation, timestamp: true });
40039
+ config.logger.info(colors$1.green(`hmr update `) +
40040
+ colors$1.dim([...new Set(updates.map((u) => u.path))].join(', ')), { clear: !afterInvalidation, timestamp: true });
40030
40041
  ws.send({
40031
40042
  type: 'update',
40032
40043
  updates,
@@ -40056,7 +40067,7 @@ function propagateUpdate(node, traversedModules, boundaries, currentChain = [nod
40056
40067
  // if the imports of `node` have not been analyzed, then `node` has not
40057
40068
  // been loaded in the browser and we should stop propagation.
40058
40069
  if (node.id && node.isSelfAccepting === undefined) {
40059
- debugHmr?.(`[propagate update] stop propagation because not analyzed: ${picocolorsExports.dim(node.id)}`);
40070
+ debugHmr?.(`[propagate update] stop propagation because not analyzed: ${colors$1.dim(node.id)}`);
40060
40071
  return false;
40061
40072
  }
40062
40073
  if (node.isSelfAccepting) {
@@ -40120,7 +40131,7 @@ function handlePrunedModules(mods, { ws }) {
40120
40131
  const t = Date.now();
40121
40132
  mods.forEach((mod) => {
40122
40133
  mod.lastHMRTimestamp = t;
40123
- debugHmr?.(`[dispose] ${picocolorsExports.dim(mod.file)}`);
40134
+ debugHmr?.(`[dispose] ${colors$1.dim(mod.file)}`);
40124
40135
  });
40125
40136
  ws.send({
40126
40137
  type: 'prune',
@@ -40412,7 +40423,7 @@ function importAnalysisPlugin(config) {
40412
40423
  const ssr = options?.ssr === true;
40413
40424
  const prettyImporter = prettifyUrl(importer, root);
40414
40425
  if (canSkipImportAnalysis(importer)) {
40415
- debug$a?.(picocolorsExports.dim(`[skipped] ${prettyImporter}`));
40426
+ debug$a?.(colors$1.dim(`[skipped] ${prettyImporter}`));
40416
40427
  return null;
40417
40428
  }
40418
40429
  const start = performance$1.now();
@@ -40452,7 +40463,7 @@ function importAnalysisPlugin(config) {
40452
40463
  }
40453
40464
  if (!imports.length && !this._addedImports) {
40454
40465
  importerModule.isSelfAccepting = false;
40455
- debug$a?.(`${timeFrom(start)} ${picocolorsExports.dim(`[no imports] ${prettyImporter}`)}`);
40466
+ debug$a?.(`${timeFrom(start)} ${colors$1.dim(`[no imports] ${prettyImporter}`)}`);
40456
40467
  return source;
40457
40468
  }
40458
40469
  let hasHMR = false;
@@ -40650,11 +40661,11 @@ function importAnalysisPlugin(config) {
40650
40661
  ) {
40651
40662
  const newImport = sourceExp + specifier + `?inline` + source.slice(end, expEnd);
40652
40663
  this.warn(`\n` +
40653
- picocolorsExports.cyan(importerModule.file) +
40664
+ colors$1.cyan(importerModule.file) +
40654
40665
  `\n` +
40655
- picocolorsExports.reset(generateCodeFrame(source, start)) +
40666
+ colors$1.reset(generateCodeFrame(source, start)) +
40656
40667
  `\n` +
40657
- picocolorsExports.yellow(`Default and named imports from CSS files are deprecated. ` +
40668
+ colors$1.yellow(`Default and named imports from CSS files are deprecated. ` +
40658
40669
  `Use the ?inline query instead. ` +
40659
40670
  `For example: ${newImport}`));
40660
40671
  }
@@ -40676,7 +40687,7 @@ function importAnalysisPlugin(config) {
40676
40687
  // optimize info for them, but they don't need es interop. If the request isn't
40677
40688
  // a dynamic import, then it is an internal Vite error
40678
40689
  if (!file.match(optimizedDepDynamicRE$1)) {
40679
- config.logger.error(picocolorsExports.red(`Vite Error, ${url} optimized info should be defined`));
40690
+ config.logger.error(colors$1.red(`Vite Error, ${url} optimized info should be defined`));
40680
40691
  }
40681
40692
  }
40682
40693
  else if (needsInterop) {
@@ -40737,11 +40748,11 @@ function importAnalysisPlugin(config) {
40737
40748
  source.slice(dynamicIndex + 1, end));
40738
40749
  if (!hasViteIgnore) {
40739
40750
  this.warn(`\n` +
40740
- picocolorsExports.cyan(importerModule.file) +
40751
+ colors$1.cyan(importerModule.file) +
40741
40752
  `\n` +
40742
- picocolorsExports.reset(generateCodeFrame(source, start)) +
40743
- picocolorsExports.yellow(`\nThe above dynamic import cannot be analyzed by Vite.\n` +
40744
- `See ${picocolorsExports.blue(`https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations`)} ` +
40753
+ colors$1.reset(generateCodeFrame(source, start)) +
40754
+ colors$1.yellow(`\nThe above dynamic import cannot be analyzed by Vite.\n` +
40755
+ `See ${colors$1.blue(`https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations`)} ` +
40745
40756
  `for supported dynamic import formats. ` +
40746
40757
  `If this is intended to be left as-is, you can use the ` +
40747
40758
  `/* @vite-ignore */ comment inside the import() call to suppress this warning.\n`));
@@ -40815,7 +40826,7 @@ function importAnalysisPlugin(config) {
40815
40826
  handlePrunedModules(prunedImports, server);
40816
40827
  }
40817
40828
  }
40818
- debug$a?.(`${timeFrom(start)} ${picocolorsExports.dim(`[${importedUrls.size} imports rewritten] ${prettyImporter}`)}`);
40829
+ debug$a?.(`${timeFrom(start)} ${colors$1.dim(`[${importedUrls.size} imports rewritten] ${prettyImporter}`)}`);
40819
40830
  if (s) {
40820
40831
  return transformStableResult(s, importer, config);
40821
40832
  }
@@ -40877,7 +40888,7 @@ function transformCjsImport(importExp, url, rawUrl, importIndex, importer, confi
40877
40888
  if (config.command === 'serve' &&
40878
40889
  node.type === 'ExportAllDeclaration' &&
40879
40890
  !node.exported) {
40880
- config.logger.warn(picocolorsExports.yellow(`\nUnable to interop \`${importExp}\` in ${importer}, this may lose module exports. Please export "${rawUrl}" as ESM or use named exports instead, e.g. \`export { A, B } from "${rawUrl}"\``));
40891
+ config.logger.warn(colors$1.yellow(`\nUnable to interop \`${importExp}\` in ${importer}, this may lose module exports. Please export "${rawUrl}" as ESM or use named exports instead, e.g. \`export { A, B } from "${rawUrl}"\``));
40881
40892
  }
40882
40893
  else if (node.type === 'ImportDeclaration' ||
40883
40894
  node.type === 'ExportNamedDeclaration') {
@@ -41440,6 +41451,9 @@ function preAliasPlugin(config) {
41440
41451
  if (optimizedId) {
41441
41452
  return optimizedId; // aliased dep already optimized
41442
41453
  }
41454
+ if (depsOptimizer.options.noDiscovery) {
41455
+ return;
41456
+ }
41443
41457
  const resolved = await this.resolve(id, importer, {
41444
41458
  ...options,
41445
41459
  custom: { ...options.custom, 'vite:pre-alias': true },
@@ -41536,13 +41550,7 @@ function definePlugin(config) {
41536
41550
  if (isBuild) {
41537
41551
  const match = key.match(metaEnvRe);
41538
41552
  if (match) {
41539
- userDefineEnv[match[1]] =
41540
- // test if value is raw identifier to wrap with __vite__ so when
41541
- // stringified for `import.meta.env`, we can remove the quotes and
41542
- // retain being an identifier
41543
- typeof val === 'string' && /^[\p{L}_$]/u.test(val.trim())
41544
- ? `__vite__define__${val}`
41545
- : val;
41553
+ userDefineEnv[match[1]] = `__vite__define__${userDefine[key]}`;
41546
41554
  }
41547
41555
  }
41548
41556
  }
@@ -41561,7 +41569,7 @@ function definePlugin(config) {
41561
41569
  ...config.env,
41562
41570
  SSR: '__vite__ssr__',
41563
41571
  ...userDefineEnv,
41564
- }).replace(/"__vite__define__(.+?)"/g, (_, val) => val),
41572
+ }).replace(/"__vite__define__(.+?)"([,}])/g, (_, val, suffix) => `${val.replace(/(^\\")|(\\"$)/g, '"')}${suffix}`),
41565
41573
  });
41566
41574
  }
41567
41575
  function getImportMetaKeys(ssr) {
@@ -42343,12 +42351,12 @@ function prepareError(err) {
42343
42351
  }
42344
42352
  function buildErrorMessage(err, args = [], includeStack = true) {
42345
42353
  if (err.plugin)
42346
- args.push(` Plugin: ${picocolorsExports.magenta(err.plugin)}`);
42354
+ args.push(` Plugin: ${colors$1.magenta(err.plugin)}`);
42347
42355
  const loc = err.loc ? `:${err.loc.line}:${err.loc.column}` : '';
42348
42356
  if (err.id)
42349
- args.push(` File: ${picocolorsExports.cyan(err.id)}${loc}`);
42357
+ args.push(` File: ${colors$1.cyan(err.id)}${loc}`);
42350
42358
  if (err.frame)
42351
- args.push(picocolorsExports.yellow(pad$1(err.frame)));
42359
+ args.push(colors$1.yellow(pad$1(err.frame)));
42352
42360
  if (includeStack && err.stack)
42353
42361
  args.push(pad$1(cleanStack(err.stack)));
42354
42362
  return args.join('\n');
@@ -42361,7 +42369,7 @@ function cleanStack(stack) {
42361
42369
  }
42362
42370
  function logError(server, err) {
42363
42371
  const msg = buildErrorMessage(err, [
42364
- picocolorsExports.red(`Internal server error: ${err.message}`),
42372
+ colors$1.red(`Internal server error: ${err.message}`),
42365
42373
  ]);
42366
42374
  server.config.logger.error(msg, {
42367
42375
  clear: true,
@@ -42431,8 +42439,8 @@ async function createPluginContainer(config, moduleGraph, watcher) {
42431
42439
  },
42432
42440
  };
42433
42441
  function warnIncompatibleMethod(method, plugin) {
42434
- logger.warn(picocolorsExports.cyan(`[plugin:${plugin}] `) +
42435
- picocolorsExports.yellow(`context method ${picocolorsExports.bold(`${method}()`)} is not supported in serve mode. This plugin is likely not vite-compatible.`));
42442
+ logger.warn(colors$1.cyan(`[plugin:${plugin}] `) +
42443
+ colors$1.yellow(`context method ${colors$1.bold(`${method}()`)} is not supported in serve mode. This plugin is likely not vite-compatible.`));
42436
42444
  }
42437
42445
  // parallel, ignores returns
42438
42446
  async function hookParallel(hookName, context, args) {
@@ -42573,7 +42581,7 @@ async function createPluginContainer(config, moduleGraph, watcher) {
42573
42581
  }
42574
42582
  warn(e, position) {
42575
42583
  const err = formatError(e, position, this);
42576
- const msg = buildErrorMessage(err, [picocolorsExports.yellow(`warning: ${err.message}`)], false);
42584
+ const msg = buildErrorMessage(err, [colors$1.yellow(`warning: ${err.message}`)], false);
42577
42585
  logger.warn(msg, {
42578
42586
  clear: true,
42579
42587
  timestamp: true,
@@ -42607,7 +42615,7 @@ async function createPluginContainer(config, moduleGraph, watcher) {
42607
42615
  errLocation = numberToPos(ctx._activeCode, pos);
42608
42616
  }
42609
42617
  catch (err2) {
42610
- logger.error(picocolorsExports.red(`Error in error handler:\n${err2.stack || err2.message}\n`),
42618
+ logger.error(colors$1.red(`Error in error handler:\n${err2.stack || err2.message}\n`),
42611
42619
  // print extra newline to separate the two errors
42612
42620
  { error: err2 });
42613
42621
  throw err;
@@ -42813,7 +42821,7 @@ async function createPluginContainer(config, moduleGraph, watcher) {
42813
42821
  // avoid spamming
42814
42822
  if (!seenResolves[key]) {
42815
42823
  seenResolves[key] = true;
42816
- debugResolve(`${timeFrom(resolveStart)} ${picocolorsExports.cyan(rawId)} -> ${picocolorsExports.dim(id)}`);
42824
+ debugResolve(`${timeFrom(resolveStart)} ${colors$1.cyan(rawId)} -> ${colors$1.dim(id)}`);
42817
42825
  }
42818
42826
  }
42819
42827
  if (id) {
@@ -42924,7 +42932,7 @@ function scanImports(config) {
42924
42932
  entries = computedEntries;
42925
42933
  if (!entries.length) {
42926
42934
  if (!config.optimizeDeps.entries && !config.optimizeDeps.include) {
42927
- config.logger.warn(picocolorsExports.yellow('(!) Could not auto-determine entry point from rollupOptions or html files ' +
42935
+ config.logger.warn(colors$1.yellow('(!) Could not auto-determine entry point from rollupOptions or html files ' +
42928
42936
  'and there are no explicit optimizeDeps.include patterns. ' +
42929
42937
  'Skipping dependency pre-bundling.'));
42930
42938
  }
@@ -42933,7 +42941,7 @@ function scanImports(config) {
42933
42941
  if (scanContext.cancelled)
42934
42942
  return;
42935
42943
  debug$9?.(`Crawling dependencies using entries: ${entries
42936
- .map((entry) => `\n ${picocolorsExports.dim(entry)}`)
42944
+ .map((entry) => `\n ${colors$1.dim(entry)}`)
42937
42945
  .join('')}`);
42938
42946
  return prepareEsbuildScanner(config, entries, deps, missing, scanContext);
42939
42947
  });
@@ -42967,7 +42975,7 @@ function scanImports(config) {
42967
42975
  // return an empty result instead
42968
42976
  return { deps: {}, missing: {} };
42969
42977
  }
42970
- const prependMessage = picocolorsExports.red(`\
42978
+ const prependMessage = colors$1.red(`\
42971
42979
  Failed to scan for dependencies from entries:
42972
42980
  ${entries.join('\n')}
42973
42981
 
@@ -42989,8 +42997,8 @@ function scanImports(config) {
42989
42997
  const duration = (performance$1.now() - start).toFixed(2);
42990
42998
  const depsStr = Object.keys(orderedDependencies(deps))
42991
42999
  .sort()
42992
- .map((id) => `\n ${picocolorsExports.cyan(id)} -> ${picocolorsExports.dim(deps[id])}`)
42993
- .join('') || picocolorsExports.dim('no dependencies found');
43000
+ .map((id) => `\n ${colors$1.cyan(id)} -> ${colors$1.dim(deps[id])}`)
43001
+ .join('') || colors$1.dim('no dependencies found');
42994
43002
  debug$9(`Scan completed in ${duration}ms: ${depsStr}`);
42995
43003
  }
42996
43004
  });
@@ -43059,7 +43067,7 @@ function orderedDependencies(deps) {
43059
43067
  return Object.fromEntries(depsList);
43060
43068
  }
43061
43069
  function globEntries(pattern, config) {
43062
- return out(pattern, {
43070
+ return glob(pattern, {
43063
43071
  cwd: config.root,
43064
43072
  ignore: [
43065
43073
  '**/node_modules/**',
@@ -43470,7 +43478,7 @@ async function createDepsOptimizer(config, server) {
43470
43478
  let newDepsToLogHandle;
43471
43479
  const logNewlyDiscoveredDeps = () => {
43472
43480
  if (newDepsToLog.length) {
43473
- config.logger.info(picocolorsExports.green(`✨ new dependencies optimized: ${depsLogString(newDepsToLog)}`), {
43481
+ config.logger.info(colors$1.green(`✨ new dependencies optimized: ${depsLogString(newDepsToLog)}`), {
43474
43482
  timestamp: true,
43475
43483
  });
43476
43484
  newDepsToLog = [];
@@ -43524,12 +43532,17 @@ async function createDepsOptimizer(config, server) {
43524
43532
  });
43525
43533
  newDepsDiscovered = true;
43526
43534
  }
43527
- if (!isBuild) {
43535
+ if (config.optimizeDeps.noDiscovery) {
43536
+ // We don't need to scan for dependencies or wait for the static crawl to end
43537
+ // Run the first optimization run immediately
43538
+ runOptimizer();
43539
+ }
43540
+ else if (!isBuild) {
43528
43541
  // Important, the scanner is dev only
43529
43542
  depsOptimizer.scanProcessing = new Promise((resolve) => {
43530
43543
  (async () => {
43531
43544
  try {
43532
- debug$8?.(picocolorsExports.green(`scanning for dependencies...`));
43545
+ debug$8?.(colors$1.green(`scanning for dependencies...`));
43533
43546
  discover = discoverProjectDependencies(config);
43534
43547
  const deps = await discover.result;
43535
43548
  discover = undefined;
@@ -43681,7 +43694,7 @@ async function createDepsOptimizer(config, server) {
43681
43694
  }, 2 * debounceMs);
43682
43695
  }
43683
43696
  else {
43684
- debug$8(picocolorsExports.green(`✨ ${!isRerun
43697
+ debug$8(colors$1.green(`✨ ${!isRerun
43685
43698
  ? `dependencies optimized`
43686
43699
  : `optimized dependencies unchanged`}`));
43687
43700
  }
@@ -43693,7 +43706,7 @@ async function createDepsOptimizer(config, server) {
43693
43706
  // We don't resolve the processing promise, as they will be resolved
43694
43707
  // once a rerun is committed
43695
43708
  processingResult.cancel();
43696
- debug$8?.(picocolorsExports.green(`✨ delaying reload as new dependencies have been found...`));
43709
+ debug$8?.(colors$1.green(`✨ delaying reload as new dependencies have been found...`));
43697
43710
  }
43698
43711
  else {
43699
43712
  await commitProcessing();
@@ -43703,11 +43716,11 @@ async function createDepsOptimizer(config, server) {
43703
43716
  newDepsToLogHandle = undefined;
43704
43717
  logNewlyDiscoveredDeps();
43705
43718
  }
43706
- logger.info(picocolorsExports.green(`✨ optimized dependencies changed. reloading`), {
43719
+ logger.info(colors$1.green(`✨ optimized dependencies changed. reloading`), {
43707
43720
  timestamp: true,
43708
43721
  });
43709
43722
  if (needsInteropMismatch.length > 0) {
43710
- config.logger.warn(`Mixed ESM and CJS detected in ${picocolorsExports.yellow(needsInteropMismatch.join(', '))}, add ${needsInteropMismatch.length === 1 ? 'it' : 'them'} to optimizeDeps.needsInterop to speed up cold start`, {
43723
+ config.logger.warn(`Mixed ESM and CJS detected in ${colors$1.yellow(needsInteropMismatch.join(', '))}, add ${needsInteropMismatch.length === 1 ? 'it' : 'them'} to optimizeDeps.needsInterop to speed up cold start`, {
43711
43724
  timestamp: true,
43712
43725
  });
43713
43726
  }
@@ -43716,7 +43729,7 @@ async function createDepsOptimizer(config, server) {
43716
43729
  }
43717
43730
  }
43718
43731
  catch (e) {
43719
- logger.error(picocolorsExports.red(`error while updating dependencies:\n${e.stack}`), { timestamp: true, error: e });
43732
+ logger.error(colors$1.red(`error while updating dependencies:\n${e.stack}`), { timestamp: true, error: e });
43720
43733
  resolveEnqueuedProcessingPromises();
43721
43734
  // Reset missing deps, let the server rediscover the dependencies
43722
43735
  metadata.discovered = {};
@@ -43743,7 +43756,7 @@ async function createDepsOptimizer(config, server) {
43743
43756
  // optimizeDeps processing is finished
43744
43757
  const deps = Object.keys(metadata.discovered);
43745
43758
  const depsString = depsLogString(deps);
43746
- debug$8?.(picocolorsExports.green(`new dependencies found: ${depsString}`));
43759
+ debug$8?.(colors$1.green(`new dependencies found: ${depsString}`));
43747
43760
  runOptimizer();
43748
43761
  }
43749
43762
  function getDiscoveredBrowserHash(hash, deps, missing) {
@@ -43828,7 +43841,7 @@ async function createDepsOptimizer(config, server) {
43828
43841
  // On build time, a missing dep appearing after onCrawlEnd is an internal error
43829
43842
  // On dev, switch after this point to a simple debounce strategy
43830
43843
  crawlEndFinder = undefined;
43831
- debug$8?.(picocolorsExports.green(`✨ static imports crawl ended`));
43844
+ debug$8?.(colors$1.green(`✨ static imports crawl ended`));
43832
43845
  if (closed) {
43833
43846
  return;
43834
43847
  }
@@ -43842,7 +43855,7 @@ async function createDepsOptimizer(config, server) {
43842
43855
  currentlyProcessing = false;
43843
43856
  const scanDeps = Object.keys(result.metadata.optimized);
43844
43857
  if (scanDeps.length === 0 && crawlDeps.length === 0) {
43845
- debug$8?.(picocolorsExports.green(`✨ no dependencies found by the scanner or crawling static imports`));
43858
+ debug$8?.(colors$1.green(`✨ no dependencies found by the scanner or crawling static imports`));
43846
43859
  result.cancel();
43847
43860
  firstRunCalled = true;
43848
43861
  return;
@@ -43860,13 +43873,13 @@ async function createDepsOptimizer(config, server) {
43860
43873
  }
43861
43874
  }
43862
43875
  if (scannerMissedDeps) {
43863
- debug$8?.(picocolorsExports.yellow(`✨ new dependencies were found while crawling that weren't detected by the scanner`));
43876
+ debug$8?.(colors$1.yellow(`✨ new dependencies were found while crawling that weren't detected by the scanner`));
43864
43877
  }
43865
- debug$8?.(picocolorsExports.green(`✨ re-running optimizer`));
43878
+ debug$8?.(colors$1.green(`✨ re-running optimizer`));
43866
43879
  debouncedProcessing(0);
43867
43880
  }
43868
43881
  else {
43869
- debug$8?.(picocolorsExports.green(`✨ using post-scan optimizer result, the scanner found every used dependency`));
43882
+ debug$8?.(colors$1.green(`✨ using post-scan optimizer result, the scanner found every used dependency`));
43870
43883
  startNextDiscoveredBatch();
43871
43884
  runOptimizer(result);
43872
43885
  }
@@ -43874,7 +43887,7 @@ async function createDepsOptimizer(config, server) {
43874
43887
  else {
43875
43888
  currentlyProcessing = false;
43876
43889
  if (crawlDeps.length === 0) {
43877
- debug$8?.(picocolorsExports.green(`✨ no dependencies found while crawling the static imports`));
43890
+ debug$8?.(colors$1.green(`✨ no dependencies found while crawling the static imports`));
43878
43891
  firstRunCalled = true;
43879
43892
  }
43880
43893
  else {
@@ -44005,7 +44018,7 @@ function findInteropMismatches(discovered, optimized) {
44005
44018
  // This only happens when a discovered dependency has mixed ESM and CJS syntax
44006
44019
  // and it hasn't been manually added to optimizeDeps.needsInterop
44007
44020
  needsInteropMismatch.push(dep);
44008
- debug$8?.(picocolorsExports.cyan(`✨ needsInterop mismatch detected for ${dep}`));
44021
+ debug$8?.(colors$1.cyan(`✨ needsInterop mismatch detected for ${dep}`));
44009
44022
  }
44010
44023
  }
44011
44024
  }
@@ -44028,7 +44041,7 @@ async function optimizeDeps(config, force = config.optimizeDeps.force, asCommand
44028
44041
  }
44029
44042
  const deps = await discoverProjectDependencies(config).result;
44030
44043
  const depsString = depsLogString(Object.keys(deps));
44031
- log?.(picocolorsExports.green(`Optimizing dependencies:\n ${depsString}`));
44044
+ log?.(colors$1.green(`Optimizing dependencies:\n ${depsString}`));
44032
44045
  await addManuallyIncludedOptimizeDeps(deps, config, ssr);
44033
44046
  const depsInfo = toDiscoveredDependencies(config, deps, ssr);
44034
44047
  const result = await runOptimizeDeps(config, depsInfo).result;
@@ -44123,7 +44136,7 @@ function discoverProjectDependencies(config) {
44123
44136
  const missingIds = Object.keys(missing);
44124
44137
  if (missingIds.length) {
44125
44138
  throw new Error(`The following dependencies are imported but could not be resolved:\n\n ${missingIds
44126
- .map((id) => `${picocolorsExports.cyan(id)} ${picocolorsExports.white(picocolorsExports.dim(`(imported by ${missing[id]})`))}`)
44139
+ .map((id) => `${colors$1.cyan(id)} ${colors$1.white(colors$1.dim(`(imported by ${missing[id]})`))}`)
44127
44140
  .join(`\n `)}\n\nAre they installed?`);
44128
44141
  }
44129
44142
  return deps;
@@ -44146,7 +44159,7 @@ function toDiscoveredDependencies(config, deps, ssr, timestamp) {
44146
44159
  return discovered;
44147
44160
  }
44148
44161
  function depsLogString(qualifiedIds) {
44149
- return picocolorsExports.yellow(qualifiedIds.join(`, `));
44162
+ return colors$1.yellow(qualifiedIds.join(`, `));
44150
44163
  }
44151
44164
  /**
44152
44165
  * Internally, Vite uses this function to prepare a optimizeDeps run. When Vite starts, we can get
@@ -44431,7 +44444,7 @@ async function addManuallyIncludedOptimizeDeps(deps, config, ssr, extra = [], fi
44431
44444
  if (optimizeDepsInclude.length || extra.length) {
44432
44445
  const unableToOptimize = (id, msg) => {
44433
44446
  if (optimizeDepsInclude.includes(id)) {
44434
- logger.warn(`${msg}: ${picocolorsExports.cyan(id)}, present in '${ssr ? 'ssr.' : ''}optimizeDeps.include'`);
44447
+ logger.warn(`${msg}: ${colors$1.cyan(id)}, present in '${ssr ? 'ssr.' : ''}optimizeDeps.include'`);
44435
44448
  }
44436
44449
  };
44437
44450
  const resolve = createOptimizeDepsIncludeResolver(config, ssr);
@@ -44877,7 +44890,7 @@ const isModernFlag = `__VITE_IS_MODERN__`;
44877
44890
  const preloadMethod = `__vitePreload`;
44878
44891
  const preloadMarker = `__VITE_PRELOAD__`;
44879
44892
  const preloadHelperId = '\0vite/preload-helper';
44880
- const preloadMarkerWithQuote = `"${preloadMarker}"`;
44893
+ const preloadMarkerWithQuote = new RegExp(`['"]${preloadMarker}['"]`);
44881
44894
  const dynamicImportPrefixRE = /import\s*\(/;
44882
44895
  // TODO: abstract
44883
44896
  const optimizedDepChunkRE = /\/chunk-[A-Z\d]{8}\.js/;
@@ -44886,6 +44899,13 @@ function toRelativePath(filename, importer) {
44886
44899
  const relPath = path$o.relative(path$o.dirname(importer), filename);
44887
44900
  return relPath[0] === '.' ? relPath : `./${relPath}`;
44888
44901
  }
44902
+ function indexOfMatchInSlice(str, reg, pos = 0) {
44903
+ if (pos !== 0) {
44904
+ str = str.slice(pos);
44905
+ }
44906
+ const matcher = str.match(reg);
44907
+ return matcher?.index !== undefined ? matcher.index + pos : -1;
44908
+ }
44889
44909
  /**
44890
44910
  * Helper for preloading CSS and direct imports of async chunks in parallel to
44891
44911
  * the async chunk itself.
@@ -45090,7 +45110,7 @@ function buildImportAnalysisPlugin(config) {
45090
45110
  // optimize info for them, but they don't need es interop. If the request isn't
45091
45111
  // a dynamic import, then it is an internal Vite error
45092
45112
  if (!file.match(optimizedDepDynamicRE)) {
45093
- config.logger.error(picocolorsExports.red(`Vite Error, ${url} optimized info should be defined`));
45113
+ config.logger.error(colors$1.red(`Vite Error, ${url} optimized info should be defined`));
45094
45114
  }
45095
45115
  }
45096
45116
  else if (needsInterop) {
@@ -45233,10 +45253,10 @@ function buildImportAnalysisPlugin(config) {
45233
45253
  };
45234
45254
  addDeps(normalizedFile);
45235
45255
  }
45236
- let markerStartPos = code.indexOf(preloadMarkerWithQuote, end);
45256
+ let markerStartPos = indexOfMatchInSlice(code, preloadMarkerWithQuote, end);
45237
45257
  // fix issue #3051
45238
45258
  if (markerStartPos === -1 && imports.length === 1) {
45239
- markerStartPos = code.indexOf(preloadMarkerWithQuote);
45259
+ markerStartPos = indexOfMatchInSlice(code, preloadMarkerWithQuote);
45240
45260
  }
45241
45261
  if (markerStartPos > 0) {
45242
45262
  // the dep list includes the main chunk, so only need to reload when there are actual other deps.
@@ -45285,19 +45305,19 @@ function buildImportAnalysisPlugin(config) {
45285
45305
  ? toRelativePath(d, file)
45286
45306
  : d));
45287
45307
  }
45288
- s.update(markerStartPos, markerStartPos + preloadMarkerWithQuote.length, `[${renderedDeps.join(',')}]`);
45308
+ s.update(markerStartPos, markerStartPos + preloadMarker.length + 2, `[${renderedDeps.join(',')}]`);
45289
45309
  rewroteMarkerStartPos.add(markerStartPos);
45290
45310
  }
45291
45311
  }
45292
45312
  }
45293
45313
  // there may still be markers due to inlined dynamic imports, remove
45294
45314
  // all the markers regardless
45295
- let markerStartPos = code.indexOf(preloadMarkerWithQuote);
45315
+ let markerStartPos = indexOfMatchInSlice(code, preloadMarkerWithQuote);
45296
45316
  while (markerStartPos >= 0) {
45297
45317
  if (!rewroteMarkerStartPos.has(markerStartPos)) {
45298
- s.update(markerStartPos, markerStartPos + preloadMarkerWithQuote.length, 'void 0');
45318
+ s.update(markerStartPos, markerStartPos + preloadMarker.length + 2, 'void 0');
45299
45319
  }
45300
- markerStartPos = code.indexOf(preloadMarkerWithQuote, markerStartPos + preloadMarkerWithQuote.length);
45320
+ markerStartPos = indexOfMatchInSlice(code, preloadMarkerWithQuote, markerStartPos + preloadMarker.length + 2);
45301
45321
  }
45302
45322
  if (s.hasChanged()) {
45303
45323
  chunk.code = s.toString();
@@ -45398,7 +45418,7 @@ function ssrManifestPlugin(config) {
45398
45418
  ? config.build.ssrManifest
45399
45419
  : 'ssr-manifest.json',
45400
45420
  type: 'asset',
45401
- source: jsonStableStringify(ssrManifest, { space: 2 }),
45421
+ source: jsonStableStringify$1(ssrManifest, { space: 2 }),
45402
45422
  });
45403
45423
  },
45404
45424
  };
@@ -45429,7 +45449,7 @@ function resolveChokidarOptions(config, options) {
45429
45449
  '**/.git/**',
45430
45450
  '**/node_modules/**',
45431
45451
  '**/test-results/**',
45432
- out.escapePath(config.cacheDir) + '/**',
45452
+ glob.escapePath(config.cacheDir) + '/**',
45433
45453
  ...(Array.isArray(ignored) ? ignored : [ignored]),
45434
45454
  ],
45435
45455
  ignoreInitial: true,
@@ -45587,6 +45607,8 @@ function stattag (stat) {
45587
45607
  return '"' + size + '-' + mtime + '"'
45588
45608
  }
45589
45609
 
45610
+ var getEtag = /*@__PURE__*/getDefaultExportFromCjs(etag_1);
45611
+
45590
45612
  const alias = {
45591
45613
  js: 'application/javascript',
45592
45614
  css: 'text/css',
@@ -45594,7 +45616,7 @@ const alias = {
45594
45616
  json: 'application/json',
45595
45617
  };
45596
45618
  function send$2(req, res, content, type, options) {
45597
- const { etag = etag_1(content, { weak: true }), cacheControl = 'no-cache', headers, map, } = options;
45619
+ const { etag = getEtag(content, { weak: true }), cacheControl = 'no-cache', headers, map, } = options;
45598
45620
  if (res.writableEnded) {
45599
45621
  return;
45600
45622
  }
@@ -45937,6 +45959,8 @@ function escapeHtml$1(string) {
45937
45959
  : html;
45938
45960
  }
45939
45961
 
45962
+ var escapeHtml$2 = /*@__PURE__*/getDefaultExportFromCjs(escapeHtml_1);
45963
+
45940
45964
  const knownJavascriptExtensionRE = /\.[tj]sx?$/;
45941
45965
  const sirvOptions = ({ headers, shouldServe, }) => {
45942
45966
  return {
@@ -46097,7 +46121,7 @@ function renderRestrictedErrorHTML(msg) {
46097
46121
  return html `
46098
46122
  <body>
46099
46123
  <h1>403 Restricted</h1>
46100
- <p>${escapeHtml_1(msg).replace(/\n/g, '<br/>')}</p>
46124
+ <p>${escapeHtml$2(msg).replace(/\n/g, '<br/>')}</p>
46101
46125
  <style>
46102
46126
  body {
46103
46127
  padding: 1em 2em;
@@ -46245,7 +46269,7 @@ async function build(inlineConfig = {}) {
46245
46269
  const options = config.build;
46246
46270
  const ssr = !!options.ssr;
46247
46271
  const libOptions = options.lib;
46248
- config.logger.info(picocolorsExports.cyan(`vite v${VERSION$1} ${picocolorsExports.green(`building ${ssr ? `SSR bundle ` : ``}for ${config.mode}...`)}`));
46272
+ config.logger.info(colors$1.cyan(`vite v${VERSION$1} ${colors$1.green(`building ${ssr ? `SSR bundle ` : ``}for ${config.mode}...`)}`));
46249
46273
  const resolve = (p) => path$o.resolve(config.root, p);
46250
46274
  const input = libOptions
46251
46275
  ? options.rollupOptions?.input ||
@@ -46295,12 +46319,12 @@ async function build(inlineConfig = {}) {
46295
46319
  },
46296
46320
  };
46297
46321
  const outputBuildError = (e) => {
46298
- let msg = picocolorsExports.red((e.plugin ? `[${e.plugin}] ` : '') + e.message);
46322
+ let msg = colors$1.red((e.plugin ? `[${e.plugin}] ` : '') + e.message);
46299
46323
  if (e.id) {
46300
- msg += `\nfile: ${picocolorsExports.cyan(e.id + (e.loc ? `:${e.loc.line}:${e.loc.column}` : ''))}`;
46324
+ msg += `\nfile: ${colors$1.cyan(e.id + (e.loc ? `:${e.loc.line}:${e.loc.column}` : ''))}`;
46301
46325
  }
46302
46326
  if (e.frame) {
46303
- msg += `\n` + picocolorsExports.yellow(e.frame);
46327
+ msg += `\n` + colors$1.yellow(e.frame);
46304
46328
  }
46305
46329
  config.logger.error(msg, { error: e });
46306
46330
  };
@@ -46364,7 +46388,7 @@ async function build(inlineConfig = {}) {
46364
46388
  const outDirs = normalizedOutputs.map(({ dir }) => resolve(dir));
46365
46389
  // watch file changes with rollup
46366
46390
  if (config.build.watch) {
46367
- config.logger.info(picocolorsExports.cyan(`\nwatching for file changes...`));
46391
+ config.logger.info(colors$1.cyan(`\nwatching for file changes...`));
46368
46392
  const resolvedChokidarOptions = resolveChokidarOptions(config, config.build.watch.chokidar);
46369
46393
  const { watch } = await import('rollup');
46370
46394
  const watcher = watch({
@@ -46377,14 +46401,14 @@ async function build(inlineConfig = {}) {
46377
46401
  });
46378
46402
  watcher.on('event', (event) => {
46379
46403
  if (event.code === 'BUNDLE_START') {
46380
- config.logger.info(picocolorsExports.cyan(`\nbuild started...`));
46404
+ config.logger.info(colors$1.cyan(`\nbuild started...`));
46381
46405
  if (options.write) {
46382
46406
  prepareOutDir(outDirs, options.emptyOutDir, config);
46383
46407
  }
46384
46408
  }
46385
46409
  else if (event.code === 'BUNDLE_END') {
46386
46410
  event.result.close();
46387
- config.logger.info(picocolorsExports.cyan(`built in ${event.duration}ms.`));
46411
+ config.logger.info(colors$1.cyan(`built in ${event.duration}ms.`));
46388
46412
  }
46389
46413
  else if (event.code === 'ERROR') {
46390
46414
  outputBuildError(event.error);
@@ -46421,7 +46445,7 @@ function prepareOutDir(outDirs, emptyOutDir, config) {
46421
46445
  if (fs$l.existsSync(outDir) &&
46422
46446
  !normalizePath$3(outDir).startsWith(config.root + '/')) {
46423
46447
  // warn if outDir is outside of root
46424
- config.logger.warn(picocolorsExports.yellow(`\n${picocolorsExports.bold(`(!)`)} outDir ${picocolorsExports.white(picocolorsExports.dim(outDir))} is not inside project root and will not be emptied.\n` +
46448
+ config.logger.warn(colors$1.yellow(`\n${colors$1.bold(`(!)`)} outDir ${colors$1.white(colors$1.dim(outDir))} is not inside project root and will not be emptied.\n` +
46425
46449
  `Use --emptyOutDir to override.\n`));
46426
46450
  outside = true;
46427
46451
  break;
@@ -46498,7 +46522,7 @@ function resolveBuildOutputs(outputs, libOptions, logger) {
46498
46522
  }
46499
46523
  // By this point, we know "outputs" is an Array.
46500
46524
  if (libOptions.formats) {
46501
- logger.warn(picocolorsExports.yellow('"build.lib.formats" will be ignored because "build.rollupOptions.output" is already an array format.'));
46525
+ logger.warn(colors$1.yellow('"build.lib.formats" will be ignored because "build.rollupOptions.output" is already an array format.'));
46502
46526
  }
46503
46527
  outputs.forEach((output) => {
46504
46528
  if (['umd', 'iife'].includes(output.format) && !output.name) {
@@ -46534,7 +46558,7 @@ function onRollupWarning(warning, warn, config) {
46534
46558
  return;
46535
46559
  }
46536
46560
  if (warning.code === 'PLUGIN_WARNING') {
46537
- config.logger.warn(`${picocolorsExports.bold(picocolorsExports.yellow(`[plugin:${warning.plugin}]`))} ${picocolorsExports.yellow(warning.message)}`);
46561
+ config.logger.warn(`${colors$1.bold(colors$1.yellow(`[plugin:${warning.plugin}]`))} ${colors$1.yellow(warning.message)}`);
46538
46562
  return;
46539
46563
  }
46540
46564
  warn(warning);
@@ -46778,23 +46802,11 @@ var build$1 = {
46778
46802
  toOutputFilePathWithoutRuntime: toOutputFilePathWithoutRuntime
46779
46803
  };
46780
46804
 
46781
- var srcExports = {};
46782
- var src = {
46783
- get exports(){ return srcExports; },
46784
- set exports(v){ srcExports = v; },
46785
- };
46805
+ var src = {exports: {}};
46786
46806
 
46787
- var browserExports = {};
46788
- var browser = {
46789
- get exports(){ return browserExports; },
46790
- set exports(v){ browserExports = v; },
46791
- };
46807
+ var browser = {exports: {}};
46792
46808
 
46793
- var debugExports = {};
46794
- var debug$6 = {
46795
- get exports(){ return debugExports; },
46796
- set exports(v){ debugExports = v; },
46797
- };
46809
+ var debug$6 = {exports: {}};
46798
46810
 
46799
46811
  /**
46800
46812
  * Helpers.
@@ -46960,7 +46972,7 @@ function requireMs () {
46960
46972
  var hasRequiredDebug;
46961
46973
 
46962
46974
  function requireDebug () {
46963
- if (hasRequiredDebug) return debugExports;
46975
+ if (hasRequiredDebug) return debug$6.exports;
46964
46976
  hasRequiredDebug = 1;
46965
46977
  (function (module, exports) {
46966
46978
  /**
@@ -47163,9 +47175,9 @@ function requireDebug () {
47163
47175
  function coerce(val) {
47164
47176
  if (val instanceof Error) return val.stack || val.message;
47165
47177
  return val;
47166
- }
47167
- } (debug$6, debugExports));
47168
- return debugExports;
47178
+ }
47179
+ } (debug$6, debug$6.exports));
47180
+ return debug$6.exports;
47169
47181
  }
47170
47182
 
47171
47183
  /**
@@ -47177,7 +47189,7 @@ function requireDebug () {
47177
47189
  var hasRequiredBrowser;
47178
47190
 
47179
47191
  function requireBrowser () {
47180
- if (hasRequiredBrowser) return browserExports;
47192
+ if (hasRequiredBrowser) return browser.exports;
47181
47193
  hasRequiredBrowser = 1;
47182
47194
  (function (module, exports) {
47183
47195
  exports = module.exports = requireDebug();
@@ -47358,16 +47370,12 @@ function requireBrowser () {
47358
47370
  try {
47359
47371
  return window.localStorage;
47360
47372
  } catch (e) {}
47361
- }
47362
- } (browser, browserExports));
47363
- return browserExports;
47373
+ }
47374
+ } (browser, browser.exports));
47375
+ return browser.exports;
47364
47376
  }
47365
47377
 
47366
- var nodeExports = {};
47367
- var node = {
47368
- get exports(){ return nodeExports; },
47369
- set exports(v){ nodeExports = v; },
47370
- };
47378
+ var node = {exports: {}};
47371
47379
 
47372
47380
  /**
47373
47381
  * Module dependencies.
@@ -47376,7 +47384,7 @@ var node = {
47376
47384
  var hasRequiredNode;
47377
47385
 
47378
47386
  function requireNode () {
47379
- if (hasRequiredNode) return nodeExports;
47387
+ if (hasRequiredNode) return node.exports;
47380
47388
  hasRequiredNode = 1;
47381
47389
  (function (module, exports) {
47382
47390
  var tty = require$$0$3;
@@ -47622,9 +47630,9 @@ function requireNode () {
47622
47630
  * Enable namespaces listed in `process.env.DEBUG` initially.
47623
47631
  */
47624
47632
 
47625
- exports.enable(load());
47626
- } (node, nodeExports));
47627
- return nodeExports;
47633
+ exports.enable(load());
47634
+ } (node, node.exports));
47635
+ return node.exports;
47628
47636
  }
47629
47637
 
47630
47638
  /**
@@ -47632,13 +47640,13 @@ function requireNode () {
47632
47640
  * treat as a browser.
47633
47641
  */
47634
47642
 
47635
- (function (module) {
47636
- if (typeof process !== 'undefined' && process.type === 'renderer') {
47637
- module.exports = requireBrowser();
47638
- } else {
47639
- module.exports = requireNode();
47640
- }
47641
- } (src));
47643
+ if (typeof process !== 'undefined' && process.type === 'renderer') {
47644
+ src.exports = requireBrowser();
47645
+ } else {
47646
+ src.exports = requireNode();
47647
+ }
47648
+
47649
+ var srcExports = src.exports;
47642
47650
 
47643
47651
  /*!
47644
47652
  * encodeurl
@@ -47699,11 +47707,7 @@ function encodeUrl$1 (url) {
47699
47707
  .replace(ENCODE_CHARS_REGEXP, encodeURI)
47700
47708
  }
47701
47709
 
47702
- var onFinishedExports = {};
47703
- var onFinished$2 = {
47704
- get exports(){ return onFinishedExports; },
47705
- set exports(v){ onFinishedExports = v; },
47706
- };
47710
+ var onFinished$2 = {exports: {}};
47707
47711
 
47708
47712
  /*!
47709
47713
  * ee-first
@@ -47812,7 +47816,7 @@ function listener(event, done) {
47812
47816
  */
47813
47817
 
47814
47818
  onFinished$2.exports = onFinished$1;
47815
- onFinishedExports.isFinished = isFinished$1;
47819
+ onFinished$2.exports.isFinished = isFinished$1;
47816
47820
 
47817
47821
  /**
47818
47822
  * Module dependencies.
@@ -47994,11 +47998,9 @@ function patchAssignSocket(res, callback) {
47994
47998
  };
47995
47999
  }
47996
48000
 
47997
- var parseurlExports = {};
47998
- var parseurl$1 = {
47999
- get exports(){ return parseurlExports; },
48000
- set exports(v){ parseurlExports = v; },
48001
- };
48001
+ var onFinishedExports = onFinished$2.exports;
48002
+
48003
+ var parseurl$1 = {exports: {}};
48002
48004
 
48003
48005
  /*!
48004
48006
  * parseurl
@@ -48022,7 +48024,7 @@ var Url = url$3.Url;
48022
48024
  */
48023
48025
 
48024
48026
  parseurl$1.exports = parseurl;
48025
- parseurlExports.original = originalurl;
48027
+ parseurl$1.exports.original = originalurl;
48026
48028
 
48027
48029
  /**
48028
48030
  * Parse the `req` url with memoization.
@@ -48155,6 +48157,8 @@ function fresh (url, parsedUrl) {
48155
48157
  parsedUrl._raw === url
48156
48158
  }
48157
48159
 
48160
+ var parseurlExports = parseurl$1.exports;
48161
+
48158
48162
  var require$$0$1 = {
48159
48163
  "100": "Continue",
48160
48164
  "101": "Switching Protocols",
@@ -48732,11 +48736,7 @@ function setHeaders (res, headers) {
48732
48736
  }
48733
48737
  }
48734
48738
 
48735
- var utilsMergeExports = {};
48736
- var utilsMerge = {
48737
- get exports(){ return utilsMergeExports; },
48738
- set exports(v){ utilsMergeExports = v; },
48739
- };
48739
+ var utilsMerge = {exports: {}};
48740
48740
 
48741
48741
  /**
48742
48742
  * Merge object b with object a.
@@ -48761,9 +48761,11 @@ var utilsMerge = {
48761
48761
  }
48762
48762
  }
48763
48763
  return a;
48764
- };
48764
+ };
48765
48765
  } (utilsMerge));
48766
48766
 
48767
+ var utilsMergeExports = utilsMerge.exports;
48768
+
48767
48769
  /*!
48768
48770
  * connect
48769
48771
  * Copyright(c) 2010 Sencha Inc.
@@ -49042,11 +49044,9 @@ function getProtohost(url) {
49042
49044
  : undefined;
49043
49045
  }
49044
49046
 
49045
- var libExports$1 = {};
49046
- var lib$1 = {
49047
- get exports(){ return libExports$1; },
49048
- set exports(v){ libExports$1 = v; },
49049
- };
49047
+ var connect$1 = /*@__PURE__*/getDefaultExportFromCjs(connect);
49048
+
49049
+ var lib$1 = {exports: {}};
49050
49050
 
49051
49051
  /*
49052
49052
  object-assign
@@ -49137,11 +49137,7 @@ var objectAssign = shouldUseNative() ? Object.assign : function (target, source)
49137
49137
  return to;
49138
49138
  };
49139
49139
 
49140
- var varyExports = {};
49141
- var vary$1 = {
49142
- get exports(){ return varyExports; },
49143
- set exports(v){ varyExports = v; },
49144
- };
49140
+ var vary$1 = {exports: {}};
49145
49141
 
49146
49142
  /*!
49147
49143
  * vary
@@ -49154,7 +49150,7 @@ var vary$1 = {
49154
49150
  */
49155
49151
 
49156
49152
  vary$1.exports = vary;
49157
- varyExports.append = append;
49153
+ vary$1.exports.append = append;
49158
49154
 
49159
49155
  /**
49160
49156
  * RegExp to match field-name in RFC 7230 sec 3.2
@@ -49291,6 +49287,8 @@ function vary (res, field) {
49291
49287
  }
49292
49288
  }
49293
49289
 
49290
+ var varyExports = vary$1.exports;
49291
+
49294
49292
  (function () {
49295
49293
 
49296
49294
  var assign = objectAssign;
@@ -49528,13 +49526,16 @@ function vary (res, field) {
49528
49526
 
49529
49527
  }());
49530
49528
 
49529
+ var libExports$1 = lib$1.exports;
49530
+ var corsMiddleware = /*@__PURE__*/getDefaultExportFromCjs(libExports$1);
49531
+
49531
49532
  var chokidar = {};
49532
49533
 
49533
49534
  const fs$8 = require$$0__default;
49534
49535
  const { Readable } = require$$0$7;
49535
49536
  const sysPath$3 = require$$0$4;
49536
49537
  const { promisify: promisify$3 } = require$$0$6;
49537
- const picomatch$1 = picomatchExports;
49538
+ const picomatch$1 = picomatch$3;
49538
49539
 
49539
49540
  const readdir$1 = promisify$3(fs$8.readdir);
49540
49541
  const stat$3 = promisify$3(fs$8.stat);
@@ -49816,11 +49817,7 @@ readdirp$1.default = readdirp$1;
49816
49817
 
49817
49818
  var readdirp_1 = readdirp$1;
49818
49819
 
49819
- var anymatchExports = {};
49820
- var anymatch$2 = {
49821
- get exports(){ return anymatchExports; },
49822
- set exports(v){ anymatchExports = v; },
49823
- };
49820
+ var anymatch$2 = {exports: {}};
49824
49821
 
49825
49822
  /*!
49826
49823
  * normalize-path <https://github.com/jonschlinkert/normalize-path>
@@ -49858,9 +49855,11 @@ var normalizePath$2 = function(path, stripTrailing) {
49858
49855
  return prefix + segs.join('/');
49859
49856
  };
49860
49857
 
49861
- Object.defineProperty(anymatchExports, "__esModule", { value: true });
49858
+ var anymatch_1 = anymatch$2.exports;
49859
+
49860
+ Object.defineProperty(anymatch_1, "__esModule", { value: true });
49862
49861
 
49863
- const picomatch = picomatchExports;
49862
+ const picomatch = picomatch$3;
49864
49863
  const normalizePath$1 = normalizePath$2;
49865
49864
 
49866
49865
  /**
@@ -49961,11 +49960,7 @@ const anymatch$1 = (matchers, testString, options = DEFAULT_OPTIONS) => {
49961
49960
  anymatch$1.default = anymatch$1;
49962
49961
  anymatch$2.exports = anymatch$1;
49963
49962
 
49964
- var binaryExtensionsExports = {};
49965
- var binaryExtensions$1 = {
49966
- get exports(){ return binaryExtensionsExports; },
49967
- set exports(v){ binaryExtensionsExports = v; },
49968
- };
49963
+ var anymatchExports = anymatch$2.exports;
49969
49964
 
49970
49965
  var require$$0 = [
49971
49966
  "3dm",
@@ -50228,12 +50223,10 @@ var require$$0 = [
50228
50223
  "zipx"
50229
50224
  ];
50230
50225
 
50231
- (function (module) {
50232
- module.exports = require$$0;
50233
- } (binaryExtensions$1));
50226
+ var binaryExtensions$1 = require$$0;
50234
50227
 
50235
50228
  const path$8 = require$$0$4;
50236
- const binaryExtensions = binaryExtensionsExports;
50229
+ const binaryExtensions = binaryExtensions$1;
50237
50230
 
50238
50231
  const extensions = new Set(binaryExtensions);
50239
50232
 
@@ -50305,7 +50298,7 @@ var constants$1 = {};
50305
50298
  exports.isWindows = platform === 'win32';
50306
50299
  exports.isMacos = platform === 'darwin';
50307
50300
  exports.isLinux = platform === 'linux';
50308
- exports.isIBMi = os.type() === 'OS400';
50301
+ exports.isIBMi = os.type() === 'OS400';
50309
50302
  } (constants$1));
50310
50303
 
50311
50304
  const fs$7 = require$$0__default;
@@ -50333,7 +50326,7 @@ const {
50333
50326
 
50334
50327
  const THROTTLE_MODE_WATCH = 'watch';
50335
50328
 
50336
- const open$1 = promisify$2(fs$7.open);
50329
+ const open$2 = promisify$2(fs$7.open);
50337
50330
  const stat$2 = promisify$2(fs$7.stat);
50338
50331
  const lstat$1 = promisify$2(fs$7.lstat);
50339
50332
  const close = promisify$2(fs$7.close);
@@ -50485,7 +50478,7 @@ const setFsWatchListener = (path, fullPath, options, handlers) => {
50485
50478
  // Workaround for https://github.com/joyent/node/issues/4337
50486
50479
  if (isWindows$2 && error.code === 'EPERM') {
50487
50480
  try {
50488
- const fd = await open$1(path, 'r');
50481
+ const fd = await open$2(path, 'r');
50489
50482
  await close(fd);
50490
50483
  broadcastErr(error);
50491
50484
  } catch (err) {}
@@ -50951,11 +50944,7 @@ async _addToNodeFs(path, initialAdd, priorWh, depth, target) {
50951
50944
 
50952
50945
  var nodefsHandler = NodeFsHandler$1;
50953
50946
 
50954
- var fseventsHandlerExports = {};
50955
- var fseventsHandler = {
50956
- get exports(){ return fseventsHandlerExports; },
50957
- set exports(v){ fseventsHandlerExports = v; },
50958
- };
50947
+ var fseventsHandler = {exports: {}};
50959
50948
 
50960
50949
  const fs$6 = require$$0__default;
50961
50950
  const sysPath$1 = require$$0$4;
@@ -51479,7 +51468,9 @@ async _addToFsEvents(path, transform, forceAdd, priorDepth) {
51479
51468
  };
51480
51469
 
51481
51470
  fseventsHandler.exports = FsEventsHandler$1;
51482
- fseventsHandlerExports.canUse = canUse;
51471
+ fseventsHandler.exports.canUse = canUse;
51472
+
51473
+ var fseventsHandlerExports = fseventsHandler.exports;
51483
51474
 
51484
51475
  const { EventEmitter: EventEmitter$2 } = require$$0$5;
51485
51476
  const fs$5 = require$$0__default;
@@ -53088,6 +53079,8 @@ var launchEditorMiddleware = (specifiedEditor, srcRoot, onErrorCallback) => {
53088
53079
  }
53089
53080
  };
53090
53081
 
53082
+ var launchEditorMiddleware$1 = /*@__PURE__*/getDefaultExportFromCjs(launchEditorMiddleware);
53083
+
53091
53084
  async function resolveHttpServer({ proxy }, app, httpsOptions) {
53092
53085
  if (!httpsOptions) {
53093
53086
  const { createServer } = await import('node:http');
@@ -53161,7 +53154,7 @@ function setClientErrorHandler(server, logger) {
53161
53154
  let msg = '400 Bad Request';
53162
53155
  if (err.code === 'HPE_HEADER_OVERFLOW') {
53163
53156
  msg = '431 Request Header Fields Too Large';
53164
- logger.warn(picocolorsExports.yellow('Server responded with status code 431. ' +
53157
+ logger.warn(colors$1.yellow('Server responded with status code 431. ' +
53165
53158
  'See https://vitejs.dev/guide/troubleshooting.html#_431-request-header-fields-too-large.'));
53166
53159
  }
53167
53160
  if (err.code === 'ECONNRESET' || !socket.writable) {
@@ -53347,7 +53340,7 @@ async function loadAndTransform(id, url, server, options, timestamp) {
53347
53340
  if (transformResult == null ||
53348
53341
  (isObject$2(transformResult) && transformResult.code == null)) {
53349
53342
  // no transform applied, keep code as-is
53350
- debugTransform?.(timeFrom(transformStart) + picocolorsExports.dim(` [skipped] ${prettyUrl}`));
53343
+ debugTransform?.(timeFrom(transformStart) + colors$1.dim(` [skipped] ${prettyUrl}`));
53351
53344
  }
53352
53345
  else {
53353
53346
  debugTransform?.(`${timeFrom(transformStart)} ${prettyUrl}`);
@@ -53380,7 +53373,7 @@ async function loadAndTransform(id, url, server, options, timestamp) {
53380
53373
  : {
53381
53374
  code,
53382
53375
  map,
53383
- etag: etag_1(code, { weak: true }),
53376
+ etag: getEtag(code, { weak: true }),
53384
53377
  };
53385
53378
  // Only cache the result if the module wasn't invalidated while it was
53386
53379
  // being processed, so it is re-processed next time if it is stale
@@ -54124,11 +54117,12 @@ const functionNodeTypeRE = /Function(?:Expression|Declaration)$|Method$/;
54124
54117
  function isFunction(node) {
54125
54118
  return functionNodeTypeRE.test(node.type);
54126
54119
  }
54120
+ const blockNodeTypeRE = /^BlockStatement$|^For(?:In|Of)?Statement$/;
54121
+ function isBlock(node) {
54122
+ return blockNodeTypeRE.test(node.type);
54123
+ }
54127
54124
  function findParentScope(parentStack, isVar = false) {
54128
- const predicate = isVar
54129
- ? isFunction
54130
- : (node) => node.type === 'BlockStatement';
54131
- return parentStack.find(predicate);
54125
+ return parentStack.find(isVar ? isFunction : isBlock);
54132
54126
  }
54133
54127
  function isInDestructuringAssignment(parent, parentStack) {
54134
54128
  if (parent &&
@@ -54357,7 +54351,7 @@ async function instantiateModule(url, server, context = { global }, urlStack = [
54357
54351
  if (e.stack && fixStacktrace) {
54358
54352
  ssrFixStacktrace(e, moduleGraph);
54359
54353
  }
54360
- server.config.logger.error(picocolorsExports.red(`Error when evaluating SSR module ${url}:` +
54354
+ server.config.logger.error(colors$1.red(`Error when evaluating SSR module ${url}:` +
54361
54355
  (errorData?.importee
54362
54356
  ? ` failed to import "${errorData.importee}"`
54363
54357
  : '') +
@@ -54427,10 +54421,10 @@ function bindShortcuts(server, opts) {
54427
54421
  }
54428
54422
  server._shortcutsOptions = opts;
54429
54423
  if (opts.print) {
54430
- server.config.logger.info(picocolorsExports.dim(picocolorsExports.green(' ➜')) +
54431
- picocolorsExports.dim(' press ') +
54432
- picocolorsExports.bold('h') +
54433
- picocolorsExports.dim(' to show help'));
54424
+ server.config.logger.info(colors$1.dim(colors$1.green(' ➜')) +
54425
+ colors$1.dim(' press ') +
54426
+ colors$1.bold('h') +
54427
+ colors$1.dim(' to show help'));
54434
54428
  }
54435
54429
  const shortcuts = (opts.customShortcuts ?? [])
54436
54430
  .filter(isDefined)
@@ -54447,10 +54441,10 @@ function bindShortcuts(server, opts) {
54447
54441
  if (input === 'h') {
54448
54442
  server.config.logger.info([
54449
54443
  '',
54450
- picocolorsExports.bold(' Shortcuts'),
54451
- ...shortcuts.map((shortcut) => picocolorsExports.dim(' press ') +
54452
- picocolorsExports.bold(shortcut.key) +
54453
- picocolorsExports.dim(` to ${shortcut.description}`)),
54444
+ colors$1.bold(' Shortcuts'),
54445
+ ...shortcuts.map((shortcut) => colors$1.dim(' press ') +
54446
+ colors$1.bold(shortcut.key) +
54447
+ colors$1.dim(` to ${shortcut.description}`)),
54454
54448
  ].join('\n'));
54455
54449
  }
54456
54450
  const shortcut = shortcuts.find((shortcut) => shortcut.key === input);
@@ -54505,11 +54499,7 @@ const BASE_SHORTCUTS = [
54505
54499
  },
54506
54500
  ];
54507
54501
 
54508
- var bufferUtilExports = {};
54509
- var bufferUtil$1 = {
54510
- get exports(){ return bufferUtilExports; },
54511
- set exports(v){ bufferUtilExports = v; },
54512
- };
54502
+ var bufferUtil$1 = {exports: {}};
54513
54503
 
54514
54504
  var constants = {
54515
54505
  BINARY_TYPES: ['nodebuffer', 'arraybuffer', 'fragments'],
@@ -54638,12 +54628,12 @@ if (!process.env.WS_NO_BUFFER_UTIL) {
54638
54628
  try {
54639
54629
  const bufferUtil = require('bufferutil');
54640
54630
 
54641
- bufferUtilExports.mask = function (source, mask, output, offset, length) {
54631
+ bufferUtil$1.exports.mask = function (source, mask, output, offset, length) {
54642
54632
  if (length < 48) _mask(source, mask, output, offset, length);
54643
54633
  else bufferUtil.mask(source, mask, output, offset, length);
54644
54634
  };
54645
54635
 
54646
- bufferUtilExports.unmask = function (buffer, mask) {
54636
+ bufferUtil$1.exports.unmask = function (buffer, mask) {
54647
54637
  if (buffer.length < 32) _unmask(buffer, mask);
54648
54638
  else bufferUtil.unmask(buffer, mask);
54649
54639
  };
@@ -54652,6 +54642,8 @@ if (!process.env.WS_NO_BUFFER_UTIL) {
54652
54642
  }
54653
54643
  }
54654
54644
 
54645
+ var bufferUtilExports = bufferUtil$1.exports;
54646
+
54655
54647
  const kDone = Symbol('kDone');
54656
54648
  const kRun = Symbol('kRun');
54657
54649
 
@@ -55219,11 +55211,7 @@ function inflateOnError(err) {
55219
55211
  this[kCallback](err);
55220
55212
  }
55221
55213
 
55222
- var validationExports = {};
55223
- var validation = {
55224
- get exports(){ return validationExports; },
55225
- set exports(v){ validationExports = v; },
55226
- };
55214
+ var validation = {exports: {}};
55227
55215
 
55228
55216
  const { isUtf8 } = require$$0$b;
55229
55217
 
@@ -55339,14 +55327,14 @@ validation.exports = {
55339
55327
  };
55340
55328
 
55341
55329
  if (isUtf8) {
55342
- validationExports.isValidUTF8 = function (buf) {
55330
+ validation.exports.isValidUTF8 = function (buf) {
55343
55331
  return buf.length < 24 ? _isValidUTF8(buf) : isUtf8(buf);
55344
55332
  };
55345
55333
  } /* istanbul ignore else */ else if (!process.env.WS_NO_UTF_8_VALIDATE) {
55346
55334
  try {
55347
55335
  const isValidUTF8 = require('utf-8-validate');
55348
55336
 
55349
- validationExports.isValidUTF8 = function (buf) {
55337
+ validation.exports.isValidUTF8 = function (buf) {
55350
55338
  return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf);
55351
55339
  };
55352
55340
  } catch (e) {
@@ -55354,6 +55342,8 @@ if (isUtf8) {
55354
55342
  }
55355
55343
  }
55356
55344
 
55345
+ var validationExports = validation.exports;
55346
+
55357
55347
  const { Writable: Writable$1 } = require$$0$7;
55358
55348
 
55359
55349
  const PerMessageDeflate$3 = permessageDeflate;
@@ -58848,6 +58838,8 @@ function abortHandshakeOrEmitwsClientError(server, req, socket, code, message) {
58848
58838
  }
58849
58839
  }
58850
58840
 
58841
+ var WebSocketServerRaw = /*@__PURE__*/getDefaultExportFromCjs(websocketServer);
58842
+
58851
58843
  const HMR_HEADER = 'vite-hmr';
58852
58844
  const wsServerEvents = [
58853
58845
  'connection',
@@ -58870,7 +58862,7 @@ function createWebSocketServer(server, config, httpsOptions) {
58870
58862
  const port = hmrPort || 24678;
58871
58863
  const host = (hmr && hmr.host) || undefined;
58872
58864
  if (wsServer) {
58873
- wss = new websocketServer({ noServer: true });
58865
+ wss = new WebSocketServerRaw({ noServer: true });
58874
58866
  wsServer.on('upgrade', (req, socket, head) => {
58875
58867
  if (req.headers['sec-websocket-protocol'] === HMR_HEADER) {
58876
58868
  wss.handleUpgrade(req, socket, head, (ws) => {
@@ -58901,7 +58893,7 @@ function createWebSocketServer(server, config, httpsOptions) {
58901
58893
  }
58902
58894
  // vite dev server in middleware mode
58903
58895
  // need to call ws listen manually
58904
- wss = new websocketServer({ server: wsHttpServer });
58896
+ wss = new WebSocketServerRaw({ server: wsHttpServer });
58905
58897
  }
58906
58898
  wss.on('connection', (socket) => {
58907
58899
  socket.on('message', (raw) => {
@@ -58921,7 +58913,7 @@ function createWebSocketServer(server, config, httpsOptions) {
58921
58913
  listeners.forEach((listener) => listener(parsed.data, client));
58922
58914
  });
58923
58915
  socket.on('error', (err) => {
58924
- config.logger.error(`${picocolorsExports.red(`ws error:`)}\n${err.stack}`, {
58916
+ config.logger.error(`${colors$1.red(`ws error:`)}\n${err.stack}`, {
58925
58917
  timestamp: true,
58926
58918
  error: err,
58927
58919
  });
@@ -58934,10 +58926,10 @@ function createWebSocketServer(server, config, httpsOptions) {
58934
58926
  });
58935
58927
  wss.on('error', (e) => {
58936
58928
  if (e.code === 'EADDRINUSE') {
58937
- config.logger.error(picocolorsExports.red(`WebSocket server error: Port is already in use`), { error: e });
58929
+ config.logger.error(colors$1.red(`WebSocket server error: Port is already in use`), { error: e });
58938
58930
  }
58939
58931
  else {
58940
- config.logger.error(picocolorsExports.red(`WebSocket server error:\n${e.stack || e.message}`), { error: e });
58932
+ config.logger.error(colors$1.red(`WebSocket server error:\n${e.stack || e.message}`), { error: e });
58941
58933
  }
58942
58934
  });
58943
58935
  // Provide a wrapper to the ws client so we can send messages in JSON format
@@ -59088,23 +59080,9 @@ function baseMiddleware({ config, }) {
59088
59080
  };
59089
59081
  }
59090
59082
 
59091
- var httpProxyExports$1 = {};
59092
- var httpProxy$3 = {
59093
- get exports(){ return httpProxyExports$1; },
59094
- set exports(v){ httpProxyExports$1 = v; },
59095
- };
59096
-
59097
- var httpProxyExports = {};
59098
- var httpProxy$2 = {
59099
- get exports(){ return httpProxyExports; },
59100
- set exports(v){ httpProxyExports = v; },
59101
- };
59083
+ var httpProxy$3 = {exports: {}};
59102
59084
 
59103
- var eventemitter3Exports = {};
59104
- var eventemitter3 = {
59105
- get exports(){ return eventemitter3Exports; },
59106
- set exports(v){ eventemitter3Exports = v; },
59107
- };
59085
+ var eventemitter3 = {exports: {}};
59108
59086
 
59109
59087
  (function (module) {
59110
59088
 
@@ -59441,9 +59419,11 @@ var eventemitter3 = {
59441
59419
  //
59442
59420
  {
59443
59421
  module.exports = EventEmitter;
59444
- }
59422
+ }
59445
59423
  } (eventemitter3));
59446
59424
 
59425
+ var eventemitter3Exports = eventemitter3.exports;
59426
+
59447
59427
  var common$3 = {};
59448
59428
 
59449
59429
  /**
@@ -59881,11 +59861,7 @@ var webOutgoing = { // <--
59881
59861
 
59882
59862
  };
59883
59863
 
59884
- var followRedirectsExports = {};
59885
- var followRedirects$1 = {
59886
- get exports(){ return followRedirectsExports; },
59887
- set exports(v){ followRedirectsExports = v; },
59888
- };
59864
+ var followRedirects$1 = {exports: {}};
59889
59865
 
59890
59866
  var debug$3;
59891
59867
 
@@ -60495,7 +60471,9 @@ function isSubdomain(subdomain, domain) {
60495
60471
 
60496
60472
  // Exports
60497
60473
  followRedirects$1.exports = wrap({ http: http$1, https: https$1 });
60498
- followRedirectsExports.wrap = wrap;
60474
+ followRedirects$1.exports.wrap = wrap;
60475
+
60476
+ var followRedirectsExports = followRedirects$1.exports;
60499
60477
 
60500
60478
  var httpNative = require$$1$1,
60501
60479
  httpsNative = require$$1$2,
@@ -61039,8 +61017,10 @@ var wsIncoming = {
61039
61017
  if(i === false) throw new Error('No such pass');
61040
61018
 
61041
61019
  passes.splice(i++, 0, callback);
61042
- };
61043
- } (httpProxy$2));
61020
+ };
61021
+ } (httpProxy$3));
61022
+
61023
+ var httpProxyExports = httpProxy$3.exports;
61044
61024
 
61045
61025
  // Use explicit /index.js to help browserify negociation in require '/lib/http-proxy' (!)
61046
61026
  var ProxyServer = httpProxyExports.Server;
@@ -61106,7 +61086,7 @@ ProxyServer.createProxy = createProxyServer;
61106
61086
  /**
61107
61087
  * Export the proxy "Server" as the main export.
61108
61088
  */
61109
- var httpProxy$1 = ProxyServer;
61089
+ var httpProxy$2 = ProxyServer;
61110
61090
 
61111
61091
  /*!
61112
61092
  * Caron dimonio, con occhi di bragia
@@ -61120,11 +61100,9 @@ var httpProxy$1 = ProxyServer;
61120
61100
  * Dante - The Divine Comedy (Canto III)
61121
61101
  */
61122
61102
 
61123
- (function (module) {
61124
- module.exports = httpProxy$1;
61125
- } (httpProxy$3));
61103
+ var httpProxy = httpProxy$2;
61126
61104
 
61127
- var httpProxy = /*@__PURE__*/getDefaultExportFromCjs(httpProxyExports$1);
61105
+ var httpProxy$1 = /*@__PURE__*/getDefaultExportFromCjs(httpProxy);
61128
61106
 
61129
61107
  const debug$1 = createDebugger('vite:proxy');
61130
61108
  function proxyMiddleware(httpServer, options, config) {
@@ -61138,7 +61116,7 @@ function proxyMiddleware(httpServer, options, config) {
61138
61116
  if (typeof opts === 'string') {
61139
61117
  opts = { target: opts, changeOrigin: true };
61140
61118
  }
61141
- const proxy = httpProxy.createProxyServer(opts);
61119
+ const proxy = httpProxy$1.createProxyServer(opts);
61142
61120
  if (opts.configure) {
61143
61121
  opts.configure(proxy, opts);
61144
61122
  }
@@ -61146,7 +61124,7 @@ function proxyMiddleware(httpServer, options, config) {
61146
61124
  // When it is ws proxy, res is net.Socket
61147
61125
  const res = originalRes;
61148
61126
  if ('req' in res) {
61149
- config.logger.error(`${picocolorsExports.red(`http proxy error at ${originalRes.req.url}:`)}\n${err.stack}`, {
61127
+ config.logger.error(`${colors$1.red(`http proxy error at ${originalRes.req.url}:`)}\n${err.stack}`, {
61150
61128
  timestamp: true,
61151
61129
  error: err,
61152
61130
  });
@@ -61159,7 +61137,7 @@ function proxyMiddleware(httpServer, options, config) {
61159
61137
  }
61160
61138
  }
61161
61139
  else {
61162
- config.logger.error(`${picocolorsExports.red(`ws proxy error:`)}\n${err.stack}`, {
61140
+ config.logger.error(`${colors$1.red(`ws proxy error:`)}\n${err.stack}`, {
61163
61141
  timestamp: true,
61164
61142
  error: err,
61165
61143
  });
@@ -61225,11 +61203,7 @@ function doesProxyContextMatchUrl(context, url) {
61225
61203
  url.startsWith(context));
61226
61204
  }
61227
61205
 
61228
- var libExports = {};
61229
- var lib = {
61230
- get exports(){ return libExports; },
61231
- set exports(v){ libExports = v; },
61232
- };
61206
+ var lib = {exports: {}};
61233
61207
 
61234
61208
  (function (module, exports) {
61235
61209
 
@@ -61351,10 +61325,11 @@ var lib = {
61351
61325
  return console.log.bind(console);
61352
61326
  }
61353
61327
  return function(){};
61354
- }
61328
+ }
61355
61329
  } (lib));
61356
61330
 
61357
- var history = libExports;
61331
+ var libExports = lib.exports;
61332
+ var history = /*@__PURE__*/getDefaultExportFromCjs(libExports);
61358
61333
 
61359
61334
  function htmlFallbackMiddleware(root, spaFallback) {
61360
61335
  const historyHtmlFallbackMiddleware = history({
@@ -61458,14 +61433,14 @@ function transformMiddleware(server) {
61458
61433
  const rawUrl = removeImportQuery(url);
61459
61434
  warning =
61460
61435
  'Assets in public cannot be imported from JavaScript.\n' +
61461
- `Instead of ${picocolorsExports.cyan(rawUrl)}, put the file in the src directory, and use ${picocolorsExports.cyan(rawUrl.replace(publicPath, '/src/'))} instead.`;
61436
+ `Instead of ${colors$1.cyan(rawUrl)}, put the file in the src directory, and use ${colors$1.cyan(rawUrl.replace(publicPath, '/src/'))} instead.`;
61462
61437
  }
61463
61438
  else {
61464
61439
  warning =
61465
61440
  `files in the public directory are served at the root path.\n` +
61466
- `Instead of ${picocolorsExports.cyan(url)}, use ${picocolorsExports.cyan(url.replace(publicPath, '/'))}.`;
61441
+ `Instead of ${colors$1.cyan(url)}, use ${colors$1.cyan(url.replace(publicPath, '/'))}.`;
61467
61442
  }
61468
- logger.warn(picocolorsExports.yellow(warning));
61443
+ logger.warn(colors$1.yellow(warning));
61469
61444
  }
61470
61445
  }
61471
61446
  if (isJSRequest(url) ||
@@ -62049,11 +62024,7 @@ class ModuleGraph {
62049
62024
  }
62050
62025
  }
62051
62026
 
62052
- var isWslExports = {};
62053
- var isWsl$2 = {
62054
- get exports(){ return isWslExports; },
62055
- set exports(v){ isWslExports = v; },
62056
- };
62027
+ var isWsl$2 = {exports: {}};
62057
62028
 
62058
62029
  const fs$3 = require$$0__default;
62059
62030
 
@@ -62115,6 +62086,8 @@ if (process.env.__IS_WSL_TEST__) {
62115
62086
  isWsl$2.exports = isWsl$1();
62116
62087
  }
62117
62088
 
62089
+ var isWslExports = isWsl$2.exports;
62090
+
62118
62091
  var defineLazyProp = (object, propertyName, fn) => {
62119
62092
  const define = value => Object.defineProperty(object, propertyName, {value, enumerable: true, writable: true});
62120
62093
 
@@ -62469,11 +62442,9 @@ open.openApp = openApp;
62469
62442
 
62470
62443
  var open_1 = open;
62471
62444
 
62472
- var crossSpawnExports = {};
62473
- var crossSpawn = {
62474
- get exports(){ return crossSpawnExports; },
62475
- set exports(v){ crossSpawnExports = v; },
62476
- };
62445
+ var open$1 = /*@__PURE__*/getDefaultExportFromCjs(open_1);
62446
+
62447
+ var crossSpawn = {exports: {}};
62477
62448
 
62478
62449
  var windows;
62479
62450
  var hasRequiredWindows;
@@ -62759,11 +62730,7 @@ const whichSync = (cmd, opt) => {
62759
62730
  var which_1 = which$1;
62760
62731
  which$1.sync = whichSync;
62761
62732
 
62762
- var pathKeyExports = {};
62763
- var pathKey$1 = {
62764
- get exports(){ return pathKeyExports; },
62765
- set exports(v){ pathKeyExports = v; },
62766
- };
62733
+ var pathKey$1 = {exports: {}};
62767
62734
 
62768
62735
  const pathKey = (options = {}) => {
62769
62736
  const environment = options.env || process.env;
@@ -62778,7 +62745,9 @@ const pathKey = (options = {}) => {
62778
62745
 
62779
62746
  pathKey$1.exports = pathKey;
62780
62747
  // TODO: Remove this for the next major release
62781
- pathKeyExports.default = pathKey;
62748
+ pathKey$1.exports.default = pathKey;
62749
+
62750
+ var pathKeyExports = pathKey$1.exports;
62782
62751
 
62783
62752
  const path$1 = require$$0$4;
62784
62753
  const which = which_1;
@@ -63100,11 +63069,14 @@ function spawnSync(command, args, options) {
63100
63069
  }
63101
63070
 
63102
63071
  crossSpawn.exports = spawn;
63103
- crossSpawnExports.spawn = spawn;
63104
- crossSpawnExports.sync = spawnSync;
63072
+ crossSpawn.exports.spawn = spawn;
63073
+ crossSpawn.exports.sync = spawnSync;
63074
+
63075
+ crossSpawn.exports._parse = parse;
63076
+ crossSpawn.exports._enoent = enoent;
63105
63077
 
63106
- crossSpawnExports._parse = parse;
63107
- crossSpawnExports._enoent = enoent;
63078
+ var crossSpawnExports = crossSpawn.exports;
63079
+ var spawn$1 = /*@__PURE__*/getDefaultExportFromCjs(crossSpawnExports);
63108
63080
 
63109
63081
  /**
63110
63082
  * The following is modified based on source found in
@@ -63134,12 +63106,12 @@ function openBrowser(url, opt, logger) {
63134
63106
  }
63135
63107
  function executeNodeScript(scriptPath, url, logger) {
63136
63108
  const extraArgs = process.argv.slice(2);
63137
- const child = crossSpawnExports(process.execPath, [scriptPath, ...extraArgs, url], {
63109
+ const child = spawn$1(process.execPath, [scriptPath, ...extraArgs, url], {
63138
63110
  stdio: 'inherit',
63139
63111
  });
63140
63112
  child.on('close', (code) => {
63141
63113
  if (code !== 0) {
63142
- logger.error(picocolorsExports.red(`\nThe script specified as BROWSER environment variable failed.\n\n${picocolorsExports.cyan(scriptPath)} exited with code ${code}.`), { error: null });
63114
+ logger.error(colors$1.red(`\nThe script specified as BROWSER environment variable failed.\n\n${colors$1.cyan(scriptPath)} exited with code ${code}.`), { error: null });
63143
63115
  }
63144
63116
  });
63145
63117
  }
@@ -63193,7 +63165,7 @@ async function startBrowserProcess(browser, browserArgs, url) {
63193
63165
  const options = browser
63194
63166
  ? { app: { name: browser, arguments: browserArgs } }
63195
63167
  : {};
63196
- open_1(url, options).catch(() => { }); // Prevent `unhandledRejection` error.
63168
+ open$1(url, options).catch(() => { }); // Prevent `unhandledRejection` error.
63197
63169
  return true;
63198
63170
  }
63199
63171
  catch (err) {
@@ -63225,7 +63197,7 @@ async function _createServer(inlineConfig = {}, options) {
63225
63197
  disableGlobbing: true,
63226
63198
  ...serverConfig.watch,
63227
63199
  });
63228
- const middlewares = connect();
63200
+ const middlewares = connect$1();
63229
63201
  const httpServer = middlewareMode
63230
63202
  ? null
63231
63203
  : await resolveHttpServer(serverConfig, middlewares, httpsOptions);
@@ -63339,7 +63311,7 @@ async function _createServer(inlineConfig = {}, options) {
63339
63311
  _importGlobMap: new Map(),
63340
63312
  _forceOptimizeOnRestart: false,
63341
63313
  _pendingRequests: new Map(),
63342
- _fsDenyGlob: picomatch$3(config.server.fs.deny, { matchBase: true }),
63314
+ _fsDenyGlob: picomatch$4(config.server.fs.deny, { matchBase: true }),
63343
63315
  _shortcutsOptions: undefined,
63344
63316
  };
63345
63317
  server.transformIndexHtml = createDevHtmlTransformFn(server);
@@ -63386,8 +63358,8 @@ async function _createServer(inlineConfig = {}, options) {
63386
63358
  ws.on('vite:invalidate', async ({ path, message }) => {
63387
63359
  const mod = moduleGraph.urlToModuleMap.get(path);
63388
63360
  if (mod && mod.isSelfAccepting && mod.lastHMRTimestamp > 0) {
63389
- config.logger.info(picocolorsExports.yellow(`hmr invalidate `) +
63390
- picocolorsExports.dim(path) +
63361
+ config.logger.info(colors$1.yellow(`hmr invalidate `) +
63362
+ colors$1.dim(path) +
63391
63363
  (message ? ` ${message}` : ''), { timestamp: true });
63392
63364
  const file = getShortName(mod.file, config.root);
63393
63365
  updateModules(file, [...mod.importers], mod.lastHMRTimestamp, server, true);
@@ -63412,7 +63384,7 @@ async function _createServer(inlineConfig = {}, options) {
63412
63384
  // cors (enabled by default)
63413
63385
  const { cors } = serverConfig;
63414
63386
  if (cors !== false) {
63415
- middlewares.use(libExports$1(typeof cors === 'boolean' ? {} : cors));
63387
+ middlewares.use(corsMiddleware(typeof cors === 'boolean' ? {} : cors));
63416
63388
  }
63417
63389
  // proxy
63418
63390
  const { proxy } = serverConfig;
@@ -63424,7 +63396,7 @@ async function _createServer(inlineConfig = {}, options) {
63424
63396
  middlewares.use(baseMiddleware(server));
63425
63397
  }
63426
63398
  // open in editor support
63427
- middlewares.use('/__open-in-editor', launchEditorMiddleware());
63399
+ middlewares.use('/__open-in-editor', launchEditorMiddleware$1());
63428
63400
  // serve static files under /public
63429
63401
  // this applies before the transform middleware so that these files are served
63430
63402
  // as-is without transforms.
@@ -63482,6 +63454,8 @@ async function _createServer(inlineConfig = {}, options) {
63482
63454
  const listen = httpServer.listen.bind(httpServer);
63483
63455
  httpServer.listen = (async (port, ...args) => {
63484
63456
  try {
63457
+ // ensure ws server started
63458
+ ws.listen();
63485
63459
  await initServer();
63486
63460
  }
63487
63461
  catch (e) {
@@ -63576,7 +63550,7 @@ function resolveServerOptions(root, raw, logger) {
63576
63550
  };
63577
63551
  if (server.origin?.endsWith('/')) {
63578
63552
  server.origin = server.origin.slice(0, -1);
63579
- logger.warn(picocolorsExports.yellow(`${picocolorsExports.bold('(!)')} server.origin should not end with "/". Using "${server.origin}" instead.`));
63553
+ logger.warn(colors$1.yellow(`${colors$1.bold('(!)')} server.origin should not end with "/". Using "${server.origin}" instead.`));
63580
63554
  }
63581
63555
  return server;
63582
63556
  }
@@ -63792,7 +63766,7 @@ async function preview(inlineConfig = {}) {
63792
63766
  process.argv[2] === 'preview') {
63793
63767
  throw new Error(`The directory "${config.build.outDir}" does not exist. Did you build your project?`);
63794
63768
  }
63795
- const app = connect();
63769
+ const app = connect$1();
63796
63770
  const httpServer = await resolveHttpServer(config.preview, app, await resolveHttpsConfig(config.preview?.https));
63797
63771
  setClientErrorHandler(httpServer, config.logger);
63798
63772
  const options = config.preview;
@@ -63819,7 +63793,7 @@ async function preview(inlineConfig = {}) {
63819
63793
  // cors
63820
63794
  const { cors } = config.preview;
63821
63795
  if (cors !== false) {
63822
- app.use(libExports$1(typeof cors === 'boolean' ? {} : cors));
63796
+ app.use(corsMiddleware(typeof cors === 'boolean' ? {} : cors));
63823
63797
  }
63824
63798
  // proxy
63825
63799
  const { proxy } = config.preview;
@@ -63903,6 +63877,7 @@ function resolveSSROptions(ssr, preserveSymlinks, buildSsrCjsExternalHeuristics)
63903
63877
  }
63904
63878
 
63905
63879
  const debug = createDebugger('vite:config');
63880
+ const promisifiedRealpath = promisify$4(fs$l.realpath);
63906
63881
  /**
63907
63882
  * Type helper to make it easier to use vite.config.ts
63908
63883
  * accepts a direct {@link UserConfig} object, or a function that returns it.
@@ -64197,16 +64172,16 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development',
64197
64172
  ]);
64198
64173
  // validate config
64199
64174
  if (middlewareMode === 'ssr') {
64200
- logger.warn(picocolorsExports.yellow(`Setting server.middlewareMode to 'ssr' is deprecated, set server.middlewareMode to \`true\`${config.appType === 'custom' ? '' : ` and appType to 'custom'`} instead`));
64175
+ logger.warn(colors$1.yellow(`Setting server.middlewareMode to 'ssr' is deprecated, set server.middlewareMode to \`true\`${config.appType === 'custom' ? '' : ` and appType to 'custom'`} instead`));
64201
64176
  }
64202
64177
  if (middlewareMode === 'html') {
64203
- logger.warn(picocolorsExports.yellow(`Setting server.middlewareMode to 'html' is deprecated, set server.middlewareMode to \`true\` instead`));
64178
+ logger.warn(colors$1.yellow(`Setting server.middlewareMode to 'html' is deprecated, set server.middlewareMode to \`true\` instead`));
64204
64179
  }
64205
64180
  if (config.server?.force &&
64206
64181
  !isBuild &&
64207
64182
  config.optimizeDeps?.force === undefined) {
64208
64183
  resolved.optimizeDeps.force = true;
64209
- logger.warn(picocolorsExports.yellow(`server.force is deprecated, use optimizeDeps.force instead`));
64184
+ logger.warn(colors$1.yellow(`server.force is deprecated, use optimizeDeps.force instead`));
64210
64185
  }
64211
64186
  debug?.(`using resolved config: %O`, {
64212
64187
  ...resolved,
@@ -64217,7 +64192,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development',
64217
64192
  },
64218
64193
  });
64219
64194
  if (config.build?.terserOptions && config.build.minify !== 'terser') {
64220
- logger.warn(picocolorsExports.yellow(`build.terserOptions is specified but build.minify is not set to use Terser. ` +
64195
+ logger.warn(colors$1.yellow(`build.terserOptions is specified but build.minify is not set to use Terser. ` +
64221
64196
  `Note Vite now defaults to use esbuild for minification. If you still ` +
64222
64197
  `prefer Terser, set build.minify to "terser".`));
64223
64198
  }
@@ -64231,7 +64206,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development',
64231
64206
  const firstAssetFileNames = assetFileNamesList[0];
64232
64207
  const hasDifferentReference = assetFileNamesList.some((assetFileNames) => assetFileNames !== firstAssetFileNames);
64233
64208
  if (hasDifferentReference) {
64234
- resolved.logger.warn(picocolorsExports.yellow(`
64209
+ resolved.logger.warn(colors$1.yellow(`
64235
64210
  assetFileNames isn't equal for every build.rollupOptions.output. A single pattern across all outputs is supported by Vite.
64236
64211
  `));
64237
64212
  }
@@ -64245,7 +64220,7 @@ assetFileNames isn't equal for every build.rollupOptions.output. A single patter
64245
64220
  */
64246
64221
  function resolveBaseUrl(base = '/', isBuild, logger) {
64247
64222
  if (base[0] === '.') {
64248
- logger.warn(picocolorsExports.yellow(picocolorsExports.bold(`(!) invalid "base" option: ${base}. The value can only be an absolute ` +
64223
+ logger.warn(colors$1.yellow(colors$1.bold(`(!) invalid "base" option: ${base}. The value can only be an absolute ` +
64249
64224
  `URL, ./, or an empty string.`)));
64250
64225
  return '/';
64251
64226
  }
@@ -64253,7 +64228,7 @@ function resolveBaseUrl(base = '/', isBuild, logger) {
64253
64228
  const isExternal = isExternalUrl(base);
64254
64229
  // no leading slash warn
64255
64230
  if (!isExternal && base[0] !== '/') {
64256
- logger.warn(picocolorsExports.yellow(picocolorsExports.bold(`(!) "base" option should start with a slash.`)));
64231
+ logger.warn(colors$1.yellow(colors$1.bold(`(!) "base" option should start with a slash.`)));
64257
64232
  }
64258
64233
  // parse base when command is serve or base is not External URL
64259
64234
  if (!isBuild || !isExternal) {
@@ -64337,7 +64312,7 @@ async function loadConfigFromFile(configEnv, configFile, configRoot = process.cw
64337
64312
  };
64338
64313
  }
64339
64314
  catch (e) {
64340
- createLogger(logLevel).error(picocolorsExports.red(`failed to load config from ${resolvedPath}`), { error: e });
64315
+ createLogger(logLevel).error(colors$1.red(`failed to load config from ${resolvedPath}`), { error: e });
64341
64316
  throw e;
64342
64317
  }
64343
64318
  }
@@ -64449,7 +64424,11 @@ async function loadConfigFromBundledFile(fileName, bundledCode, isESM) {
64449
64424
  // for cjs, we can register a custom loader via `_require.extensions`
64450
64425
  else {
64451
64426
  const extension = path$o.extname(fileName);
64452
- const realFileName = await fsp.realpath(fileName);
64427
+ // We don't use fsp.realpath() here because it has the same behaviour as
64428
+ // fs.realpath.native. On some Windows systems, it returns uppercase volume
64429
+ // letters (e.g. "C:\") while the Node.js loader uses lowercase volume letters.
64430
+ // See https://github.com/vitejs/vite/issues/12923
64431
+ const realFileName = await promisifiedRealpath(fileName);
64453
64432
  const loaderExt = extension in _require.extensions ? extension : '.js';
64454
64433
  const defaultLoader = _require.extensions[loaderExt];
64455
64434
  _require.extensions[loaderExt] = (module, filename) => {
@@ -64492,4 +64471,4 @@ function isDepsOptimizerEnabled(config, ssr) {
64492
64471
  (command === 'serve' && disabled === 'dev'));
64493
64472
  }
64494
64473
 
64495
- export { loadEnv as A, resolveEnvPrefix as B, picocolorsExports as C, bindShortcuts as D, commonjsGlobal as E, index$1 as F, build$1 as G, index as H, preview$1 as I, preprocessCSS as a, build as b, createServer as c, resolvePackageData as d, buildErrorMessage as e, formatPostcssSourceMap as f, defineConfig as g, resolveConfig as h, isInNodeModules as i, resolveBaseUrl as j, getDepOptimizationConfig as k, loadConfigFromFile as l, isDepsOptimizerEnabled as m, normalizePath$3 as n, optimizeDeps as o, preview as p, mergeConfig as q, resolvePackageEntry as r, sortUserPlugins as s, transformWithEsbuild as t, mergeAlias as u, createFilter as v, send$2 as w, createLogger as x, searchForWorkspaceRoot as y, isFileServingAllowed as z };
64474
+ export { loadEnv as A, resolveEnvPrefix as B, colors$1 as C, bindShortcuts as D, getDefaultExportFromCjs as E, commonjsGlobal as F, index$1 as G, build$1 as H, index as I, preview$1 as J, preprocessCSS as a, build as b, createServer as c, resolvePackageData as d, buildErrorMessage as e, formatPostcssSourceMap as f, defineConfig as g, resolveConfig as h, isInNodeModules as i, resolveBaseUrl as j, getDepOptimizationConfig as k, loadConfigFromFile as l, isDepsOptimizerEnabled as m, normalizePath$3 as n, optimizeDeps as o, preview as p, mergeConfig as q, resolvePackageEntry as r, sortUserPlugins as s, transformWithEsbuild as t, mergeAlias as u, createFilter as v, send$2 as w, createLogger as x, searchForWorkspaceRoot as y, isFileServingAllowed as z };