diff --git a/actions/plan/dist/index.js b/actions/plan/dist/index.js index bf19d994..80ef5541 100644 --- a/actions/plan/dist/index.js +++ b/actions/plan/dist/index.js @@ -1,21 +1,21 @@ /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ -/***/ 3471: +/***/ 63471: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = require(__nccwpck_require__.ab + "nx.linux-x64-gnu.node") /***/ }), -/***/ 4901: +/***/ 74901: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = require(__nccwpck_require__.ab + "swc.linux-x64-gnu.node") /***/ }), -/***/ 7351: +/***/ 87351: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -41,7 +41,7 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.issue = exports.issueCommand = void 0; -const os = __importStar(__nccwpck_require__(2037)); +const os = __importStar(__nccwpck_require__(22037)); const utils_1 = __nccwpck_require__(5278); /** * Commands @@ -114,7 +114,7 @@ function escapeProperty(s) { /***/ }), -/***/ 2186: +/***/ 42186: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -149,12 +149,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; -const command_1 = __nccwpck_require__(7351); +const command_1 = __nccwpck_require__(87351); const file_command_1 = __nccwpck_require__(717); const utils_1 = __nccwpck_require__(5278); -const os = __importStar(__nccwpck_require__(2037)); -const path = __importStar(__nccwpck_require__(1017)); -const oidc_utils_1 = __nccwpck_require__(8041); +const os = __importStar(__nccwpck_require__(22037)); +const path = __importStar(__nccwpck_require__(71017)); +const oidc_utils_1 = __nccwpck_require__(98041); /** * The code to exit an action */ @@ -439,12 +439,12 @@ exports.getIDToken = getIDToken; /** * Summary exports */ -var summary_1 = __nccwpck_require__(1327); +var summary_1 = __nccwpck_require__(81327); Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } })); /** * @deprecated use core.summary */ -var summary_2 = __nccwpck_require__(1327); +var summary_2 = __nccwpck_require__(81327); Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } })); /** * Path exports @@ -486,9 +486,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ -const fs = __importStar(__nccwpck_require__(7147)); -const os = __importStar(__nccwpck_require__(2037)); -const uuid_1 = __nccwpck_require__(5840); +const fs = __importStar(__nccwpck_require__(57147)); +const os = __importStar(__nccwpck_require__(22037)); +const uuid_1 = __nccwpck_require__(75840); const utils_1 = __nccwpck_require__(5278); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; @@ -522,7 +522,7 @@ exports.prepareKeyValueMessage = prepareKeyValueMessage; /***/ }), -/***/ 8041: +/***/ 98041: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -538,9 +538,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.OidcClient = void 0; -const http_client_1 = __nccwpck_require__(6255); -const auth_1 = __nccwpck_require__(5526); -const core_1 = __nccwpck_require__(2186); +const http_client_1 = __nccwpck_require__(96255); +const auth_1 = __nccwpck_require__(35526); +const core_1 = __nccwpck_require__(42186); class OidcClient { static createHttpClient(allowRetry = true, maxRetry = 10) { const requestOptions = { @@ -632,7 +632,7 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0; -const path = __importStar(__nccwpck_require__(1017)); +const path = __importStar(__nccwpck_require__(71017)); /** * toPosixPath converts the given path to the posix form. On Windows, \\ will be * replaced with /. @@ -671,7 +671,7 @@ exports.toPlatformPath = toPlatformPath; /***/ }), -/***/ 1327: +/***/ 81327: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -687,8 +687,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0; -const os_1 = __nccwpck_require__(2037); -const fs_1 = __nccwpck_require__(7147); +const os_1 = __nccwpck_require__(22037); +const fs_1 = __nccwpck_require__(57147); const { access, appendFile, writeFile } = fs_1.promises; exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY'; exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary'; @@ -1008,7 +1008,7 @@ exports.toCommandProperties = toCommandProperties; /***/ }), -/***/ 5526: +/***/ 35526: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -1096,7 +1096,7 @@ exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHand /***/ }), -/***/ 6255: +/***/ 96255: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1132,10 +1132,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; -const http = __importStar(__nccwpck_require__(3685)); -const https = __importStar(__nccwpck_require__(5687)); -const pm = __importStar(__nccwpck_require__(9835)); -const tunnel = __importStar(__nccwpck_require__(4294)); +const http = __importStar(__nccwpck_require__(13685)); +const https = __importStar(__nccwpck_require__(95687)); +const pm = __importStar(__nccwpck_require__(19835)); +const tunnel = __importStar(__nccwpck_require__(74294)); var HttpCodes; (function (HttpCodes) { HttpCodes[HttpCodes["OK"] = 200] = "OK"; @@ -1708,7 +1708,7 @@ const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCa /***/ }), -/***/ 9835: +/***/ 19835: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -1791,11 +1791,11 @@ function isLoopbackAddress(host) { /***/ }), -/***/ 598: +/***/ 10598: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { (function (global, factory) { - true ? factory(exports, __nccwpck_require__(7225), __nccwpck_require__(6898)) : + true ? factory(exports, __nccwpck_require__(87225), __nccwpck_require__(46898)) : 0; })(this, (function (exports, sourcemapCodec, resolveUri) { 'use strict'; @@ -2325,18 +2325,18 @@ function isLoopbackAddress(host) { /***/ }), -/***/ 9964: +/***/ 99964: /***/ ((module, exports, __nccwpck_require__) => { /* module decorator */ module = __nccwpck_require__.nmd(module); -const { TraceMap, originalPositionFor, AnyMap } = __nccwpck_require__(598); -var path = __nccwpck_require__(1017); -const { fileURLToPath, pathToFileURL } = __nccwpck_require__(7310); -var util = __nccwpck_require__(3837); +const { TraceMap, originalPositionFor, AnyMap } = __nccwpck_require__(10598); +var path = __nccwpck_require__(71017); +const { fileURLToPath, pathToFileURL } = __nccwpck_require__(57310); +var util = __nccwpck_require__(73837); var fs; try { - fs = __nccwpck_require__(7147); + fs = __nccwpck_require__(57147); if (!fs.existsSync || !fs.readFileSync) { // fs doesn't have all methods we need fs = null; @@ -3271,7 +3271,7 @@ exports.resetRetrieveHandlers = function() { /***/ }), -/***/ 6898: +/***/ 46898: /***/ (function(module) { (function (global, factory) { @@ -3527,7 +3527,7 @@ exports.resetRetrieveHandlers = function() { /***/ }), -/***/ 7225: +/***/ 87225: /***/ (function(__unused_webpack_module, exports) { (function (global, factory) { @@ -3715,7 +3715,7 @@ exports.resetRetrieveHandlers = function() { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.transform = exports.transformJest = exports.transformSync = void 0; -const core_1 = __nccwpck_require__(874); +const core_1 = __nccwpck_require__(30874); // Oldest LTS Node.js supported target const DEFAULT_ES_TARGET = 'es2018'; function transformOption(path, options, jest = false) { @@ -3789,7 +3789,7 @@ exports.transform = transform; /***/ }), -/***/ 9545: +/***/ 89545: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -3822,11 +3822,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.tsCompilerOptionsToSwcConfig = exports.readDefaultTsConfig = void 0; -const fs_1 = __nccwpck_require__(7147); -const path_1 = __nccwpck_require__(1017); -const colorette_1 = __nccwpck_require__(3278); -const debug_1 = __importDefault(__nccwpck_require__(8237)); -const ts = __importStar(__nccwpck_require__(7414)); +const fs_1 = __nccwpck_require__(57147); +const path_1 = __nccwpck_require__(71017); +const colorette_1 = __nccwpck_require__(53278); +const debug_1 = __importDefault(__nccwpck_require__(38237)); +const ts = __importStar(__nccwpck_require__(37414)); const debug = (0, debug_1.default)('@swc-node'); function readDefaultTsConfig(tsConfigPath) { var _a, _b; @@ -3849,6 +3849,10 @@ function readDefaultTsConfig(tsConfigPath) { debug(`Read config file from ${fullTsConfigPath}`); const { config } = ts.readConfigFile(fullTsConfigPath, ts.sys.readFile); const { options, errors, fileNames } = ts.parseJsonConfigFileContent(config, ts.sys, (0, path_1.dirname)(fullTsConfigPath)); + // if baseUrl not set, use dirname of tsconfig.json. align with ts https://www.typescriptlang.org/tsconfig#paths + if (options.paths && !options.baseUrl) { + options.baseUrl = (0, path_1.dirname)(fullTsConfigPath); + } if (!errors.length) { compilerOptions = options; compilerOptions.files = fileNames; @@ -3920,7 +3924,7 @@ function getUseDefineForClassFields(compilerOptions, target) { return (_a = compilerOptions.useDefineForClassFields) !== null && _a !== void 0 ? _a : target >= ts.ScriptTarget.ES2022; } function tsCompilerOptionsToSwcConfig(options, filename) { - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l; const isJsx = filename.endsWith('.tsx') || filename.endsWith('.jsx') || Boolean(options.jsx); const target = (_a = options.target) !== null && _a !== void 0 ? _a : ts.ScriptTarget.ES2018; return { @@ -3944,8 +3948,8 @@ function tsCompilerOptionsToSwcConfig(options, filename) { useBuiltins: true, } : undefined, - baseUrl: (0, path_1.resolve)((_l = options.baseUrl) !== null && _l !== void 0 ? _l : './'), - paths: Object.fromEntries(Object.entries((_m = options.paths) !== null && _m !== void 0 ? _m : {}).map(([aliasKey, aliasPaths]) => { + baseUrl: options.baseUrl ? (0, path_1.resolve)(options.baseUrl) : undefined, + paths: Object.fromEntries(Object.entries((_l = options.paths) !== null && _l !== void 0 ? _l : {}).map(([aliasKey, aliasPaths]) => { var _a; return [ aliasKey, @@ -3964,7 +3968,7 @@ exports.tsCompilerOptionsToSwcConfig = tsCompilerOptionsToSwcConfig; /***/ }), -/***/ 8495: +/***/ 78495: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -3993,16 +3997,26 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.register = exports.compile = void 0; -const os_1 = __nccwpck_require__(2037); -const path_1 = __nccwpck_require__(1017); +exports.register = exports.compile = exports.AVAILABLE_EXTENSION_PATTERN = exports.AVAILABLE_TS_EXTENSION_PATTERN = void 0; const core_1 = __nccwpck_require__(5323); -const sourcemap_support_1 = __nccwpck_require__(5568); -const pirates_1 = __nccwpck_require__(4191); -const ts = __importStar(__nccwpck_require__(7414)); -const read_default_tsconfig_1 = __nccwpck_require__(9545); -const DEFAULT_EXTENSIONS = ['.js', '.jsx', '.es6', '.es', '.mjs', '.ts', '.tsx']; -const PLATFORM = (0, os_1.platform)(); +const sourcemap_support_1 = __nccwpck_require__(65568); +const pirates_1 = __nccwpck_require__(94191); +const ts = __importStar(__nccwpck_require__(37414)); +const read_default_tsconfig_1 = __nccwpck_require__(89545); +const DEFAULT_EXTENSIONS = [ + ts.Extension.Js, + ts.Extension.Ts, + ts.Extension.Jsx, + ts.Extension.Tsx, + ts.Extension.Mjs, + ts.Extension.Mts, + ts.Extension.Cjs, + ts.Extension.Cts, + '.es6', + '.es', +]; +exports.AVAILABLE_TS_EXTENSION_PATTERN = new RegExp(`(? ext.replace(/^\./, '\\.')).join('|')}))$`, 'i'); +exports.AVAILABLE_EXTENSION_PATTERN = new RegExp(`(? ext.replace(/^\./, '\\.')).join('|')}))$`, 'i'); const injectInlineSourceMap = ({ filename, code, map, }) => { if (map) { sourcemap_support_1.SourcemapMap.set(filename, map); @@ -4013,17 +4027,9 @@ const injectInlineSourceMap = ({ filename, code, map, }) => { return code; }; function compile(sourcecode, filename, options, async = false) { - if (filename.endsWith('.d.ts')) { - return ''; - } - if (options.files && options.files.length) { - if (PLATFORM === 'win32' && - options.files.every((file) => filename !== (0, path_1.resolve)(process.cwd(), file))) { - return sourcecode; - } - if (PLATFORM !== 'win32' && options.files.every((file) => !filename.endsWith(file))) { - return sourcecode; - } + if ((filename.includes('node_modules') && !exports.AVAILABLE_TS_EXTENSION_PATTERN.test(filename)) || + !exports.AVAILABLE_EXTENSION_PATTERN.test(filename)) { + return sourcecode; } if (options && typeof options.fallbackToTs === 'function' && options.fallbackToTs(filename)) { delete options.fallbackToTs; @@ -4072,7 +4078,7 @@ exports.register = register; /***/ }), -/***/ 5568: +/***/ 65568: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -4104,7 +4110,7 @@ exports.installSourceMapSupport = installSourceMapSupport; /***/ }), -/***/ 2334: +/***/ 62334: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -4112,7 +4118,7 @@ exports.installSourceMapSupport = installSourceMapSupport; // prettier-ignore /* eslint-disable */ /* auto-generated by NAPI-RS */ -const { readFileSync } = __nccwpck_require__(7147); +const { readFileSync } = __nccwpck_require__(57147); let nativeBinding = null; const loadErrors = []; const isMusl = () => { @@ -4154,7 +4160,7 @@ const isMuslFromReport = () => { }; const isMuslFromChildProcess = () => { try { - return (__nccwpck_require__(8493).execSync)('ldd --version', { encoding: 'utf8' }).includes('musl'); + return (__nccwpck_require__(32081).execSync)('ldd --version', { encoding: 'utf8' }).includes('musl'); } catch (e) { // If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false @@ -4165,13 +4171,13 @@ function requireNative() { if (process.platform === 'android') { if (process.arch === 'arm64') { try { - return __nccwpck_require__(7816); + return __nccwpck_require__(77816); } catch (e) { loadErrors.push(e); } try { - return __nccwpck_require__(2210); + return __nccwpck_require__(42210); } catch (e) { loadErrors.push(e); @@ -4179,13 +4185,13 @@ function requireNative() { } else if (process.arch === 'arm') { try { - return __nccwpck_require__(4560); + return __nccwpck_require__(64560); } catch (e) { loadErrors.push(e); } try { - return __nccwpck_require__(6276); + return __nccwpck_require__(76276); } catch (e) { loadErrors.push(e); @@ -4198,13 +4204,13 @@ function requireNative() { else if (process.platform === 'win32') { if (process.arch === 'x64') { try { - return __nccwpck_require__(3410); + return __nccwpck_require__(23410); } catch (e) { loadErrors.push(e); } try { - return __nccwpck_require__(5610); + return __nccwpck_require__(65610); } catch (e) { loadErrors.push(e); @@ -4212,13 +4218,13 @@ function requireNative() { } else if (process.arch === 'ia32') { try { - return __nccwpck_require__(2846); + return __nccwpck_require__(12846); } catch (e) { loadErrors.push(e); } try { - return __nccwpck_require__(9635); + return __nccwpck_require__(89635); } catch (e) { loadErrors.push(e); @@ -4226,13 +4232,13 @@ function requireNative() { } else if (process.arch === 'arm64') { try { - return __nccwpck_require__(3222); + return __nccwpck_require__(13222); } catch (e) { loadErrors.push(e); } try { - return __nccwpck_require__(9104); + return __nccwpck_require__(69104); } catch (e) { loadErrors.push(e); @@ -4244,26 +4250,26 @@ function requireNative() { } else if (process.platform === 'darwin') { try { - return __nccwpck_require__(8310); + return __nccwpck_require__(38310); } catch (e) { loadErrors.push(e); } try { - return __nccwpck_require__(3011); + return __nccwpck_require__(73011); } catch (e) { loadErrors.push(e); } if (process.arch === 'x64') { try { - return __nccwpck_require__(9243); + return __nccwpck_require__(59243); } catch (e) { loadErrors.push(e); } try { - return __nccwpck_require__(5794); + return __nccwpck_require__(95794); } catch (e) { loadErrors.push(e); @@ -4271,13 +4277,13 @@ function requireNative() { } else if (process.arch === 'arm64') { try { - return __nccwpck_require__(5918); + return __nccwpck_require__(35918); } catch (e) { loadErrors.push(e); } try { - return __nccwpck_require__(225); + return __nccwpck_require__(60225); } catch (e) { loadErrors.push(e); @@ -4290,13 +4296,13 @@ function requireNative() { else if (process.platform === 'freebsd') { if (process.arch === 'x64') { try { - return __nccwpck_require__(3003); + return __nccwpck_require__(43003); } catch (e) { loadErrors.push(e); } try { - return __nccwpck_require__(4546); + return __nccwpck_require__(44546); } catch (e) { loadErrors.push(e); @@ -4304,13 +4310,13 @@ function requireNative() { } else if (process.arch === 'arm64') { try { - return __nccwpck_require__(6350); + return __nccwpck_require__(56350); } catch (e) { loadErrors.push(e); } try { - return __nccwpck_require__(2514); + return __nccwpck_require__(72514); } catch (e) { loadErrors.push(e); @@ -4324,7 +4330,7 @@ function requireNative() { if (process.arch === 'x64') { if (isMusl()) { try { - return __nccwpck_require__(9698); + return __nccwpck_require__(79698); } catch (e) { loadErrors.push(e); @@ -4338,13 +4344,13 @@ function requireNative() { } else { try { - return __nccwpck_require__(5701); + return __nccwpck_require__(75701); } catch (e) { loadErrors.push(e); } try { - return __nccwpck_require__(4901); + return __nccwpck_require__(74901); } catch (e) { loadErrors.push(e); @@ -4354,7 +4360,7 @@ function requireNative() { else if (process.arch === 'arm64') { if (isMusl()) { try { - return __nccwpck_require__(5712); + return __nccwpck_require__(35712); } catch (e) { loadErrors.push(e); @@ -4368,13 +4374,13 @@ function requireNative() { } else { try { - return __nccwpck_require__(3068); + return __nccwpck_require__(83068); } catch (e) { loadErrors.push(e); } try { - return __nccwpck_require__(6336); + return __nccwpck_require__(66336); } catch (e) { loadErrors.push(e); @@ -4389,7 +4395,7 @@ function requireNative() { loadErrors.push(e); } try { - return __nccwpck_require__(5083); + return __nccwpck_require__(15083); } catch (e) { loadErrors.push(e); @@ -4398,13 +4404,13 @@ function requireNative() { else if (process.arch === 'riscv64') { if (isMusl()) { try { - return __nccwpck_require__(7917); + return __nccwpck_require__(37917); } catch (e) { loadErrors.push(e); } try { - return __nccwpck_require__(1978); + return __nccwpck_require__(11978); } catch (e) { loadErrors.push(e); @@ -4412,13 +4418,13 @@ function requireNative() { } else { try { - return __nccwpck_require__(2752); + return __nccwpck_require__(72752); } catch (e) { loadErrors.push(e); } try { - return __nccwpck_require__(2574); + return __nccwpck_require__(72574); } catch (e) { loadErrors.push(e); @@ -4427,13 +4433,13 @@ function requireNative() { } else if (process.arch === 's390x') { try { - return __nccwpck_require__(2097); + return __nccwpck_require__(52097); } catch (e) { loadErrors.push(e); } try { - return __nccwpck_require__(7035); + return __nccwpck_require__(47035); } catch (e) { loadErrors.push(e); @@ -4450,7 +4456,7 @@ function requireNative() { nativeBinding = requireNative(); if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) { try { - nativeBinding = __nccwpck_require__(2465); + nativeBinding = __nccwpck_require__(82465); } catch (err) { if (process.env.NAPI_RS_FORCE_WASI) { @@ -4459,7 +4465,7 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) { } if (!nativeBinding) { try { - nativeBinding = __nccwpck_require__(4068); + nativeBinding = __nccwpck_require__(74068); } catch (err) { if (process.env.NAPI_RS_FORCE_WASI) { @@ -4499,7 +4505,7 @@ module.exports.transformSync = nativeBinding.transformSync; /***/ }), -/***/ 874: +/***/ 30874: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -4552,10 +4558,10 @@ var __rest = (this && this.__rest) || function (s, e) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DEFAULT_EXTENSIONS = exports.getBinaryMetadata = exports.__experimental_registerGlobalTraceConfig = exports.minifySync = exports.minify = exports.bundle = exports.transformFileSync = exports.transformFile = exports.transformSync = exports.transform = exports.printSync = exports.print = exports.parseFileSync = exports.parseFile = exports.parseSync = exports.parse = exports.Compiler = exports.plugins = exports.version = void 0; -const path_1 = __nccwpck_require__(1017); -__exportStar(__nccwpck_require__(870), exports); -const spack_1 = __nccwpck_require__(20); -const assert = __importStar(__nccwpck_require__(9491)); +const path_1 = __nccwpck_require__(71017); +__exportStar(__nccwpck_require__(91803), exports); +const spack_1 = __nccwpck_require__(80020); +const assert = __importStar(__nccwpck_require__(39491)); // Allow overrides to the location of the .node binding file const bindingsOverride = process.env["SWC_BINARY_PATH"]; // `@swc/core` includes d.ts for the `@swc/wasm` to provide typed fallback bindings @@ -4564,7 +4570,7 @@ let fallbackBindings; const bindings = (() => { let binding; try { - binding = !!bindingsOverride ? require((0, path_1.resolve)(bindingsOverride)) : __nccwpck_require__(2334); + binding = !!bindingsOverride ? require((0, path_1.resolve)(bindingsOverride)) : __nccwpck_require__(62334); // If native binding loaded successfully, it should return proper target triple constant. const triple = binding.getTargetTriple(); assert.ok(triple, 'Failed to read target triple from native binary.'); @@ -4572,7 +4578,7 @@ const bindings = (() => { } catch (_) { // postinstall supposed to install `@swc/wasm` already - fallbackBindings = __nccwpck_require__(3469); + fallbackBindings = __nccwpck_require__(93469); } finally { return binding; @@ -4581,7 +4587,7 @@ const bindings = (() => { /** * Version of the swc binding. */ -exports.version = __nccwpck_require__(1841).version; +exports.version = __nccwpck_require__(21841).version; /** * @deprecated JavaScript API is deprecated. Please use Wasm plugin instead. */ @@ -4938,7 +4944,17 @@ function toBuffer(t) { /***/ }), -/***/ 20: +/***/ 91803: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 80020: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -4977,7 +4993,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.config = exports.compileBundleOptions = exports.isLocalFile = void 0; -const path = __importStar(__nccwpck_require__(1017)); +const path = __importStar(__nccwpck_require__(71017)); exports.isLocalFile = /^\.{0,2}\//; // starts with '/' './' '../' function compileBundleOptions(config) { return __awaiter(this, void 0, void 0, function* () { @@ -5031,7367 +5047,7075 @@ exports.config = config; /***/ }), -/***/ 870: -/***/ ((__unused_webpack_module, exports) => { +/***/ 70904: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // identity function for calling harmony imports with the correct context +/******/ __nested_webpack_require_187__.i = function(value) { return value; }; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 14); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports) { + +module.exports = __nccwpck_require__(71017); + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __nested_webpack_require_2716__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.__esModule = true; + +var _promise = __nested_webpack_require_2716__(173); + +var _promise2 = _interopRequireDefault(_promise); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function (fn) { + return function () { + var gen = fn.apply(this, arguments); + return new _promise2.default(function (resolve, reject) { + function step(key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + + if (info.done) { + resolve(value); + } else { + return _promise2.default.resolve(value).then(function (value) { + step("next", value); + }, function (err) { + step("throw", err); + }); + } + } + + return step("next"); + }); + }; +}; /***/ }), +/* 2 */ +/***/ (function(module, exports) { -/***/ 8390: -/***/ (function(__unused_webpack_module, exports) { +module.exports = __nccwpck_require__(73837); -(function (global, factory) { - true ? factory(exports) : - 0; -}(this, (function (exports) { 'use strict'; +/***/ }), +/* 3 */ +/***/ (function(module, exports) { - // AST walker module for Mozilla Parser API compatible trees +module.exports = __nccwpck_require__(57147); - // A simple walk is one where you simply specify callbacks to be - // called on specific nodes. The last two arguments are optional. A - // simple use would be - // - // walk.simple(myTree, { - // Expression: function(node) { ... } - // }); - // - // to do something with all expressions. All Parser API node types - // can be used to identify node types, as well as Expression and - // Statement, which denote categories of nodes. - // - // The base argument can be used to pass a custom (recursive) - // walker, and state can be used to give this walked an initial - // state. +/***/ }), +/* 4 */ +/***/ (function(module, exports, __nccwpck_require__) { - function simple(node, visitors, baseVisitor, state, override) { - if (!baseVisitor) { baseVisitor = base - ; }(function c(node, st, override) { - var type = override || node.type, found = visitors[type]; - baseVisitor[type](node, st, c); - if (found) { found(node, st); } - })(node, state, override); - } +"use strict"; - // An ancestor walk keeps an array of ancestor nodes (including the - // current node) and passes them to the callback as third parameter - // (and also as state parameter when no other state is present). - function ancestor(node, visitors, baseVisitor, state, override) { - var ancestors = []; - if (!baseVisitor) { baseVisitor = base - ; }(function c(node, st, override) { - var type = override || node.type, found = visitors[type]; - var isNew = node !== ancestors[ancestors.length - 1]; - if (isNew) { ancestors.push(node); } - baseVisitor[type](node, st, c); - if (found) { found(node, st || ancestors, ancestors); } - if (isNew) { ancestors.pop(); } - })(node, state, override); - } - // A recursive walk is one where your functions override the default - // walkers. They can modify and replace the state parameter that's - // threaded through the walk, and can opt how and whether to walk - // their child nodes (by calling their third argument on these - // nodes). - function recursive(node, state, funcs, baseVisitor, override) { - var visitor = funcs ? make(funcs, baseVisitor || undefined) : baseVisitor - ;(function c(node, st, override) { - visitor[override || node.type](node, st, c); - })(node, state, override); +Object.defineProperty(exports, "__esModule", { + value: true +}); +class MessageError extends Error { + constructor(msg, code) { + super(msg); + this.code = code; } - function makeTest(test) { - if (typeof test === "string") - { return function (type) { return type === test; } } - else if (!test) - { return function () { return true; } } - else - { return test } +} + +exports.MessageError = MessageError; +class ProcessSpawnError extends MessageError { + constructor(msg, code, process) { + super(msg, code); + this.process = process; } - var Found = function Found(node, state) { this.node = node; this.state = state; }; +} - // A full walk triggers the callback on each node - function full(node, callback, baseVisitor, state, override) { - if (!baseVisitor) { baseVisitor = base; } - var last - ;(function c(node, st, override) { - var type = override || node.type; - baseVisitor[type](node, st, c); - if (last !== node) { - callback(node, st, type); - last = node; - } - })(node, state, override); - } +exports.ProcessSpawnError = ProcessSpawnError; +class SecurityError extends MessageError {} - // An fullAncestor walk is like an ancestor walk, but triggers - // the callback on each node - function fullAncestor(node, callback, baseVisitor, state) { - if (!baseVisitor) { baseVisitor = base; } - var ancestors = [], last - ;(function c(node, st, override) { - var type = override || node.type; - var isNew = node !== ancestors[ancestors.length - 1]; - if (isNew) { ancestors.push(node); } - baseVisitor[type](node, st, c); - if (last !== node) { - callback(node, st || ancestors, ancestors, type); - last = node; - } - if (isNew) { ancestors.pop(); } - })(node, state); - } +exports.SecurityError = SecurityError; +class ProcessTermError extends MessageError {} - // Find a node with a given start, end, and type (all are optional, - // null can be used as wildcard). Returns a {node, state} object, or - // undefined when it doesn't find a matching node. - function findNodeAt(node, start, end, test, baseVisitor, state) { - if (!baseVisitor) { baseVisitor = base; } - test = makeTest(test); - try { - (function c(node, st, override) { - var type = override || node.type; - if ((start == null || node.start <= start) && - (end == null || node.end >= end)) - { baseVisitor[type](node, st, c); } - if ((start == null || node.start === start) && - (end == null || node.end === end) && - test(type, node)) - { throw new Found(node, st) } - })(node, state); - } catch (e) { - if (e instanceof Found) { return e } - throw e - } +exports.ProcessTermError = ProcessTermError; +class ResponseError extends Error { + constructor(msg, responseCode) { + super(msg); + this.responseCode = responseCode; } - // Find the innermost node of a given type that contains the given - // position. Interface similar to findNodeAt. - function findNodeAround(node, pos, test, baseVisitor, state) { - test = makeTest(test); - if (!baseVisitor) { baseVisitor = base; } - try { - (function c(node, st, override) { - var type = override || node.type; - if (node.start > pos || node.end < pos) { return } - baseVisitor[type](node, st, c); - if (test(type, node)) { throw new Found(node, st) } - })(node, state); - } catch (e) { - if (e instanceof Found) { return e } - throw e - } - } +} +exports.ResponseError = ResponseError; - // Find the outermost matching node after a given position. - function findNodeAfter(node, pos, test, baseVisitor, state) { - test = makeTest(test); - if (!baseVisitor) { baseVisitor = base; } - try { - (function c(node, st, override) { - if (node.end < pos) { return } - var type = override || node.type; - if (node.start >= pos && test(type, node)) { throw new Found(node, st) } - baseVisitor[type](node, st, c); - })(node, state); - } catch (e) { - if (e instanceof Found) { return e } - throw e - } - } +/***/ }), +/* 5 */ +/***/ (function(module, exports, __nested_webpack_require_4709__) { - // Find the outermost matching node before a given position. - function findNodeBefore(node, pos, test, baseVisitor, state) { - test = makeTest(test); - if (!baseVisitor) { baseVisitor = base; } - var max - ;(function c(node, st, override) { - if (node.start > pos) { return } - var type = override || node.type; - if (node.end <= pos && (!max || max.node.end < node.end) && test(type, node)) - { max = new Found(node, st); } - baseVisitor[type](node, st, c); - })(node, state); - return max - } +"use strict"; - // Used to create a custom walker. Will fill in all missing node - // type properties with the defaults. - function make(funcs, baseVisitor) { - var visitor = Object.create(baseVisitor || base); - for (var type in funcs) { visitor[type] = funcs[type]; } - return visitor - } - function skipThrough(node, st, c) { c(node, st); } - function ignore(_node, _st, _c) {} +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getFirstSuitableFolder = exports.readFirstAvailableStream = exports.makeTempDir = exports.hardlinksWork = exports.writeFilePreservingEol = exports.getFileSizeOnDisk = exports.walk = exports.symlink = exports.find = exports.readJsonAndFile = exports.readJson = exports.readFileAny = exports.hardlinkBulk = exports.copyBulk = exports.unlink = exports.glob = exports.link = exports.chmod = exports.lstat = exports.exists = exports.mkdirp = exports.stat = exports.access = exports.rename = exports.readdir = exports.realpath = exports.readlink = exports.writeFile = exports.open = exports.readFileBuffer = exports.lockQueue = exports.constants = undefined; - // Node walkers. +var _asyncToGenerator2; - var base = {}; +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__nested_webpack_require_4709__(1)); +} - base.Program = base.BlockStatement = base.StaticBlock = function (node, st, c) { - for (var i = 0, list = node.body; i < list.length; i += 1) - { - var stmt = list[i]; +let buildActionsForCopy = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) { - c(stmt, st, "Statement"); - } - }; - base.Statement = skipThrough; - base.EmptyStatement = ignore; - base.ExpressionStatement = base.ParenthesizedExpression = base.ChainExpression = - function (node, st, c) { return c(node.expression, st, "Expression"); }; - base.IfStatement = function (node, st, c) { - c(node.test, st, "Expression"); - c(node.consequent, st, "Statement"); - if (node.alternate) { c(node.alternate, st, "Statement"); } - }; - base.LabeledStatement = function (node, st, c) { return c(node.body, st, "Statement"); }; - base.BreakStatement = base.ContinueStatement = ignore; - base.WithStatement = function (node, st, c) { - c(node.object, st, "Expression"); - c(node.body, st, "Statement"); - }; - base.SwitchStatement = function (node, st, c) { - c(node.discriminant, st, "Expression"); - for (var i$1 = 0, list$1 = node.cases; i$1 < list$1.length; i$1 += 1) { - var cs = list$1[i$1]; + // + let build = (() => { + var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { + const src = data.src, + dest = data.dest, + type = data.type; + + const onFresh = data.onFresh || noop; + const onDone = data.onDone || noop; + + // TODO https://github.com/yarnpkg/yarn/issues/3751 + // related to bundled dependencies handling + if (files.has(dest.toLowerCase())) { + reporter.verbose(`The case-insensitive file ${dest} shouldn't be copied twice in one bulk copy`); + } else { + files.add(dest.toLowerCase()); + } - if (cs.test) { c(cs.test, st, "Expression"); } - for (var i = 0, list = cs.consequent; i < list.length; i += 1) - { - var cons = list[i]; + if (type === 'symlink') { + yield mkdirp((_path || _load_path()).default.dirname(dest)); + onFresh(); + actions.symlink.push({ + dest, + linkname: src + }); + onDone(); + return; + } - c(cons, st, "Statement"); + if (events.ignoreBasenames.indexOf((_path || _load_path()).default.basename(src)) >= 0) { + // ignored file + return; + } + + const srcStat = yield lstat(src); + let srcFiles; + + if (srcStat.isDirectory()) { + srcFiles = yield readdir(src); + } + + let destStat; + try { + // try accessing the destination + destStat = yield lstat(dest); + } catch (e) { + // proceed if destination doesn't exist, otherwise error + if (e.code !== 'ENOENT') { + throw e; + } + } + + // if destination exists + if (destStat) { + const bothSymlinks = srcStat.isSymbolicLink() && destStat.isSymbolicLink(); + const bothFolders = srcStat.isDirectory() && destStat.isDirectory(); + const bothFiles = srcStat.isFile() && destStat.isFile(); + + // EINVAL access errors sometimes happen which shouldn't because node shouldn't be giving + // us modes that aren't valid. investigate this, it's generally safe to proceed. + + /* if (srcStat.mode !== destStat.mode) { + try { + await access(dest, srcStat.mode); + } catch (err) {} + } */ + + if (bothFiles && artifactFiles.has(dest)) { + // this file gets changed during build, likely by a custom install script. Don't bother checking it. + onDone(); + reporter.verbose(reporter.lang('verboseFileSkipArtifact', src)); + return; + } + + if (bothFiles && srcStat.size === destStat.size && (0, (_fsNormalized || _load_fsNormalized()).fileDatesEqual)(srcStat.mtime, destStat.mtime)) { + // we can safely assume this is the same file + onDone(); + reporter.verbose(reporter.lang('verboseFileSkip', src, dest, srcStat.size, +srcStat.mtime)); + return; + } + + if (bothSymlinks) { + const srcReallink = yield readlink(src); + if (srcReallink === (yield readlink(dest))) { + // if both symlinks are the same then we can continue on + onDone(); + reporter.verbose(reporter.lang('verboseFileSkipSymlink', src, dest, srcReallink)); + return; + } + } + + if (bothFolders) { + // mark files that aren't in this folder as possibly extraneous + const destFiles = yield readdir(dest); + invariant(srcFiles, 'src files not initialised'); + + for (var _iterator4 = destFiles, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref6; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref6 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref6 = _i4.value; + } + + const file = _ref6; + + if (srcFiles.indexOf(file) < 0) { + const loc = (_path || _load_path()).default.join(dest, file); + possibleExtraneous.add(loc); + + if ((yield lstat(loc)).isDirectory()) { + for (var _iterator5 = yield readdir(loc), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { + var _ref7; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref7 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref7 = _i5.value; + } + + const file = _ref7; + + possibleExtraneous.add((_path || _load_path()).default.join(loc, file)); + } + } + } + } + } + } + + if (destStat && destStat.isSymbolicLink()) { + yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dest); + destStat = null; + } + + if (srcStat.isSymbolicLink()) { + onFresh(); + const linkname = yield readlink(src); + actions.symlink.push({ + dest, + linkname + }); + onDone(); + } else if (srcStat.isDirectory()) { + if (!destStat) { + reporter.verbose(reporter.lang('verboseFileFolder', dest)); + yield mkdirp(dest); + } + + const destParts = dest.split((_path || _load_path()).default.sep); + while (destParts.length) { + files.add(destParts.join((_path || _load_path()).default.sep).toLowerCase()); + destParts.pop(); + } + + // push all files to queue + invariant(srcFiles, 'src files not initialised'); + let remaining = srcFiles.length; + if (!remaining) { + onDone(); + } + for (var _iterator6 = srcFiles, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { + var _ref8; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref8 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref8 = _i6.value; + } + + const file = _ref8; + + queue.push({ + dest: (_path || _load_path()).default.join(dest, file), + onFresh, + onDone: function (_onDone) { + function onDone() { + return _onDone.apply(this, arguments); + } + + onDone.toString = function () { + return _onDone.toString(); + }; + + return onDone; + }(function () { + if (--remaining === 0) { + onDone(); + } + }), + src: (_path || _load_path()).default.join(src, file) + }); + } + } else if (srcStat.isFile()) { + onFresh(); + actions.file.push({ + src, + dest, + atime: srcStat.atime, + mtime: srcStat.mtime, + mode: srcStat.mode + }); + onDone(); + } else { + throw new Error(`unsure how to copy this: ${src}`); + } + }); + + return function build(_x5) { + return _ref5.apply(this, arguments); + }; + })(); + + const artifactFiles = new Set(events.artifactFiles || []); + const files = new Set(); + + // initialise events + for (var _iterator = queue, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref2; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; } - } - }; - base.SwitchCase = function (node, st, c) { - if (node.test) { c(node.test, st, "Expression"); } - for (var i = 0, list = node.consequent; i < list.length; i += 1) - { - var cons = list[i]; - c(cons, st, "Statement"); + const item = _ref2; + + const onDone = item.onDone; + item.onDone = function () { + events.onProgress(item.dest); + if (onDone) { + onDone(); + } + }; } - }; - base.ReturnStatement = base.YieldExpression = base.AwaitExpression = function (node, st, c) { - if (node.argument) { c(node.argument, st, "Expression"); } - }; - base.ThrowStatement = base.SpreadElement = - function (node, st, c) { return c(node.argument, st, "Expression"); }; - base.TryStatement = function (node, st, c) { - c(node.block, st, "Statement"); - if (node.handler) { c(node.handler, st); } - if (node.finalizer) { c(node.finalizer, st, "Statement"); } - }; - base.CatchClause = function (node, st, c) { - if (node.param) { c(node.param, st, "Pattern"); } - c(node.body, st, "Statement"); - }; - base.WhileStatement = base.DoWhileStatement = function (node, st, c) { - c(node.test, st, "Expression"); - c(node.body, st, "Statement"); - }; - base.ForStatement = function (node, st, c) { - if (node.init) { c(node.init, st, "ForInit"); } - if (node.test) { c(node.test, st, "Expression"); } - if (node.update) { c(node.update, st, "Expression"); } - c(node.body, st, "Statement"); - }; - base.ForInStatement = base.ForOfStatement = function (node, st, c) { - c(node.left, st, "ForInit"); - c(node.right, st, "Expression"); - c(node.body, st, "Statement"); - }; - base.ForInit = function (node, st, c) { - if (node.type === "VariableDeclaration") { c(node, st); } - else { c(node, st, "Expression"); } - }; - base.DebuggerStatement = ignore; + events.onStart(queue.length); - base.FunctionDeclaration = function (node, st, c) { return c(node, st, "Function"); }; - base.VariableDeclaration = function (node, st, c) { - for (var i = 0, list = node.declarations; i < list.length; i += 1) - { - var decl = list[i]; + // start building actions + const actions = { + file: [], + symlink: [], + link: [] + }; - c(decl, st); + // custom concurrency logic as we're always executing stacks of CONCURRENT_QUEUE_ITEMS queue items + // at a time due to the requirement to push items onto the queue + while (queue.length) { + const items = queue.splice(0, CONCURRENT_QUEUE_ITEMS); + yield Promise.all(items.map(build)); } - }; - base.VariableDeclarator = function (node, st, c) { - c(node.id, st, "Pattern"); - if (node.init) { c(node.init, st, "Expression"); } - }; - base.Function = function (node, st, c) { - if (node.id) { c(node.id, st, "Pattern"); } - for (var i = 0, list = node.params; i < list.length; i += 1) - { - var param = list[i]; + // simulate the existence of some files to prevent considering them extraneous + for (var _iterator2 = artifactFiles, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref3; - c(param, st, "Pattern"); - } - c(node.body, st, node.expression ? "Expression" : "Statement"); - }; + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } - base.Pattern = function (node, st, c) { - if (node.type === "Identifier") - { c(node, st, "VariablePattern"); } - else if (node.type === "MemberExpression") - { c(node, st, "MemberPattern"); } - else - { c(node, st); } - }; - base.VariablePattern = ignore; - base.MemberPattern = skipThrough; - base.RestElement = function (node, st, c) { return c(node.argument, st, "Pattern"); }; - base.ArrayPattern = function (node, st, c) { - for (var i = 0, list = node.elements; i < list.length; i += 1) { - var elt = list[i]; + const file = _ref3; - if (elt) { c(elt, st, "Pattern"); } + if (possibleExtraneous.has(file)) { + reporter.verbose(reporter.lang('verboseFilePhantomExtraneous', file)); + possibleExtraneous.delete(file); + } } - }; - base.ObjectPattern = function (node, st, c) { - for (var i = 0, list = node.properties; i < list.length; i += 1) { - var prop = list[i]; - if (prop.type === "Property") { - if (prop.computed) { c(prop.key, st, "Expression"); } - c(prop.value, st, "Pattern"); - } else if (prop.type === "RestElement") { - c(prop.argument, st, "Pattern"); + for (var _iterator3 = possibleExtraneous, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref4; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref4 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref4 = _i3.value; } - } - }; - base.Expression = skipThrough; - base.ThisExpression = base.Super = base.MetaProperty = ignore; - base.ArrayExpression = function (node, st, c) { - for (var i = 0, list = node.elements; i < list.length; i += 1) { - var elt = list[i]; + const loc = _ref4; - if (elt) { c(elt, st, "Expression"); } + if (files.has(loc.toLowerCase())) { + possibleExtraneous.delete(loc); + } } - }; - base.ObjectExpression = function (node, st, c) { - for (var i = 0, list = node.properties; i < list.length; i += 1) - { - var prop = list[i]; - c(prop, st); - } - }; - base.FunctionExpression = base.ArrowFunctionExpression = base.FunctionDeclaration; - base.SequenceExpression = function (node, st, c) { - for (var i = 0, list = node.expressions; i < list.length; i += 1) - { - var expr = list[i]; + return actions; + }); - c(expr, st, "Expression"); - } + return function buildActionsForCopy(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); }; - base.TemplateLiteral = function (node, st, c) { - for (var i = 0, list = node.quasis; i < list.length; i += 1) - { - var quasi = list[i]; +})(); - c(quasi, st); - } +let buildActionsForHardlink = (() => { + var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) { - for (var i$1 = 0, list$1 = node.expressions; i$1 < list$1.length; i$1 += 1) - { - var expr = list$1[i$1]; + // + let build = (() => { + var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { + const src = data.src, + dest = data.dest; + + const onFresh = data.onFresh || noop; + const onDone = data.onDone || noop; + if (files.has(dest.toLowerCase())) { + // Fixes issue https://github.com/yarnpkg/yarn/issues/2734 + // When bulk hardlinking we have A -> B structure that we want to hardlink to A1 -> B1, + // package-linker passes that modules A1 and B1 need to be hardlinked, + // the recursive linking algorithm of A1 ends up scheduling files in B1 to be linked twice which will case + // an exception. + onDone(); + return; + } + files.add(dest.toLowerCase()); - c(expr, st, "Expression"); - } - }; - base.TemplateElement = ignore; - base.UnaryExpression = base.UpdateExpression = function (node, st, c) { - c(node.argument, st, "Expression"); - }; - base.BinaryExpression = base.LogicalExpression = function (node, st, c) { - c(node.left, st, "Expression"); - c(node.right, st, "Expression"); - }; - base.AssignmentExpression = base.AssignmentPattern = function (node, st, c) { - c(node.left, st, "Pattern"); - c(node.right, st, "Expression"); - }; - base.ConditionalExpression = function (node, st, c) { - c(node.test, st, "Expression"); - c(node.consequent, st, "Expression"); - c(node.alternate, st, "Expression"); - }; - base.NewExpression = base.CallExpression = function (node, st, c) { - c(node.callee, st, "Expression"); - if (node.arguments) - { for (var i = 0, list = node.arguments; i < list.length; i += 1) - { - var arg = list[i]; + if (events.ignoreBasenames.indexOf((_path || _load_path()).default.basename(src)) >= 0) { + // ignored file + return; + } - c(arg, st, "Expression"); - } } - }; - base.MemberExpression = function (node, st, c) { - c(node.object, st, "Expression"); - if (node.computed) { c(node.property, st, "Expression"); } - }; - base.ExportNamedDeclaration = base.ExportDefaultDeclaration = function (node, st, c) { - if (node.declaration) - { c(node.declaration, st, node.type === "ExportNamedDeclaration" || node.declaration.id ? "Statement" : "Expression"); } - if (node.source) { c(node.source, st, "Expression"); } - }; - base.ExportAllDeclaration = function (node, st, c) { - if (node.exported) - { c(node.exported, st); } - c(node.source, st, "Expression"); - }; - base.ImportDeclaration = function (node, st, c) { - for (var i = 0, list = node.specifiers; i < list.length; i += 1) - { - var spec = list[i]; + const srcStat = yield lstat(src); + let srcFiles; - c(spec, st); - } - c(node.source, st, "Expression"); - }; - base.ImportExpression = function (node, st, c) { - c(node.source, st, "Expression"); - }; - base.ImportSpecifier = base.ImportDefaultSpecifier = base.ImportNamespaceSpecifier = base.Identifier = base.PrivateIdentifier = base.Literal = ignore; + if (srcStat.isDirectory()) { + srcFiles = yield readdir(src); + } - base.TaggedTemplateExpression = function (node, st, c) { - c(node.tag, st, "Expression"); - c(node.quasi, st, "Expression"); - }; - base.ClassDeclaration = base.ClassExpression = function (node, st, c) { return c(node, st, "Class"); }; - base.Class = function (node, st, c) { - if (node.id) { c(node.id, st, "Pattern"); } - if (node.superClass) { c(node.superClass, st, "Expression"); } - c(node.body, st); - }; - base.ClassBody = function (node, st, c) { - for (var i = 0, list = node.body; i < list.length; i += 1) - { - var elt = list[i]; + const destExists = yield exists(dest); + if (destExists) { + const destStat = yield lstat(dest); - c(elt, st); - } - }; - base.MethodDefinition = base.PropertyDefinition = base.Property = function (node, st, c) { - if (node.computed) { c(node.key, st, "Expression"); } - if (node.value) { c(node.value, st, "Expression"); } - }; + const bothSymlinks = srcStat.isSymbolicLink() && destStat.isSymbolicLink(); + const bothFolders = srcStat.isDirectory() && destStat.isDirectory(); + const bothFiles = srcStat.isFile() && destStat.isFile(); - exports.ancestor = ancestor; - exports.base = base; - exports.findNodeAfter = findNodeAfter; - exports.findNodeAround = findNodeAround; - exports.findNodeAt = findNodeAt; - exports.findNodeBefore = findNodeBefore; - exports.full = full; - exports.fullAncestor = fullAncestor; - exports.make = make; - exports.recursive = recursive; - exports.simple = simple; + if (srcStat.mode !== destStat.mode) { + try { + yield access(dest, srcStat.mode); + } catch (err) { + // EINVAL access errors sometimes happen which shouldn't because node shouldn't be giving + // us modes that aren't valid. investigate this, it's generally safe to proceed. + reporter.verbose(err); + } + } - Object.defineProperty(exports, '__esModule', { value: true }); + if (bothFiles && artifactFiles.has(dest)) { + // this file gets changed during build, likely by a custom install script. Don't bother checking it. + onDone(); + reporter.verbose(reporter.lang('verboseFileSkipArtifact', src)); + return; + } -}))); + // correct hardlink + if (bothFiles && srcStat.ino !== null && srcStat.ino === destStat.ino) { + onDone(); + reporter.verbose(reporter.lang('verboseFileSkip', src, dest, srcStat.ino)); + return; + } + if (bothSymlinks) { + const srcReallink = yield readlink(src); + if (srcReallink === (yield readlink(dest))) { + // if both symlinks are the same then we can continue on + onDone(); + reporter.verbose(reporter.lang('verboseFileSkipSymlink', src, dest, srcReallink)); + return; + } + } -/***/ }), + if (bothFolders) { + // mark files that aren't in this folder as possibly extraneous + const destFiles = yield readdir(dest); + invariant(srcFiles, 'src files not initialised'); -/***/ 390: -/***/ (function(__unused_webpack_module, exports) { + for (var _iterator10 = destFiles, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) { + var _ref14; -(function (global, factory) { - true ? factory(exports) : - 0; -})(this, (function (exports) { 'use strict'; + if (_isArray10) { + if (_i10 >= _iterator10.length) break; + _ref14 = _iterator10[_i10++]; + } else { + _i10 = _iterator10.next(); + if (_i10.done) break; + _ref14 = _i10.value; + } - // This file was generated. Do not modify manually! - 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]; + const file = _ref14; - // This file was generated. Do not modify manually! - var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938, 6, 4191]; + if (srcFiles.indexOf(file) < 0) { + const loc = (_path || _load_path()).default.join(dest, file); + possibleExtraneous.add(loc); - // This file was generated. Do not modify manually! - var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; + if ((yield lstat(loc)).isDirectory()) { + for (var _iterator11 = yield readdir(loc), _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : _iterator11[Symbol.iterator]();;) { + var _ref15; - // This file was generated. Do not modify manually! - var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; + if (_isArray11) { + if (_i11 >= _iterator11.length) break; + _ref15 = _iterator11[_i11++]; + } else { + _i11 = _iterator11.next(); + if (_i11.done) break; + _ref15 = _i11.value; + } - // These are a run-length and offset encoded representation of the - // >0xffff code points that are a valid part of identifiers. The - // offset starts at 0x10000, and each pair of numbers represents an - // offset to the next range, and then a size of the range. + const file = _ref15; - // Reserved word lists for various dialects of the language + possibleExtraneous.add((_path || _load_path()).default.join(loc, file)); + } + } + } + } + } + } - var reservedWords = { - 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile", - 5: "class enum extends super const export import", - 6: "enum", - strict: "implements interface let package private protected public static yield", - strictBind: "eval arguments" - }; + if (srcStat.isSymbolicLink()) { + onFresh(); + const linkname = yield readlink(src); + actions.symlink.push({ + dest, + linkname + }); + onDone(); + } else if (srcStat.isDirectory()) { + reporter.verbose(reporter.lang('verboseFileFolder', dest)); + yield mkdirp(dest); - // And the keywords + const destParts = dest.split((_path || _load_path()).default.sep); + while (destParts.length) { + files.add(destParts.join((_path || _load_path()).default.sep).toLowerCase()); + destParts.pop(); + } - var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"; + // push all files to queue + invariant(srcFiles, 'src files not initialised'); + let remaining = srcFiles.length; + if (!remaining) { + onDone(); + } + for (var _iterator12 = srcFiles, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : _iterator12[Symbol.iterator]();;) { + var _ref16; - var keywords$1 = { - 5: ecma5AndLessKeywords, - "5module": ecma5AndLessKeywords + " export import", - 6: ecma5AndLessKeywords + " const class extends export import super" - }; + if (_isArray12) { + if (_i12 >= _iterator12.length) break; + _ref16 = _iterator12[_i12++]; + } else { + _i12 = _iterator12.next(); + if (_i12.done) break; + _ref16 = _i12.value; + } - var keywordRelationalOperator = /^in(stanceof)?$/; + const file = _ref16; - // ## Character categories + queue.push({ + onFresh, + src: (_path || _load_path()).default.join(src, file), + dest: (_path || _load_path()).default.join(dest, file), + onDone: function (_onDone2) { + function onDone() { + return _onDone2.apply(this, arguments); + } - var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); - var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); + onDone.toString = function () { + return _onDone2.toString(); + }; - // This has a complexity linear to the value of the code. The - // assumption is that looking up astral identifier characters is - // rare. - function isInAstralSet(code, set) { - var pos = 0x10000; - for (var i = 0; i < set.length; i += 2) { - pos += set[i]; - if (pos > code) { return false } - pos += set[i + 1]; - if (pos >= code) { return true } + return onDone; + }(function () { + if (--remaining === 0) { + onDone(); + } + }) + }); + } + } else if (srcStat.isFile()) { + onFresh(); + actions.link.push({ + src, + dest, + removeDest: destExists + }); + onDone(); + } else { + throw new Error(`unsure how to copy this: ${src}`); + } + }); + + return function build(_x10) { + return _ref13.apply(this, arguments); + }; + })(); + + const artifactFiles = new Set(events.artifactFiles || []); + const files = new Set(); + + // initialise events + for (var _iterator7 = queue, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) { + var _ref10; + + if (_isArray7) { + if (_i7 >= _iterator7.length) break; + _ref10 = _iterator7[_i7++]; + } else { + _i7 = _iterator7.next(); + if (_i7.done) break; + _ref10 = _i7.value; + } + + const item = _ref10; + + const onDone = item.onDone || noop; + item.onDone = function () { + events.onProgress(item.dest); + onDone(); + }; } - return false - } + events.onStart(queue.length); - // Test whether a given character code starts an identifier. + // start building actions + const actions = { + file: [], + symlink: [], + link: [] + }; - function isIdentifierStart(code, astral) { - if (code < 65) { return code === 36 } - if (code < 91) { return true } - if (code < 97) { return code === 95 } - if (code < 123) { return true } - if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) } - if (astral === false) { return false } - return isInAstralSet(code, astralIdentifierStartCodes) - } + // custom concurrency logic as we're always executing stacks of CONCURRENT_QUEUE_ITEMS queue items + // at a time due to the requirement to push items onto the queue + while (queue.length) { + const items = queue.splice(0, CONCURRENT_QUEUE_ITEMS); + yield Promise.all(items.map(build)); + } - // Test whether a given character is part of an identifier. + // simulate the existence of some files to prevent considering them extraneous + for (var _iterator8 = artifactFiles, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) { + var _ref11; - function isIdentifierChar(code, astral) { - if (code < 48) { return code === 36 } - if (code < 58) { return true } - if (code < 65) { return false } - if (code < 91) { return true } - if (code < 97) { return code === 95 } - if (code < 123) { return true } - if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) } - if (astral === false) { return false } - return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes) - } + if (_isArray8) { + if (_i8 >= _iterator8.length) break; + _ref11 = _iterator8[_i8++]; + } else { + _i8 = _iterator8.next(); + if (_i8.done) break; + _ref11 = _i8.value; + } - // ## Token types + const file = _ref11; - // The assignment of fine-grained, information-carrying type objects - // allows the tokenizer to store the information it has about a - // token in a way that is very cheap for the parser to look up. + if (possibleExtraneous.has(file)) { + reporter.verbose(reporter.lang('verboseFilePhantomExtraneous', file)); + possibleExtraneous.delete(file); + } + } - // All token type variables start with an underscore, to make them - // easy to recognize. + for (var _iterator9 = possibleExtraneous, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) { + var _ref12; - // The `beforeExpr` property is used to disambiguate between regular - // expressions and divisions. It is set on all token types that can - // be followed by an expression (thus, a slash after them would be a - // regular expression). - // - // The `startsExpr` property is used to check if the token ends a - // `yield` expression. It is set on all token types that either can - // directly start an expression (like a quotation mark) or can - // continue an expression (like the body of a string). - // - // `isLoop` marks a keyword as starting a loop, which is important - // to know when parsing a label, in order to allow or disallow - // continue jumps to that label. + if (_isArray9) { + if (_i9 >= _iterator9.length) break; + _ref12 = _iterator9[_i9++]; + } else { + _i9 = _iterator9.next(); + if (_i9.done) break; + _ref12 = _i9.value; + } - var TokenType = function TokenType(label, conf) { - if ( conf === void 0 ) conf = {}; + const loc = _ref12; - this.label = label; - this.keyword = conf.keyword; - this.beforeExpr = !!conf.beforeExpr; - this.startsExpr = !!conf.startsExpr; - this.isLoop = !!conf.isLoop; - this.isAssign = !!conf.isAssign; - this.prefix = !!conf.prefix; - this.postfix = !!conf.postfix; - this.binop = conf.binop || null; - this.updateContext = null; + if (files.has(loc.toLowerCase())) { + possibleExtraneous.delete(loc); + } + } + + return actions; + }); + + return function buildActionsForHardlink(_x6, _x7, _x8, _x9) { + return _ref9.apply(this, arguments); }; +})(); - function binop(name, prec) { - return new TokenType(name, {beforeExpr: true, binop: prec}) - } - var beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true}; +let copyBulk = exports.copyBulk = (() => { + var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) { + const events = { + onStart: _events && _events.onStart || noop, + onProgress: _events && _events.onProgress || noop, + possibleExtraneous: _events ? _events.possibleExtraneous : new Set(), + ignoreBasenames: _events && _events.ignoreBasenames || [], + artifactFiles: _events && _events.artifactFiles || [] + }; - // Map keyword names to token types. + const actions = yield buildActionsForCopy(queue, events, events.possibleExtraneous, reporter); + events.onStart(actions.file.length + actions.symlink.length + actions.link.length); - var keywords = {}; + const fileActions = actions.file; - // Succinct definitions of keyword token types - function kw(name, options) { - if ( options === void 0 ) options = {}; + const currentlyWriting = new Map(); - options.keyword = name; - return keywords[name] = new TokenType(name, options) - } + yield (_promise || _load_promise()).queue(fileActions, (() => { + var _ref18 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { + let writePromise; + while (writePromise = currentlyWriting.get(data.dest)) { + yield writePromise; + } - var types$1 = { - num: new TokenType("num", startsExpr), - regexp: new TokenType("regexp", startsExpr), - string: new TokenType("string", startsExpr), - name: new TokenType("name", startsExpr), - privateId: new TokenType("privateId", startsExpr), - eof: new TokenType("eof"), + reporter.verbose(reporter.lang('verboseFileCopy', data.src, data.dest)); + const copier = (0, (_fsNormalized || _load_fsNormalized()).copyFile)(data, function () { + return currentlyWriting.delete(data.dest); + }); + currentlyWriting.set(data.dest, copier); + events.onProgress(data.dest); + return copier; + }); - // Punctuation token types. - bracketL: new TokenType("[", {beforeExpr: true, startsExpr: true}), - bracketR: new TokenType("]"), - braceL: new TokenType("{", {beforeExpr: true, startsExpr: true}), - braceR: new TokenType("}"), - parenL: new TokenType("(", {beforeExpr: true, startsExpr: true}), - parenR: new TokenType(")"), - comma: new TokenType(",", beforeExpr), - semi: new TokenType(";", beforeExpr), - colon: new TokenType(":", beforeExpr), - dot: new TokenType("."), - question: new TokenType("?", beforeExpr), - questionDot: new TokenType("?."), - arrow: new TokenType("=>", beforeExpr), - template: new TokenType("template"), - invalidTemplate: new TokenType("invalidTemplate"), - ellipsis: new TokenType("...", beforeExpr), - backQuote: new TokenType("`", startsExpr), - dollarBraceL: new TokenType("${", {beforeExpr: true, startsExpr: true}), + return function (_x14) { + return _ref18.apply(this, arguments); + }; + })(), CONCURRENT_QUEUE_ITEMS); + + // we need to copy symlinks last as they could reference files we were copying + const symlinkActions = actions.symlink; + yield (_promise || _load_promise()).queue(symlinkActions, function (data) { + const linkname = (_path || _load_path()).default.resolve((_path || _load_path()).default.dirname(data.dest), data.linkname); + reporter.verbose(reporter.lang('verboseFileSymlink', data.dest, linkname)); + return symlink(linkname, data.dest); + }); + }); - // Operators. These carry several kinds of properties to help the - // parser use them properly (the presence of these properties is - // what categorizes them as operators). - // - // `binop`, when present, specifies that this operator is a binary - // operator, and will refer to its precedence. - // - // `prefix` and `postfix` mark the operator as a prefix or postfix - // unary operator. - // - // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as - // binary operators with a very low precedence, that should result - // in AssignmentExpression nodes. + return function copyBulk(_x11, _x12, _x13) { + return _ref17.apply(this, arguments); + }; +})(); - eq: new TokenType("=", {beforeExpr: true, isAssign: true}), - assign: new TokenType("_=", {beforeExpr: true, isAssign: true}), - incDec: new TokenType("++/--", {prefix: true, postfix: true, startsExpr: true}), - prefix: new TokenType("!/~", {beforeExpr: true, prefix: true, startsExpr: true}), - logicalOR: binop("||", 1), - logicalAND: binop("&&", 2), - bitwiseOR: binop("|", 3), - bitwiseXOR: binop("^", 4), - bitwiseAND: binop("&", 5), - equality: binop("==/!=/===/!==", 6), - relational: binop("/<=/>=", 7), - bitShift: binop("<>/>>>", 8), - plusMin: new TokenType("+/-", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}), - modulo: binop("%", 10), - star: binop("*", 10), - slash: binop("/", 10), - starstar: new TokenType("**", {beforeExpr: true}), - coalesce: binop("??", 1), +let hardlinkBulk = exports.hardlinkBulk = (() => { + var _ref19 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) { + const events = { + onStart: _events && _events.onStart || noop, + onProgress: _events && _events.onProgress || noop, + possibleExtraneous: _events ? _events.possibleExtraneous : new Set(), + artifactFiles: _events && _events.artifactFiles || [], + ignoreBasenames: [] + }; - // Keyword token types. - _break: kw("break"), - _case: kw("case", beforeExpr), - _catch: kw("catch"), - _continue: kw("continue"), - _debugger: kw("debugger"), - _default: kw("default", beforeExpr), - _do: kw("do", {isLoop: true, beforeExpr: true}), - _else: kw("else", beforeExpr), - _finally: kw("finally"), - _for: kw("for", {isLoop: true}), - _function: kw("function", startsExpr), - _if: kw("if"), - _return: kw("return", beforeExpr), - _switch: kw("switch"), - _throw: kw("throw", beforeExpr), - _try: kw("try"), - _var: kw("var"), - _const: kw("const"), - _while: kw("while", {isLoop: true}), - _with: kw("with"), - _new: kw("new", {beforeExpr: true, startsExpr: true}), - _this: kw("this", startsExpr), - _super: kw("super", startsExpr), - _class: kw("class", startsExpr), - _extends: kw("extends", beforeExpr), - _export: kw("export"), - _import: kw("import", startsExpr), - _null: kw("null", startsExpr), - _true: kw("true", startsExpr), - _false: kw("false", startsExpr), - _in: kw("in", {beforeExpr: true, binop: 7}), - _instanceof: kw("instanceof", {beforeExpr: true, binop: 7}), - _typeof: kw("typeof", {beforeExpr: true, prefix: true, startsExpr: true}), - _void: kw("void", {beforeExpr: true, prefix: true, startsExpr: true}), - _delete: kw("delete", {beforeExpr: true, prefix: true, startsExpr: true}) + const actions = yield buildActionsForHardlink(queue, events, events.possibleExtraneous, reporter); + events.onStart(actions.file.length + actions.symlink.length + actions.link.length); + + const fileActions = actions.link; + + yield (_promise || _load_promise()).queue(fileActions, (() => { + var _ref20 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { + reporter.verbose(reporter.lang('verboseFileLink', data.src, data.dest)); + if (data.removeDest) { + yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(data.dest); + } + yield link(data.src, data.dest); + }); + + return function (_x18) { + return _ref20.apply(this, arguments); + }; + })(), CONCURRENT_QUEUE_ITEMS); + + // we need to copy symlinks last as they could reference files we were copying + const symlinkActions = actions.symlink; + yield (_promise || _load_promise()).queue(symlinkActions, function (data) { + const linkname = (_path || _load_path()).default.resolve((_path || _load_path()).default.dirname(data.dest), data.linkname); + reporter.verbose(reporter.lang('verboseFileSymlink', data.dest, linkname)); + return symlink(linkname, data.dest); + }); + }); + + return function hardlinkBulk(_x15, _x16, _x17) { + return _ref19.apply(this, arguments); }; +})(); - // Matches a whole line break (where CRLF is considered a single - // line break). Used to count lines. +let readFileAny = exports.readFileAny = (() => { + var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (files) { + for (var _iterator13 = files, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : _iterator13[Symbol.iterator]();;) { + var _ref22; - var lineBreak = /\r\n?|\n|\u2028|\u2029/; - var lineBreakG = new RegExp(lineBreak.source, "g"); + if (_isArray13) { + if (_i13 >= _iterator13.length) break; + _ref22 = _iterator13[_i13++]; + } else { + _i13 = _iterator13.next(); + if (_i13.done) break; + _ref22 = _i13.value; + } - function isNewLine(code) { - return code === 10 || code === 13 || code === 0x2028 || code === 0x2029 - } + const file = _ref22; - function nextLineBreak(code, from, end) { - if ( end === void 0 ) end = code.length; + if (yield exists(file)) { + return readFile(file); + } + } + return null; + }); - for (var i = from; i < end; i++) { - var next = code.charCodeAt(i); - if (isNewLine(next)) - { return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1 } + return function readFileAny(_x19) { + return _ref21.apply(this, arguments); + }; +})(); + +let readJson = exports.readJson = (() => { + var _ref23 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { + return (yield readJsonAndFile(loc)).object; + }); + + return function readJson(_x20) { + return _ref23.apply(this, arguments); + }; +})(); + +let readJsonAndFile = exports.readJsonAndFile = (() => { + var _ref24 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { + const file = yield readFile(loc); + try { + return { + object: (0, (_map || _load_map()).default)(JSON.parse(stripBOM(file))), + content: file + }; + } catch (err) { + err.message = `${loc}: ${err.message}`; + throw err; } - return -1 - } + }); - var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/; + return function readJsonAndFile(_x21) { + return _ref24.apply(this, arguments); + }; +})(); - var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; +let find = exports.find = (() => { + var _ref25 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (filename, dir) { + const parts = dir.split((_path || _load_path()).default.sep); - var ref = Object.prototype; - var hasOwnProperty = ref.hasOwnProperty; - var toString = ref.toString; + while (parts.length) { + const loc = parts.concat(filename).join((_path || _load_path()).default.sep); - var hasOwn = Object.hasOwn || (function (obj, propName) { return ( - hasOwnProperty.call(obj, propName) - ); }); + if (yield exists(loc)) { + return loc; + } else { + parts.pop(); + } + } - var isArray = Array.isArray || (function (obj) { return ( - toString.call(obj) === "[object Array]" - ); }); + return false; + }); - function wordsRegexp(words) { - return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$") - } + return function find(_x22, _x23) { + return _ref25.apply(this, arguments); + }; +})(); - function codePointToString(code) { - // UTF-16 Decoding - if (code <= 0xFFFF) { return String.fromCharCode(code) } - code -= 0x10000; - return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00) - } +let symlink = exports.symlink = (() => { + var _ref26 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (src, dest) { + try { + const stats = yield lstat(dest); + if (stats.isSymbolicLink()) { + const resolved = yield realpath(dest); + if (resolved === src) { + return; + } + } + } catch (err) { + if (err.code !== 'ENOENT') { + throw err; + } + } + // We use rimraf for unlink which never throws an ENOENT on missing target + yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dest); - var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/; + if (process.platform === 'win32') { + // use directory junctions if possible on win32, this requires absolute paths + yield fsSymlink(src, dest, 'junction'); + } else { + // use relative paths otherwise which will be retained if the directory is moved + let relative; + try { + relative = (_path || _load_path()).default.relative((_fs || _load_fs()).default.realpathSync((_path || _load_path()).default.dirname(dest)), (_fs || _load_fs()).default.realpathSync(src)); + } catch (err) { + if (err.code !== 'ENOENT') { + throw err; + } + relative = (_path || _load_path()).default.relative((_path || _load_path()).default.dirname(dest), src); + } + // When path.relative returns an empty string for the current directory, we should instead use + // '.', which is a valid fs.symlink target. + yield fsSymlink(relative || '.', dest); + } + }); - // These are used when `options.locations` is on, for the - // `startLoc` and `endLoc` properties. + return function symlink(_x24, _x25) { + return _ref26.apply(this, arguments); + }; +})(); - var Position = function Position(line, col) { - this.line = line; - this.column = col; +let walk = exports.walk = (() => { + var _ref27 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, relativeDir, ignoreBasenames = new Set()) { + let files = []; + + let filenames = yield readdir(dir); + if (ignoreBasenames.size) { + filenames = filenames.filter(function (name) { + return !ignoreBasenames.has(name); + }); + } + + for (var _iterator14 = filenames, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : _iterator14[Symbol.iterator]();;) { + var _ref28; + + if (_isArray14) { + if (_i14 >= _iterator14.length) break; + _ref28 = _iterator14[_i14++]; + } else { + _i14 = _iterator14.next(); + if (_i14.done) break; + _ref28 = _i14.value; + } + + const name = _ref28; + + const relative = relativeDir ? (_path || _load_path()).default.join(relativeDir, name) : name; + const loc = (_path || _load_path()).default.join(dir, name); + const stat = yield lstat(loc); + + files.push({ + relative, + basename: name, + absolute: loc, + mtime: +stat.mtime + }); + + if (stat.isDirectory()) { + files = files.concat((yield walk(loc, relative, ignoreBasenames))); + } + } + + return files; + }); + + return function walk(_x26, _x27) { + return _ref27.apply(this, arguments); }; +})(); - Position.prototype.offset = function offset (n) { - return new Position(this.line, this.column + n) +let getFileSizeOnDisk = exports.getFileSizeOnDisk = (() => { + var _ref29 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { + const stat = yield lstat(loc); + const size = stat.size, + blockSize = stat.blksize; + + + return Math.ceil(size / blockSize) * blockSize; + }); + + return function getFileSizeOnDisk(_x28) { + return _ref29.apply(this, arguments); }; +})(); - var SourceLocation = function SourceLocation(p, start, end) { - this.start = start; - this.end = end; - if (p.sourceFile !== null) { this.source = p.sourceFile; } +let getEolFromFile = (() => { + var _ref30 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path) { + if (!(yield exists(path))) { + return undefined; + } + + const buffer = yield readFileBuffer(path); + + for (let i = 0; i < buffer.length; ++i) { + if (buffer[i] === cr) { + return '\r\n'; + } + if (buffer[i] === lf) { + return '\n'; + } + } + return undefined; + }); + + return function getEolFromFile(_x29) { + return _ref30.apply(this, arguments); }; +})(); - // The `getLineInfo` function is mostly useful when the - // `locations` option is off (for performance reasons) and you - // want to find the line/column position for a given character - // offset. `input` should be the code string that the offset refers - // into. +let writeFilePreservingEol = exports.writeFilePreservingEol = (() => { + var _ref31 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path, data) { + const eol = (yield getEolFromFile(path)) || (_os || _load_os()).default.EOL; + if (eol !== '\n') { + data = data.replace(/\n/g, eol); + } + yield writeFile(path, data); + }); - function getLineInfo(input, offset) { - for (var line = 1, cur = 0;;) { - var nextBreak = nextLineBreak(input, cur, offset); - if (nextBreak < 0) { return new Position(line, offset - cur) } - ++line; - cur = nextBreak; + return function writeFilePreservingEol(_x30, _x31) { + return _ref31.apply(this, arguments); + }; +})(); + +let hardlinksWork = exports.hardlinksWork = (() => { + var _ref32 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir) { + const filename = 'test-file' + Math.random(); + const file = (_path || _load_path()).default.join(dir, filename); + const fileLink = (_path || _load_path()).default.join(dir, filename + '-link'); + try { + yield writeFile(file, 'test'); + yield link(file, fileLink); + } catch (err) { + return false; + } finally { + yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(file); + yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(fileLink); } - } + return true; + }); - // A second argument must be given to configure the parser process. - // These options are recognized (only `ecmaVersion` is required): + return function hardlinksWork(_x32) { + return _ref32.apply(this, arguments); + }; +})(); - var defaultOptions = { - // `ecmaVersion` indicates the ECMAScript version to parse. Must be - // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10 - // (2019), 11 (2020), 12 (2021), 13 (2022), 14 (2023), or `"latest"` - // (the latest version the library supports). This influences - // support for strict mode, the set of reserved words, and support - // for new syntax features. - ecmaVersion: null, - // `sourceType` indicates the mode the code should be parsed in. - // Can be either `"script"` or `"module"`. This influences global - // strict mode and parsing of `import` and `export` declarations. - sourceType: "script", - // `onInsertedSemicolon` can be a callback that will be called - // when a semicolon is automatically inserted. It will be passed - // the position of the comma as an offset, and if `locations` is - // enabled, it is given the location as a `{line, column}` object - // as second argument. - onInsertedSemicolon: null, - // `onTrailingComma` is similar to `onInsertedSemicolon`, but for - // trailing commas. - onTrailingComma: null, - // By default, reserved words are only enforced if ecmaVersion >= 5. - // Set `allowReserved` to a boolean value to explicitly turn this on - // an off. When this option has the value "never", reserved words - // and keywords can also not be used as property names. - allowReserved: null, - // When enabled, a return at the top level is not considered an - // error. - allowReturnOutsideFunction: false, - // When enabled, import/export statements are not constrained to - // appearing at the top of the program, and an import.meta expression - // in a script isn't considered an error. - allowImportExportEverywhere: false, - // By default, await identifiers are allowed to appear at the top-level scope only if ecmaVersion >= 2022. - // When enabled, await identifiers are allowed to appear at the top-level scope, - // but they are still not allowed in non-async functions. - allowAwaitOutsideFunction: null, - // When enabled, super identifiers are not constrained to - // appearing in methods and do not raise an error when they appear elsewhere. - allowSuperOutsideMethod: null, - // When enabled, hashbang directive in the beginning of file is - // allowed and treated as a line comment. Enabled by default when - // `ecmaVersion` >= 2023. - allowHashBang: false, - // When `locations` is on, `loc` properties holding objects with - // `start` and `end` properties in `{line, column}` form (with - // line being 1-based and column 0-based) will be attached to the - // nodes. - locations: false, - // A function can be passed as `onToken` option, which will - // cause Acorn to call that function with object in the same - // format as tokens returned from `tokenizer().getToken()`. Note - // that you are not allowed to call the parser from the - // callback—that will corrupt its internal state. - onToken: null, - // A function can be passed as `onComment` option, which will - // cause Acorn to call that function with `(block, text, start, - // end)` parameters whenever a comment is skipped. `block` is a - // boolean indicating whether this is a block (`/* */`) comment, - // `text` is the content of the comment, and `start` and `end` are - // character offsets that denote the start and end of the comment. - // When the `locations` option is on, two more parameters are - // passed, the full `{line, column}` locations of the start and - // end of the comments. Note that you are not allowed to call the - // parser from the callback—that will corrupt its internal state. - onComment: null, - // Nodes have their start and end characters offsets recorded in - // `start` and `end` properties (directly on the node, rather than - // the `loc` object, which holds line/column data. To also add a - // [semi-standardized][range] `range` property holding a `[start, - // end]` array with the same numbers, set the `ranges` option to - // `true`. - // - // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 - ranges: false, - // It is possible to parse multiple files into a single AST by - // passing the tree produced by parsing the first file as - // `program` option in subsequent parses. This will add the - // toplevel forms of the parsed file to the `Program` (top) node - // of an existing parse tree. - program: null, - // When `locations` is on, you can pass this to record the source - // file in every node's `loc` object. - sourceFile: null, - // This value, if given, is stored in every node, whether - // `locations` is on or off. - directSourceFile: null, - // When enabled, parenthesized expressions are represented by - // (non-standard) ParenthesizedExpression nodes - preserveParens: false - }; +// not a strict polyfill for Node's fs.mkdtemp - // Interpret and default an options object - var warnedAboutEcmaVersion = false; +let makeTempDir = exports.makeTempDir = (() => { + var _ref33 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (prefix) { + const dir = (_path || _load_path()).default.join((_os || _load_os()).default.tmpdir(), `yarn-${prefix || ''}-${Date.now()}-${Math.random()}`); + yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dir); + yield mkdirp(dir); + return dir; + }); - function getOptions(opts) { - var options = {}; + return function makeTempDir(_x33) { + return _ref33.apply(this, arguments); + }; +})(); - for (var opt in defaultOptions) - { options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt]; } +let readFirstAvailableStream = exports.readFirstAvailableStream = (() => { + var _ref34 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths) { + for (var _iterator15 = paths, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : _iterator15[Symbol.iterator]();;) { + var _ref35; - if (options.ecmaVersion === "latest") { - options.ecmaVersion = 1e8; - } else if (options.ecmaVersion == null) { - if (!warnedAboutEcmaVersion && typeof console === "object" && console.warn) { - warnedAboutEcmaVersion = true; - console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future."); + if (_isArray15) { + if (_i15 >= _iterator15.length) break; + _ref35 = _iterator15[_i15++]; + } else { + _i15 = _iterator15.next(); + if (_i15.done) break; + _ref35 = _i15.value; } - options.ecmaVersion = 11; - } else if (options.ecmaVersion >= 2015) { - options.ecmaVersion -= 2009; - } - - if (options.allowReserved == null) - { options.allowReserved = options.ecmaVersion < 5; } - if (!opts || opts.allowHashBang == null) - { options.allowHashBang = options.ecmaVersion >= 14; } + const path = _ref35; - if (isArray(options.onToken)) { - var tokens = options.onToken; - options.onToken = function (token) { return tokens.push(token); }; + try { + const fd = yield open(path, 'r'); + return (_fs || _load_fs()).default.createReadStream(path, { fd }); + } catch (err) { + // Try the next one + } } - if (isArray(options.onComment)) - { options.onComment = pushComment(options, options.onComment); } - - return options - } + return null; + }); - function pushComment(options, array) { - return function(block, text, start, end, startLoc, endLoc) { - var comment = { - type: block ? "Block" : "Line", - value: text, - start: start, - end: end - }; - if (options.locations) - { comment.loc = new SourceLocation(this, startLoc, endLoc); } - if (options.ranges) - { comment.range = [start, end]; } - array.push(comment); - } - } + return function readFirstAvailableStream(_x34) { + return _ref34.apply(this, arguments); + }; +})(); - // Each scope gets a bitset that may contain these flags - var - SCOPE_TOP = 1, - SCOPE_FUNCTION = 2, - SCOPE_ASYNC = 4, - SCOPE_GENERATOR = 8, - SCOPE_ARROW = 16, - SCOPE_SIMPLE_CATCH = 32, - SCOPE_SUPER = 64, - SCOPE_DIRECT_SUPER = 128, - SCOPE_CLASS_STATIC_BLOCK = 256, - SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK; +let getFirstSuitableFolder = exports.getFirstSuitableFolder = (() => { + var _ref36 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths, mode = constants.W_OK | constants.X_OK) { + const result = { + skipped: [], + folder: null + }; - function functionFlags(async, generator) { - return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0) - } + for (var _iterator16 = paths, _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : _iterator16[Symbol.iterator]();;) { + var _ref37; - // Used in checkLVal* and declareName to determine the type of a binding - var - BIND_NONE = 0, // Not a binding - BIND_VAR = 1, // Var-style binding - BIND_LEXICAL = 2, // Let- or const-style binding - BIND_FUNCTION = 3, // Function declaration - BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding - BIND_OUTSIDE = 5; // Special case for function names as bound inside the function + if (_isArray16) { + if (_i16 >= _iterator16.length) break; + _ref37 = _iterator16[_i16++]; + } else { + _i16 = _iterator16.next(); + if (_i16.done) break; + _ref37 = _i16.value; + } - var Parser = function Parser(options, input, startPos) { - this.options = options = getOptions(options); - this.sourceFile = options.sourceFile; - this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); - var reserved = ""; - if (options.allowReserved !== true) { - reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3]; - if (options.sourceType === "module") { reserved += " await"; } - } - this.reservedWords = wordsRegexp(reserved); - var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict; - this.reservedWordsStrict = wordsRegexp(reservedStrict); - this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind); - this.input = String(input); + const folder = _ref37; - // Used to signal to callers of `readWord1` whether the word - // contained any escape sequences. This is needed because words with - // escape sequences must not be interpreted as keywords. - this.containsEsc = false; + try { + yield mkdirp(folder); + yield access(folder, mode); - // Set up token state + result.folder = folder; - // The current position of the tokenizer in the input. - if (startPos) { - this.pos = startPos; - this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1; - this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length; - } else { - this.pos = this.lineStart = 0; - this.curLine = 1; + return result; + } catch (error) { + result.skipped.push({ + error, + folder + }); + } } + return result; + }); - // Properties of the current token: - // Its type - this.type = types$1.eof; - // For tokens that include more information than their type, the value - this.value = null; - // Its start and end offset - this.start = this.end = this.pos; - // And, if locations are used, the {line, column} object - // corresponding to those offsets - this.startLoc = this.endLoc = this.curPosition(); + return function getFirstSuitableFolder(_x35) { + return _ref36.apply(this, arguments); + }; +})(); - // Position information for the previous token - this.lastTokEndLoc = this.lastTokStartLoc = null; - this.lastTokStart = this.lastTokEnd = this.pos; +exports.copy = copy; +exports.readFile = readFile; +exports.readFileRaw = readFileRaw; +exports.normalizeOS = normalizeOS; - // The context stack is used to superficially track syntactic - // context to predict whether a regular expression is allowed in a - // given position. - this.context = this.initialContext(); - this.exprAllowed = true; +var _fs; - // Figure out if it's a module code. - this.inModule = options.sourceType === "module"; - this.strict = this.inModule || this.strictDirective(this.pos); +function _load_fs() { + return _fs = _interopRequireDefault(__nested_webpack_require_4709__(3)); +} - // Used to signify the start of a potential arrow function - this.potentialArrowAt = -1; - this.potentialArrowInForAwait = false; +var _glob; - // Positions to delayed-check that yield/await does not exist in default parameters. - this.yieldPos = this.awaitPos = this.awaitIdentPos = 0; - // Labels in scope. - this.labels = []; - // Thus-far undefined exports. - this.undefinedExports = Object.create(null); +function _load_glob() { + return _glob = _interopRequireDefault(__nested_webpack_require_4709__(75)); +} - // If enabled, skip leading hashbang line. - if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") - { this.skipLineComment(2); } +var _os; - // Scope tracking for duplicate variable names (see scope.js) - this.scopeStack = []; - this.enterScope(SCOPE_TOP); +function _load_os() { + return _os = _interopRequireDefault(__nested_webpack_require_4709__(36)); +} - // For RegExp validation - this.regexpState = null; +var _path; - // The stack of private names. - // Each element has two properties: 'declared' and 'used'. - // When it exited from the outermost class definition, all used private names must be declared. - this.privateNameStack = []; - }; +function _load_path() { + return _path = _interopRequireDefault(__nested_webpack_require_4709__(0)); +} - var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },canAwait: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true },allowNewDotTarget: { configurable: true },inClassStaticBlock: { configurable: true } }; +var _blockingQueue; - Parser.prototype.parse = function parse () { - var node = this.options.program || this.startNode(); - this.nextToken(); - return this.parseTopLevel(node) - }; +function _load_blockingQueue() { + return _blockingQueue = _interopRequireDefault(__nested_webpack_require_4709__(84)); +} - prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 }; +var _promise; - prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 && !this.currentVarScope().inClassFieldInit }; +function _load_promise() { + return _promise = _interopRequireWildcard(__nested_webpack_require_4709__(40)); +} - prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 && !this.currentVarScope().inClassFieldInit }; +var _promise2; - prototypeAccessors.canAwait.get = function () { - for (var i = this.scopeStack.length - 1; i >= 0; i--) { - var scope = this.scopeStack[i]; - if (scope.inClassFieldInit || scope.flags & SCOPE_CLASS_STATIC_BLOCK) { return false } - if (scope.flags & SCOPE_FUNCTION) { return (scope.flags & SCOPE_ASYNC) > 0 } - } - return (this.inModule && this.options.ecmaVersion >= 13) || this.options.allowAwaitOutsideFunction - }; +function _load_promise2() { + return _promise2 = __nested_webpack_require_4709__(40); +} - prototypeAccessors.allowSuper.get = function () { - var ref = this.currentThisScope(); - var flags = ref.flags; - var inClassFieldInit = ref.inClassFieldInit; - return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod - }; +var _map; - prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 }; +function _load_map() { + return _map = _interopRequireDefault(__nested_webpack_require_4709__(20)); +} - prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) }; +var _fsNormalized; - prototypeAccessors.allowNewDotTarget.get = function () { - var ref = this.currentThisScope(); - var flags = ref.flags; - var inClassFieldInit = ref.inClassFieldInit; - return (flags & (SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK)) > 0 || inClassFieldInit - }; +function _load_fsNormalized() { + return _fsNormalized = __nested_webpack_require_4709__(164); +} - prototypeAccessors.inClassStaticBlock.get = function () { - return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0 - }; +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - Parser.extend = function extend () { - var plugins = [], len = arguments.length; - while ( len-- ) plugins[ len ] = arguments[ len ]; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var cls = this; - for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); } - return cls - }; +const constants = exports.constants = typeof (_fs || _load_fs()).default.constants !== 'undefined' ? (_fs || _load_fs()).default.constants : { + R_OK: (_fs || _load_fs()).default.R_OK, + W_OK: (_fs || _load_fs()).default.W_OK, + X_OK: (_fs || _load_fs()).default.X_OK +}; - Parser.parse = function parse (input, options) { - return new this(options, input).parse() - }; +const lockQueue = exports.lockQueue = new (_blockingQueue || _load_blockingQueue()).default('fs lock'); - Parser.parseExpressionAt = function parseExpressionAt (input, pos, options) { - var parser = new this(options, input, pos); - parser.nextToken(); - return parser.parseExpression() - }; +const readFileBuffer = exports.readFileBuffer = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readFile); +const open = exports.open = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.open); +const writeFile = exports.writeFile = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.writeFile); +const readlink = exports.readlink = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readlink); +const realpath = exports.realpath = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.realpath); +const readdir = exports.readdir = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readdir); +const rename = exports.rename = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.rename); +const access = exports.access = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.access); +const stat = exports.stat = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.stat); +const mkdirp = exports.mkdirp = (0, (_promise2 || _load_promise2()).promisify)(__nested_webpack_require_4709__(116)); +const exists = exports.exists = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.exists, true); +const lstat = exports.lstat = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.lstat); +const chmod = exports.chmod = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.chmod); +const link = exports.link = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.link); +const glob = exports.glob = (0, (_promise2 || _load_promise2()).promisify)((_glob || _load_glob()).default); +exports.unlink = (_fsNormalized || _load_fsNormalized()).unlink; - Parser.tokenizer = function tokenizer (input, options) { - return new this(options, input) - }; +// fs.copyFile uses the native file copying instructions on the system, performing much better +// than any JS-based solution and consumes fewer resources. Repeated testing to fine tune the +// concurrency level revealed 128 as the sweet spot on a quad-core, 16 CPU Intel system with SSD. - Object.defineProperties( Parser.prototype, prototypeAccessors ); +const CONCURRENT_QUEUE_ITEMS = (_fs || _load_fs()).default.copyFile ? 128 : 4; - var pp$9 = Parser.prototype; +const fsSymlink = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.symlink); +const invariant = __nested_webpack_require_4709__(7); +const stripBOM = __nested_webpack_require_4709__(122); - // ## Parser utilities +const noop = () => {}; - var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/; - pp$9.strictDirective = function(start) { - if (this.options.ecmaVersion < 5) { return false } - for (;;) { - // Try to find string literal. - skipWhiteSpace.lastIndex = start; - start += skipWhiteSpace.exec(this.input)[0].length; - var match = literal.exec(this.input.slice(start)); - if (!match) { return false } - if ((match[1] || match[2]) === "use strict") { - skipWhiteSpace.lastIndex = start + match[0].length; - var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length; - var next = this.input.charAt(end); - return next === ";" || next === "}" || - (lineBreak.test(spaceAfter[0]) && - !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "=")) - } - start += match[0].length; +function copy(src, dest, reporter) { + return copyBulk([{ src, dest }], reporter); +} - // Skip semicolon, if any. - skipWhiteSpace.lastIndex = start; - start += skipWhiteSpace.exec(this.input)[0].length; - if (this.input[start] === ";") - { start++; } - } - }; +function _readFile(loc, encoding) { + return new Promise((resolve, reject) => { + (_fs || _load_fs()).default.readFile(loc, encoding, function (err, content) { + if (err) { + reject(err); + } else { + resolve(content); + } + }); + }); +} - // Predicate that tests whether the next token is of the given - // type, and if yes, consumes it as a side effect. +function readFile(loc) { + return _readFile(loc, 'utf8').then(normalizeOS); +} - pp$9.eat = function(type) { - if (this.type === type) { - this.next(); - return true - } else { - return false - } - }; +function readFileRaw(loc) { + return _readFile(loc, 'binary'); +} - // Tests whether parsed token is a contextual keyword. +function normalizeOS(body) { + return body.replace(/\r\n/g, '\n'); +} - pp$9.isContextual = function(name) { - return this.type === types$1.name && this.value === name && !this.containsEsc - }; +const cr = '\r'.charCodeAt(0); +const lf = '\n'.charCodeAt(0); - // Consumes contextual keyword if possible. +/***/ }), +/* 6 */ +/***/ (function(module, exports, __nested_webpack_require_44107__) { - pp$9.eatContextual = function(name) { - if (!this.isContextual(name)) { return false } - this.next(); - return true - }; +"use strict"; - // Asserts that following token is given contextual keyword. - pp$9.expectContextual = function(name) { - if (!this.eatContextual(name)) { this.unexpected(); } - }; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getPathKey = getPathKey; +const os = __nested_webpack_require_44107__(36); +const path = __nested_webpack_require_44107__(0); +const userHome = __nested_webpack_require_44107__(45).default; - // Test whether a semicolon can be inserted at the current position. +var _require = __nested_webpack_require_44107__(171); - pp$9.canInsertSemicolon = function() { - return this.type === types$1.eof || - this.type === types$1.braceR || - lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) - }; +const getCacheDir = _require.getCacheDir, + getConfigDir = _require.getConfigDir, + getDataDir = _require.getDataDir; - pp$9.insertSemicolon = function() { - if (this.canInsertSemicolon()) { - if (this.options.onInsertedSemicolon) - { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); } - return true - } - }; +const isWebpackBundle = __nested_webpack_require_44107__(227); - // Consume a semicolon, or, failing that, see if we are allowed to - // pretend that there is a semicolon at this position. +const DEPENDENCY_TYPES = exports.DEPENDENCY_TYPES = ['devDependencies', 'dependencies', 'optionalDependencies', 'peerDependencies']; +const RESOLUTIONS = exports.RESOLUTIONS = 'resolutions'; +const MANIFEST_FIELDS = exports.MANIFEST_FIELDS = [RESOLUTIONS, ...DEPENDENCY_TYPES]; - pp$9.semicolon = function() { - if (!this.eat(types$1.semi) && !this.insertSemicolon()) { this.unexpected(); } - }; +const SUPPORTED_NODE_VERSIONS = exports.SUPPORTED_NODE_VERSIONS = '^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0'; - pp$9.afterTrailingComma = function(tokType, notNext) { - if (this.type === tokType) { - if (this.options.onTrailingComma) - { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); } - if (!notNext) - { this.next(); } - return true - } - }; +const YARN_REGISTRY = exports.YARN_REGISTRY = 'https://registry.yarnpkg.com'; - // Expect a token of a given type. If found, consume it, otherwise, - // raise an unexpected token error. +const YARN_DOCS = exports.YARN_DOCS = 'https://yarnpkg.com/en/docs/cli/'; +const YARN_INSTALLER_SH = exports.YARN_INSTALLER_SH = 'https://yarnpkg.com/install.sh'; +const YARN_INSTALLER_MSI = exports.YARN_INSTALLER_MSI = 'https://yarnpkg.com/latest.msi'; - pp$9.expect = function(type) { - this.eat(type) || this.unexpected(); - }; +const SELF_UPDATE_VERSION_URL = exports.SELF_UPDATE_VERSION_URL = 'https://yarnpkg.com/latest-version'; - // Raise an unexpected token error. +// cache version, bump whenever we make backwards incompatible changes +const CACHE_VERSION = exports.CACHE_VERSION = 2; - pp$9.unexpected = function(pos) { - this.raise(pos != null ? pos : this.start, "Unexpected token"); - }; +// lockfile version, bump whenever we make backwards incompatible changes +const LOCKFILE_VERSION = exports.LOCKFILE_VERSION = 1; - var DestructuringErrors = function DestructuringErrors() { - this.shorthandAssign = - this.trailingComma = - this.parenthesizedAssign = - this.parenthesizedBind = - this.doubleProto = - -1; - }; +// max amount of network requests to perform concurrently +const NETWORK_CONCURRENCY = exports.NETWORK_CONCURRENCY = 8; - pp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) { - if (!refDestructuringErrors) { return } - if (refDestructuringErrors.trailingComma > -1) - { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); } - var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind; - if (parens > -1) { this.raiseRecoverable(parens, isAssign ? "Assigning to rvalue" : "Parenthesized pattern"); } - }; +// HTTP timeout used when downloading packages +const NETWORK_TIMEOUT = exports.NETWORK_TIMEOUT = 30 * 1000; // in milliseconds - pp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) { - if (!refDestructuringErrors) { return false } - var shorthandAssign = refDestructuringErrors.shorthandAssign; - var doubleProto = refDestructuringErrors.doubleProto; - if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 } - if (shorthandAssign >= 0) - { this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); } - if (doubleProto >= 0) - { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); } - }; +// max amount of child processes to execute concurrently +const CHILD_CONCURRENCY = exports.CHILD_CONCURRENCY = 5; - pp$9.checkYieldAwaitInDefaultParams = function() { - if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) - { this.raise(this.yieldPos, "Yield expression cannot be a default value"); } - if (this.awaitPos) - { this.raise(this.awaitPos, "Await expression cannot be a default value"); } - }; +const REQUIRED_PACKAGE_KEYS = exports.REQUIRED_PACKAGE_KEYS = ['name', 'version', '_uid']; - pp$9.isSimpleAssignTarget = function(expr) { - if (expr.type === "ParenthesizedExpression") - { return this.isSimpleAssignTarget(expr.expression) } - return expr.type === "Identifier" || expr.type === "MemberExpression" - }; +function getPreferredCacheDirectories() { + const preferredCacheDirectories = [getCacheDir()]; - var pp$8 = Parser.prototype; + if (process.getuid) { + // $FlowFixMe: process.getuid exists, dammit + preferredCacheDirectories.push(path.join(os.tmpdir(), `.yarn-cache-${process.getuid()}`)); + } - // ### Statement parsing + preferredCacheDirectories.push(path.join(os.tmpdir(), `.yarn-cache`)); - // Parse a program. Initializes the parser, reads any number of - // statements, and wraps them in a Program node. Optionally takes a - // `program` argument. If present, the statements will be appended - // to its body instead of creating a new node. + return preferredCacheDirectories; +} - pp$8.parseTopLevel = function(node) { - var exports = Object.create(null); - if (!node.body) { node.body = []; } - while (this.type !== types$1.eof) { - var stmt = this.parseStatement(null, true, exports); - node.body.push(stmt); - } - if (this.inModule) - { for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1) - { - var name = list[i]; +const PREFERRED_MODULE_CACHE_DIRECTORIES = exports.PREFERRED_MODULE_CACHE_DIRECTORIES = getPreferredCacheDirectories(); +const CONFIG_DIRECTORY = exports.CONFIG_DIRECTORY = getConfigDir(); +const DATA_DIRECTORY = exports.DATA_DIRECTORY = getDataDir(); +const LINK_REGISTRY_DIRECTORY = exports.LINK_REGISTRY_DIRECTORY = path.join(DATA_DIRECTORY, 'link'); +const GLOBAL_MODULE_DIRECTORY = exports.GLOBAL_MODULE_DIRECTORY = path.join(DATA_DIRECTORY, 'global'); - this.raiseRecoverable(this.undefinedExports[name].start, ("Export '" + name + "' is not defined")); - } } - this.adaptDirectivePrologue(node.body); - this.next(); - node.sourceType = this.options.sourceType; - return this.finishNode(node, "Program") - }; +const NODE_BIN_PATH = exports.NODE_BIN_PATH = process.execPath; +const YARN_BIN_PATH = exports.YARN_BIN_PATH = getYarnBinPath(); - var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"}; +// Webpack needs to be configured with node.__dirname/__filename = false +function getYarnBinPath() { + if (isWebpackBundle) { + return __filename; + } else { + return path.join(__dirname, '..', 'bin', 'yarn.js'); + } +} - pp$8.isLet = function(context) { - if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false } - skipWhiteSpace.lastIndex = this.pos; - var skip = skipWhiteSpace.exec(this.input); - var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); - // For ambiguous cases, determine if a LexicalDeclaration (or only a - // Statement) is allowed here. If context is not empty then only a Statement - // is allowed. However, `let [` is an explicit negative lookahead for - // ExpressionStatement, so special-case it first. - if (nextCh === 91 || nextCh === 92) { return true } // '[', '/' - if (context) { return false } +const NODE_MODULES_FOLDER = exports.NODE_MODULES_FOLDER = 'node_modules'; +const NODE_PACKAGE_JSON = exports.NODE_PACKAGE_JSON = 'package.json'; - if (nextCh === 123 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true } // '{', astral - if (isIdentifierStart(nextCh, true)) { - var pos = next + 1; - while (isIdentifierChar(nextCh = this.input.charCodeAt(pos), true)) { ++pos; } - if (nextCh === 92 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true } - var ident = this.input.slice(next, pos); - if (!keywordRelationalOperator.test(ident)) { return true } - } - return false - }; +const POSIX_GLOBAL_PREFIX = exports.POSIX_GLOBAL_PREFIX = `${process.env.DESTDIR || ''}/usr/local`; +const FALLBACK_GLOBAL_PREFIX = exports.FALLBACK_GLOBAL_PREFIX = path.join(userHome, '.yarn'); - // check 'async [no LineTerminator here] function' - // - 'async /*foo*/ function' is OK. - // - 'async /*\n*/ function' is invalid. - pp$8.isAsyncFunction = function() { - if (this.options.ecmaVersion < 8 || !this.isContextual("async")) - { return false } +const META_FOLDER = exports.META_FOLDER = '.yarn-meta'; +const INTEGRITY_FILENAME = exports.INTEGRITY_FILENAME = '.yarn-integrity'; +const LOCKFILE_FILENAME = exports.LOCKFILE_FILENAME = 'yarn.lock'; +const METADATA_FILENAME = exports.METADATA_FILENAME = '.yarn-metadata.json'; +const TARBALL_FILENAME = exports.TARBALL_FILENAME = '.yarn-tarball.tgz'; +const CLEAN_FILENAME = exports.CLEAN_FILENAME = '.yarnclean'; - skipWhiteSpace.lastIndex = this.pos; - var skip = skipWhiteSpace.exec(this.input); - var next = this.pos + skip[0].length, after; - return !lineBreak.test(this.input.slice(this.pos, next)) && - this.input.slice(next, next + 8) === "function" && - (next + 8 === this.input.length || - !(isIdentifierChar(after = this.input.charCodeAt(next + 8)) || after > 0xd7ff && after < 0xdc00)) - }; +const NPM_LOCK_FILENAME = exports.NPM_LOCK_FILENAME = 'package-lock.json'; +const NPM_SHRINKWRAP_FILENAME = exports.NPM_SHRINKWRAP_FILENAME = 'npm-shrinkwrap.json'; - // Parse a single statement. - // - // If expecting a statement and finding a slash operator, parse a - // regular expression literal. This is to handle cases like - // `if (foo) /blah/.exec(foo)`, where looking at the previous token - // does not help. +const DEFAULT_INDENT = exports.DEFAULT_INDENT = ' '; +const SINGLE_INSTANCE_PORT = exports.SINGLE_INSTANCE_PORT = 31997; +const SINGLE_INSTANCE_FILENAME = exports.SINGLE_INSTANCE_FILENAME = '.yarn-single-instance'; - pp$8.parseStatement = function(context, topLevel, exports) { - var starttype = this.type, node = this.startNode(), kind; +const ENV_PATH_KEY = exports.ENV_PATH_KEY = getPathKey(process.platform, process.env); - if (this.isLet(context)) { - starttype = types$1._var; - kind = "let"; - } +function getPathKey(platform, env) { + let pathKey = 'PATH'; - // Most types of statements are recognized by the keyword they - // start with. Many are trivial to parse, some require a bit of - // complexity. + // windows calls its path "Path" usually, but this is not guaranteed. + if (platform === 'win32') { + pathKey = 'Path'; - switch (starttype) { - case types$1._break: case types$1._continue: return this.parseBreakContinueStatement(node, starttype.keyword) - case types$1._debugger: return this.parseDebuggerStatement(node) - case types$1._do: return this.parseDoStatement(node) - case types$1._for: return this.parseForStatement(node) - case types$1._function: - // Function as sole body of either an if statement or a labeled statement - // works, but not when it is part of a labeled statement that is the sole - // body of an if statement. - if ((context && (this.strict || context !== "if" && context !== "label")) && this.options.ecmaVersion >= 6) { this.unexpected(); } - return this.parseFunctionStatement(node, false, !context) - case types$1._class: - if (context) { this.unexpected(); } - return this.parseClass(node, true) - case types$1._if: return this.parseIfStatement(node) - case types$1._return: return this.parseReturnStatement(node) - case types$1._switch: return this.parseSwitchStatement(node) - case types$1._throw: return this.parseThrowStatement(node) - case types$1._try: return this.parseTryStatement(node) - case types$1._const: case types$1._var: - kind = kind || this.value; - if (context && kind !== "var") { this.unexpected(); } - return this.parseVarStatement(node, kind) - case types$1._while: return this.parseWhileStatement(node) - case types$1._with: return this.parseWithStatement(node) - case types$1.braceL: return this.parseBlock(true, node) - case types$1.semi: return this.parseEmptyStatement(node) - case types$1._export: - case types$1._import: - if (this.options.ecmaVersion > 10 && starttype === types$1._import) { - skipWhiteSpace.lastIndex = this.pos; - var skip = skipWhiteSpace.exec(this.input); - var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); - if (nextCh === 40 || nextCh === 46) // '(' or '.' - { return this.parseExpressionStatement(node, this.parseExpression()) } + for (const key in env) { + if (key.toLowerCase() === 'path') { + pathKey = key; } + } + } - if (!this.options.allowImportExportEverywhere) { - if (!topLevel) - { this.raise(this.start, "'import' and 'export' may only appear at the top level"); } - if (!this.inModule) - { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); } - } - return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports) + return pathKey; +} - // If the statement does not start with a statement keyword or a - // brace, it's an ExpressionStatement or LabeledStatement. We - // simply start parsing an expression, and afterwards, if the - // next token is a colon and the expression was a simple - // Identifier node, we switch to interpreting it as a label. - default: - if (this.isAsyncFunction()) { - if (context) { this.unexpected(); } - this.next(); - return this.parseFunctionStatement(node, true, !context) - } +const VERSION_COLOR_SCHEME = exports.VERSION_COLOR_SCHEME = { + major: 'red', + premajor: 'red', + minor: 'yellow', + preminor: 'yellow', + patch: 'green', + prepatch: 'green', + prerelease: 'red', + unchanged: 'white', + unknown: 'red' +}; - var maybeName = this.value, expr = this.parseExpression(); - if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon)) - { return this.parseLabeledStatement(node, maybeName, expr, context) } - else { return this.parseExpressionStatement(node, expr) } - } - }; +/***/ }), +/* 7 */ +/***/ (function(module, exports, __nccwpck_require__) { - pp$8.parseBreakContinueStatement = function(node, keyword) { - var isBreak = keyword === "break"; - this.next(); - if (this.eat(types$1.semi) || this.insertSemicolon()) { node.label = null; } - else if (this.type !== types$1.name) { this.unexpected(); } - else { - node.label = this.parseIdent(); - this.semicolon(); - } +"use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ - // Verify that there is an actual destination to break or - // continue to. - var i = 0; - for (; i < this.labels.length; ++i) { - var lab = this.labels[i]; - if (node.label == null || lab.name === node.label.name) { - if (lab.kind != null && (isBreak || lab.kind === "loop")) { break } - if (node.label && isBreak) { break } - } - } - if (i === this.labels.length) { this.raise(node.start, "Unsyntactic " + keyword); } - return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement") - }; - pp$8.parseDebuggerStatement = function(node) { - this.next(); - this.semicolon(); - return this.finishNode(node, "DebuggerStatement") - }; - pp$8.parseDoStatement = function(node) { - this.next(); - this.labels.push(loopLabel); - node.body = this.parseStatement("do"); - this.labels.pop(); - this.expect(types$1._while); - node.test = this.parseParenExpression(); - if (this.options.ecmaVersion >= 6) - { this.eat(types$1.semi); } - else - { this.semicolon(); } - return this.finishNode(node, "DoWhileStatement") - }; +/** + * Use invariant() to assert state which your program assumes to be true. + * + * Provide sprintf-style format (only %s is supported) and arguments + * to provide information about what broke and what you were + * expecting. + * + * The invariant message will be stripped in production, but the invariant + * will remain to ensure logic does not differ in production. + */ - // Disambiguating between a `for` and a `for`/`in` or `for`/`of` - // loop is non-trivial. Basically, we have to parse the init `var` - // statement or expression, disallowing the `in` operator (see - // the second parameter to `parseExpression`), and then check - // whether the next token is `in` or `of`. When there is no init - // part (semicolon immediately after the opening parenthesis), it - // is a regular `for` loop. +var NODE_ENV = process.env.NODE_ENV; - pp$8.parseForStatement = function(node) { - this.next(); - var awaitAt = (this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await")) ? this.lastTokStart : -1; - this.labels.push(loopLabel); - this.enterScope(0); - this.expect(types$1.parenL); - if (this.type === types$1.semi) { - if (awaitAt > -1) { this.unexpected(awaitAt); } - return this.parseFor(node, null) - } - var isLet = this.isLet(); - if (this.type === types$1._var || this.type === types$1._const || isLet) { - var init$1 = this.startNode(), kind = isLet ? "let" : this.value; - this.next(); - this.parseVar(init$1, true, kind); - this.finishNode(init$1, "VariableDeclaration"); - if ((this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) { - if (this.options.ecmaVersion >= 9) { - if (this.type === types$1._in) { - if (awaitAt > -1) { this.unexpected(awaitAt); } - } else { node.await = awaitAt > -1; } - } - return this.parseForIn(node, init$1) - } - if (awaitAt > -1) { this.unexpected(awaitAt); } - return this.parseFor(node, init$1) +var invariant = function(condition, format, a, b, c, d, e, f) { + if (NODE_ENV !== 'production') { + if (format === undefined) { + throw new Error('invariant requires an error message argument'); } - var startsWithLet = this.isContextual("let"), isForOf = false; - var refDestructuringErrors = new DestructuringErrors; - var init = this.parseExpression(awaitAt > -1 ? "await" : true, refDestructuringErrors); - if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) { - if (this.options.ecmaVersion >= 9) { - if (this.type === types$1._in) { - if (awaitAt > -1) { this.unexpected(awaitAt); } - } else { node.await = awaitAt > -1; } - } - if (startsWithLet && isForOf) { this.raise(init.start, "The left-hand side of a for-of loop may not start with 'let'."); } - this.toAssignable(init, false, refDestructuringErrors); - this.checkLValPattern(init); - return this.parseForIn(node, init) + } + + if (!condition) { + var error; + if (format === undefined) { + error = new Error( + 'Minified exception occurred; use the non-minified dev environment ' + + 'for the full error message and additional helpful warnings.' + ); } else { - this.checkExpressionErrors(refDestructuringErrors, true); + var args = [a, b, c, d, e, f]; + var argIndex = 0; + error = new Error( + format.replace(/%s/g, function() { return args[argIndex++]; }) + ); + error.name = 'Invariant Violation'; } - if (awaitAt > -1) { this.unexpected(awaitAt); } - return this.parseFor(node, init) - }; - - pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) { - this.next(); - return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync) - }; - pp$8.parseIfStatement = function(node) { - this.next(); - node.test = this.parseParenExpression(); - // allow function declarations in branches, but only in non-strict mode - node.consequent = this.parseStatement("if"); - node.alternate = this.eat(types$1._else) ? this.parseStatement("if") : null; - return this.finishNode(node, "IfStatement") - }; + error.framesToPop = 1; // we don't care about invariant's own frame + throw error; + } +}; - pp$8.parseReturnStatement = function(node) { - if (!this.inFunction && !this.options.allowReturnOutsideFunction) - { this.raise(this.start, "'return' outside of function"); } - this.next(); +module.exports = invariant; - // In `return` (and `break`/`continue`), the keywords with - // optional arguments, we eagerly look for a semicolon or the - // possibility to insert one. - if (this.eat(types$1.semi) || this.insertSemicolon()) { node.argument = null; } - else { node.argument = this.parseExpression(); this.semicolon(); } - return this.finishNode(node, "ReturnStatement") - }; +/***/ }), +/* 8 */, +/* 9 */ +/***/ (function(module, exports) { - pp$8.parseSwitchStatement = function(node) { - this.next(); - node.discriminant = this.parseParenExpression(); - node.cases = []; - this.expect(types$1.braceL); - this.labels.push(switchLabel); - this.enterScope(0); +module.exports = __nccwpck_require__(6113); - // Statements under must be grouped (by label) in SwitchCase - // nodes. `cur` is used to keep the node that we are currently - // adding statements to. +/***/ }), +/* 10 */, +/* 11 */ +/***/ (function(module, exports) { - var cur; - for (var sawDefault = false; this.type !== types$1.braceR;) { - if (this.type === types$1._case || this.type === types$1._default) { - var isCase = this.type === types$1._case; - if (cur) { this.finishNode(cur, "SwitchCase"); } - node.cases.push(cur = this.startNode()); - cur.consequent = []; - this.next(); - if (isCase) { - cur.test = this.parseExpression(); - } else { - if (sawDefault) { this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); } - sawDefault = true; - cur.test = null; - } - this.expect(types$1.colon); - } else { - if (!cur) { this.unexpected(); } - cur.consequent.push(this.parseStatement(null)); - } - } - this.exitScope(); - if (cur) { this.finishNode(cur, "SwitchCase"); } - this.next(); // Closing brace - this.labels.pop(); - return this.finishNode(node, "SwitchStatement") - }; +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self + // eslint-disable-next-line no-new-func + : Function('return this')(); +if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef - pp$8.parseThrowStatement = function(node) { - this.next(); - if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) - { this.raise(this.lastTokEnd, "Illegal newline after throw"); } - node.argument = this.parseExpression(); - this.semicolon(); - return this.finishNode(node, "ThrowStatement") - }; - // Reused empty array added for node fields that are always empty. +/***/ }), +/* 12 */ +/***/ (function(module, exports, __nested_webpack_require_51177__) { - var empty$1 = []; +"use strict"; - pp$8.parseCatchClauseParam = function() { - var param = this.parseBindingAtom(); - var simple = param.type === "Identifier"; - this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0); - this.checkLValPattern(param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL); - this.expect(types$1.parenR); - return param - }; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sortAlpha = sortAlpha; +exports.entries = entries; +exports.removePrefix = removePrefix; +exports.removeSuffix = removeSuffix; +exports.addSuffix = addSuffix; +exports.hyphenate = hyphenate; +exports.camelCase = camelCase; +exports.compareSortedArrays = compareSortedArrays; +exports.sleep = sleep; +const _camelCase = __nested_webpack_require_51177__(176); - pp$8.parseTryStatement = function(node) { - this.next(); - node.block = this.parseBlock(); - node.handler = null; - if (this.type === types$1._catch) { - var clause = this.startNode(); - this.next(); - if (this.eat(types$1.parenL)) { - clause.param = this.parseCatchClauseParam(); - } else { - if (this.options.ecmaVersion < 10) { this.unexpected(); } - clause.param = null; - this.enterScope(0); - } - clause.body = this.parseBlock(false); - this.exitScope(); - node.handler = this.finishNode(clause, "CatchClause"); +function sortAlpha(a, b) { + // sort alphabetically in a deterministic way + const shortLen = Math.min(a.length, b.length); + for (let i = 0; i < shortLen; i++) { + const aChar = a.charCodeAt(i); + const bChar = b.charCodeAt(i); + if (aChar !== bChar) { + return aChar - bChar; } - node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null; - if (!node.handler && !node.finalizer) - { this.raise(node.start, "Missing catch or finally clause"); } - return this.finishNode(node, "TryStatement") - }; + } + return a.length - b.length; +} - pp$8.parseVarStatement = function(node, kind, allowMissingInitializer) { - this.next(); - this.parseVar(node, false, kind, allowMissingInitializer); - this.semicolon(); - return this.finishNode(node, "VariableDeclaration") - }; +function entries(obj) { + const entries = []; + if (obj) { + for (const key in obj) { + entries.push([key, obj[key]]); + } + } + return entries; +} - pp$8.parseWhileStatement = function(node) { - this.next(); - node.test = this.parseParenExpression(); - this.labels.push(loopLabel); - node.body = this.parseStatement("while"); - this.labels.pop(); - return this.finishNode(node, "WhileStatement") - }; +function removePrefix(pattern, prefix) { + if (pattern.startsWith(prefix)) { + pattern = pattern.slice(prefix.length); + } - pp$8.parseWithStatement = function(node) { - if (this.strict) { this.raise(this.start, "'with' in strict mode"); } - this.next(); - node.object = this.parseParenExpression(); - node.body = this.parseStatement("with"); - return this.finishNode(node, "WithStatement") - }; + return pattern; +} - pp$8.parseEmptyStatement = function(node) { - this.next(); - return this.finishNode(node, "EmptyStatement") - }; +function removeSuffix(pattern, suffix) { + if (pattern.endsWith(suffix)) { + return pattern.slice(0, -suffix.length); + } - pp$8.parseLabeledStatement = function(node, maybeName, expr, context) { - for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1) - { - var label = list[i$1]; + return pattern; +} - if (label.name === maybeName) - { this.raise(expr.start, "Label '" + maybeName + "' is already declared"); - } } - var kind = this.type.isLoop ? "loop" : this.type === types$1._switch ? "switch" : null; - for (var i = this.labels.length - 1; i >= 0; i--) { - var label$1 = this.labels[i]; - if (label$1.statementStart === node.start) { - // Update information about previous labels on this node - label$1.statementStart = this.start; - label$1.kind = kind; - } else { break } - } - this.labels.push({name: maybeName, kind: kind, statementStart: this.start}); - node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label"); - this.labels.pop(); - node.label = expr; - return this.finishNode(node, "LabeledStatement") - }; +function addSuffix(pattern, suffix) { + if (!pattern.endsWith(suffix)) { + return pattern + suffix; + } - pp$8.parseExpressionStatement = function(node, expr) { - node.expression = expr; - this.semicolon(); - return this.finishNode(node, "ExpressionStatement") - }; + return pattern; +} - // Parse a semicolon-enclosed block of statements, handling `"use - // strict"` declarations when `allowStrict` is true (used for - // function bodies). +function hyphenate(str) { + return str.replace(/[A-Z]/g, match => { + return '-' + match.charAt(0).toLowerCase(); + }); +} - pp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) { - if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true; - if ( node === void 0 ) node = this.startNode(); +function camelCase(str) { + if (/[A-Z]/.test(str)) { + return null; + } else { + return _camelCase(str); + } +} - node.body = []; - this.expect(types$1.braceL); - if (createNewLexicalScope) { this.enterScope(0); } - while (this.type !== types$1.braceR) { - var stmt = this.parseStatement(null); - node.body.push(stmt); +function compareSortedArrays(array1, array2) { + if (array1.length !== array2.length) { + return false; + } + for (let i = 0, len = array1.length; i < len; i++) { + if (array1[i] !== array2[i]) { + return false; } - if (exitStrict) { this.strict = false; } - this.next(); - if (createNewLexicalScope) { this.exitScope(); } - return this.finishNode(node, "BlockStatement") - }; + } + return true; +} - // Parse a regular `for` loop. The disambiguation code in - // `parseStatement` will already have parsed the init statement or - // expression. +function sleep(ms) { + return new Promise(resolve => { + setTimeout(resolve, ms); + }); +} - pp$8.parseFor = function(node, init) { - node.init = init; - this.expect(types$1.semi); - node.test = this.type === types$1.semi ? null : this.parseExpression(); - this.expect(types$1.semi); - node.update = this.type === types$1.parenR ? null : this.parseExpression(); - this.expect(types$1.parenR); - node.body = this.parseStatement("for"); - this.exitScope(); - this.labels.pop(); - return this.finishNode(node, "ForStatement") - }; +/***/ }), +/* 13 */ +/***/ (function(module, exports, __nested_webpack_require_53169__) { - // Parse a `for`/`in` and `for`/`of` loop, which are almost - // same from parser's perspective. +var store = __nested_webpack_require_53169__(107)('wks'); +var uid = __nested_webpack_require_53169__(111); +var Symbol = __nested_webpack_require_53169__(11).Symbol; +var USE_SYMBOL = typeof Symbol == 'function'; - pp$8.parseForIn = function(node, init) { - var isForIn = this.type === types$1._in; - this.next(); +var $exports = module.exports = function (name) { + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); +}; - if ( - init.type === "VariableDeclaration" && - init.declarations[0].init != null && - ( - !isForIn || - this.options.ecmaVersion < 8 || - this.strict || - init.kind !== "var" || - init.declarations[0].id.type !== "Identifier" - ) - ) { - this.raise( - init.start, - ((isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer") - ); - } - node.left = init; - node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(); - this.expect(types$1.parenR); - node.body = this.parseStatement("for"); - this.exitScope(); - this.labels.pop(); - return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement") - }; +$exports.store = store; - // Parse a list of variable declarations. - pp$8.parseVar = function(node, isFor, kind, allowMissingInitializer) { - node.declarations = []; - node.kind = kind; - for (;;) { - var decl = this.startNode(); - this.parseVarId(decl, kind); - if (this.eat(types$1.eq)) { - decl.init = this.parseMaybeAssign(isFor); - } else if (!allowMissingInitializer && kind === "const" && !(this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) { - this.unexpected(); - } else if (!allowMissingInitializer && decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) { - this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value"); - } else { - decl.init = null; - } - node.declarations.push(this.finishNode(decl, "VariableDeclarator")); - if (!this.eat(types$1.comma)) { break } - } - return node - }; +/***/ }), +/* 14 */ +/***/ (function(module, exports, __nested_webpack_require_53619__) { - pp$8.parseVarId = function(decl, kind) { - decl.id = this.parseBindingAtom(); - this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); - }; +"use strict"; - var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4; - // Parse a function declaration or literal (depending on the - // `statement & FUNC_STATEMENT`). +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.stringify = exports.parse = undefined; - // Remove `allowExpressionBody` for 7.0.0, as it is only called with false - pp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) { - this.initFunction(node); - if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) { - if (this.type === types$1.star && (statement & FUNC_HANGING_STATEMENT)) - { this.unexpected(); } - node.generator = this.eat(types$1.star); - } - if (this.options.ecmaVersion >= 8) - { node.async = !!isAsync; } +var _asyncToGenerator2; - if (statement & FUNC_STATEMENT) { - node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types$1.name ? null : this.parseIdent(); - if (node.id && !(statement & FUNC_HANGING_STATEMENT)) - // If it is a regular function declaration in sloppy mode, then it is - // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding - // mode depends on properties of the current scope (see - // treatFunctionsAsVar). - { this.checkLValSimple(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); } - } +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__nested_webpack_require_53619__(1)); +} - var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; - this.enterScope(functionFlags(node.async, node.generator)); +var _parse; - if (!(statement & FUNC_STATEMENT)) - { node.id = this.type === types$1.name ? this.parseIdent() : null; } +function _load_parse() { + return _parse = __nested_webpack_require_53619__(81); +} - this.parseFunctionParams(node); - this.parseFunctionBody(node, allowExpressionBody, false, forInit); +Object.defineProperty(exports, 'parse', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_parse || _load_parse()).default; + } +}); - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression") - }; +var _stringify; - pp$8.parseFunctionParams = function(node) { - this.expect(types$1.parenL); - node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); - this.checkYieldAwaitInDefaultParams(); - }; +function _load_stringify() { + return _stringify = __nested_webpack_require_53619__(150); +} - // Parse a class declaration or literal (depending on the - // `isStatement` parameter). +Object.defineProperty(exports, 'stringify', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_stringify || _load_stringify()).default; + } +}); +exports.implodeEntry = implodeEntry; +exports.explodeEntry = explodeEntry; - pp$8.parseClass = function(node, isStatement) { - this.next(); +var _misc; - // ecma-262 14.6 Class Definitions - // A class definition is always strict mode code. - var oldStrict = this.strict; - this.strict = true; +function _load_misc() { + return _misc = __nested_webpack_require_53619__(12); +} - this.parseClassId(node, isStatement); - this.parseClassSuper(node); - var privateNameMap = this.enterClassBody(); - var classBody = this.startNode(); - var hadConstructor = false; - classBody.body = []; - this.expect(types$1.braceL); - while (this.type !== types$1.braceR) { - var element = this.parseClassElement(node.superClass !== null); - if (element) { - classBody.body.push(element); - if (element.type === "MethodDefinition" && element.kind === "constructor") { - if (hadConstructor) { this.raiseRecoverable(element.start, "Duplicate constructor in the same class"); } - hadConstructor = true; - } else if (element.key && element.key.type === "PrivateIdentifier" && isPrivateNameConflicted(privateNameMap, element)) { - this.raiseRecoverable(element.key.start, ("Identifier '#" + (element.key.name) + "' has already been declared")); - } - } - } - this.strict = oldStrict; - this.next(); - node.body = this.finishNode(classBody, "ClassBody"); - this.exitClassBody(); - return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression") - }; +var _normalizePattern; - pp$8.parseClassElement = function(constructorAllowsSuper) { - if (this.eat(types$1.semi)) { return null } +function _load_normalizePattern() { + return _normalizePattern = __nested_webpack_require_53619__(29); +} - var ecmaVersion = this.options.ecmaVersion; - var node = this.startNode(); - var keyName = ""; - var isGenerator = false; - var isAsync = false; - var kind = "method"; - var isStatic = false; +var _parse2; - if (this.eatContextual("static")) { - // Parse static init block - if (ecmaVersion >= 13 && this.eat(types$1.braceL)) { - this.parseClassStaticBlock(node); - return node - } - if (this.isClassElementNameStart() || this.type === types$1.star) { - isStatic = true; - } else { - keyName = "static"; - } - } - node.static = isStatic; - if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) { - if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) { - isAsync = true; - } else { - keyName = "async"; - } - } - if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) { - isGenerator = true; - } - if (!keyName && !isAsync && !isGenerator) { - var lastValue = this.value; - if (this.eatContextual("get") || this.eatContextual("set")) { - if (this.isClassElementNameStart()) { - kind = lastValue; - } else { - keyName = lastValue; - } - } - } +function _load_parse2() { + return _parse2 = _interopRequireDefault(__nested_webpack_require_53619__(81)); +} - // Parse element name - if (keyName) { - // 'async', 'get', 'set', or 'static' were not a keyword contextually. - // The last token is any of those. Make it the element name. - node.computed = false; - node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc); - node.key.name = keyName; - this.finishNode(node.key, "Identifier"); - } else { - this.parseClassElementName(node); - } +var _constants; - // Parse element value - if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync) { - var isConstructor = !node.static && checkKeyName(node, "constructor"); - var allowsDirectSuper = isConstructor && constructorAllowsSuper; - // Couldn't move this check into the 'parseClassMethod' method for backward compatibility. - if (isConstructor && kind !== "method") { this.raise(node.key.start, "Constructor can't have get/set modifier"); } - node.kind = isConstructor ? "constructor" : kind; - this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper); - } else { - this.parseClassField(node); - } +function _load_constants() { + return _constants = __nested_webpack_require_53619__(6); +} - return node - }; +var _fs; - pp$8.isClassElementNameStart = function() { - return ( - this.type === types$1.name || - this.type === types$1.privateId || - this.type === types$1.num || - this.type === types$1.string || - this.type === types$1.bracketL || - this.type.keyword - ) - }; +function _load_fs() { + return _fs = _interopRequireWildcard(__nested_webpack_require_53619__(5)); +} - pp$8.parseClassElementName = function(element) { - if (this.type === types$1.privateId) { - if (this.value === "constructor") { - this.raise(this.start, "Classes can't have an element named '#constructor'"); - } - element.computed = false; - element.key = this.parsePrivateIdent(); - } else { - this.parsePropertyName(element); - } - }; +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - pp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { - // Check key and flags - var key = method.key; - if (method.kind === "constructor") { - if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); } - if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); } - } else if (method.static && checkKeyName(method, "prototype")) { - this.raise(key.start, "Classes may not have a static property named prototype"); - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - // Parse value - var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper); +const invariant = __nested_webpack_require_53619__(7); - // Check value - if (method.kind === "get" && value.params.length !== 0) - { this.raiseRecoverable(value.start, "getter should have no params"); } - if (method.kind === "set" && value.params.length !== 1) - { this.raiseRecoverable(value.start, "setter should have exactly one param"); } - if (method.kind === "set" && value.params[0].type === "RestElement") - { this.raiseRecoverable(value.params[0].start, "Setter cannot use rest params"); } +const path = __nested_webpack_require_53619__(0); +const ssri = __nested_webpack_require_53619__(55); - return this.finishNode(method, "MethodDefinition") - }; +function getName(pattern) { + return (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(pattern).name; +} - pp$8.parseClassField = function(field) { - if (checkKeyName(field, "constructor")) { - this.raise(field.key.start, "Classes can't have a field named 'constructor'"); - } else if (field.static && checkKeyName(field, "prototype")) { - this.raise(field.key.start, "Classes can't have a static field named 'prototype'"); - } +function blankObjectUndefined(obj) { + return obj && Object.keys(obj).length ? obj : undefined; +} - if (this.eat(types$1.eq)) { - // To raise SyntaxError if 'arguments' exists in the initializer. - var scope = this.currentThisScope(); - var inClassFieldInit = scope.inClassFieldInit; - scope.inClassFieldInit = true; - field.value = this.parseMaybeAssign(); - scope.inClassFieldInit = inClassFieldInit; - } else { - field.value = null; - } - this.semicolon(); +function keyForRemote(remote) { + return remote.resolved || (remote.reference && remote.hash ? `${remote.reference}#${remote.hash}` : null); +} - return this.finishNode(field, "PropertyDefinition") +function serializeIntegrity(integrity) { + // We need this because `Integrity.toString()` does not use sorting to ensure a stable string output + // See https://git.io/vx2Hy + return integrity.toString().split(' ').sort().join(' '); +} + +function implodeEntry(pattern, obj) { + const inferredName = getName(pattern); + const integrity = obj.integrity ? serializeIntegrity(obj.integrity) : ''; + const imploded = { + name: inferredName === obj.name ? undefined : obj.name, + version: obj.version, + uid: obj.uid === obj.version ? undefined : obj.uid, + resolved: obj.resolved, + registry: obj.registry === 'npm' ? undefined : obj.registry, + dependencies: blankObjectUndefined(obj.dependencies), + optionalDependencies: blankObjectUndefined(obj.optionalDependencies), + permissions: blankObjectUndefined(obj.permissions), + prebuiltVariants: blankObjectUndefined(obj.prebuiltVariants) }; + if (integrity) { + imploded.integrity = integrity; + } + return imploded; +} - pp$8.parseClassStaticBlock = function(node) { - node.body = []; +function explodeEntry(pattern, obj) { + obj.optionalDependencies = obj.optionalDependencies || {}; + obj.dependencies = obj.dependencies || {}; + obj.uid = obj.uid || obj.version; + obj.permissions = obj.permissions || {}; + obj.registry = obj.registry || 'npm'; + obj.name = obj.name || getName(pattern); + const integrity = obj.integrity; + if (integrity && integrity.isIntegrity) { + obj.integrity = ssri.parse(integrity); + } + return obj; +} - var oldLabels = this.labels; - this.labels = []; - this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER); - while (this.type !== types$1.braceR) { - var stmt = this.parseStatement(null); - node.body.push(stmt); - } - this.next(); - this.exitScope(); - this.labels = oldLabels; +class Lockfile { + constructor({ cache, source, parseResultType } = {}) { + this.source = source || ''; + this.cache = cache; + this.parseResultType = parseResultType; + } - return this.finishNode(node, "StaticBlock") - }; + // source string if the `cache` was parsed - pp$8.parseClassId = function(node, isStatement) { - if (this.type === types$1.name) { - node.id = this.parseIdent(); - if (isStatement) - { this.checkLValSimple(node.id, BIND_LEXICAL, false); } - } else { - if (isStatement === true) - { this.unexpected(); } - node.id = null; + + // if true, we're parsing an old yarn file and need to update integrity fields + hasEntriesExistWithoutIntegrity() { + if (!this.cache) { + return false; } - }; - pp$8.parseClassSuper = function(node) { - node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(null, false) : null; - }; + for (const key in this.cache) { + // $FlowFixMe - `this.cache` is clearly defined at this point + if (!/^.*@(file:|http)/.test(key) && this.cache[key] && !this.cache[key].integrity) { + return true; + } + } - pp$8.enterClassBody = function() { - var element = {declared: Object.create(null), used: []}; - this.privateNameStack.push(element); - return element.declared - }; + return false; + } - pp$8.exitClassBody = function() { - var ref = this.privateNameStack.pop(); - var declared = ref.declared; - var used = ref.used; - var len = this.privateNameStack.length; - var parent = len === 0 ? null : this.privateNameStack[len - 1]; - for (var i = 0; i < used.length; ++i) { - var id = used[i]; - if (!hasOwn(declared, id.name)) { - if (parent) { - parent.used.push(id); - } else { - this.raiseRecoverable(id.start, ("Private field '#" + (id.name) + "' must be declared in an enclosing class")); + static fromDirectory(dir, reporter) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + // read the manifest in this directory + const lockfileLoc = path.join(dir, (_constants || _load_constants()).LOCKFILE_FILENAME); + + let lockfile; + let rawLockfile = ''; + let parseResult; + + if (yield (_fs || _load_fs()).exists(lockfileLoc)) { + rawLockfile = yield (_fs || _load_fs()).readFile(lockfileLoc); + parseResult = (0, (_parse2 || _load_parse2()).default)(rawLockfile, lockfileLoc); + + if (reporter) { + if (parseResult.type === 'merge') { + reporter.info(reporter.lang('lockfileMerged')); + } else if (parseResult.type === 'conflict') { + reporter.warn(reporter.lang('lockfileConflict')); + } } + + lockfile = parseResult.object; + } else if (reporter) { + reporter.info(reporter.lang('noLockfileFound')); } - } - }; - function isPrivateNameConflicted(privateNameMap, element) { - var name = element.key.name; - var curr = privateNameMap[name]; + return new Lockfile({ cache: lockfile, source: rawLockfile, parseResultType: parseResult && parseResult.type }); + })(); + } - var next = "true"; - if (element.type === "MethodDefinition" && (element.kind === "get" || element.kind === "set")) { - next = (element.static ? "s" : "i") + element.kind; + getLocked(pattern) { + const cache = this.cache; + if (!cache) { + return undefined; } - // `class { get #a(){}; static set #a(_){} }` is also conflict. - if ( - curr === "iget" && next === "iset" || - curr === "iset" && next === "iget" || - curr === "sget" && next === "sset" || - curr === "sset" && next === "sget" - ) { - privateNameMap[name] = "true"; - return false - } else if (!curr) { - privateNameMap[name] = next; - return false - } else { - return true + const shrunk = pattern in cache && cache[pattern]; + + if (typeof shrunk === 'string') { + return this.getLocked(shrunk); + } else if (shrunk) { + explodeEntry(pattern, shrunk); + return shrunk; } + + return undefined; } - function checkKeyName(node, name) { - var computed = node.computed; - var key = node.key; - return !computed && ( - key.type === "Identifier" && key.name === name || - key.type === "Literal" && key.value === name - ) + removePattern(pattern) { + const cache = this.cache; + if (!cache) { + return; + } + delete cache[pattern]; } - // Parses module export declaration. + getLockfile(patterns) { + const lockfile = {}; + const seen = new Map(); - pp$8.parseExportAllDeclaration = function(node, exports) { - if (this.options.ecmaVersion >= 11) { - if (this.eatContextual("as")) { - node.exported = this.parseModuleExportName(); - this.checkExport(exports, node.exported, this.lastTokStart); + // order by name so that lockfile manifest is assigned to the first dependency with this manifest + // the others that have the same remoteKey will just refer to the first + // ordering allows for consistency in lockfile when it is serialized + const sortedPatternsKeys = Object.keys(patterns).sort((_misc || _load_misc()).sortAlpha); + + for (var _iterator = sortedPatternsKeys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; } else { - node.exported = null; + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; } - } - this.expectContextual("from"); - if (this.type !== types$1.string) { this.unexpected(); } - node.source = this.parseExprAtom(); - this.semicolon(); - return this.finishNode(node, "ExportAllDeclaration") - }; - pp$8.parseExport = function(node, exports) { - this.next(); - // export * from '...' - if (this.eat(types$1.star)) { - return this.parseExportAllDeclaration(node, exports) - } - if (this.eat(types$1._default)) { // export default ... - this.checkExport(exports, "default", this.lastTokStart); - node.declaration = this.parseExportDefaultDeclaration(); - return this.finishNode(node, "ExportDefaultDeclaration") - } - // export var|const|let|function|class ... - if (this.shouldParseExportStatement()) { - node.declaration = this.parseExportDeclaration(node); - if (node.declaration.type === "VariableDeclaration") - { this.checkVariableExport(exports, node.declaration.declarations); } - else - { this.checkExport(exports, node.declaration.id, node.declaration.id.start); } - node.specifiers = []; - node.source = null; - } else { // export { x, y as z } [from '...'] - node.declaration = null; - node.specifiers = this.parseExportSpecifiers(exports); - if (this.eatContextual("from")) { - if (this.type !== types$1.string) { this.unexpected(); } - node.source = this.parseExprAtom(); - } else { - for (var i = 0, list = node.specifiers; i < list.length; i += 1) { - // check for keywords used as local names - var spec = list[i]; + const pattern = _ref; - this.checkUnreserved(spec.local); - // check if export is defined - this.checkLocalExport(spec.local); + const pkg = patterns[pattern]; + const remote = pkg._remote, + ref = pkg._reference; - if (spec.local.type === "Literal") { - this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`."); - } + invariant(ref, 'Package is missing a reference'); + invariant(remote, 'Package is missing a remote'); + + const remoteKey = keyForRemote(remote); + const seenPattern = remoteKey && seen.get(remoteKey); + if (seenPattern) { + // no point in duplicating it + lockfile[pattern] = seenPattern; + + // if we're relying on our name being inferred and two of the patterns have + // different inferred names then we need to set it + if (!seenPattern.name && getName(pattern) !== pkg.name) { + seenPattern.name = pkg.name; } + continue; + } + const obj = implodeEntry(pattern, { + name: pkg.name, + version: pkg.version, + uid: pkg._uid, + resolved: remote.resolved, + integrity: remote.integrity, + registry: remote.registry, + dependencies: pkg.dependencies, + peerDependencies: pkg.peerDependencies, + optionalDependencies: pkg.optionalDependencies, + permissions: ref.permissions, + prebuiltVariants: pkg.prebuiltVariants + }); - node.source = null; + lockfile[pattern] = obj; + + if (remoteKey) { + seen.set(remoteKey, obj); } - this.semicolon(); } - return this.finishNode(node, "ExportNamedDeclaration") - }; - pp$8.parseExportDeclaration = function(node) { - return this.parseStatement(null) - }; + return lockfile; + } +} +exports.default = Lockfile; - pp$8.parseExportDefaultDeclaration = function() { - var isAsync; - if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) { - var fNode = this.startNode(); - this.next(); - if (isAsync) { this.next(); } - return this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync) - } else if (this.type === types$1._class) { - var cNode = this.startNode(); - return this.parseClass(cNode, "nullableID") - } else { - var declaration = this.parseMaybeAssign(); - this.semicolon(); - return declaration - } - }; +/***/ }), +/* 15 */, +/* 16 */, +/* 17 */ +/***/ (function(module, exports) { - pp$8.checkExport = function(exports, name, pos) { - if (!exports) { return } - if (typeof name !== "string") - { name = name.type === "Identifier" ? name.name : name.value; } - if (hasOwn(exports, name)) - { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); } - exports[name] = true; - }; +module.exports = __nccwpck_require__(12781); - pp$8.checkPatternExport = function(exports, pat) { - var type = pat.type; - if (type === "Identifier") - { this.checkExport(exports, pat, pat.start); } - else if (type === "ObjectPattern") - { for (var i = 0, list = pat.properties; i < list.length; i += 1) - { - var prop = list[i]; +/***/ }), +/* 18 */, +/* 19 */, +/* 20 */ +/***/ (function(module, exports, __nccwpck_require__) { - this.checkPatternExport(exports, prop); - } } - else if (type === "ArrayPattern") - { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) { - var elt = list$1[i$1]; +"use strict"; - if (elt) { this.checkPatternExport(exports, elt); } - } } - else if (type === "Property") - { this.checkPatternExport(exports, pat.value); } - else if (type === "AssignmentPattern") - { this.checkPatternExport(exports, pat.left); } - else if (type === "RestElement") - { this.checkPatternExport(exports, pat.argument); } - else if (type === "ParenthesizedExpression") - { this.checkPatternExport(exports, pat.expression); } - }; - pp$8.checkVariableExport = function(exports, decls) { - if (!exports) { return } - for (var i = 0, list = decls; i < list.length; i += 1) - { - var decl = list[i]; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = nullify; +function nullify(obj = {}) { + if (Array.isArray(obj)) { + for (var _iterator = obj, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } - this.checkPatternExport(exports, decl.id); + const item = _ref; + + nullify(item); } - }; + } else if (obj !== null && typeof obj === 'object' || typeof obj === 'function') { + Object.setPrototypeOf(obj, null); - pp$8.shouldParseExportStatement = function() { - return this.type.keyword === "var" || - this.type.keyword === "const" || - this.type.keyword === "class" || - this.type.keyword === "function" || - this.isLet() || - this.isAsyncFunction() - }; + // for..in can only be applied to 'object', not 'function' + if (typeof obj === 'object') { + for (const key in obj) { + nullify(obj[key]); + } + } + } - // Parses a comma-separated list of module exports. + return obj; +} - pp$8.parseExportSpecifier = function(exports) { - var node = this.startNode(); - node.local = this.parseModuleExportName(); +/***/ }), +/* 21 */, +/* 22 */ +/***/ (function(module, exports) { - node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local; - this.checkExport( - exports, - node.exported, - node.exported.start - ); +module.exports = __nccwpck_require__(39491); - return this.finishNode(node, "ExportSpecifier") - }; +/***/ }), +/* 23 */ +/***/ (function(module, exports) { - pp$8.parseExportSpecifiers = function(exports) { - var nodes = [], first = true; - // export { x, y as z } [from '...'] - this.expect(types$1.braceL); - while (!this.eat(types$1.braceR)) { - if (!first) { - this.expect(types$1.comma); - if (this.afterTrailingComma(types$1.braceR)) { break } - } else { first = false; } +var core = module.exports = { version: '2.5.7' }; +if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef - nodes.push(this.parseExportSpecifier(exports)); - } - return nodes - }; - // Parses import declaration. +/***/ }), +/* 24 */, +/* 25 */, +/* 26 */, +/* 27 */ +/***/ (function(module, exports, __nested_webpack_require_63175__) { + +var isObject = __nested_webpack_require_63175__(34); +module.exports = function (it) { + if (!isObject(it)) throw TypeError(it + ' is not an object!'); + return it; +}; - pp$8.parseImport = function(node) { - this.next(); - // import '...' - if (this.type === types$1.string) { - node.specifiers = empty$1; - node.source = this.parseExprAtom(); - } else { - node.specifiers = this.parseImportSpecifiers(); - this.expectContextual("from"); - node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected(); - } - this.semicolon(); - return this.finishNode(node, "ImportDeclaration") - }; +/***/ }), +/* 28 */, +/* 29 */ +/***/ (function(module, exports, __nccwpck_require__) { - // Parses a comma-separated list of module imports. +"use strict"; - pp$8.parseImportSpecifier = function() { - var node = this.startNode(); - node.imported = this.parseModuleExportName(); - if (this.eatContextual("as")) { - node.local = this.parseIdent(); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.normalizePattern = normalizePattern; + +/** + * Explode and normalize a pattern into its name and range. + */ + +function normalizePattern(pattern) { + let hasVersion = false; + let range = 'latest'; + let name = pattern; + + // if we're a scope then remove the @ and add it back later + let isScoped = false; + if (name[0] === '@') { + isScoped = true; + name = name.slice(1); + } + + // take first part as the name + const parts = name.split('@'); + if (parts.length > 1) { + name = parts.shift(); + range = parts.join('@'); + + if (range) { + hasVersion = true; } else { - this.checkUnreserved(node.imported); - node.local = node.imported; + range = '*'; } - this.checkLValSimple(node.local, BIND_LEXICAL); + } - return this.finishNode(node, "ImportSpecifier") - }; + // add back @ scope suffix + if (isScoped) { + name = `@${name}`; + } - pp$8.parseImportDefaultSpecifier = function() { - // import defaultObj, { x, y as z } from '...' - var node = this.startNode(); - node.local = this.parseIdent(); - this.checkLValSimple(node.local, BIND_LEXICAL); - return this.finishNode(node, "ImportDefaultSpecifier") - }; + return { name, range, hasVersion }; +} - pp$8.parseImportNamespaceSpecifier = function() { - var node = this.startNode(); - this.next(); - this.expectContextual("as"); - node.local = this.parseIdent(); - this.checkLValSimple(node.local, BIND_LEXICAL); - return this.finishNode(node, "ImportNamespaceSpecifier") - }; +/***/ }), +/* 30 */, +/* 31 */ +/***/ (function(module, exports, __nested_webpack_require_64321__) { + +var dP = __nested_webpack_require_64321__(50); +var createDesc = __nested_webpack_require_64321__(106); +module.exports = __nested_webpack_require_64321__(33) ? function (object, key, value) { + return dP.f(object, key, createDesc(1, value)); +} : function (object, key, value) { + object[key] = value; + return object; +}; - pp$8.parseImportSpecifiers = function() { - var nodes = [], first = true; - if (this.type === types$1.name) { - nodes.push(this.parseImportDefaultSpecifier()); - if (!this.eat(types$1.comma)) { return nodes } - } - if (this.type === types$1.star) { - nodes.push(this.parseImportNamespaceSpecifier()); - return nodes - } - this.expect(types$1.braceL); - while (!this.eat(types$1.braceR)) { - if (!first) { - this.expect(types$1.comma); - if (this.afterTrailingComma(types$1.braceR)) { break } - } else { first = false; } - nodes.push(this.parseImportSpecifier()); - } - return nodes - }; +/***/ }), +/* 32 */ +/***/ (function(module, exports, __nested_webpack_require_64680__) { - pp$8.parseModuleExportName = function() { - if (this.options.ecmaVersion >= 13 && this.type === types$1.string) { - var stringLiteral = this.parseLiteral(this.value); - if (loneSurrogate.test(stringLiteral.value)) { - this.raise(stringLiteral.start, "An export name cannot include a lone surrogate."); - } - return stringLiteral - } - return this.parseIdent(true) - }; +/* eslint-disable node/no-deprecated-api */ +var buffer = __nested_webpack_require_64680__(63) +var Buffer = buffer.Buffer - // Set `ExpressionStatement#directive` property for directive prologues. - pp$8.adaptDirectivePrologue = function(statements) { - for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) { - statements[i].directive = statements[i].expression.raw.slice(1, -1); - } - }; - pp$8.isDirectiveCandidate = function(statement) { - return ( - this.options.ecmaVersion >= 5 && - statement.type === "ExpressionStatement" && - statement.expression.type === "Literal" && - typeof statement.expression.value === "string" && - // Reject parenthesized strings. - (this.input[statement.start] === "\"" || this.input[statement.start] === "'") - ) - }; +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} - var pp$7 = Parser.prototype; +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} - // Convert existing expression atom to assignable pattern - // if possible. +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) - pp$7.toAssignable = function(node, isBinding, refDestructuringErrors) { - if (this.options.ecmaVersion >= 6 && node) { - switch (node.type) { - case "Identifier": - if (this.inAsync && node.name === "await") - { this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); } - break +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} - case "ObjectPattern": - case "ArrayPattern": - case "AssignmentPattern": - case "RestElement": - break +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf +} - case "ObjectExpression": - node.type = "ObjectPattern"; - if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } - for (var i = 0, list = node.properties; i < list.length; i += 1) { - var prop = list[i]; +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} - this.toAssignable(prop, isBinding); - // Early error: - // AssignmentRestProperty[Yield, Await] : - // `...` DestructuringAssignmentTarget[Yield, Await] - // - // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|. - if ( - prop.type === "RestElement" && - (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern") - ) { - this.raise(prop.argument.start, "Unexpected token"); - } - } - break +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} - case "Property": - // AssignmentProperty has type === "Property" - if (node.kind !== "init") { this.raise(node.key.start, "Object pattern can't contain getter or setter"); } - this.toAssignable(node.value, isBinding); - break - case "ArrayExpression": - node.type = "ArrayPattern"; - if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } - this.toAssignableList(node.elements, isBinding); - break +/***/ }), +/* 33 */ +/***/ (function(module, exports, __nested_webpack_require_66293__) { - case "SpreadElement": - node.type = "RestElement"; - this.toAssignable(node.argument, isBinding); - if (node.argument.type === "AssignmentPattern") - { this.raise(node.argument.start, "Rest elements cannot have a default value"); } - break +// Thank's IE8 for his funny defineProperty +module.exports = !__nested_webpack_require_66293__(85)(function () { + return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; +}); - case "AssignmentExpression": - if (node.operator !== "=") { this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); } - node.type = "AssignmentPattern"; - delete node.operator; - this.toAssignable(node.left, isBinding); - break - case "ParenthesizedExpression": - this.toAssignable(node.expression, isBinding, refDestructuringErrors); - break +/***/ }), +/* 34 */ +/***/ (function(module, exports) { - case "ChainExpression": - this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side"); - break +module.exports = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; - case "MemberExpression": - if (!isBinding) { break } - default: - this.raise(node.start, "Assigning to rvalue"); - } - } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } - return node - }; +/***/ }), +/* 35 */ +/***/ (function(module, exports) { - // Convert list of expression atoms to binding list. +module.exports = {}; - pp$7.toAssignableList = function(exprList, isBinding) { - var end = exprList.length; - for (var i = 0; i < end; i++) { - var elt = exprList[i]; - if (elt) { this.toAssignable(elt, isBinding); } - } - if (end) { - var last = exprList[end - 1]; - if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier") - { this.unexpected(last.argument.start); } - } - return exprList - }; - // Parses spread element. +/***/ }), +/* 36 */ +/***/ (function(module, exports) { - pp$7.parseSpread = function(refDestructuringErrors) { - var node = this.startNode(); - this.next(); - node.argument = this.parseMaybeAssign(false, refDestructuringErrors); - return this.finishNode(node, "SpreadElement") - }; +module.exports = __nccwpck_require__(22037); - pp$7.parseRestBinding = function() { - var node = this.startNode(); - this.next(); +/***/ }), +/* 37 */, +/* 38 */, +/* 39 */, +/* 40 */ +/***/ (function(module, exports, __nccwpck_require__) { - // RestElement inside of a function parameter must be an identifier - if (this.options.ecmaVersion === 6 && this.type !== types$1.name) - { this.unexpected(); } +"use strict"; - node.argument = this.parseBindingAtom(); - return this.finishNode(node, "RestElement") - }; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.wait = wait; +exports.promisify = promisify; +exports.queue = queue; +function wait(delay) { + return new Promise(resolve => { + setTimeout(resolve, delay); + }); +} - // Parses lvalue (assignable) atom. +function promisify(fn, firstData) { + return function (...args) { + return new Promise(function (resolve, reject) { + args.push(function (err, ...result) { + let res = result; - pp$7.parseBindingAtom = function() { - if (this.options.ecmaVersion >= 6) { - switch (this.type) { - case types$1.bracketL: - var node = this.startNode(); - this.next(); - node.elements = this.parseBindingList(types$1.bracketR, true, true); - return this.finishNode(node, "ArrayPattern") + if (result.length <= 1) { + res = result[0]; + } - case types$1.braceL: - return this.parseObj(true) - } - } - return this.parseIdent() - }; + if (firstData) { + res = err; + err = null; + } - pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma, allowModifiers) { - var elts = [], first = true; - while (!this.eat(close)) { - if (first) { first = false; } - else { this.expect(types$1.comma); } - if (allowEmpty && this.type === types$1.comma) { - elts.push(null); - } else if (allowTrailingComma && this.afterTrailingComma(close)) { - break - } else if (this.type === types$1.ellipsis) { - var rest = this.parseRestBinding(); - this.parseBindingListItem(rest); - elts.push(rest); - if (this.type === types$1.comma) { this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"); } - this.expect(close); - break - } else { - elts.push(this.parseAssignableListItem(allowModifiers)); - } - } - return elts - }; + if (err) { + reject(err); + } else { + resolve(res); + } + }); - pp$7.parseAssignableListItem = function(allowModifiers) { - var elem = this.parseMaybeDefault(this.start, this.startLoc); - this.parseBindingListItem(elem); - return elem + fn.apply(null, args); + }); }; +} - pp$7.parseBindingListItem = function(param) { - return param - }; +function queue(arr, promiseProducer, concurrency = Infinity) { + concurrency = Math.min(concurrency, arr.length); - // Parses assignment pattern around given atom if possible. + // clone + arr = arr.slice(); - pp$7.parseMaybeDefault = function(startPos, startLoc, left) { - left = left || this.parseBindingAtom(); - if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) { return left } - var node = this.startNodeAt(startPos, startLoc); - node.left = left; - node.right = this.parseMaybeAssign(); - return this.finishNode(node, "AssignmentPattern") - }; + const results = []; + let total = arr.length; + if (!total) { + return Promise.resolve(results); + } - // The following three functions all verify that a node is an lvalue — - // something that can be bound, or assigned to. In order to do so, they perform - // a variety of checks: - // - // - Check that none of the bound/assigned-to identifiers are reserved words. - // - Record name declarations for bindings in the appropriate scope. - // - Check duplicate argument names, if checkClashes is set. - // - // If a complex binding pattern is encountered (e.g., object and array - // destructuring), the entire pattern is recursively checked. - // - // There are three versions of checkLVal*() appropriate for different - // circumstances: - // - // - checkLValSimple() shall be used if the syntactic construct supports - // nothing other than identifiers and member expressions. Parenthesized - // expressions are also correctly handled. This is generally appropriate for - // constructs for which the spec says - // - // > It is a Syntax Error if AssignmentTargetType of [the production] is not - // > simple. - // - // It is also appropriate for checking if an identifier is valid and not - // defined elsewhere, like import declarations or function/class identifiers. - // - // Examples where this is used include: - // a += …; - // import a from '…'; - // where a is the node to be checked. - // - // - checkLValPattern() shall be used if the syntactic construct supports - // anything checkLValSimple() supports, as well as object and array - // destructuring patterns. This is generally appropriate for constructs for - // which the spec says - // - // > It is a Syntax Error if [the production] is neither an ObjectLiteral nor - // > an ArrayLiteral and AssignmentTargetType of [the production] is not - // > simple. - // - // Examples where this is used include: - // (a = …); - // const a = …; - // try { … } catch (a) { … } - // where a is the node to be checked. - // - // - checkLValInnerPattern() shall be used if the syntactic construct supports - // anything checkLValPattern() supports, as well as default assignment - // patterns, rest elements, and other constructs that may appear within an - // object or array destructuring pattern. - // - // As a special case, function parameters also use checkLValInnerPattern(), - // as they also support defaults and rest constructs. - // - // These functions deliberately support both assignment and binding constructs, - // as the logic for both is exceedingly similar. If the node is the target of - // an assignment, then bindingType should be set to BIND_NONE. Otherwise, it - // should be set to the appropriate BIND_* constant, like BIND_VAR or - // BIND_LEXICAL. - // - // If the function is called with a non-BIND_NONE bindingType, then - // additionally a checkClashes object may be specified to allow checking for - // duplicate argument names. checkClashes is ignored if the provided construct - // is an assignment (i.e., bindingType is BIND_NONE). + return new Promise((resolve, reject) => { + for (let i = 0; i < concurrency; i++) { + next(); + } - pp$7.checkLValSimple = function(expr, bindingType, checkClashes) { - if ( bindingType === void 0 ) bindingType = BIND_NONE; + function next() { + const item = arr.shift(); + const promise = promiseProducer(item); - var isBind = bindingType !== BIND_NONE; + promise.then(function (result) { + results.push(result); - switch (expr.type) { - case "Identifier": - if (this.strict && this.reservedWordsStrictBind.test(expr.name)) - { this.raiseRecoverable(expr.start, (isBind ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); } - if (isBind) { - if (bindingType === BIND_LEXICAL && expr.name === "let") - { this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); } - if (checkClashes) { - if (hasOwn(checkClashes, expr.name)) - { this.raiseRecoverable(expr.start, "Argument name clash"); } - checkClashes[expr.name] = true; + total--; + if (total === 0) { + resolve(results); + } else { + if (arr.length) { + next(); + } } - if (bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); } - } - break + }, reject); + } + }); +} - case "ChainExpression": - this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side"); - break +/***/ }), +/* 41 */ +/***/ (function(module, exports, __nested_webpack_require_68465__) { + +var global = __nested_webpack_require_68465__(11); +var core = __nested_webpack_require_68465__(23); +var ctx = __nested_webpack_require_68465__(48); +var hide = __nested_webpack_require_68465__(31); +var has = __nested_webpack_require_68465__(49); +var PROTOTYPE = 'prototype'; + +var $export = function (type, name, source) { + var IS_FORCED = type & $export.F; + var IS_GLOBAL = type & $export.G; + var IS_STATIC = type & $export.S; + var IS_PROTO = type & $export.P; + var IS_BIND = type & $export.B; + var IS_WRAP = type & $export.W; + var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); + var expProto = exports[PROTOTYPE]; + var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]; + var key, own, out; + if (IS_GLOBAL) source = name; + for (key in source) { + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + if (own && has(exports, key)) continue; + // export native or passed + out = own ? target[key] : source[key]; + // prevent global pollution for namespaces + exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] + // bind timers to global for call from export context + : IS_BIND && own ? ctx(out, global) + // wrap global constructors for prevent change them in library + : IS_WRAP && target[key] == out ? (function (C) { + var F = function (a, b, c) { + if (this instanceof C) { + switch (arguments.length) { + case 0: return new C(); + case 1: return new C(a); + case 2: return new C(a, b); + } return new C(a, b, c); + } return C.apply(this, arguments); + }; + F[PROTOTYPE] = C[PROTOTYPE]; + return F; + // make static versions for prototype methods + })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% + if (IS_PROTO) { + (exports.virtual || (exports.virtual = {}))[key] = out; + // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% + if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out); + } + } +}; +// type bitmap +$export.F = 1; // forced +$export.G = 2; // global +$export.S = 4; // static +$export.P = 8; // proto +$export.B = 16; // bind +$export.W = 32; // wrap +$export.U = 64; // safe +$export.R = 128; // real proto method for `library` +module.exports = $export; - case "MemberExpression": - if (isBind) { this.raiseRecoverable(expr.start, "Binding member expression"); } - break - case "ParenthesizedExpression": - if (isBind) { this.raiseRecoverable(expr.start, "Binding parenthesized expression"); } - return this.checkLValSimple(expr.expression, bindingType, checkClashes) +/***/ }), +/* 42 */ +/***/ (function(module, exports, __nested_webpack_require_70917__) { - default: - this.raise(expr.start, (isBind ? "Binding" : "Assigning to") + " rvalue"); - } - }; +try { + var util = __nested_webpack_require_70917__(2); + if (typeof util.inherits !== 'function') throw ''; + module.exports = util.inherits; +} catch (e) { + module.exports = __nested_webpack_require_70917__(224); +} - pp$7.checkLValPattern = function(expr, bindingType, checkClashes) { - if ( bindingType === void 0 ) bindingType = BIND_NONE; - switch (expr.type) { - case "ObjectPattern": - for (var i = 0, list = expr.properties; i < list.length; i += 1) { - var prop = list[i]; +/***/ }), +/* 43 */, +/* 44 */, +/* 45 */ +/***/ (function(module, exports, __nested_webpack_require_71206__) { - this.checkLValInnerPattern(prop, bindingType, checkClashes); - } - break +"use strict"; - case "ArrayPattern": - for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) { - var elem = list$1[i$1]; - if (elem) { this.checkLValInnerPattern(elem, bindingType, checkClashes); } - } - break +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.home = undefined; - default: - this.checkLValSimple(expr, bindingType, checkClashes); - } - }; +var _rootUser; - pp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) { - if ( bindingType === void 0 ) bindingType = BIND_NONE; +function _load_rootUser() { + return _rootUser = _interopRequireDefault(__nested_webpack_require_71206__(169)); +} - switch (expr.type) { - case "Property": - // AssignmentProperty has type === "Property" - this.checkLValInnerPattern(expr.value, bindingType, checkClashes); - break +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - case "AssignmentPattern": - this.checkLValPattern(expr.left, bindingType, checkClashes); - break +const path = __nested_webpack_require_71206__(0); - case "RestElement": - this.checkLValPattern(expr.argument, bindingType, checkClashes); - break +const home = exports.home = __nested_webpack_require_71206__(36).homedir(); - default: - this.checkLValPattern(expr, bindingType, checkClashes); - } - }; +const userHomeDir = (_rootUser || _load_rootUser()).default ? path.resolve('/usr/local/share') : home; - // The algorithm used to determine whether a regexp can appear at a - // given point in the program is loosely based on sweet.js' approach. - // See https://github.com/mozilla/sweet.js/wiki/design +exports.default = userHomeDir; +/***/ }), +/* 46 */ +/***/ (function(module, exports) { - var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) { - this.token = token; - this.isExpr = !!isExpr; - this.preserveSpace = !!preserveSpace; - this.override = override; - this.generator = !!generator; - }; +module.exports = function (it) { + if (typeof it != 'function') throw TypeError(it + ' is not a function!'); + return it; +}; - var types = { - b_stat: new TokContext("{", false), - b_expr: new TokContext("{", true), - b_tmpl: new TokContext("${", false), - p_stat: new TokContext("(", false), - p_expr: new TokContext("(", true), - q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }), - f_stat: new TokContext("function", false), - f_expr: new TokContext("function", true), - f_expr_gen: new TokContext("function", true, false, null, true), - f_gen: new TokContext("function", false, false, null, true) - }; - var pp$6 = Parser.prototype; +/***/ }), +/* 47 */ +/***/ (function(module, exports) { - pp$6.initialContext = function() { - return [types.b_stat] - }; +var toString = {}.toString; - pp$6.curContext = function() { - return this.context[this.context.length - 1] - }; +module.exports = function (it) { + return toString.call(it).slice(8, -1); +}; - pp$6.braceIsBlock = function(prevType) { - var parent = this.curContext(); - if (parent === types.f_expr || parent === types.f_stat) - { return true } - if (prevType === types$1.colon && (parent === types.b_stat || parent === types.b_expr)) - { return !parent.isExpr } - // The check for `tt.name && exprAllowed` detects whether we are - // after a `yield` or `of` construct. See the `updateContext` for - // `tt.name`. - if (prevType === types$1._return || prevType === types$1.name && this.exprAllowed) - { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) } - if (prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow) - { return true } - if (prevType === types$1.braceL) - { return parent === types.b_stat } - if (prevType === types$1._var || prevType === types$1._const || prevType === types$1.name) - { return false } - return !this.exprAllowed +/***/ }), +/* 48 */ +/***/ (function(module, exports, __nested_webpack_require_72188__) { + +// optional / simple context binding +var aFunction = __nested_webpack_require_72188__(46); +module.exports = function (fn, that, length) { + aFunction(fn); + if (that === undefined) return fn; + switch (length) { + case 1: return function (a) { + return fn.call(that, a); + }; + case 2: return function (a, b) { + return fn.call(that, a, b); + }; + case 3: return function (a, b, c) { + return fn.call(that, a, b, c); + }; + } + return function (/* ...args */) { + return fn.apply(that, arguments); }; +}; - pp$6.inGeneratorContext = function() { - for (var i = this.context.length - 1; i >= 1; i--) { - var context = this.context[i]; - if (context.token === "function") - { return context.generator } - } - return false - }; - pp$6.updateContext = function(prevType) { - var update, type = this.type; - if (type.keyword && prevType === types$1.dot) - { this.exprAllowed = false; } - else if (update = type.updateContext) - { update.call(this, prevType); } - else - { this.exprAllowed = type.beforeExpr; } - }; +/***/ }), +/* 49 */ +/***/ (function(module, exports) { - // Used to handle egde cases when token context could not be inferred correctly during tokenization phase +var hasOwnProperty = {}.hasOwnProperty; +module.exports = function (it, key) { + return hasOwnProperty.call(it, key); +}; - pp$6.overrideContext = function(tokenCtx) { - if (this.curContext() !== tokenCtx) { - this.context[this.context.length - 1] = tokenCtx; - } - }; - // Token-specific context update code +/***/ }), +/* 50 */ +/***/ (function(module, exports, __nested_webpack_require_72962__) { + +var anObject = __nested_webpack_require_72962__(27); +var IE8_DOM_DEFINE = __nested_webpack_require_72962__(184); +var toPrimitive = __nested_webpack_require_72962__(201); +var dP = Object.defineProperty; + +exports.f = __nested_webpack_require_72962__(33) ? Object.defineProperty : function defineProperty(O, P, Attributes) { + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if (IE8_DOM_DEFINE) try { + return dP(O, P, Attributes); + } catch (e) { /* empty */ } + if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); + if ('value' in Attributes) O[P] = Attributes.value; + return O; +}; - types$1.parenR.updateContext = types$1.braceR.updateContext = function() { - if (this.context.length === 1) { - this.exprAllowed = true; - return - } - var out = this.context.pop(); - if (out === types.b_stat && this.curContext().token === "function") { - out = this.context.pop(); - } - this.exprAllowed = !out.isExpr; - }; - - types$1.braceL.updateContext = function(prevType) { - this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr); - this.exprAllowed = true; - }; - - types$1.dollarBraceL.updateContext = function() { - this.context.push(types.b_tmpl); - this.exprAllowed = true; - }; - - types$1.parenL.updateContext = function(prevType) { - var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while; - this.context.push(statementParens ? types.p_stat : types.p_expr); - this.exprAllowed = true; - }; - types$1.incDec.updateContext = function() { - // tokExprAllowed stays unchanged - }; +/***/ }), +/* 51 */, +/* 52 */, +/* 53 */, +/* 54 */ +/***/ (function(module, exports) { - types$1._function.updateContext = types$1._class.updateContext = function(prevType) { - if (prevType.beforeExpr && prevType !== types$1._else && - !(prevType === types$1.semi && this.curContext() !== types.p_stat) && - !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && - !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types.b_stat)) - { this.context.push(types.f_expr); } - else - { this.context.push(types.f_stat); } - this.exprAllowed = false; - }; +module.exports = __nccwpck_require__(82361); - types$1.backQuote.updateContext = function() { - if (this.curContext() === types.q_tmpl) - { this.context.pop(); } - else - { this.context.push(types.q_tmpl); } - this.exprAllowed = false; - }; +/***/ }), +/* 55 */ +/***/ (function(module, exports, __nested_webpack_require_73754__) { - types$1.star.updateContext = function(prevType) { - if (prevType === types$1._function) { - var index = this.context.length - 1; - if (this.context[index] === types.f_expr) - { this.context[index] = types.f_expr_gen; } - else - { this.context[index] = types.f_gen; } - } - this.exprAllowed = true; - }; +"use strict"; - types$1.name.updateContext = function(prevType) { - var allowed = false; - if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) { - if (this.value === "of" && !this.exprAllowed || - this.value === "yield" && this.inGeneratorContext()) - { allowed = true; } - } - this.exprAllowed = allowed; - }; - // A recursive descent parser operates by defining functions for all - // syntactic elements, and recursively calling those, each function - // advancing the input stream and returning an AST node. Precedence - // of constructs (for example, the fact that `!x[1]` means `!(x[1])` - // instead of `(!x)[1]` is handled by the fact that the parser - // function that parses unary prefix operators is called first, and - // in turn calls the function that parses `[]` subscripts — that - // way, it'll receive the node for `x[1]` already parsed, and wraps - // *that* in the unary operator node. - // - // Acorn uses an [operator precedence parser][opp] to handle binary - // operator precedence, because it is much more compact than using - // the technique outlined above, which uses different, nesting - // functions to specify precedence, for all of the ten binary - // precedence levels that JavaScript defines. - // - // [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser +const Buffer = __nested_webpack_require_73754__(32).Buffer +const crypto = __nested_webpack_require_73754__(9) +const Transform = __nested_webpack_require_73754__(17).Transform - var pp$5 = Parser.prototype; +const SPEC_ALGORITHMS = ['sha256', 'sha384', 'sha512'] - // Check if property name clashes with already added. - // Object/class getters and setters are not allowed to clash — - // either with each other or with an init property — and in - // strict mode, init properties are also not allowed to be repeated. +const BASE64_REGEX = /^[a-z0-9+/]+(?:=?=?)$/i +const SRI_REGEX = /^([^-]+)-([^?]+)([?\S*]*)$/ +const STRICT_SRI_REGEX = /^([^-]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)*$/ +const VCHAR_REGEX = /^[\x21-\x7E]+$/ - pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) { - if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") - { return } - if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) - { return } - var key = prop.key; - var name; - switch (key.type) { - case "Identifier": name = key.name; break - case "Literal": name = String(key.value); break - default: return - } - var kind = prop.kind; - if (this.options.ecmaVersion >= 6) { - if (name === "__proto__" && kind === "init") { - if (propHash.proto) { - if (refDestructuringErrors) { - if (refDestructuringErrors.doubleProto < 0) { - refDestructuringErrors.doubleProto = key.start; - } - } else { - this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); - } - } - propHash.proto = true; - } - return - } - name = "$" + name; - var other = propHash[name]; - if (other) { - var redefinition; - if (kind === "init") { - redefinition = this.strict && other.init || other.get || other.set; - } else { - redefinition = other.init || other[kind]; +class Hash { + get isHash () { return true } + constructor (hash, opts) { + const strict = !!(opts && opts.strict) + this.source = hash.trim() + // 3.1. Integrity metadata (called "Hash" by ssri) + // https://w3c.github.io/webappsec-subresource-integrity/#integrity-metadata-description + const match = this.source.match( + strict + ? STRICT_SRI_REGEX + : SRI_REGEX + ) + if (!match) { return } + if (strict && !SPEC_ALGORITHMS.some(a => a === match[1])) { return } + this.algorithm = match[1] + this.digest = match[2] + + const rawOpts = match[3] + this.options = rawOpts ? rawOpts.slice(1).split('?') : [] + } + hexDigest () { + return this.digest && Buffer.from(this.digest, 'base64').toString('hex') + } + toJSON () { + return this.toString() + } + toString (opts) { + if (opts && opts.strict) { + // Strict mode enforces the standard as close to the foot of the + // letter as it can. + if (!( + // The spec has very restricted productions for algorithms. + // https://www.w3.org/TR/CSP2/#source-list-syntax + SPEC_ALGORITHMS.some(x => x === this.algorithm) && + // Usually, if someone insists on using a "different" base64, we + // leave it as-is, since there's multiple standards, and the + // specified is not a URL-safe variant. + // https://www.w3.org/TR/CSP2/#base64_value + this.digest.match(BASE64_REGEX) && + // Option syntax is strictly visual chars. + // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-option-expression + // https://tools.ietf.org/html/rfc5234#appendix-B.1 + (this.options || []).every(opt => opt.match(VCHAR_REGEX)) + )) { + return '' } - if (redefinition) - { this.raiseRecoverable(key.start, "Redefinition of property"); } - } else { - other = propHash[name] = { - init: false, - get: false, - set: false - }; } - other[kind] = true; - }; - - // ### Expression parsing + const options = this.options && this.options.length + ? `?${this.options.join('?')}` + : '' + return `${this.algorithm}-${this.digest}${options}` + } +} - // These nest, from the most general expression type at the top to - // 'atomic', nondivisible expression types at the bottom. Most of - // the functions will simply let the function(s) below them parse, - // and, *if* the syntactic construct they handle is present, wrap - // the AST node that the inner parser gave them in another node. +class Integrity { + get isIntegrity () { return true } + toJSON () { + return this.toString() + } + toString (opts) { + opts = opts || {} + let sep = opts.sep || ' ' + if (opts.strict) { + // Entries must be separated by whitespace, according to spec. + sep = sep.replace(/\S+/g, ' ') + } + return Object.keys(this).map(k => { + return this[k].map(hash => { + return Hash.prototype.toString.call(hash, opts) + }).filter(x => x.length).join(sep) + }).filter(x => x.length).join(sep) + } + concat (integrity, opts) { + const other = typeof integrity === 'string' + ? integrity + : stringify(integrity, opts) + return parse(`${this.toString(opts)} ${other}`, opts) + } + hexDigest () { + return parse(this, {single: true}).hexDigest() + } + match (integrity, opts) { + const other = parse(integrity, opts) + const algo = other.pickAlgorithm(opts) + return ( + this[algo] && + other[algo] && + this[algo].find(hash => + other[algo].find(otherhash => + hash.digest === otherhash.digest + ) + ) + ) || false + } + pickAlgorithm (opts) { + const pickAlgorithm = (opts && opts.pickAlgorithm) || getPrioritizedHash + const keys = Object.keys(this) + if (!keys.length) { + throw new Error(`No algorithms available for ${ + JSON.stringify(this.toString()) + }`) + } + return keys.reduce((acc, algo) => { + return pickAlgorithm(acc, algo) || acc + }) + } +} - // Parse a full expression. The optional arguments are used to - // forbid the `in` operator (in for loops initalization expressions) - // and provide reference for storing '=' operator inside shorthand - // property assignment in contexts where both object expression - // and object pattern might appear (so it's possible to raise - // delayed syntax error at correct position). +module.exports.parse = parse +function parse (sri, opts) { + opts = opts || {} + if (typeof sri === 'string') { + return _parse(sri, opts) + } else if (sri.algorithm && sri.digest) { + const fullSri = new Integrity() + fullSri[sri.algorithm] = [sri] + return _parse(stringify(fullSri, opts), opts) + } else { + return _parse(stringify(sri, opts), opts) + } +} - pp$5.parseExpression = function(forInit, refDestructuringErrors) { - var startPos = this.start, startLoc = this.startLoc; - var expr = this.parseMaybeAssign(forInit, refDestructuringErrors); - if (this.type === types$1.comma) { - var node = this.startNodeAt(startPos, startLoc); - node.expressions = [expr]; - while (this.eat(types$1.comma)) { node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); } - return this.finishNode(node, "SequenceExpression") +function _parse (integrity, opts) { + // 3.4.3. Parse metadata + // https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata + if (opts.single) { + return new Hash(integrity, opts) + } + return integrity.trim().split(/\s+/).reduce((acc, string) => { + const hash = new Hash(string, opts) + if (hash.algorithm && hash.digest) { + const algo = hash.algorithm + if (!acc[algo]) { acc[algo] = [] } + acc[algo].push(hash) } - return expr - }; + return acc + }, new Integrity()) +} - // Parse an assignment expression. This includes applications of - // operators like `+=`. +module.exports.stringify = stringify +function stringify (obj, opts) { + if (obj.algorithm && obj.digest) { + return Hash.prototype.toString.call(obj, opts) + } else if (typeof obj === 'string') { + return stringify(parse(obj, opts), opts) + } else { + return Integrity.prototype.toString.call(obj, opts) + } +} - pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) { - if (this.isContextual("yield")) { - if (this.inGenerator) { return this.parseYield(forInit) } - // The tokenizer will assume an expression is allowed after - // `yield`, but this isn't that kind of yield - else { this.exprAllowed = false; } +module.exports.fromHex = fromHex +function fromHex (hexDigest, algorithm, opts) { + const optString = (opts && opts.options && opts.options.length) + ? `?${opts.options.join('?')}` + : '' + return parse( + `${algorithm}-${ + Buffer.from(hexDigest, 'hex').toString('base64') + }${optString}`, opts + ) +} + +module.exports.fromData = fromData +function fromData (data, opts) { + opts = opts || {} + const algorithms = opts.algorithms || ['sha512'] + const optString = opts.options && opts.options.length + ? `?${opts.options.join('?')}` + : '' + return algorithms.reduce((acc, algo) => { + const digest = crypto.createHash(algo).update(data).digest('base64') + const hash = new Hash( + `${algo}-${digest}${optString}`, + opts + ) + if (hash.algorithm && hash.digest) { + const algo = hash.algorithm + if (!acc[algo]) { acc[algo] = [] } + acc[algo].push(hash) } + return acc + }, new Integrity()) +} - var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1; - if (refDestructuringErrors) { - oldParenAssign = refDestructuringErrors.parenthesizedAssign; - oldTrailingComma = refDestructuringErrors.trailingComma; - oldDoubleProto = refDestructuringErrors.doubleProto; - refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1; +module.exports.fromStream = fromStream +function fromStream (stream, opts) { + opts = opts || {} + const P = opts.Promise || Promise + const istream = integrityStream(opts) + return new P((resolve, reject) => { + stream.pipe(istream) + stream.on('error', reject) + istream.on('error', reject) + let sri + istream.on('integrity', s => { sri = s }) + istream.on('end', () => resolve(sri)) + istream.on('data', () => {}) + }) +} + +module.exports.checkData = checkData +function checkData (data, sri, opts) { + opts = opts || {} + sri = parse(sri, opts) + if (!Object.keys(sri).length) { + if (opts.error) { + throw Object.assign( + new Error('No valid integrity hashes to check against'), { + code: 'EINTEGRITY' + } + ) } else { - refDestructuringErrors = new DestructuringErrors; - ownDestructuringErrors = true; + return false } + } + const algorithm = sri.pickAlgorithm(opts) + const digest = crypto.createHash(algorithm).update(data).digest('base64') + const newSri = parse({algorithm, digest}) + const match = newSri.match(sri, opts) + if (match || !opts.error) { + return match + } else if (typeof opts.size === 'number' && (data.length !== opts.size)) { + const err = new Error(`data size mismatch when checking ${sri}.\n Wanted: ${opts.size}\n Found: ${data.length}`) + err.code = 'EBADSIZE' + err.found = data.length + err.expected = opts.size + err.sri = sri + throw err + } else { + const err = new Error(`Integrity checksum failed when using ${algorithm}: Wanted ${sri}, but got ${newSri}. (${data.length} bytes)`) + err.code = 'EINTEGRITY' + err.found = newSri + err.expected = sri + err.algorithm = algorithm + err.sri = sri + throw err + } +} - var startPos = this.start, startLoc = this.startLoc; - if (this.type === types$1.parenL || this.type === types$1.name) { - this.potentialArrowAt = this.start; - this.potentialArrowInForAwait = forInit === "await"; - } - var left = this.parseMaybeConditional(forInit, refDestructuringErrors); - if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); } - if (this.type.isAssign) { - var node = this.startNodeAt(startPos, startLoc); - node.operator = this.value; - if (this.type === types$1.eq) - { left = this.toAssignable(left, false, refDestructuringErrors); } - if (!ownDestructuringErrors) { - refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1; - } - if (refDestructuringErrors.shorthandAssign >= left.start) - { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly - if (this.type === types$1.eq) - { this.checkLValPattern(left); } - else - { this.checkLValSimple(left); } - node.left = left; - this.next(); - node.right = this.parseMaybeAssign(forInit); - if (oldDoubleProto > -1) { refDestructuringErrors.doubleProto = oldDoubleProto; } - return this.finishNode(node, "AssignmentExpression") +module.exports.checkStream = checkStream +function checkStream (stream, sri, opts) { + opts = opts || {} + const P = opts.Promise || Promise + const checker = integrityStream(Object.assign({}, opts, { + integrity: sri + })) + return new P((resolve, reject) => { + stream.pipe(checker) + stream.on('error', reject) + checker.on('error', reject) + let sri + checker.on('verified', s => { sri = s }) + checker.on('end', () => resolve(sri)) + checker.on('data', () => {}) + }) +} + +module.exports.integrityStream = integrityStream +function integrityStream (opts) { + opts = opts || {} + // For verification + const sri = opts.integrity && parse(opts.integrity, opts) + const goodSri = sri && Object.keys(sri).length + const algorithm = goodSri && sri.pickAlgorithm(opts) + const digests = goodSri && sri[algorithm] + // Calculating stream + const algorithms = Array.from( + new Set( + (opts.algorithms || ['sha512']) + .concat(algorithm ? [algorithm] : []) + ) + ) + const hashes = algorithms.map(crypto.createHash) + let streamSize = 0 + const stream = new Transform({ + transform (chunk, enc, cb) { + streamSize += chunk.length + hashes.forEach(h => h.update(chunk, enc)) + cb(null, chunk, enc) + } + }).on('end', () => { + const optString = (opts.options && opts.options.length) + ? `?${opts.options.join('?')}` + : '' + const newSri = parse(hashes.map((h, i) => { + return `${algorithms[i]}-${h.digest('base64')}${optString}` + }).join(' '), opts) + // Integrity verification mode + const match = goodSri && newSri.match(sri, opts) + if (typeof opts.size === 'number' && streamSize !== opts.size) { + const err = new Error(`stream size mismatch when checking ${sri}.\n Wanted: ${opts.size}\n Found: ${streamSize}`) + err.code = 'EBADSIZE' + err.found = streamSize + err.expected = opts.size + err.sri = sri + stream.emit('error', err) + } else if (opts.integrity && !match) { + const err = new Error(`${sri} integrity checksum failed when using ${algorithm}: wanted ${digests} but got ${newSri}. (${streamSize} bytes)`) + err.code = 'EINTEGRITY' + err.found = newSri + err.expected = digests + err.algorithm = algorithm + err.sri = sri + stream.emit('error', err) } else { - if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); } + stream.emit('size', streamSize) + stream.emit('integrity', newSri) + match && stream.emit('verified', match) } - if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; } - if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; } - return left - }; + }) + return stream +} - // Parse a ternary conditional (`?:`) operator. +module.exports.create = createIntegrity +function createIntegrity (opts) { + opts = opts || {} + const algorithms = opts.algorithms || ['sha512'] + const optString = opts.options && opts.options.length + ? `?${opts.options.join('?')}` + : '' - pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) { - var startPos = this.start, startLoc = this.startLoc; - var expr = this.parseExprOps(forInit, refDestructuringErrors); - if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } - if (this.eat(types$1.question)) { - var node = this.startNodeAt(startPos, startLoc); - node.test = expr; - node.consequent = this.parseMaybeAssign(); - this.expect(types$1.colon); - node.alternate = this.parseMaybeAssign(forInit); - return this.finishNode(node, "ConditionalExpression") + const hashes = algorithms.map(crypto.createHash) + + return { + update: function (chunk, enc) { + hashes.forEach(h => h.update(chunk, enc)) + return this + }, + digest: function (enc) { + const integrity = algorithms.reduce((acc, algo) => { + const digest = hashes.shift().digest('base64') + const hash = new Hash( + `${algo}-${digest}${optString}`, + opts + ) + if (hash.algorithm && hash.digest) { + const algo = hash.algorithm + if (!acc[algo]) { acc[algo] = [] } + acc[algo].push(hash) + } + return acc + }, new Integrity()) + + return integrity } - return expr - }; + } +} - // Start the precedence parser. +const NODE_HASHES = new Set(crypto.getHashes()) - pp$5.parseExprOps = function(forInit, refDestructuringErrors) { - var startPos = this.start, startLoc = this.startLoc; - var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit); - if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } - return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, forInit) - }; +// This is a Best Effort™ at a reasonable priority for hash algos +const DEFAULT_PRIORITY = [ + 'md5', 'whirlpool', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512', + // TODO - it's unclear _which_ of these Node will actually use as its name + // for the algorithm, so we guesswork it based on the OpenSSL names. + 'sha3', + 'sha3-256', 'sha3-384', 'sha3-512', + 'sha3_256', 'sha3_384', 'sha3_512' +].filter(algo => NODE_HASHES.has(algo)) - // Parse binary operators with the operator precedence parsing - // algorithm. `left` is the left-hand side of the operator. - // `minPrec` provides context that allows the function to stop and - // defer further parser to one of its callers when it encounters an - // operator that has a lower precedence than the set it is parsing. +function getPrioritizedHash (algo1, algo2) { + return DEFAULT_PRIORITY.indexOf(algo1.toLowerCase()) >= DEFAULT_PRIORITY.indexOf(algo2.toLowerCase()) + ? algo1 + : algo2 +} - pp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) { - var prec = this.type.binop; - if (prec != null && (!forInit || this.type !== types$1._in)) { - if (prec > minPrec) { - var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND; - var coalesce = this.type === types$1.coalesce; - if (coalesce) { - // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions. - // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error. - prec = types$1.logicalAND.binop; - } - var op = this.value; - this.next(); - var startPos = this.start, startLoc = this.startLoc; - var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit); - var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce); - if ((logical && this.type === types$1.coalesce) || (coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND))) { - this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"); - } - return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit) - } - } - return left - }; - pp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) { - if (right.type === "PrivateIdentifier") { this.raise(right.start, "Private identifier can only be left side of binary expression"); } - var node = this.startNodeAt(startPos, startLoc); - node.left = left; - node.operator = op; - node.right = right; - return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression") - }; +/***/ }), +/* 56 */, +/* 57 */, +/* 58 */, +/* 59 */, +/* 60 */ +/***/ (function(module, exports, __nested_webpack_require_85443__) { - // Parse unary operators, both prefix and postfix. +module.exports = minimatch +minimatch.Minimatch = Minimatch - pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) { - var startPos = this.start, startLoc = this.startLoc, expr; - if (this.isContextual("await") && this.canAwait) { - expr = this.parseAwait(forInit); - sawUnary = true; - } else if (this.type.prefix) { - var node = this.startNode(), update = this.type === types$1.incDec; - node.operator = this.value; - node.prefix = true; - this.next(); - node.argument = this.parseMaybeUnary(null, true, update, forInit); - this.checkExpressionErrors(refDestructuringErrors, true); - if (update) { this.checkLValSimple(node.argument); } - else if (this.strict && node.operator === "delete" && - node.argument.type === "Identifier") - { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); } - else if (node.operator === "delete" && isPrivateFieldAccess(node.argument)) - { this.raiseRecoverable(node.start, "Private fields can not be deleted"); } - else { sawUnary = true; } - expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); - } else if (!sawUnary && this.type === types$1.privateId) { - if (forInit || this.privateNameStack.length === 0) { this.unexpected(); } - expr = this.parsePrivateIdent(); - // only could be private fields in 'in', such as #x in obj - if (this.type !== types$1._in) { this.unexpected(); } - } else { - expr = this.parseExprSubscripts(refDestructuringErrors, forInit); - if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } - while (this.type.postfix && !this.canInsertSemicolon()) { - var node$1 = this.startNodeAt(startPos, startLoc); - node$1.operator = this.value; - node$1.prefix = false; - node$1.argument = expr; - this.checkLValSimple(expr); - this.next(); - expr = this.finishNode(node$1, "UpdateExpression"); - } - } +var path = { sep: '/' } +try { + path = __nested_webpack_require_85443__(0) +} catch (er) {} - if (!incDec && this.eat(types$1.starstar)) { - if (sawUnary) - { this.unexpected(this.lastTokStart); } - else - { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), "**", false) } - } else { - return expr - } - }; +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} +var expand = __nested_webpack_require_85443__(175) - function isPrivateFieldAccess(node) { - return ( - node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" || - node.type === "ChainExpression" && isPrivateFieldAccess(node.expression) - ) - } +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} - // Parse call, dot, and `[]`-subscript expressions. +// any single thing other than / +// don't need to escape / when using new RegExp() +var qmark = '[^/]' - pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) { - var startPos = this.start, startLoc = this.startLoc; - var expr = this.parseExprAtom(refDestructuringErrors, forInit); - if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") - { return expr } - var result = this.parseSubscripts(expr, startPos, startLoc, false, forInit); - if (refDestructuringErrors && result.type === "MemberExpression") { - if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; } - if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; } - if (refDestructuringErrors.trailingComma >= result.start) { refDestructuringErrors.trailingComma = -1; } - } - return result - }; +// * => any number of characters +var star = qmark + '*?' - pp$5.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) { - var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && - this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && - this.potentialArrowAt === base.start; - var optionalChained = false; +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' - while (true) { - var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit); +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' - if (element.optional) { optionalChained = true; } - if (element === base || element.type === "ArrowFunctionExpression") { - if (optionalChained) { - var chainNode = this.startNodeAt(startPos, startLoc); - chainNode.expression = element; - element = this.finishNode(chainNode, "ChainExpression"); - } - return element - } +// characters that need to be escaped in RegExp. +var reSpecials = charSet('().*{}+?[]^$\\!') - base = element; - } - }; +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split('').reduce(function (set, c) { + set[c] = true + return set + }, {}) +} - pp$5.shouldParseAsyncArrow = function() { - return !this.canInsertSemicolon() && this.eat(types$1.arrow) - }; +// normalizes slashes. +var slashSplit = /\/+/ - pp$5.parseSubscriptAsyncArrow = function(startPos, startLoc, exprList, forInit) { - return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit) - }; +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} - pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) { - var optionalSupported = this.options.ecmaVersion >= 11; - var optional = optionalSupported && this.eat(types$1.questionDot); - if (noCalls && optional) { this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); } +function ext (a, b) { + a = a || {} + b = b || {} + var t = {} + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + return t +} - var computed = this.eat(types$1.bracketL); - if (computed || (optional && this.type !== types$1.parenL && this.type !== types$1.backQuote) || this.eat(types$1.dot)) { - var node = this.startNodeAt(startPos, startLoc); - node.object = base; - if (computed) { - node.property = this.parseExpression(); - this.expect(types$1.bracketR); - } else if (this.type === types$1.privateId && base.type !== "Super") { - node.property = this.parsePrivateIdent(); - } else { - node.property = this.parseIdent(this.options.allowReserved !== "never"); - } - node.computed = !!computed; - if (optionalSupported) { - node.optional = optional; - } - base = this.finishNode(node, "MemberExpression"); - } else if (!noCalls && this.eat(types$1.parenL)) { - var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; - var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); - if (maybeAsyncArrow && !optional && this.shouldParseAsyncArrow()) { - this.checkPatternErrors(refDestructuringErrors, false); - this.checkYieldAwaitInDefaultParams(); - if (this.awaitIdentPos > 0) - { this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); } - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - return this.parseSubscriptAsyncArrow(startPos, startLoc, exprList, forInit) - } - this.checkExpressionErrors(refDestructuringErrors, true); - this.yieldPos = oldYieldPos || this.yieldPos; - this.awaitPos = oldAwaitPos || this.awaitPos; - this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos; - var node$1 = this.startNodeAt(startPos, startLoc); - node$1.callee = base; - node$1.arguments = exprList; - if (optionalSupported) { - node$1.optional = optional; - } - base = this.finishNode(node$1, "CallExpression"); - } else if (this.type === types$1.backQuote) { - if (optional || optionalChained) { - this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions"); - } - var node$2 = this.startNodeAt(startPos, startLoc); - node$2.tag = base; - node$2.quasi = this.parseTemplate({isTagged: true}); - base = this.finishNode(node$2, "TaggedTemplateExpression"); - } - return base - }; +minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return minimatch - // Parse an atomic expression — either a single token that is an - // expression, an expression started by a keyword like `function` or - // `new`, or an expression wrapped in punctuation like `()`, `[]`, - // or `{}`. + var orig = minimatch - pp$5.parseExprAtom = function(refDestructuringErrors, forInit, forNew) { - // If a division operator appears in an expression position, the - // tokenizer got confused, and we force it to read a regexp instead. - if (this.type === types$1.slash) { this.readRegexp(); } + var m = function minimatch (p, pattern, options) { + return orig.minimatch(p, pattern, ext(def, options)) + } - var node, canBeArrow = this.potentialArrowAt === this.start; - switch (this.type) { - case types$1._super: - if (!this.allowSuper) - { this.raise(this.start, "'super' keyword outside a method"); } - node = this.startNode(); - this.next(); - if (this.type === types$1.parenL && !this.allowDirectSuper) - { this.raise(node.start, "super() call outside constructor of a subclass"); } - // The `super` keyword can appear at below: - // SuperProperty: - // super [ Expression ] - // super . IdentifierName - // SuperCall: - // super ( Arguments ) - if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL) - { this.unexpected(); } - return this.finishNode(node, "Super") + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } - case types$1._this: - node = this.startNode(); - this.next(); - return this.finishNode(node, "ThisExpression") + return m +} - case types$1.name: - var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; - var id = this.parseIdent(false); - if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types$1._function)) { - this.overrideContext(types.f_expr); - return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit) - } - if (canBeArrow && !this.canInsertSemicolon()) { - if (this.eat(types$1.arrow)) - { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit) } - if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types$1.name && !containsEsc && - (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) { - id = this.parseIdent(false); - if (this.canInsertSemicolon() || !this.eat(types$1.arrow)) - { this.unexpected(); } - return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit) - } - } - return id +Minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return Minimatch + return minimatch.defaults(def).Minimatch +} - case types$1.regexp: - var value = this.value; - node = this.parseLiteral(value.value); - node.regex = {pattern: value.pattern, flags: value.flags}; - return node +function minimatch (p, pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } - case types$1.num: case types$1.string: - return this.parseLiteral(this.value) + if (!options) options = {} - case types$1._null: case types$1._true: case types$1._false: - node = this.startNode(); - node.value = this.type === types$1._null ? null : this.type === types$1._true; - node.raw = this.type.keyword; - this.next(); - return this.finishNode(node, "Literal") + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false + } - case types$1.parenL: - var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit); - if (refDestructuringErrors) { - if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) - { refDestructuringErrors.parenthesizedAssign = start; } - if (refDestructuringErrors.parenthesizedBind < 0) - { refDestructuringErrors.parenthesizedBind = start; } - } - return expr + // "" only matches "" + if (pattern.trim() === '') return p === '' - case types$1.bracketL: - node = this.startNode(); - this.next(); - node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors); - return this.finishNode(node, "ArrayExpression") + return new Minimatch(pattern, options).match(p) +} - case types$1.braceL: - this.overrideContext(types.b_expr); - return this.parseObj(false, refDestructuringErrors) +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options) + } - case types$1._function: - node = this.startNode(); - this.next(); - return this.parseFunction(node, 0) + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } - case types$1._class: - return this.parseClass(this.startNode(), false) + if (!options) options = {} + pattern = pattern.trim() - case types$1._new: - return this.parseNew() + // windows support: need to use /, not \ + if (path.sep !== '/') { + pattern = pattern.split(path.sep).join('/') + } - case types$1.backQuote: - return this.parseTemplate() + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false - case types$1._import: - if (this.options.ecmaVersion >= 11) { - return this.parseExprImport(forNew) - } else { - return this.unexpected() - } + // make the set of regexps etc. + this.make() +} - default: - return this.parseExprAtomDefault() - } - }; +Minimatch.prototype.debug = function () {} - pp$5.parseExprAtomDefault = function() { - this.unexpected(); - }; +Minimatch.prototype.make = make +function make () { + // don't do it more than once. + if (this._made) return - pp$5.parseExprImport = function(forNew) { - var node = this.startNode(); + var pattern = this.pattern + var options = this.options - // Consume `import` as an identifier for `import.meta`. - // Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`. - if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword import"); } - var meta = this.parseIdent(true); + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } - if (this.type === types$1.parenL && !forNew) { - return this.parseDynamicImport(node) - } else if (this.type === types$1.dot) { - node.meta = meta; - return this.parseImportMeta(node) - } else { - this.unexpected(); - } - }; + // step 1: figure out negation, etc. + this.parseNegate() - pp$5.parseDynamicImport = function(node) { - this.next(); // skip `(` + // step 2: expand braces + var set = this.globSet = this.braceExpand() - // Parse node.source. - node.source = this.parseMaybeAssign(); + if (options.debug) this.debug = console.error - // Verify ending. - if (!this.eat(types$1.parenR)) { - var errorPos = this.start; - if (this.eat(types$1.comma) && this.eat(types$1.parenR)) { - this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()"); - } else { - this.unexpected(errorPos); - } - } + this.debug(this.pattern, set) - return this.finishNode(node, "ImportExpression") - }; + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) - pp$5.parseImportMeta = function(node) { - this.next(); // skip `.` + this.debug(this.pattern, set) - var containsEsc = this.containsEsc; - node.property = this.parseIdent(true); + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) - if (node.property.name !== "meta") - { this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"); } - if (containsEsc) - { this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"); } - if (this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere) - { this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); } + this.debug(this.pattern, set) - return this.finishNode(node, "MetaProperty") - }; + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return s.indexOf(false) === -1 + }) - pp$5.parseLiteral = function(value) { - var node = this.startNode(); - node.value = value; - node.raw = this.input.slice(this.start, this.end); - if (node.raw.charCodeAt(node.raw.length - 1) === 110) { node.bigint = node.raw.slice(0, -1).replace(/_/g, ""); } - this.next(); - return this.finishNode(node, "Literal") - }; + this.debug(this.pattern, set) - pp$5.parseParenExpression = function() { - this.expect(types$1.parenL); - var val = this.parseExpression(); - this.expect(types$1.parenR); - return val - }; + this.set = set +} - pp$5.shouldParseArrow = function(exprList) { - return !this.canInsertSemicolon() - }; +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + var negate = false + var options = this.options + var negateOffset = 0 - pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) { - var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8; - if (this.options.ecmaVersion >= 6) { - this.next(); + if (options.nonegate) return - var innerStartPos = this.start, innerStartLoc = this.startLoc; - var exprList = [], first = true, lastIsComma = false; - var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart; - this.yieldPos = 0; - this.awaitPos = 0; - // Do not save awaitIdentPos to allow checking awaits nested in parameters - while (this.type !== types$1.parenR) { - first ? first = false : this.expect(types$1.comma); - if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) { - lastIsComma = true; - break - } else if (this.type === types$1.ellipsis) { - spreadStart = this.start; - exprList.push(this.parseParenItem(this.parseRestBinding())); - if (this.type === types$1.comma) { - this.raiseRecoverable( - this.start, - "Comma is not permitted after the rest element" - ); - } - break - } else { - exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem)); - } - } - var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc; - this.expect(types$1.parenR); + for (var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === '!' + ; i++) { + negate = !negate + negateOffset++ + } - if (canBeArrow && this.shouldParseArrow(exprList) && this.eat(types$1.arrow)) { - this.checkPatternErrors(refDestructuringErrors, false); - this.checkYieldAwaitInDefaultParams(); - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - return this.parseParenArrowList(startPos, startLoc, exprList, forInit) - } + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} - if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); } - if (spreadStart) { this.unexpected(spreadStart); } - this.checkExpressionErrors(refDestructuringErrors, true); - this.yieldPos = oldYieldPos || this.yieldPos; - this.awaitPos = oldAwaitPos || this.awaitPos; +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return braceExpand(pattern, options) +} - if (exprList.length > 1) { - val = this.startNodeAt(innerStartPos, innerStartLoc); - val.expressions = exprList; - this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); - } else { - val = exprList[0]; - } - } else { - val = this.parseParenExpression(); - } +Minimatch.prototype.braceExpand = braceExpand - if (this.options.preserveParens) { - var par = this.startNodeAt(startPos, startLoc); - par.expression = val; - return this.finishNode(par, "ParenthesizedExpression") +function braceExpand (pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options } else { - return val + options = {} } - }; + } - pp$5.parseParenItem = function(item) { - return item - }; + pattern = typeof pattern === 'undefined' + ? this.pattern : pattern - pp$5.parseParenArrowList = function(startPos, startLoc, exprList, forInit) { - return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit) - }; + if (typeof pattern === 'undefined') { + throw new TypeError('undefined pattern') + } - // New's precedence is slightly tricky. It must allow its argument to - // be a `[]` or dot subscript expression, but not a call — at least, - // not without wrapping it in parentheses. Thus, it uses the noCalls - // argument to parseSubscripts to prevent it from consuming the - // argument list. + if (options.nobrace || + !pattern.match(/\{.*\}/)) { + // shortcut. no need to expand. + return [pattern] + } - var empty = []; + return expand(pattern) +} - pp$5.parseNew = function() { - if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); } - var node = this.startNode(); - var meta = this.parseIdent(true); - if (this.options.ecmaVersion >= 6 && this.eat(types$1.dot)) { - node.meta = meta; - var containsEsc = this.containsEsc; - node.property = this.parseIdent(true); - if (node.property.name !== "target") - { this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); } - if (containsEsc) - { this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); } - if (!this.allowNewDotTarget) - { this.raiseRecoverable(node.start, "'new.target' can only be used in functions and class static block"); } - return this.finishNode(node, "MetaProperty") - } - var startPos = this.start, startLoc = this.startLoc; - node.callee = this.parseSubscripts(this.parseExprAtom(null, false, true), startPos, startLoc, true, false); - if (this.eat(types$1.parenL)) { node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false); } - else { node.arguments = empty; } - return this.finishNode(node, "NewExpression") - }; +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + if (pattern.length > 1024 * 64) { + throw new TypeError('pattern is too long') + } - // Parse template expression. + var options = this.options - pp$5.parseTemplateElement = function(ref) { - var isTagged = ref.isTagged; + // shortcuts + if (!options.noglobstar && pattern === '**') return GLOBSTAR + if (pattern === '') return '' - var elem = this.startNode(); - if (this.type === types$1.invalidTemplate) { - if (!isTagged) { - this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); + var re = '' + var hasMagic = !!options.nocase + var escaping = false + // ? => one single character + var patternListStack = [] + var negativeLists = [] + var stateChar + var inClass = false + var reClassStart = -1 + var classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + var patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)' + var self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star + hasMagic = true + break + case '?': + re += qmark + hasMagic = true + break + default: + re += '\\' + stateChar + break } - elem.value = { - raw: this.value, - cooked: null - }; - } else { - elem.value = { - raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"), - cooked: this.value - }; + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false } - this.next(); - elem.tail = this.type === types$1.backQuote; - return this.finishNode(elem, "TemplateElement") - }; + } - pp$5.parseTemplate = function(ref) { - if ( ref === void 0 ) ref = {}; - var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false; + for (var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) - var node = this.startNode(); - this.next(); - node.expressions = []; - var curElt = this.parseTemplateElement({isTagged: isTagged}); - node.quasis = [curElt]; - while (!curElt.tail) { - if (this.type === types$1.eof) { this.raise(this.pos, "Unterminated template literal"); } - this.expect(types$1.dollarBraceL); - node.expressions.push(this.parseExpression()); - this.expect(types$1.braceR); - node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged})); + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += '\\' + c + escaping = false + continue } - this.next(); - return this.finishNode(node, "TemplateLiteral") - }; - - pp$5.isAsyncProp = function(prop) { - return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && - (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types$1.star)) && - !lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) - }; - // Parse an object literal or binding pattern. + switch (c) { + case '/': + // completely not allowed, even escaped. + // Should already be path-split by now. + return false - pp$5.parseObj = function(isPattern, refDestructuringErrors) { - var node = this.startNode(), first = true, propHash = {}; - node.properties = []; - this.next(); - while (!this.eat(types$1.braceR)) { - if (!first) { - this.expect(types$1.comma); - if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR)) { break } - } else { first = false; } + case '\\': + clearStateChar() + escaping = true + continue - var prop = this.parseProperty(isPattern, refDestructuringErrors); - if (!isPattern) { this.checkPropClash(prop, propHash, refDestructuringErrors); } - node.properties.push(prop); - } - return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression") - }; + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) - pp$5.parseProperty = function(isPattern, refDestructuringErrors) { - var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc; - if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) { - if (isPattern) { - prop.argument = this.parseIdent(false); - if (this.type === types$1.comma) { - this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"); + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === '!' && i === classStart + 1) c = '^' + re += c + continue } - return this.finishNode(prop, "RestElement") - } - // Parse argument. - prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); - // To disallow trailing comma via `this.toAssignable()`. - if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { - refDestructuringErrors.trailingComma = this.start; - } - // Finish - return this.finishNode(prop, "SpreadElement") - } - if (this.options.ecmaVersion >= 6) { - prop.method = false; - prop.shorthand = false; - if (isPattern || refDestructuringErrors) { - startPos = this.start; - startLoc = this.startLoc; - } - if (!isPattern) - { isGenerator = this.eat(types$1.star); } - } - var containsEsc = this.containsEsc; - this.parsePropertyName(prop); - if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { - isAsync = true; - isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star); - this.parsePropertyName(prop); - } else { - isAsync = false; - } - this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc); - return this.finishNode(prop, "Property") - }; - - pp$5.parseGetterSetter = function(prop) { - prop.kind = prop.key.name; - this.parsePropertyName(prop); - prop.value = this.parseMethod(false); - var paramCount = prop.kind === "get" ? 0 : 1; - if (prop.value.params.length !== paramCount) { - var start = prop.value.start; - if (prop.kind === "get") - { this.raiseRecoverable(start, "getter should have no params"); } - else - { this.raiseRecoverable(start, "setter should have exactly one param"); } - } else { - if (prop.kind === "set" && prop.value.params[0].type === "RestElement") - { this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); } - } - }; - pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { - if ((isGenerator || isAsync) && this.type === types$1.colon) - { this.unexpected(); } + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue - if (this.eat(types$1.colon)) { - prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); - prop.kind = "init"; - } else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) { - if (isPattern) { this.unexpected(); } - prop.kind = "init"; - prop.method = true; - prop.value = this.parseMethod(isGenerator, isAsync); - } else if (!isPattern && !containsEsc && - this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && - (prop.key.name === "get" || prop.key.name === "set") && - (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) { - if (isGenerator || isAsync) { this.unexpected(); } - this.parseGetterSetter(prop); - } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { - if (isGenerator || isAsync) { this.unexpected(); } - this.checkUnreserved(prop.key); - if (prop.key.name === "await" && !this.awaitIdentPos) - { this.awaitIdentPos = startPos; } - prop.kind = "init"; - if (isPattern) { - prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); - } else if (this.type === types$1.eq && refDestructuringErrors) { - if (refDestructuringErrors.shorthandAssign < 0) - { refDestructuringErrors.shorthandAssign = this.start; } - prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); - } else { - prop.value = this.copyNode(prop.key); - } - prop.shorthand = true; - } else { this.unexpected(); } - }; + case '(': + if (inClass) { + re += '(' + continue + } - pp$5.parsePropertyName = function(prop) { - if (this.options.ecmaVersion >= 6) { - if (this.eat(types$1.bracketL)) { - prop.computed = true; - prop.key = this.parseMaybeAssign(); - this.expect(types$1.bracketR); - return prop.key - } else { - prop.computed = false; - } - } - return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never") - }; + if (!stateChar) { + re += '\\(' + continue + } - // Initialize empty function node. + patternListStack.push({ + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }) + // negation is (?:(?!js)[^/]*) + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue - pp$5.initFunction = function(node) { - node.id = null; - if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; } - if (this.options.ecmaVersion >= 8) { node.async = false; } - }; + case ')': + if (inClass || !patternListStack.length) { + re += '\\)' + continue + } - // Parse object or class method. + clearStateChar() + hasMagic = true + var pl = patternListStack.pop() + // negation is (?:(?!js)[^/]*) + // The others are (?:) + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) + } + pl.reEnd = re.length + continue - pp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { - var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + case '|': + if (inClass || !patternListStack.length || escaping) { + re += '\\|' + escaping = false + continue + } - this.initFunction(node); - if (this.options.ecmaVersion >= 6) - { node.generator = isGenerator; } - if (this.options.ecmaVersion >= 8) - { node.async = !!isAsync; } + clearStateChar() + re += '|' + continue - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; - this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar() - this.expect(types$1.parenL); - node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); - this.checkYieldAwaitInDefaultParams(); - this.parseFunctionBody(node, false, true, false); + if (inClass) { + re += '\\' + c + continue + } - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - return this.finishNode(node, "FunctionExpression") - }; + inClass = true + classStart = i + reClassStart = re.length + re += c + continue - // Parse arrow function expression with given parameters. + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c + escaping = false + continue + } - pp$5.parseArrowExpression = function(node, params, isAsync, forInit) { - var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + if (inClass) { + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue + } + } - this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW); - this.initFunction(node); - if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; } + // finish up the class. + hasMagic = true + inClass = false + re += c + continue - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; + default: + // swallow any state char that wasn't consumed + clearStateChar() - node.params = this.toAssignableList(params, true); - this.parseFunctionBody(node, true, false, forInit); + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === '^' && inClass)) { + re += '\\' + } - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - return this.finishNode(node, "ArrowFunctionExpression") - }; + re += c - // Parse function body and check parameters. + } // switch + } // for - pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) { - var isExpression = isArrowFunction && this.type !== types$1.braceL; - var oldStrict = this.strict, useStrict = false; + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.substr(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + hasMagic = hasMagic || sp[1] + } - if (isExpression) { - node.body = this.parseMaybeAssign(forInit); - node.expression = true; - this.checkParams(node, false); - } else { - var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params); - if (!oldStrict || nonSimple) { - useStrict = this.strictDirective(this.end); - // If this is a strict mode function, verify that argument names - // are not repeated, and it does not try to bind the words `eval` - // or `arguments`. - if (useStrict && nonSimple) - { this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); } + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\' } - // Start a new scope with regard to labels and the `inFunction` - // flag (restore them to their old value afterwards). - var oldLabels = this.labels; - this.labels = []; - if (useStrict) { this.strict = true; } - // Add the params to varDeclaredNames to ensure that an error is thrown - // if a let/const declaration in the function clashes with one of the params. - this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params)); - // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval' - if (this.strict && node.id) { this.checkLValSimple(node.id, BIND_OUTSIDE); } - node.body = this.parseBlock(false, undefined, useStrict && !oldStrict); - node.expression = false; - this.adaptDirectivePrologue(node.body.body); - this.labels = oldLabels; - } - this.exitScope(); - }; + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }) - pp$5.isSimpleParamList = function(params) { - for (var i = 0, list = params; i < list.length; i += 1) - { - var param = list[i]; + this.debug('tail=%j\n %s', tail, tail, pl, re) + var t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type - if (param.type !== "Identifier") { return false - } } - return true - }; + hasMagic = true + re = re.slice(0, pl.reStart) + t + '\\(' + tail + } - // Checks function params for various disallowed patterns such as using "eval" - // or "arguments" and duplicate parameters. + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += '\\\\' + } - pp$5.checkParams = function(node, allowDuplicates) { - var nameHash = Object.create(null); - for (var i = 0, list = node.params; i < list.length; i += 1) - { - var param = list[i]; + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case '.': + case '[': + case '(': addPatternStart = true + } - this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash); - } - }; + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n] - // Parses a comma-separated list of expressions, and returns them as - // an array. `close` is the token type that ends the list, and - // `allowEmpty` can be turned on to allow subsequent commas with - // nothing in between them to be parsed as `null` (which is needed - // for array literals). + var nlBefore = re.slice(0, nl.reStart) + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + var nlAfter = re.slice(nl.reEnd) - pp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { - var elts = [], first = true; - while (!this.eat(close)) { - if (!first) { - this.expect(types$1.comma); - if (allowTrailingComma && this.afterTrailingComma(close)) { break } - } else { first = false; } + nlLast += nlAfter - var elt = (void 0); - if (allowEmpty && this.type === types$1.comma) - { elt = null; } - else if (this.type === types$1.ellipsis) { - elt = this.parseSpread(refDestructuringErrors); - if (refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0) - { refDestructuringErrors.trailingComma = this.start; } - } else { - elt = this.parseMaybeAssign(false, refDestructuringErrors); - } - elts.push(elt); + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1 + var cleanAfter = nlAfter + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') } - return elts - }; - - pp$5.checkUnreserved = function(ref) { - var start = ref.start; - var end = ref.end; - var name = ref.name; + nlAfter = cleanAfter - if (this.inGenerator && name === "yield") - { this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); } - if (this.inAsync && name === "await") - { this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); } - if (this.currentThisScope().inClassFieldInit && name === "arguments") - { this.raiseRecoverable(start, "Cannot use 'arguments' in class field initializer"); } - if (this.inClassStaticBlock && (name === "arguments" || name === "await")) - { this.raise(start, ("Cannot use " + name + " in class static initialization block")); } - if (this.keywords.test(name)) - { this.raise(start, ("Unexpected keyword '" + name + "'")); } - if (this.options.ecmaVersion < 6 && - this.input.slice(start, end).indexOf("\\") !== -1) { return } - var re = this.strict ? this.reservedWordsStrict : this.reservedWords; - if (re.test(name)) { - if (!this.inAsync && name === "await") - { this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function"); } - this.raiseRecoverable(start, ("The keyword '" + name + "' is reserved")); + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' } - }; - - // Parse the next token as an identifier. If `liberal` is true (used - // when parsing properties), it will also convert keywords into - // identifiers. + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe + } - pp$5.parseIdent = function(liberal) { - var node = this.parseIdentNode(); - this.next(!!liberal); - this.finishNode(node, "Identifier"); - if (!liberal) { - this.checkUnreserved(node); - if (node.name === "await" && !this.awaitIdentPos) - { this.awaitIdentPos = node.start; } - } - return node - }; + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } - pp$5.parseIdentNode = function() { - var node = this.startNode(); - if (this.type === types$1.name) { - node.name = this.value; - } else if (this.type.keyword) { - node.name = this.type.keyword; + if (addPatternStart) { + re = patternStart + re + } - // To fix https://github.com/acornjs/acorn/issues/575 - // `class` and `function` keywords push new context into this.context. - // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name. - // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword - if ((node.name === "class" || node.name === "function") && - (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) { - this.context.pop(); - } - } else { - this.unexpected(); - } - return node - }; + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } - pp$5.parsePrivateIdent = function() { - var node = this.startNode(); - if (this.type === types$1.privateId) { - node.name = this.value; - } else { - this.unexpected(); - } - this.next(); - this.finishNode(node, "PrivateIdentifier"); + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } - // For validating existence - if (this.privateNameStack.length === 0) { - this.raise(node.start, ("Private field '#" + (node.name) + "' must be declared in an enclosing class")); - } else { - this.privateNameStack[this.privateNameStack.length - 1].used.push(node); - } + var flags = options.nocase ? 'i' : '' + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } - return node - }; + regExp._glob = pattern + regExp._src = re - // Parses yield expression inside generator. + return regExp +} - pp$5.parseYield = function(forInit) { - if (!this.yieldPos) { this.yieldPos = this.start; } +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} - var node = this.startNode(); - this.next(); - if (this.type === types$1.semi || this.canInsertSemicolon() || (this.type !== types$1.star && !this.type.startsExpr)) { - node.delegate = false; - node.argument = null; - } else { - node.delegate = this.eat(types$1.star); - node.argument = this.parseMaybeAssign(forInit); - } - return this.finishNode(node, "YieldExpression") - }; +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp - pp$5.parseAwait = function(forInit) { - if (!this.awaitPos) { this.awaitPos = this.start; } + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set - var node = this.startNode(); - this.next(); - node.argument = this.parseMaybeUnary(null, true, false, forInit); - return this.finishNode(node, "AwaitExpression") - }; + if (!set.length) { + this.regexp = false + return this.regexp + } + var options = this.options - var pp$4 = Parser.prototype; + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + var flags = options.nocase ? 'i' : '' - // This function is used to raise exceptions on parse errors. It - // takes an offset integer (into the current `input`) to indicate - // the location of the error, attaches the position to the end - // of the error message, and then raises a `SyntaxError` with that - // message. + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === 'string') ? regExpEscape(p) + : p._src + }).join('\\\/') + }).join('|') - pp$4.raise = function(pos, message) { - var loc = getLineInfo(this.input, pos); - message += " (" + loc.line + ":" + loc.column + ")"; - var err = new SyntaxError(message); - err.pos = pos; err.loc = loc; err.raisedAt = this.pos; - throw err - }; + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$' - pp$4.raiseRecoverable = pp$4.raise; + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$' - pp$4.curPosition = function() { - if (this.options.locations) { - return new Position(this.curLine, this.pos - this.lineStart) - } - }; + try { + this.regexp = new RegExp(re, flags) + } catch (ex) { + this.regexp = false + } + return this.regexp +} - var pp$3 = Parser.prototype; +minimatch.match = function (list, pattern, options) { + options = options || {} + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (mm.options.nonull && !list.length) { + list.push(pattern) + } + return list +} - var Scope = function Scope(flags) { - this.flags = flags; - // A list of var-declared names in the current lexical scope - this.var = []; - // A list of lexically-declared names in the current lexical scope - this.lexical = []; - // A list of lexically-declared FunctionDeclaration names in the current lexical scope - this.functions = []; - // A switch to disallow the identifier reference 'arguments' - this.inClassFieldInit = false; - }; +Minimatch.prototype.match = match +function match (f, partial) { + this.debug('match', f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === '' - // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names. + if (f === '/' && partial) return true - pp$3.enterScope = function(flags) { - this.scopeStack.push(new Scope(flags)); - }; + var options = this.options - pp$3.exitScope = function() { - this.scopeStack.pop(); - }; + // windows: need to use /, not \ + if (path.sep !== '/') { + f = f.split(path.sep).join('/') + } - // The spec says: - // > At the top level of a function, or script, function declarations are - // > treated like var declarations rather than like lexical declarations. - pp$3.treatFunctionsAsVarInScope = function(scope) { - return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP) - }; + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, 'split', f) - pp$3.declareName = function(name, bindingType, pos) { - var redeclared = false; - if (bindingType === BIND_LEXICAL) { - var scope = this.currentScope(); - redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1; - scope.lexical.push(name); - if (this.inModule && (scope.flags & SCOPE_TOP)) - { delete this.undefinedExports[name]; } - } else if (bindingType === BIND_SIMPLE_CATCH) { - var scope$1 = this.currentScope(); - scope$1.lexical.push(name); - } else if (bindingType === BIND_FUNCTION) { - var scope$2 = this.currentScope(); - if (this.treatFunctionsAsVar) - { redeclared = scope$2.lexical.indexOf(name) > -1; } - else - { redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; } - scope$2.functions.push(name); - } else { - for (var i = this.scopeStack.length - 1; i >= 0; --i) { - var scope$3 = this.scopeStack[i]; - if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) || - !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) { - redeclared = true; - break - } - scope$3.var.push(name); - if (this.inModule && (scope$3.flags & SCOPE_TOP)) - { delete this.undefinedExports[name]; } - if (scope$3.flags & SCOPE_VAR) { break } - } - } - if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); } - }; + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. - pp$3.checkLocalExport = function(id) { - // scope.functions must be empty as Module code is always strict. - if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && - this.scopeStack[0].var.indexOf(id.name) === -1) { - this.undefinedExports[id.name] = id; - } - }; + var set = this.set + this.debug(this.pattern, 'set', set) - pp$3.currentScope = function() { - return this.scopeStack[this.scopeStack.length - 1] - }; + // Find the basename of the path by looking for the last non-empty segment + var filename + var i + for (i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } - pp$3.currentVarScope = function() { - for (var i = this.scopeStack.length - 1;; i--) { - var scope = this.scopeStack[i]; - if (scope.flags & SCOPE_VAR) { return scope } + for (i = 0; i < set.length; i++) { + var pattern = set[i] + var file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] } - }; - - // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`. - pp$3.currentThisScope = function() { - for (var i = this.scopeStack.length - 1;; i--) { - var scope = this.scopeStack[i]; - if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate } - }; + } - var Node = function Node(parser, pos, loc) { - this.type = ""; - this.start = pos; - this.end = 0; - if (parser.options.locations) - { this.loc = new SourceLocation(parser, loc); } - if (parser.options.directSourceFile) - { this.sourceFile = parser.options.directSourceFile; } - if (parser.options.ranges) - { this.range = [pos, 0]; } - }; + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} - // Start an AST node, attaching a start offset. +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options - var pp$2 = Parser.prototype; + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }) - pp$2.startNode = function() { - return new Node(this, this.start, this.startLoc) - }; + this.debug('matchOne', file.length, pattern.length) - pp$2.startNodeAt = function(pos, loc) { - return new Node(this, pos, loc) - }; + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++) { + this.debug('matchOne loop') + var p = pattern[pi] + var f = file[fi] - // Finish an AST node, adding `type` and `end` properties. + this.debug(pattern, p, f) - function finishNodeAt(node, type, pos, loc) { - node.type = type; - node.end = pos; - if (this.options.locations) - { node.loc.end = loc; } - if (this.options.ranges) - { node.range[1] = pos; } - return node - } + // should be impossible. + // some invalid regexp stuff in the set. + if (p === false) return false - pp$2.finishNode = function(node, type) { - return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc) - }; + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) - // Finish node at given position + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + var pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false + } + return true + } - pp$2.finishNodeAt = function(node, type, pos, loc) { - return finishNodeAt.call(this, node, type, pos, loc) - }; + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr] - pp$2.copyNode = function(node) { - var newNode = new Node(this, node.start, this.startLoc); - for (var prop in node) { newNode[prop] = node[prop]; } - return newNode - }; + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) - // This file contains Unicode properties extracted from the ECMAScript specification. - // The lists are extracted like so: - // $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText) + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr) + break + } - // #table-binary-unicode-properties - var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS"; - var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic"; - var ecma11BinaryProperties = ecma10BinaryProperties; - var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict"; - var ecma13BinaryProperties = ecma12BinaryProperties; - var ecma14BinaryProperties = ecma13BinaryProperties; + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr++ + } + } - var unicodeBinaryProperties = { - 9: ecma9BinaryProperties, - 10: ecma10BinaryProperties, - 11: ecma11BinaryProperties, - 12: ecma12BinaryProperties, - 13: ecma13BinaryProperties, - 14: ecma14BinaryProperties - }; + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } - // #table-binary-unicode-properties-of-strings - var ecma14BinaryPropertiesOfStrings = "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"; + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === 'string') { + if (options.nocase) { + hit = f.toLowerCase() === p.toLowerCase() + } else { + hit = f === p + } + this.debug('string match', p, f, hit) + } else { + hit = f.match(p) + this.debug('pattern match', p, f, hit) + } - var unicodeBinaryPropertiesOfStrings = { - 9: "", - 10: "", - 11: "", - 12: "", - 13: "", - 14: ecma14BinaryPropertiesOfStrings - }; + if (!hit) return false + } - // #table-unicode-general-category-values - var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu"; + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* - // #table-unicode-script-values - var ecma9ScriptValues = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb"; - var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd"; - var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"; - var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi"; - var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith"; - var ecma14ScriptValues = ecma13ScriptValues + " Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz"; + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') + return emptyFileEnd + } - var unicodeScriptValues = { - 9: ecma9ScriptValues, - 10: ecma10ScriptValues, - 11: ecma11ScriptValues, - 12: ecma12ScriptValues, - 13: ecma13ScriptValues, - 14: ecma14ScriptValues - }; + // should be unreachable. + throw new Error('wtf?') +} - var data = {}; - function buildUnicodeData(ecmaVersion) { - var d = data[ecmaVersion] = { - binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues), - binaryOfStrings: wordsRegexp(unicodeBinaryPropertiesOfStrings[ecmaVersion]), - nonBinary: { - General_Category: wordsRegexp(unicodeGeneralCategoryValues), - Script: wordsRegexp(unicodeScriptValues[ecmaVersion]) - } - }; - d.nonBinary.Script_Extensions = d.nonBinary.Script; +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, '$1') +} - d.nonBinary.gc = d.nonBinary.General_Category; - d.nonBinary.sc = d.nonBinary.Script; - d.nonBinary.scx = d.nonBinary.Script_Extensions; - } +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') +} - for (var i = 0, list = [9, 10, 11, 12, 13, 14]; i < list.length; i += 1) { - var ecmaVersion = list[i]; - buildUnicodeData(ecmaVersion); - } +/***/ }), +/* 61 */ +/***/ (function(module, exports, __nested_webpack_require_110873__) { - var pp$1 = Parser.prototype; +var wrappy = __nested_webpack_require_110873__(123) +module.exports = wrappy(once) +module.exports.strict = wrappy(onceStrict) - var RegExpValidationState = function RegExpValidationState(parser) { - this.parser = parser; - this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "") + (parser.options.ecmaVersion >= 15 ? "v" : ""); - this.unicodeProperties = data[parser.options.ecmaVersion >= 14 ? 14 : parser.options.ecmaVersion]; - this.source = ""; - this.flags = ""; - this.start = 0; - this.switchU = false; - this.switchV = false; - this.switchN = false; - this.pos = 0; - this.lastIntValue = 0; - this.lastStringValue = ""; - this.lastAssertionIsQuantifiable = false; - this.numCapturingParens = 0; - this.maxBackReference = 0; - this.groupNames = []; - this.backReferenceNames = []; - }; +once.proto = once(function () { + Object.defineProperty(Function.prototype, 'once', { + value: function () { + return once(this) + }, + configurable: true + }) - RegExpValidationState.prototype.reset = function reset (start, pattern, flags) { - var unicodeSets = flags.indexOf("v") !== -1; - var unicode = flags.indexOf("u") !== -1; - this.start = start | 0; - this.source = pattern + ""; - this.flags = flags; - if (unicodeSets && this.parser.options.ecmaVersion >= 15) { - this.switchU = true; - this.switchV = true; - this.switchN = true; - } else { - this.switchU = unicode && this.parser.options.ecmaVersion >= 6; - this.switchV = false; - this.switchN = unicode && this.parser.options.ecmaVersion >= 9; - } - }; + Object.defineProperty(Function.prototype, 'onceStrict', { + value: function () { + return onceStrict(this) + }, + configurable: true + }) +}) - RegExpValidationState.prototype.raise = function raise (message) { - this.parser.raiseRecoverable(this.start, ("Invalid regular expression: /" + (this.source) + "/: " + message)); - }; +function once (fn) { + var f = function () { + if (f.called) return f.value + f.called = true + return f.value = fn.apply(this, arguments) + } + f.called = false + return f +} - // If u flag is given, this returns the code point at the index (it combines a surrogate pair). - // Otherwise, this returns the code unit of the index (can be a part of a surrogate pair). - RegExpValidationState.prototype.at = function at (i, forceU) { - if ( forceU === void 0 ) forceU = false; +function onceStrict (fn) { + var f = function () { + if (f.called) + throw new Error(f.onceError) + f.called = true + return f.value = fn.apply(this, arguments) + } + var name = fn.name || 'Function wrapped with `once`' + f.onceError = name + " shouldn't be called more than once" + f.called = false + return f +} - var s = this.source; - var l = s.length; - if (i >= l) { - return -1 - } - var c = s.charCodeAt(i); - if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) { - return c - } - var next = s.charCodeAt(i + 1); - return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c - }; - RegExpValidationState.prototype.nextIndex = function nextIndex (i, forceU) { - if ( forceU === void 0 ) forceU = false; +/***/ }), +/* 62 */, +/* 63 */ +/***/ (function(module, exports) { - var s = this.source; - var l = s.length; - if (i >= l) { - return l - } - var c = s.charCodeAt(i), next; - if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l || - (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) { - return i + 1 - } - return i + 2 - }; +module.exports = __nccwpck_require__(14300); - RegExpValidationState.prototype.current = function current (forceU) { - if ( forceU === void 0 ) forceU = false; +/***/ }), +/* 64 */, +/* 65 */, +/* 66 */, +/* 67 */ +/***/ (function(module, exports) { + +// 7.2.1 RequireObjectCoercible(argument) +module.exports = function (it) { + if (it == undefined) throw TypeError("Can't call method on " + it); + return it; +}; - return this.at(this.pos, forceU) - }; - RegExpValidationState.prototype.lookahead = function lookahead (forceU) { - if ( forceU === void 0 ) forceU = false; +/***/ }), +/* 68 */ +/***/ (function(module, exports, __nested_webpack_require_112244__) { + +var isObject = __nested_webpack_require_112244__(34); +var document = __nested_webpack_require_112244__(11).document; +// typeof document.createElement is 'object' in old IE +var is = isObject(document) && isObject(document.createElement); +module.exports = function (it) { + return is ? document.createElement(it) : {}; +}; - return this.at(this.nextIndex(this.pos, forceU), forceU) - }; - RegExpValidationState.prototype.advance = function advance (forceU) { - if ( forceU === void 0 ) forceU = false; +/***/ }), +/* 69 */ +/***/ (function(module, exports) { - this.pos = this.nextIndex(this.pos, forceU); - }; +module.exports = true; - RegExpValidationState.prototype.eat = function eat (ch, forceU) { - if ( forceU === void 0 ) forceU = false; - if (this.current(forceU) === ch) { - this.advance(forceU); - return true - } - return false - }; +/***/ }), +/* 70 */ +/***/ (function(module, exports, __nested_webpack_require_112694__) { - RegExpValidationState.prototype.eatChars = function eatChars (chs, forceU) { - if ( forceU === void 0 ) forceU = false; +"use strict"; - var pos = this.pos; - for (var i = 0, list = chs; i < list.length; i += 1) { - var ch = list[i]; +// 25.4.1.5 NewPromiseCapability(C) +var aFunction = __nested_webpack_require_112694__(46); - var current = this.at(pos, forceU); - if (current === -1 || current !== ch) { - return false - } - pos = this.nextIndex(pos, forceU); - } - this.pos = pos; - return true - }; +function PromiseCapability(C) { + var resolve, reject; + this.promise = new C(function ($$resolve, $$reject) { + if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = aFunction(resolve); + this.reject = aFunction(reject); +} - /** - * Validate the flags part of a given RegExpLiteral. - * - * @param {RegExpValidationState} state The state to validate RegExp. - * @returns {void} - */ - pp$1.validateRegExpFlags = function(state) { - var validFlags = state.validFlags; - var flags = state.flags; +module.exports.f = function (C) { + return new PromiseCapability(C); +}; - var u = false; - var v = false; - for (var i = 0; i < flags.length; i++) { - var flag = flags.charAt(i); - if (validFlags.indexOf(flag) === -1) { - this.raise(state.start, "Invalid regular expression flag"); - } - if (flags.indexOf(flag, i + 1) > -1) { - this.raise(state.start, "Duplicate regular expression flag"); - } - if (flag === "u") { u = true; } - if (flag === "v") { v = true; } - } - if (this.options.ecmaVersion >= 15 && u && v) { - this.raise(state.start, "Invalid regular expression flag"); - } - }; +/***/ }), +/* 71 */ +/***/ (function(module, exports, __nested_webpack_require_113276__) { - /** - * Validate the pattern part of a given RegExpLiteral. - * - * @param {RegExpValidationState} state The state to validate RegExp. - * @returns {void} - */ - pp$1.validateRegExpPattern = function(state) { - this.regexp_pattern(state); +var def = __nested_webpack_require_113276__(50).f; +var has = __nested_webpack_require_113276__(49); +var TAG = __nested_webpack_require_113276__(13)('toStringTag'); - // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of - // parsing contains a |GroupName|, reparse with the goal symbol - // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError* - // exception if _P_ did not conform to the grammar, if any elements of _P_ - // were not matched by the parse, or if any Early Error conditions exist. - if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) { - state.switchN = true; - this.regexp_pattern(state); - } - }; +module.exports = function (it, tag, stat) { + if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); +}; - // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern - pp$1.regexp_pattern = function(state) { - state.pos = 0; - state.lastIntValue = 0; - state.lastStringValue = ""; - state.lastAssertionIsQuantifiable = false; - state.numCapturingParens = 0; - state.maxBackReference = 0; - state.groupNames.length = 0; - state.backReferenceNames.length = 0; - this.regexp_disjunction(state); +/***/ }), +/* 72 */ +/***/ (function(module, exports, __nested_webpack_require_113628__) { - if (state.pos !== state.source.length) { - // Make the same messages as V8. - if (state.eat(0x29 /* ) */)) { - state.raise("Unmatched ')'"); - } - if (state.eat(0x5D /* ] */) || state.eat(0x7D /* } */)) { - state.raise("Lone quantifier brackets"); - } - } - if (state.maxBackReference > state.numCapturingParens) { - state.raise("Invalid escape"); - } - for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) { - var name = list[i]; +var shared = __nested_webpack_require_113628__(107)('keys'); +var uid = __nested_webpack_require_113628__(111); +module.exports = function (key) { + return shared[key] || (shared[key] = uid(key)); +}; - if (state.groupNames.indexOf(name) === -1) { - state.raise("Invalid named capture referenced"); - } - } - }; - // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction - pp$1.regexp_disjunction = function(state) { - this.regexp_alternative(state); - while (state.eat(0x7C /* | */)) { - this.regexp_alternative(state); - } +/***/ }), +/* 73 */ +/***/ (function(module, exports) { + +// 7.1.4 ToInteger +var ceil = Math.ceil; +var floor = Math.floor; +module.exports = function (it) { + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); +}; - // Make the same message as V8. - if (this.regexp_eatQuantifier(state, true)) { - state.raise("Nothing to repeat"); - } - if (state.eat(0x7B /* { */)) { - state.raise("Lone quantifier brackets"); - } - }; - // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative - pp$1.regexp_alternative = function(state) { - while (state.pos < state.source.length && this.regexp_eatTerm(state)) - { } - }; +/***/ }), +/* 74 */ +/***/ (function(module, exports, __nested_webpack_require_114094__) { + +// to indexed object, toObject with fallback for non-array-like ES3 strings +var IObject = __nested_webpack_require_114094__(131); +var defined = __nested_webpack_require_114094__(67); +module.exports = function (it) { + return IObject(defined(it)); +}; - // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term - pp$1.regexp_eatTerm = function(state) { - if (this.regexp_eatAssertion(state)) { - // Handle `QuantifiableAssertion Quantifier` alternative. - // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion - // is a QuantifiableAssertion. - if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) { - // Make the same message as V8. - if (state.switchU) { - state.raise("Invalid quantifier"); - } - } - return true - } - if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) { - this.regexp_eatQuantifier(state); - return true - } +/***/ }), +/* 75 */ +/***/ (function(module, exports, __nested_webpack_require_114394__) { - return false - }; +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. - // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion - pp$1.regexp_eatAssertion = function(state) { - var start = state.pos; - state.lastAssertionIsQuantifiable = false; +module.exports = glob - // ^, $ - if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) { - return true - } +var fs = __nested_webpack_require_114394__(3) +var rp = __nested_webpack_require_114394__(114) +var minimatch = __nested_webpack_require_114394__(60) +var Minimatch = minimatch.Minimatch +var inherits = __nested_webpack_require_114394__(42) +var EE = __nested_webpack_require_114394__(54).EventEmitter +var path = __nested_webpack_require_114394__(0) +var assert = __nested_webpack_require_114394__(22) +var isAbsolute = __nested_webpack_require_114394__(76) +var globSync = __nested_webpack_require_114394__(218) +var common = __nested_webpack_require_114394__(115) +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = __nested_webpack_require_114394__(223) +var util = __nested_webpack_require_114394__(2) +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored - // \b \B - if (state.eat(0x5C /* \ */)) { - if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) { - return true - } - state.pos = start; - } +var once = __nested_webpack_require_114394__(61) - // Lookahead / Lookbehind - if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) { - var lookbehind = false; - if (this.options.ecmaVersion >= 9) { - lookbehind = state.eat(0x3C /* < */); - } - if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) { - this.regexp_disjunction(state); - if (!state.eat(0x29 /* ) */)) { - state.raise("Unterminated group"); - } - state.lastAssertionIsQuantifiable = !lookbehind; - return true - } - } +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} - state.pos = start; - return false - }; + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } - // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier - pp$1.regexp_eatQuantifier = function(state, noError) { - if ( noError === void 0 ) noError = false; + return new Glob(pattern, options, cb) +} - if (this.regexp_eatQuantifierPrefix(state, noError)) { - state.eat(0x3F /* ? */); - return true - } - return false - }; +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync - // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix - pp$1.regexp_eatQuantifierPrefix = function(state, noError) { - return ( - state.eat(0x2A /* * */) || - state.eat(0x2B /* + */) || - state.eat(0x3F /* ? */) || - this.regexp_eatBracedQuantifier(state, noError) - ) - }; - pp$1.regexp_eatBracedQuantifier = function(state, noError) { - var start = state.pos; - if (state.eat(0x7B /* { */)) { - var min = 0, max = -1; - if (this.regexp_eatDecimalDigits(state)) { - min = state.lastIntValue; - if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) { - max = state.lastIntValue; - } - if (state.eat(0x7D /* } */)) { - // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term - if (max !== -1 && max < min && !noError) { - state.raise("numbers out of order in {} quantifier"); - } - return true - } - } - if (state.switchU && !noError) { - state.raise("Incomplete quantifier"); - } - state.pos = start; - } - return false - }; +// old api surface +glob.glob = glob - // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom - pp$1.regexp_eatAtom = function(state) { - return ( - this.regexp_eatPatternCharacters(state) || - state.eat(0x2E /* . */) || - this.regexp_eatReverseSolidusAtomEscape(state) || - this.regexp_eatCharacterClass(state) || - this.regexp_eatUncapturingGroup(state) || - this.regexp_eatCapturingGroup(state) - ) - }; - pp$1.regexp_eatReverseSolidusAtomEscape = function(state) { - var start = state.pos; - if (state.eat(0x5C /* \ */)) { - if (this.regexp_eatAtomEscape(state)) { - return true - } - state.pos = start; - } - return false - }; - pp$1.regexp_eatUncapturingGroup = function(state) { - var start = state.pos; - if (state.eat(0x28 /* ( */)) { - if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) { - this.regexp_disjunction(state); - if (state.eat(0x29 /* ) */)) { - return true - } - state.raise("Unterminated group"); - } - state.pos = start; - } - return false - }; - pp$1.regexp_eatCapturingGroup = function(state) { - if (state.eat(0x28 /* ( */)) { - if (this.options.ecmaVersion >= 9) { - this.regexp_groupSpecifier(state); - } else if (state.current() === 0x3F /* ? */) { - state.raise("Invalid group"); - } - this.regexp_disjunction(state); - if (state.eat(0x29 /* ) */)) { - state.numCapturingParens += 1; - return true - } - state.raise("Unterminated group"); - } - return false - }; +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin + } - // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom - pp$1.regexp_eatExtendedAtom = function(state) { - return ( - state.eat(0x2E /* . */) || - this.regexp_eatReverseSolidusAtomEscape(state) || - this.regexp_eatCharacterClass(state) || - this.regexp_eatUncapturingGroup(state) || - this.regexp_eatCapturingGroup(state) || - this.regexp_eatInvalidBracedQuantifier(state) || - this.regexp_eatExtendedPatternCharacter(state) - ) - }; + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] + } + return origin +} - // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier - pp$1.regexp_eatInvalidBracedQuantifier = function(state) { - if (this.regexp_eatBracedQuantifier(state, true)) { - state.raise("Nothing to repeat"); - } +glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + + if (!pattern) return false - }; - // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter - pp$1.regexp_eatSyntaxCharacter = function(state) { - var ch = state.current(); - if (isSyntaxCharacter(ch)) { - state.lastIntValue = ch; - state.advance(); + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') return true - } - return false - }; - function isSyntaxCharacter(ch) { - return ( - ch === 0x24 /* $ */ || - ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ || - ch === 0x2E /* . */ || - ch === 0x3F /* ? */ || - ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ || - ch >= 0x7B /* { */ && ch <= 0x7D /* } */ - ) } - // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter - // But eat eager. - pp$1.regexp_eatPatternCharacters = function(state) { - var start = state.pos; - var ch = 0; - while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) { - state.advance(); - } - return state.pos !== start - }; + return false +} - // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter - pp$1.regexp_eatExtendedPatternCharacter = function(state) { - var ch = state.current(); - if ( - ch !== -1 && - ch !== 0x24 /* $ */ && - !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) && - ch !== 0x2E /* . */ && - ch !== 0x3F /* ? */ && - ch !== 0x5B /* [ */ && - ch !== 0x5E /* ^ */ && - ch !== 0x7C /* | */ - ) { - state.advance(); - return true - } - return false - }; +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } - // GroupSpecifier :: - // [empty] - // `?` GroupName - pp$1.regexp_groupSpecifier = function(state) { - if (state.eat(0x3F /* ? */)) { - if (this.regexp_eatGroupName(state)) { - if (state.groupNames.indexOf(state.lastStringValue) !== -1) { - state.raise("Duplicate capture group name"); - } - state.groupNames.push(state.lastStringValue); - return - } - state.raise("Invalid group"); - } - }; + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } - // GroupName :: - // `<` RegExpIdentifierName `>` - // Note: this updates `state.lastStringValue` property with the eaten name. - pp$1.regexp_eatGroupName = function(state) { - state.lastStringValue = ""; - if (state.eat(0x3C /* < */)) { - if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) { - return true - } - state.raise("Invalid capture group name"); - } - return false - }; + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) - // RegExpIdentifierName :: - // RegExpIdentifierStart - // RegExpIdentifierName RegExpIdentifierPart - // Note: this updates `state.lastStringValue` property with the eaten name. - pp$1.regexp_eatRegExpIdentifierName = function(state) { - state.lastStringValue = ""; - if (this.regexp_eatRegExpIdentifierStart(state)) { - state.lastStringValue += codePointToString(state.lastIntValue); - while (this.regexp_eatRegExpIdentifierPart(state)) { - state.lastStringValue += codePointToString(state.lastIntValue); - } - return true - } - return false - }; + setopts(this, pattern, options) + this._didRealPath = false - // RegExpIdentifierStart :: - // UnicodeIDStart - // `$` - // `_` - // `\` RegExpUnicodeEscapeSequence[+U] - pp$1.regexp_eatRegExpIdentifierStart = function(state) { - var start = state.pos; - var forceU = this.options.ecmaVersion >= 11; - var ch = state.current(forceU); - state.advance(forceU); + // process each pattern in the minimatch set + var n = this.minimatch.set.length - if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { - ch = state.lastIntValue; - } - if (isRegExpIdentifierStart(ch)) { - state.lastIntValue = ch; - return true - } + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) - state.pos = start; - return false - }; - function isRegExpIdentifierStart(ch) { - return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) } - // RegExpIdentifierPart :: - // UnicodeIDContinue - // `$` - // `_` - // `\` RegExpUnicodeEscapeSequence[+U] - // - // - pp$1.regexp_eatRegExpIdentifierPart = function(state) { - var start = state.pos; - var forceU = this.options.ecmaVersion >= 11; - var ch = state.current(forceU); - state.advance(forceU); + var self = this + this._processing = 0 - if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { - ch = state.lastIntValue; - } - if (isRegExpIdentifierPart(ch)) { - state.lastIntValue = ch; - return true - } + this._emitQueue = [] + this._processQueue = [] + this.paused = false - state.pos = start; - return false - }; - function isRegExpIdentifierPart(ch) { - return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* */ || ch === 0x200D /* */ + if (this.noprocess) + return this + + if (n === 0) + return done() + + var sync = true + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) } + sync = false - // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape - pp$1.regexp_eatAtomEscape = function(state) { - if ( - this.regexp_eatBackReference(state) || - this.regexp_eatCharacterClassEscape(state) || - this.regexp_eatCharacterEscape(state) || - (state.switchN && this.regexp_eatKGroupName(state)) - ) { - return true - } - if (state.switchU) { - // Make the same message as V8. - if (state.current() === 0x63 /* c */) { - state.raise("Invalid unicode escape"); - } - state.raise("Invalid escape"); - } - return false - }; - pp$1.regexp_eatBackReference = function(state) { - var start = state.pos; - if (this.regexp_eatDecimalEscape(state)) { - var n = state.lastIntValue; - if (state.switchU) { - // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape - if (n > state.maxBackReference) { - state.maxBackReference = n; - } - return true - } - if (n <= state.numCapturingParens) { - return true - } - state.pos = start; - } - return false - }; - pp$1.regexp_eatKGroupName = function(state) { - if (state.eat(0x6B /* k */)) { - if (this.regexp_eatGroupName(state)) { - state.backReferenceNames.push(state.lastStringValue); - return true + function done () { + --self._processing + if (self._processing <= 0) { + if (sync) { + process.nextTick(function () { + self._finish() + }) + } else { + self._finish() } - state.raise("Invalid named reference"); } - return false - }; + } +} - // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape - pp$1.regexp_eatCharacterEscape = function(state) { - return ( - this.regexp_eatControlEscape(state) || - this.regexp_eatCControlLetter(state) || - this.regexp_eatZero(state) || - this.regexp_eatHexEscapeSequence(state) || - this.regexp_eatRegExpUnicodeEscapeSequence(state, false) || - (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) || - this.regexp_eatIdentityEscape(state) - ) - }; - pp$1.regexp_eatCControlLetter = function(state) { - var start = state.pos; - if (state.eat(0x63 /* c */)) { - if (this.regexp_eatControlLetter(state)) { - return true - } - state.pos = start; - } - return false - }; - pp$1.regexp_eatZero = function(state) { - if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) { - state.lastIntValue = 0; - state.advance(); - return true - } - return false - }; +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return - // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape - pp$1.regexp_eatControlEscape = function(state) { - var ch = state.current(); - if (ch === 0x74 /* t */) { - state.lastIntValue = 0x09; /* \t */ - state.advance(); - return true - } - if (ch === 0x6E /* n */) { - state.lastIntValue = 0x0A; /* \n */ - state.advance(); - return true - } - if (ch === 0x76 /* v */) { - state.lastIntValue = 0x0B; /* \v */ - state.advance(); - return true - } - if (ch === 0x66 /* f */) { - state.lastIntValue = 0x0C; /* \f */ - state.advance(); - return true - } - if (ch === 0x72 /* r */) { - state.lastIntValue = 0x0D; /* \r */ - state.advance(); - return true - } - return false - }; + if (this.realpath && !this._didRealpath) + return this._realpath() - // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter - pp$1.regexp_eatControlLetter = function(state) { - var ch = state.current(); - if (isControlLetter(ch)) { - state.lastIntValue = ch % 0x20; - state.advance(); - return true - } - return false - }; - function isControlLetter(ch) { - return ( - (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) || - (ch >= 0x61 /* a */ && ch <= 0x7A /* z */) - ) - } + common.finish(this) + this.emit('end', this.found) +} - // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence - pp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) { - if ( forceU === void 0 ) forceU = false; +Glob.prototype._realpath = function () { + if (this._didRealpath) + return - var start = state.pos; - var switchU = forceU || state.switchU; + this._didRealpath = true - if (state.eat(0x75 /* u */)) { - if (this.regexp_eatFixedHexDigits(state, 4)) { - var lead = state.lastIntValue; - if (switchU && lead >= 0xD800 && lead <= 0xDBFF) { - var leadSurrogateEnd = state.pos; - if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) { - var trail = state.lastIntValue; - if (trail >= 0xDC00 && trail <= 0xDFFF) { - state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; - return true - } - } - state.pos = leadSurrogateEnd; - state.lastIntValue = lead; - } - return true - } - if ( - switchU && - state.eat(0x7B /* { */) && - this.regexp_eatHexDigits(state) && - state.eat(0x7D /* } */) && - isValidUnicode(state.lastIntValue) - ) { - return true - } - if (switchU) { - state.raise("Invalid unicode escape"); - } - state.pos = start; - } + var n = this.matches.length + if (n === 0) + return this._finish() - return false - }; - function isValidUnicode(ch) { - return ch >= 0 && ch <= 0x10FFFF + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() } +} - // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape - pp$1.regexp_eatIdentityEscape = function(state) { - if (state.switchU) { - if (this.regexp_eatSyntaxCharacter(state)) { - return true - } - if (state.eat(0x2F /* / */)) { - state.lastIntValue = 0x2F; /* / */ - return true - } - return false - } +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() - var ch = state.current(); - if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) { - state.lastIntValue = ch; - state.advance(); - return true - } + var found = Object.keys(matchset) + var self = this + var n = found.length - return false - }; + if (n === 0) + return cb() - // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape - pp$1.regexp_eatDecimalEscape = function(state) { - state.lastIntValue = 0; - var ch = state.current(); - if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) { - do { - state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); - state.advance(); - } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) - return true - } - return false - }; + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + rp.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here - // Return values used by character set parsing methods, needed to - // forbid negation of sets that can match strings. - var CharSetNone = 0; // Nothing parsed - var CharSetOk = 1; // Construct parsed, cannot contain strings - var CharSetString = 2; // Construct parsed, can contain strings + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} - // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape - pp$1.regexp_eatCharacterClassEscape = function(state) { - var ch = state.current(); +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} - if (isCharacterClassEscape(ch)) { - state.lastIntValue = -1; - state.advance(); - return CharSetOk - } +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} - var negate = false; - if ( - state.switchU && - this.options.ecmaVersion >= 9 && - ((negate = ch === 0x50 /* P */) || ch === 0x70 /* p */) - ) { - state.lastIntValue = -1; - state.advance(); - var result; - if ( - state.eat(0x7B /* { */) && - (result = this.regexp_eatUnicodePropertyValueExpression(state)) && - state.eat(0x7D /* } */) - ) { - if (negate && result === CharSetString) { state.raise("Invalid property name"); } - return result +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) } - state.raise("Invalid property name"); } + } +} - return CharSetNone - }; +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') - function isCharacterClassEscape(ch) { - return ( - ch === 0x64 /* d */ || - ch === 0x44 /* D */ || - ch === 0x73 /* s */ || - ch === 0x53 /* S */ || - ch === 0x77 /* w */ || - ch === 0x57 /* W */ - ) + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return } - // UnicodePropertyValueExpression :: - // UnicodePropertyName `=` UnicodePropertyValue - // LoneUnicodePropertyNameOrValue - pp$1.regexp_eatUnicodePropertyValueExpression = function(state) { - var start = state.pos; + //console.error('PROCESS %d', this._processing, pattern) - // UnicodePropertyName `=` UnicodePropertyValue - if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) { - var name = state.lastStringValue; - if (this.regexp_eatUnicodePropertyValue(state)) { - var value = state.lastStringValue; - this.regexp_validateUnicodePropertyNameAndValue(state, name, value); - return CharSetOk - } - } - state.pos = start; + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. - // LoneUnicodePropertyNameOrValue - if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) { - var nameOrValue = state.lastStringValue; - return this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue) - } - return CharSetNone - }; + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return - pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { - if (!hasOwn(state.unicodeProperties.nonBinary, name)) - { state.raise("Invalid property name"); } - if (!state.unicodeProperties.nonBinary[name].test(value)) - { state.raise("Invalid property value"); } - }; + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break - pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { - if (state.unicodeProperties.binary.test(nameOrValue)) { return CharSetOk } - if (state.switchV && state.unicodeProperties.binaryOfStrings.test(nameOrValue)) { return CharSetString } - state.raise("Invalid property name"); - }; + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } - // UnicodePropertyName :: - // UnicodePropertyNameCharacters - pp$1.regexp_eatUnicodePropertyName = function(state) { - var ch = 0; - state.lastStringValue = ""; - while (isUnicodePropertyNameCharacter(ch = state.current())) { - state.lastStringValue += codePointToString(ch); - state.advance(); - } - return state.lastStringValue !== "" - }; + var remain = pattern.slice(n) - function isUnicodePropertyNameCharacter(ch) { - return isControlLetter(ch) || ch === 0x5F /* _ */ - } + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix - // UnicodePropertyValue :: - // UnicodePropertyValueCharacters - pp$1.regexp_eatUnicodePropertyValue = function(state) { - var ch = 0; - state.lastStringValue = ""; - while (isUnicodePropertyValueCharacter(ch = state.current())) { - state.lastStringValue += codePointToString(ch); - state.advance(); - } - return state.lastStringValue !== "" - }; - function isUnicodePropertyValueCharacter(ch) { - return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch) - } + var abs = this._makeAbs(read) - // LoneUnicodePropertyNameOrValue :: - // UnicodePropertyValueCharacters - pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { - return this.regexp_eatUnicodePropertyValue(state) - }; + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() - // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass - pp$1.regexp_eatCharacterClass = function(state) { - if (state.eat(0x5B /* [ */)) { - var negate = state.eat(0x5E /* ^ */); - var result = this.regexp_classContents(state); - if (!state.eat(0x5D /* ] */)) - { state.raise("Unterminated character class"); } - if (negate && result === CharSetString) - { state.raise("Negated character class may contain strings"); } - return true - } - return false - }; + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} - // https://tc39.es/ecma262/#prod-ClassContents - // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges - pp$1.regexp_classContents = function(state) { - if (state.current() === 0x5D /* ] */) { return CharSetOk } - if (state.switchV) { return this.regexp_classSetExpression(state) } - this.regexp_nonEmptyClassRanges(state); - return CharSetOk - }; +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} - // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges - // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash - pp$1.regexp_nonEmptyClassRanges = function(state) { - while (this.regexp_eatClassAtom(state)) { - var left = state.lastIntValue; - if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) { - var right = state.lastIntValue; - if (state.switchU && (left === -1 || right === -1)) { - state.raise("Invalid character class"); - } - if (left !== -1 && right !== -1 && left > right) { - state.raise("Range out of order in character class"); - } +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) } + if (m) + matchedEntries.push(e) } - }; + } - // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom - // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash - pp$1.regexp_eatClassAtom = function(state) { - var start = state.pos; + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) - if (state.eat(0x5C /* \ */)) { - if (this.regexp_eatClassEscape(state)) { - return true + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e } - if (state.switchU) { - // Make the same message as V8. - var ch$1 = state.current(); - if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) { - state.raise("Invalid class escape"); - } - state.raise("Invalid escape"); + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) } - state.pos = start; + this._emitMatch(index, e) } + // This was the last one, and no stats were needed + return cb() + } - var ch = state.current(); - if (ch !== 0x5D /* ] */) { - state.lastIntValue = ch; - state.advance(); - return true + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} - return false - }; +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return - // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape - pp$1.regexp_eatClassEscape = function(state) { - var start = state.pos; + if (isIgnored(this, e)) + return - if (state.eat(0x62 /* b */)) { - state.lastIntValue = 0x08; /* */ - return true - } + if (this.paused) { + this._emitQueue.push([index, e]) + return + } - if (state.switchU && state.eat(0x2D /* - */)) { - state.lastIntValue = 0x2D; /* - */ - return true - } + var abs = isAbsolute(e) ? e : this._makeAbs(e) - if (!state.switchU && state.eat(0x63 /* c */)) { - if (this.regexp_eatClassControlLetter(state)) { - return true - } - state.pos = start; - } + if (this.mark) + e = this._mark(e) - return ( - this.regexp_eatCharacterClassEscape(state) || - this.regexp_eatCharacterEscape(state) - ) - }; + if (this.absolute) + e = abs - // https://tc39.es/ecma262/#prod-ClassSetExpression - // https://tc39.es/ecma262/#prod-ClassUnion - // https://tc39.es/ecma262/#prod-ClassIntersection - // https://tc39.es/ecma262/#prod-ClassSubtraction - pp$1.regexp_classSetExpression = function(state) { - var result = CharSetOk, subResult; - if (this.regexp_eatClassSetRange(state)) ; else if (subResult = this.regexp_eatClassSetOperand(state)) { - if (subResult === CharSetString) { result = CharSetString; } - // https://tc39.es/ecma262/#prod-ClassIntersection - var start = state.pos; - while (state.eatChars([0x26, 0x26] /* && */)) { - if ( - state.current() !== 0x26 /* & */ && - (subResult = this.regexp_eatClassSetOperand(state)) - ) { - if (subResult !== CharSetString) { result = CharSetOk; } - continue - } - state.raise("Invalid character in character class"); - } - if (start !== state.pos) { return result } - // https://tc39.es/ecma262/#prod-ClassSubtraction - while (state.eatChars([0x2D, 0x2D] /* -- */)) { - if (this.regexp_eatClassSetOperand(state)) { continue } - state.raise("Invalid character in character class"); - } - if (start !== state.pos) { return result } - } else { - state.raise("Invalid character in character class"); - } - // https://tc39.es/ecma262/#prod-ClassUnion - for (;;) { - if (this.regexp_eatClassSetRange(state)) { continue } - subResult = this.regexp_eatClassSetOperand(state); - if (!subResult) { return result } - if (subResult === CharSetString) { result = CharSetString; } - } - }; + if (this.matches[index][e]) + return - // https://tc39.es/ecma262/#prod-ClassSetRange - pp$1.regexp_eatClassSetRange = function(state) { - var start = state.pos; - if (this.regexp_eatClassSetCharacter(state)) { - var left = state.lastIntValue; - if (state.eat(0x2D /* - */) && this.regexp_eatClassSetCharacter(state)) { - var right = state.lastIntValue; - if (left !== -1 && right !== -1 && left > right) { - state.raise("Range out of order in character class"); - } - return true - } - state.pos = start; - } - return false - }; + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } - // https://tc39.es/ecma262/#prod-ClassSetOperand - pp$1.regexp_eatClassSetOperand = function(state) { - if (this.regexp_eatClassSetCharacter(state)) { return CharSetOk } - return this.regexp_eatClassStringDisjunction(state) || this.regexp_eatNestedClass(state) - }; + this.matches[index][e] = true - // https://tc39.es/ecma262/#prod-NestedClass - pp$1.regexp_eatNestedClass = function(state) { - var start = state.pos; - if (state.eat(0x5B /* [ */)) { - var negate = state.eat(0x5E /* ^ */); - var result = this.regexp_classContents(state); - if (state.eat(0x5D /* ] */)) { - if (negate && result === CharSetString) { - state.raise("Negated character class may contain strings"); - } - return result - } - state.pos = start; - } - if (state.eat(0x5C /* \ */)) { - var result$1 = this.regexp_eatCharacterClassEscape(state); - if (result$1) { - return result$1 - } - state.pos = start; - } - return null - }; + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) - // https://tc39.es/ecma262/#prod-ClassStringDisjunction - pp$1.regexp_eatClassStringDisjunction = function(state) { - var start = state.pos; - if (state.eatChars([0x5C, 0x71] /* \q */)) { - if (state.eat(0x7B /* { */)) { - var result = this.regexp_classStringDisjunctionContents(state); - if (state.eat(0x7D /* } */)) { - return result - } - } else { - // Make the same message as V8. - state.raise("Invalid escape"); - } - state.pos = start; - } - return null - }; + this.emit('match', e) +} - // https://tc39.es/ecma262/#prod-ClassStringDisjunctionContents - pp$1.regexp_classStringDisjunctionContents = function(state) { - var result = this.regexp_classString(state); - while (state.eat(0x7C /* | */)) { - if (this.regexp_classString(state) === CharSetString) { result = CharSetString; } - } - return result - }; +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return - // https://tc39.es/ecma262/#prod-ClassString - // https://tc39.es/ecma262/#prod-NonEmptyClassString - pp$1.regexp_classString = function(state) { - var count = 0; - while (this.regexp_eatClassSetCharacter(state)) { count++; } - return count === 1 ? CharSetOk : CharSetString - }; + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) - // https://tc39.es/ecma262/#prod-ClassSetCharacter - pp$1.regexp_eatClassSetCharacter = function(state) { - var start = state.pos; - if (state.eat(0x5C /* \ */)) { - if ( - this.regexp_eatCharacterEscape(state) || - this.regexp_eatClassSetReservedPunctuator(state) - ) { - return true - } - if (state.eat(0x62 /* b */)) { - state.lastIntValue = 0x08; /* */ - return true - } - state.pos = start; - return false - } - var ch = state.current(); - if (ch < 0 || ch === state.lookahead() && isClassSetReservedDoublePunctuatorCharacter(ch)) { return false } - if (isClassSetSyntaxCharacter(ch)) { return false } - state.advance(); - state.lastIntValue = ch; - return true - }; + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) - // https://tc39.es/ecma262/#prod-ClassSetReservedDoublePunctuator - function isClassSetReservedDoublePunctuatorCharacter(ch) { - return ( - ch === 0x21 /* ! */ || - ch >= 0x23 /* # */ && ch <= 0x26 /* & */ || - ch >= 0x2A /* * */ && ch <= 0x2C /* , */ || - ch === 0x2E /* . */ || - ch >= 0x3A /* : */ && ch <= 0x40 /* @ */ || - ch === 0x5E /* ^ */ || - ch === 0x60 /* ` */ || - ch === 0x7E /* ~ */ - ) - } + if (lstatcb) + fs.lstat(abs, lstatcb) - // https://tc39.es/ecma262/#prod-ClassSetSyntaxCharacter - function isClassSetSyntaxCharacter(ch) { - return ( - ch === 0x28 /* ( */ || - ch === 0x29 /* ) */ || - ch === 0x2D /* - */ || - ch === 0x2F /* / */ || - ch >= 0x5B /* [ */ && ch <= 0x5D /* ] */ || - ch >= 0x7B /* { */ && ch <= 0x7D /* } */ - ) - } + function lstatcb_ (er, lstat) { + if (er && er.code === 'ENOENT') + return cb() - // https://tc39.es/ecma262/#prod-ClassSetReservedPunctuator - pp$1.regexp_eatClassSetReservedPunctuator = function(state) { - var ch = state.current(); - if (isClassSetReservedPunctuator(ch)) { - state.lastIntValue = ch; - state.advance(); - return true - } - return false - }; + var isSym = lstat && lstat.isSymbolicLink() + self.symlinks[abs] = isSym - // https://tc39.es/ecma262/#prod-ClassSetReservedPunctuator - function isClassSetReservedPunctuator(ch) { - return ( - ch === 0x21 /* ! */ || - ch === 0x23 /* # */ || - ch === 0x25 /* % */ || - ch === 0x26 /* & */ || - ch === 0x2C /* , */ || - ch === 0x2D /* - */ || - ch >= 0x3A /* : */ && ch <= 0x3E /* > */ || - ch === 0x40 /* @ */ || - ch === 0x60 /* ` */ || - ch === 0x7E /* ~ */ - ) + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) } +} - // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter - pp$1.regexp_eatClassControlLetter = function(state) { - var ch = state.current(); - if (isDecimalDigit(ch) || ch === 0x5F /* _ */) { - state.lastIntValue = ch % 0x20; - state.advance(); - return true - } - return false - }; +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return - // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence - pp$1.regexp_eatHexEscapeSequence = function(state) { - var start = state.pos; - if (state.eat(0x78 /* x */)) { - if (this.regexp_eatFixedHexDigits(state, 2)) { - return true - } - if (state.switchU) { - state.raise("Invalid escape"); - } - state.pos = start; - } - return false - }; + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return - // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits - pp$1.regexp_eatDecimalDigits = function(state) { - var start = state.pos; - var ch = 0; - state.lastIntValue = 0; - while (isDecimalDigit(ch = state.current())) { - state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); - state.advance(); - } - return state.pos !== start - }; - function isDecimalDigit(ch) { - return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */ - } + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) - // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits - pp$1.regexp_eatHexDigits = function(state) { - var start = state.pos; - var ch = 0; - state.lastIntValue = 0; - while (isHexDigit(ch = state.current())) { - state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); - state.advance(); - } - return state.pos !== start - }; - function isHexDigit(ch) { - return ( - (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) || - (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) || - (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) - ) + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) } - function hexToInt(ch) { - if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) { - return 10 + (ch - 0x41 /* A */) - } - if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) { - return 10 + (ch - 0x61 /* a */) - } - return ch - 0x30 /* 0 */ + + var self = this + fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) } +} - // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence - // Allows only 0-377(octal) i.e. 0-255(decimal). - pp$1.regexp_eatLegacyOctalEscapeSequence = function(state) { - if (this.regexp_eatOctalDigit(state)) { - var n1 = state.lastIntValue; - if (this.regexp_eatOctalDigit(state)) { - var n2 = state.lastIntValue; - if (n1 <= 3 && this.regexp_eatOctalDigit(state)) { - state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue; - } else { - state.lastIntValue = n1 * 8 + n2; - } - } else { - state.lastIntValue = n1; - } - return true - } - return false - }; +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return - // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit - pp$1.regexp_eatOctalDigit = function(state) { - var ch = state.current(); - if (isOctalDigit(ch)) { - state.lastIntValue = ch - 0x30; /* 0 */ - state.advance(); - return true + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true } - state.lastIntValue = 0; - return false - }; - function isOctalDigit(ch) { - return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */ } - // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits - // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit - // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence - pp$1.regexp_eatFixedHexDigits = function(state, length) { - var start = state.pos; - state.lastIntValue = 0; - for (var i = 0; i < length; ++i) { - var ch = state.current(); - if (!isHexDigit(ch)) { - state.pos = start; - return false - } - state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); - state.advance(); - } - return true - }; + this.cache[abs] = entries + return cb(null, entries) +} - // Object type used to represent tokens. Note that normally, tokens - // simply exist as properties on the parser object. This is only - // used for the onToken callback and the external tokenizer. +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return - var Token = function Token(p) { - this.type = p.type; - this.value = p.value; - this.start = p.start; - this.end = p.end; - if (p.options.locations) - { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); } - if (p.options.ranges) - { this.range = [p.start, p.end]; } - }; + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + this.emit('error', error) + this.abort() + } + break - // ## Tokenizer + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break - var pp = Parser.prototype; + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } - // Move to the next token + return cb() +} - pp.next = function(ignoreEscapeSequenceInKeyword) { - if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) - { this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); } - if (this.options.onToken) - { this.options.onToken(new Token(this)); } +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} - this.lastTokEnd = this.end; - this.lastTokStart = this.start; - this.lastTokEndLoc = this.endLoc; - this.lastTokStartLoc = this.startLoc; - this.nextToken(); - }; - pp.getToken = function() { - this.next(); - return new Token(this) - }; +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) - // If we're in an ES6 environment, make parsers iterable - if (typeof Symbol !== "undefined") - { pp[Symbol.iterator] = function() { - var this$1$1 = this; + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() - return { - next: function () { - var token = this$1$1.getToken(); - return { - done: token.type === types$1.eof, - value: token - } - } - } - }; } + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) - // Toggle strict mode. Re-reads the next number or string to please - // pedantic tests (`"use strict"; 010;` should fail). + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) - // Read a single token, updating the parser object's token-related - // properties. + var isSym = this.symlinks[abs] + var len = entries.length - pp.nextToken = function() { - var curContext = this.curContext(); - if (!curContext || !curContext.preserveSpace) { this.skipSpace(); } + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() - this.start = this.pos; - if (this.options.locations) { this.startLoc = this.curPosition(); } - if (this.pos >= this.input.length) { return this.finishToken(types$1.eof) } + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue - if (curContext.override) { return curContext.override(this) } - else { this.readToken(this.fullCharCodeAtPos()); } - }; + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) - pp.readToken = function(code) { - // Identifier or keyword. '\uXXXX' sequences are allowed in - // identifiers, so '\' also dispatches to that. - if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */) - { return this.readWord() } + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } - return this.getTokenFromCode(code) - }; + cb() +} - pp.fullCharCodeAtPos = function() { - var code = this.input.charCodeAt(this.pos); - if (code <= 0xd7ff || code >= 0xdc00) { return code } - var next = this.input.charCodeAt(this.pos + 1); - return next <= 0xdbff || next >= 0xe000 ? code : (code << 10) + next - 0x35fdc00 - }; +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { - pp.skipBlockComment = function() { - var startLoc = this.options.onComment && this.curPosition(); - var start = this.pos, end = this.input.indexOf("*/", this.pos += 2); - if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); } - this.pos = end + 2; - if (this.options.locations) { - for (var nextBreak = (void 0), pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1;) { - ++this.curLine; - pos = this.lineStart = nextBreak; - } - } - if (this.options.onComment) - { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos, - startLoc, this.curPosition()); } - }; + //console.error('ps2', prefix, exists) - pp.skipLineComment = function(startSkip) { - var start = this.pos; - var startLoc = this.options.onComment && this.curPosition(); - var ch = this.input.charCodeAt(this.pos += startSkip); - while (this.pos < this.input.length && !isNewLine(ch)) { - ch = this.input.charCodeAt(++this.pos); - } - if (this.options.onComment) - { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos, - startLoc, this.curPosition()); } - }; + if (!this.matches[index]) + this.matches[index] = Object.create(null) - // Called at the start of the parse and after every token. Skips - // whitespace and comments, and. + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() - pp.skipSpace = function() { - loop: while (this.pos < this.input.length) { - var ch = this.input.charCodeAt(this.pos); - switch (ch) { - case 32: case 160: // ' ' - ++this.pos; - break - case 13: - if (this.input.charCodeAt(this.pos + 1) === 10) { - ++this.pos; - } - case 10: case 8232: case 8233: - ++this.pos; - if (this.options.locations) { - ++this.curLine; - this.lineStart = this.pos; - } - break - case 47: // '/' - switch (this.input.charCodeAt(this.pos + 1)) { - case 42: // '*' - this.skipBlockComment(); - break - case 47: - this.skipLineComment(2); - break - default: - break loop - } - break - default: - if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { - ++this.pos; - } else { - break loop - } - } + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' } - }; + } - // Called at the end of every token. Sets `end`, `val`, and - // maintains `context` and `exprAllowed`, and skips the space after - // the token, so that the next one's `start` will point at the - // right position. + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') - pp.finishToken = function(type, val) { - this.end = this.pos; - if (this.options.locations) { this.endLoc = this.curPosition(); } - var prevType = this.type; - this.type = type; - this.value = val; + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} - this.updateContext(prevType); - }; +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' - // ### Token reading + if (f.length > this.maxLength) + return cb() - // This is the function that is called to fetch the next token. It - // is somewhat obscure, because it works in character codes rather - // than characters, and because operator parsing has been inlined - // into it. - // - // All in the name of speed. - // - pp.readToken_dot = function() { - var next = this.input.charCodeAt(this.pos + 1); - if (next >= 48 && next <= 57) { return this.readNumber(true) } - var next2 = this.input.charCodeAt(this.pos + 2); - if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.' - this.pos += 3; - return this.finishToken(types$1.ellipsis) - } else { - ++this.pos; - return this.finishToken(types$1.dot) - } - }; + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] - pp.readToken_slash = function() { // '/' - var next = this.input.charCodeAt(this.pos + 1); - if (this.exprAllowed) { ++this.pos; return this.readRegexp() } - if (next === 61) { return this.finishOp(types$1.assign, 2) } - return this.finishOp(types$1.slash, 1) - }; + if (Array.isArray(c)) + c = 'DIR' - pp.readToken_mult_modulo_exp = function(code) { // '%*' - var next = this.input.charCodeAt(this.pos + 1); - var size = 1; - var tokentype = code === 42 ? types$1.star : types$1.modulo; + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) - // exponentiation operator ** and **= - if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) { - ++size; - tokentype = types$1.starstar; - next = this.input.charCodeAt(this.pos + 2); - } + if (needDir && c === 'FILE') + return cb() - if (next === 61) { return this.finishOp(types$1.assign, size + 1) } - return this.finishOp(tokentype, size) - }; + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } - pp.readToken_pipe_amp = function(code) { // '|&' - var next = this.input.charCodeAt(this.pos + 1); - if (next === code) { - if (this.options.ecmaVersion >= 12) { - var next2 = this.input.charCodeAt(this.pos + 2); - if (next2 === 61) { return this.finishOp(types$1.assign, 3) } - } - return this.finishOp(code === 124 ? types$1.logicalOR : types$1.logicalAND, 2) + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) } - if (next === 61) { return this.finishOp(types$1.assign, 2) } - return this.finishOp(code === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1) - }; + } - pp.readToken_caret = function() { // '^' - var next = this.input.charCodeAt(this.pos + 1); - if (next === 61) { return this.finishOp(types$1.assign, 2) } - return this.finishOp(types$1.bitwiseXOR, 1) - }; + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + fs.lstat(abs, statcb) - pp.readToken_plus_min = function(code) { // '+-' - var next = this.input.charCodeAt(this.pos + 1); - if (next === code) { - if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && - (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) { - // A `-->` line comment - this.skipLineComment(3); - this.skipSpace(); - return this.nextToken() - } - return this.finishOp(types$1.incDec, 2) + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) } - if (next === 61) { return this.finishOp(types$1.assign, 2) } - return this.finishOp(types$1.plusMin, 1) - }; + } +} - pp.readToken_lt_gt = function(code) { // '<>' - var next = this.input.charCodeAt(this.pos + 1); - var size = 1; - if (next === code) { - size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; - if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types$1.assign, size + 1) } - return this.finishOp(types$1.bitShift, size) - } - if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && - this.input.charCodeAt(this.pos + 3) === 45) { - // ` regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) + var Scope = function Scope(flags) { + this.flags = flags; + // A list of var-declared names in the current lexical scope + this.var = []; + // A list of lexically-declared names in the current lexical scope + this.lexical = []; + // A list of lexically-declared FunctionDeclaration names in the current lexical scope + this.functions = []; + // A switch to disallow the identifier reference 'arguments' + this.inClassFieldInit = false; + }; - this.debug(this.pattern, set) + // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names. - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return s.indexOf(false) === -1 - }) + pp$3.enterScope = function(flags) { + this.scopeStack.push(new Scope(flags)); + }; - this.debug(this.pattern, set) + pp$3.exitScope = function() { + this.scopeStack.pop(); + }; - this.set = set -} + // The spec says: + // > At the top level of a function, or script, function declarations are + // > treated like var declarations rather than like lexical declarations. + pp$3.treatFunctionsAsVarInScope = function(scope) { + return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP) + }; -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - var negate = false - var options = this.options - var negateOffset = 0 + pp$3.declareName = function(name, bindingType, pos) { + var redeclared = false; + if (bindingType === BIND_LEXICAL) { + var scope = this.currentScope(); + redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1; + scope.lexical.push(name); + if (this.inModule && (scope.flags & SCOPE_TOP)) + { delete this.undefinedExports[name]; } + } else if (bindingType === BIND_SIMPLE_CATCH) { + var scope$1 = this.currentScope(); + scope$1.lexical.push(name); + } else if (bindingType === BIND_FUNCTION) { + var scope$2 = this.currentScope(); + if (this.treatFunctionsAsVar) + { redeclared = scope$2.lexical.indexOf(name) > -1; } + else + { redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; } + scope$2.functions.push(name); + } else { + for (var i = this.scopeStack.length - 1; i >= 0; --i) { + var scope$3 = this.scopeStack[i]; + if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) || + !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) { + redeclared = true; + break + } + scope$3.var.push(name); + if (this.inModule && (scope$3.flags & SCOPE_TOP)) + { delete this.undefinedExports[name]; } + if (scope$3.flags & SCOPE_VAR) { break } + } + } + if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); } + }; - if (options.nonegate) return + pp$3.checkLocalExport = function(id) { + // scope.functions must be empty as Module code is always strict. + if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && + this.scopeStack[0].var.indexOf(id.name) === -1) { + this.undefinedExports[id.name] = id; + } + }; - for (var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === '!' - ; i++) { - negate = !negate - negateOffset++ - } + pp$3.currentScope = function() { + return this.scopeStack[this.scopeStack.length - 1] + }; - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} + pp$3.currentVarScope = function() { + for (var i = this.scopeStack.length - 1;; i--) { + var scope = this.scopeStack[i]; + if (scope.flags & SCOPE_VAR) { return scope } + } + }; -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return braceExpand(pattern, options) -} + // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`. + pp$3.currentThisScope = function() { + for (var i = this.scopeStack.length - 1;; i--) { + var scope = this.scopeStack[i]; + if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope } + } + }; -Minimatch.prototype.braceExpand = braceExpand + var Node = function Node(parser, pos, loc) { + this.type = ""; + this.start = pos; + this.end = 0; + if (parser.options.locations) + { this.loc = new SourceLocation(parser, loc); } + if (parser.options.directSourceFile) + { this.sourceFile = parser.options.directSourceFile; } + if (parser.options.ranges) + { this.range = [pos, 0]; } + }; -function braceExpand (pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options - } else { - options = {} - } - } + // Start an AST node, attaching a start offset. - pattern = typeof pattern === 'undefined' - ? this.pattern : pattern + var pp$2 = Parser.prototype; - assertValidPattern(pattern) + pp$2.startNode = function() { + return new Node(this, this.start, this.startLoc) + }; - // Thanks to Yeting Li for - // improving this regexp to avoid a ReDOS vulnerability. - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - // shortcut. no need to expand. - return [pattern] - } + pp$2.startNodeAt = function(pos, loc) { + return new Node(this, pos, loc) + }; - return expand(pattern) -} + // Finish an AST node, adding `type` and `end` properties. -var MAX_PATTERN_LENGTH = 1024 * 64 -var assertValidPattern = function (pattern) { - if (typeof pattern !== 'string') { - throw new TypeError('invalid pattern') + function finishNodeAt(node, type, pos, loc) { + node.type = type; + node.end = pos; + if (this.options.locations) + { node.loc.end = loc; } + if (this.options.ranges) + { node.range[1] = pos; } + return node } - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError('pattern is too long') - } -} + pp$2.finishNode = function(node, type) { + return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc) + }; -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - assertValidPattern(pattern) + // Finish node at given position - var options = this.options + pp$2.finishNodeAt = function(node, type, pos, loc) { + return finishNodeAt.call(this, node, type, pos, loc) + }; - // shortcuts - if (pattern === '**') { - if (!options.noglobstar) - return GLOBSTAR - else - pattern = '*' - } - if (pattern === '') return '' + pp$2.copyNode = function(node) { + var newNode = new Node(this, node.start, this.startLoc); + for (var prop in node) { newNode[prop] = node[prop]; } + return newNode + }; - var re = '' - var hasMagic = !!options.nocase - var escaping = false - // ? => one single character - var patternListStack = [] - var negativeLists = [] - var stateChar - var inClass = false - var reClassStart = -1 - var classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - var patternStart = pattern.charAt(0) === '.' ? '' // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' - : '(?!\\.)' - var self = this + // This file contains Unicode properties extracted from the ECMAScript specification. + // The lists are extracted like so: + // $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText) - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break - } - self.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } + // #table-binary-unicode-properties + var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS"; + var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic"; + var ecma11BinaryProperties = ecma10BinaryProperties; + var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict"; + var ecma13BinaryProperties = ecma12BinaryProperties; + var ecma14BinaryProperties = ecma13BinaryProperties; - for (var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) + var unicodeBinaryProperties = { + 9: ecma9BinaryProperties, + 10: ecma10BinaryProperties, + 11: ecma11BinaryProperties, + 12: ecma12BinaryProperties, + 13: ecma13BinaryProperties, + 14: ecma14BinaryProperties + }; - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += '\\' + c - escaping = false - continue - } + // #table-binary-unicode-properties-of-strings + var ecma14BinaryPropertiesOfStrings = "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"; - switch (c) { - /* istanbul ignore next */ - case '/': { - // completely not allowed, even escaped. - // Should already be path-split by now. - return false - } + var unicodeBinaryPropertiesOfStrings = { + 9: "", + 10: "", + 11: "", + 12: "", + 13: "", + 14: ecma14BinaryPropertiesOfStrings + }; - case '\\': - clearStateChar() - escaping = true - continue + // #table-unicode-general-category-values + var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu"; - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) + // #table-unicode-script-values + var ecma9ScriptValues = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb"; + var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd"; + var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"; + var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi"; + var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith"; + var ecma14ScriptValues = ecma13ScriptValues + " Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz"; - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } + var unicodeScriptValues = { + 9: ecma9ScriptValues, + 10: ecma10ScriptValues, + 11: ecma11ScriptValues, + 12: ecma12ScriptValues, + 13: ecma13ScriptValues, + 14: ecma14ScriptValues + }; - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - self.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue + var data = {}; + function buildUnicodeData(ecmaVersion) { + var d = data[ecmaVersion] = { + binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues), + binaryOfStrings: wordsRegexp(unicodeBinaryPropertiesOfStrings[ecmaVersion]), + nonBinary: { + General_Category: wordsRegexp(unicodeGeneralCategoryValues), + Script: wordsRegexp(unicodeScriptValues[ecmaVersion]) + } + }; + d.nonBinary.Script_Extensions = d.nonBinary.Script; - case '(': - if (inClass) { - re += '(' - continue - } + d.nonBinary.gc = d.nonBinary.General_Category; + d.nonBinary.sc = d.nonBinary.Script; + d.nonBinary.scx = d.nonBinary.Script_Extensions; + } - if (!stateChar) { - re += '\\(' - continue - } + for (var i = 0, list = [9, 10, 11, 12, 13, 14]; i < list.length; i += 1) { + var ecmaVersion = list[i]; - patternListStack.push({ - type: stateChar, - start: i - 1, - reStart: re.length, - open: plTypes[stateChar].open, - close: plTypes[stateChar].close - }) - // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!(?:' : '(?:' - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue + buildUnicodeData(ecmaVersion); + } - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue - } - - clearStateChar() - hasMagic = true - var pl = patternListStack.pop() - // negation is (?:(?!js)[^/]*) - // The others are (?:) - re += pl.close - if (pl.type === '!') { - negativeLists.push(pl) - } - pl.reEnd = re.length - continue - - case '|': - if (inClass || !patternListStack.length || escaping) { - re += '\\|' - escaping = false - continue - } - - clearStateChar() - re += '|' - continue - - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() - - if (inClass) { - re += '\\' + c - continue - } - - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - escaping = false - continue - } - - // handle the case where we left a class open. - // "[z-a]" is valid, equivalent to "\[z-a\]" - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - var cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - var sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue - } - - // finish up the class. - hasMagic = true - inClass = false - re += c - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === '^' && inClass)) { - re += '\\' - } - - re += c - - } // switch - } // for - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.substr(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] - } - - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + pl.open.length) - this.debug('setting tail', re, pl) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } - - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) - - this.debug('tail=%j\n %s', tail, tail, pl, re) - var t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail - } - - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' - } + var pp$1 = Parser.prototype; - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case '[': case '.': case '(': addPatternStart = true - } + var RegExpValidationState = function RegExpValidationState(parser) { + this.parser = parser; + this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "") + (parser.options.ecmaVersion >= 15 ? "v" : ""); + this.unicodeProperties = data[parser.options.ecmaVersion >= 14 ? 14 : parser.options.ecmaVersion]; + this.source = ""; + this.flags = ""; + this.start = 0; + this.switchU = false; + this.switchV = false; + this.switchN = false; + this.pos = 0; + this.lastIntValue = 0; + this.lastStringValue = ""; + this.lastAssertionIsQuantifiable = false; + this.numCapturingParens = 0; + this.maxBackReference = 0; + this.groupNames = []; + this.backReferenceNames = []; + }; - // Hack to work around lack of negative lookbehind in JS - // A pattern like: *.!(x).!(y|z) needs to ensure that a name - // like 'a.xyz.yz' doesn't match. So, the first negative - // lookahead, has to look ALL the way ahead, to the end of - // the pattern. - for (var n = negativeLists.length - 1; n > -1; n--) { - var nl = negativeLists[n] + RegExpValidationState.prototype.reset = function reset (start, pattern, flags) { + var unicodeSets = flags.indexOf("v") !== -1; + var unicode = flags.indexOf("u") !== -1; + this.start = start | 0; + this.source = pattern + ""; + this.flags = flags; + if (unicodeSets && this.parser.options.ecmaVersion >= 15) { + this.switchU = true; + this.switchV = true; + this.switchN = true; + } else { + this.switchU = unicode && this.parser.options.ecmaVersion >= 6; + this.switchV = false; + this.switchN = unicode && this.parser.options.ecmaVersion >= 9; + } + }; - var nlBefore = re.slice(0, nl.reStart) - var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) - var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) - var nlAfter = re.slice(nl.reEnd) + RegExpValidationState.prototype.raise = function raise (message) { + this.parser.raiseRecoverable(this.start, ("Invalid regular expression: /" + (this.source) + "/: " + message)); + }; - nlLast += nlAfter + // If u flag is given, this returns the code point at the index (it combines a surrogate pair). + // Otherwise, this returns the code unit of the index (can be a part of a surrogate pair). + RegExpValidationState.prototype.at = function at (i, forceU) { + if ( forceU === void 0 ) forceU = false; - // Handle nested stuff like *(*.js|!(*.json)), where open parens - // mean that we should *not* include the ) in the bit that is considered - // "after" the negated section. - var openParensBefore = nlBefore.split('(').length - 1 - var cleanAfter = nlAfter - for (i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + var s = this.source; + var l = s.length; + if (i >= l) { + return -1 } - nlAfter = cleanAfter - - var dollar = '' - if (nlAfter === '' && isSub !== SUBPARSE) { - dollar = '$' + var c = s.charCodeAt(i); + if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) { + return c } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast - re = newRe - } - - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) { - re = '(?=.)' + re - } - - if (addPatternStart) { - re = patternStart + re - } + var next = s.charCodeAt(i + 1); + return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c + }; - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] - } + RegExpValidationState.prototype.nextIndex = function nextIndex (i, forceU) { + if ( forceU === void 0 ) forceU = false; - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } + var s = this.source; + var l = s.length; + if (i >= l) { + return l + } + var c = s.charCodeAt(i), next; + if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l || + (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) { + return i + 1 + } + return i + 2 + }; - var flags = options.nocase ? 'i' : '' - try { - var regExp = new RegExp('^' + re + '$', flags) - } catch (er) /* istanbul ignore next - should be impossible */ { - // If it was an invalid regular expression, then it can't match - // anything. This trick looks for a character after the end of - // the string, which is of course impossible, except in multi-line - // mode, but it's not a /m regex. - return new RegExp('$.') - } + RegExpValidationState.prototype.current = function current (forceU) { + if ( forceU === void 0 ) forceU = false; - regExp._glob = pattern - regExp._src = re + return this.at(this.pos, forceU) + }; - return regExp -} + RegExpValidationState.prototype.lookahead = function lookahead (forceU) { + if ( forceU === void 0 ) forceU = false; -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() -} + return this.at(this.nextIndex(this.pos, forceU), forceU) + }; -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp + RegExpValidationState.prototype.advance = function advance (forceU) { + if ( forceU === void 0 ) forceU = false; - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set + this.pos = this.nextIndex(this.pos, forceU); + }; - if (!set.length) { - this.regexp = false - return this.regexp - } - var options = this.options + RegExpValidationState.prototype.eat = function eat (ch, forceU) { + if ( forceU === void 0 ) forceU = false; - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - var flags = options.nocase ? 'i' : '' + if (this.current(forceU) === ch) { + this.advance(forceU); + return true + } + return false + }; - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === 'string') ? regExpEscape(p) - : p._src - }).join('\\\/') - }).join('|') + RegExpValidationState.prototype.eatChars = function eatChars (chs, forceU) { + if ( forceU === void 0 ) forceU = false; - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' + var pos = this.pos; + for (var i = 0, list = chs; i < list.length; i += 1) { + var ch = list[i]; - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' + var current = this.at(pos, forceU); + if (current === -1 || current !== ch) { + return false + } + pos = this.nextIndex(pos, forceU); + } + this.pos = pos; + return true + }; - try { - this.regexp = new RegExp(re, flags) - } catch (ex) /* istanbul ignore next - should be impossible */ { - this.regexp = false - } - return this.regexp -} + /** + * Validate the flags part of a given RegExpLiteral. + * + * @param {RegExpValidationState} state The state to validate RegExp. + * @returns {void} + */ + pp$1.validateRegExpFlags = function(state) { + var validFlags = state.validFlags; + var flags = state.flags; -minimatch.match = function (list, pattern, options) { - options = options || {} - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} + var u = false; + var v = false; -Minimatch.prototype.match = function match (f, partial) { - if (typeof partial === 'undefined') partial = this.partial - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' + for (var i = 0; i < flags.length; i++) { + var flag = flags.charAt(i); + if (validFlags.indexOf(flag) === -1) { + this.raise(state.start, "Invalid regular expression flag"); + } + if (flags.indexOf(flag, i + 1) > -1) { + this.raise(state.start, "Duplicate regular expression flag"); + } + if (flag === "u") { u = true; } + if (flag === "v") { v = true; } + } + if (this.options.ecmaVersion >= 15 && u && v) { + this.raise(state.start, "Invalid regular expression flag"); + } + }; - if (f === '/' && partial) return true + /** + * Validate the pattern part of a given RegExpLiteral. + * + * @param {RegExpValidationState} state The state to validate RegExp. + * @returns {void} + */ + pp$1.validateRegExpPattern = function(state) { + this.regexp_pattern(state); - var options = this.options + // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of + // parsing contains a |GroupName|, reparse with the goal symbol + // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError* + // exception if _P_ did not conform to the grammar, if any elements of _P_ + // were not matched by the parse, or if any Early Error conditions exist. + if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) { + state.switchN = true; + this.regexp_pattern(state); + } + }; - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } + // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern + pp$1.regexp_pattern = function(state) { + state.pos = 0; + state.lastIntValue = 0; + state.lastStringValue = ""; + state.lastAssertionIsQuantifiable = false; + state.numCapturingParens = 0; + state.maxBackReference = 0; + state.groupNames.length = 0; + state.backReferenceNames.length = 0; - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) + this.regexp_disjunction(state); - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. + if (state.pos !== state.source.length) { + // Make the same messages as V8. + if (state.eat(0x29 /* ) */)) { + state.raise("Unmatched ')'"); + } + if (state.eat(0x5D /* ] */) || state.eat(0x7D /* } */)) { + state.raise("Lone quantifier brackets"); + } + } + if (state.maxBackReference > state.numCapturingParens) { + state.raise("Invalid escape"); + } + for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) { + var name = list[i]; - var set = this.set - this.debug(this.pattern, 'set', set) + if (state.groupNames.indexOf(name) === -1) { + state.raise("Invalid named capture referenced"); + } + } + }; - // Find the basename of the path by looking for the last non-empty segment - var filename - var i - for (i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break - } + // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction + pp$1.regexp_disjunction = function(state) { + this.regexp_alternative(state); + while (state.eat(0x7C /* | */)) { + this.regexp_alternative(state); + } - for (i = 0; i < set.length; i++) { - var pattern = set[i] - var file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] + // Make the same message as V8. + if (this.regexp_eatQuantifier(state, true)) { + state.raise("Nothing to repeat"); } - var hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate + if (state.eat(0x7B /* { */)) { + state.raise("Lone quantifier brackets"); } - } - - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate -} + }; -// set partial to true to test if, for example, -// "/a/b" matches the start of "/*/b/*/d" -// Partial means, if you run out of file before you run -// out of pattern, then that's fine, as long as all -// the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options + // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative + pp$1.regexp_alternative = function(state) { + while (state.pos < state.source.length && this.regexp_eatTerm(state)) + { } + }; - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term + pp$1.regexp_eatTerm = function(state) { + if (this.regexp_eatAssertion(state)) { + // Handle `QuantifiableAssertion Quantifier` alternative. + // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion + // is a QuantifiableAssertion. + if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) { + // Make the same message as V8. + if (state.switchU) { + state.raise("Invalid quantifier"); + } + } + return true + } - this.debug('matchOne', file.length, pattern.length) + if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) { + this.regexp_eatQuantifier(state); + return true + } - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] + return false + }; - this.debug(pattern, p, f) + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion + pp$1.regexp_eatAssertion = function(state) { + var start = state.pos; + state.lastAssertionIsQuantifiable = false; - // should be impossible. - // some invalid regexp stuff in the set. - /* istanbul ignore if */ - if (p === false) return false + // ^, $ + if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) { + return true + } - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) + // \b \B + if (state.eat(0x5C /* \ */)) { + if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) { + return true + } + state.pos = start; + } - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false + // Lookahead / Lookbehind + if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) { + var lookbehind = false; + if (this.options.ecmaVersion >= 9) { + lookbehind = state.eat(0x3C /* < */); + } + if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) { + this.regexp_disjunction(state); + if (!state.eat(0x29 /* ) */)) { + state.raise("Unterminated group"); } + state.lastAssertionIsQuantifiable = !lookbehind; return true } + } - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] + state.pos = start; + return false + }; - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) + // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier + pp$1.regexp_eatQuantifier = function(state, noError) { + if ( noError === void 0 ) noError = false; - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } + if (this.regexp_eatQuantifierPrefix(state, noError)) { + state.eat(0x3F /* ? */); + return true + } + return false + }; - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ + // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix + pp$1.regexp_eatQuantifierPrefix = function(state, noError) { + return ( + state.eat(0x2A /* * */) || + state.eat(0x2B /* + */) || + state.eat(0x3F /* ? */) || + this.regexp_eatBracedQuantifier(state, noError) + ) + }; + pp$1.regexp_eatBracedQuantifier = function(state, noError) { + var start = state.pos; + if (state.eat(0x7B /* { */)) { + var min = 0, max = -1; + if (this.regexp_eatDecimalDigits(state)) { + min = state.lastIntValue; + if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) { + max = state.lastIntValue; + } + if (state.eat(0x7D /* } */)) { + // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term + if (max !== -1 && max < min && !noError) { + state.raise("numbers out of order in {} quantifier"); + } + return true } } - - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - /* istanbul ignore if */ - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true + if (state.switchU && !noError) { + state.raise("Incomplete quantifier"); } - return false + state.pos = start; } + return false + }; - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - hit = f === p - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) + // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom + pp$1.regexp_eatAtom = function(state) { + return ( + this.regexp_eatPatternCharacters(state) || + state.eat(0x2E /* . */) || + this.regexp_eatReverseSolidusAtomEscape(state) || + this.regexp_eatCharacterClass(state) || + this.regexp_eatUncapturingGroup(state) || + this.regexp_eatCapturingGroup(state) + ) + }; + pp$1.regexp_eatReverseSolidusAtomEscape = function(state) { + var start = state.pos; + if (state.eat(0x5C /* \ */)) { + if (this.regexp_eatAtomEscape(state)) { + return true + } + state.pos = start; + } + return false + }; + pp$1.regexp_eatUncapturingGroup = function(state) { + var start = state.pos; + if (state.eat(0x28 /* ( */)) { + if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) { + this.regexp_disjunction(state); + if (state.eat(0x29 /* ) */)) { + return true + } + state.raise("Unterminated group"); + } + state.pos = start; + } + return false + }; + pp$1.regexp_eatCapturingGroup = function(state) { + if (state.eat(0x28 /* ( */)) { + if (this.options.ecmaVersion >= 9) { + this.regexp_groupSpecifier(state); + } else if (state.current() === 0x3F /* ? */) { + state.raise("Invalid group"); + } + this.regexp_disjunction(state); + if (state.eat(0x29 /* ) */)) { + state.numCapturingParens += 1; + return true + } + state.raise("Unterminated group"); } + return false + }; - if (!hit) return false - } + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom + pp$1.regexp_eatExtendedAtom = function(state) { + return ( + state.eat(0x2E /* . */) || + this.regexp_eatReverseSolidusAtomEscape(state) || + this.regexp_eatCharacterClass(state) || + this.regexp_eatUncapturingGroup(state) || + this.regexp_eatCapturingGroup(state) || + this.regexp_eatInvalidBracedQuantifier(state) || + this.regexp_eatExtendedPatternCharacter(state) + ) + }; - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier + pp$1.regexp_eatInvalidBracedQuantifier = function(state) { + if (this.regexp_eatBracedQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + return false + }; - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else /* istanbul ignore else */ if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - return (fi === fl - 1) && (file[fi] === '') + // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter + pp$1.regexp_eatSyntaxCharacter = function(state) { + var ch = state.current(); + if (isSyntaxCharacter(ch)) { + state.lastIntValue = ch; + state.advance(); + return true + } + return false + }; + function isSyntaxCharacter(ch) { + return ( + ch === 0x24 /* $ */ || + ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ || + ch === 0x2E /* . */ || + ch === 0x3F /* ? */ || + ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ || + ch >= 0x7B /* { */ && ch <= 0x7D /* } */ + ) } - // should be unreachable. - /* istanbul ignore next */ - throw new Error('wtf?') -} - -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, '$1') -} - -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') -} - - -/***/ }), - -/***/ 8184: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var concatMap = __nccwpck_require__(6891); -var balanced = __nccwpck_require__(9417); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} + // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter + // But eat eager. + pp$1.regexp_eatPatternCharacters = function(state) { + var start = state.pos; + var ch = 0; + while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) { + state.advance(); + } + return state.pos !== start + }; -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter + pp$1.regexp_eatExtendedPatternCharacter = function(state) { + var ch = state.current(); + if ( + ch !== -1 && + ch !== 0x24 /* $ */ && + !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) && + ch !== 0x2E /* . */ && + ch !== 0x3F /* ? */ && + ch !== 0x5B /* [ */ && + ch !== 0x5E /* ^ */ && + ch !== 0x7C /* | */ + ) { + state.advance(); + return true + } + return false + }; + // GroupSpecifier :: + // [empty] + // `?` GroupName + pp$1.regexp_groupSpecifier = function(state) { + if (state.eat(0x3F /* ? */)) { + if (this.regexp_eatGroupName(state)) { + if (state.groupNames.indexOf(state.lastStringValue) !== -1) { + state.raise("Duplicate capture group name"); + } + state.groupNames.push(state.lastStringValue); + return + } + state.raise("Invalid group"); + } + }; -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; + // GroupName :: + // `<` RegExpIdentifierName `>` + // Note: this updates `state.lastStringValue` property with the eaten name. + pp$1.regexp_eatGroupName = function(state) { + state.lastStringValue = ""; + if (state.eat(0x3C /* < */)) { + if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) { + return true + } + state.raise("Invalid capture group name"); + } + return false + }; - var parts = []; - var m = balanced('{', '}', str); + // RegExpIdentifierName :: + // RegExpIdentifierStart + // RegExpIdentifierName RegExpIdentifierPart + // Note: this updates `state.lastStringValue` property with the eaten name. + pp$1.regexp_eatRegExpIdentifierName = function(state) { + state.lastStringValue = ""; + if (this.regexp_eatRegExpIdentifierStart(state)) { + state.lastStringValue += codePointToString(state.lastIntValue); + while (this.regexp_eatRegExpIdentifierPart(state)) { + state.lastStringValue += codePointToString(state.lastIntValue); + } + return true + } + return false + }; - if (!m) - return str.split(','); + // RegExpIdentifierStart :: + // UnicodeIDStart + // `$` + // `_` + // `\` RegExpUnicodeEscapeSequence[+U] + pp$1.regexp_eatRegExpIdentifierStart = function(state) { + var start = state.pos; + var forceU = this.options.ecmaVersion >= 11; + var ch = state.current(forceU); + state.advance(forceU); - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); + if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierStart(ch)) { + state.lastIntValue = ch; + return true + } - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); + state.pos = start; + return false + }; + function isRegExpIdentifierStart(ch) { + return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ } - parts.push.apply(parts, p); - - return parts; -} + // RegExpIdentifierPart :: + // UnicodeIDContinue + // `$` + // `_` + // `\` RegExpUnicodeEscapeSequence[+U] + // + // + pp$1.regexp_eatRegExpIdentifierPart = function(state) { + var start = state.pos; + var forceU = this.options.ecmaVersion >= 11; + var ch = state.current(forceU); + state.advance(forceU); -function expandTop(str) { - if (!str) - return []; + if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierPart(ch)) { + state.lastIntValue = ch; + return true + } - // I don't know why Bash 4.3 does this, but it does. - // Anything starting with {} will have the first two bytes preserved - // but *only* at the top level, so {},a}b will not expand to anything, - // but a{},b}c will be expanded to [a}c,abc]. - // One could argue that this is a bug in Bash, but since the goal of - // this module is to match Bash's rules, we escape a leading {} - if (str.substr(0, 2) === '{}') { - str = '\\{\\}' + str.substr(2); + state.pos = start; + return false + }; + function isRegExpIdentifierPart(ch) { + return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* */ || ch === 0x200D /* */ } - return expand(escapeBraces(str), true).map(unescapeBraces); -} - -function identity(e) { - return e; -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str, isTop) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(',') >= 0; - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape + pp$1.regexp_eatAtomEscape = function(state) { + if ( + this.regexp_eatBackReference(state) || + this.regexp_eatCharacterClassEscape(state) || + this.regexp_eatCharacterEscape(state) || + (state.switchN && this.regexp_eatKGroupName(state)) + ) { + return true } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); + if (state.switchU) { + // Make the same message as V8. + if (state.current() === 0x63 /* c */) { + state.raise("Invalid unicode escape"); } + state.raise("Invalid escape"); } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. + return false + }; + pp$1.regexp_eatBackReference = function(state) { + var start = state.pos; + if (this.regexp_eatDecimalEscape(state)) { + var n = state.lastIntValue; + if (state.switchU) { + // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape + if (n > state.maxBackReference) { + state.maxBackReference = n; + } + return true + } + if (n <= state.numCapturingParens) { + return true + } + state.pos = start; + } + return false + }; + pp$1.regexp_eatKGroupName = function(state) { + if (state.eat(0x6B /* k */)) { + if (this.regexp_eatGroupName(state)) { + state.backReferenceNames.push(state.lastStringValue); + return true + } + state.raise("Invalid named reference"); + } + return false + }; - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape + pp$1.regexp_eatCharacterEscape = function(state) { + return ( + this.regexp_eatControlEscape(state) || + this.regexp_eatCControlLetter(state) || + this.regexp_eatZero(state) || + this.regexp_eatHexEscapeSequence(state) || + this.regexp_eatRegExpUnicodeEscapeSequence(state, false) || + (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) || + this.regexp_eatIdentityEscape(state) + ) + }; + pp$1.regexp_eatCControlLetter = function(state) { + var start = state.pos; + if (state.eat(0x63 /* c */)) { + if (this.regexp_eatControlLetter(state)) { + return true + } + state.pos = start; + } + return false + }; + pp$1.regexp_eatZero = function(state) { + if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) { + state.lastIntValue = 0; + state.advance(); + return true + } + return false + }; - var N; + // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape + pp$1.regexp_eatControlEscape = function(state) { + var ch = state.current(); + if (ch === 0x74 /* t */) { + state.lastIntValue = 0x09; /* \t */ + state.advance(); + return true + } + if (ch === 0x6E /* n */) { + state.lastIntValue = 0x0A; /* \n */ + state.advance(); + return true + } + if (ch === 0x76 /* v */) { + state.lastIntValue = 0x0B; /* \v */ + state.advance(); + return true + } + if (ch === 0x66 /* f */) { + state.lastIntValue = 0x0C; /* \f */ + state.advance(); + return true + } + if (ch === 0x72 /* r */) { + state.lastIntValue = 0x0D; /* \r */ + state.advance(); + return true + } + return false + }; - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; + // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter + pp$1.regexp_eatControlLetter = function(state) { + var ch = state.current(); + if (isControlLetter(ch)) { + state.lastIntValue = ch % 0x20; + state.advance(); + return true } - var pad = n.some(isPadded); + return false + }; + function isControlLetter(ch) { + return ( + (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) || + (ch >= 0x61 /* a */ && ch <= 0x7A /* z */) + ) + } - N = []; + // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence + pp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) { + if ( forceU === void 0 ) forceU = false; - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; + var start = state.pos; + var switchU = forceU || state.switchU; + + if (state.eat(0x75 /* u */)) { + if (this.regexp_eatFixedHexDigits(state, 4)) { + var lead = state.lastIntValue; + if (switchU && lead >= 0xD800 && lead <= 0xDBFF) { + var leadSurrogateEnd = state.pos; + if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) { + var trail = state.lastIntValue; + if (trail >= 0xDC00 && trail <= 0xDFFF) { + state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; + return true + } } + state.pos = leadSurrogateEnd; + state.lastIntValue = lead; } + return true } - N.push(c); + if ( + switchU && + state.eat(0x7B /* { */) && + this.regexp_eatHexDigits(state) && + state.eat(0x7D /* } */) && + isValidUnicode(state.lastIntValue) + ) { + return true + } + if (switchU) { + state.raise("Invalid unicode escape"); + } + state.pos = start; } - } else { - N = concatMap(n, function(el) { return expand(el, false) }); - } - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } + return false + }; + function isValidUnicode(ch) { + return ch >= 0 && ch <= 0x10FFFF } - return expansions; -} - - - -/***/ }), + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape + pp$1.regexp_eatIdentityEscape = function(state) { + if (state.switchU) { + if (this.regexp_eatSyntaxCharacter(state)) { + return true + } + if (state.eat(0x2F /* / */)) { + state.lastIntValue = 0x2F; /* / */ + return true + } + return false + } -/***/ 5871: -/***/ ((module) => { + var ch = state.current(); + if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) { + state.lastIntValue = ch; + state.advance(); + return true + } -"use strict"; + return false + }; + // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape + pp$1.regexp_eatDecimalEscape = function(state) { + state.lastIntValue = 0; + var ch = state.current(); + if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) { + do { + state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); + state.advance(); + } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) + return true + } + return false + }; -function hasKey(obj, keys) { - var o = obj; - keys.slice(0, -1).forEach(function (key) { - o = o[key] || {}; - }); + // Return values used by character set parsing methods, needed to + // forbid negation of sets that can match strings. + var CharSetNone = 0; // Nothing parsed + var CharSetOk = 1; // Construct parsed, cannot contain strings + var CharSetString = 2; // Construct parsed, can contain strings - var key = keys[keys.length - 1]; - return key in o; -} + // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape + pp$1.regexp_eatCharacterClassEscape = function(state) { + var ch = state.current(); -function isNumber(x) { - if (typeof x === 'number') { return true; } - if ((/^0x[0-9a-f]+$/i).test(x)) { return true; } - return (/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/).test(x); -} + if (isCharacterClassEscape(ch)) { + state.lastIntValue = -1; + state.advance(); + return CharSetOk + } -function isConstructorOrProto(obj, key) { - return (key === 'constructor' && typeof obj[key] === 'function') || key === '__proto__'; -} + var negate = false; + if ( + state.switchU && + this.options.ecmaVersion >= 9 && + ((negate = ch === 0x50 /* P */) || ch === 0x70 /* p */) + ) { + state.lastIntValue = -1; + state.advance(); + var result; + if ( + state.eat(0x7B /* { */) && + (result = this.regexp_eatUnicodePropertyValueExpression(state)) && + state.eat(0x7D /* } */) + ) { + if (negate && result === CharSetString) { state.raise("Invalid property name"); } + return result + } + state.raise("Invalid property name"); + } -module.exports = function (args, opts) { - if (!opts) { opts = {}; } + return CharSetNone + }; - var flags = { - bools: {}, - strings: {}, - unknownFn: null, - }; + function isCharacterClassEscape(ch) { + return ( + ch === 0x64 /* d */ || + ch === 0x44 /* D */ || + ch === 0x73 /* s */ || + ch === 0x53 /* S */ || + ch === 0x77 /* w */ || + ch === 0x57 /* W */ + ) + } - if (typeof opts.unknown === 'function') { - flags.unknownFn = opts.unknown; - } + // UnicodePropertyValueExpression :: + // UnicodePropertyName `=` UnicodePropertyValue + // LoneUnicodePropertyNameOrValue + pp$1.regexp_eatUnicodePropertyValueExpression = function(state) { + var start = state.pos; - if (typeof opts.boolean === 'boolean' && opts.boolean) { - flags.allBools = true; - } else { - [].concat(opts.boolean).filter(Boolean).forEach(function (key) { - flags.bools[key] = true; - }); - } + // UnicodePropertyName `=` UnicodePropertyValue + if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) { + var name = state.lastStringValue; + if (this.regexp_eatUnicodePropertyValue(state)) { + var value = state.lastStringValue; + this.regexp_validateUnicodePropertyNameAndValue(state, name, value); + return CharSetOk + } + } + state.pos = start; - var aliases = {}; + // LoneUnicodePropertyNameOrValue + if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) { + var nameOrValue = state.lastStringValue; + return this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue) + } + return CharSetNone + }; - function aliasIsBoolean(key) { - return aliases[key].some(function (x) { - return flags.bools[x]; - }); - } + pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { + if (!hasOwn(state.unicodeProperties.nonBinary, name)) + { state.raise("Invalid property name"); } + if (!state.unicodeProperties.nonBinary[name].test(value)) + { state.raise("Invalid property value"); } + }; - Object.keys(opts.alias || {}).forEach(function (key) { - aliases[key] = [].concat(opts.alias[key]); - aliases[key].forEach(function (x) { - aliases[x] = [key].concat(aliases[key].filter(function (y) { - return x !== y; - })); - }); - }); + pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { + if (state.unicodeProperties.binary.test(nameOrValue)) { return CharSetOk } + if (state.switchV && state.unicodeProperties.binaryOfStrings.test(nameOrValue)) { return CharSetString } + state.raise("Invalid property name"); + }; - [].concat(opts.string).filter(Boolean).forEach(function (key) { - flags.strings[key] = true; - if (aliases[key]) { - [].concat(aliases[key]).forEach(function (k) { - flags.strings[k] = true; - }); - } - }); + // UnicodePropertyName :: + // UnicodePropertyNameCharacters + pp$1.regexp_eatUnicodePropertyName = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyNameCharacter(ch = state.current())) { + state.lastStringValue += codePointToString(ch); + state.advance(); + } + return state.lastStringValue !== "" + }; - var defaults = opts.default || {}; + function isUnicodePropertyNameCharacter(ch) { + return isControlLetter(ch) || ch === 0x5F /* _ */ + } - var argv = { _: [] }; + // UnicodePropertyValue :: + // UnicodePropertyValueCharacters + pp$1.regexp_eatUnicodePropertyValue = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyValueCharacter(ch = state.current())) { + state.lastStringValue += codePointToString(ch); + state.advance(); + } + return state.lastStringValue !== "" + }; + function isUnicodePropertyValueCharacter(ch) { + return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch) + } - function argDefined(key, arg) { - return (flags.allBools && (/^--[^=]+$/).test(arg)) - || flags.strings[key] - || flags.bools[key] - || aliases[key]; - } + // LoneUnicodePropertyNameOrValue :: + // UnicodePropertyValueCharacters + pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { + return this.regexp_eatUnicodePropertyValue(state) + }; - function setKey(obj, keys, value) { - var o = obj; - for (var i = 0; i < keys.length - 1; i++) { - var key = keys[i]; - if (isConstructorOrProto(o, key)) { return; } - if (o[key] === undefined) { o[key] = {}; } - if ( - o[key] === Object.prototype - || o[key] === Number.prototype - || o[key] === String.prototype - ) { - o[key] = {}; - } - if (o[key] === Array.prototype) { o[key] = []; } - o = o[key]; - } + // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass + pp$1.regexp_eatCharacterClass = function(state) { + if (state.eat(0x5B /* [ */)) { + var negate = state.eat(0x5E /* ^ */); + var result = this.regexp_classContents(state); + if (!state.eat(0x5D /* ] */)) + { state.raise("Unterminated character class"); } + if (negate && result === CharSetString) + { state.raise("Negated character class may contain strings"); } + return true + } + return false + }; - var lastKey = keys[keys.length - 1]; - if (isConstructorOrProto(o, lastKey)) { return; } - if ( - o === Object.prototype - || o === Number.prototype - || o === String.prototype - ) { - o = {}; - } - if (o === Array.prototype) { o = []; } - if (o[lastKey] === undefined || flags.bools[lastKey] || typeof o[lastKey] === 'boolean') { - o[lastKey] = value; - } else if (Array.isArray(o[lastKey])) { - o[lastKey].push(value); - } else { - o[lastKey] = [o[lastKey], value]; - } - } + // https://tc39.es/ecma262/#prod-ClassContents + // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges + pp$1.regexp_classContents = function(state) { + if (state.current() === 0x5D /* ] */) { return CharSetOk } + if (state.switchV) { return this.regexp_classSetExpression(state) } + this.regexp_nonEmptyClassRanges(state); + return CharSetOk + }; - function setArg(key, val, arg) { - if (arg && flags.unknownFn && !argDefined(key, arg)) { - if (flags.unknownFn(arg) === false) { return; } - } + // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges + // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash + pp$1.regexp_nonEmptyClassRanges = function(state) { + while (this.regexp_eatClassAtom(state)) { + var left = state.lastIntValue; + if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) { + var right = state.lastIntValue; + if (state.switchU && (left === -1 || right === -1)) { + state.raise("Invalid character class"); + } + if (left !== -1 && right !== -1 && left > right) { + state.raise("Range out of order in character class"); + } + } + } + }; - var value = !flags.strings[key] && isNumber(val) - ? Number(val) - : val; - setKey(argv, key.split('.'), value); + // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom + // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash + pp$1.regexp_eatClassAtom = function(state) { + var start = state.pos; - (aliases[key] || []).forEach(function (x) { - setKey(argv, x.split('.'), value); - }); - } + if (state.eat(0x5C /* \ */)) { + if (this.regexp_eatClassEscape(state)) { + return true + } + if (state.switchU) { + // Make the same message as V8. + var ch$1 = state.current(); + if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) { + state.raise("Invalid class escape"); + } + state.raise("Invalid escape"); + } + state.pos = start; + } - Object.keys(flags.bools).forEach(function (key) { - setArg(key, defaults[key] === undefined ? false : defaults[key]); - }); + var ch = state.current(); + if (ch !== 0x5D /* ] */) { + state.lastIntValue = ch; + state.advance(); + return true + } - var notFlags = []; + return false + }; - if (args.indexOf('--') !== -1) { - notFlags = args.slice(args.indexOf('--') + 1); - args = args.slice(0, args.indexOf('--')); - } + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape + pp$1.regexp_eatClassEscape = function(state) { + var start = state.pos; - for (var i = 0; i < args.length; i++) { - var arg = args[i]; - var key; - var next; + if (state.eat(0x62 /* b */)) { + state.lastIntValue = 0x08; /* */ + return true + } - if ((/^--.+=/).test(arg)) { - // Using [\s\S] instead of . because js doesn't support the - // 'dotall' regex modifier. See: - // http://stackoverflow.com/a/1068308/13216 - var m = arg.match(/^--([^=]+)=([\s\S]*)$/); - key = m[1]; - var value = m[2]; - if (flags.bools[key]) { - value = value !== 'false'; - } - setArg(key, value, arg); - } else if ((/^--no-.+/).test(arg)) { - key = arg.match(/^--no-(.+)/)[1]; - setArg(key, false, arg); - } else if ((/^--.+/).test(arg)) { - key = arg.match(/^--(.+)/)[1]; - next = args[i + 1]; - if ( - next !== undefined - && !(/^(-|--)[^-]/).test(next) - && !flags.bools[key] - && !flags.allBools - && (aliases[key] ? !aliasIsBoolean(key) : true) - ) { - setArg(key, next, arg); - i += 1; - } else if ((/^(true|false)$/).test(next)) { - setArg(key, next === 'true', arg); - i += 1; - } else { - setArg(key, flags.strings[key] ? '' : true, arg); - } - } else if ((/^-[^-]+/).test(arg)) { - var letters = arg.slice(1, -1).split(''); + if (state.switchU && state.eat(0x2D /* - */)) { + state.lastIntValue = 0x2D; /* - */ + return true + } - var broken = false; - for (var j = 0; j < letters.length; j++) { - next = arg.slice(j + 2); + if (!state.switchU && state.eat(0x63 /* c */)) { + if (this.regexp_eatClassControlLetter(state)) { + return true + } + state.pos = start; + } - if (next === '-') { - setArg(letters[j], next, arg); - continue; - } + return ( + this.regexp_eatCharacterClassEscape(state) || + this.regexp_eatCharacterEscape(state) + ) + }; - if ((/[A-Za-z]/).test(letters[j]) && next[0] === '=') { - setArg(letters[j], next.slice(1), arg); - broken = true; - break; - } + // https://tc39.es/ecma262/#prod-ClassSetExpression + // https://tc39.es/ecma262/#prod-ClassUnion + // https://tc39.es/ecma262/#prod-ClassIntersection + // https://tc39.es/ecma262/#prod-ClassSubtraction + pp$1.regexp_classSetExpression = function(state) { + var result = CharSetOk, subResult; + if (this.regexp_eatClassSetRange(state)) ; else if (subResult = this.regexp_eatClassSetOperand(state)) { + if (subResult === CharSetString) { result = CharSetString; } + // https://tc39.es/ecma262/#prod-ClassIntersection + var start = state.pos; + while (state.eatChars([0x26, 0x26] /* && */)) { + if ( + state.current() !== 0x26 /* & */ && + (subResult = this.regexp_eatClassSetOperand(state)) + ) { + if (subResult !== CharSetString) { result = CharSetOk; } + continue + } + state.raise("Invalid character in character class"); + } + if (start !== state.pos) { return result } + // https://tc39.es/ecma262/#prod-ClassSubtraction + while (state.eatChars([0x2D, 0x2D] /* -- */)) { + if (this.regexp_eatClassSetOperand(state)) { continue } + state.raise("Invalid character in character class"); + } + if (start !== state.pos) { return result } + } else { + state.raise("Invalid character in character class"); + } + // https://tc39.es/ecma262/#prod-ClassUnion + for (;;) { + if (this.regexp_eatClassSetRange(state)) { continue } + subResult = this.regexp_eatClassSetOperand(state); + if (!subResult) { return result } + if (subResult === CharSetString) { result = CharSetString; } + } + }; - if ( - (/[A-Za-z]/).test(letters[j]) - && (/-?\d+(\.\d*)?(e-?\d+)?$/).test(next) - ) { - setArg(letters[j], next, arg); - broken = true; - break; - } + // https://tc39.es/ecma262/#prod-ClassSetRange + pp$1.regexp_eatClassSetRange = function(state) { + var start = state.pos; + if (this.regexp_eatClassSetCharacter(state)) { + var left = state.lastIntValue; + if (state.eat(0x2D /* - */) && this.regexp_eatClassSetCharacter(state)) { + var right = state.lastIntValue; + if (left !== -1 && right !== -1 && left > right) { + state.raise("Range out of order in character class"); + } + return true + } + state.pos = start; + } + return false + }; - if (letters[j + 1] && letters[j + 1].match(/\W/)) { - setArg(letters[j], arg.slice(j + 2), arg); - broken = true; - break; - } else { - setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg); - } - } + // https://tc39.es/ecma262/#prod-ClassSetOperand + pp$1.regexp_eatClassSetOperand = function(state) { + if (this.regexp_eatClassSetCharacter(state)) { return CharSetOk } + return this.regexp_eatClassStringDisjunction(state) || this.regexp_eatNestedClass(state) + }; - key = arg.slice(-1)[0]; - if (!broken && key !== '-') { - if ( - args[i + 1] - && !(/^(-|--)[^-]/).test(args[i + 1]) - && !flags.bools[key] - && (aliases[key] ? !aliasIsBoolean(key) : true) - ) { - setArg(key, args[i + 1], arg); - i += 1; - } else if (args[i + 1] && (/^(true|false)$/).test(args[i + 1])) { - setArg(key, args[i + 1] === 'true', arg); - i += 1; - } else { - setArg(key, flags.strings[key] ? '' : true, arg); - } - } - } else { - if (!flags.unknownFn || flags.unknownFn(arg) !== false) { - argv._.push(flags.strings._ || !isNumber(arg) ? arg : Number(arg)); - } - if (opts.stopEarly) { - argv._.push.apply(argv._, args.slice(i + 1)); - break; - } - } - } + // https://tc39.es/ecma262/#prod-NestedClass + pp$1.regexp_eatNestedClass = function(state) { + var start = state.pos; + if (state.eat(0x5B /* [ */)) { + var negate = state.eat(0x5E /* ^ */); + var result = this.regexp_classContents(state); + if (state.eat(0x5D /* ] */)) { + if (negate && result === CharSetString) { + state.raise("Negated character class may contain strings"); + } + return result + } + state.pos = start; + } + if (state.eat(0x5C /* \ */)) { + var result$1 = this.regexp_eatCharacterClassEscape(state); + if (result$1) { + return result$1 + } + state.pos = start; + } + return null + }; - Object.keys(defaults).forEach(function (k) { - if (!hasKey(argv, k.split('.'))) { - setKey(argv, k.split('.'), defaults[k]); + // https://tc39.es/ecma262/#prod-ClassStringDisjunction + pp$1.regexp_eatClassStringDisjunction = function(state) { + var start = state.pos; + if (state.eatChars([0x5C, 0x71] /* \q */)) { + if (state.eat(0x7B /* { */)) { + var result = this.regexp_classStringDisjunctionContents(state); + if (state.eat(0x7D /* } */)) { + return result + } + } else { + // Make the same message as V8. + state.raise("Invalid escape"); + } + state.pos = start; + } + return null + }; - (aliases[k] || []).forEach(function (x) { - setKey(argv, x.split('.'), defaults[k]); - }); - } - }); + // https://tc39.es/ecma262/#prod-ClassStringDisjunctionContents + pp$1.regexp_classStringDisjunctionContents = function(state) { + var result = this.regexp_classString(state); + while (state.eat(0x7C /* | */)) { + if (this.regexp_classString(state) === CharSetString) { result = CharSetString; } + } + return result + }; - if (opts['--']) { - argv['--'] = notFlags.slice(); - } else { - notFlags.forEach(function (k) { - argv._.push(k); - }); - } + // https://tc39.es/ecma262/#prod-ClassString + // https://tc39.es/ecma262/#prod-NonEmptyClassString + pp$1.regexp_classString = function(state) { + var count = 0; + while (this.regexp_eatClassSetCharacter(state)) { count++; } + return count === 1 ? CharSetOk : CharSetString + }; - return argv; -}; + // https://tc39.es/ecma262/#prod-ClassSetCharacter + pp$1.regexp_eatClassSetCharacter = function(state) { + var start = state.pos; + if (state.eat(0x5C /* \ */)) { + if ( + this.regexp_eatCharacterEscape(state) || + this.regexp_eatClassSetReservedPunctuator(state) + ) { + return true + } + if (state.eat(0x62 /* b */)) { + state.lastIntValue = 0x08; /* */ + return true + } + state.pos = start; + return false + } + var ch = state.current(); + if (ch < 0 || ch === state.lookahead() && isClassSetReservedDoublePunctuatorCharacter(ch)) { return false } + if (isClassSetSyntaxCharacter(ch)) { return false } + state.advance(); + state.lastIntValue = ch; + return true + }; + // https://tc39.es/ecma262/#prod-ClassSetReservedDoublePunctuator + function isClassSetReservedDoublePunctuatorCharacter(ch) { + return ( + ch === 0x21 /* ! */ || + ch >= 0x23 /* # */ && ch <= 0x26 /* & */ || + ch >= 0x2A /* * */ && ch <= 0x2C /* , */ || + ch === 0x2E /* . */ || + ch >= 0x3A /* : */ && ch <= 0x40 /* @ */ || + ch === 0x5E /* ^ */ || + ch === 0x60 /* ` */ || + ch === 0x7E /* ~ */ + ) + } -/***/ }), + // https://tc39.es/ecma262/#prod-ClassSetSyntaxCharacter + function isClassSetSyntaxCharacter(ch) { + return ( + ch === 0x28 /* ( */ || + ch === 0x29 /* ) */ || + ch === 0x2D /* - */ || + ch === 0x2F /* / */ || + ch >= 0x5B /* [ */ && ch <= 0x5D /* ] */ || + ch >= 0x7B /* { */ && ch <= 0x7D /* } */ + ) + } -/***/ 768: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // https://tc39.es/ecma262/#prod-ClassSetReservedPunctuator + pp$1.regexp_eatClassSetReservedPunctuator = function(state) { + var ch = state.current(); + if (isClassSetReservedPunctuator(ch)) { + state.lastIntValue = ch; + state.advance(); + return true + } + return false + }; -"use strict"; + // https://tc39.es/ecma262/#prod-ClassSetReservedPunctuator + function isClassSetReservedPunctuator(ch) { + return ( + ch === 0x21 /* ! */ || + ch === 0x23 /* # */ || + ch === 0x25 /* % */ || + ch === 0x26 /* & */ || + ch === 0x2C /* , */ || + ch === 0x2D /* - */ || + ch >= 0x3A /* : */ && ch <= 0x3E /* > */ || + ch === 0x40 /* @ */ || + ch === 0x60 /* ` */ || + ch === 0x7E /* ~ */ + ) + } + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter + pp$1.regexp_eatClassControlLetter = function(state) { + var ch = state.current(); + if (isDecimalDigit(ch) || ch === 0x5F /* _ */) { + state.lastIntValue = ch % 0x20; + state.advance(); + return true + } + return false + }; -const fs = __nccwpck_require__(7758) -const path = __nccwpck_require__(1017) -const mkdirsSync = (__nccwpck_require__(4139).mkdirsSync) -const utimesMillisSync = (__nccwpck_require__(6942).utimesMillisSync) -const stat = __nccwpck_require__(4683) + // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence + pp$1.regexp_eatHexEscapeSequence = function(state) { + var start = state.pos; + if (state.eat(0x78 /* x */)) { + if (this.regexp_eatFixedHexDigits(state, 2)) { + return true + } + if (state.switchU) { + state.raise("Invalid escape"); + } + state.pos = start; + } + return false + }; -function copySync (src, dest, opts) { - if (typeof opts === 'function') { - opts = { filter: opts } + // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits + pp$1.regexp_eatDecimalDigits = function(state) { + var start = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isDecimalDigit(ch = state.current())) { + state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); + state.advance(); + } + return state.pos !== start + }; + function isDecimalDigit(ch) { + return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */ } - opts = opts || {} - opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now - opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber - - // Warn about using preserveTimestamps on 32-bit node - if (opts.preserveTimestamps && process.arch === 'ia32') { - process.emitWarning( - 'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' + - '\tsee https://github.com/jprichardson/node-fs-extra/issues/269', - 'Warning', 'fs-extra-WARN0002' + // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits + pp$1.regexp_eatHexDigits = function(state) { + var start = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isHexDigit(ch = state.current())) { + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); + } + return state.pos !== start + }; + function isHexDigit(ch) { + return ( + (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) || + (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) || + (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) ) } + function hexToInt(ch) { + if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) { + return 10 + (ch - 0x41 /* A */) + } + if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) { + return 10 + (ch - 0x61 /* a */) + } + return ch - 0x30 /* 0 */ + } - const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy', opts) - stat.checkParentPathsSync(src, srcStat, dest, 'copy') - if (opts.filter && !opts.filter(src, dest)) return - const destParent = path.dirname(dest) - if (!fs.existsSync(destParent)) mkdirsSync(destParent) - return getStats(destStat, src, dest, opts) -} + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence + // Allows only 0-377(octal) i.e. 0-255(decimal). + pp$1.regexp_eatLegacyOctalEscapeSequence = function(state) { + if (this.regexp_eatOctalDigit(state)) { + var n1 = state.lastIntValue; + if (this.regexp_eatOctalDigit(state)) { + var n2 = state.lastIntValue; + if (n1 <= 3 && this.regexp_eatOctalDigit(state)) { + state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue; + } else { + state.lastIntValue = n1 * 8 + n2; + } + } else { + state.lastIntValue = n1; + } + return true + } + return false + }; -function getStats (destStat, src, dest, opts) { - const statSync = opts.dereference ? fs.statSync : fs.lstatSync - const srcStat = statSync(src) + // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit + pp$1.regexp_eatOctalDigit = function(state) { + var ch = state.current(); + if (isOctalDigit(ch)) { + state.lastIntValue = ch - 0x30; /* 0 */ + state.advance(); + return true + } + state.lastIntValue = 0; + return false + }; + function isOctalDigit(ch) { + return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */ + } - if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts) - else if (srcStat.isFile() || - srcStat.isCharacterDevice() || - srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts) - else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts) - else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`) - else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`) - throw new Error(`Unknown file: ${src}`) -} + // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits + // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit + // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence + pp$1.regexp_eatFixedHexDigits = function(state, length) { + var start = state.pos; + state.lastIntValue = 0; + for (var i = 0; i < length; ++i) { + var ch = state.current(); + if (!isHexDigit(ch)) { + state.pos = start; + return false + } + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); + } + return true + }; -function onFile (srcStat, destStat, src, dest, opts) { - if (!destStat) return copyFile(srcStat, src, dest, opts) - return mayCopyFile(srcStat, src, dest, opts) -} + // Object type used to represent tokens. Note that normally, tokens + // simply exist as properties on the parser object. This is only + // used for the onToken callback and the external tokenizer. -function mayCopyFile (srcStat, src, dest, opts) { - if (opts.overwrite) { - fs.unlinkSync(dest) - return copyFile(srcStat, src, dest, opts) - } else if (opts.errorOnExist) { - throw new Error(`'${dest}' already exists`) - } -} + var Token = function Token(p) { + this.type = p.type; + this.value = p.value; + this.start = p.start; + this.end = p.end; + if (p.options.locations) + { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); } + if (p.options.ranges) + { this.range = [p.start, p.end]; } + }; -function copyFile (srcStat, src, dest, opts) { - fs.copyFileSync(src, dest) - if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest) - return setDestMode(dest, srcStat.mode) -} + // ## Tokenizer -function handleTimestamps (srcMode, src, dest) { - // Make sure the file is writable before setting the timestamp - // otherwise open fails with EPERM when invoked with 'r+' - // (through utimes call) - if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode) - return setDestTimestamps(src, dest) -} + var pp = Parser.prototype; -function fileIsNotWritable (srcMode) { - return (srcMode & 0o200) === 0 -} + // Move to the next token -function makeFileWritable (dest, srcMode) { - return setDestMode(dest, srcMode | 0o200) -} + pp.next = function(ignoreEscapeSequenceInKeyword) { + if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) + { this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); } + if (this.options.onToken) + { this.options.onToken(new Token(this)); } -function setDestMode (dest, srcMode) { - return fs.chmodSync(dest, srcMode) -} + this.lastTokEnd = this.end; + this.lastTokStart = this.start; + this.lastTokEndLoc = this.endLoc; + this.lastTokStartLoc = this.startLoc; + this.nextToken(); + }; -function setDestTimestamps (src, dest) { - // The initial srcStat.atime cannot be trusted - // because it is modified by the read(2) system call - // (See https://nodejs.org/api/fs.html#fs_stat_time_values) - const updatedSrcStat = fs.statSync(src) - return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime) -} + pp.getToken = function() { + this.next(); + return new Token(this) + }; -function onDir (srcStat, destStat, src, dest, opts) { - if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts) - return copyDir(src, dest, opts) -} + // If we're in an ES6 environment, make parsers iterable + if (typeof Symbol !== "undefined") + { pp[Symbol.iterator] = function() { + var this$1$1 = this; -function mkDirAndCopy (srcMode, src, dest, opts) { - fs.mkdirSync(dest) - copyDir(src, dest, opts) - return setDestMode(dest, srcMode) -} + return { + next: function () { + var token = this$1$1.getToken(); + return { + done: token.type === types$1.eof, + value: token + } + } + } + }; } -function copyDir (src, dest, opts) { - fs.readdirSync(src).forEach(item => copyDirItem(item, src, dest, opts)) -} + // Toggle strict mode. Re-reads the next number or string to please + // pedantic tests (`"use strict"; 010;` should fail). -function copyDirItem (item, src, dest, opts) { - const srcItem = path.join(src, item) - const destItem = path.join(dest, item) - if (opts.filter && !opts.filter(srcItem, destItem)) return - const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy', opts) - return getStats(destStat, srcItem, destItem, opts) -} + // Read a single token, updating the parser object's token-related + // properties. -function onLink (destStat, src, dest, opts) { - let resolvedSrc = fs.readlinkSync(src) - if (opts.dereference) { - resolvedSrc = path.resolve(process.cwd(), resolvedSrc) - } + pp.nextToken = function() { + var curContext = this.curContext(); + if (!curContext || !curContext.preserveSpace) { this.skipSpace(); } - if (!destStat) { - return fs.symlinkSync(resolvedSrc, dest) - } else { - let resolvedDest - try { - resolvedDest = fs.readlinkSync(dest) - } catch (err) { - // dest exists and is a regular file or directory, - // Windows may throw UNKNOWN error. If dest already exists, - // fs throws error anyway, so no need to guard against it here. - if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest) - throw err - } - if (opts.dereference) { - resolvedDest = path.resolve(process.cwd(), resolvedDest) - } - if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { - throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`) - } + this.start = this.pos; + if (this.options.locations) { this.startLoc = this.curPosition(); } + if (this.pos >= this.input.length) { return this.finishToken(types$1.eof) } - // prevent copy if src is a subdir of dest since unlinking - // dest in this case would result in removing src contents - // and therefore a broken symlink would be created. - if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) { - throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`) + if (curContext.override) { return curContext.override(this) } + else { this.readToken(this.fullCharCodeAtPos()); } + }; + + pp.readToken = function(code) { + // Identifier or keyword. '\uXXXX' sequences are allowed in + // identifiers, so '\' also dispatches to that. + if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */) + { return this.readWord() } + + return this.getTokenFromCode(code) + }; + + pp.fullCharCodeAtPos = function() { + var code = this.input.charCodeAt(this.pos); + if (code <= 0xd7ff || code >= 0xdc00) { return code } + var next = this.input.charCodeAt(this.pos + 1); + return next <= 0xdbff || next >= 0xe000 ? code : (code << 10) + next - 0x35fdc00 + }; + + pp.skipBlockComment = function() { + var startLoc = this.options.onComment && this.curPosition(); + var start = this.pos, end = this.input.indexOf("*/", this.pos += 2); + if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); } + this.pos = end + 2; + if (this.options.locations) { + for (var nextBreak = (void 0), pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1;) { + ++this.curLine; + pos = this.lineStart = nextBreak; + } } - return copyLink(resolvedSrc, dest) - } -} + if (this.options.onComment) + { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos, + startLoc, this.curPosition()); } + }; -function copyLink (resolvedSrc, dest) { - fs.unlinkSync(dest) - return fs.symlinkSync(resolvedSrc, dest) -} + pp.skipLineComment = function(startSkip) { + var start = this.pos; + var startLoc = this.options.onComment && this.curPosition(); + var ch = this.input.charCodeAt(this.pos += startSkip); + while (this.pos < this.input.length && !isNewLine(ch)) { + ch = this.input.charCodeAt(++this.pos); + } + if (this.options.onComment) + { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos, + startLoc, this.curPosition()); } + }; -module.exports = copySync + // Called at the start of the parse and after every token. Skips + // whitespace and comments, and. + pp.skipSpace = function() { + loop: while (this.pos < this.input.length) { + var ch = this.input.charCodeAt(this.pos); + switch (ch) { + case 32: case 160: // ' ' + ++this.pos; + break + case 13: + if (this.input.charCodeAt(this.pos + 1) === 10) { + ++this.pos; + } + case 10: case 8232: case 8233: + ++this.pos; + if (this.options.locations) { + ++this.curLine; + this.lineStart = this.pos; + } + break + case 47: // '/' + switch (this.input.charCodeAt(this.pos + 1)) { + case 42: // '*' + this.skipBlockComment(); + break + case 47: + this.skipLineComment(2); + break + default: + break loop + } + break + default: + if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { + ++this.pos; + } else { + break loop + } + } + } + }; -/***/ }), + // Called at the end of every token. Sets `end`, `val`, and + // maintains `context` and `exprAllowed`, and skips the space after + // the token, so that the next one's `start` will point at the + // right position. -/***/ 3205: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + pp.finishToken = function(type, val) { + this.end = this.pos; + if (this.options.locations) { this.endLoc = this.curPosition(); } + var prevType = this.type; + this.type = type; + this.value = val; -"use strict"; + this.updateContext(prevType); + }; + // ### Token reading -const fs = __nccwpck_require__(7758) -const path = __nccwpck_require__(1017) -const mkdirs = (__nccwpck_require__(4139).mkdirs) -const pathExists = (__nccwpck_require__(821).pathExists) -const utimesMillis = (__nccwpck_require__(6942).utimesMillis) -const stat = __nccwpck_require__(4683) + // This is the function that is called to fetch the next token. It + // is somewhat obscure, because it works in character codes rather + // than characters, and because operator parsing has been inlined + // into it. + // + // All in the name of speed. + // + pp.readToken_dot = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (next >= 48 && next <= 57) { return this.readNumber(true) } + var next2 = this.input.charCodeAt(this.pos + 2); + if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.' + this.pos += 3; + return this.finishToken(types$1.ellipsis) + } else { + ++this.pos; + return this.finishToken(types$1.dot) + } + }; -function copy (src, dest, opts, cb) { - if (typeof opts === 'function' && !cb) { - cb = opts - opts = {} - } else if (typeof opts === 'function') { - opts = { filter: opts } - } + pp.readToken_slash = function() { // '/' + var next = this.input.charCodeAt(this.pos + 1); + if (this.exprAllowed) { ++this.pos; return this.readRegexp() } + if (next === 61) { return this.finishOp(types$1.assign, 2) } + return this.finishOp(types$1.slash, 1) + }; - cb = cb || function () {} - opts = opts || {} + pp.readToken_mult_modulo_exp = function(code) { // '%*' + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + var tokentype = code === 42 ? types$1.star : types$1.modulo; - opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now - opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber + // exponentiation operator ** and **= + if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) { + ++size; + tokentype = types$1.starstar; + next = this.input.charCodeAt(this.pos + 2); + } - // Warn about using preserveTimestamps on 32-bit node - if (opts.preserveTimestamps && process.arch === 'ia32') { - process.emitWarning( - 'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' + - '\tsee https://github.com/jprichardson/node-fs-extra/issues/269', - 'Warning', 'fs-extra-WARN0001' - ) - } + if (next === 61) { return this.finishOp(types$1.assign, size + 1) } + return this.finishOp(tokentype, size) + }; - stat.checkPaths(src, dest, 'copy', opts, (err, stats) => { - if (err) return cb(err) - const { srcStat, destStat } = stats - stat.checkParentPaths(src, srcStat, dest, 'copy', err => { - if (err) return cb(err) - runFilter(src, dest, opts, (err, include) => { - if (err) return cb(err) - if (!include) return cb() + pp.readToken_pipe_amp = function(code) { // '|&' + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { + if (this.options.ecmaVersion >= 12) { + var next2 = this.input.charCodeAt(this.pos + 2); + if (next2 === 61) { return this.finishOp(types$1.assign, 3) } + } + return this.finishOp(code === 124 ? types$1.logicalOR : types$1.logicalAND, 2) + } + if (next === 61) { return this.finishOp(types$1.assign, 2) } + return this.finishOp(code === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1) + }; - checkParentDir(destStat, src, dest, opts, cb) - }) - }) - }) -} + pp.readToken_caret = function() { // '^' + var next = this.input.charCodeAt(this.pos + 1); + if (next === 61) { return this.finishOp(types$1.assign, 2) } + return this.finishOp(types$1.bitwiseXOR, 1) + }; -function checkParentDir (destStat, src, dest, opts, cb) { - const destParent = path.dirname(dest) - pathExists(destParent, (err, dirExists) => { - if (err) return cb(err) - if (dirExists) return getStats(destStat, src, dest, opts, cb) - mkdirs(destParent, err => { - if (err) return cb(err) - return getStats(destStat, src, dest, opts, cb) - }) - }) -} + pp.readToken_plus_min = function(code) { // '+-' + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { + if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && + (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) { + // A `-->` line comment + this.skipLineComment(3); + this.skipSpace(); + return this.nextToken() + } + return this.finishOp(types$1.incDec, 2) + } + if (next === 61) { return this.finishOp(types$1.assign, 2) } + return this.finishOp(types$1.plusMin, 1) + }; -function runFilter (src, dest, opts, cb) { - if (!opts.filter) return cb(null, true) - Promise.resolve(opts.filter(src, dest)) - .then(include => cb(null, include), error => cb(error)) -} + pp.readToken_lt_gt = function(code) { // '<>' + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types$1.assign, size + 1) } + return this.finishOp(types$1.bitShift, size) + } + if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && + this.input.charCodeAt(this.pos + 3) === 45) { + // ` regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return s.indexOf(false) === -1 + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + var negate = false + var options = this.options + var negateOffset = 0 + + if (options.nonegate) return + + for (var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === '!' + ; i++) { + negate = !negate + negateOffset++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return braceExpand(pattern, options) +} + +Minimatch.prototype.braceExpand = braceExpand + +function braceExpand (pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options + } else { + options = {} + } + } + + pattern = typeof pattern === 'undefined' + ? this.pattern : pattern + + assertValidPattern(pattern) + + // Thanks to Yeting Li for + // improving this regexp to avoid a ReDOS vulnerability. + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + // shortcut. no need to expand. + return [pattern] + } + + return expand(pattern) +} + +var MAX_PATTERN_LENGTH = 1024 * 64 +var assertValidPattern = function (pattern) { + if (typeof pattern !== 'string') { + throw new TypeError('invalid pattern') + } + + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError('pattern is too long') + } +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + assertValidPattern(pattern) + + var options = this.options + + // shortcuts + if (pattern === '**') { + if (!options.noglobstar) + return GLOBSTAR + else + pattern = '*' + } + if (pattern === '') return '' + + var re = '' + var hasMagic = !!options.nocase + var escaping = false + // ? => one single character + var patternListStack = [] + var negativeLists = [] + var stateChar + var inClass = false + var reClassStart = -1 + var classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + var patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)' + var self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star + hasMagic = true + break + case '?': + re += qmark + hasMagic = true + break + default: + re += '\\' + stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for (var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += '\\' + c + escaping = false + continue + } + + switch (c) { + /* istanbul ignore next */ + case '/': { + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + } + + case '\\': + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === '!' && i === classStart + 1) c = '^' + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case '(': + if (inClass) { + re += '(' + continue + } + + if (!stateChar) { + re += '\\(' + continue + } + + patternListStack.push({ + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }) + // negation is (?:(?!js)[^/]*) + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ')': + if (inClass || !patternListStack.length) { + re += '\\)' + continue + } + + clearStateChar() + hasMagic = true + var pl = patternListStack.pop() + // negation is (?:(?!js)[^/]*) + // The others are (?:) + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) + } + pl.reEnd = re.length + continue + + case '|': + if (inClass || !patternListStack.length || escaping) { + re += '\\|' + escaping = false + continue + } + + clearStateChar() + re += '|' + continue + + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += '\\' + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c + escaping = false + continue + } + + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === '^' && inClass)) { + re += '\\' + } + + re += c + + } // switch + } // for + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.substr(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\' + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }) + + this.debug('tail=%j\n %s', tail, tail, pl, re) + var t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + t + '\\(' + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += '\\\\' + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case '[': case '.': case '(': addPatternStart = true + } + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n] + + var nlBefore = re.slice(0, nl.reStart) + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + var nlAfter = re.slice(nl.reEnd) + + nlLast += nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1 + var cleanAfter = nlAfter + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + } + nlAfter = cleanAfter + + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } + + if (addPatternStart) { + re = patternStart + re + } + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? 'i' : '' + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) /* istanbul ignore next - should be impossible */ { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) { + this.regexp = false + return this.regexp + } + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + var flags = options.nocase ? 'i' : '' + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === 'string') ? regExpEscape(p) + : p._src + }).join('\\\/') + }).join('|') + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$' + + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$' + + try { + this.regexp = new RegExp(re, flags) + } catch (ex) /* istanbul ignore next - should be impossible */ { + this.regexp = false + } + return this.regexp +} + +minimatch.match = function (list, pattern, options) { + options = options || {} + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (mm.options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = function match (f, partial) { + if (typeof partial === 'undefined') partial = this.partial + this.debug('match', f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === '' + + if (f === '/' && partial) return true + + var options = this.options + + // windows: need to use /, not \ + if (path.sep !== '/') { + f = f.split(path.sep).join('/') + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, 'split', f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, 'set', set) + + // Find the basename of the path by looking for the last non-empty segment + var filename + var i + for (i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } + + for (i = 0; i < set.length; i++) { + var pattern = set[i] + var file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }) + + this.debug('matchOne', file.length, pattern.length) + + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++) { + this.debug('matchOne loop') + var p = pattern[pi] + var f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + /* istanbul ignore if */ + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + var pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr) + break + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr++ + } + } + + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + /* istanbul ignore if */ + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === 'string') { + hit = f === p + this.debug('string match', p, f, hit) + } else { + hit = f.match(p) + this.debug('pattern match', p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else /* istanbul ignore else */ if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + return (fi === fl - 1) && (file[fi] === '') + } + + // should be unreachable. + /* istanbul ignore next */ + throw new Error('wtf?') +} + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, '$1') +} + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') +} + + +/***/ }), + +/***/ 48184: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var concatMap = __nccwpck_require__(86891); +var balanced = __nccwpck_require__(9417); + +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + + return expand(escapeBraces(str), true).map(unescapeBraces); +} + +function identity(e) { + return e; +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + + return expansions; +} + + + +/***/ }), + +/***/ 35871: +/***/ ((module) => { + +"use strict"; + + +function hasKey(obj, keys) { + var o = obj; + keys.slice(0, -1).forEach(function (key) { + o = o[key] || {}; + }); + + var key = keys[keys.length - 1]; + return key in o; +} + +function isNumber(x) { + if (typeof x === 'number') { return true; } + if ((/^0x[0-9a-f]+$/i).test(x)) { return true; } + return (/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/).test(x); +} + +function isConstructorOrProto(obj, key) { + return (key === 'constructor' && typeof obj[key] === 'function') || key === '__proto__'; +} + +module.exports = function (args, opts) { + if (!opts) { opts = {}; } + + var flags = { + bools: {}, + strings: {}, + unknownFn: null, + }; + + if (typeof opts.unknown === 'function') { + flags.unknownFn = opts.unknown; + } + + if (typeof opts.boolean === 'boolean' && opts.boolean) { + flags.allBools = true; + } else { + [].concat(opts.boolean).filter(Boolean).forEach(function (key) { + flags.bools[key] = true; + }); + } + + var aliases = {}; + + function aliasIsBoolean(key) { + return aliases[key].some(function (x) { + return flags.bools[x]; + }); + } + + Object.keys(opts.alias || {}).forEach(function (key) { + aliases[key] = [].concat(opts.alias[key]); + aliases[key].forEach(function (x) { + aliases[x] = [key].concat(aliases[key].filter(function (y) { + return x !== y; + })); + }); + }); + + [].concat(opts.string).filter(Boolean).forEach(function (key) { + flags.strings[key] = true; + if (aliases[key]) { + [].concat(aliases[key]).forEach(function (k) { + flags.strings[k] = true; + }); + } + }); + + var defaults = opts.default || {}; + + var argv = { _: [] }; + + function argDefined(key, arg) { + return (flags.allBools && (/^--[^=]+$/).test(arg)) + || flags.strings[key] + || flags.bools[key] + || aliases[key]; + } + + function setKey(obj, keys, value) { + var o = obj; + for (var i = 0; i < keys.length - 1; i++) { + var key = keys[i]; + if (isConstructorOrProto(o, key)) { return; } + if (o[key] === undefined) { o[key] = {}; } + if ( + o[key] === Object.prototype + || o[key] === Number.prototype + || o[key] === String.prototype + ) { + o[key] = {}; + } + if (o[key] === Array.prototype) { o[key] = []; } + o = o[key]; + } + + var lastKey = keys[keys.length - 1]; + if (isConstructorOrProto(o, lastKey)) { return; } + if ( + o === Object.prototype + || o === Number.prototype + || o === String.prototype + ) { + o = {}; + } + if (o === Array.prototype) { o = []; } + if (o[lastKey] === undefined || flags.bools[lastKey] || typeof o[lastKey] === 'boolean') { + o[lastKey] = value; + } else if (Array.isArray(o[lastKey])) { + o[lastKey].push(value); + } else { + o[lastKey] = [o[lastKey], value]; + } + } + + function setArg(key, val, arg) { + if (arg && flags.unknownFn && !argDefined(key, arg)) { + if (flags.unknownFn(arg) === false) { return; } + } + + var value = !flags.strings[key] && isNumber(val) + ? Number(val) + : val; + setKey(argv, key.split('.'), value); + + (aliases[key] || []).forEach(function (x) { + setKey(argv, x.split('.'), value); + }); + } + + Object.keys(flags.bools).forEach(function (key) { + setArg(key, defaults[key] === undefined ? false : defaults[key]); + }); + + var notFlags = []; + + if (args.indexOf('--') !== -1) { + notFlags = args.slice(args.indexOf('--') + 1); + args = args.slice(0, args.indexOf('--')); + } + + for (var i = 0; i < args.length; i++) { + var arg = args[i]; + var key; + var next; + + if ((/^--.+=/).test(arg)) { + // Using [\s\S] instead of . because js doesn't support the + // 'dotall' regex modifier. See: + // http://stackoverflow.com/a/1068308/13216 + var m = arg.match(/^--([^=]+)=([\s\S]*)$/); + key = m[1]; + var value = m[2]; + if (flags.bools[key]) { + value = value !== 'false'; + } + setArg(key, value, arg); + } else if ((/^--no-.+/).test(arg)) { + key = arg.match(/^--no-(.+)/)[1]; + setArg(key, false, arg); + } else if ((/^--.+/).test(arg)) { + key = arg.match(/^--(.+)/)[1]; + next = args[i + 1]; + if ( + next !== undefined + && !(/^(-|--)[^-]/).test(next) + && !flags.bools[key] + && !flags.allBools + && (aliases[key] ? !aliasIsBoolean(key) : true) + ) { + setArg(key, next, arg); + i += 1; + } else if ((/^(true|false)$/).test(next)) { + setArg(key, next === 'true', arg); + i += 1; + } else { + setArg(key, flags.strings[key] ? '' : true, arg); + } + } else if ((/^-[^-]+/).test(arg)) { + var letters = arg.slice(1, -1).split(''); + + var broken = false; + for (var j = 0; j < letters.length; j++) { + next = arg.slice(j + 2); + + if (next === '-') { + setArg(letters[j], next, arg); + continue; + } + + if ((/[A-Za-z]/).test(letters[j]) && next[0] === '=') { + setArg(letters[j], next.slice(1), arg); + broken = true; + break; + } + + if ( + (/[A-Za-z]/).test(letters[j]) + && (/-?\d+(\.\d*)?(e-?\d+)?$/).test(next) + ) { + setArg(letters[j], next, arg); + broken = true; + break; + } + + if (letters[j + 1] && letters[j + 1].match(/\W/)) { + setArg(letters[j], arg.slice(j + 2), arg); + broken = true; + break; + } else { + setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg); + } + } + + key = arg.slice(-1)[0]; + if (!broken && key !== '-') { + if ( + args[i + 1] + && !(/^(-|--)[^-]/).test(args[i + 1]) + && !flags.bools[key] + && (aliases[key] ? !aliasIsBoolean(key) : true) + ) { + setArg(key, args[i + 1], arg); + i += 1; + } else if (args[i + 1] && (/^(true|false)$/).test(args[i + 1])) { + setArg(key, args[i + 1] === 'true', arg); + i += 1; + } else { + setArg(key, flags.strings[key] ? '' : true, arg); + } + } + } else { + if (!flags.unknownFn || flags.unknownFn(arg) !== false) { + argv._.push(flags.strings._ || !isNumber(arg) ? arg : Number(arg)); + } + if (opts.stopEarly) { + argv._.push.apply(argv._, args.slice(i + 1)); + break; + } + } + } + + Object.keys(defaults).forEach(function (k) { + if (!hasKey(argv, k.split('.'))) { + setKey(argv, k.split('.'), defaults[k]); + + (aliases[k] || []).forEach(function (x) { + setKey(argv, x.split('.'), defaults[k]); + }); + } + }); + + if (opts['--']) { + argv['--'] = notFlags.slice(); + } else { + notFlags.forEach(function (k) { + argv._.push(k); + }); + } + + return argv; +}; + + +/***/ }), + +/***/ 90768: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const fs = __nccwpck_require__(77758) +const path = __nccwpck_require__(71017) +const mkdirsSync = (__nccwpck_require__(54139).mkdirsSync) +const utimesMillisSync = (__nccwpck_require__(96942).utimesMillisSync) +const stat = __nccwpck_require__(84683) + +function copySync (src, dest, opts) { + if (typeof opts === 'function') { + opts = { filter: opts } + } + + opts = opts || {} + opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now + opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber + + // Warn about using preserveTimestamps on 32-bit node + if (opts.preserveTimestamps && process.arch === 'ia32') { + process.emitWarning( + 'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' + + '\tsee https://github.com/jprichardson/node-fs-extra/issues/269', + 'Warning', 'fs-extra-WARN0002' + ) + } + + const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy', opts) + stat.checkParentPathsSync(src, srcStat, dest, 'copy') + if (opts.filter && !opts.filter(src, dest)) return + const destParent = path.dirname(dest) + if (!fs.existsSync(destParent)) mkdirsSync(destParent) + return getStats(destStat, src, dest, opts) +} + +function getStats (destStat, src, dest, opts) { + const statSync = opts.dereference ? fs.statSync : fs.lstatSync + const srcStat = statSync(src) + + if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts) + else if (srcStat.isFile() || + srcStat.isCharacterDevice() || + srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts) + else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts) + else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`) + else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`) + throw new Error(`Unknown file: ${src}`) +} + +function onFile (srcStat, destStat, src, dest, opts) { + if (!destStat) return copyFile(srcStat, src, dest, opts) + return mayCopyFile(srcStat, src, dest, opts) +} + +function mayCopyFile (srcStat, src, dest, opts) { + if (opts.overwrite) { + fs.unlinkSync(dest) + return copyFile(srcStat, src, dest, opts) + } else if (opts.errorOnExist) { + throw new Error(`'${dest}' already exists`) + } +} + +function copyFile (srcStat, src, dest, opts) { + fs.copyFileSync(src, dest) + if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest) + return setDestMode(dest, srcStat.mode) +} + +function handleTimestamps (srcMode, src, dest) { + // Make sure the file is writable before setting the timestamp + // otherwise open fails with EPERM when invoked with 'r+' + // (through utimes call) + if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode) + return setDestTimestamps(src, dest) +} + +function fileIsNotWritable (srcMode) { + return (srcMode & 0o200) === 0 +} + +function makeFileWritable (dest, srcMode) { + return setDestMode(dest, srcMode | 0o200) +} + +function setDestMode (dest, srcMode) { + return fs.chmodSync(dest, srcMode) +} + +function setDestTimestamps (src, dest) { + // The initial srcStat.atime cannot be trusted + // because it is modified by the read(2) system call + // (See https://nodejs.org/api/fs.html#fs_stat_time_values) + const updatedSrcStat = fs.statSync(src) + return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime) +} + +function onDir (srcStat, destStat, src, dest, opts) { + if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts) + return copyDir(src, dest, opts) +} + +function mkDirAndCopy (srcMode, src, dest, opts) { + fs.mkdirSync(dest) + copyDir(src, dest, opts) + return setDestMode(dest, srcMode) +} + +function copyDir (src, dest, opts) { + fs.readdirSync(src).forEach(item => copyDirItem(item, src, dest, opts)) +} + +function copyDirItem (item, src, dest, opts) { + const srcItem = path.join(src, item) + const destItem = path.join(dest, item) + if (opts.filter && !opts.filter(srcItem, destItem)) return + const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy', opts) + return getStats(destStat, srcItem, destItem, opts) +} + +function onLink (destStat, src, dest, opts) { + let resolvedSrc = fs.readlinkSync(src) + if (opts.dereference) { + resolvedSrc = path.resolve(process.cwd(), resolvedSrc) + } + + if (!destStat) { + return fs.symlinkSync(resolvedSrc, dest) + } else { + let resolvedDest + try { + resolvedDest = fs.readlinkSync(dest) + } catch (err) { + // dest exists and is a regular file or directory, + // Windows may throw UNKNOWN error. If dest already exists, + // fs throws error anyway, so no need to guard against it here. + if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest) + throw err + } + if (opts.dereference) { + resolvedDest = path.resolve(process.cwd(), resolvedDest) + } + if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { + throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`) + } + + // prevent copy if src is a subdir of dest since unlinking + // dest in this case would result in removing src contents + // and therefore a broken symlink would be created. + if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) { + throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`) + } + return copyLink(resolvedSrc, dest) + } +} + +function copyLink (resolvedSrc, dest) { + fs.unlinkSync(dest) + return fs.symlinkSync(resolvedSrc, dest) +} + +module.exports = copySync + + +/***/ }), + +/***/ 43205: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const fs = __nccwpck_require__(77758) +const path = __nccwpck_require__(71017) +const mkdirs = (__nccwpck_require__(54139).mkdirs) +const pathExists = (__nccwpck_require__(40821).pathExists) +const utimesMillis = (__nccwpck_require__(96942).utimesMillis) +const stat = __nccwpck_require__(84683) + +function copy (src, dest, opts, cb) { + if (typeof opts === 'function' && !cb) { + cb = opts + opts = {} + } else if (typeof opts === 'function') { + opts = { filter: opts } + } + + cb = cb || function () {} + opts = opts || {} + + opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now + opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber + + // Warn about using preserveTimestamps on 32-bit node + if (opts.preserveTimestamps && process.arch === 'ia32') { + process.emitWarning( + 'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' + + '\tsee https://github.com/jprichardson/node-fs-extra/issues/269', + 'Warning', 'fs-extra-WARN0001' + ) + } + + stat.checkPaths(src, dest, 'copy', opts, (err, stats) => { + if (err) return cb(err) + const { srcStat, destStat } = stats + stat.checkParentPaths(src, srcStat, dest, 'copy', err => { + if (err) return cb(err) + runFilter(src, dest, opts, (err, include) => { + if (err) return cb(err) + if (!include) return cb() + + checkParentDir(destStat, src, dest, opts, cb) + }) + }) + }) +} + +function checkParentDir (destStat, src, dest, opts, cb) { + const destParent = path.dirname(dest) + pathExists(destParent, (err, dirExists) => { + if (err) return cb(err) + if (dirExists) return getStats(destStat, src, dest, opts, cb) + mkdirs(destParent, err => { + if (err) return cb(err) + return getStats(destStat, src, dest, opts, cb) + }) + }) +} + +function runFilter (src, dest, opts, cb) { + if (!opts.filter) return cb(null, true) + Promise.resolve(opts.filter(src, dest)) + .then(include => cb(null, include), error => cb(error)) +} + +function getStats (destStat, src, dest, opts, cb) { + const stat = opts.dereference ? fs.stat : fs.lstat + stat(src, (err, srcStat) => { + if (err) return cb(err) + + if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts, cb) + else if (srcStat.isFile() || + srcStat.isCharacterDevice() || + srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts, cb) + else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts, cb) + else if (srcStat.isSocket()) return cb(new Error(`Cannot copy a socket file: ${src}`)) + else if (srcStat.isFIFO()) return cb(new Error(`Cannot copy a FIFO pipe: ${src}`)) + return cb(new Error(`Unknown file: ${src}`)) + }) +} + +function onFile (srcStat, destStat, src, dest, opts, cb) { + if (!destStat) return copyFile(srcStat, src, dest, opts, cb) + return mayCopyFile(srcStat, src, dest, opts, cb) +} + +function mayCopyFile (srcStat, src, dest, opts, cb) { + if (opts.overwrite) { + fs.unlink(dest, err => { + if (err) return cb(err) + return copyFile(srcStat, src, dest, opts, cb) + }) + } else if (opts.errorOnExist) { + return cb(new Error(`'${dest}' already exists`)) + } else return cb() +} + +function copyFile (srcStat, src, dest, opts, cb) { + fs.copyFile(src, dest, err => { + if (err) return cb(err) + if (opts.preserveTimestamps) return handleTimestampsAndMode(srcStat.mode, src, dest, cb) + return setDestMode(dest, srcStat.mode, cb) + }) +} + +function handleTimestampsAndMode (srcMode, src, dest, cb) { + // Make sure the file is writable before setting the timestamp + // otherwise open fails with EPERM when invoked with 'r+' + // (through utimes call) + if (fileIsNotWritable(srcMode)) { + return makeFileWritable(dest, srcMode, err => { + if (err) return cb(err) + return setDestTimestampsAndMode(srcMode, src, dest, cb) + }) + } + return setDestTimestampsAndMode(srcMode, src, dest, cb) +} + +function fileIsNotWritable (srcMode) { + return (srcMode & 0o200) === 0 +} + +function makeFileWritable (dest, srcMode, cb) { + return setDestMode(dest, srcMode | 0o200, cb) +} + +function setDestTimestampsAndMode (srcMode, src, dest, cb) { + setDestTimestamps(src, dest, err => { + if (err) return cb(err) + return setDestMode(dest, srcMode, cb) + }) +} + +function setDestMode (dest, srcMode, cb) { + return fs.chmod(dest, srcMode, cb) +} + +function setDestTimestamps (src, dest, cb) { + // The initial srcStat.atime cannot be trusted + // because it is modified by the read(2) system call + // (See https://nodejs.org/api/fs.html#fs_stat_time_values) + fs.stat(src, (err, updatedSrcStat) => { + if (err) return cb(err) + return utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime, cb) + }) +} + +function onDir (srcStat, destStat, src, dest, opts, cb) { + if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts, cb) + return copyDir(src, dest, opts, cb) +} + +function mkDirAndCopy (srcMode, src, dest, opts, cb) { + fs.mkdir(dest, err => { + if (err) return cb(err) + copyDir(src, dest, opts, err => { + if (err) return cb(err) + return setDestMode(dest, srcMode, cb) + }) + }) +} + +function copyDir (src, dest, opts, cb) { + fs.readdir(src, (err, items) => { + if (err) return cb(err) + return copyDirItems(items, src, dest, opts, cb) + }) +} + +function copyDirItems (items, src, dest, opts, cb) { + const item = items.pop() + if (!item) return cb() + return copyDirItem(items, item, src, dest, opts, cb) +} + +function copyDirItem (items, item, src, dest, opts, cb) { + const srcItem = path.join(src, item) + const destItem = path.join(dest, item) + runFilter(srcItem, destItem, opts, (err, include) => { + if (err) return cb(err) + if (!include) return copyDirItems(items, src, dest, opts, cb) + + stat.checkPaths(srcItem, destItem, 'copy', opts, (err, stats) => { + if (err) return cb(err) + const { destStat } = stats + getStats(destStat, srcItem, destItem, opts, err => { + if (err) return cb(err) + return copyDirItems(items, src, dest, opts, cb) + }) + }) + }) +} + +function onLink (destStat, src, dest, opts, cb) { + fs.readlink(src, (err, resolvedSrc) => { + if (err) return cb(err) + if (opts.dereference) { + resolvedSrc = path.resolve(process.cwd(), resolvedSrc) + } + + if (!destStat) { + return fs.symlink(resolvedSrc, dest, cb) + } else { + fs.readlink(dest, (err, resolvedDest) => { + if (err) { + // dest exists and is a regular file or directory, + // Windows may throw UNKNOWN error. If dest already exists, + // fs throws error anyway, so no need to guard against it here. + if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest, cb) + return cb(err) + } + if (opts.dereference) { + resolvedDest = path.resolve(process.cwd(), resolvedDest) + } + if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { + return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)) + } + + // do not copy if src is a subdir of dest since unlinking + // dest in this case would result in removing src contents + // and therefore a broken symlink would be created. + if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) { + return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)) + } + return copyLink(resolvedSrc, dest, cb) + }) + } + }) +} + +function copyLink (resolvedSrc, dest, cb) { + fs.unlink(dest, err => { + if (err) return cb(err) + return fs.symlink(resolvedSrc, dest, cb) + }) +} + +module.exports = copy + + +/***/ }), + +/***/ 68227: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const u = (__nccwpck_require__(9046).fromCallback) +module.exports = { + copy: u(__nccwpck_require__(43205)), + copySync: __nccwpck_require__(90768) +} + + +/***/ }), + +/***/ 20623: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const u = (__nccwpck_require__(9046).fromPromise) +const fs = __nccwpck_require__(82866) +const path = __nccwpck_require__(71017) +const mkdir = __nccwpck_require__(54139) +const remove = __nccwpck_require__(26798) + +const emptyDir = u(async function emptyDir (dir) { + let items + try { + items = await fs.readdir(dir) + } catch { + return mkdir.mkdirs(dir) + } + + return Promise.all(items.map(item => remove.remove(path.join(dir, item)))) +}) + +function emptyDirSync (dir) { + let items + try { + items = fs.readdirSync(dir) + } catch { + return mkdir.mkdirsSync(dir) + } + + items.forEach(item => { + item = path.join(dir, item) + remove.removeSync(item) + }) +} + +module.exports = { + emptyDirSync, + emptydirSync: emptyDirSync, + emptyDir, + emptydir: emptyDir +} + + +/***/ }), + +/***/ 55145: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const u = (__nccwpck_require__(9046).fromCallback) +const path = __nccwpck_require__(71017) +const fs = __nccwpck_require__(77758) +const mkdir = __nccwpck_require__(54139) + +function createFile (file, callback) { + function makeFile () { + fs.writeFile(file, '', err => { + if (err) return callback(err) + callback() + }) + } + + fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err + if (!err && stats.isFile()) return callback() + const dir = path.dirname(file) + fs.stat(dir, (err, stats) => { + if (err) { + // if the directory doesn't exist, make it + if (err.code === 'ENOENT') { + return mkdir.mkdirs(dir, err => { + if (err) return callback(err) + makeFile() + }) + } + return callback(err) + } + + if (stats.isDirectory()) makeFile() + else { + // parent is not a directory + // This is just to cause an internal ENOTDIR error to be thrown + fs.readdir(dir, err => { + if (err) return callback(err) + }) + } + }) + }) +} + +function createFileSync (file) { + let stats + try { + stats = fs.statSync(file) + } catch {} + if (stats && stats.isFile()) return + + const dir = path.dirname(file) + try { + if (!fs.statSync(dir).isDirectory()) { + // parent is not a directory + // This is just to cause an internal ENOTDIR error to be thrown + fs.readdirSync(dir) + } + } catch (err) { + // If the stat call above failed because the directory doesn't exist, create it + if (err && err.code === 'ENOENT') mkdir.mkdirsSync(dir) + else throw err + } + + fs.writeFileSync(file, '') +} + +module.exports = { + createFile: u(createFile), + createFileSync +} + + +/***/ }), + +/***/ 18548: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { createFile, createFileSync } = __nccwpck_require__(55145) +const { createLink, createLinkSync } = __nccwpck_require__(90098) +const { createSymlink, createSymlinkSync } = __nccwpck_require__(60848) + +module.exports = { + // file + createFile, + createFileSync, + ensureFile: createFile, + ensureFileSync: createFileSync, + // link + createLink, + createLinkSync, + ensureLink: createLink, + ensureLinkSync: createLinkSync, + // symlink + createSymlink, + createSymlinkSync, + ensureSymlink: createSymlink, + ensureSymlinkSync: createSymlinkSync +} + + +/***/ }), + +/***/ 90098: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const u = (__nccwpck_require__(9046).fromCallback) +const path = __nccwpck_require__(71017) +const fs = __nccwpck_require__(77758) +const mkdir = __nccwpck_require__(54139) +const pathExists = (__nccwpck_require__(40821).pathExists) +const { areIdentical } = __nccwpck_require__(84683) + +function createLink (srcpath, dstpath, callback) { + function makeLink (srcpath, dstpath) { + fs.link(srcpath, dstpath, err => { + if (err) return callback(err) + callback(null) + }) + } + + fs.lstat(dstpath, (_, dstStat) => { + fs.lstat(srcpath, (err, srcStat) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureLink') + return callback(err) + } + if (dstStat && areIdentical(srcStat, dstStat)) return callback(null) + + const dir = path.dirname(dstpath) + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return makeLink(srcpath, dstpath) + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + makeLink(srcpath, dstpath) + }) + }) + }) + }) +} + +function createLinkSync (srcpath, dstpath) { + let dstStat + try { + dstStat = fs.lstatSync(dstpath) + } catch {} + + try { + const srcStat = fs.lstatSync(srcpath) + if (dstStat && areIdentical(srcStat, dstStat)) return + } catch (err) { + err.message = err.message.replace('lstat', 'ensureLink') + throw err + } + + const dir = path.dirname(dstpath) + const dirExists = fs.existsSync(dir) + if (dirExists) return fs.linkSync(srcpath, dstpath) + mkdir.mkdirsSync(dir) + + return fs.linkSync(srcpath, dstpath) +} + +module.exports = { + createLink: u(createLink), + createLinkSync +} + + +/***/ }), + +/***/ 45766: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const path = __nccwpck_require__(71017) +const fs = __nccwpck_require__(77758) +const pathExists = (__nccwpck_require__(40821).pathExists) + +/** + * Function that returns two types of paths, one relative to symlink, and one + * relative to the current working directory. Checks if path is absolute or + * relative. If the path is relative, this function checks if the path is + * relative to symlink or relative to current working directory. This is an + * initiative to find a smarter `srcpath` to supply when building symlinks. + * This allows you to determine which path to use out of one of three possible + * types of source paths. The first is an absolute path. This is detected by + * `path.isAbsolute()`. When an absolute path is provided, it is checked to + * see if it exists. If it does it's used, if not an error is returned + * (callback)/ thrown (sync). The other two options for `srcpath` are a + * relative url. By default Node's `fs.symlink` works by creating a symlink + * using `dstpath` and expects the `srcpath` to be relative to the newly + * created symlink. If you provide a `srcpath` that does not exist on the file + * system it results in a broken symlink. To minimize this, the function + * checks to see if the 'relative to symlink' source file exists, and if it + * does it will use it. If it does not, it checks if there's a file that + * exists that is relative to the current working directory, if does its used. + * This preserves the expectations of the original fs.symlink spec and adds + * the ability to pass in `relative to current working direcotry` paths. + */ + +function symlinkPaths (srcpath, dstpath, callback) { + if (path.isAbsolute(srcpath)) { + return fs.lstat(srcpath, (err) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureSymlink') + return callback(err) + } + return callback(null, { + toCwd: srcpath, + toDst: srcpath + }) + }) + } else { + const dstdir = path.dirname(dstpath) + const relativeToDst = path.join(dstdir, srcpath) + return pathExists(relativeToDst, (err, exists) => { + if (err) return callback(err) + if (exists) { + return callback(null, { + toCwd: relativeToDst, + toDst: srcpath + }) + } else { + return fs.lstat(srcpath, (err) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureSymlink') + return callback(err) + } + return callback(null, { + toCwd: srcpath, + toDst: path.relative(dstdir, srcpath) + }) + }) + } + }) + } +} + +function symlinkPathsSync (srcpath, dstpath) { + let exists + if (path.isAbsolute(srcpath)) { + exists = fs.existsSync(srcpath) + if (!exists) throw new Error('absolute srcpath does not exist') + return { + toCwd: srcpath, + toDst: srcpath + } + } else { + const dstdir = path.dirname(dstpath) + const relativeToDst = path.join(dstdir, srcpath) + exists = fs.existsSync(relativeToDst) + if (exists) { + return { + toCwd: relativeToDst, + toDst: srcpath + } + } else { + exists = fs.existsSync(srcpath) + if (!exists) throw new Error('relative srcpath does not exist') + return { + toCwd: srcpath, + toDst: path.relative(dstdir, srcpath) + } + } + } +} + +module.exports = { + symlinkPaths, + symlinkPathsSync +} + + +/***/ }), + +/***/ 9145: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const fs = __nccwpck_require__(77758) + +function symlinkType (srcpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + if (type) return callback(null, type) + fs.lstat(srcpath, (err, stats) => { + if (err) return callback(null, 'file') + type = (stats && stats.isDirectory()) ? 'dir' : 'file' + callback(null, type) + }) +} + +function symlinkTypeSync (srcpath, type) { + let stats + + if (type) return type + try { + stats = fs.lstatSync(srcpath) + } catch { + return 'file' + } + return (stats && stats.isDirectory()) ? 'dir' : 'file' +} + +module.exports = { + symlinkType, + symlinkTypeSync +} + + +/***/ }), + +/***/ 60848: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const u = (__nccwpck_require__(9046).fromCallback) +const path = __nccwpck_require__(71017) +const fs = __nccwpck_require__(82866) +const _mkdirs = __nccwpck_require__(54139) +const mkdirs = _mkdirs.mkdirs +const mkdirsSync = _mkdirs.mkdirsSync + +const _symlinkPaths = __nccwpck_require__(45766) +const symlinkPaths = _symlinkPaths.symlinkPaths +const symlinkPathsSync = _symlinkPaths.symlinkPathsSync + +const _symlinkType = __nccwpck_require__(9145) +const symlinkType = _symlinkType.symlinkType +const symlinkTypeSync = _symlinkType.symlinkTypeSync + +const pathExists = (__nccwpck_require__(40821).pathExists) + +const { areIdentical } = __nccwpck_require__(84683) + +function createSymlink (srcpath, dstpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + + fs.lstat(dstpath, (err, stats) => { + if (!err && stats.isSymbolicLink()) { + Promise.all([ + fs.stat(srcpath), + fs.stat(dstpath) + ]).then(([srcStat, dstStat]) => { + if (areIdentical(srcStat, dstStat)) return callback(null) + _createSymlink(srcpath, dstpath, type, callback) + }) + } else _createSymlink(srcpath, dstpath, type, callback) + }) +} + +function _createSymlink (srcpath, dstpath, type, callback) { + symlinkPaths(srcpath, dstpath, (err, relative) => { + if (err) return callback(err) + srcpath = relative.toDst + symlinkType(relative.toCwd, type, (err, type) => { + if (err) return callback(err) + const dir = path.dirname(dstpath) + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return fs.symlink(srcpath, dstpath, type, callback) + mkdirs(dir, err => { + if (err) return callback(err) + fs.symlink(srcpath, dstpath, type, callback) + }) + }) + }) + }) +} + +function createSymlinkSync (srcpath, dstpath, type) { + let stats + try { + stats = fs.lstatSync(dstpath) + } catch {} + if (stats && stats.isSymbolicLink()) { + const srcStat = fs.statSync(srcpath) + const dstStat = fs.statSync(dstpath) + if (areIdentical(srcStat, dstStat)) return + } + + const relative = symlinkPathsSync(srcpath, dstpath) + srcpath = relative.toDst + type = symlinkTypeSync(relative.toCwd, type) + const dir = path.dirname(dstpath) + const exists = fs.existsSync(dir) + if (exists) return fs.symlinkSync(srcpath, dstpath, type) + mkdirsSync(dir) + return fs.symlinkSync(srcpath, dstpath, type) +} + +module.exports = { + createSymlink: u(createSymlink), + createSymlinkSync +} + + +/***/ }), + +/***/ 82866: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +// This is adapted from https://github.com/normalize/mz +// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors +const u = (__nccwpck_require__(9046).fromCallback) +const fs = __nccwpck_require__(77758) + +const api = [ + 'access', + 'appendFile', + 'chmod', + 'chown', + 'close', + 'copyFile', + 'fchmod', + 'fchown', + 'fdatasync', + 'fstat', + 'fsync', + 'ftruncate', + 'futimes', + 'lchmod', + 'lchown', + 'link', + 'lstat', + 'mkdir', + 'mkdtemp', + 'open', + 'opendir', + 'readdir', + 'readFile', + 'readlink', + 'realpath', + 'rename', + 'rm', + 'rmdir', + 'stat', + 'symlink', + 'truncate', + 'unlink', + 'utimes', + 'writeFile' +].filter(key => { + // Some commands are not available on some systems. Ex: + // fs.cp was added in Node.js v16.7.0 + // fs.lchown is not available on at least some Linux + return typeof fs[key] === 'function' +}) + +// Export cloned fs: +Object.assign(exports, fs) + +// Universalify async methods: +api.forEach(method => { + exports[method] = u(fs[method]) +}) + +// We differ from mz/fs in that we still ship the old, broken, fs.exists() +// since we are a drop-in replacement for the native module +exports.exists = function (filename, callback) { + if (typeof callback === 'function') { + return fs.exists(filename, callback) + } + return new Promise(resolve => { + return fs.exists(filename, resolve) + }) +} + +// fs.read(), fs.write(), fs.readv(), & fs.writev() need special treatment due to multiple callback args + +exports.read = function (fd, buffer, offset, length, position, callback) { + if (typeof callback === 'function') { + return fs.read(fd, buffer, offset, length, position, callback) + } + return new Promise((resolve, reject) => { + fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => { + if (err) return reject(err) + resolve({ bytesRead, buffer }) + }) + }) +} + +// Function signature can be +// fs.write(fd, buffer[, offset[, length[, position]]], callback) +// OR +// fs.write(fd, string[, position[, encoding]], callback) +// We need to handle both cases, so we use ...args +exports.write = function (fd, buffer, ...args) { + if (typeof args[args.length - 1] === 'function') { + return fs.write(fd, buffer, ...args) + } + + return new Promise((resolve, reject) => { + fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => { + if (err) return reject(err) + resolve({ bytesWritten, buffer }) + }) + }) +} + +// Function signature is +// s.readv(fd, buffers[, position], callback) +// We need to handle the optional arg, so we use ...args +exports.readv = function (fd, buffers, ...args) { + if (typeof args[args.length - 1] === 'function') { + return fs.readv(fd, buffers, ...args) + } + + return new Promise((resolve, reject) => { + fs.readv(fd, buffers, ...args, (err, bytesRead, buffers) => { + if (err) return reject(err) + resolve({ bytesRead, buffers }) + }) + }) +} + +// Function signature is +// s.writev(fd, buffers[, position], callback) +// We need to handle the optional arg, so we use ...args +exports.writev = function (fd, buffers, ...args) { + if (typeof args[args.length - 1] === 'function') { + return fs.writev(fd, buffers, ...args) + } + + return new Promise((resolve, reject) => { + fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => { + if (err) return reject(err) + resolve({ bytesWritten, buffers }) + }) + }) +} + +// fs.realpath.native sometimes not available if fs is monkey-patched +if (typeof fs.realpath.native === 'function') { + exports.realpath.native = u(fs.realpath.native) +} else { + process.emitWarning( + 'fs.realpath.native is not a function. Is fs being monkey-patched?', + 'Warning', 'fs-extra-WARN0003' + ) +} + + +/***/ }), + +/***/ 2103: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +module.exports = { + // Export promiseified graceful-fs: + ...__nccwpck_require__(82866), + // Export extra methods: + ...__nccwpck_require__(68227), + ...__nccwpck_require__(20623), + ...__nccwpck_require__(18548), + ...__nccwpck_require__(47084), + ...__nccwpck_require__(54139), + ...__nccwpck_require__(28372), + ...__nccwpck_require__(79897), + ...__nccwpck_require__(40821), + ...__nccwpck_require__(26798) +} + + +/***/ }), + +/***/ 47084: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const u = (__nccwpck_require__(9046).fromPromise) +const jsonFile = __nccwpck_require__(87772) + +jsonFile.outputJson = u(__nccwpck_require__(65002)) +jsonFile.outputJsonSync = __nccwpck_require__(24241) +// aliases +jsonFile.outputJSON = jsonFile.outputJson +jsonFile.outputJSONSync = jsonFile.outputJsonSync +jsonFile.writeJSON = jsonFile.writeJson +jsonFile.writeJSONSync = jsonFile.writeJsonSync +jsonFile.readJSON = jsonFile.readJson +jsonFile.readJSONSync = jsonFile.readJsonSync + +module.exports = jsonFile + + +/***/ }), + +/***/ 87772: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const jsonFile = __nccwpck_require__(26160) + +module.exports = { + // jsonfile exports + readJson: jsonFile.readFile, + readJsonSync: jsonFile.readFileSync, + writeJson: jsonFile.writeFile, + writeJsonSync: jsonFile.writeFileSync +} + + +/***/ }), + +/***/ 24241: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { stringify } = __nccwpck_require__(35902) +const { outputFileSync } = __nccwpck_require__(79897) + +function outputJsonSync (file, data, options) { + const str = stringify(data, options) + + outputFileSync(file, str, options) +} + +module.exports = outputJsonSync + + +/***/ }), + +/***/ 65002: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { stringify } = __nccwpck_require__(35902) +const { outputFile } = __nccwpck_require__(79897) + +async function outputJson (file, data, options = {}) { + const str = stringify(data, options) + + await outputFile(file, str, options) +} + +module.exports = outputJson + + +/***/ }), + +/***/ 54139: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +const u = (__nccwpck_require__(9046).fromPromise) +const { makeDir: _makeDir, makeDirSync } = __nccwpck_require__(54025) +const makeDir = u(_makeDir) + +module.exports = { + mkdirs: makeDir, + mkdirsSync: makeDirSync, + // alias + mkdirp: makeDir, + mkdirpSync: makeDirSync, + ensureDir: makeDir, + ensureDirSync: makeDirSync +} + + +/***/ }), + +/***/ 54025: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +const fs = __nccwpck_require__(82866) +const { checkPath } = __nccwpck_require__(24305) + +const getMode = options => { + const defaults = { mode: 0o777 } + if (typeof options === 'number') return options + return ({ ...defaults, ...options }).mode +} + +module.exports.makeDir = async (dir, options) => { + checkPath(dir) + + return fs.mkdir(dir, { + mode: getMode(options), + recursive: true + }) +} + +module.exports.makeDirSync = (dir, options) => { + checkPath(dir) + + return fs.mkdirSync(dir, { + mode: getMode(options), + recursive: true + }) +} + + +/***/ }), + +/***/ 24305: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// Adapted from https://github.com/sindresorhus/make-dir +// Copyright (c) Sindre Sorhus (sindresorhus.com) +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +const path = __nccwpck_require__(71017) + +// https://github.com/nodejs/node/issues/8987 +// https://github.com/libuv/libuv/pull/1088 +module.exports.checkPath = function checkPath (pth) { + if (process.platform === 'win32') { + const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, '')) + + if (pathHasInvalidWinCharacters) { + const error = new Error(`Path contains invalid characters: ${pth}`) + error.code = 'EINVAL' + throw error + } + } +} + + +/***/ }), + +/***/ 28372: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const u = (__nccwpck_require__(9046).fromCallback) +module.exports = { + move: u(__nccwpck_require__(26935)), + moveSync: __nccwpck_require__(75297) +} + + +/***/ }), + +/***/ 75297: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const fs = __nccwpck_require__(77758) +const path = __nccwpck_require__(71017) +const copySync = (__nccwpck_require__(68227).copySync) +const removeSync = (__nccwpck_require__(26798).removeSync) +const mkdirpSync = (__nccwpck_require__(54139).mkdirpSync) +const stat = __nccwpck_require__(84683) + +function moveSync (src, dest, opts) { + opts = opts || {} + const overwrite = opts.overwrite || opts.clobber || false + + const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, 'move', opts) + stat.checkParentPathsSync(src, srcStat, dest, 'move') + if (!isParentRoot(dest)) mkdirpSync(path.dirname(dest)) + return doRename(src, dest, overwrite, isChangingCase) +} + +function isParentRoot (dest) { + const parent = path.dirname(dest) + const parsedPath = path.parse(parent) + return parsedPath.root === parent +} + +function doRename (src, dest, overwrite, isChangingCase) { + if (isChangingCase) return rename(src, dest, overwrite) + if (overwrite) { + removeSync(dest) + return rename(src, dest, overwrite) + } + if (fs.existsSync(dest)) throw new Error('dest already exists.') + return rename(src, dest, overwrite) +} + +function rename (src, dest, overwrite) { + try { + fs.renameSync(src, dest) + } catch (err) { + if (err.code !== 'EXDEV') throw err + return moveAcrossDevice(src, dest, overwrite) + } +} + +function moveAcrossDevice (src, dest, overwrite) { + const opts = { + overwrite, + errorOnExist: true, + preserveTimestamps: true + } + copySync(src, dest, opts) + return removeSync(src) +} + +module.exports = moveSync + + +/***/ }), + +/***/ 26935: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const fs = __nccwpck_require__(77758) +const path = __nccwpck_require__(71017) +const copy = (__nccwpck_require__(68227).copy) +const remove = (__nccwpck_require__(26798).remove) +const mkdirp = (__nccwpck_require__(54139).mkdirp) +const pathExists = (__nccwpck_require__(40821).pathExists) +const stat = __nccwpck_require__(84683) + +function move (src, dest, opts, cb) { + if (typeof opts === 'function') { + cb = opts + opts = {} + } + + opts = opts || {} + + const overwrite = opts.overwrite || opts.clobber || false + + stat.checkPaths(src, dest, 'move', opts, (err, stats) => { + if (err) return cb(err) + const { srcStat, isChangingCase = false } = stats + stat.checkParentPaths(src, srcStat, dest, 'move', err => { + if (err) return cb(err) + if (isParentRoot(dest)) return doRename(src, dest, overwrite, isChangingCase, cb) + mkdirp(path.dirname(dest), err => { + if (err) return cb(err) + return doRename(src, dest, overwrite, isChangingCase, cb) + }) + }) + }) +} + +function isParentRoot (dest) { + const parent = path.dirname(dest) + const parsedPath = path.parse(parent) + return parsedPath.root === parent +} + +function doRename (src, dest, overwrite, isChangingCase, cb) { + if (isChangingCase) return rename(src, dest, overwrite, cb) + if (overwrite) { + return remove(dest, err => { + if (err) return cb(err) + return rename(src, dest, overwrite, cb) + }) + } + pathExists(dest, (err, destExists) => { + if (err) return cb(err) + if (destExists) return cb(new Error('dest already exists.')) + return rename(src, dest, overwrite, cb) + }) +} + +function rename (src, dest, overwrite, cb) { + fs.rename(src, dest, err => { + if (!err) return cb() + if (err.code !== 'EXDEV') return cb(err) + return moveAcrossDevice(src, dest, overwrite, cb) + }) +} + +function moveAcrossDevice (src, dest, overwrite, cb) { + const opts = { + overwrite, + errorOnExist: true, + preserveTimestamps: true + } + copy(src, dest, opts, err => { + if (err) return cb(err) + return remove(src, cb) + }) +} + +module.exports = move + + +/***/ }), + +/***/ 79897: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const u = (__nccwpck_require__(9046).fromCallback) +const fs = __nccwpck_require__(77758) +const path = __nccwpck_require__(71017) +const mkdir = __nccwpck_require__(54139) +const pathExists = (__nccwpck_require__(40821).pathExists) + +function outputFile (file, data, encoding, callback) { + if (typeof encoding === 'function') { + callback = encoding + encoding = 'utf8' + } + + const dir = path.dirname(file) + pathExists(dir, (err, itDoes) => { + if (err) return callback(err) + if (itDoes) return fs.writeFile(file, data, encoding, callback) + + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + + fs.writeFile(file, data, encoding, callback) + }) + }) +} + +function outputFileSync (file, ...args) { + const dir = path.dirname(file) + if (fs.existsSync(dir)) { + return fs.writeFileSync(file, ...args) + } + mkdir.mkdirsSync(dir) + fs.writeFileSync(file, ...args) +} + +module.exports = { + outputFile: u(outputFile), + outputFileSync +} + + +/***/ }), + +/***/ 40821: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +const u = (__nccwpck_require__(9046).fromPromise) +const fs = __nccwpck_require__(82866) + +function pathExists (path) { + return fs.access(path).then(() => true).catch(() => false) +} + +module.exports = { + pathExists: u(pathExists), + pathExistsSync: fs.existsSync +} + + +/***/ }), + +/***/ 26798: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const fs = __nccwpck_require__(77758) +const u = (__nccwpck_require__(9046).fromCallback) + +function remove (path, callback) { + fs.rm(path, { recursive: true, force: true }, callback) +} + +function removeSync (path) { + fs.rmSync(path, { recursive: true, force: true }) +} + +module.exports = { + remove: u(remove), + removeSync +} + + +/***/ }), + +/***/ 84683: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const fs = __nccwpck_require__(82866) +const path = __nccwpck_require__(71017) +const util = __nccwpck_require__(73837) + +function getStats (src, dest, opts) { + const statFunc = opts.dereference + ? (file) => fs.stat(file, { bigint: true }) + : (file) => fs.lstat(file, { bigint: true }) + return Promise.all([ + statFunc(src), + statFunc(dest).catch(err => { + if (err.code === 'ENOENT') return null + throw err + }) + ]).then(([srcStat, destStat]) => ({ srcStat, destStat })) +} + +function getStatsSync (src, dest, opts) { + let destStat + const statFunc = opts.dereference + ? (file) => fs.statSync(file, { bigint: true }) + : (file) => fs.lstatSync(file, { bigint: true }) + const srcStat = statFunc(src) + try { + destStat = statFunc(dest) + } catch (err) { + if (err.code === 'ENOENT') return { srcStat, destStat: null } + throw err + } + return { srcStat, destStat } +} + +function checkPaths (src, dest, funcName, opts, cb) { + util.callbackify(getStats)(src, dest, opts, (err, stats) => { + if (err) return cb(err) + const { srcStat, destStat } = stats + + if (destStat) { + if (areIdentical(srcStat, destStat)) { + const srcBaseName = path.basename(src) + const destBaseName = path.basename(dest) + if (funcName === 'move' && + srcBaseName !== destBaseName && + srcBaseName.toLowerCase() === destBaseName.toLowerCase()) { + return cb(null, { srcStat, destStat, isChangingCase: true }) + } + return cb(new Error('Source and destination must not be the same.')) + } + if (srcStat.isDirectory() && !destStat.isDirectory()) { + return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)) + } + if (!srcStat.isDirectory() && destStat.isDirectory()) { + return cb(new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`)) + } + } + + if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { + return cb(new Error(errMsg(src, dest, funcName))) + } + return cb(null, { srcStat, destStat }) + }) +} + +function checkPathsSync (src, dest, funcName, opts) { + const { srcStat, destStat } = getStatsSync(src, dest, opts) + + if (destStat) { + if (areIdentical(srcStat, destStat)) { + const srcBaseName = path.basename(src) + const destBaseName = path.basename(dest) + if (funcName === 'move' && + srcBaseName !== destBaseName && + srcBaseName.toLowerCase() === destBaseName.toLowerCase()) { + return { srcStat, destStat, isChangingCase: true } + } + throw new Error('Source and destination must not be the same.') + } + if (srcStat.isDirectory() && !destStat.isDirectory()) { + throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`) + } + if (!srcStat.isDirectory() && destStat.isDirectory()) { + throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`) + } + } + + if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { + throw new Error(errMsg(src, dest, funcName)) + } + return { srcStat, destStat } +} + +// recursively check if dest parent is a subdirectory of src. +// It works for all file types including symlinks since it +// checks the src and dest inodes. It starts from the deepest +// parent and stops once it reaches the src parent or the root path. +function checkParentPaths (src, srcStat, dest, funcName, cb) { + const srcParent = path.resolve(path.dirname(src)) + const destParent = path.resolve(path.dirname(dest)) + if (destParent === srcParent || destParent === path.parse(destParent).root) return cb() + fs.stat(destParent, { bigint: true }, (err, destStat) => { + if (err) { + if (err.code === 'ENOENT') return cb() + return cb(err) + } + if (areIdentical(srcStat, destStat)) { + return cb(new Error(errMsg(src, dest, funcName))) + } + return checkParentPaths(src, srcStat, destParent, funcName, cb) + }) +} + +function checkParentPathsSync (src, srcStat, dest, funcName) { + const srcParent = path.resolve(path.dirname(src)) + const destParent = path.resolve(path.dirname(dest)) + if (destParent === srcParent || destParent === path.parse(destParent).root) return + let destStat + try { + destStat = fs.statSync(destParent, { bigint: true }) + } catch (err) { + if (err.code === 'ENOENT') return + throw err + } + if (areIdentical(srcStat, destStat)) { + throw new Error(errMsg(src, dest, funcName)) + } + return checkParentPathsSync(src, srcStat, destParent, funcName) +} + +function areIdentical (srcStat, destStat) { + return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev +} + +// return true if dest is a subdir of src, otherwise false. +// It only checks the path strings. +function isSrcSubdir (src, dest) { + const srcArr = path.resolve(src).split(path.sep).filter(i => i) + const destArr = path.resolve(dest).split(path.sep).filter(i => i) + return srcArr.reduce((acc, cur, i) => acc && destArr[i] === cur, true) +} + +function errMsg (src, dest, funcName) { + return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.` +} + +module.exports = { + checkPaths, + checkPathsSync, + checkParentPaths, + checkParentPathsSync, + isSrcSubdir, + areIdentical +} + + +/***/ }), + +/***/ 96942: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const fs = __nccwpck_require__(77758) + +function utimesMillis (path, atime, mtime, callback) { + // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback) + fs.open(path, 'r+', (err, fd) => { + if (err) return callback(err) + fs.futimes(fd, atime, mtime, futimesErr => { + fs.close(fd, closeErr => { + if (callback) callback(futimesErr || closeErr) + }) + }) + }) +} + +function utimesMillisSync (path, atime, mtime) { + const fd = fs.openSync(path, 'r+') + fs.futimesSync(fd, atime, mtime) + return fs.closeSync(fd) +} + +module.exports = { + utimesMillis, + utimesMillisSync +} + + +/***/ }), + +/***/ 63085: +/***/ ((module) => { + +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global global, define, System, Reflect, Promise */ +var __extends; +var __assign; +var __rest; +var __decorate; +var __param; +var __esDecorate; +var __runInitializers; +var __propKey; +var __setFunctionName; +var __metadata; +var __awaiter; +var __generator; +var __exportStar; +var __values; +var __read; +var __spread; +var __spreadArrays; +var __spreadArray; +var __await; +var __asyncGenerator; +var __asyncDelegator; +var __asyncValues; +var __makeTemplateObject; +var __importStar; +var __importDefault; +var __classPrivateFieldGet; +var __classPrivateFieldSet; +var __classPrivateFieldIn; +var __createBinding; +(function (factory) { + var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; + if (typeof define === "function" && define.amd) { + define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); + } + else if ( true && typeof module.exports === "object") { + factory(createExporter(root, createExporter(module.exports))); + } + else { + factory(createExporter(root)); + } + function createExporter(exports, previous) { + if (exports !== root) { + if (typeof Object.create === "function") { + Object.defineProperty(exports, "__esModule", { value: true }); + } + else { + exports.__esModule = true; + } + } + return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + } +}) +(function (exporter) { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + + __extends = function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + + __assign = Object.assign || function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + + __rest = function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + + __decorate = function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + + __param = function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } + }; + + __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } + else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; + }; + + __runInitializers = function (thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; + }; + + __propKey = function (x) { + return typeof x === "symbol" ? x : "".concat(x); + }; + + __setFunctionName = function (f, name, prefix) { + if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); + }; + + __metadata = function (metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + }; + + __awaiter = function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + + __generator = function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + + __exportStar = function(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); + }; + + __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); + }) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); + + __values = function (o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + }; + + __read = function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; + }; + + /** @deprecated */ + __spread = function () { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; + }; + + /** @deprecated */ + __spreadArrays = function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + }; + + __spreadArray = function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); + }; + + __await = function (v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); + }; + + __asyncGenerator = function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } + }; + + __asyncDelegator = function (o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } + }; + + __asyncValues = function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } + }; + + __makeTemplateObject = function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; + }; + + var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }; + + __importStar = function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; + }; + + __importDefault = function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; + }; + + __classPrivateFieldGet = function (receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); + }; + + __classPrivateFieldSet = function (receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; + }; + + __classPrivateFieldIn = function (state, receiver) { + if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); + return typeof state === "function" ? receiver === state : state.has(receiver); + }; + + exporter("__extends", __extends); + exporter("__assign", __assign); + exporter("__rest", __rest); + exporter("__decorate", __decorate); + exporter("__param", __param); + exporter("__esDecorate", __esDecorate); + exporter("__runInitializers", __runInitializers); + exporter("__propKey", __propKey); + exporter("__setFunctionName", __setFunctionName); + exporter("__metadata", __metadata); + exporter("__awaiter", __awaiter); + exporter("__generator", __generator); + exporter("__exportStar", __exportStar); + exporter("__createBinding", __createBinding); + exporter("__values", __values); + exporter("__read", __read); + exporter("__spread", __spread); + exporter("__spreadArrays", __spreadArrays); + exporter("__spreadArray", __spreadArray); + exporter("__await", __await); + exporter("__asyncGenerator", __asyncGenerator); + exporter("__asyncDelegator", __asyncDelegator); + exporter("__asyncValues", __asyncValues); + exporter("__makeTemplateObject", __makeTemplateObject); + exporter("__importStar", __importStar); + exporter("__importDefault", __importDefault); + exporter("__classPrivateFieldGet", __classPrivateFieldGet); + exporter("__classPrivateFieldSet", __classPrivateFieldSet); + exporter("__classPrivateFieldIn", __classPrivateFieldIn); +}); + + +/***/ }), + +/***/ 1223: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var wrappy = __nccwpck_require__(62940) +module.exports = wrappy(once) +module.exports.strict = wrappy(onceStrict) + +once.proto = once(function () { + Object.defineProperty(Function.prototype, 'once', { + value: function () { + return once(this) + }, + configurable: true + }) + + Object.defineProperty(Function.prototype, 'onceStrict', { + value: function () { + return onceStrict(this) + }, + configurable: true + }) +}) + +function once (fn) { + var f = function () { + if (f.called) return f.value + f.called = true + return f.value = fn.apply(this, arguments) + } + f.called = false + return f +} + +function onceStrict (fn) { + var f = function () { + if (f.called) + throw new Error(f.onceError) + f.called = true + return f.value = fn.apply(this, arguments) + } + var name = fn.name || 'Function wrapped with `once`' + f.onceError = name + " shouldn't be called more than once" + f.called = false + return f +} + + +/***/ }), + +/***/ 38714: +/***/ ((module) => { + +"use strict"; + + +function posix(path) { + return path.charAt(0) === '/'; +} + +function win32(path) { + // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 + var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + var result = splitDeviceRe.exec(path); + var device = result[1] || ''; + var isUnc = Boolean(device && device.charAt(1) !== ':'); + + // UNC paths are always absolute + return Boolean(result[2] || isUnc); +} + +module.exports = process.platform === 'win32' ? win32 : posix; +module.exports.posix = posix; +module.exports.win32 = win32; + + +/***/ }), + +/***/ 94191: +/***/ ((module, exports, __nccwpck_require__) => { + +"use strict"; +/* module decorator */ module = __nccwpck_require__.nmd(module); + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.addHook = addHook; +var _module = _interopRequireDefault(__nccwpck_require__(98188)); +var _path = _interopRequireDefault(__nccwpck_require__(71017)); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/* (c) 2015 Ari Porad (@ariporad) . License: ariporad.mit-license.org */ + +const nodeModulesRegex = /^(?:.*[\\/])?node_modules(?:[\\/].*)?$/; +// Guard against poorly mocked module constructors. +const Module = module.constructor.length > 1 ? module.constructor : _module.default; +const HOOK_RETURNED_NOTHING_ERROR_MESSAGE = '[Pirates] A hook returned a non-string, or nothing at all! This is a' + ' violation of intergalactic law!\n' + '--------------------\n' + 'If you have no idea what this means or what Pirates is, let me explain: ' + 'Pirates is a module that makes is easy to implement require hooks. One of' + " the require hooks you're using uses it. One of these require hooks" + " didn't return anything from it's handler, so we don't know what to" + ' do. You might want to debug this.'; + +/** + * @param {string} filename The filename to check. + * @param {string[]} exts The extensions to hook. Should start with '.' (ex. ['.js']). + * @param {Matcher|null} matcher A matcher function, will be called with path to a file. Should return truthy if the file should be hooked, falsy otherwise. + * @param {boolean} ignoreNodeModules Auto-ignore node_modules. Independent of any matcher. + */ +function shouldCompile(filename, exts, matcher, ignoreNodeModules) { + if (typeof filename !== 'string') { + return false; + } + if (exts.indexOf(_path.default.extname(filename)) === -1) { + return false; + } + const resolvedFilename = _path.default.resolve(filename); + if (ignoreNodeModules && nodeModulesRegex.test(resolvedFilename)) { + return false; + } + if (matcher && typeof matcher === 'function') { + return !!matcher(resolvedFilename); + } + return true; +} + +/** + * @callback Hook The hook. Accepts the code of the module and the filename. + * @param {string} code + * @param {string} filename + * @returns {string} + */ +/** + * @callback Matcher A matcher function, will be called with path to a file. + * + * Should return truthy if the file should be hooked, falsy otherwise. + * @param {string} path + * @returns {boolean} + */ +/** + * @callback RevertFunction Reverts the hook when called. + * @returns {void} + */ +/** + * @typedef {object} Options + * @property {Matcher|null} [matcher=null] A matcher function, will be called with path to a file. + * + * Should return truthy if the file should be hooked, falsy otherwise. + * + * @property {string[]} [extensions=['.js']] The extensions to hook. Should start with '.' (ex. ['.js']). + * @property {string[]} [exts=['.js']] The extensions to hook. Should start with '.' (ex. ['.js']). + * + * @property {string[]} [extension=['.js']] The extensions to hook. Should start with '.' (ex. ['.js']). + * @property {string[]} [ext=['.js']] The extensions to hook. Should start with '.' (ex. ['.js']). + * + * @property {boolean} [ignoreNodeModules=true] Auto-ignore node_modules. Independent of any matcher. + */ + +/** + * Add a require hook. + * + * @param {Hook} hook The hook. Accepts the code of the module and the filename. Required. + * @param {Options} [opts] Options + * @returns {RevertFunction} The `revert` function. Reverts the hook when called. + */ +function addHook(hook, opts = {}) { + let reverted = false; + const loaders = []; + const oldLoaders = []; + let exts; + + // We need to do this to fix #15. Basically, if you use a non-standard extension (ie. .jsx), then + // We modify the .js loader, then use the modified .js loader for as the base for .jsx. + // This prevents that. + const originalJSLoader = Module._extensions['.js']; + const matcher = opts.matcher || null; + const ignoreNodeModules = opts.ignoreNodeModules !== false; + exts = opts.extensions || opts.exts || opts.extension || opts.ext || ['.js']; + if (!Array.isArray(exts)) { + exts = [exts]; + } + exts.forEach(ext => { + if (typeof ext !== 'string') { + throw new TypeError(`Invalid Extension: ${ext}`); + } + const oldLoader = Module._extensions[ext] || originalJSLoader; + oldLoaders[ext] = Module._extensions[ext]; + loaders[ext] = Module._extensions[ext] = function newLoader(mod, filename) { + let compile; + if (!reverted) { + if (shouldCompile(filename, exts, matcher, ignoreNodeModules)) { + compile = mod._compile; + mod._compile = function _compile(code) { + // reset the compile immediately as otherwise we end up having the + // compile function being changed even though this loader might be reverted + // Not reverting it here leads to long useless compile chains when doing + // addHook -> revert -> addHook -> revert -> ... + // The compile function is also anyway created new when the loader is called a second time. + mod._compile = compile; + const newCode = hook(code, filename); + if (typeof newCode !== 'string') { + throw new Error(HOOK_RETURNED_NOTHING_ERROR_MESSAGE); + } + return mod._compile(newCode, filename); + }; + } + } + oldLoader(mod, filename); + }; + }); + return function revert() { + if (reverted) return; + reverted = true; + exts.forEach(ext => { + // if the current loader for the extension is our loader then unregister it and set the oldLoader again + // if not we can not do anything as we cannot remove a loader from within the loader-chain + if (Module._extensions[ext] === loaders[ext]) { + if (!oldLoaders[ext]) { + delete Module._extensions[ext]; + } else { + Module._extensions[ext] = oldLoaders[ext]; + } + } + }); + }; +} + +/***/ }), + +/***/ 67214: +/***/ ((module) => { + +"use strict"; + + +const codes = {}; + +function createErrorType(code, message, Base) { + if (!Base) { + Base = Error + } + + function getMessage (arg1, arg2, arg3) { + if (typeof message === 'string') { + return message + } else { + return message(arg1, arg2, arg3) + } + } + + class NodeError extends Base { + constructor (arg1, arg2, arg3) { + super(getMessage(arg1, arg2, arg3)); + } + } + + NodeError.prototype.name = Base.name; + NodeError.prototype.code = code; + + codes[code] = NodeError; +} + +// https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js +function oneOf(expected, thing) { + if (Array.isArray(expected)) { + const len = expected.length; + expected = expected.map((i) => String(i)); + if (len > 2) { + return `one of ${thing} ${expected.slice(0, len - 1).join(', ')}, or ` + + expected[len - 1]; + } else if (len === 2) { + return `one of ${thing} ${expected[0]} or ${expected[1]}`; + } else { + return `of ${thing} ${expected[0]}`; + } + } else { + return `of ${thing} ${String(expected)}`; + } +} + +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith +function startsWith(str, search, pos) { + return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; +} + +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith +function endsWith(str, search, this_len) { + if (this_len === undefined || this_len > str.length) { + this_len = str.length; + } + return str.substring(this_len - search.length, this_len) === search; +} + +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes +function includes(str, search, start) { + if (typeof start !== 'number') { + start = 0; + } + + if (start + search.length > str.length) { + return false; + } else { + return str.indexOf(search, start) !== -1; + } +} + +createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { + return 'The value "' + value + '" is invalid for option "' + name + '"' +}, TypeError); +createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { + // determiner: 'must be' or 'must not be' + let determiner; + if (typeof expected === 'string' && startsWith(expected, 'not ')) { + determiner = 'must not be'; + expected = expected.replace(/^not /, ''); + } else { + determiner = 'must be'; + } + + let msg; + if (endsWith(name, ' argument')) { + // For cases like 'first argument' + msg = `The ${name} ${determiner} ${oneOf(expected, 'type')}`; + } else { + const type = includes(name, '.') ? 'property' : 'argument'; + msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, 'type')}`; + } + + msg += `. Received type ${typeof actual}`; + return msg; +}, TypeError); +createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); +createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { + return 'The ' + name + ' method is not implemented' +}); +createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); +createErrorType('ERR_STREAM_DESTROYED', function (name) { + return 'Cannot call ' + name + ' after a stream was destroyed'; +}); +createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); +createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); +createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); +createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); +createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { + return 'Unknown encoding: ' + arg +}, TypeError); +createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); + +module.exports.q = codes; + + +/***/ }), + +/***/ 41359: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + + + +/**/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; +}; +/**/ + +module.exports = Duplex; +var Readable = __nccwpck_require__(51433); +var Writable = __nccwpck_require__(26993); +__nccwpck_require__(44124)(Duplex, Readable); +{ + // Allow the keys array to be GC'ed. + var keys = objectKeys(Writable.prototype); + for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; + } +} +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + Readable.call(this, options); + Writable.call(this, options); + this.allowHalfOpen = true; + if (options) { + if (options.readable === false) this.readable = false; + if (options.writable === false) this.writable = false; + if (options.allowHalfOpen === false) { + this.allowHalfOpen = false; + this.once('end', onend); + } + } +} +Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.highWaterMark; + } +}); +Object.defineProperty(Duplex.prototype, 'writableBuffer', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState && this._writableState.getBuffer(); + } +}); +Object.defineProperty(Duplex.prototype, 'writableLength', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.length; + } +}); + +// the no-half-open enforcer +function onend() { + // If the writable side ended, then we're ok. + if (this._writableState.ended) return; + + // no more data can be written. + // But allow more writes to happen in this tick. + process.nextTick(onEndNT, this); +} +function onEndNT(self) { + self.end(); +} +Object.defineProperty(Duplex.prototype, 'destroyed', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + if (this._readableState === undefined || this._writableState === undefined) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function set(value) { + // we ignore the value if the stream + // has not been initialized yet + if (this._readableState === undefined || this._writableState === undefined) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + this._writableState.destroyed = value; + } +}); + +/***/ }), + +/***/ 81542: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + + + +module.exports = PassThrough; +var Transform = __nccwpck_require__(34415); +__nccwpck_require__(44124)(PassThrough, Transform); +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); + Transform.call(this, options); +} +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; + +/***/ }), + +/***/ 51433: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + + + +module.exports = Readable; + +/**/ +var Duplex; +/**/ + +Readable.ReadableState = ReadableState; + +/**/ +var EE = (__nccwpck_require__(82361).EventEmitter); +var EElistenerCount = function EElistenerCount(emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + +/**/ +var Stream = __nccwpck_require__(62387); +/**/ + +var Buffer = (__nccwpck_require__(14300).Buffer); +var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} + +/**/ +var debugUtil = __nccwpck_require__(73837); +var debug; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function debug() {}; +} +/**/ + +var BufferList = __nccwpck_require__(52746); +var destroyImpl = __nccwpck_require__(97049); +var _require = __nccwpck_require__(39948), + getHighWaterMark = _require.getHighWaterMark; +var _require$codes = (__nccwpck_require__(67214)/* .codes */ .q), + ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, + ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, + ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, + ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; + +// Lazy loaded to improve the startup performance. +var StringDecoder; +var createReadableStreamAsyncIterator; +var from; +__nccwpck_require__(44124)(Readable, Stream); +var errorOrDestroy = destroyImpl.errorOrDestroy; +var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; +function prependListener(emitter, event, fn) { + // Sadly this is not cacheable as some libraries bundle their own + // event emitter implementation with them. + if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); + + // This is a hack to make sure that our error handler is attached before any + // userland ones. NEVER DO THIS. This is here only because this code needs + // to continue to work with older versions of Node.js that do not include + // the prependListener() method. The goal is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; +} +function ReadableState(options, stream, isDuplex) { + Duplex = Duplex || __nccwpck_require__(41359); + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); + + // A linked list is used to store data chunks instead of an array because the + // linked list can remove elements from the beginning faster than + // array.shift() + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // a flag to be able to tell if the event 'readable'/'data' is emitted + // immediately, or on a later tick. We set this to true at first, because + // any actions that shouldn't happen until "later" should generally also + // not happen before the first read call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + this.paused = true; + + // Should close be emitted on destroy. Defaults to true. + this.emitClose = options.emitClose !== false; + + // Should .destroy() be called after 'end' (and potentially 'finish') + this.autoDestroy = !!options.autoDestroy; + + // has it been destroyed + this.destroyed = false; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = (__nccwpck_require__(94841)/* .StringDecoder */ .s); + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} +function Readable(options) { + Duplex = Duplex || __nccwpck_require__(41359); + if (!(this instanceof Readable)) return new Readable(options); + + // Checking for a Stream.Duplex instance is faster here instead of inside + // the ReadableState constructor, at least with V8 6.5 + var isDuplex = this instanceof Duplex; + this._readableState = new ReadableState(options, this, isDuplex); + + // legacy + this.readable = true; + if (options) { + if (typeof options.read === 'function') this._read = options.read; + if (typeof options.destroy === 'function') this._destroy = options.destroy; + } + Stream.call(this); +} +Object.defineProperty(Readable.prototype, 'destroyed', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + if (this._readableState === undefined) { + return false; + } + return this._readableState.destroyed; + }, + set: function set(value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._readableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + } +}); +Readable.prototype.destroy = destroyImpl.destroy; +Readable.prototype._undestroy = destroyImpl.undestroy; +Readable.prototype._destroy = function (err, cb) { + cb(err); +}; + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; + var skipChunkCheck; + if (!state.objectMode) { + if (typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = Buffer.from(chunk, encoding); + encoding = ''; + } + skipChunkCheck = true; + } + } else { + skipChunkCheck = true; + } + return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); +}; + +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + return readableAddChunk(this, chunk, null, true, false); +}; +function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { + debug('readableAddChunk', chunk); + var state = stream._readableState; + if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else { + var er; + if (!skipChunkCheck) er = chunkInvalid(state, chunk); + if (er) { + errorOrDestroy(stream, er); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { + chunk = _uint8ArrayToBuffer(chunk); + } + if (addToFront) { + if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true); + } else if (state.ended) { + errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); + } else if (state.destroyed) { + return false; + } else { + state.reading = false; + if (state.decoder && !encoding) { + chunk = state.decoder.write(chunk); + if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); + } else { + addChunk(stream, state, chunk, false); + } + } + } else if (!addToFront) { + state.reading = false; + maybeReadMore(stream, state); + } + } + + // We can push more data if we are below the highWaterMark. + // Also, if we have no data yet, we can stand some more bytes. + // This is to work around cases where hwm=0, such as the repl. + return !state.ended && (state.length < state.highWaterMark || state.length === 0); +} +function addChunk(stream, state, chunk, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + state.awaitDrain = 0; + stream.emit('data', chunk); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + if (state.needReadable) emitReadable(stream); + } + maybeReadMore(stream, state); +} +function chunkInvalid(state, chunk) { + var er; + if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk); + } + return er; +} +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; + +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = (__nccwpck_require__(94841)/* .StringDecoder */ .s); + var decoder = new StringDecoder(enc); + this._readableState.decoder = decoder; + // If setEncoding(null), decoder.encoding equals utf8 + this._readableState.encoding = this._readableState.decoder.encoding; + + // Iterate over current buffer to convert already stored Buffers: + var p = this._readableState.buffer.head; + var content = ''; + while (p !== null) { + content += decoder.write(p.data); + p = p.next; + } + this._readableState.buffer.clear(); + if (content !== '') this._readableState.buffer.push(content); + this._readableState.length = content.length; + return this; +}; + +// Don't raise the hwm > 1GB +var MAX_HWM = 0x40000000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE. + n = MAX_HWM; + } else { + // Get the next highest power of 2 to prevent increasing hwm excessively in + // tiny amounts + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; + } + return n; +} + +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function howMuchToRead(n, state) { + if (n <= 0 || state.length === 0 && state.ended) return 0; + if (state.objectMode) return 1; + if (n !== n) { + // Only flow one buffer at a time + if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; + } + // If we're asking for more than the current hwm, then raise the hwm. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); + if (n <= state.length) return n; + // Don't have enough + if (!state.ended) { + state.needReadable = true; + return 0; + } + return state.length; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function (n) { + debug('read', n); + n = parseInt(n, 10); + var state = this._readableState; + var nOrig = n; + if (n !== 0) state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; + } + n = howMuchToRead(n, state); + + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); + + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } else if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (!state.reading) n = howMuchToRead(nOrig, state); + } + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; + if (ret === null) { + state.needReadable = state.length <= state.highWaterMark; + n = 0; + } else { + state.length -= n; + state.awaitDrain = 0; + } + if (state.length === 0) { + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (!state.ended) state.needReadable = true; + + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended) endReadable(this); + } + if (ret !== null) this.emit('data', ret); + return ret; +}; +function onEofChunk(stream, state) { + debug('onEofChunk'); + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + if (state.sync) { + // if we are sync, wait until next tick to emit the data. + // Otherwise we risk emitting data in the flow() + // the readable code triggers during a read() call + emitReadable(stream); + } else { + // emit 'readable' now to make sure it gets picked up. + state.needReadable = false; + if (!state.emittedReadable) { + state.emittedReadable = true; + emitReadable_(stream); + } + } +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + debug('emitReadable', state.needReadable, state.emittedReadable); + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + process.nextTick(emitReadable_, stream); + } +} +function emitReadable_(stream) { + var state = stream._readableState; + debug('emitReadable_', state.destroyed, state.length, state.ended); + if (!state.destroyed && (state.length || state.ended)) { + stream.emit('readable'); + state.emittedReadable = false; + } + + // The stream needs another readable event if + // 1. It is not flowing, as the flow mechanism will take + // care of it. + // 2. It is not ended. + // 3. It is below the highWaterMark, so we can schedule + // another readable later. + state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; + flow(stream); +} + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + process.nextTick(maybeReadMore_, stream, state); + } +} +function maybeReadMore_(stream, state) { + // Attempt to read more data if we should. + // + // The conditions for reading more data are (one of): + // - Not enough data buffered (state.length < state.highWaterMark). The loop + // is responsible for filling the buffer with enough data if such data + // is available. If highWaterMark is 0 and we are not in the flowing mode + // we should _not_ attempt to buffer any extra data. We'll get more data + // when the stream consumer calls read() instead. + // - No data in the buffer, and the stream is in flowing mode. In this mode + // the loop below is responsible for ensuring read() is called. Failing to + // call read here would abort the flow and there's no other mechanism for + // continuing the flow if the stream consumer has just subscribed to the + // 'data' event. + // + // In addition to the above conditions to keep reading data, the following + // conditions prevent the data from being read: + // - The stream has ended (state.ended). + // - There is already a pending 'read' operation (state.reading). This is a + // case where the the stream has called the implementation defined _read() + // method, but they are processing the call asynchronously and have _not_ + // called push() with new data. In this case we skip performing more + // read()s. The execution ends in this method again after the _read() ends + // up calling push() with more data. + while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { + var len = state.length; + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function (n) { + errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()')); +}; +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn); + dest.on('unpipe', onunpipe); + function onunpipe(readable, unpipeInfo) { + debug('onunpipe'); + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } + } + function onend() { + debug('onend'); + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', unpipe); + src.removeListener('data', ondata); + cleanedUp = true; + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + var ret = dest.write(chunk); + debug('dest.write', ret); + if (ret === false) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug('false write response, pause', state.awaitDrain); + state.awaitDrain++; + } + src.pause(); + } + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er); + } + + // Make sure our error handler is attached before userland ones. + prependListener(dest, 'error', onerror); + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } + return dest; +}; +function pipeOnDrain(src) { + return function pipeOnDrainFunctionResult() { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; +} +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; + var unpipeInfo = { + hasUnpiped: false + }; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; + if (!dest) dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this, unpipeInfo); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + for (var i = 0; i < len; i++) dests[i].emit('unpipe', this, { + hasUnpiped: false + }); + return this; + } + + // try to find the right one. + var index = indexOf(state.pipes, dest); + if (index === -1) return this; + state.pipes.splice(index, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; + dest.emit('unpipe', this, unpipeInfo); + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + var state = this._readableState; + if (ev === 'data') { + // update readableListening so that resume() may be a no-op + // a few lines down. This is needed to support once('readable'). + state.readableListening = this.listenerCount('readable') > 0; + + // Try start flowing on next tick if stream isn't explicitly paused + if (state.flowing !== false) this.resume(); + } else if (ev === 'readable') { + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.flowing = false; + state.emittedReadable = false; + debug('on readable', state.length, state.reading); + if (state.length) { + emitReadable(this); + } else if (!state.reading) { + process.nextTick(nReadingNextTick, this); + } + } + } + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; +Readable.prototype.removeListener = function (ev, fn) { + var res = Stream.prototype.removeListener.call(this, ev, fn); + if (ev === 'readable') { + // We need to check if there is someone still listening to + // readable and reset the state. However this needs to happen + // after readable has been emitted but before I/O (nextTick) to + // support once('readable', fn) cycles. This means that calling + // resume within the same tick will have no + // effect. + process.nextTick(updateReadableListening, this); + } + return res; +}; +Readable.prototype.removeAllListeners = function (ev) { + var res = Stream.prototype.removeAllListeners.apply(this, arguments); + if (ev === 'readable' || ev === undefined) { + // We need to check if there is someone still listening to + // readable and reset the state. However this needs to happen + // after readable has been emitted but before I/O (nextTick) to + // support once('readable', fn) cycles. This means that calling + // resume within the same tick will have no + // effect. + process.nextTick(updateReadableListening, this); + } + return res; +}; +function updateReadableListening(self) { + var state = self._readableState; + state.readableListening = self.listenerCount('readable') > 0; + if (state.resumeScheduled && !state.paused) { + // flowing needs to be set to true now, otherwise + // the upcoming resume will not flow. + state.flowing = true; + + // crude way to check if we should resume + } else if (self.listenerCount('data') > 0) { + self.resume(); + } +} +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function () { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + // we flow only if there is no one listening + // for readable, but we still have to call + // resume() + state.flowing = !state.readableListening; + resume(this, state); + } + state.paused = false; + return this; +}; +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + process.nextTick(resume_, stream, state); + } +} +function resume_(stream, state) { + debug('resume', state.reading); + if (!state.reading) { + stream.read(0); + } + state.resumeScheduled = false; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (this._readableState.flowing !== false) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + this._readableState.paused = true; + return this; +}; +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + while (state.flowing && stream.read() !== null); +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function (stream) { + var _this = this; + var state = this._readableState; + var paused = false; + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) _this.push(chunk); + } + _this.push(null); + }); + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); + + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; + var ret = _this.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function methodWrap(method) { + return function methodWrapReturnFunction() { + return stream[method].apply(stream, arguments); + }; + }(i); + } + } + + // proxy certain important events. + for (var n = 0; n < kProxyEvents.length; n++) { + stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); + } + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + this._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; + return this; +}; +if (typeof Symbol === 'function') { + Readable.prototype[Symbol.asyncIterator] = function () { + if (createReadableStreamAsyncIterator === undefined) { + createReadableStreamAsyncIterator = __nccwpck_require__(43306); + } + return createReadableStreamAsyncIterator(this); + }; +} +Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState.highWaterMark; + } +}); +Object.defineProperty(Readable.prototype, 'readableBuffer', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState && this._readableState.buffer; + } +}); +Object.defineProperty(Readable.prototype, 'readableFlowing', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState.flowing; + }, + set: function set(state) { + if (this._readableState) { + this._readableState.flowing = state; + } + } +}); + +// exposed for testing purposes only. +Readable._fromList = fromList; +Object.defineProperty(Readable.prototype, 'readableLength', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState.length; + } +}); + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromList(n, state) { + // nothing buffered + if (state.length === 0) return null; + var ret; + if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { + // read it all, truncate the list + if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + // read part of list + ret = state.buffer.consume(n, state.decoder); + } + return ret; +} +function endReadable(stream) { + var state = stream._readableState; + debug('endReadable', state.endEmitted); + if (!state.endEmitted) { + state.ended = true; + process.nextTick(endReadableNT, state, stream); + } +} +function endReadableNT(state, stream) { + debug('endReadableNT', state.endEmitted, state.length); + + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + if (state.autoDestroy) { + // In case of duplex streams we need a way to detect + // if the writable side is ready for autoDestroy as well + var wState = stream._writableState; + if (!wState || wState.autoDestroy && wState.finished) { + stream.destroy(); + } + } + } +} +if (typeof Symbol === 'function') { + Readable.from = function (iterable, opts) { + if (from === undefined) { + from = __nccwpck_require__(39082); + } + return from(Readable, iterable, opts); + }; +} +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} + +/***/ }), + +/***/ 34415: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + + + +module.exports = Transform; +var _require$codes = (__nccwpck_require__(67214)/* .codes */ .q), + ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, + ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, + ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, + ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; +var Duplex = __nccwpck_require__(41359); +__nccwpck_require__(44124)(Transform, Duplex); +function afterTransform(er, data) { + var ts = this._transformState; + ts.transforming = false; + var cb = ts.writecb; + if (cb === null) { + return this.emit('error', new ERR_MULTIPLE_CALLBACK()); + } + ts.writechunk = null; + ts.writecb = null; + if (data != null) + // single equals check for both `null` and `undefined` + this.push(data); + cb(er); + var rs = this._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); + } +} +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); + Duplex.call(this, options); + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + if (typeof options.flush === 'function') this._flush = options.flush; + } + + // When the writable side finishes, then flush out anything remaining. + this.on('prefinish', prefinish); +} +function prefinish() { + var _this = this; + if (typeof this._flush === 'function' && !this._readableState.destroyed) { + this._flush(function (er, data) { + done(_this, er, data); + }); + } else { + done(this, null, null); + } +} +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function (chunk, encoding, cb) { + cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()')); +}; +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); + } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function (n) { + var ts = this._transformState; + if (ts.writechunk !== null && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; +Transform.prototype._destroy = function (err, cb) { + Duplex.prototype._destroy.call(this, err, function (err2) { + cb(err2); + }); +}; +function done(stream, er, data) { + if (er) return stream.emit('error', er); + if (data != null) + // single equals check for both `null` and `undefined` + stream.push(data); + + // TODO(BridgeAR): Write a test for these two error cases + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); + if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); + return stream.push(null); +} + +/***/ }), + +/***/ 26993: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. + + + +module.exports = Writable; + +/* */ +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} + +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; + this.next = null; + this.entry = null; + this.finish = function () { + onCorkedFinish(_this, state); + }; +} +/* */ + +/**/ +var Duplex; +/**/ + +Writable.WritableState = WritableState; + +/**/ +var internalUtil = { + deprecate: __nccwpck_require__(65278) +}; +/**/ + +/**/ +var Stream = __nccwpck_require__(62387); +/**/ + +var Buffer = (__nccwpck_require__(14300).Buffer); +var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} +var destroyImpl = __nccwpck_require__(97049); +var _require = __nccwpck_require__(39948), + getHighWaterMark = _require.getHighWaterMark; +var _require$codes = (__nccwpck_require__(67214)/* .codes */ .q), + ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, + ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, + ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, + ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, + ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, + ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, + ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, + ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; +var errorOrDestroy = destroyImpl.errorOrDestroy; +__nccwpck_require__(44124)(Writable, Stream); +function nop() {} +function WritableState(options, stream, isDuplex) { + Duplex = Duplex || __nccwpck_require__(41359); + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream, + // e.g. options.readableObjectMode vs. options.writableObjectMode, etc. + if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex); + + // if _final has been called + this.finalCalled = false; + + // drain event flag. + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // has it been destroyed + this.destroyed = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // when true all writes will be buffered until .uncork() call + this.corked = 0; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + this.bufferedRequest = null; + this.lastBufferedRequest = null; + + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; + + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; + + // Should close be emitted on destroy. Defaults to true. + this.emitClose = options.emitClose !== false; + + // Should .destroy() be called after 'finish' (and potentially 'end') + this.autoDestroy = !!options.autoDestroy; + + // count buffered requests + this.bufferedRequestCount = 0; + + // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + this.corkedRequestsFree = new CorkedRequest(this); +} +WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function writableStateBufferGetter() { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') + }); + } catch (_) {} +})(); + +// Test _writableState for inheritance to account for Duplex streams, +// whose prototype chain only points to Readable. +var realHasInstance; +if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable, Symbol.hasInstance, { + value: function value(object) { + if (realHasInstance.call(this, object)) return true; + if (this !== Writable) return false; + return object && object._writableState instanceof WritableState; + } + }); +} else { + realHasInstance = function realHasInstance(object) { + return object instanceof this; + }; +} +function Writable(options) { + Duplex = Duplex || __nccwpck_require__(41359); + + // Writable ctor is applied to Duplexes, too. + // `realHasInstance` is necessary because using plain `instanceof` + // would return false, as no `_writableState` property is attached. + + // Trying to use the custom `instanceof` for Writable here will also break the + // Node.js LazyTransform implementation, which has a non-trivial getter for + // `_writableState` that would lead to infinite recursion. + + // Checking for a Stream.Duplex instance is faster here instead of inside + // the WritableState constructor, at least with V8 6.5 + var isDuplex = this instanceof Duplex; + if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); + this._writableState = new WritableState(options, this, isDuplex); + + // legacy. + this.writable = true; + if (options) { + if (typeof options.write === 'function') this._write = options.write; + if (typeof options.writev === 'function') this._writev = options.writev; + if (typeof options.destroy === 'function') this._destroy = options.destroy; + if (typeof options.final === 'function') this._final = options.final; + } + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); +}; +function writeAfterEnd(stream, cb) { + var er = new ERR_STREAM_WRITE_AFTER_END(); + // TODO: defer error events consistently everywhere, not just the cb + errorOrDestroy(stream, er); + process.nextTick(cb, er); +} + +// Checks that a user-supplied chunk is valid, especially for the particular +// mode the stream is in. Currently this means that `null` is never accepted +// and undefined/non-string values are only allowed in object mode. +function validChunk(stream, state, chunk, cb) { + var er; + if (chunk === null) { + er = new ERR_STREAM_NULL_VALUES(); + } else if (typeof chunk !== 'string' && !state.objectMode) { + er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk); + } + if (er) { + errorOrDestroy(stream, er); + process.nextTick(cb, er); + return false; + } + return true; +} +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + var isBuf = !state.objectMode && _isUint8Array(chunk); + if (isBuf && !Buffer.isBuffer(chunk)) { + chunk = _uint8ArrayToBuffer(chunk); + } + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + if (typeof cb !== 'function') cb = nop; + if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); + } + return ret; +}; +Writable.prototype.cork = function () { + this._writableState.corked++; +}; +Writable.prototype.uncork = function () { + var state = this._writableState; + if (state.corked) { + state.corked--; + if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } +}; +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); + this._writableState.defaultEncoding = encoding; + return this; +}; +Object.defineProperty(Writable.prototype, 'writableBuffer', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState && this._writableState.getBuffer(); + } +}); +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = Buffer.from(chunk, encoding); + } + return chunk; +} +Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.highWaterMark; + } +}); + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk, encoding); + if (chunk !== newChunk) { + isBuf = true; + encoding = 'buffer'; + chunk = newChunk; + } + } + var len = state.objectMode ? 1 : chunk.length; + state.length += len; + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk: chunk, + encoding: encoding, + isBuf: isBuf, + callback: cb, + next: null + }; + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } + return ret; +} +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + if (sync) { + // defer the callback if we are being called synchronously + // to avoid piling up things on the stack + process.nextTick(cb, er); + // this can emit finish, and it will always happen + // after error + process.nextTick(finishMaybe, stream, state); + stream._writableState.errorEmitted = true; + errorOrDestroy(stream, er); + } else { + // the caller expect this to happen before if + // it is async + cb(er); + stream._writableState.errorEmitted = true; + errorOrDestroy(stream, er); + // this can emit finish, but finish must + // always follow error + finishMaybe(stream, state); + } +} +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK(); + onwriteStateUpdate(state); + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state) || stream.destroyed; + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } + if (sync) { + process.nextTick(afterWrite, stream, state, finished, cb); + } else { + afterWrite(stream, state, finished, cb); + } + } +} +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + var count = 0; + var allBuffers = true; + while (entry) { + buffer[count] = entry; + if (!entry.isBuf) allBuffers = false; + entry = entry.next; + count += 1; + } + buffer.allBuffers = allBuffers; + doWrite(stream, state, true, state.length, buffer, '', holder.finish); + + // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + state.bufferedRequestCount = 0; + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + state.bufferedRequestCount--; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } + } + if (entry === null) state.lastBufferedRequest = null; + } + state.bufferedRequest = entry; + state.bufferProcessing = false; +} +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()')); +}; +Writable.prototype._writev = null; +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } + + // ignore unnecessary end() calls. + if (!state.ending) endWritable(this, state, cb); + return this; +}; +Object.defineProperty(Writable.prototype, 'writableLength', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.length; + } +}); +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} +function callFinal(stream, state) { + stream._final(function (err) { + state.pendingcb--; + if (err) { + errorOrDestroy(stream, err); + } + state.prefinished = true; + stream.emit('prefinish'); + finishMaybe(stream, state); + }); +} +function prefinish(stream, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream._final === 'function' && !state.destroyed) { + state.pendingcb++; + state.finalCalled = true; + process.nextTick(callFinal, stream, state); + } else { + state.prefinished = true; + stream.emit('prefinish'); + } + } +} +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + prefinish(stream, state); + if (state.pendingcb === 0) { + state.finished = true; + stream.emit('finish'); + if (state.autoDestroy) { + // In case of duplex streams we need a way to detect + // if the readable side is ready for autoDestroy as well + var rState = stream._readableState; + if (!rState || rState.autoDestroy && rState.endEmitted) { + stream.destroy(); + } + } + } + } + return need; +} +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) process.nextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; +} +function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + + // reuse the free corkReq. + state.corkedRequestsFree.next = corkReq; +} +Object.defineProperty(Writable.prototype, 'destroyed', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + if (this._writableState === undefined) { + return false; + } + return this._writableState.destroyed; + }, + set: function set(value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._writableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._writableState.destroyed = value; + } +}); +Writable.prototype.destroy = destroyImpl.destroy; +Writable.prototype._undestroy = destroyImpl.undestroy; +Writable.prototype._destroy = function (err, cb) { + cb(err); +}; + +/***/ }), + +/***/ 43306: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var _Object$setPrototypeO; +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +var finished = __nccwpck_require__(76080); +var kLastResolve = Symbol('lastResolve'); +var kLastReject = Symbol('lastReject'); +var kError = Symbol('error'); +var kEnded = Symbol('ended'); +var kLastPromise = Symbol('lastPromise'); +var kHandlePromise = Symbol('handlePromise'); +var kStream = Symbol('stream'); +function createIterResult(value, done) { + return { + value: value, + done: done + }; +} +function readAndResolve(iter) { + var resolve = iter[kLastResolve]; + if (resolve !== null) { + var data = iter[kStream].read(); + // we defer if data is null + // we can be expecting either 'end' or + // 'error' + if (data !== null) { + iter[kLastPromise] = null; + iter[kLastResolve] = null; + iter[kLastReject] = null; + resolve(createIterResult(data, false)); + } + } +} +function onReadable(iter) { + // we wait for the next tick, because it might + // emit an error with process.nextTick + process.nextTick(readAndResolve, iter); +} +function wrapForNext(lastPromise, iter) { + return function (resolve, reject) { + lastPromise.then(function () { + if (iter[kEnded]) { + resolve(createIterResult(undefined, true)); + return; + } + iter[kHandlePromise](resolve, reject); + }, reject); + }; +} +var AsyncIteratorPrototype = Object.getPrototypeOf(function () {}); +var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { + get stream() { + return this[kStream]; + }, + next: function next() { + var _this = this; + // if we have detected an error in the meanwhile + // reject straight away + var error = this[kError]; + if (error !== null) { + return Promise.reject(error); + } + if (this[kEnded]) { + return Promise.resolve(createIterResult(undefined, true)); + } + if (this[kStream].destroyed) { + // We need to defer via nextTick because if .destroy(err) is + // called, the error will be emitted via nextTick, and + // we cannot guarantee that there is no error lingering around + // waiting to be emitted. + return new Promise(function (resolve, reject) { + process.nextTick(function () { + if (_this[kError]) { + reject(_this[kError]); + } else { + resolve(createIterResult(undefined, true)); + } + }); + }); + } + + // if we have multiple next() calls + // we will wait for the previous Promise to finish + // this logic is optimized to support for await loops, + // where next() is only called once at a time + var lastPromise = this[kLastPromise]; + var promise; + if (lastPromise) { + promise = new Promise(wrapForNext(lastPromise, this)); + } else { + // fast path needed to support multiple this.push() + // without triggering the next() queue + var data = this[kStream].read(); + if (data !== null) { + return Promise.resolve(createIterResult(data, false)); + } + promise = new Promise(this[kHandlePromise]); + } + this[kLastPromise] = promise; + return promise; + } +}, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () { + return this; +}), _defineProperty(_Object$setPrototypeO, "return", function _return() { + var _this2 = this; + // destroy(err, cb) is a private API + // we can guarantee we have that here, because we control the + // Readable class this is attached to + return new Promise(function (resolve, reject) { + _this2[kStream].destroy(null, function (err) { + if (err) { + reject(err); + return; + } + resolve(createIterResult(undefined, true)); + }); + }); +}), _Object$setPrototypeO), AsyncIteratorPrototype); +var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) { + var _Object$create; + var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { + value: stream, + writable: true + }), _defineProperty(_Object$create, kLastResolve, { + value: null, + writable: true + }), _defineProperty(_Object$create, kLastReject, { + value: null, + writable: true + }), _defineProperty(_Object$create, kError, { + value: null, + writable: true + }), _defineProperty(_Object$create, kEnded, { + value: stream._readableState.endEmitted, + writable: true + }), _defineProperty(_Object$create, kHandlePromise, { + value: function value(resolve, reject) { + var data = iterator[kStream].read(); + if (data) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + resolve(createIterResult(data, false)); + } else { + iterator[kLastResolve] = resolve; + iterator[kLastReject] = reject; + } + }, + writable: true + }), _Object$create)); + iterator[kLastPromise] = null; + finished(stream, function (err) { + if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') { + var reject = iterator[kLastReject]; + // reject if we are waiting for data in the Promise + // returned by next() and store the error + if (reject !== null) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + reject(err); + } + iterator[kError] = err; + return; + } + var resolve = iterator[kLastResolve]; + if (resolve !== null) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + resolve(createIterResult(undefined, true)); + } + iterator[kEnded] = true; + }); + stream.on('readable', onReadable.bind(null, iterator)); + return iterator; +}; +module.exports = createReadableStreamAsyncIterator; + +/***/ }), + +/***/ 52746: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +var _require = __nccwpck_require__(14300), + Buffer = _require.Buffer; +var _require2 = __nccwpck_require__(73837), + inspect = _require2.inspect; +var custom = inspect && inspect.custom || 'inspect'; +function copyBuffer(src, target, offset) { + Buffer.prototype.copy.call(src, target, offset); +} +module.exports = /*#__PURE__*/function () { + function BufferList() { + _classCallCheck(this, BufferList); + this.head = null; + this.tail = null; + this.length = 0; + } + _createClass(BufferList, [{ + key: "push", + value: function push(v) { + var entry = { + data: v, + next: null + }; + if (this.length > 0) this.tail.next = entry;else this.head = entry; + this.tail = entry; + ++this.length; + } + }, { + key: "unshift", + value: function unshift(v) { + var entry = { + data: v, + next: this.head + }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; + } + }, { + key: "shift", + value: function shift() { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; + --this.length; + return ret; + } + }, { + key: "clear", + value: function clear() { + this.head = this.tail = null; + this.length = 0; + } + }, { + key: "join", + value: function join(s) { + if (this.length === 0) return ''; + var p = this.head; + var ret = '' + p.data; + while (p = p.next) ret += s + p.data; + return ret; + } + }, { + key: "concat", + value: function concat(n) { + if (this.length === 0) return Buffer.alloc(0); + var ret = Buffer.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; + while (p) { + copyBuffer(p.data, ret, i); + i += p.data.length; + p = p.next; + } + return ret; + } + + // Consumes a specified amount of bytes or characters from the buffered data. + }, { + key: "consume", + value: function consume(n, hasStrings) { + var ret; + if (n < this.head.data.length) { + // `slice` is the same for buffers and strings. + ret = this.head.data.slice(0, n); + this.head.data = this.head.data.slice(n); + } else if (n === this.head.data.length) { + // First chunk is a perfect match. + ret = this.shift(); + } else { + // Result spans more than one buffer. + ret = hasStrings ? this._getString(n) : this._getBuffer(n); + } + return ret; + } + }, { + key: "first", + value: function first() { + return this.head.data; + } + + // Consumes a specified amount of characters from the buffered data. + }, { + key: "_getString", + value: function _getString(n) { + var p = this.head; + var c = 1; + var ret = p.data; + n -= ret.length; + while (p = p.next) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) ret += str;else ret += str.slice(0, n); + n -= nb; + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) this.head = p.next;else this.head = this.tail = null; + } else { + this.head = p; + p.data = str.slice(nb); + } + break; + } + ++c; + } + this.length -= c; + return ret; + } + + // Consumes a specified amount of bytes from the buffered data. + }, { + key: "_getBuffer", + value: function _getBuffer(n) { + var ret = Buffer.allocUnsafe(n); + var p = this.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + while (p = p.next) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) this.head = p.next;else this.head = this.tail = null; + } else { + this.head = p; + p.data = buf.slice(nb); + } + break; + } + ++c; + } + this.length -= c; + return ret; + } + + // Make sure the linked list only shows the minimal necessary information. + }, { + key: custom, + value: function value(_, options) { + return inspect(this, _objectSpread(_objectSpread({}, options), {}, { + // Only inspect one level. + depth: 0, + // It should not recurse. + customInspect: false + })); + } + }]); + return BufferList; +}(); + +/***/ }), + +/***/ 97049: +/***/ ((module) => { + +"use strict"; + + +// undocumented cb() API, needed for core, not for public API +function destroy(err, cb) { + var _this = this; + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err) { + if (!this._writableState) { + process.nextTick(emitErrorNT, this, err); + } else if (!this._writableState.errorEmitted) { + this._writableState.errorEmitted = true; + process.nextTick(emitErrorNT, this, err); + } + } + return this; + } + + // we set destroyed to true before firing error callbacks in order + // to make it re-entrance safe in case destroy() is called within callbacks + + if (this._readableState) { + this._readableState.destroyed = true; + } + + // if this is a duplex stream mark the writable part as destroyed as well + if (this._writableState) { + this._writableState.destroyed = true; + } + this._destroy(err || null, function (err) { + if (!cb && err) { + if (!_this._writableState) { + process.nextTick(emitErrorAndCloseNT, _this, err); + } else if (!_this._writableState.errorEmitted) { + _this._writableState.errorEmitted = true; + process.nextTick(emitErrorAndCloseNT, _this, err); + } else { + process.nextTick(emitCloseNT, _this); + } + } else if (cb) { + process.nextTick(emitCloseNT, _this); + cb(err); + } else { + process.nextTick(emitCloseNT, _this); + } + }); + return this; +} +function emitErrorAndCloseNT(self, err) { + emitErrorNT(self, err); + emitCloseNT(self); +} +function emitCloseNT(self) { + if (self._writableState && !self._writableState.emitClose) return; + if (self._readableState && !self._readableState.emitClose) return; + self.emit('close'); +} +function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; + } + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finalCalled = false; + this._writableState.prefinished = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; + } +} +function emitErrorNT(self, err) { + self.emit('error', err); +} +function errorOrDestroy(stream, err) { + // We have tests that rely on errors being emitted + // in the same tick, so changing this is semver major. + // For now when you opt-in to autoDestroy we allow + // the error to be emitted nextTick. In a future + // semver major update we should change the default to this. + + var rState = stream._readableState; + var wState = stream._writableState; + if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err); +} +module.exports = { + destroy: destroy, + undestroy: undestroy, + errorOrDestroy: errorOrDestroy +}; + +/***/ }), + +/***/ 76080: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// Ported from https://github.com/mafintosh/end-of-stream with +// permission from the author, Mathias Buus (@mafintosh). + + + +var ERR_STREAM_PREMATURE_CLOSE = (__nccwpck_require__(67214)/* .codes.ERR_STREAM_PREMATURE_CLOSE */ .q.ERR_STREAM_PREMATURE_CLOSE); +function once(callback) { + var called = false; + return function () { + if (called) return; + called = true; + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + callback.apply(this, args); + }; +} +function noop() {} +function isRequest(stream) { + return stream.setHeader && typeof stream.abort === 'function'; +} +function eos(stream, opts, callback) { + if (typeof opts === 'function') return eos(stream, null, opts); + if (!opts) opts = {}; + callback = once(callback || noop); + var readable = opts.readable || opts.readable !== false && stream.readable; + var writable = opts.writable || opts.writable !== false && stream.writable; + var onlegacyfinish = function onlegacyfinish() { + if (!stream.writable) onfinish(); + }; + var writableEnded = stream._writableState && stream._writableState.finished; + var onfinish = function onfinish() { + writable = false; + writableEnded = true; + if (!readable) callback.call(stream); + }; + var readableEnded = stream._readableState && stream._readableState.endEmitted; + var onend = function onend() { + readable = false; + readableEnded = true; + if (!writable) callback.call(stream); + }; + var onerror = function onerror(err) { + callback.call(stream, err); + }; + var onclose = function onclose() { + var err; + if (readable && !readableEnded) { + if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); + return callback.call(stream, err); + } + if (writable && !writableEnded) { + if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); + return callback.call(stream, err); + } + }; + var onrequest = function onrequest() { + stream.req.on('finish', onfinish); + }; + if (isRequest(stream)) { + stream.on('complete', onfinish); + stream.on('abort', onclose); + if (stream.req) onrequest();else stream.on('request', onrequest); + } else if (writable && !stream._writableState) { + // legacy streams + stream.on('end', onlegacyfinish); + stream.on('close', onlegacyfinish); + } + stream.on('end', onend); + stream.on('finish', onfinish); + if (opts.error !== false) stream.on('error', onerror); + stream.on('close', onclose); + return function () { + stream.removeListener('complete', onfinish); + stream.removeListener('abort', onclose); + stream.removeListener('request', onrequest); + if (stream.req) stream.req.removeListener('finish', onfinish); + stream.removeListener('end', onlegacyfinish); + stream.removeListener('close', onlegacyfinish); + stream.removeListener('finish', onfinish); + stream.removeListener('end', onend); + stream.removeListener('error', onerror); + stream.removeListener('close', onclose); + }; +} +module.exports = eos; + +/***/ }), + +/***/ 39082: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } +function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +var ERR_INVALID_ARG_TYPE = (__nccwpck_require__(67214)/* .codes.ERR_INVALID_ARG_TYPE */ .q.ERR_INVALID_ARG_TYPE); +function from(Readable, iterable, opts) { + var iterator; + if (iterable && typeof iterable.next === 'function') { + iterator = iterable; + } else if (iterable && iterable[Symbol.asyncIterator]) iterator = iterable[Symbol.asyncIterator]();else if (iterable && iterable[Symbol.iterator]) iterator = iterable[Symbol.iterator]();else throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable); + var readable = new Readable(_objectSpread({ + objectMode: true + }, opts)); + // Reading boolean to protect against _read + // being called before last iteration completion. + var reading = false; + readable._read = function () { + if (!reading) { + reading = true; + next(); + } + }; + function next() { + return _next2.apply(this, arguments); + } + function _next2() { + _next2 = _asyncToGenerator(function* () { + try { + var _yield$iterator$next = yield iterator.next(), + value = _yield$iterator$next.value, + done = _yield$iterator$next.done; + if (done) { + readable.push(null); + } else if (readable.push(yield value)) { + next(); + } else { + reading = false; + } + } catch (err) { + readable.destroy(err); + } + }); + return _next2.apply(this, arguments); + } + return readable; +} +module.exports = from; + + +/***/ }), + +/***/ 76989: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// Ported from https://github.com/mafintosh/pump with +// permission from the author, Mathias Buus (@mafintosh). + + + +var eos; +function once(callback) { + var called = false; + return function () { + if (called) return; + called = true; + callback.apply(void 0, arguments); + }; +} +var _require$codes = (__nccwpck_require__(67214)/* .codes */ .q), + ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, + ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; +function noop(err) { + // Rethrow the error if it exists to avoid swallowing it + if (err) throw err; +} +function isRequest(stream) { + return stream.setHeader && typeof stream.abort === 'function'; +} +function destroyer(stream, reading, writing, callback) { + callback = once(callback); + var closed = false; + stream.on('close', function () { + closed = true; + }); + if (eos === undefined) eos = __nccwpck_require__(76080); + eos(stream, { + readable: reading, + writable: writing + }, function (err) { + if (err) return callback(err); + closed = true; + callback(); + }); + var destroyed = false; + return function (err) { + if (closed) return; + if (destroyed) return; + destroyed = true; + + // request.destroy just do .end - .abort is what we want + if (isRequest(stream)) return stream.abort(); + if (typeof stream.destroy === 'function') return stream.destroy(); + callback(err || new ERR_STREAM_DESTROYED('pipe')); + }; +} +function call(fn) { + fn(); +} +function pipe(from, to) { + return from.pipe(to); +} +function popCallback(streams) { + if (!streams.length) return noop; + if (typeof streams[streams.length - 1] !== 'function') return noop; + return streams.pop(); +} +function pipeline() { + for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { + streams[_key] = arguments[_key]; + } + var callback = popCallback(streams); + if (Array.isArray(streams[0])) streams = streams[0]; + if (streams.length < 2) { + throw new ERR_MISSING_ARGS('streams'); + } + var error; + var destroys = streams.map(function (stream, i) { + var reading = i < streams.length - 1; + var writing = i > 0; + return destroyer(stream, reading, writing, function (err) { + if (!error) error = err; + if (err) destroys.forEach(call); + if (reading) return; + destroys.forEach(call); + callback(error); + }); + }); + return streams.reduce(pipe); +} +module.exports = pipeline; + +/***/ }), + +/***/ 39948: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var ERR_INVALID_OPT_VALUE = (__nccwpck_require__(67214)/* .codes.ERR_INVALID_OPT_VALUE */ .q.ERR_INVALID_OPT_VALUE); +function highWaterMarkFrom(options, isDuplex, duplexKey) { + return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; +} +function getHighWaterMark(state, options, duplexKey, isDuplex) { + var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); + if (hwm != null) { + if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { + var name = isDuplex ? duplexKey : 'highWaterMark'; + throw new ERR_INVALID_OPT_VALUE(name, hwm); + } + return Math.floor(hwm); + } + + // Default value + return state.objectMode ? 16 : 16 * 1024; +} +module.exports = { + getHighWaterMark: getHighWaterMark +}; + +/***/ }), + +/***/ 62387: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +module.exports = __nccwpck_require__(12781); + + +/***/ }), + +/***/ 51642: +/***/ ((module, exports, __nccwpck_require__) => { + +var Stream = __nccwpck_require__(12781); +if (process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream.Readable; + Object.assign(module.exports, Stream); + module.exports.Stream = Stream; +} else { + exports = module.exports = __nccwpck_require__(51433); + exports.Stream = Stream || exports; + exports.Readable = exports; + exports.Writable = __nccwpck_require__(26993); + exports.Duplex = __nccwpck_require__(41359); + exports.Transform = __nccwpck_require__(34415); + exports.PassThrough = __nccwpck_require__(81542); + exports.finished = __nccwpck_require__(76080); + exports.pipeline = __nccwpck_require__(76989); +} + + +/***/ }), + +/***/ 14959: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const assert = __nccwpck_require__(39491) +const path = __nccwpck_require__(71017) +const fs = __nccwpck_require__(57147) +let glob = undefined +try { + glob = __nccwpck_require__(91957) +} catch (_err) { + // treat glob as optional. +} + +const defaultGlobOpts = { + nosort: true, + silent: true +} + +// for EMFILE handling +let timeout = 0 + +const isWindows = (process.platform === "win32") + +const defaults = options => { + const methods = [ + 'unlink', + 'chmod', + 'stat', + 'lstat', + 'rmdir', + 'readdir' + ] + methods.forEach(m => { + options[m] = options[m] || fs[m] + m = m + 'Sync' + options[m] = options[m] || fs[m] + }) + + options.maxBusyTries = options.maxBusyTries || 3 + options.emfileWait = options.emfileWait || 1000 + if (options.glob === false) { + options.disableGlob = true + } + if (options.disableGlob !== true && glob === undefined) { + throw Error('glob dependency not found, set `options.disableGlob = true` if intentional') + } + options.disableGlob = options.disableGlob || false + options.glob = options.glob || defaultGlobOpts +} + +const rimraf = (p, options, cb) => { + if (typeof options === 'function') { + cb = options + options = {} + } + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert.equal(typeof cb, 'function', 'rimraf: callback function required') + assert(options, 'rimraf: invalid options argument provided') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + defaults(options) + + let busyTries = 0 + let errState = null + let n = 0 + + const next = (er) => { + errState = errState || er + if (--n === 0) + cb(errState) + } + + const afterGlob = (er, results) => { + if (er) + return cb(er) + + n = results.length + if (n === 0) + return cb() + + results.forEach(p => { + const CB = (er) => { + if (er) { + if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && + busyTries < options.maxBusyTries) { + busyTries ++ + // try again, with the same exact callback as this one. + return setTimeout(() => rimraf_(p, options, CB), busyTries * 100) + } + + // this one won't happen if graceful-fs is used. + if (er.code === "EMFILE" && timeout < options.emfileWait) { + return setTimeout(() => rimraf_(p, options, CB), timeout ++) + } + + // already gone + if (er.code === "ENOENT") er = null + } + + timeout = 0 + next(er) + } + rimraf_(p, options, CB) + }) + } + + if (options.disableGlob || !glob.hasMagic(p)) + return afterGlob(null, [p]) + + options.lstat(p, (er, stat) => { + if (!er) + return afterGlob(null, [p]) + + glob(p, options.glob, afterGlob) + }) + +} + +// Two possible strategies. +// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR +// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR +// +// Both result in an extra syscall when you guess wrong. However, there +// are likely far more normal files in the world than directories. This +// is based on the assumption that a the average number of files per +// directory is >= 1. +// +// If anyone ever complains about this, then I guess the strategy could +// be made configurable somehow. But until then, YAGNI. +const rimraf_ = (p, options, cb) => { + assert(p) + assert(options) + assert(typeof cb === 'function') + + // sunos lets the root user unlink directories, which is... weird. + // so we have to lstat here and make sure it's not a dir. + options.lstat(p, (er, st) => { + if (er && er.code === "ENOENT") + return cb(null) + + // Windows can EPERM on stat. Life is suffering. + if (er && er.code === "EPERM" && isWindows) + fixWinEPERM(p, options, er, cb) + + if (st && st.isDirectory()) + return rmdir(p, options, er, cb) + + options.unlink(p, er => { + if (er) { + if (er.code === "ENOENT") + return cb(null) + if (er.code === "EPERM") + return (isWindows) + ? fixWinEPERM(p, options, er, cb) + : rmdir(p, options, er, cb) + if (er.code === "EISDIR") + return rmdir(p, options, er, cb) + } + return cb(er) + }) + }) +} + +const fixWinEPERM = (p, options, er, cb) => { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.chmod(p, 0o666, er2 => { + if (er2) + cb(er2.code === "ENOENT" ? null : er) + else + options.stat(p, (er3, stats) => { + if (er3) + cb(er3.code === "ENOENT" ? null : er) + else if (stats.isDirectory()) + rmdir(p, options, er, cb) + else + options.unlink(p, cb) + }) + }) +} + +const fixWinEPERMSync = (p, options, er) => { + assert(p) + assert(options) + + try { + options.chmodSync(p, 0o666) + } catch (er2) { + if (er2.code === "ENOENT") + return + else + throw er + } + + let stats + try { + stats = options.statSync(p) + } catch (er3) { + if (er3.code === "ENOENT") + return + else + throw er + } + + if (stats.isDirectory()) + rmdirSync(p, options, er) + else + options.unlinkSync(p) +} + +const rmdir = (p, options, originalEr, cb) => { + assert(p) + assert(options) + assert(typeof cb === 'function') + + // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) + // if we guessed wrong, and it's not a directory, then + // raise the original error. + options.rmdir(p, er => { + if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) + rmkids(p, options, cb) + else if (er && er.code === "ENOTDIR") + cb(originalEr) + else + cb(er) + }) +} + +const rmkids = (p, options, cb) => { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.readdir(p, (er, files) => { + if (er) + return cb(er) + let n = files.length + if (n === 0) + return options.rmdir(p, cb) + let errState + files.forEach(f => { + rimraf(path.join(p, f), options, er => { + if (errState) + return + if (er) + return cb(errState = er) + if (--n === 0) + options.rmdir(p, cb) + }) + }) + }) +} + +// this looks simpler, and is strictly *faster*, but will +// tie up the JavaScript thread and fail on excessively +// deep directory trees. +const rimrafSync = (p, options) => { + options = options || {} + defaults(options) + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert(options, 'rimraf: missing options') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + let results + + if (options.disableGlob || !glob.hasMagic(p)) { + results = [p] + } else { + try { + options.lstatSync(p) + results = [p] + } catch (er) { + results = glob.sync(p, options.glob) + } + } + + if (!results.length) + return + + for (let i = 0; i < results.length; i++) { + const p = results[i] + + let st + try { + st = options.lstatSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + + // Windows can EPERM on stat. Life is suffering. + if (er.code === "EPERM" && isWindows) + fixWinEPERMSync(p, options, er) + } + + try { + // sunos lets the root user unlink directories, which is... weird. + if (st && st.isDirectory()) + rmdirSync(p, options, null) + else + options.unlinkSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + if (er.code === "EPERM") + return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) + if (er.code !== "EISDIR") + throw er + + rmdirSync(p, options, er) + } + } +} + +const rmdirSync = (p, options, originalEr) => { + assert(p) + assert(options) + + try { + options.rmdirSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + if (er.code === "ENOTDIR") + throw originalEr + if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") + rmkidsSync(p, options) + } +} + +const rmkidsSync = (p, options) => { + assert(p) + assert(options) + options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) + + // We only end up here once we got ENOTEMPTY at least once, and + // at this point, we are guaranteed to have removed all the kids. + // So, we know that it won't be ENOENT or ENOTDIR or anything else. + // try really hard to delete stuff on windows, because it has a + // PROFOUNDLY annoying habit of not closing handles promptly when + // files are deleted, resulting in spurious ENOTEMPTY errors. + const retries = isWindows ? 100 : 1 + let i = 0 + do { + let threw = true + try { + const ret = options.rmdirSync(p, options) + threw = false + return ret + } finally { + if (++i < retries && threw) + continue + } + } while (true) +} + +module.exports = rimraf +rimraf.sync = rimrafSync + + +/***/ }), + +/***/ 21867: +/***/ ((module, exports, __nccwpck_require__) => { + +/*! safe-buffer. MIT License. Feross Aboukhadijeh */ +/* eslint-disable node/no-deprecated-api */ +var buffer = __nccwpck_require__(14300) +var Buffer = buffer.Buffer + +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} + +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.prototype = Object.create(Buffer.prototype) + +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) + +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf +} + +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} + +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} + + +/***/ }), + +/***/ 91532: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const ANY = Symbol('SemVer ANY') +// hoisted class for cyclic dependency +class Comparator { + static get ANY () { + return ANY + } + + constructor (comp, options) { + options = parseOptions(options) + + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp + } else { + comp = comp.value + } + } + + comp = comp.trim().split(/\s+/).join(' ') + debug('comparator', comp, options) + this.options = options + this.loose = !!options.loose + this.parse(comp) + + if (this.semver === ANY) { + this.value = '' + } else { + this.value = this.operator + this.semver.version + } + + debug('comp', this) + } + + parse (comp) { + const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + const m = comp.match(r) + + if (!m) { + throw new TypeError(`Invalid comparator: ${comp}`) + } + + this.operator = m[1] !== undefined ? m[1] : '' + if (this.operator === '=') { + this.operator = '' + } + + // if it literally is just '>' or '' then allow anything. + if (!m[2]) { + this.semver = ANY + } else { + this.semver = new SemVer(m[2], this.options.loose) + } + } + + toString () { + return this.value + } + + test (version) { + debug('Comparator.test', version, this.options.loose) + + if (this.semver === ANY || version === ANY) { + return true + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + return cmp(version, this.operator, this.semver, this.options) + } + + intersects (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') + } + + if (this.operator === '') { + if (this.value === '') { + return true + } + return new Range(comp.value, options).test(this.value) + } else if (comp.operator === '') { + if (comp.value === '') { + return true + } + return new Range(this.value, options).test(comp.semver) + } + + options = parseOptions(options) + + // Special cases where nothing can possibly be lower + if (options.includePrerelease && + (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) { + return false + } + if (!options.includePrerelease && + (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) { + return false + } + + // Same direction increasing (> or >=) + if (this.operator.startsWith('>') && comp.operator.startsWith('>')) { + return true + } + // Same direction decreasing (< or <=) + if (this.operator.startsWith('<') && comp.operator.startsWith('<')) { + return true + } + // same SemVer and both sides are inclusive (<= or >=) + if ( + (this.semver.version === comp.semver.version) && + this.operator.includes('=') && comp.operator.includes('=')) { + return true + } + // opposite directions less than + if (cmp(this.semver, '<', comp.semver, options) && + this.operator.startsWith('>') && comp.operator.startsWith('<')) { + return true + } + // opposite directions greater than + if (cmp(this.semver, '>', comp.semver, options) && + this.operator.startsWith('<') && comp.operator.startsWith('>')) { + return true + } + return false + } +} + +module.exports = Comparator + +const parseOptions = __nccwpck_require__(40785) +const { safeRe: re, t } = __nccwpck_require__(9523) +const cmp = __nccwpck_require__(75098) +const debug = __nccwpck_require__(50427) +const SemVer = __nccwpck_require__(48088) +const Range = __nccwpck_require__(9828) + + +/***/ }), + +/***/ 9828: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +// hoisted class for cyclic dependency +class Range { + constructor (range, options) { + options = parseOptions(options) + + if (range instanceof Range) { + if ( + range.loose === !!options.loose && + range.includePrerelease === !!options.includePrerelease + ) { + return range + } else { + return new Range(range.raw, options) + } + } + + if (range instanceof Comparator) { + // just put it in the set and return + this.raw = range.value + this.set = [[range]] + this.format() + return this + } + + this.options = options + this.loose = !!options.loose + this.includePrerelease = !!options.includePrerelease + + // First reduce all whitespace as much as possible so we do not have to rely + // on potentially slow regexes like \s*. This is then stored and used for + // future error messages as well. + this.raw = range + .trim() + .split(/\s+/) + .join(' ') + + // First, split on || + this.set = this.raw + .split('||') + // map the range to a 2d array of comparators + .map(r => this.parseRange(r.trim())) + // throw out any comparator lists that are empty + // this generally means that it was not a valid range, which is allowed + // in loose mode, but will still throw if the WHOLE range is invalid. + .filter(c => c.length) + + if (!this.set.length) { + throw new TypeError(`Invalid SemVer Range: ${this.raw}`) + } + + // if we have any that are not the null set, throw out null sets. + if (this.set.length > 1) { + // keep the first one, in case they're all null sets + const first = this.set[0] + this.set = this.set.filter(c => !isNullSet(c[0])) + if (this.set.length === 0) { + this.set = [first] + } else if (this.set.length > 1) { + // if we have any that are *, then the range is just * + for (const c of this.set) { + if (c.length === 1 && isAny(c[0])) { + this.set = [c] + break + } + } + } + } + + this.format() + } + + format () { + this.range = this.set + .map((comps) => comps.join(' ').trim()) + .join('||') + .trim() + return this.range + } + + toString () { + return this.range + } + + parseRange (range) { + // memoize range parsing for performance. + // this is a very hot path, and fully deterministic. + const memoOpts = + (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | + (this.options.loose && FLAG_LOOSE) + const memoKey = memoOpts + ':' + range + const cached = cache.get(memoKey) + if (cached) { + return cached + } + + const loose = this.options.loose + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] + range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) + debug('hyphen replace', range) + + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range) + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[t.TILDETRIM], tildeTrimReplace) + debug('tilde trim', range) + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[t.CARETTRIM], caretTrimReplace) + debug('caret trim', range) + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + let rangeList = range + .split(' ') + .map(comp => parseComparator(comp, this.options)) + .join(' ') + .split(/\s+/) + // >=0.0.0 is equivalent to * + .map(comp => replaceGTE0(comp, this.options)) + + if (loose) { + // in loose mode, throw out any that are not valid comparators + rangeList = rangeList.filter(comp => { + debug('loose invalid filter', comp, this.options) + return !!comp.match(re[t.COMPARATORLOOSE]) + }) + } + debug('range list', rangeList) + + // if any comparators are the null set, then replace with JUST null set + // if more than one comparator, remove any * comparators + // also, don't include the same comparator more than once + const rangeMap = new Map() + const comparators = rangeList.map(comp => new Comparator(comp, this.options)) + for (const comp of comparators) { + if (isNullSet(comp)) { + return [comp] + } + rangeMap.set(comp.value, comp) + } + if (rangeMap.size > 1 && rangeMap.has('')) { + rangeMap.delete('') + } + + const result = [...rangeMap.values()] + cache.set(memoKey, result) + return result + } + + intersects (range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required') + } + + return this.set.some((thisComparators) => { + return ( + isSatisfiable(thisComparators, options) && + range.set.some((rangeComparators) => { + return ( + isSatisfiable(rangeComparators, options) && + thisComparators.every((thisComparator) => { + return rangeComparators.every((rangeComparator) => { + return thisComparator.intersects(rangeComparator, options) + }) + }) + ) + }) + ) + }) + } + + // if ANY of the sets match ALL of its comparators, then pass + test (version) { + if (!version) { + return false + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + for (let i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true + } + } + return false + } +} + +module.exports = Range + +const LRU = __nccwpck_require__(7129) +const cache = new LRU({ max: 1000 }) + +const parseOptions = __nccwpck_require__(40785) +const Comparator = __nccwpck_require__(91532) +const debug = __nccwpck_require__(50427) +const SemVer = __nccwpck_require__(48088) +const { + safeRe: re, + t, + comparatorTrimReplace, + tildeTrimReplace, + caretTrimReplace, +} = __nccwpck_require__(9523) +const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = __nccwpck_require__(42293) + +const isNullSet = c => c.value === '<0.0.0-0' +const isAny = c => c.value === '' + +// take a set of comparators and determine whether there +// exists a version which can satisfy it +const isSatisfiable = (comparators, options) => { + let result = true + const remainingComparators = comparators.slice() + let testComparator = remainingComparators.pop() + + while (result && remainingComparators.length) { + result = remainingComparators.every((otherComparator) => { + return testComparator.intersects(otherComparator, options) + }) + + testComparator = remainingComparators.pop() + } + + return result +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +const parseComparator = (comp, options) => { + debug('comp', comp, options) + comp = replaceCarets(comp, options) + debug('caret', comp) + comp = replaceTildes(comp, options) + debug('tildes', comp) + comp = replaceXRanges(comp, options) + debug('xrange', comp) + comp = replaceStars(comp, options) + debug('stars', comp) + return comp +} + +const isX = id => !id || id.toLowerCase() === 'x' || id === '*' + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 +// ~0.0.1 --> >=0.0.1 <0.1.0-0 +const replaceTildes = (comp, options) => { + return comp + .trim() + .split(/\s+/) + .map((c) => replaceTilde(c, options)) + .join(' ') +} + +const replaceTilde = (comp, options) => { + const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] + return comp.replace(r, (_, M, m, p, pr) => { + debug('tilde', comp, _, M, m, p, pr) + let ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0 <${+M + 1}.0.0-0` + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0-0 + ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` + } else if (pr) { + debug('replaceTilde pr', pr) + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` + } else { + // ~1.2.3 == >=1.2.3 <1.3.0-0 + ret = `>=${M}.${m}.${p + } <${M}.${+m + 1}.0-0` + } + + debug('tilde return', ret) + return ret + }) +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 +// ^1.2.3 --> >=1.2.3 <2.0.0-0 +// ^1.2.0 --> >=1.2.0 <2.0.0-0 +// ^0.0.1 --> >=0.0.1 <0.0.2-0 +// ^0.1.0 --> >=0.1.0 <0.2.0-0 +const replaceCarets = (comp, options) => { + return comp + .trim() + .split(/\s+/) + .map((c) => replaceCaret(c, options)) + .join(' ') +} + +const replaceCaret = (comp, options) => { + debug('caret', comp, options) + const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] + const z = options.includePrerelease ? '-0' : '' + return comp.replace(r, (_, M, m, p, pr) => { + debug('caret', comp, _, M, m, p, pr) + let ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` + } else if (isX(p)) { + if (M === '0') { + ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` + } else { + ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` + } + } else if (pr) { + debug('replaceCaret pr', pr) + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${+M + 1}.0.0-0` + } + } else { + debug('no pr') + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p + }${z} <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p + }${z} <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p + } <${+M + 1}.0.0-0` + } + } + + debug('caret return', ret) + return ret + }) +} + +const replaceXRanges = (comp, options) => { + debug('replaceXRanges', comp, options) + return comp + .split(/\s+/) + .map((c) => replaceXRange(c, options)) + .join(' ') +} + +const replaceXRange = (comp, options) => { + comp = comp.trim() + const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] + return comp.replace(r, (ret, gtlt, M, m, p, pr) => { + debug('xRange', comp, ret, gtlt, M, m, p, pr) + const xM = isX(M) + const xm = xM || isX(m) + const xp = xm || isX(p) + const anyX = xp + + if (gtlt === '=' && anyX) { + gtlt = '' + } + + // if we're including prereleases in the match, then we need + // to fix this to -0, the lowest possible prerelease value + pr = options.includePrerelease ? '-0' : '' + + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0-0' + } else { + // nothing is forbidden + ret = '*' + } + } else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. + // replace X with 0 + if (xm) { + m = 0 + } + p = 0 + + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + gtlt = '>=' + if (xm) { + M = +M + 1 + m = 0 + p = 0 + } else { + m = +m + 1 + p = 0 + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) { + M = +M + 1 + } else { + m = +m + 1 + } + } + + if (gtlt === '<') { + pr = '-0' + } + + ret = `${gtlt + M}.${m}.${p}${pr}` + } else if (xm) { + ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` + } else if (xp) { + ret = `>=${M}.${m}.0${pr + } <${M}.${+m + 1}.0-0` + } + + debug('xRange return', ret) + + return ret + }) +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +const replaceStars = (comp, options) => { + debug('replaceStars', comp, options) + // Looseness is ignored here. star is always as loose as it gets! + return comp + .trim() + .replace(re[t.STAR], '') +} + +const replaceGTE0 = (comp, options) => { + debug('replaceGTE0', comp, options) + return comp + .trim() + .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') +} + +// This function is passed to string.replace(re[t.HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0-0 +const hyphenReplace = incPr => ($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) => { + if (isX(fM)) { + from = '' + } else if (isX(fm)) { + from = `>=${fM}.0.0${incPr ? '-0' : ''}` + } else if (isX(fp)) { + from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` + } else if (fpr) { + from = `>=${from}` + } else { + from = `>=${from}${incPr ? '-0' : ''}` + } + + if (isX(tM)) { + to = '' + } else if (isX(tm)) { + to = `<${+tM + 1}.0.0-0` + } else if (isX(tp)) { + to = `<${tM}.${+tm + 1}.0-0` + } else if (tpr) { + to = `<=${tM}.${tm}.${tp}-${tpr}` + } else if (incPr) { + to = `<${tM}.${tm}.${+tp + 1}-0` + } else { + to = `<=${to}` + } + + return `${from} ${to}`.trim() +} + +const testSet = (set, version, options) => { + for (let i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false + } + } + + if (version.prerelease.length && !options.includePrerelease) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (let i = 0; i < set.length; i++) { + debug(set[i].semver) + if (set[i].semver === Comparator.ANY) { + continue + } + + if (set[i].semver.prerelease.length > 0) { + const allowed = set[i].semver + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) { + return true + } + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false + } + + return true +} + + +/***/ }), + +/***/ 48088: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const debug = __nccwpck_require__(50427) +const { MAX_LENGTH, MAX_SAFE_INTEGER } = __nccwpck_require__(42293) +const { safeRe: re, t } = __nccwpck_require__(9523) + +const parseOptions = __nccwpck_require__(40785) +const { compareIdentifiers } = __nccwpck_require__(92463) +class SemVer { + constructor (version, options) { + options = parseOptions(options) + + if (version instanceof SemVer) { + if (version.loose === !!options.loose && + version.includePrerelease === !!options.includePrerelease) { + return version + } else { + version = version.version + } + } else if (typeof version !== 'string') { + throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`) + } + + if (version.length > MAX_LENGTH) { + throw new TypeError( + `version is longer than ${MAX_LENGTH} characters` + ) + } + + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose + // this isn't actually relevant for versions, but keep it so that we + // don't run into trouble passing this.options around. + this.includePrerelease = !!options.includePrerelease + + const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) + + if (!m) { + throw new TypeError(`Invalid Version: ${version}`) + } + + this.raw = version + + // these are actually numbers + this.major = +m[1] + this.minor = +m[2] + this.patch = +m[3] + + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') + } + + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } + + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } + + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } + } + return id + }) + } + + this.build = m[5] ? m[5].split('.') : [] + this.format() + } + + format () { + this.version = `${this.major}.${this.minor}.${this.patch}` + if (this.prerelease.length) { + this.version += `-${this.prerelease.join('.')}` + } + return this.version + } + + toString () { + return this.version + } + + compare (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + if (typeof other === 'string' && other === this.version) { + return 0 + } + other = new SemVer(other, this.options) + } + + if (other.version === this.version) { + return 0 + } + + return this.compareMain(other) || this.comparePre(other) + } + + compareMain (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return ( + compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) + ) + } + + comparePre (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } + + let i = 0 + do { + const a = this.prerelease[i] + const b = other.prerelease[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) + } + + compareBuild (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + let i = 0 + do { + const a = this.build[i] + const b = other.build[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) + } + + // preminor will bump the version up to the next minor release, and immediately + // down to pre-release. premajor and prepatch work the same way. + inc (release, identifier, identifierBase) { + switch (release) { + case 'premajor': + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier, identifierBase) + break + case 'preminor': + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier, identifierBase) + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0 + this.inc('patch', identifier, identifierBase) + this.inc('pre', identifier, identifierBase) + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier, identifierBase) + } + this.inc('pre', identifier, identifierBase) + break + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if ( + this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0 + ) { + this.major++ + } + this.minor = 0 + this.patch = 0 + this.prerelease = [] + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++ + } + this.patch = 0 + this.prerelease = [] + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++ + } + this.prerelease = [] + break + // This probably shouldn't be used publicly. + // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. + case 'pre': { + const base = Number(identifierBase) ? 1 : 0 + + if (!identifier && identifierBase === false) { + throw new Error('invalid increment argument: identifier is empty') + } + + if (this.prerelease.length === 0) { + this.prerelease = [base] + } else { + let i = this.prerelease.length + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++ + i = -2 + } + } + if (i === -1) { + // didn't increment anything + if (identifier === this.prerelease.join('.') && identifierBase === false) { + throw new Error('invalid increment argument: identifier already exists') + } + this.prerelease.push(base) + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + let prerelease = [identifier, base] + if (identifierBase === false) { + prerelease = [identifier] + } + if (compareIdentifiers(this.prerelease[0], identifier) === 0) { + if (isNaN(this.prerelease[1])) { + this.prerelease = prerelease + } + } else { + this.prerelease = prerelease + } + } + break + } + default: + throw new Error(`invalid increment argument: ${release}`) + } + this.raw = this.format() + if (this.build.length) { + this.raw += `+${this.build.join('.')}` + } + return this + } +} + +module.exports = SemVer + + +/***/ }), + +/***/ 48848: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const parse = __nccwpck_require__(75925) +const clean = (version, options) => { + const s = parse(version.trim().replace(/^[=v]+/, ''), options) + return s ? s.version : null +} +module.exports = clean + + +/***/ }), + +/***/ 75098: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const eq = __nccwpck_require__(91898) +const neq = __nccwpck_require__(6017) +const gt = __nccwpck_require__(84123) +const gte = __nccwpck_require__(15522) +const lt = __nccwpck_require__(80194) +const lte = __nccwpck_require__(77520) + +const cmp = (a, op, b, loose) => { + switch (op) { + case '===': + if (typeof a === 'object') { + a = a.version + } + if (typeof b === 'object') { + b = b.version + } + return a === b + + case '!==': + if (typeof a === 'object') { + a = a.version + } + if (typeof b === 'object') { + b = b.version + } + return a !== b + + case '': + case '=': + case '==': + return eq(a, b, loose) + + case '!=': + return neq(a, b, loose) + + case '>': + return gt(a, b, loose) + + case '>=': + return gte(a, b, loose) + + case '<': + return lt(a, b, loose) + + case '<=': + return lte(a, b, loose) + + default: + throw new TypeError(`Invalid operator: ${op}`) + } +} +module.exports = cmp + + +/***/ }), + +/***/ 13466: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(48088) +const parse = __nccwpck_require__(75925) +const { safeRe: re, t } = __nccwpck_require__(9523) + +const coerce = (version, options) => { + if (version instanceof SemVer) { + return version + } + + if (typeof version === 'number') { + version = String(version) + } + + if (typeof version !== 'string') { + return null + } + + options = options || {} + + let match = null + if (!options.rtl) { + match = version.match(re[t.COERCE]) + } else { + // Find the right-most coercible string that does not share + // a terminus with a more left-ward coercible string. + // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' + // + // Walk through the string checking with a /g regexp + // Manually set the index so as to pick up overlapping matches. + // Stop when we get a match that ends at the string end, since no + // coercible string can be more right-ward without the same terminus. + let next + while ((next = re[t.COERCERTL].exec(version)) && + (!match || match.index + match[0].length !== version.length) + ) { + if (!match || + next.index + next[0].length !== match.index + match[0].length) { + match = next + } + re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length + } + // leave it in a clean state + re[t.COERCERTL].lastIndex = -1 + } + + if (match === null) { + return null + } + + return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options) +} +module.exports = coerce + + +/***/ }), + +/***/ 92156: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(48088) +const compareBuild = (a, b, loose) => { + const versionA = new SemVer(a, loose) + const versionB = new SemVer(b, loose) + return versionA.compare(versionB) || versionA.compareBuild(versionB) +} +module.exports = compareBuild + + +/***/ }), + +/***/ 62804: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(44309) +const compareLoose = (a, b) => compare(a, b, true) +module.exports = compareLoose + + +/***/ }), + +/***/ 44309: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(48088) +const compare = (a, b, loose) => + new SemVer(a, loose).compare(new SemVer(b, loose)) + +module.exports = compare + + +/***/ }), + +/***/ 64297: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const parse = __nccwpck_require__(75925) + +const diff = (version1, version2) => { + const v1 = parse(version1, null, true) + const v2 = parse(version2, null, true) + const comparison = v1.compare(v2) + + if (comparison === 0) { + return null + } + + const v1Higher = comparison > 0 + const highVersion = v1Higher ? v1 : v2 + const lowVersion = v1Higher ? v2 : v1 + const highHasPre = !!highVersion.prerelease.length + const lowHasPre = !!lowVersion.prerelease.length + + if (lowHasPre && !highHasPre) { + // Going from prerelease -> no prerelease requires some special casing + + // If the low version has only a major, then it will always be a major + // Some examples: + // 1.0.0-1 -> 1.0.0 + // 1.0.0-1 -> 1.1.1 + // 1.0.0-1 -> 2.0.0 + if (!lowVersion.patch && !lowVersion.minor) { + return 'major' + } + + // Otherwise it can be determined by checking the high version + + if (highVersion.patch) { + // anything higher than a patch bump would result in the wrong version + return 'patch' + } + + if (highVersion.minor) { + // anything higher than a minor bump would result in the wrong version + return 'minor' + } + + // bumping major/minor/patch all have same result + return 'major' + } + + // add the `pre` prefix if we are going to a prerelease version + const prefix = highHasPre ? 'pre' : '' + + if (v1.major !== v2.major) { + return prefix + 'major' + } + + if (v1.minor !== v2.minor) { + return prefix + 'minor' + } + + if (v1.patch !== v2.patch) { + return prefix + 'patch' + } + + // high and low are preleases + return 'prerelease' +} + +module.exports = diff + + +/***/ }), + +/***/ 91898: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(44309) +const eq = (a, b, loose) => compare(a, b, loose) === 0 +module.exports = eq + + +/***/ }), + +/***/ 84123: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(44309) +const gt = (a, b, loose) => compare(a, b, loose) > 0 +module.exports = gt + + +/***/ }), + +/***/ 15522: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(44309) +const gte = (a, b, loose) => compare(a, b, loose) >= 0 +module.exports = gte + + +/***/ }), + +/***/ 30900: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(48088) + +const inc = (version, release, options, identifier, identifierBase) => { + if (typeof (options) === 'string') { + identifierBase = identifier + identifier = options + options = undefined + } + + try { + return new SemVer( + version instanceof SemVer ? version.version : version, + options + ).inc(release, identifier, identifierBase).version + } catch (er) { + return null + } +} +module.exports = inc + + +/***/ }), + +/***/ 80194: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(44309) +const lt = (a, b, loose) => compare(a, b, loose) < 0 +module.exports = lt + + +/***/ }), + +/***/ 77520: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(44309) +const lte = (a, b, loose) => compare(a, b, loose) <= 0 +module.exports = lte + + +/***/ }), + +/***/ 76688: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(48088) +const major = (a, loose) => new SemVer(a, loose).major +module.exports = major + + +/***/ }), + +/***/ 38447: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(48088) +const minor = (a, loose) => new SemVer(a, loose).minor +module.exports = minor + + +/***/ }), + +/***/ 6017: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(44309) +const neq = (a, b, loose) => compare(a, b, loose) !== 0 +module.exports = neq + + +/***/ }), + +/***/ 75925: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(48088) +const parse = (version, options, throwErrors = false) => { + if (version instanceof SemVer) { + return version + } + try { + return new SemVer(version, options) + } catch (er) { + if (!throwErrors) { + return null + } + throw er + } +} + +module.exports = parse + + +/***/ }), + +/***/ 42866: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(48088) +const patch = (a, loose) => new SemVer(a, loose).patch +module.exports = patch + + +/***/ }), + +/***/ 24016: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const parse = __nccwpck_require__(75925) +const prerelease = (version, options) => { + const parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +} +module.exports = prerelease + + +/***/ }), + +/***/ 76417: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(44309) +const rcompare = (a, b, loose) => compare(b, a, loose) +module.exports = rcompare + + +/***/ }), + +/***/ 8701: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compareBuild = __nccwpck_require__(92156) +const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) +module.exports = rsort + + +/***/ }), + +/***/ 6055: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const Range = __nccwpck_require__(9828) +const satisfies = (version, range, options) => { + try { + range = new Range(range, options) + } catch (er) { + return false + } + return range.test(version) +} +module.exports = satisfies + + +/***/ }), + +/***/ 61426: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compareBuild = __nccwpck_require__(92156) +const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) +module.exports = sort + + +/***/ }), + +/***/ 19601: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const parse = __nccwpck_require__(75925) +const valid = (version, options) => { + const v = parse(version, options) + return v ? v.version : null +} +module.exports = valid + + +/***/ }), + +/***/ 11383: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +// just pre-load all the stuff that index.js lazily exports +const internalRe = __nccwpck_require__(9523) +const constants = __nccwpck_require__(42293) +const SemVer = __nccwpck_require__(48088) +const identifiers = __nccwpck_require__(92463) +const parse = __nccwpck_require__(75925) +const valid = __nccwpck_require__(19601) +const clean = __nccwpck_require__(48848) +const inc = __nccwpck_require__(30900) +const diff = __nccwpck_require__(64297) +const major = __nccwpck_require__(76688) +const minor = __nccwpck_require__(38447) +const patch = __nccwpck_require__(42866) +const prerelease = __nccwpck_require__(24016) +const compare = __nccwpck_require__(44309) +const rcompare = __nccwpck_require__(76417) +const compareLoose = __nccwpck_require__(62804) +const compareBuild = __nccwpck_require__(92156) +const sort = __nccwpck_require__(61426) +const rsort = __nccwpck_require__(8701) +const gt = __nccwpck_require__(84123) +const lt = __nccwpck_require__(80194) +const eq = __nccwpck_require__(91898) +const neq = __nccwpck_require__(6017) +const gte = __nccwpck_require__(15522) +const lte = __nccwpck_require__(77520) +const cmp = __nccwpck_require__(75098) +const coerce = __nccwpck_require__(13466) +const Comparator = __nccwpck_require__(91532) +const Range = __nccwpck_require__(9828) +const satisfies = __nccwpck_require__(6055) +const toComparators = __nccwpck_require__(52706) +const maxSatisfying = __nccwpck_require__(20579) +const minSatisfying = __nccwpck_require__(10832) +const minVersion = __nccwpck_require__(34179) +const validRange = __nccwpck_require__(2098) +const outside = __nccwpck_require__(60420) +const gtr = __nccwpck_require__(9380) +const ltr = __nccwpck_require__(33323) +const intersects = __nccwpck_require__(27008) +const simplifyRange = __nccwpck_require__(56561) +const subset = __nccwpck_require__(7863) +module.exports = { + parse, + valid, + clean, + inc, + diff, + major, + minor, + patch, + prerelease, + compare, + rcompare, + compareLoose, + compareBuild, + sort, + rsort, + gt, + lt, + eq, + neq, + gte, + lte, + cmp, + coerce, + Comparator, + Range, + satisfies, + toComparators, + maxSatisfying, + minSatisfying, + minVersion, + validRange, + outside, + gtr, + ltr, + intersects, + simplifyRange, + subset, + SemVer, + re: internalRe.re, + src: internalRe.src, + tokens: internalRe.t, + SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION, + RELEASE_TYPES: constants.RELEASE_TYPES, + compareIdentifiers: identifiers.compareIdentifiers, + rcompareIdentifiers: identifiers.rcompareIdentifiers, +} + + +/***/ }), + +/***/ 42293: +/***/ ((module) => { + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +const SEMVER_SPEC_VERSION = '2.0.0' + +const MAX_LENGTH = 256 +const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || +/* istanbul ignore next */ 9007199254740991 + +// Max safe segment length for coercion. +const MAX_SAFE_COMPONENT_LENGTH = 16 + +// Max safe length for a build identifier. The max length minus 6 characters for +// the shortest version with a build 0.0.0+BUILD. +const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 + +const RELEASE_TYPES = [ + 'major', + 'premajor', + 'minor', + 'preminor', + 'patch', + 'prepatch', + 'prerelease', +] + +module.exports = { + MAX_LENGTH, + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_SAFE_INTEGER, + RELEASE_TYPES, + SEMVER_SPEC_VERSION, + FLAG_INCLUDE_PRERELEASE: 0b001, + FLAG_LOOSE: 0b010, +} + + +/***/ }), + +/***/ 50427: +/***/ ((module) => { + +const debug = ( + typeof process === 'object' && + process.env && + process.env.NODE_DEBUG && + /\bsemver\b/i.test(process.env.NODE_DEBUG) +) ? (...args) => console.error('SEMVER', ...args) + : () => {} + +module.exports = debug + + +/***/ }), + +/***/ 92463: +/***/ ((module) => { + +const numeric = /^[0-9]+$/ +const compareIdentifiers = (a, b) => { + const anum = numeric.test(a) + const bnum = numeric.test(b) + + if (anum && bnum) { + a = +a + b = +b + } + + return a === b ? 0 + : (anum && !bnum) ? -1 + : (bnum && !anum) ? 1 + : a < b ? -1 + : 1 +} + +const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) + +module.exports = { + compareIdentifiers, + rcompareIdentifiers, +} + + +/***/ }), + +/***/ 40785: +/***/ ((module) => { + +// parse out just the options we care about +const looseOption = Object.freeze({ loose: true }) +const emptyOpts = Object.freeze({ }) +const parseOptions = options => { + if (!options) { + return emptyOpts + } + + if (typeof options !== 'object') { + return looseOption + } + + return options +} +module.exports = parseOptions + + +/***/ }), + +/***/ 9523: +/***/ ((module, exports, __nccwpck_require__) => { + +const { + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_LENGTH, +} = __nccwpck_require__(42293) +const debug = __nccwpck_require__(50427) +exports = module.exports = {} + +// The actual regexps go on exports.re +const re = exports.re = [] +const safeRe = exports.safeRe = [] +const src = exports.src = [] +const t = exports.t = {} +let R = 0 + +const LETTERDASHNUMBER = '[a-zA-Z0-9-]' + +// Replace some greedy regex tokens to prevent regex dos issues. These regex are +// used internally via the safeRe object since all inputs in this library get +// normalized first to trim and collapse all extra whitespace. The original +// regexes are exported for userland consumption and lower level usage. A +// future breaking change could export the safer regex only with a note that +// all input should have extra whitespace removed. +const safeRegexReplacements = [ + ['\\s', 1], + ['\\d', MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], +] + +const makeSafeRegex = (value) => { + for (const [token, max] of safeRegexReplacements) { + value = value + .split(`${token}*`).join(`${token}{0,${max}}`) + .split(`${token}+`).join(`${token}{1,${max}}`) + } + return value +} + +const createToken = (name, value, isGlobal) => { + const safe = makeSafeRegex(value) + const index = R++ + debug(name, index, value) + t[name] = index + src[index] = value + re[index] = new RegExp(value, isGlobal ? 'g' : undefined) + safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined) +} + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') +createToken('NUMERICIDENTIFIERLOOSE', '\\d+') + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`) + +// ## Main Version +// Three dot-separated numeric identifiers. + +createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})`) + +createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})`) + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] +}|${src[t.NONNUMERICIDENTIFIER]})`) + +createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] +}|${src[t.NONNUMERICIDENTIFIER]})`) + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] +}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`) + +createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] +}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`) + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`) + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] +}(?:\\.${src[t.BUILDIDENTIFIER]})*))`) + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +createToken('FULLPLAIN', `v?${src[t.MAINVERSION] +}${src[t.PRERELEASE]}?${ + src[t.BUILD]}?`) + +createToken('FULL', `^${src[t.FULLPLAIN]}$`) + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] +}${src[t.PRERELEASELOOSE]}?${ + src[t.BUILD]}?`) + +createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`) + +createToken('GTLT', '((?:<|>)?=?)') + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`) +createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`) + +createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:${src[t.PRERELEASE]})?${ + src[t.BUILD]}?` + + `)?)?`) + +createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:${src[t.PRERELEASELOOSE]})?${ + src[t.BUILD]}?` + + `)?)?`) + +createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`) +createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`) + +// Coercion. +// Extract anything that could conceivably be a part of a valid semver +createToken('COERCE', `${'(^|[^\\d])' + + '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + + `(?:$|[^\\d])`) +createToken('COERCERTL', src[t.COERCE], true) + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +createToken('LONETILDE', '(?:~>?)') + +createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true) +exports.tildeTrimReplace = '$1~' + +createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`) +createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`) + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +createToken('LONECARET', '(?:\\^)') + +createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true) +exports.caretTrimReplace = '$1^' + +createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`) +createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`) + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`) +createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`) + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] +}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true) +exports.comparatorTrimReplace = '$1$2$3' + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAIN]})` + + `\\s*$`) + +createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAINLOOSE]})` + + `\\s*$`) + +// Star ranges basically just allow anything at all. +createToken('STAR', '(<|>)?=?\\s*\\*') +// >=0.0.0 is like a star +createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$') +createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$') + + +/***/ }), + +/***/ 9380: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +// Determine if version is greater than all the versions possible in the range. +const outside = __nccwpck_require__(60420) +const gtr = (version, range, options) => outside(version, range, '>', options) +module.exports = gtr + + +/***/ }), + +/***/ 27008: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const Range = __nccwpck_require__(9828) +const intersects = (r1, r2, options) => { + r1 = new Range(r1, options) + r2 = new Range(r2, options) + return r1.intersects(r2, options) +} +module.exports = intersects + + +/***/ }), + +/***/ 33323: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const outside = __nccwpck_require__(60420) +// Determine if version is less than all the versions possible in the range +const ltr = (version, range, options) => outside(version, range, '<', options) +module.exports = ltr + + +/***/ }), + +/***/ 20579: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(48088) +const Range = __nccwpck_require__(9828) + +const maxSatisfying = (versions, range, options) => { + let max = null + let maxSV = null + let rangeObj = null + try { + rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!max || maxSV.compare(v) === -1) { + // compare(max, v, true) + max = v + maxSV = new SemVer(max, options) + } + } + }) + return max +} +module.exports = maxSatisfying + + +/***/ }), + +/***/ 10832: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(48088) +const Range = __nccwpck_require__(9828) +const minSatisfying = (versions, range, options) => { + let min = null + let minSV = null + let rangeObj = null + try { + rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!min || minSV.compare(v) === 1) { + // compare(min, v, true) + min = v + minSV = new SemVer(min, options) + } + } + }) + return min +} +module.exports = minSatisfying + + +/***/ }), + +/***/ 34179: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(48088) +const Range = __nccwpck_require__(9828) +const gt = __nccwpck_require__(84123) + +const minVersion = (range, loose) => { + range = new Range(range, loose) + + let minver = new SemVer('0.0.0') + if (range.test(minver)) { + return minver + } + + minver = new SemVer('0.0.0-0') + if (range.test(minver)) { + return minver + } + + minver = null + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i] + + let setMin = null + comparators.forEach((comparator) => { + // Clone to avoid manipulating the comparator's semver object. + const compver = new SemVer(comparator.semver.version) + switch (comparator.operator) { + case '>': + if (compver.prerelease.length === 0) { + compver.patch++ + } else { + compver.prerelease.push(0) + } + compver.raw = compver.format() + /* fallthrough */ + case '': + case '>=': + if (!setMin || gt(compver, setMin)) { + setMin = compver + } + break + case '<': + case '<=': + /* Ignore maximum versions */ + break + /* istanbul ignore next */ + default: + throw new Error(`Unexpected operation: ${comparator.operator}`) + } + }) + if (setMin && (!minver || gt(minver, setMin))) { + minver = setMin + } + } + + if (minver && range.test(minver)) { + return minver + } + + return null +} +module.exports = minVersion + + +/***/ }), + +/***/ 60420: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(48088) +const Comparator = __nccwpck_require__(91532) +const { ANY } = Comparator +const Range = __nccwpck_require__(9828) +const satisfies = __nccwpck_require__(6055) +const gt = __nccwpck_require__(84123) +const lt = __nccwpck_require__(80194) +const lte = __nccwpck_require__(77520) +const gte = __nccwpck_require__(15522) + +const outside = (version, range, hilo, options) => { + version = new SemVer(version, options) + range = new Range(range, options) + + let gtfn, ltefn, ltfn, comp, ecomp + switch (hilo) { + case '>': + gtfn = gt + ltefn = lte + ltfn = lt + comp = '>' + ecomp = '>=' + break + case '<': + gtfn = lt + ltefn = gte + ltfn = gt + comp = '<' + ecomp = '<=' + break + default: + throw new TypeError('Must provide a hilo val of "<" or ">"') + } + + // If it satisfies the range it is not outside + if (satisfies(version, range, options)) { + return false + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i] + + let high = null + let low = null + + comparators.forEach((comparator) => { + if (comparator.semver === ANY) { + comparator = new Comparator('>=0.0.0') + } + high = high || comparator + low = low || comparator + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator + } + }) + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false + } + } + return true +} + +module.exports = outside + + +/***/ }), + +/***/ 56561: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +// given a set of versions and a range, create a "simplified" range +// that includes the same versions that the original range does +// If the original range is shorter than the simplified one, return that. +const satisfies = __nccwpck_require__(6055) +const compare = __nccwpck_require__(44309) +module.exports = (versions, range, options) => { + const set = [] + let first = null + let prev = null + const v = versions.sort((a, b) => compare(a, b, options)) + for (const version of v) { + const included = satisfies(version, range, options) + if (included) { + prev = version + if (!first) { + first = version + } + } else { + if (prev) { + set.push([first, prev]) + } + prev = null + first = null + } + } + if (first) { + set.push([first, null]) + } + + const ranges = [] + for (const [min, max] of set) { + if (min === max) { + ranges.push(min) + } else if (!max && min === v[0]) { + ranges.push('*') + } else if (!max) { + ranges.push(`>=${min}`) + } else if (min === v[0]) { + ranges.push(`<=${max}`) + } else { + ranges.push(`${min} - ${max}`) + } + } + const simplified = ranges.join(' || ') + const original = typeof range.raw === 'string' ? range.raw : String(range) + return simplified.length < original.length ? simplified : range +} + + +/***/ }), + +/***/ 7863: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const Range = __nccwpck_require__(9828) +const Comparator = __nccwpck_require__(91532) +const { ANY } = Comparator +const satisfies = __nccwpck_require__(6055) +const compare = __nccwpck_require__(44309) + +// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: +// - Every simple range `r1, r2, ...` is a null set, OR +// - Every simple range `r1, r2, ...` which is not a null set is a subset of +// some `R1, R2, ...` +// +// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: +// - If c is only the ANY comparator +// - If C is only the ANY comparator, return true +// - Else if in prerelease mode, return false +// - else replace c with `[>=0.0.0]` +// - If C is only the ANY comparator +// - if in prerelease mode, return true +// - else replace C with `[>=0.0.0]` +// - Let EQ be the set of = comparators in c +// - If EQ is more than one, return true (null set) +// - Let GT be the highest > or >= comparator in c +// - Let LT be the lowest < or <= comparator in c +// - If GT and LT, and GT.semver > LT.semver, return true (null set) +// - If any C is a = range, and GT or LT are set, return false +// - If EQ +// - If GT, and EQ does not satisfy GT, return true (null set) +// - If LT, and EQ does not satisfy LT, return true (null set) +// - If EQ satisfies every C, return true +// - Else return false +// - If GT +// - If GT.semver is lower than any > or >= comp in C, return false +// - If GT is >=, and GT.semver does not satisfy every C, return false +// - If GT.semver has a prerelease, and not in prerelease mode +// - If no C has a prerelease and the GT.semver tuple, return false +// - If LT +// - If LT.semver is greater than any < or <= comp in C, return false +// - If LT is <=, and LT.semver does not satisfy every C, return false +// - If GT.semver has a prerelease, and not in prerelease mode +// - If no C has a prerelease and the LT.semver tuple, return false +// - Else return true + +const subset = (sub, dom, options = {}) => { + if (sub === dom) { + return true + } + + sub = new Range(sub, options) + dom = new Range(dom, options) + let sawNonNull = false + + OUTER: for (const simpleSub of sub.set) { + for (const simpleDom of dom.set) { + const isSub = simpleSubset(simpleSub, simpleDom, options) + sawNonNull = sawNonNull || isSub !== null + if (isSub) { + continue OUTER + } + } + // the null set is a subset of everything, but null simple ranges in + // a complex range should be ignored. so if we saw a non-null range, + // then we know this isn't a subset, but if EVERY simple range was null, + // then it is a subset. + if (sawNonNull) { + return false + } + } + return true +} + +const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')] +const minimumVersion = [new Comparator('>=0.0.0')] + +const simpleSubset = (sub, dom, options) => { + if (sub === dom) { + return true + } + + if (sub.length === 1 && sub[0].semver === ANY) { + if (dom.length === 1 && dom[0].semver === ANY) { + return true + } else if (options.includePrerelease) { + sub = minimumVersionWithPreRelease + } else { + sub = minimumVersion + } + } + + if (dom.length === 1 && dom[0].semver === ANY) { + if (options.includePrerelease) { + return true + } else { + dom = minimumVersion + } + } + + const eqSet = new Set() + let gt, lt + for (const c of sub) { + if (c.operator === '>' || c.operator === '>=') { + gt = higherGT(gt, c, options) + } else if (c.operator === '<' || c.operator === '<=') { + lt = lowerLT(lt, c, options) + } else { + eqSet.add(c.semver) + } + } + + if (eqSet.size > 1) { + return null + } + + let gtltComp + if (gt && lt) { + gtltComp = compare(gt.semver, lt.semver, options) + if (gtltComp > 0) { + return null + } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) { + return null + } + } + + // will iterate one or zero times + for (const eq of eqSet) { + if (gt && !satisfies(eq, String(gt), options)) { + return null + } + + if (lt && !satisfies(eq, String(lt), options)) { + return null + } + + for (const c of dom) { + if (!satisfies(eq, String(c), options)) { + return false + } + } + + return true + } + + let higher, lower + let hasDomLT, hasDomGT + // if the subset has a prerelease, we need a comparator in the superset + // with the same tuple and a prerelease, or it's not a subset + let needDomLTPre = lt && + !options.includePrerelease && + lt.semver.prerelease.length ? lt.semver : false + let needDomGTPre = gt && + !options.includePrerelease && + gt.semver.prerelease.length ? gt.semver : false + // exception: <1.2.3-0 is the same as <1.2.3 + if (needDomLTPre && needDomLTPre.prerelease.length === 1 && + lt.operator === '<' && needDomLTPre.prerelease[0] === 0) { + needDomLTPre = false + } + + for (const c of dom) { + hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' + hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' + if (gt) { + if (needDomGTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && + c.semver.major === needDomGTPre.major && + c.semver.minor === needDomGTPre.minor && + c.semver.patch === needDomGTPre.patch) { + needDomGTPre = false + } + } + if (c.operator === '>' || c.operator === '>=') { + higher = higherGT(gt, c, options) + if (higher === c && higher !== gt) { + return false + } + } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) { + return false + } + } + if (lt) { + if (needDomLTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && + c.semver.major === needDomLTPre.major && + c.semver.minor === needDomLTPre.minor && + c.semver.patch === needDomLTPre.patch) { + needDomLTPre = false + } + } + if (c.operator === '<' || c.operator === '<=') { + lower = lowerLT(lt, c, options) + if (lower === c && lower !== lt) { + return false + } + } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) { + return false + } + } + if (!c.operator && (lt || gt) && gtltComp !== 0) { + return false + } + } + + // if there was a < or >, and nothing in the dom, then must be false + // UNLESS it was limited by another range in the other direction. + // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 + if (gt && hasDomLT && !lt && gtltComp !== 0) { + return false + } + + if (lt && hasDomGT && !gt && gtltComp !== 0) { + return false + } + + // we needed a prerelease range in a specific tuple, but didn't get one + // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, + // because it includes prereleases in the 1.2.3 tuple + if (needDomGTPre || needDomLTPre) { + return false + } + + return true +} + +// >=1.2.3 is lower than >1.2.3 +const higherGT = (a, b, options) => { + if (!a) { + return b + } + const comp = compare(a.semver, b.semver, options) + return comp > 0 ? a + : comp < 0 ? b + : b.operator === '>' && a.operator === '>=' ? b + : a +} + +// <=1.2.3 is higher than <1.2.3 +const lowerLT = (a, b, options) => { + if (!a) { + return b + } + const comp = compare(a.semver, b.semver, options) + return comp < 0 ? a + : comp > 0 ? b + : b.operator === '<' && a.operator === '<=' ? b + : a +} + +module.exports = subset + + +/***/ }), + +/***/ 52706: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const Range = __nccwpck_require__(9828) + +// Mostly just for testing and legacy API reasons +const toComparators = (range, options) => + new Range(range, options).set + .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) + +module.exports = toComparators + + +/***/ }), + +/***/ 2098: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const Range = __nccwpck_require__(9828) +const validRange = (range, options) => { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, options).range || '*' + } catch (er) { + return null + } +} +module.exports = validRange + + +/***/ }), + +/***/ 45123: +/***/ ((module) => { + +module.exports = [ + 'cat', + 'cd', + 'chmod', + 'cp', + 'dirs', + 'echo', + 'exec', + 'find', + 'grep', + 'head', + 'ln', + 'ls', + 'mkdir', + 'mv', + 'pwd', + 'rm', + 'sed', + 'set', + 'sort', + 'tail', + 'tempdir', + 'test', + 'to', + 'toEnd', + 'touch', + 'uniq', + 'which', +]; + + +/***/ }), + +/***/ 33516: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +// +// ShellJS +// Unix shell commands on top of Node's API +// +// Copyright (c) 2012 Artur Adib +// http://github.com/shelljs/shelljs +// + +function __ncc_wildcard$0 (arg) { + if (arg === "cat.js" || arg === "cat") return __nccwpck_require__(30271); + else if (arg === "cd.js" || arg === "cd") return __nccwpck_require__(42051); + else if (arg === "chmod.js" || arg === "chmod") return __nccwpck_require__(24975); + else if (arg === "common.js" || arg === "common") return __nccwpck_require__(53687); + else if (arg === "cp.js" || arg === "cp") return __nccwpck_require__(34932); + else if (arg === "dirs.js" || arg === "dirs") return __nccwpck_require__(41178); + else if (arg === "echo.js" || arg === "echo") return __nccwpck_require__(10243); + else if (arg === "error.js" || arg === "error") return __nccwpck_require__(10232); + else if (arg === "exec-child.js" || arg === "exec-child") return __nccwpck_require__(69607); + else if (arg === "exec.js" || arg === "exec") return __nccwpck_require__(10896); + else if (arg === "find.js" || arg === "find") return __nccwpck_require__(47838); + else if (arg === "grep.js" || arg === "grep") return __nccwpck_require__(17417); + else if (arg === "head.js" || arg === "head") return __nccwpck_require__(6613); + else if (arg === "ln.js" || arg === "ln") return __nccwpck_require__(15787); + else if (arg === "ls.js" || arg === "ls") return __nccwpck_require__(35561); + else if (arg === "mkdir.js" || arg === "mkdir") return __nccwpck_require__(72695); + else if (arg === "mv.js" || arg === "mv") return __nccwpck_require__(39849); + else if (arg === "popd.js" || arg === "popd") return __nccwpck_require__(50227); + else if (arg === "pushd.js" || arg === "pushd") return __nccwpck_require__(44177); + else if (arg === "pwd.js" || arg === "pwd") return __nccwpck_require__(58553); + else if (arg === "rm.js" || arg === "rm") return __nccwpck_require__(22830); + else if (arg === "sed.js" || arg === "sed") return __nccwpck_require__(25899); + else if (arg === "set.js" || arg === "set") return __nccwpck_require__(11411); + else if (arg === "sort.js" || arg === "sort") return __nccwpck_require__(72116); + else if (arg === "tail.js" || arg === "tail") return __nccwpck_require__(42284); + else if (arg === "tempdir.js" || arg === "tempdir") return __nccwpck_require__(76150); + else if (arg === "test.js" || arg === "test") return __nccwpck_require__(79723); + else if (arg === "to.js" || arg === "to") return __nccwpck_require__(71961); + else if (arg === "toEnd.js" || arg === "toEnd") return __nccwpck_require__(33736); + else if (arg === "touch.js" || arg === "touch") return __nccwpck_require__(28358); + else if (arg === "uniq.js" || arg === "uniq") return __nccwpck_require__(77286); + else if (arg === "which.js" || arg === "which") return __nccwpck_require__(64766); +} +var common = __nccwpck_require__(53687); + +//@ +//@ All commands run synchronously, unless otherwise stated. +//@ All commands accept standard bash globbing characters (`*`, `?`, etc.), +//@ compatible with the [node `glob` module](https://github.com/isaacs/node-glob). +//@ +//@ For less-commonly used commands and features, please check out our [wiki +//@ page](https://github.com/shelljs/shelljs/wiki). +//@ + +// Include the docs for all the default commands +//@commands + +// Load all default commands +(__nccwpck_require__(45123).forEach)(function (command) { + __ncc_wildcard$0(command); +}); + +//@ +//@ ### exit(code) +//@ +//@ Exits the current process with the given exit `code`. +exports.exit = process.exit; + +//@include ./src/error +exports.error = __nccwpck_require__(10232); + +//@include ./src/common +exports.ShellString = common.ShellString; + +//@ +//@ ### env['VAR_NAME'] +//@ +//@ Object containing environment variables (both getter and setter). Shortcut +//@ to `process.env`. +exports.env = process.env; + +//@ +//@ ### Pipes +//@ +//@ Examples: +//@ +//@ ```javascript +//@ grep('foo', 'file1.txt', 'file2.txt').sed(/o/g, 'a').to('output.txt'); +//@ echo('files with o\'s in the name:\n' + ls().grep('o')); +//@ cat('test.js').exec('node'); // pipe to exec() call +//@ ``` +//@ +//@ Commands can send their output to another command in a pipe-like fashion. +//@ `sed`, `grep`, `cat`, `exec`, `to`, and `toEnd` can appear on the right-hand +//@ side of a pipe. Pipes can be chained. + +//@ +//@ ## Configuration +//@ + +exports.config = common.config; + +//@ +//@ ### config.silent +//@ +//@ Example: +//@ +//@ ```javascript +//@ var sh = require('shelljs'); +//@ var silentState = sh.config.silent; // save old silent state +//@ sh.config.silent = true; +//@ /* ... */ +//@ sh.config.silent = silentState; // restore old silent state +//@ ``` +//@ +//@ Suppresses all command output if `true`, except for `echo()` calls. +//@ Default is `false`. + +//@ +//@ ### config.fatal +//@ +//@ Example: +//@ +//@ ```javascript +//@ require('shelljs/global'); +//@ config.fatal = true; // or set('-e'); +//@ cp('this_file_does_not_exist', '/dev/null'); // throws Error here +//@ /* more commands... */ +//@ ``` +//@ +//@ If `true`, the script will throw a Javascript error when any shell.js +//@ command encounters an error. Default is `false`. This is analogous to +//@ Bash's `set -e`. + +//@ +//@ ### config.verbose +//@ +//@ Example: +//@ +//@ ```javascript +//@ config.verbose = true; // or set('-v'); +//@ cd('dir/'); +//@ rm('-rf', 'foo.txt', 'bar.txt'); +//@ exec('echo hello'); +//@ ``` +//@ +//@ Will print each command as follows: +//@ +//@ ``` +//@ cd dir/ +//@ rm -rf foo.txt bar.txt +//@ exec echo hello +//@ ``` + +//@ +//@ ### config.globOptions +//@ +//@ Example: +//@ +//@ ```javascript +//@ config.globOptions = {nodir: true}; +//@ ``` +//@ +//@ Use this value for calls to `glob.sync()` instead of the default options. + +//@ +//@ ### config.reset() +//@ +//@ Example: +//@ +//@ ```javascript +//@ var shell = require('shelljs'); +//@ // Make changes to shell.config, and do stuff... +//@ /* ... */ +//@ shell.config.reset(); // reset to original state +//@ // Do more stuff, but with original settings +//@ /* ... */ +//@ ``` +//@ +//@ Reset `shell.config` to the defaults: +//@ +//@ ```javascript +//@ { +//@ fatal: false, +//@ globOptions: {}, +//@ maxdepth: 255, +//@ noglob: false, +//@ silent: false, +//@ verbose: false, +//@ } +//@ ``` + + +/***/ }), + +/***/ 30271: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var common = __nccwpck_require__(53687); +var fs = __nccwpck_require__(57147); + +common.register('cat', _cat, { + canReceivePipe: true, + cmdOptions: { + 'n': 'number', + }, +}); + +//@ +//@ ### cat([options,] file [, file ...]) +//@ ### cat([options,] file_array) +//@ +//@ Available options: +//@ +//@ + `-n`: number all output lines +//@ +//@ Examples: +//@ +//@ ```javascript +//@ var str = cat('file*.txt'); +//@ var str = cat('file1', 'file2'); +//@ var str = cat(['file1', 'file2']); // same as above +//@ ``` +//@ +//@ Returns a string containing the given file, or a concatenated string +//@ containing the files if more than one file is given (a new line character is +//@ introduced between each file). +function _cat(options, files) { + var cat = common.readFromPipe(); + + if (!files && !cat) common.error('no paths given'); + + files = [].slice.call(arguments, 1); + + files.forEach(function (file) { + if (!fs.existsSync(file)) { + common.error('no such file or directory: ' + file); + } else if (common.statFollowLinks(file).isDirectory()) { + common.error(file + ': Is a directory'); + } + + cat += fs.readFileSync(file, 'utf8'); + }); + + if (options.number) { + cat = addNumbers(cat); + } + + return cat; +} +module.exports = _cat; + +function addNumbers(cat) { + var lines = cat.split('\n'); + var lastLine = lines.pop(); + + lines = lines.map(function (line, i) { + return numberedLine(i + 1, line); + }); + + if (lastLine.length) { + lastLine = numberedLine(lines.length + 1, lastLine); + } + lines.push(lastLine); + + return lines.join('\n'); +} + +function numberedLine(n, line) { + // GNU cat use six pad start number + tab. See http://lingrok.org/xref/coreutils/src/cat.c#57 + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart + var number = (' ' + n).slice(-6) + '\t'; + return number + line; +} + + +/***/ }), + +/***/ 42051: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var os = __nccwpck_require__(22037); +var common = __nccwpck_require__(53687); + +common.register('cd', _cd, {}); + +//@ +//@ ### cd([dir]) +//@ +//@ Changes to directory `dir` for the duration of the script. Changes to home +//@ directory if no argument is supplied. +function _cd(options, dir) { + if (!dir) dir = os.homedir(); + + if (dir === '-') { + if (!process.env.OLDPWD) { + common.error('could not find previous directory'); + } else { + dir = process.env.OLDPWD; + } + } + + try { + var curDir = process.cwd(); + process.chdir(dir); + process.env.OLDPWD = curDir; + } catch (e) { + // something went wrong, let's figure out the error + var err; + try { + common.statFollowLinks(dir); // if this succeeds, it must be some sort of file + err = 'not a directory: ' + dir; + } catch (e2) { + err = 'no such file or directory: ' + dir; + } + if (err) common.error(err); + } + return ''; +} +module.exports = _cd; + + +/***/ }), + +/***/ 24975: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var common = __nccwpck_require__(53687); +var fs = __nccwpck_require__(57147); +var path = __nccwpck_require__(71017); + +var PERMS = (function (base) { + return { + OTHER_EXEC: base.EXEC, + OTHER_WRITE: base.WRITE, + OTHER_READ: base.READ, + + GROUP_EXEC: base.EXEC << 3, + GROUP_WRITE: base.WRITE << 3, + GROUP_READ: base.READ << 3, + + OWNER_EXEC: base.EXEC << 6, + OWNER_WRITE: base.WRITE << 6, + OWNER_READ: base.READ << 6, + + // Literal octal numbers are apparently not allowed in "strict" javascript. + STICKY: parseInt('01000', 8), + SETGID: parseInt('02000', 8), + SETUID: parseInt('04000', 8), + + TYPE_MASK: parseInt('0770000', 8), + }; +}({ + EXEC: 1, + WRITE: 2, + READ: 4, +})); + +common.register('chmod', _chmod, { +}); + +//@ +//@ ### chmod([options,] octal_mode || octal_string, file) +//@ ### chmod([options,] symbolic_mode, file) +//@ +//@ Available options: +//@ +//@ + `-v`: output a diagnostic for every file processed//@ +//@ + `-c`: like verbose, but report only when a change is made//@ +//@ + `-R`: change files and directories recursively//@ +//@ +//@ Examples: +//@ +//@ ```javascript +//@ chmod(755, '/Users/brandon'); +//@ chmod('755', '/Users/brandon'); // same as above +//@ chmod('u+x', '/Users/brandon'); +//@ chmod('-R', 'a-w', '/Users/brandon'); +//@ ``` +//@ +//@ Alters the permissions of a file or directory by either specifying the +//@ absolute permissions in octal form or expressing the changes in symbols. +//@ This command tries to mimic the POSIX behavior as much as possible. +//@ Notable exceptions: +//@ +//@ + In symbolic modes, `a-r` and `-r` are identical. No consideration is +//@ given to the `umask`. +//@ + There is no "quiet" option, since default behavior is to run silent. +function _chmod(options, mode, filePattern) { + if (!filePattern) { + if (options.length > 0 && options.charAt(0) === '-') { + // Special case where the specified file permissions started with - to subtract perms, which + // get picked up by the option parser as command flags. + // If we are down by one argument and options starts with -, shift everything over. + [].unshift.call(arguments, ''); + } else { + common.error('You must specify a file.'); + } + } + + options = common.parseOptions(options, { + 'R': 'recursive', + 'c': 'changes', + 'v': 'verbose', + }); + + filePattern = [].slice.call(arguments, 2); + + var files; + + // TODO: replace this with a call to common.expand() + if (options.recursive) { + files = []; + filePattern.forEach(function addFile(expandedFile) { + var stat = common.statNoFollowLinks(expandedFile); + + if (!stat.isSymbolicLink()) { + files.push(expandedFile); + + if (stat.isDirectory()) { // intentionally does not follow symlinks. + fs.readdirSync(expandedFile).forEach(function (child) { + addFile(expandedFile + '/' + child); + }); + } + } + }); + } else { + files = filePattern; + } + + files.forEach(function innerChmod(file) { + file = path.resolve(file); + if (!fs.existsSync(file)) { + common.error('File not found: ' + file); + } + + // When recursing, don't follow symlinks. + if (options.recursive && common.statNoFollowLinks(file).isSymbolicLink()) { + return; + } + + var stat = common.statFollowLinks(file); + var isDir = stat.isDirectory(); + var perms = stat.mode; + var type = perms & PERMS.TYPE_MASK; + + var newPerms = perms; + + if (isNaN(parseInt(mode, 8))) { + // parse options + mode.split(',').forEach(function (symbolicMode) { + var pattern = /([ugoa]*)([=\+-])([rwxXst]*)/i; + var matches = pattern.exec(symbolicMode); + + if (matches) { + var applyTo = matches[1]; + var operator = matches[2]; + var change = matches[3]; + + var changeOwner = applyTo.indexOf('u') !== -1 || applyTo === 'a' || applyTo === ''; + var changeGroup = applyTo.indexOf('g') !== -1 || applyTo === 'a' || applyTo === ''; + var changeOther = applyTo.indexOf('o') !== -1 || applyTo === 'a' || applyTo === ''; + + var changeRead = change.indexOf('r') !== -1; + var changeWrite = change.indexOf('w') !== -1; + var changeExec = change.indexOf('x') !== -1; + var changeExecDir = change.indexOf('X') !== -1; + var changeSticky = change.indexOf('t') !== -1; + var changeSetuid = change.indexOf('s') !== -1; + + if (changeExecDir && isDir) { + changeExec = true; + } + + var mask = 0; + if (changeOwner) { + mask |= (changeRead ? PERMS.OWNER_READ : 0) + (changeWrite ? PERMS.OWNER_WRITE : 0) + (changeExec ? PERMS.OWNER_EXEC : 0) + (changeSetuid ? PERMS.SETUID : 0); + } + if (changeGroup) { + mask |= (changeRead ? PERMS.GROUP_READ : 0) + (changeWrite ? PERMS.GROUP_WRITE : 0) + (changeExec ? PERMS.GROUP_EXEC : 0) + (changeSetuid ? PERMS.SETGID : 0); + } + if (changeOther) { + mask |= (changeRead ? PERMS.OTHER_READ : 0) + (changeWrite ? PERMS.OTHER_WRITE : 0) + (changeExec ? PERMS.OTHER_EXEC : 0); + } + + // Sticky bit is special - it's not tied to user, group or other. + if (changeSticky) { + mask |= PERMS.STICKY; + } + + switch (operator) { + case '+': + newPerms |= mask; + break; + + case '-': + newPerms &= ~mask; + break; + + case '=': + newPerms = type + mask; + + // According to POSIX, when using = to explicitly set the + // permissions, setuid and setgid can never be cleared. + if (common.statFollowLinks(file).isDirectory()) { + newPerms |= (PERMS.SETUID + PERMS.SETGID) & perms; + } + break; + default: + common.error('Could not recognize operator: `' + operator + '`'); + } + + if (options.verbose) { + console.log(file + ' -> ' + newPerms.toString(8)); + } + + if (perms !== newPerms) { + if (!options.verbose && options.changes) { + console.log(file + ' -> ' + newPerms.toString(8)); + } + fs.chmodSync(file, newPerms); + perms = newPerms; // for the next round of changes! + } + } else { + common.error('Invalid symbolic mode change: ' + symbolicMode); + } + }); + } else { + // they gave us a full number + newPerms = type + parseInt(mode, 8); + + // POSIX rules are that setuid and setgid can only be added using numeric + // form, but not cleared. + if (common.statFollowLinks(file).isDirectory()) { + newPerms |= (PERMS.SETUID + PERMS.SETGID) & perms; + } + + fs.chmodSync(file, newPerms); + } + }); + return ''; +} +module.exports = _chmod; + + +/***/ }), + +/***/ 53687: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +// Ignore warning about 'new String()' +/* eslint no-new-wrappers: 0 */ + + +var os = __nccwpck_require__(22037); +var fs = __nccwpck_require__(57147); +var glob = __nccwpck_require__(91957); +var shell = __nccwpck_require__(33516); + +var shellMethods = Object.create(shell); + +exports.extend = Object.assign; + +// Check if we're running under electron +var isElectron = Boolean(process.versions.electron); + +// Module globals (assume no execPath by default) +var DEFAULT_CONFIG = { + fatal: false, + globOptions: {}, + maxdepth: 255, + noglob: false, + silent: false, + verbose: false, + execPath: null, + bufLength: 64 * 1024, // 64KB +}; + +var config = { + reset: function () { + Object.assign(this, DEFAULT_CONFIG); + if (!isElectron) { + this.execPath = process.execPath; + } + }, + resetForTesting: function () { + this.reset(); + this.silent = true; + }, +}; + +config.reset(); +exports.config = config; + +// Note: commands should generally consider these as read-only values. +var state = { + error: null, + errorCode: 0, + currentCmd: 'shell.js', +}; +exports.state = state; + +delete process.env.OLDPWD; // initially, there's no previous directory + +// Reliably test if something is any sort of javascript object +function isObject(a) { + return typeof a === 'object' && a !== null; +} +exports.isObject = isObject; + +function log() { + /* istanbul ignore next */ + if (!config.silent) { + console.error.apply(console, arguments); + } +} +exports.log = log; + +// Converts strings to be equivalent across all platforms. Primarily responsible +// for making sure we use '/' instead of '\' as path separators, but this may be +// expanded in the future if necessary +function convertErrorOutput(msg) { + if (typeof msg !== 'string') { + throw new TypeError('input must be a string'); + } + return msg.replace(/\\/g, '/'); +} +exports.convertErrorOutput = convertErrorOutput; + +// Shows error message. Throws if config.fatal is true +function error(msg, _code, options) { + // Validate input + if (typeof msg !== 'string') throw new Error('msg must be a string'); + + var DEFAULT_OPTIONS = { + continue: false, + code: 1, + prefix: state.currentCmd + ': ', + silent: false, + }; + + if (typeof _code === 'number' && isObject(options)) { + options.code = _code; + } else if (isObject(_code)) { // no 'code' + options = _code; + } else if (typeof _code === 'number') { // no 'options' + options = { code: _code }; + } else if (typeof _code !== 'number') { // only 'msg' + options = {}; + } + options = Object.assign({}, DEFAULT_OPTIONS, options); + + if (!state.errorCode) state.errorCode = options.code; + + var logEntry = convertErrorOutput(options.prefix + msg); + state.error = state.error ? state.error + '\n' : ''; + state.error += logEntry; + + // Throw an error, or log the entry + if (config.fatal) throw new Error(logEntry); + if (msg.length > 0 && !options.silent) log(logEntry); + + if (!options.continue) { + throw { + msg: 'earlyExit', + retValue: (new ShellString('', state.error, state.errorCode)), + }; + } +} +exports.error = error; + +//@ +//@ ### ShellString(str) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ var foo = ShellString('hello world'); +//@ ``` +//@ +//@ Turns a regular string into a string-like object similar to what each +//@ command returns. This has special methods, like `.to()` and `.toEnd()`. +function ShellString(stdout, stderr, code) { + var that; + if (stdout instanceof Array) { + that = stdout; + that.stdout = stdout.join('\n'); + if (stdout.length > 0) that.stdout += '\n'; + } else { + that = new String(stdout); + that.stdout = stdout; + } + that.stderr = stderr; + that.code = code; + // A list of all commands that can appear on the right-hand side of a pipe + // (populated by calls to common.wrap()) + pipeMethods.forEach(function (cmd) { + that[cmd] = shellMethods[cmd].bind(that); + }); + return that; +} + +exports.ShellString = ShellString; + +// Returns {'alice': true, 'bob': false} when passed a string and dictionary as follows: +// parseOptions('-a', {'a':'alice', 'b':'bob'}); +// Returns {'reference': 'string-value', 'bob': false} when passed two dictionaries of the form: +// parseOptions({'-r': 'string-value'}, {'r':'reference', 'b':'bob'}); +// Throws an error when passed a string that does not start with '-': +// parseOptions('a', {'a':'alice'}); // throws +function parseOptions(opt, map, errorOptions) { + // Validate input + if (typeof opt !== 'string' && !isObject(opt)) { + throw new Error('options must be strings or key-value pairs'); + } else if (!isObject(map)) { + throw new Error('parseOptions() internal error: map must be an object'); + } else if (errorOptions && !isObject(errorOptions)) { + throw new Error('parseOptions() internal error: errorOptions must be object'); + } + + if (opt === '--') { + // This means there are no options. + return {}; + } + + // All options are false by default + var options = {}; + Object.keys(map).forEach(function (letter) { + var optName = map[letter]; + if (optName[0] !== '!') { + options[optName] = false; + } + }); + + if (opt === '') return options; // defaults + + if (typeof opt === 'string') { + if (opt[0] !== '-') { + throw new Error("Options string must start with a '-'"); + } + + // e.g. chars = ['R', 'f'] + var chars = opt.slice(1).split(''); + + chars.forEach(function (c) { + if (c in map) { + var optionName = map[c]; + if (optionName[0] === '!') { + options[optionName.slice(1)] = false; + } else { + options[optionName] = true; + } + } else { + error('option not recognized: ' + c, errorOptions || {}); + } + }); + } else { // opt is an Object + Object.keys(opt).forEach(function (key) { + // key is a string of the form '-r', '-d', etc. + var c = key[1]; + if (c in map) { + var optionName = map[c]; + options[optionName] = opt[key]; // assign the given value + } else { + error('option not recognized: ' + c, errorOptions || {}); + } + }); + } + return options; +} +exports.parseOptions = parseOptions; + +// Expands wildcards with matching (ie. existing) file names. +// For example: +// expand(['file*.js']) = ['file1.js', 'file2.js', ...] +// (if the files 'file1.js', 'file2.js', etc, exist in the current dir) +function expand(list) { + if (!Array.isArray(list)) { + throw new TypeError('must be an array'); + } + var expanded = []; + list.forEach(function (listEl) { + // Don't expand non-strings + if (typeof listEl !== 'string') { + expanded.push(listEl); + } else { + var ret; + try { + ret = glob.sync(listEl, config.globOptions); + // if nothing matched, interpret the string literally + ret = ret.length > 0 ? ret : [listEl]; + } catch (e) { + // if glob fails, interpret the string literally + ret = [listEl]; + } + expanded = expanded.concat(ret); + } + }); + return expanded; +} +exports.expand = expand; + +// Normalizes Buffer creation, using Buffer.alloc if possible. +// Also provides a good default buffer length for most use cases. +var buffer = typeof Buffer.alloc === 'function' ? + function (len) { + return Buffer.alloc(len || config.bufLength); + } : + function (len) { + return new Buffer(len || config.bufLength); + }; +exports.buffer = buffer; + +// Normalizes _unlinkSync() across platforms to match Unix behavior, i.e. +// file can be unlinked even if it's read-only, see https://github.com/joyent/node/issues/3006 +function unlinkSync(file) { + try { + fs.unlinkSync(file); + } catch (e) { + // Try to override file permission + /* istanbul ignore next */ + if (e.code === 'EPERM') { + fs.chmodSync(file, '0666'); + fs.unlinkSync(file); + } else { + throw e; + } + } +} +exports.unlinkSync = unlinkSync; + +// wrappers around common.statFollowLinks and common.statNoFollowLinks that clarify intent +// and improve readability +function statFollowLinks() { + return fs.statSync.apply(fs, arguments); +} +exports.statFollowLinks = statFollowLinks; + +function statNoFollowLinks() { + return fs.lstatSync.apply(fs, arguments); +} +exports.statNoFollowLinks = statNoFollowLinks; + +// e.g. 'shelljs_a5f185d0443ca...' +function randomFileName() { + function randomHash(count) { + if (count === 1) { + return parseInt(16 * Math.random(), 10).toString(16); + } + var hash = ''; + for (var i = 0; i < count; i++) { + hash += randomHash(1); + } + return hash; + } + + return 'shelljs_' + randomHash(20); +} +exports.randomFileName = randomFileName; + +// Common wrapper for all Unix-like commands that performs glob expansion, +// command-logging, and other nice things +function wrap(cmd, fn, options) { + options = options || {}; + return function () { + var retValue = null; + + state.currentCmd = cmd; + state.error = null; + state.errorCode = 0; + + try { + var args = [].slice.call(arguments, 0); + + // Log the command to stderr, if appropriate + if (config.verbose) { + console.error.apply(console, [cmd].concat(args)); + } + + // If this is coming from a pipe, let's set the pipedValue (otherwise, set + // it to the empty string) + state.pipedValue = (this && typeof this.stdout === 'string') ? this.stdout : ''; + + if (options.unix === false) { // this branch is for exec() + retValue = fn.apply(this, args); + } else { // and this branch is for everything else + if (isObject(args[0]) && args[0].constructor.name === 'Object') { + // a no-op, allowing the syntax `touch({'-r': file}, ...)` + } else if (args.length === 0 || typeof args[0] !== 'string' || args[0].length <= 1 || args[0][0] !== '-') { + args.unshift(''); // only add dummy option if '-option' not already present + } + + // flatten out arrays that are arguments, to make the syntax: + // `cp([file1, file2, file3], dest);` + // equivalent to: + // `cp(file1, file2, file3, dest);` + args = args.reduce(function (accum, cur) { + if (Array.isArray(cur)) { + return accum.concat(cur); + } + accum.push(cur); + return accum; + }, []); + + // Convert ShellStrings (basically just String objects) to regular strings + args = args.map(function (arg) { + if (isObject(arg) && arg.constructor.name === 'String') { + return arg.toString(); + } + return arg; + }); + + // Expand the '~' if appropriate + var homeDir = os.homedir(); + args = args.map(function (arg) { + if (typeof arg === 'string' && arg.slice(0, 2) === '~/' || arg === '~') { + return arg.replace(/^~/, homeDir); + } + return arg; + }); + + // Perform glob-expansion on all arguments after globStart, but preserve + // the arguments before it (like regexes for sed and grep) + if (!config.noglob && options.allowGlobbing === true) { + args = args.slice(0, options.globStart).concat(expand(args.slice(options.globStart))); + } + + try { + // parse options if options are provided + if (isObject(options.cmdOptions)) { + args[0] = parseOptions(args[0], options.cmdOptions); + } + + retValue = fn.apply(this, args); + } catch (e) { + /* istanbul ignore else */ + if (e.msg === 'earlyExit') { + retValue = e.retValue; + } else { + throw e; // this is probably a bug that should be thrown up the call stack + } + } + } + } catch (e) { + /* istanbul ignore next */ + if (!state.error) { + // If state.error hasn't been set it's an error thrown by Node, not us - probably a bug... + e.name = 'ShellJSInternalError'; + throw e; + } + if (config.fatal) throw e; + } + + if (options.wrapOutput && + (typeof retValue === 'string' || Array.isArray(retValue))) { + retValue = new ShellString(retValue, state.error, state.errorCode); + } + + state.currentCmd = 'shell.js'; + return retValue; + }; +} // wrap +exports.wrap = wrap; + +// This returns all the input that is piped into the current command (or the +// empty string, if this isn't on the right-hand side of a pipe +function _readFromPipe() { + return state.pipedValue; +} +exports.readFromPipe = _readFromPipe; + +var DEFAULT_WRAP_OPTIONS = { + allowGlobbing: true, + canReceivePipe: false, + cmdOptions: null, + globStart: 1, + pipeOnly: false, + wrapOutput: true, + unix: true, +}; + +// This is populated during plugin registration +var pipeMethods = []; + +// Register a new ShellJS command +function _register(name, implementation, wrapOptions) { + wrapOptions = wrapOptions || {}; + + // Validate options + Object.keys(wrapOptions).forEach(function (option) { + if (!DEFAULT_WRAP_OPTIONS.hasOwnProperty(option)) { + throw new Error("Unknown option '" + option + "'"); + } + if (typeof wrapOptions[option] !== typeof DEFAULT_WRAP_OPTIONS[option]) { + throw new TypeError("Unsupported type '" + typeof wrapOptions[option] + + "' for option '" + option + "'"); + } + }); + + // If an option isn't specified, use the default + wrapOptions = Object.assign({}, DEFAULT_WRAP_OPTIONS, wrapOptions); + + if (shell.hasOwnProperty(name)) { + throw new Error('Command `' + name + '` already exists'); + } + + if (wrapOptions.pipeOnly) { + wrapOptions.canReceivePipe = true; + shellMethods[name] = wrap(name, implementation, wrapOptions); + } else { + shell[name] = wrap(name, implementation, wrapOptions); + } + + if (wrapOptions.canReceivePipe) { + pipeMethods.push(name); + } +} +exports.register = _register; + + +/***/ }), + +/***/ 34932: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var fs = __nccwpck_require__(57147); +var path = __nccwpck_require__(71017); +var common = __nccwpck_require__(53687); + +common.register('cp', _cp, { + cmdOptions: { + 'f': '!no_force', + 'n': 'no_force', + 'u': 'update', + 'R': 'recursive', + 'r': 'recursive', + 'L': 'followsymlink', + 'P': 'noFollowsymlink', + }, + wrapOutput: false, +}); + +// Buffered file copy, synchronous +// (Using readFileSync() + writeFileSync() could easily cause a memory overflow +// with large files) +function copyFileSync(srcFile, destFile, options) { + if (!fs.existsSync(srcFile)) { + common.error('copyFileSync: no such file or directory: ' + srcFile); + } + + var isWindows = process.platform === 'win32'; + + // Check the mtimes of the files if the '-u' flag is provided + try { + if (options.update && common.statFollowLinks(srcFile).mtime < fs.statSync(destFile).mtime) { + return; + } + } catch (e) { + // If we're here, destFile probably doesn't exist, so just do a normal copy + } + + if (common.statNoFollowLinks(srcFile).isSymbolicLink() && !options.followsymlink) { + try { + common.statNoFollowLinks(destFile); + common.unlinkSync(destFile); // re-link it + } catch (e) { + // it doesn't exist, so no work needs to be done + } + + var symlinkFull = fs.readlinkSync(srcFile); + fs.symlinkSync(symlinkFull, destFile, isWindows ? 'junction' : null); + } else { + var buf = common.buffer(); + var bufLength = buf.length; + var bytesRead = bufLength; + var pos = 0; + var fdr = null; + var fdw = null; + + try { + fdr = fs.openSync(srcFile, 'r'); + } catch (e) { + /* istanbul ignore next */ + common.error('copyFileSync: could not read src file (' + srcFile + ')'); + } + + try { + fdw = fs.openSync(destFile, 'w'); + } catch (e) { + /* istanbul ignore next */ + common.error('copyFileSync: could not write to dest file (code=' + e.code + '):' + destFile); + } + + while (bytesRead === bufLength) { + bytesRead = fs.readSync(fdr, buf, 0, bufLength, pos); + fs.writeSync(fdw, buf, 0, bytesRead); + pos += bytesRead; + } + + fs.closeSync(fdr); + fs.closeSync(fdw); + + fs.chmodSync(destFile, common.statFollowLinks(srcFile).mode); + } +} + +// Recursively copies 'sourceDir' into 'destDir' +// Adapted from https://github.com/ryanmcgrath/wrench-js +// +// Copyright (c) 2010 Ryan McGrath +// Copyright (c) 2012 Artur Adib +// +// Licensed under the MIT License +// http://www.opensource.org/licenses/mit-license.php +function cpdirSyncRecursive(sourceDir, destDir, currentDepth, opts) { + if (!opts) opts = {}; + + // Ensure there is not a run away recursive copy + if (currentDepth >= common.config.maxdepth) return; + currentDepth++; + + var isWindows = process.platform === 'win32'; + + // Create the directory where all our junk is moving to; read the mode of the + // source directory and mirror it + try { + fs.mkdirSync(destDir); + } catch (e) { + // if the directory already exists, that's okay + if (e.code !== 'EEXIST') throw e; + } + + var files = fs.readdirSync(sourceDir); + + for (var i = 0; i < files.length; i++) { + var srcFile = sourceDir + '/' + files[i]; + var destFile = destDir + '/' + files[i]; + var srcFileStat = common.statNoFollowLinks(srcFile); + + var symlinkFull; + if (opts.followsymlink) { + if (cpcheckcycle(sourceDir, srcFile)) { + // Cycle link found. + console.error('Cycle link found.'); + symlinkFull = fs.readlinkSync(srcFile); + fs.symlinkSync(symlinkFull, destFile, isWindows ? 'junction' : null); + continue; + } + } + if (srcFileStat.isDirectory()) { + /* recursion this thing right on back. */ + cpdirSyncRecursive(srcFile, destFile, currentDepth, opts); + } else if (srcFileStat.isSymbolicLink() && !opts.followsymlink) { + symlinkFull = fs.readlinkSync(srcFile); + try { + common.statNoFollowLinks(destFile); + common.unlinkSync(destFile); // re-link it + } catch (e) { + // it doesn't exist, so no work needs to be done + } + fs.symlinkSync(symlinkFull, destFile, isWindows ? 'junction' : null); + } else if (srcFileStat.isSymbolicLink() && opts.followsymlink) { + srcFileStat = common.statFollowLinks(srcFile); + if (srcFileStat.isDirectory()) { + cpdirSyncRecursive(srcFile, destFile, currentDepth, opts); + } else { + copyFileSync(srcFile, destFile, opts); + } + } else { + /* At this point, we've hit a file actually worth copying... so copy it on over. */ + if (fs.existsSync(destFile) && opts.no_force) { + common.log('skipping existing file: ' + files[i]); + } else { + copyFileSync(srcFile, destFile, opts); + } + } + } // for files + + // finally change the mode for the newly created directory (otherwise, we + // couldn't add files to a read-only directory). + var checkDir = common.statFollowLinks(sourceDir); + fs.chmodSync(destDir, checkDir.mode); +} // cpdirSyncRecursive + +// Checks if cureent file was created recently +function checkRecentCreated(sources, index) { + var lookedSource = sources[index]; + return sources.slice(0, index).some(function (src) { + return path.basename(src) === path.basename(lookedSource); + }); +} + +function cpcheckcycle(sourceDir, srcFile) { + var srcFileStat = common.statNoFollowLinks(srcFile); + if (srcFileStat.isSymbolicLink()) { + // Do cycle check. For example: + // $ mkdir -p 1/2/3/4 + // $ cd 1/2/3/4 + // $ ln -s ../../3 link + // $ cd ../../../.. + // $ cp -RL 1 copy + var cyclecheck = common.statFollowLinks(srcFile); + if (cyclecheck.isDirectory()) { + var sourcerealpath = fs.realpathSync(sourceDir); + var symlinkrealpath = fs.realpathSync(srcFile); + var re = new RegExp(symlinkrealpath); + if (re.test(sourcerealpath)) { + return true; + } + } + } + return false; +} + +//@ +//@ ### cp([options,] source [, source ...], dest) +//@ ### cp([options,] source_array, dest) +//@ +//@ Available options: +//@ +//@ + `-f`: force (default behavior) +//@ + `-n`: no-clobber +//@ + `-u`: only copy if `source` is newer than `dest` +//@ + `-r`, `-R`: recursive +//@ + `-L`: follow symlinks +//@ + `-P`: don't follow symlinks +//@ +//@ Examples: +//@ +//@ ```javascript +//@ cp('file1', 'dir1'); +//@ cp('-R', 'path/to/dir/', '~/newCopy/'); +//@ cp('-Rf', '/tmp/*', '/usr/local/*', '/home/tmp'); +//@ cp('-Rf', ['/tmp/*', '/usr/local/*'], '/home/tmp'); // same as above +//@ ``` +//@ +//@ Copies files. +function _cp(options, sources, dest) { + // If we're missing -R, it actually implies -L (unless -P is explicit) + if (options.followsymlink) { + options.noFollowsymlink = false; + } + if (!options.recursive && !options.noFollowsymlink) { + options.followsymlink = true; + } + + // Get sources, dest + if (arguments.length < 3) { + common.error('missing and/or '); + } else { + sources = [].slice.call(arguments, 1, arguments.length - 1); + dest = arguments[arguments.length - 1]; + } + + var destExists = fs.existsSync(dest); + var destStat = destExists && common.statFollowLinks(dest); + + // Dest is not existing dir, but multiple sources given + if ((!destExists || !destStat.isDirectory()) && sources.length > 1) { + common.error('dest is not a directory (too many sources)'); + } + + // Dest is an existing file, but -n is given + if (destExists && destStat.isFile() && options.no_force) { + return new common.ShellString('', '', 0); + } + + sources.forEach(function (src, srcIndex) { + if (!fs.existsSync(src)) { + if (src === '') src = "''"; // if src was empty string, display empty string + common.error('no such file or directory: ' + src, { continue: true }); + return; // skip file + } + var srcStat = common.statFollowLinks(src); + if (!options.noFollowsymlink && srcStat.isDirectory()) { + if (!options.recursive) { + // Non-Recursive + common.error("omitting directory '" + src + "'", { continue: true }); + } else { + // Recursive + // 'cp /a/source dest' should create 'source' in 'dest' + var newDest = (destStat && destStat.isDirectory()) ? + path.join(dest, path.basename(src)) : + dest; + + try { + common.statFollowLinks(path.dirname(dest)); + cpdirSyncRecursive(src, newDest, 0, { no_force: options.no_force, followsymlink: options.followsymlink }); + } catch (e) { + /* istanbul ignore next */ + common.error("cannot create directory '" + dest + "': No such file or directory"); + } + } + } else { + // If here, src is a file + + // When copying to '/path/dir': + // thisDest = '/path/dir/file1' + var thisDest = dest; + if (destStat && destStat.isDirectory()) { + thisDest = path.normalize(dest + '/' + path.basename(src)); + } + + var thisDestExists = fs.existsSync(thisDest); + if (thisDestExists && checkRecentCreated(sources, srcIndex)) { + // cannot overwrite file created recently in current execution, but we want to continue copying other files + if (!options.no_force) { + common.error("will not overwrite just-created '" + thisDest + "' with '" + src + "'", { continue: true }); + } + return; + } + + if (thisDestExists && options.no_force) { + return; // skip file + } + + if (path.relative(src, thisDest) === '') { + // a file cannot be copied to itself, but we want to continue copying other files + common.error("'" + thisDest + "' and '" + src + "' are the same file", { continue: true }); + return; + } + + copyFileSync(src, thisDest, options); + } + }); // forEach(src) + + return new common.ShellString('', common.state.error, common.state.errorCode); +} +module.exports = _cp; + + +/***/ }), + +/***/ 41178: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var common = __nccwpck_require__(53687); +var _cd = __nccwpck_require__(42051); +var path = __nccwpck_require__(71017); + +common.register('dirs', _dirs, { + wrapOutput: false, +}); +common.register('pushd', _pushd, { + wrapOutput: false, +}); +common.register('popd', _popd, { + wrapOutput: false, +}); + +// Pushd/popd/dirs internals +var _dirStack = []; + +function _isStackIndex(index) { + return (/^[\-+]\d+$/).test(index); +} + +function _parseStackIndex(index) { + if (_isStackIndex(index)) { + if (Math.abs(index) < _dirStack.length + 1) { // +1 for pwd + return (/^-/).test(index) ? Number(index) - 1 : Number(index); + } + common.error(index + ': directory stack index out of range'); + } else { + common.error(index + ': invalid number'); + } +} + +function _actualDirStack() { + return [process.cwd()].concat(_dirStack); +} + +//@ +//@ ### pushd([options,] [dir | '-N' | '+N']) +//@ +//@ Available options: +//@ +//@ + `-n`: Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated. +//@ + `-q`: Supresses output to the console. +//@ +//@ Arguments: +//@ +//@ + `dir`: Sets the current working directory to the top of the stack, then executes the equivalent of `cd dir`. +//@ + `+N`: Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. +//@ + `-N`: Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. +//@ +//@ Examples: +//@ +//@ ```javascript +//@ // process.cwd() === '/usr' +//@ pushd('/etc'); // Returns /etc /usr +//@ pushd('+1'); // Returns /usr /etc +//@ ``` +//@ +//@ Save the current directory on the top of the directory stack and then `cd` to `dir`. With no arguments, `pushd` exchanges the top two directories. Returns an array of paths in the stack. +function _pushd(options, dir) { + if (_isStackIndex(options)) { + dir = options; + options = ''; + } + + options = common.parseOptions(options, { + 'n': 'no-cd', + 'q': 'quiet', + }); + + var dirs = _actualDirStack(); + + if (dir === '+0') { + return dirs; // +0 is a noop + } else if (!dir) { + if (dirs.length > 1) { + dirs = dirs.splice(1, 1).concat(dirs); + } else { + return common.error('no other directory'); + } + } else if (_isStackIndex(dir)) { + var n = _parseStackIndex(dir); + dirs = dirs.slice(n).concat(dirs.slice(0, n)); + } else { + if (options['no-cd']) { + dirs.splice(1, 0, dir); + } else { + dirs.unshift(dir); + } + } + + if (options['no-cd']) { + dirs = dirs.slice(1); + } else { + dir = path.resolve(dirs.shift()); + _cd('', dir); + } + + _dirStack = dirs; + return _dirs(options.quiet ? '-q' : ''); +} +exports.pushd = _pushd; + +//@ +//@ +//@ ### popd([options,] ['-N' | '+N']) +//@ +//@ Available options: +//@ +//@ + `-n`: Suppress the normal directory change when removing directories from the stack, so that only the stack is manipulated. +//@ + `-q`: Supresses output to the console. +//@ +//@ Arguments: +//@ +//@ + `+N`: Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero. +//@ + `-N`: Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero. +//@ +//@ Examples: +//@ +//@ ```javascript +//@ echo(process.cwd()); // '/usr' +//@ pushd('/etc'); // '/etc /usr' +//@ echo(process.cwd()); // '/etc' +//@ popd(); // '/usr' +//@ echo(process.cwd()); // '/usr' +//@ ``` +//@ +//@ When no arguments are given, `popd` removes the top directory from the stack and performs a `cd` to the new top directory. The elements are numbered from 0, starting at the first directory listed with dirs (i.e., `popd` is equivalent to `popd +0`). Returns an array of paths in the stack. +function _popd(options, index) { + if (_isStackIndex(options)) { + index = options; + options = ''; + } + + options = common.parseOptions(options, { + 'n': 'no-cd', + 'q': 'quiet', + }); + + if (!_dirStack.length) { + return common.error('directory stack empty'); + } + + index = _parseStackIndex(index || '+0'); + + if (options['no-cd'] || index > 0 || _dirStack.length + index === 0) { + index = index > 0 ? index - 1 : index; + _dirStack.splice(index, 1); + } else { + var dir = path.resolve(_dirStack.shift()); + _cd('', dir); + } + + return _dirs(options.quiet ? '-q' : ''); +} +exports.popd = _popd; + +//@ +//@ +//@ ### dirs([options | '+N' | '-N']) +//@ +//@ Available options: +//@ +//@ + `-c`: Clears the directory stack by deleting all of the elements. +//@ + `-q`: Supresses output to the console. +//@ +//@ Arguments: +//@ +//@ + `+N`: Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero. +//@ + `-N`: Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero. +//@ +//@ Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if `+N` or `-N` was specified. +//@ +//@ See also: `pushd`, `popd` +function _dirs(options, index) { + if (_isStackIndex(options)) { + index = options; + options = ''; + } + + options = common.parseOptions(options, { + 'c': 'clear', + 'q': 'quiet', + }); + + if (options.clear) { + _dirStack = []; + return _dirStack; + } + + var stack = _actualDirStack(); + + if (index) { + index = _parseStackIndex(index); + + if (index < 0) { + index = stack.length + index; + } + + if (!options.quiet) { + common.log(stack[index]); + } + return stack[index]; + } + + if (!options.quiet) { + common.log(stack.join(' ')); + } + + return stack; +} +exports.dirs = _dirs; + + +/***/ }), + +/***/ 10243: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var format = (__nccwpck_require__(73837).format); + +var common = __nccwpck_require__(53687); + +common.register('echo', _echo, { + allowGlobbing: false, +}); + +//@ +//@ ### echo([options,] string [, string ...]) +//@ +//@ Available options: +//@ +//@ + `-e`: interpret backslash escapes (default) +//@ + `-n`: remove trailing newline from output +//@ +//@ Examples: +//@ +//@ ```javascript +//@ echo('hello world'); +//@ var str = echo('hello world'); +//@ echo('-n', 'no newline at end'); +//@ ``` +//@ +//@ Prints `string` to stdout, and returns string with additional utility methods +//@ like `.to()`. +function _echo(opts) { + // allow strings starting with '-', see issue #20 + var messages = [].slice.call(arguments, opts ? 0 : 1); + var options = {}; + + // If the first argument starts with '-', parse it as options string. + // If parseOptions throws, it wasn't an options string. + try { + options = common.parseOptions(messages[0], { + 'e': 'escapes', + 'n': 'no_newline', + }, { + silent: true, + }); + + // Allow null to be echoed + if (messages[0]) { + messages.shift(); + } + } catch (_) { + // Clear out error if an error occurred + common.state.error = null; + } + + var output = format.apply(null, messages); + + // Add newline if -n is not passed. + if (!options.no_newline) { + output += '\n'; + } + + process.stdout.write(output); + + return output; +} + +module.exports = _echo; + + +/***/ }), + +/***/ 10232: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var common = __nccwpck_require__(53687); + +//@ +//@ ### error() +//@ +//@ Tests if error occurred in the last command. Returns a truthy value if an +//@ error returned, or a falsy value otherwise. +//@ +//@ **Note**: do not rely on the +//@ return value to be an error message. If you need the last error message, use +//@ the `.stderr` attribute from the last command's return value instead. +function error() { + return common.state.error; +} +module.exports = error; + + +/***/ }), + +/***/ 69607: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +/* module decorator */ module = __nccwpck_require__.nmd(module); +if (require.main !== module) { + throw new Error('This file should not be required'); +} + +var childProcess = __nccwpck_require__(32081); +var fs = __nccwpck_require__(57147); + +var paramFilePath = process.argv[2]; + +var serializedParams = fs.readFileSync(paramFilePath, 'utf8'); +var params = JSON.parse(serializedParams); + +var cmd = params.command; +var execOptions = params.execOptions; +var pipe = params.pipe; +var stdoutFile = params.stdoutFile; +var stderrFile = params.stderrFile; + +var c = childProcess.exec(cmd, execOptions, function (err) { + if (!err) { + process.exitCode = 0; + } else if (err.code === undefined) { + process.exitCode = 1; + } else { + process.exitCode = err.code; + } +}); + +var stdoutStream = fs.createWriteStream(stdoutFile); +var stderrStream = fs.createWriteStream(stderrFile); + +c.stdout.pipe(stdoutStream); +c.stderr.pipe(stderrStream); +c.stdout.pipe(process.stdout); +c.stderr.pipe(process.stderr); + +if (pipe) { + c.stdin.end(pipe); +} + + +/***/ }), + +/***/ 10896: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var common = __nccwpck_require__(53687); +var _tempDir = (__nccwpck_require__(76150).tempDir); +var _pwd = __nccwpck_require__(58553); +var path = __nccwpck_require__(71017); +var fs = __nccwpck_require__(57147); +var child = __nccwpck_require__(32081); + +var DEFAULT_MAXBUFFER_SIZE = 20 * 1024 * 1024; +var DEFAULT_ERROR_CODE = 1; + +common.register('exec', _exec, { + unix: false, + canReceivePipe: true, + wrapOutput: false, +}); + +// We use this function to run `exec` synchronously while also providing realtime +// output. +function execSync(cmd, opts, pipe) { + if (!common.config.execPath) { + common.error('Unable to find a path to the node binary. Please manually set config.execPath'); + } + + var tempDir = _tempDir(); + var paramsFile = path.resolve(tempDir + '/' + common.randomFileName()); + var stderrFile = path.resolve(tempDir + '/' + common.randomFileName()); + var stdoutFile = path.resolve(tempDir + '/' + common.randomFileName()); + + opts = common.extend({ + silent: common.config.silent, + cwd: _pwd().toString(), + env: process.env, + maxBuffer: DEFAULT_MAXBUFFER_SIZE, + encoding: 'utf8', + }, opts); + + if (fs.existsSync(paramsFile)) common.unlinkSync(paramsFile); + if (fs.existsSync(stderrFile)) common.unlinkSync(stderrFile); + if (fs.existsSync(stdoutFile)) common.unlinkSync(stdoutFile); + + opts.cwd = path.resolve(opts.cwd); + + var paramsToSerialize = { + command: cmd, + execOptions: opts, + pipe: pipe, + stdoutFile: stdoutFile, + stderrFile: stderrFile, + }; + + // Create the files and ensure these are locked down (for read and write) to + // the current user. The main concerns here are: + // + // * If we execute a command which prints sensitive output, then + // stdoutFile/stderrFile must not be readable by other users. + // * paramsFile must not be readable by other users, or else they can read it + // to figure out the path for stdoutFile/stderrFile and create these first + // (locked down to their own access), which will crash exec() when it tries + // to write to the files. + function writeFileLockedDown(filePath, data) { + fs.writeFileSync(filePath, data, { + encoding: 'utf8', + mode: parseInt('600', 8), + }); + } + writeFileLockedDown(stdoutFile, ''); + writeFileLockedDown(stderrFile, ''); + writeFileLockedDown(paramsFile, JSON.stringify(paramsToSerialize)); + + var execArgs = [ + __nccwpck_require__.ab + "exec-child.js", + paramsFile, + ]; + + /* istanbul ignore else */ + if (opts.silent) { + opts.stdio = 'ignore'; + } else { + opts.stdio = [0, 1, 2]; + } + + var code = 0; + + // Welcome to the future + try { + // Bad things if we pass in a `shell` option to child_process.execFileSync, + // so we need to explicitly remove it here. + delete opts.shell; + + child.execFileSync(common.config.execPath, execArgs, opts); + } catch (e) { + // Commands with non-zero exit code raise an exception. + code = e.status || DEFAULT_ERROR_CODE; + } + + // fs.readFileSync uses buffer encoding by default, so call + // it without the encoding option if the encoding is 'buffer'. + // Also, if the exec timeout is too short for node to start up, + // the files will not be created, so these calls will throw. + var stdout = ''; + var stderr = ''; + if (opts.encoding === 'buffer') { + stdout = fs.readFileSync(stdoutFile); + stderr = fs.readFileSync(stderrFile); + } else { + stdout = fs.readFileSync(stdoutFile, opts.encoding); + stderr = fs.readFileSync(stderrFile, opts.encoding); + } + + // No biggie if we can't erase the files now -- they're in a temp dir anyway + // and we locked down permissions (see the note above). + try { common.unlinkSync(paramsFile); } catch (e) {} + try { common.unlinkSync(stderrFile); } catch (e) {} + try { common.unlinkSync(stdoutFile); } catch (e) {} + + if (code !== 0) { + // Note: `silent` should be unconditionally true to avoid double-printing + // the command's stderr, and to avoid printing any stderr when the user has + // set `shell.config.silent`. + common.error(stderr, code, { continue: true, silent: true }); + } + var obj = common.ShellString(stdout, stderr, code); + return obj; +} // execSync() + +// Wrapper around exec() to enable echoing output to console in real time +function execAsync(cmd, opts, pipe, callback) { + opts = common.extend({ + silent: common.config.silent, + cwd: _pwd().toString(), + env: process.env, + maxBuffer: DEFAULT_MAXBUFFER_SIZE, + encoding: 'utf8', + }, opts); + + var c = child.exec(cmd, opts, function (err, stdout, stderr) { + if (callback) { + if (!err) { + callback(0, stdout, stderr); + } else if (err.code === undefined) { + // See issue #536 + /* istanbul ignore next */ + callback(1, stdout, stderr); + } else { + callback(err.code, stdout, stderr); + } + } + }); + + if (pipe) c.stdin.end(pipe); + + if (!opts.silent) { + c.stdout.pipe(process.stdout); + c.stderr.pipe(process.stderr); + } + + return c; +} + +//@ +//@ ### exec(command [, options] [, callback]) +//@ +//@ Available options: +//@ +//@ + `async`: Asynchronous execution. If a callback is provided, it will be set to +//@ `true`, regardless of the passed value (default: `false`). +//@ + `silent`: Do not echo program output to console (default: `false`). +//@ + `encoding`: Character encoding to use. Affects the values returned to stdout and stderr, and +//@ what is written to stdout and stderr when not in silent mode (default: `'utf8'`). +//@ + and any option available to Node.js's +//@ [`child_process.exec()`](https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ var version = exec('node --version', {silent:true}).stdout; +//@ +//@ var child = exec('some_long_running_process', {async:true}); +//@ child.stdout.on('data', function(data) { +//@ /* ... do something with data ... */ +//@ }); +//@ +//@ exec('some_long_running_process', function(code, stdout, stderr) { +//@ console.log('Exit code:', code); +//@ console.log('Program output:', stdout); +//@ console.log('Program stderr:', stderr); +//@ }); +//@ ``` +//@ +//@ Executes the given `command` _synchronously_, unless otherwise specified. When in synchronous +//@ mode, this returns a `ShellString` (compatible with ShellJS v0.6.x, which returns an object +//@ of the form `{ code:..., stdout:... , stderr:... }`). Otherwise, this returns the child process +//@ object, and the `callback` receives the arguments `(code, stdout, stderr)`. +//@ +//@ Not seeing the behavior you want? `exec()` runs everything through `sh` +//@ by default (or `cmd.exe` on Windows), which differs from `bash`. If you +//@ need bash-specific behavior, try out the `{shell: 'path/to/bash'}` option. +function _exec(command, options, callback) { + options = options || {}; + if (!command) common.error('must specify command'); + + var pipe = common.readFromPipe(); + + // Callback is defined instead of options. + if (typeof options === 'function') { + callback = options; + options = { async: true }; + } + + // Callback is defined with options. + if (typeof options === 'object' && typeof callback === 'function') { + options.async = true; + } + + options = common.extend({ + silent: common.config.silent, + async: false, + }, options); + + if (options.async) { + return execAsync(command, options, pipe, callback); + } else { + return execSync(command, options, pipe); + } +} +module.exports = _exec; + + +/***/ }), + +/***/ 47838: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var path = __nccwpck_require__(71017); +var common = __nccwpck_require__(53687); +var _ls = __nccwpck_require__(35561); + +common.register('find', _find, {}); + +//@ +//@ ### find(path [, path ...]) +//@ ### find(path_array) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ find('src', 'lib'); +//@ find(['src', 'lib']); // same as above +//@ find('.').filter(function(file) { return file.match(/\.js$/); }); +//@ ``` +//@ +//@ Returns array of all files (however deep) in the given paths. +//@ +//@ The main difference from `ls('-R', path)` is that the resulting file names +//@ include the base directories (e.g., `lib/resources/file1` instead of just `file1`). +function _find(options, paths) { + if (!paths) { + common.error('no path specified'); + } else if (typeof paths === 'string') { + paths = [].slice.call(arguments, 1); + } + + var list = []; + + function pushFile(file) { + if (process.platform === 'win32') { + file = file.replace(/\\/g, '/'); + } + list.push(file); + } + + // why not simply do `ls('-R', paths)`? because the output wouldn't give the base dirs + // to get the base dir in the output, we need instead `ls('-R', 'dir/*')` for every directory + + paths.forEach(function (file) { + var stat; + try { + stat = common.statFollowLinks(file); + } catch (e) { + common.error('no such file or directory: ' + file); + } + + pushFile(file); + + if (stat.isDirectory()) { + _ls({ recursive: true, all: true }, file).forEach(function (subfile) { + pushFile(path.join(file, subfile)); + }); + } + }); + + return list; +} +module.exports = _find; + + +/***/ }), + +/***/ 17417: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var common = __nccwpck_require__(53687); +var fs = __nccwpck_require__(57147); + +common.register('grep', _grep, { + globStart: 2, // don't glob-expand the regex + canReceivePipe: true, + cmdOptions: { + 'v': 'inverse', + 'l': 'nameOnly', + 'i': 'ignoreCase', + }, +}); + +//@ +//@ ### grep([options,] regex_filter, file [, file ...]) +//@ ### grep([options,] regex_filter, file_array) +//@ +//@ Available options: +//@ +//@ + `-v`: Invert `regex_filter` (only print non-matching lines). +//@ + `-l`: Print only filenames of matching files. +//@ + `-i`: Ignore case. +//@ +//@ Examples: +//@ +//@ ```javascript +//@ grep('-v', 'GLOBAL_VARIABLE', '*.js'); +//@ grep('GLOBAL_VARIABLE', '*.js'); +//@ ``` +//@ +//@ Reads input string from given files and returns a string containing all lines of the +//@ file that match the given `regex_filter`. +function _grep(options, regex, files) { + // Check if this is coming from a pipe + var pipe = common.readFromPipe(); + + if (!files && !pipe) common.error('no paths given', 2); + + files = [].slice.call(arguments, 2); + + if (pipe) { + files.unshift('-'); + } + + var grep = []; + if (options.ignoreCase) { + regex = new RegExp(regex, 'i'); + } + files.forEach(function (file) { + if (!fs.existsSync(file) && file !== '-') { + common.error('no such file or directory: ' + file, 2, { continue: true }); + return; + } + + var contents = file === '-' ? pipe : fs.readFileSync(file, 'utf8'); + if (options.nameOnly) { + if (contents.match(regex)) { + grep.push(file); + } + } else { + var lines = contents.split('\n'); + lines.forEach(function (line) { + var matched = line.match(regex); + if ((options.inverse && !matched) || (!options.inverse && matched)) { + grep.push(line); + } + }); + } + }); + + return grep.join('\n') + '\n'; +} +module.exports = _grep; + + +/***/ }), + +/***/ 6613: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var common = __nccwpck_require__(53687); +var fs = __nccwpck_require__(57147); + +common.register('head', _head, { + canReceivePipe: true, + cmdOptions: { + 'n': 'numLines', + }, +}); + +// Reads |numLines| lines or the entire file, whichever is less. +function readSomeLines(file, numLines) { + var buf = common.buffer(); + var bufLength = buf.length; + var bytesRead = bufLength; + var pos = 0; + + var fdr = fs.openSync(file, 'r'); + var numLinesRead = 0; + var ret = ''; + while (bytesRead === bufLength && numLinesRead < numLines) { + bytesRead = fs.readSync(fdr, buf, 0, bufLength, pos); + var bufStr = buf.toString('utf8', 0, bytesRead); + numLinesRead += bufStr.split('\n').length - 1; + ret += bufStr; + pos += bytesRead; + } + + fs.closeSync(fdr); + return ret; +} + +//@ +//@ ### head([{'-n': \},] file [, file ...]) +//@ ### head([{'-n': \},] file_array) +//@ +//@ Available options: +//@ +//@ + `-n `: Show the first `` lines of the files +//@ +//@ Examples: +//@ +//@ ```javascript +//@ var str = head({'-n': 1}, 'file*.txt'); +//@ var str = head('file1', 'file2'); +//@ var str = head(['file1', 'file2']); // same as above +//@ ``` +//@ +//@ Read the start of a file. +function _head(options, files) { + var head = []; + var pipe = common.readFromPipe(); + + if (!files && !pipe) common.error('no paths given'); + + var idx = 1; + if (options.numLines === true) { + idx = 2; + options.numLines = Number(arguments[1]); + } else if (options.numLines === false) { + options.numLines = 10; + } + files = [].slice.call(arguments, idx); + + if (pipe) { + files.unshift('-'); + } + + var shouldAppendNewline = false; + files.forEach(function (file) { + if (file !== '-') { + if (!fs.existsSync(file)) { + common.error('no such file or directory: ' + file, { continue: true }); + return; + } else if (common.statFollowLinks(file).isDirectory()) { + common.error("error reading '" + file + "': Is a directory", { + continue: true, + }); + return; + } + } + + var contents; + if (file === '-') { + contents = pipe; + } else if (options.numLines < 0) { + contents = fs.readFileSync(file, 'utf8'); + } else { + contents = readSomeLines(file, options.numLines); + } + + var lines = contents.split('\n'); + var hasTrailingNewline = (lines[lines.length - 1] === ''); + if (hasTrailingNewline) { + lines.pop(); + } + shouldAppendNewline = (hasTrailingNewline || options.numLines < lines.length); + + head = head.concat(lines.slice(0, options.numLines)); + }); + + if (shouldAppendNewline) { + head.push(''); // to add a trailing newline once we join + } + return head.join('\n'); +} +module.exports = _head; + + +/***/ }), + +/***/ 15787: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var fs = __nccwpck_require__(57147); +var path = __nccwpck_require__(71017); +var common = __nccwpck_require__(53687); + +common.register('ln', _ln, { + cmdOptions: { + 's': 'symlink', + 'f': 'force', + }, +}); + +//@ +//@ ### ln([options,] source, dest) +//@ +//@ Available options: +//@ +//@ + `-s`: symlink +//@ + `-f`: force +//@ +//@ Examples: +//@ +//@ ```javascript +//@ ln('file', 'newlink'); +//@ ln('-sf', 'file', 'existing'); +//@ ``` +//@ +//@ Links `source` to `dest`. Use `-f` to force the link, should `dest` already exist. +function _ln(options, source, dest) { + if (!source || !dest) { + common.error('Missing and/or '); + } + + source = String(source); + var sourcePath = path.normalize(source).replace(RegExp(path.sep + '$'), ''); + var isAbsolute = (path.resolve(source) === sourcePath); + dest = path.resolve(process.cwd(), String(dest)); + + if (fs.existsSync(dest)) { + if (!options.force) { + common.error('Destination file exists', { continue: true }); + } + + fs.unlinkSync(dest); + } + + if (options.symlink) { + var isWindows = process.platform === 'win32'; + var linkType = isWindows ? 'file' : null; + var resolvedSourcePath = isAbsolute ? sourcePath : path.resolve(process.cwd(), path.dirname(dest), source); + if (!fs.existsSync(resolvedSourcePath)) { + common.error('Source file does not exist', { continue: true }); + } else if (isWindows && common.statFollowLinks(resolvedSourcePath).isDirectory()) { + linkType = 'junction'; + } + + try { + fs.symlinkSync(linkType === 'junction' ? resolvedSourcePath : source, dest, linkType); + } catch (err) { + common.error(err.message); + } + } else { + if (!fs.existsSync(source)) { + common.error('Source file does not exist', { continue: true }); + } + try { + fs.linkSync(source, dest); + } catch (err) { + common.error(err.message); + } + } + return ''; +} +module.exports = _ln; + + +/***/ }), + +/***/ 35561: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var path = __nccwpck_require__(71017); +var fs = __nccwpck_require__(57147); +var common = __nccwpck_require__(53687); +var glob = __nccwpck_require__(91957); + +var globPatternRecursive = path.sep + '**'; + +common.register('ls', _ls, { + cmdOptions: { + 'R': 'recursive', + 'A': 'all', + 'L': 'link', + 'a': 'all_deprecated', + 'd': 'directory', + 'l': 'long', + }, +}); + +//@ +//@ ### ls([options,] [path, ...]) +//@ ### ls([options,] path_array) +//@ +//@ Available options: +//@ +//@ + `-R`: recursive +//@ + `-A`: all files (include files beginning with `.`, except for `.` and `..`) +//@ + `-L`: follow symlinks +//@ + `-d`: list directories themselves, not their contents +//@ + `-l`: list objects representing each file, each with fields containing `ls +//@ -l` output fields. See +//@ [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) +//@ for more info +//@ +//@ Examples: +//@ +//@ ```javascript +//@ ls('projs/*.js'); +//@ ls('-R', '/users/me', '/tmp'); +//@ ls('-R', ['/users/me', '/tmp']); // same as above +//@ ls('-l', 'file.txt'); // { name: 'file.txt', mode: 33188, nlink: 1, ...} +//@ ``` +//@ +//@ Returns array of files in the given `path`, or files in +//@ the current directory if no `path` is provided. +function _ls(options, paths) { + if (options.all_deprecated) { + // We won't support the -a option as it's hard to image why it's useful + // (it includes '.' and '..' in addition to '.*' files) + // For backwards compatibility we'll dump a deprecated message and proceed as before + common.log('ls: Option -a is deprecated. Use -A instead'); + options.all = true; + } + + if (!paths) { + paths = ['.']; + } else { + paths = [].slice.call(arguments, 1); + } + + var list = []; + + function pushFile(abs, relName, stat) { + if (process.platform === 'win32') { + relName = relName.replace(/\\/g, '/'); + } + if (options.long) { + stat = stat || (options.link ? common.statFollowLinks(abs) : common.statNoFollowLinks(abs)); + list.push(addLsAttributes(relName, stat)); + } else { + // list.push(path.relative(rel || '.', file)); + list.push(relName); + } + } + + paths.forEach(function (p) { + var stat; + + try { + stat = options.link ? common.statFollowLinks(p) : common.statNoFollowLinks(p); + // follow links to directories by default + if (stat.isSymbolicLink()) { + /* istanbul ignore next */ + // workaround for https://github.com/shelljs/shelljs/issues/795 + // codecov seems to have a bug that miscalculate this block as uncovered. + // but according to nyc report this block does get covered. + try { + var _stat = common.statFollowLinks(p); + if (_stat.isDirectory()) { + stat = _stat; + } + } catch (_) {} // bad symlink, treat it like a file + } + } catch (e) { + common.error('no such file or directory: ' + p, 2, { continue: true }); + return; + } + + // If the stat succeeded + if (stat.isDirectory() && !options.directory) { + if (options.recursive) { + // use glob, because it's simple + glob.sync(p + globPatternRecursive, { dot: options.all, follow: options.link }) + .forEach(function (item) { + // Glob pattern returns the directory itself and needs to be filtered out. + if (path.relative(p, item)) { + pushFile(item, path.relative(p, item)); + } + }); + } else if (options.all) { + // use fs.readdirSync, because it's fast + fs.readdirSync(p).forEach(function (item) { + pushFile(path.join(p, item), item); + }); + } else { + // use fs.readdirSync and then filter out secret files + fs.readdirSync(p).forEach(function (item) { + if (item[0] !== '.') { + pushFile(path.join(p, item), item); + } + }); + } + } else { + pushFile(p, p, stat); + } + }); + + // Add methods, to make this more compatible with ShellStrings + return list; +} + +function addLsAttributes(pathName, stats) { + // Note: this object will contain more information than .toString() returns + stats.name = pathName; + stats.toString = function () { + // Return a string resembling unix's `ls -l` format + return [this.mode, this.nlink, this.uid, this.gid, this.size, this.mtime, this.name].join(' '); + }; + return stats; +} + +module.exports = _ls; + + +/***/ }), + +/***/ 72695: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var common = __nccwpck_require__(53687); +var fs = __nccwpck_require__(57147); +var path = __nccwpck_require__(71017); + +common.register('mkdir', _mkdir, { + cmdOptions: { + 'p': 'fullpath', + }, +}); + +// Recursively creates `dir` +function mkdirSyncRecursive(dir) { + var baseDir = path.dirname(dir); + + // Prevents some potential problems arising from malformed UNCs or + // insufficient permissions. + /* istanbul ignore next */ + if (baseDir === dir) { + common.error('dirname() failed: [' + dir + ']'); + } + + // Base dir exists, no recursion necessary + if (fs.existsSync(baseDir)) { + fs.mkdirSync(dir, parseInt('0777', 8)); + return; + } + + // Base dir does not exist, go recursive + mkdirSyncRecursive(baseDir); + + // Base dir created, can create dir + fs.mkdirSync(dir, parseInt('0777', 8)); +} + +//@ +//@ ### mkdir([options,] dir [, dir ...]) +//@ ### mkdir([options,] dir_array) +//@ +//@ Available options: +//@ +//@ + `-p`: full path (and create intermediate directories, if necessary) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ mkdir('-p', '/tmp/a/b/c/d', '/tmp/e/f/g'); +//@ mkdir('-p', ['/tmp/a/b/c/d', '/tmp/e/f/g']); // same as above +//@ ``` +//@ +//@ Creates directories. +function _mkdir(options, dirs) { + if (!dirs) common.error('no paths given'); + + if (typeof dirs === 'string') { + dirs = [].slice.call(arguments, 1); + } + // if it's array leave it as it is + + dirs.forEach(function (dir) { + try { + var stat = common.statNoFollowLinks(dir); + if (!options.fullpath) { + common.error('path already exists: ' + dir, { continue: true }); + } else if (stat.isFile()) { + common.error('cannot create directory ' + dir + ': File exists', { continue: true }); + } + return; // skip dir + } catch (e) { + // do nothing + } + + // Base dir does not exist, and no -p option given + var baseDir = path.dirname(dir); + if (!fs.existsSync(baseDir) && !options.fullpath) { + common.error('no such file or directory: ' + baseDir, { continue: true }); + return; // skip dir + } + + try { + if (options.fullpath) { + mkdirSyncRecursive(path.resolve(dir)); + } else { + fs.mkdirSync(dir, parseInt('0777', 8)); + } + } catch (e) { + var reason; + if (e.code === 'EACCES') { + reason = 'Permission denied'; + } else if (e.code === 'ENOTDIR' || e.code === 'ENOENT') { + reason = 'Not a directory'; + } else { + /* istanbul ignore next */ + throw e; + } + common.error('cannot create directory ' + dir + ': ' + reason, { continue: true }); + } + }); + return ''; +} // mkdir +module.exports = _mkdir; + + +/***/ }), + +/***/ 39849: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var fs = __nccwpck_require__(57147); +var path = __nccwpck_require__(71017); +var common = __nccwpck_require__(53687); +var cp = __nccwpck_require__(34932); +var rm = __nccwpck_require__(22830); + +common.register('mv', _mv, { + cmdOptions: { + 'f': '!no_force', + 'n': 'no_force', + }, +}); + +// Checks if cureent file was created recently +function checkRecentCreated(sources, index) { + var lookedSource = sources[index]; + return sources.slice(0, index).some(function (src) { + return path.basename(src) === path.basename(lookedSource); + }); +} + +//@ +//@ ### mv([options ,] source [, source ...], dest') +//@ ### mv([options ,] source_array, dest') +//@ +//@ Available options: +//@ +//@ + `-f`: force (default behavior) +//@ + `-n`: no-clobber +//@ +//@ Examples: +//@ +//@ ```javascript +//@ mv('-n', 'file', 'dir/'); +//@ mv('file1', 'file2', 'dir/'); +//@ mv(['file1', 'file2'], 'dir/'); // same as above +//@ ``` +//@ +//@ Moves `source` file(s) to `dest`. +function _mv(options, sources, dest) { + // Get sources, dest + if (arguments.length < 3) { + common.error('missing and/or '); + } else if (arguments.length > 3) { + sources = [].slice.call(arguments, 1, arguments.length - 1); + dest = arguments[arguments.length - 1]; + } else if (typeof sources === 'string') { + sources = [sources]; + } else { + // TODO(nate): figure out if we actually need this line + common.error('invalid arguments'); + } + + var exists = fs.existsSync(dest); + var stats = exists && common.statFollowLinks(dest); + + // Dest is not existing dir, but multiple sources given + if ((!exists || !stats.isDirectory()) && sources.length > 1) { + common.error('dest is not a directory (too many sources)'); + } + + // Dest is an existing file, but no -f given + if (exists && stats.isFile() && options.no_force) { + common.error('dest file already exists: ' + dest); + } + + sources.forEach(function (src, srcIndex) { + if (!fs.existsSync(src)) { + common.error('no such file or directory: ' + src, { continue: true }); + return; // skip file + } + + // If here, src exists + + // When copying to '/path/dir': + // thisDest = '/path/dir/file1' + var thisDest = dest; + if (fs.existsSync(dest) && common.statFollowLinks(dest).isDirectory()) { + thisDest = path.normalize(dest + '/' + path.basename(src)); + } + + var thisDestExists = fs.existsSync(thisDest); + + if (thisDestExists && checkRecentCreated(sources, srcIndex)) { + // cannot overwrite file created recently in current execution, but we want to continue copying other files + if (!options.no_force) { + common.error("will not overwrite just-created '" + thisDest + "' with '" + src + "'", { continue: true }); + } + return; + } + + if (fs.existsSync(thisDest) && options.no_force) { + common.error('dest file already exists: ' + thisDest, { continue: true }); + return; // skip file + } + + if (path.resolve(src) === path.dirname(path.resolve(thisDest))) { + common.error('cannot move to self: ' + src, { continue: true }); + return; // skip file + } + + try { + fs.renameSync(src, thisDest); + } catch (e) { + /* istanbul ignore next */ + if (e.code === 'EXDEV') { + // If we're trying to `mv` to an external partition, we'll actually need + // to perform a copy and then clean up the original file. If either the + // copy or the rm fails with an exception, we should allow this + // exception to pass up to the top level. + cp('-r', src, thisDest); + rm('-rf', src); + } + } + }); // forEach(src) + return ''; +} // mv +module.exports = _mv; + + +/***/ }), + +/***/ 50227: +/***/ (() => { + +// see dirs.js + + +/***/ }), + +/***/ 44177: +/***/ (() => { + +// see dirs.js + + +/***/ }), + +/***/ 58553: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var path = __nccwpck_require__(71017); +var common = __nccwpck_require__(53687); + +common.register('pwd', _pwd, { + allowGlobbing: false, +}); + +//@ +//@ ### pwd() +//@ +//@ Returns the current directory. +function _pwd() { + var pwd = path.resolve(process.cwd()); + return pwd; +} +module.exports = _pwd; + + +/***/ }), + +/***/ 22830: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var common = __nccwpck_require__(53687); +var fs = __nccwpck_require__(57147); + +common.register('rm', _rm, { + cmdOptions: { + 'f': 'force', + 'r': 'recursive', + 'R': 'recursive', + }, +}); + +// Recursively removes 'dir' +// Adapted from https://github.com/ryanmcgrath/wrench-js +// +// Copyright (c) 2010 Ryan McGrath +// Copyright (c) 2012 Artur Adib +// +// Licensed under the MIT License +// http://www.opensource.org/licenses/mit-license.php +function rmdirSyncRecursive(dir, force, fromSymlink) { + var files; + + files = fs.readdirSync(dir); + + // Loop through and delete everything in the sub-tree after checking it + for (var i = 0; i < files.length; i++) { + var file = dir + '/' + files[i]; + var currFile = common.statNoFollowLinks(file); + + if (currFile.isDirectory()) { // Recursive function back to the beginning + rmdirSyncRecursive(file, force); + } else { // Assume it's a file - perhaps a try/catch belongs here? + if (force || isWriteable(file)) { + try { + common.unlinkSync(file); + } catch (e) { + /* istanbul ignore next */ + common.error('could not remove file (code ' + e.code + '): ' + file, { + continue: true, + }); + } + } + } + } + + // if was directory was referenced through a symbolic link, + // the contents should be removed, but not the directory itself + if (fromSymlink) return; + + // Now that we know everything in the sub-tree has been deleted, we can delete the main directory. + // Huzzah for the shopkeep. + + var result; + try { + // Retry on windows, sometimes it takes a little time before all the files in the directory are gone + var start = Date.now(); + + // TODO: replace this with a finite loop + for (;;) { + try { + result = fs.rmdirSync(dir); + if (fs.existsSync(dir)) throw { code: 'EAGAIN' }; + break; + } catch (er) { + /* istanbul ignore next */ + // In addition to error codes, also check if the directory still exists and loop again if true + if (process.platform === 'win32' && (er.code === 'ENOTEMPTY' || er.code === 'EBUSY' || er.code === 'EPERM' || er.code === 'EAGAIN')) { + if (Date.now() - start > 1000) throw er; + } else if (er.code === 'ENOENT') { + // Directory did not exist, deletion was successful + break; + } else { + throw er; + } + } + } + } catch (e) { + common.error('could not remove directory (code ' + e.code + '): ' + dir, { continue: true }); + } + + return result; +} // rmdirSyncRecursive + +// Hack to determine if file has write permissions for current user +// Avoids having to check user, group, etc, but it's probably slow +function isWriteable(file) { + var writePermission = true; + try { + var __fd = fs.openSync(file, 'a'); + fs.closeSync(__fd); + } catch (e) { + writePermission = false; + } + + return writePermission; +} + +function handleFile(file, options) { + if (options.force || isWriteable(file)) { + // -f was passed, or file is writable, so it can be removed + common.unlinkSync(file); + } else { + common.error('permission denied: ' + file, { continue: true }); + } +} + +function handleDirectory(file, options) { + if (options.recursive) { + // -r was passed, so directory can be removed + rmdirSyncRecursive(file, options.force); + } else { + common.error('path is a directory', { continue: true }); + } +} + +function handleSymbolicLink(file, options) { + var stats; + try { + stats = common.statFollowLinks(file); + } catch (e) { + // symlink is broken, so remove the symlink itself + common.unlinkSync(file); + return; + } + + if (stats.isFile()) { + common.unlinkSync(file); + } else if (stats.isDirectory()) { + if (file[file.length - 1] === '/') { + // trailing separator, so remove the contents, not the link + if (options.recursive) { + // -r was passed, so directory can be removed + var fromSymlink = true; + rmdirSyncRecursive(file, options.force, fromSymlink); + } else { + common.error('path is a directory', { continue: true }); + } + } else { + // no trailing separator, so remove the link + common.unlinkSync(file); + } + } +} + +function handleFIFO(file) { + common.unlinkSync(file); +} + +//@ +//@ ### rm([options,] file [, file ...]) +//@ ### rm([options,] file_array) +//@ +//@ Available options: +//@ +//@ + `-f`: force +//@ + `-r, -R`: recursive +//@ +//@ Examples: +//@ +//@ ```javascript +//@ rm('-rf', '/tmp/*'); +//@ rm('some_file.txt', 'another_file.txt'); +//@ rm(['some_file.txt', 'another_file.txt']); // same as above +//@ ``` +//@ +//@ Removes files. +function _rm(options, files) { + if (!files) common.error('no paths given'); + + // Convert to array + files = [].slice.call(arguments, 1); + + files.forEach(function (file) { + var lstats; + try { + var filepath = (file[file.length - 1] === '/') + ? file.slice(0, -1) // remove the '/' so lstatSync can detect symlinks + : file; + lstats = common.statNoFollowLinks(filepath); // test for existence + } catch (e) { + // Path does not exist, no force flag given + if (!options.force) { + common.error('no such file or directory: ' + file, { continue: true }); + } + return; // skip file + } + + // If here, path exists + if (lstats.isFile()) { + handleFile(file, options); + } else if (lstats.isDirectory()) { + handleDirectory(file, options); + } else if (lstats.isSymbolicLink()) { + handleSymbolicLink(file, options); + } else if (lstats.isFIFO()) { + handleFIFO(file); + } + }); // forEach(file) + return ''; +} // rm +module.exports = _rm; + + +/***/ }), + +/***/ 25899: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var common = __nccwpck_require__(53687); +var fs = __nccwpck_require__(57147); + +common.register('sed', _sed, { + globStart: 3, // don't glob-expand regexes + canReceivePipe: true, + cmdOptions: { + 'i': 'inplace', + }, +}); + +//@ +//@ ### sed([options,] search_regex, replacement, file [, file ...]) +//@ ### sed([options,] search_regex, replacement, file_array) +//@ +//@ Available options: +//@ +//@ + `-i`: Replace contents of `file` in-place. _Note that no backups will be created!_ +//@ +//@ Examples: +//@ +//@ ```javascript +//@ sed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js'); +//@ sed(/.*DELETE_THIS_LINE.*\n/, '', 'source.js'); +//@ ``` +//@ +//@ Reads an input string from `file`s, and performs a JavaScript `replace()` on the input +//@ using the given `search_regex` and `replacement` string or function. Returns the new string after replacement. +//@ +//@ Note: +//@ +//@ Like unix `sed`, ShellJS `sed` supports capture groups. Capture groups are specified +//@ using the `$n` syntax: +//@ +//@ ```javascript +//@ sed(/(\w+)\s(\w+)/, '$2, $1', 'file.txt'); +//@ ``` +function _sed(options, regex, replacement, files) { + // Check if this is coming from a pipe + var pipe = common.readFromPipe(); + + if (typeof replacement !== 'string' && typeof replacement !== 'function') { + if (typeof replacement === 'number') { + replacement = replacement.toString(); // fallback + } else { + common.error('invalid replacement string'); + } + } + + // Convert all search strings to RegExp + if (typeof regex === 'string') { + regex = RegExp(regex); + } + + if (!files && !pipe) { + common.error('no files given'); + } + + files = [].slice.call(arguments, 3); + + if (pipe) { + files.unshift('-'); + } + + var sed = []; + files.forEach(function (file) { + if (!fs.existsSync(file) && file !== '-') { + common.error('no such file or directory: ' + file, 2, { continue: true }); + return; + } + + var contents = file === '-' ? pipe : fs.readFileSync(file, 'utf8'); + var lines = contents.split('\n'); + var result = lines.map(function (line) { + return line.replace(regex, replacement); + }).join('\n'); + + sed.push(result); + + if (options.inplace) { + fs.writeFileSync(file, result, 'utf8'); + } + }); + + return sed.join('\n'); +} +module.exports = _sed; + + +/***/ }), + +/***/ 11411: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var common = __nccwpck_require__(53687); + +common.register('set', _set, { + allowGlobbing: false, + wrapOutput: false, +}); + +//@ +//@ ### set(options) +//@ +//@ Available options: +//@ +//@ + `+/-e`: exit upon error (`config.fatal`) +//@ + `+/-v`: verbose: show all commands (`config.verbose`) +//@ + `+/-f`: disable filename expansion (globbing) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ set('-e'); // exit upon first error +//@ set('+e'); // this undoes a "set('-e')" +//@ ``` +//@ +//@ Sets global configuration variables. +function _set(options) { + if (!options) { + var args = [].slice.call(arguments, 0); + if (args.length < 2) common.error('must provide an argument'); + options = args[1]; + } + var negate = (options[0] === '+'); + if (negate) { + options = '-' + options.slice(1); // parseOptions needs a '-' prefix + } + options = common.parseOptions(options, { + 'e': 'fatal', + 'v': 'verbose', + 'f': 'noglob', + }); + + if (negate) { + Object.keys(options).forEach(function (key) { + options[key] = !options[key]; + }); + } + + Object.keys(options).forEach(function (key) { + // Only change the global config if `negate` is false and the option is true + // or if `negate` is true and the option is false (aka negate !== option) + if (negate !== options[key]) { + common.config[key] = options[key]; + } + }); + return; +} +module.exports = _set; + + +/***/ }), + +/***/ 72116: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var common = __nccwpck_require__(53687); +var fs = __nccwpck_require__(57147); + +common.register('sort', _sort, { + canReceivePipe: true, + cmdOptions: { + 'r': 'reverse', + 'n': 'numerical', + }, +}); + +// parse out the number prefix of a line +function parseNumber(str) { + var match = str.match(/^\s*(\d*)\s*(.*)$/); + return { num: Number(match[1]), value: match[2] }; +} + +// compare two strings case-insensitively, but examine case for strings that are +// case-insensitive equivalent +function unixCmp(a, b) { + var aLower = a.toLowerCase(); + var bLower = b.toLowerCase(); + return (aLower === bLower ? + -1 * a.localeCompare(b) : // unix sort treats case opposite how javascript does + aLower.localeCompare(bLower)); +} + +// compare two strings in the fashion that unix sort's -n option works +function numericalCmp(a, b) { + var objA = parseNumber(a); + var objB = parseNumber(b); + if (objA.hasOwnProperty('num') && objB.hasOwnProperty('num')) { + return ((objA.num !== objB.num) ? + (objA.num - objB.num) : + unixCmp(objA.value, objB.value)); + } else { + return unixCmp(objA.value, objB.value); + } +} + +//@ +//@ ### sort([options,] file [, file ...]) +//@ ### sort([options,] file_array) +//@ +//@ Available options: +//@ +//@ + `-r`: Reverse the results +//@ + `-n`: Compare according to numerical value +//@ +//@ Examples: +//@ +//@ ```javascript +//@ sort('foo.txt', 'bar.txt'); +//@ sort('-r', 'foo.txt'); +//@ ``` +//@ +//@ Return the contents of the `file`s, sorted line-by-line. Sorting multiple +//@ files mixes their content (just as unix `sort` does). +function _sort(options, files) { + // Check if this is coming from a pipe + var pipe = common.readFromPipe(); + + if (!files && !pipe) common.error('no files given'); + + files = [].slice.call(arguments, 1); + + if (pipe) { + files.unshift('-'); + } + + var lines = files.reduce(function (accum, file) { + if (file !== '-') { + if (!fs.existsSync(file)) { + common.error('no such file or directory: ' + file, { continue: true }); + return accum; + } else if (common.statFollowLinks(file).isDirectory()) { + common.error('read failed: ' + file + ': Is a directory', { + continue: true, + }); + return accum; + } + } + + var contents = file === '-' ? pipe : fs.readFileSync(file, 'utf8'); + return accum.concat(contents.trimRight().split('\n')); + }, []); + + var sorted = lines.sort(options.numerical ? numericalCmp : unixCmp); + + if (options.reverse) { + sorted = sorted.reverse(); + } + + return sorted.join('\n') + '\n'; +} + +module.exports = _sort; + + +/***/ }), + +/***/ 42284: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var common = __nccwpck_require__(53687); +var fs = __nccwpck_require__(57147); + +common.register('tail', _tail, { + canReceivePipe: true, + cmdOptions: { + 'n': 'numLines', + }, +}); + +//@ +//@ ### tail([{'-n': \},] file [, file ...]) +//@ ### tail([{'-n': \},] file_array) +//@ +//@ Available options: +//@ +//@ + `-n `: Show the last `` lines of `file`s +//@ +//@ Examples: +//@ +//@ ```javascript +//@ var str = tail({'-n': 1}, 'file*.txt'); +//@ var str = tail('file1', 'file2'); +//@ var str = tail(['file1', 'file2']); // same as above +//@ ``` +//@ +//@ Read the end of a `file`. +function _tail(options, files) { + var tail = []; + var pipe = common.readFromPipe(); + + if (!files && !pipe) common.error('no paths given'); + + var idx = 1; + if (options.numLines === true) { + idx = 2; + options.numLines = Number(arguments[1]); + } else if (options.numLines === false) { + options.numLines = 10; + } + options.numLines = -1 * Math.abs(options.numLines); + files = [].slice.call(arguments, idx); + + if (pipe) { + files.unshift('-'); + } + + var shouldAppendNewline = false; + files.forEach(function (file) { + if (file !== '-') { + if (!fs.existsSync(file)) { + common.error('no such file or directory: ' + file, { continue: true }); + return; + } else if (common.statFollowLinks(file).isDirectory()) { + common.error("error reading '" + file + "': Is a directory", { + continue: true, + }); + return; + } + } + + var contents = file === '-' ? pipe : fs.readFileSync(file, 'utf8'); + + var lines = contents.split('\n'); + if (lines[lines.length - 1] === '') { + lines.pop(); + shouldAppendNewline = true; + } else { + shouldAppendNewline = false; + } + + tail = tail.concat(lines.slice(options.numLines)); + }); + + if (shouldAppendNewline) { + tail.push(''); // to add a trailing newline once we join + } + return tail.join('\n'); +} +module.exports = _tail; + + +/***/ }), + +/***/ 76150: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var common = __nccwpck_require__(53687); +var os = __nccwpck_require__(22037); +var fs = __nccwpck_require__(57147); + +common.register('tempdir', _tempDir, { + allowGlobbing: false, + wrapOutput: false, +}); + +// Returns false if 'dir' is not a writeable directory, 'dir' otherwise +function writeableDir(dir) { + if (!dir || !fs.existsSync(dir)) return false; + + if (!common.statFollowLinks(dir).isDirectory()) return false; + + var testFile = dir + '/' + common.randomFileName(); + try { + fs.writeFileSync(testFile, ' '); + common.unlinkSync(testFile); + return dir; + } catch (e) { + /* istanbul ignore next */ + return false; + } +} + +// Variable to cache the tempdir value for successive lookups. +var cachedTempDir; + +//@ +//@ ### tempdir() +//@ +//@ Examples: +//@ +//@ ```javascript +//@ var tmp = tempdir(); // "/tmp" for most *nix platforms +//@ ``` +//@ +//@ Searches and returns string containing a writeable, platform-dependent temporary directory. +//@ Follows Python's [tempfile algorithm](http://docs.python.org/library/tempfile.html#tempfile.tempdir). +function _tempDir() { + if (cachedTempDir) return cachedTempDir; + + cachedTempDir = writeableDir(os.tmpdir()) || + writeableDir(process.env.TMPDIR) || + writeableDir(process.env.TEMP) || + writeableDir(process.env.TMP) || + writeableDir(process.env.Wimp$ScrapDir) || // RiscOS + writeableDir('C:\\TEMP') || // Windows + writeableDir('C:\\TMP') || // Windows + writeableDir('\\TEMP') || // Windows + writeableDir('\\TMP') || // Windows + writeableDir('/tmp') || + writeableDir('/var/tmp') || + writeableDir('/usr/tmp') || + writeableDir('.'); // last resort + + return cachedTempDir; +} + +// Indicates if the tempdir value is currently cached. This is exposed for tests +// only. The return value should only be tested for truthiness. +function isCached() { + return cachedTempDir; +} + +// Clears the cached tempDir value, if one is cached. This is exposed for tests +// only. +function clearCache() { + cachedTempDir = undefined; +} + +module.exports.tempDir = _tempDir; +module.exports.isCached = isCached; +module.exports.clearCache = clearCache; + + +/***/ }), + +/***/ 79723: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var common = __nccwpck_require__(53687); +var fs = __nccwpck_require__(57147); + +common.register('test', _test, { + cmdOptions: { + 'b': 'block', + 'c': 'character', + 'd': 'directory', + 'e': 'exists', + 'f': 'file', + 'L': 'link', + 'p': 'pipe', + 'S': 'socket', + }, + wrapOutput: false, + allowGlobbing: false, +}); + + +//@ +//@ ### test(expression) +//@ +//@ Available expression primaries: +//@ +//@ + `'-b', 'path'`: true if path is a block device +//@ + `'-c', 'path'`: true if path is a character device +//@ + `'-d', 'path'`: true if path is a directory +//@ + `'-e', 'path'`: true if path exists +//@ + `'-f', 'path'`: true if path is a regular file +//@ + `'-L', 'path'`: true if path is a symbolic link +//@ + `'-p', 'path'`: true if path is a pipe (FIFO) +//@ + `'-S', 'path'`: true if path is a socket +//@ +//@ Examples: +//@ +//@ ```javascript +//@ if (test('-d', path)) { /* do something with dir */ }; +//@ if (!test('-f', path)) continue; // skip if it's a regular file +//@ ``` +//@ +//@ Evaluates `expression` using the available primaries and returns corresponding value. +function _test(options, path) { + if (!path) common.error('no path given'); + + var canInterpret = false; + Object.keys(options).forEach(function (key) { + if (options[key] === true) { + canInterpret = true; + } + }); + + if (!canInterpret) common.error('could not interpret expression'); + + if (options.link) { + try { + return common.statNoFollowLinks(path).isSymbolicLink(); + } catch (e) { + return false; + } + } + + if (!fs.existsSync(path)) return false; + + if (options.exists) return true; + + var stats = common.statFollowLinks(path); + + if (options.block) return stats.isBlockDevice(); + + if (options.character) return stats.isCharacterDevice(); + + if (options.directory) return stats.isDirectory(); + + if (options.file) return stats.isFile(); + + /* istanbul ignore next */ + if (options.pipe) return stats.isFIFO(); + + /* istanbul ignore next */ + if (options.socket) return stats.isSocket(); + + /* istanbul ignore next */ + return false; // fallback +} // test +module.exports = _test; + + +/***/ }), + +/***/ 71961: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var common = __nccwpck_require__(53687); +var fs = __nccwpck_require__(57147); +var path = __nccwpck_require__(71017); + +common.register('to', _to, { + pipeOnly: true, + wrapOutput: false, +}); + +//@ +//@ ### ShellString.prototype.to(file) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ cat('input.txt').to('output.txt'); +//@ ``` +//@ +//@ Analogous to the redirection operator `>` in Unix, but works with +//@ `ShellStrings` (such as those returned by `cat`, `grep`, etc.). _Like Unix +//@ redirections, `to()` will overwrite any existing file!_ +function _to(options, file) { + if (!file) common.error('wrong arguments'); + + if (!fs.existsSync(path.dirname(file))) { + common.error('no such file or directory: ' + path.dirname(file)); + } + + try { + fs.writeFileSync(file, this.stdout || this.toString(), 'utf8'); + return this; + } catch (e) { + /* istanbul ignore next */ + common.error('could not write to file (code ' + e.code + '): ' + file, { continue: true }); + } +} +module.exports = _to; + + +/***/ }), + +/***/ 33736: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var common = __nccwpck_require__(53687); +var fs = __nccwpck_require__(57147); +var path = __nccwpck_require__(71017); + +common.register('toEnd', _toEnd, { + pipeOnly: true, + wrapOutput: false, +}); + +//@ +//@ ### ShellString.prototype.toEnd(file) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ cat('input.txt').toEnd('output.txt'); +//@ ``` +//@ +//@ Analogous to the redirect-and-append operator `>>` in Unix, but works with +//@ `ShellStrings` (such as those returned by `cat`, `grep`, etc.). +function _toEnd(options, file) { + if (!file) common.error('wrong arguments'); + + if (!fs.existsSync(path.dirname(file))) { + common.error('no such file or directory: ' + path.dirname(file)); + } + + try { + fs.appendFileSync(file, this.stdout || this.toString(), 'utf8'); + return this; + } catch (e) { + /* istanbul ignore next */ + common.error('could not append to file (code ' + e.code + '): ' + file, { continue: true }); + } +} +module.exports = _toEnd; + + +/***/ }), + +/***/ 28358: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var common = __nccwpck_require__(53687); +var fs = __nccwpck_require__(57147); + +common.register('touch', _touch, { + cmdOptions: { + 'a': 'atime_only', + 'c': 'no_create', + 'd': 'date', + 'm': 'mtime_only', + 'r': 'reference', + }, +}); + +//@ +//@ ### touch([options,] file [, file ...]) +//@ ### touch([options,] file_array) +//@ +//@ Available options: +//@ +//@ + `-a`: Change only the access time +//@ + `-c`: Do not create any files +//@ + `-m`: Change only the modification time +//@ + `-d DATE`: Parse `DATE` and use it instead of current time +//@ + `-r FILE`: Use `FILE`'s times instead of current time +//@ +//@ Examples: +//@ +//@ ```javascript +//@ touch('source.js'); +//@ touch('-c', '/path/to/some/dir/source.js'); +//@ touch({ '-r': FILE }, '/path/to/some/dir/source.js'); +//@ ``` +//@ +//@ Update the access and modification times of each `FILE` to the current time. +//@ A `FILE` argument that does not exist is created empty, unless `-c` is supplied. +//@ This is a partial implementation of [`touch(1)`](http://linux.die.net/man/1/touch). +function _touch(opts, files) { + if (!files) { + common.error('no files given'); + } else if (typeof files === 'string') { + files = [].slice.call(arguments, 1); + } else { + common.error('file arg should be a string file path or an Array of string file paths'); + } + + files.forEach(function (f) { + touchFile(opts, f); + }); + return ''; +} + +function touchFile(opts, file) { + var stat = tryStatFile(file); + + if (stat && stat.isDirectory()) { + // don't error just exit + return; + } + + // if the file doesn't already exist and the user has specified --no-create then + // this script is finished + if (!stat && opts.no_create) { + return; + } + + // open the file and then close it. this will create it if it doesn't exist but will + // not truncate the file + fs.closeSync(fs.openSync(file, 'a')); + + // + // Set timestamps + // + + // setup some defaults + var now = new Date(); + var mtime = opts.date || now; + var atime = opts.date || now; + + // use reference file + if (opts.reference) { + var refStat = tryStatFile(opts.reference); + if (!refStat) { + common.error('failed to get attributess of ' + opts.reference); + } + mtime = refStat.mtime; + atime = refStat.atime; + } else if (opts.date) { + mtime = opts.date; + atime = opts.date; + } + + if (opts.atime_only && opts.mtime_only) { + // keep the new values of mtime and atime like GNU + } else if (opts.atime_only) { + mtime = stat.mtime; + } else if (opts.mtime_only) { + atime = stat.atime; + } + + fs.utimesSync(file, atime, mtime); +} + +module.exports = _touch; + +function tryStatFile(filePath) { + try { + return common.statFollowLinks(filePath); + } catch (e) { + return null; + } +} + + +/***/ }), + +/***/ 77286: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var common = __nccwpck_require__(53687); +var fs = __nccwpck_require__(57147); + +// add c spaces to the left of str +function lpad(c, str) { + var res = '' + str; + if (res.length < c) { + res = Array((c - res.length) + 1).join(' ') + res; + } + return res; +} + +common.register('uniq', _uniq, { + canReceivePipe: true, + cmdOptions: { + 'i': 'ignoreCase', + 'c': 'count', + 'd': 'duplicates', + }, +}); + +//@ +//@ ### uniq([options,] [input, [output]]) +//@ +//@ Available options: +//@ +//@ + `-i`: Ignore case while comparing +//@ + `-c`: Prefix lines by the number of occurrences +//@ + `-d`: Only print duplicate lines, one for each group of identical lines +//@ +//@ Examples: +//@ +//@ ```javascript +//@ uniq('foo.txt'); +//@ uniq('-i', 'foo.txt'); +//@ uniq('-cd', 'foo.txt', 'bar.txt'); +//@ ``` +//@ +//@ Filter adjacent matching lines from `input`. +function _uniq(options, input, output) { + // Check if this is coming from a pipe + var pipe = common.readFromPipe(); + + if (!pipe) { + if (!input) common.error('no input given'); + + if (!fs.existsSync(input)) { + common.error(input + ': No such file or directory'); + } else if (common.statFollowLinks(input).isDirectory()) { + common.error("error reading '" + input + "'"); + } + } + if (output && fs.existsSync(output) && common.statFollowLinks(output).isDirectory()) { + common.error(output + ': Is a directory'); + } + + var lines = (input ? fs.readFileSync(input, 'utf8') : pipe). + trimRight(). + split('\n'); + + var compare = function (a, b) { + return options.ignoreCase ? + a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase()) : + a.localeCompare(b); + }; + var uniqed = lines.reduceRight(function (res, e) { + // Perform uniq -c on the input + if (res.length === 0) { + return [{ count: 1, ln: e }]; + } else if (compare(res[0].ln, e) === 0) { + return [{ count: res[0].count + 1, ln: e }].concat(res.slice(1)); + } else { + return [{ count: 1, ln: e }].concat(res); + } + }, []).filter(function (obj) { + // Do we want only duplicated objects? + return options.duplicates ? obj.count > 1 : true; + }).map(function (obj) { + // Are we tracking the counts of each line? + return (options.count ? (lpad(7, obj.count) + ' ') : '') + obj.ln; + }).join('\n') + '\n'; + + if (output) { + (new common.ShellString(uniqed)).to(output); + // if uniq writes to output, nothing is passed to the next command in the pipeline (if any) + return ''; + } else { + return uniqed; + } +} + +module.exports = _uniq; + + +/***/ }), + +/***/ 64766: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var common = __nccwpck_require__(53687); +var fs = __nccwpck_require__(57147); +var path = __nccwpck_require__(71017); + +common.register('which', _which, { + allowGlobbing: false, + cmdOptions: { + 'a': 'all', + }, +}); + +// XP's system default value for `PATHEXT` system variable, just in case it's not +// set on Windows. +var XP_DEFAULT_PATHEXT = '.com;.exe;.bat;.cmd;.vbs;.vbe;.js;.jse;.wsf;.wsh'; + +// For earlier versions of NodeJS that doesn't have a list of constants (< v6) +var FILE_EXECUTABLE_MODE = 1; + +function isWindowsPlatform() { + return process.platform === 'win32'; +} + +// Cross-platform method for splitting environment `PATH` variables +function splitPath(p) { + return p ? p.split(path.delimiter) : []; +} + +// Tests are running all cases for this func but it stays uncovered by codecov due to unknown reason +/* istanbul ignore next */ +function isExecutable(pathName) { + try { + // TODO(node-support): replace with fs.constants.X_OK once remove support for node < v6 + fs.accessSync(pathName, FILE_EXECUTABLE_MODE); + } catch (err) { + return false; + } + return true; +} + +function checkPath(pathName) { + return fs.existsSync(pathName) && !common.statFollowLinks(pathName).isDirectory() + && (isWindowsPlatform() || isExecutable(pathName)); +} + +//@ +//@ ### which(command) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ var nodeExec = which('node'); +//@ ``` +//@ +//@ Searches for `command` in the system's `PATH`. On Windows, this uses the +//@ `PATHEXT` variable to append the extension if it's not already executable. +//@ Returns string containing the absolute path to `command`. +function _which(options, cmd) { + if (!cmd) common.error('must specify command'); + + var isWindows = isWindowsPlatform(); + var pathArray = splitPath(process.env.PATH); + + var queryMatches = []; + + // No relative/absolute paths provided? + if (cmd.indexOf('/') === -1) { + // Assume that there are no extensions to append to queries (this is the + // case for unix) + var pathExtArray = ['']; + if (isWindows) { + // In case the PATHEXT variable is somehow not set (e.g. + // child_process.spawn with an empty environment), use the XP default. + var pathExtEnv = process.env.PATHEXT || XP_DEFAULT_PATHEXT; + pathExtArray = splitPath(pathExtEnv.toUpperCase()); + } + + // Search for command in PATH + for (var k = 0; k < pathArray.length; k++) { + // already found it + if (queryMatches.length > 0 && !options.all) break; + + var attempt = path.resolve(pathArray[k], cmd); + + if (isWindows) { + attempt = attempt.toUpperCase(); + } + + var match = attempt.match(/\.[^<>:"/\|?*.]+$/); + if (match && pathExtArray.indexOf(match[0]) >= 0) { // this is Windows-only + // The user typed a query with the file extension, like + // `which('node.exe')` + if (checkPath(attempt)) { + queryMatches.push(attempt); + break; + } + } else { // All-platforms + // Cycle through the PATHEXT array, and check each extension + // Note: the array is always [''] on Unix + for (var i = 0; i < pathExtArray.length; i++) { + var ext = pathExtArray[i]; + var newAttempt = attempt + ext; + if (checkPath(newAttempt)) { + queryMatches.push(newAttempt); + break; + } + } + } + } + } else if (checkPath(cmd)) { // a valid absolute or relative path + queryMatches.push(path.resolve(cmd)); + } + + if (queryMatches.length > 0) { + return options.all ? queryMatches : queryMatches[0]; + } + return options.all ? [] : null; +} +module.exports = _which; + + +/***/ }), + +/***/ 9249: +/***/ ((module, exports, __nccwpck_require__) => { + +/* module decorator */ module = __nccwpck_require__.nmd(module); +var SourceMapConsumer = (__nccwpck_require__(56594).SourceMapConsumer); +var path = __nccwpck_require__(71017); + +var fs; +try { + fs = __nccwpck_require__(57147); + if (!fs.existsSync || !fs.readFileSync) { + // fs doesn't have all methods we need + fs = null; + } +} catch (err) { + /* nop */ +} + +var bufferFrom = __nccwpck_require__(93018); + +/** + * Requires a module which is protected against bundler minification. + * + * @param {NodeModule} mod + * @param {string} request + */ +function dynamicRequire(mod, request) { + return mod.require(request); +} + +// Only install once if called multiple times +var errorFormatterInstalled = false; +var uncaughtShimInstalled = false; + +// If true, the caches are reset before a stack trace formatting operation +var emptyCacheBetweenOperations = false; + +// Supports {browser, node, auto} +var environment = "auto"; + +// Maps a file path to a string containing the file contents +var fileContentsCache = {}; + +// Maps a file path to a source map for that file +var sourceMapCache = {}; + +// Regex for detecting source maps +var reSourceMap = /^data:application\/json[^,]+base64,/; + +// Priority list of retrieve handlers +var retrieveFileHandlers = []; +var retrieveMapHandlers = []; + +function isInBrowser() { + if (environment === "browser") + return true; + if (environment === "node") + return false; + return ((typeof window !== 'undefined') && (typeof XMLHttpRequest === 'function') && !(window.require && window.module && window.process && window.process.type === "renderer")); +} + +function hasGlobalProcessEventEmitter() { + return ((typeof process === 'object') && (process !== null) && (typeof process.on === 'function')); +} + +function globalProcessVersion() { + if ((typeof process === 'object') && (process !== null)) { + return process.version; + } else { + return ''; + } +} + +function globalProcessStderr() { + if ((typeof process === 'object') && (process !== null)) { + return process.stderr; + } +} + +function globalProcessExit(code) { + if ((typeof process === 'object') && (process !== null) && (typeof process.exit === 'function')) { + return process.exit(code); + } +} + +function handlerExec(list) { + return function(arg) { + for (var i = 0; i < list.length; i++) { + var ret = list[i](arg); + if (ret) { + return ret; + } + } + return null; + }; +} + +var retrieveFile = handlerExec(retrieveFileHandlers); + +retrieveFileHandlers.push(function(path) { + // Trim the path to make sure there is no extra whitespace. + path = path.trim(); + if (/^file:/.test(path)) { + // existsSync/readFileSync can't handle file protocol, but once stripped, it works + path = path.replace(/file:\/\/\/(\w:)?/, function(protocol, drive) { + return drive ? + '' : // file:///C:/dir/file -> C:/dir/file + '/'; // file:///root-dir/file -> /root-dir/file + }); + } + if (path in fileContentsCache) { + return fileContentsCache[path]; + } + + var contents = ''; + try { + if (!fs) { + // Use SJAX if we are in the browser + var xhr = new XMLHttpRequest(); + xhr.open('GET', path, /** async */ false); + xhr.send(null); + if (xhr.readyState === 4 && xhr.status === 200) { + contents = xhr.responseText; + } + } else if (fs.existsSync(path)) { + // Otherwise, use the filesystem + contents = fs.readFileSync(path, 'utf8'); + } + } catch (er) { + /* ignore any errors */ + } + + return fileContentsCache[path] = contents; +}); + +// Support URLs relative to a directory, but be careful about a protocol prefix +// in case we are in the browser (i.e. directories may start with "http://" or "file:///") +function supportRelativeURL(file, url) { + if (!file) return url; + var dir = path.dirname(file); + var match = /^\w+:\/\/[^\/]*/.exec(dir); + var protocol = match ? match[0] : ''; + var startPath = dir.slice(protocol.length); + if (protocol && /^\/\w\:/.test(startPath)) { + // handle file:///C:/ paths + protocol += '/'; + return protocol + path.resolve(dir.slice(protocol.length), url).replace(/\\/g, '/'); + } + return protocol + path.resolve(dir.slice(protocol.length), url); +} + +function retrieveSourceMapURL(source) { + var fileData; + + if (isInBrowser()) { + try { + var xhr = new XMLHttpRequest(); + xhr.open('GET', source, false); + xhr.send(null); + fileData = xhr.readyState === 4 ? xhr.responseText : null; + + // Support providing a sourceMappingURL via the SourceMap header + var sourceMapHeader = xhr.getResponseHeader("SourceMap") || + xhr.getResponseHeader("X-SourceMap"); + if (sourceMapHeader) { + return sourceMapHeader; + } + } catch (e) { + } + } + + // Get the URL of the source map + fileData = retrieveFile(source); + var re = /(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg; + // Keep executing the search to find the *last* sourceMappingURL to avoid + // picking up sourceMappingURLs from comments, strings, etc. + var lastMatch, match; + while (match = re.exec(fileData)) lastMatch = match; + if (!lastMatch) return null; + return lastMatch[1]; +}; + +// Can be overridden by the retrieveSourceMap option to install. Takes a +// generated source filename; returns a {map, optional url} object, or null if +// there is no source map. The map field may be either a string or the parsed +// JSON object (ie, it must be a valid argument to the SourceMapConsumer +// constructor). +var retrieveSourceMap = handlerExec(retrieveMapHandlers); +retrieveMapHandlers.push(function(source) { + var sourceMappingURL = retrieveSourceMapURL(source); + if (!sourceMappingURL) return null; + + // Read the contents of the source map + var sourceMapData; + if (reSourceMap.test(sourceMappingURL)) { + // Support source map URL as a data url + var rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(',') + 1); + sourceMapData = bufferFrom(rawData, "base64").toString(); + sourceMappingURL = source; + } else { + // Support source map URLs relative to the source URL + sourceMappingURL = supportRelativeURL(source, sourceMappingURL); + sourceMapData = retrieveFile(sourceMappingURL); + } + + if (!sourceMapData) { + return null; + } + + return { + url: sourceMappingURL, + map: sourceMapData + }; +}); + +function mapSourcePosition(position) { + var sourceMap = sourceMapCache[position.source]; + if (!sourceMap) { + // Call the (overrideable) retrieveSourceMap function to get the source map. + var urlAndMap = retrieveSourceMap(position.source); + if (urlAndMap) { + sourceMap = sourceMapCache[position.source] = { + url: urlAndMap.url, + map: new SourceMapConsumer(urlAndMap.map) + }; + + // Load all sources stored inline with the source map into the file cache + // to pretend like they are already loaded. They may not exist on disk. + if (sourceMap.map.sourcesContent) { + sourceMap.map.sources.forEach(function(source, i) { + var contents = sourceMap.map.sourcesContent[i]; + if (contents) { + var url = supportRelativeURL(sourceMap.url, source); + fileContentsCache[url] = contents; + } + }); + } + } else { + sourceMap = sourceMapCache[position.source] = { + url: null, + map: null + }; + } + } + + // Resolve the source URL relative to the URL of the source map + if (sourceMap && sourceMap.map && typeof sourceMap.map.originalPositionFor === 'function') { + var originalPosition = sourceMap.map.originalPositionFor(position); + + // Only return the original position if a matching line was found. If no + // matching line is found then we return position instead, which will cause + // the stack trace to print the path and line for the compiled file. It is + // better to give a precise location in the compiled file than a vague + // location in the original file. + if (originalPosition.source !== null) { + originalPosition.source = supportRelativeURL( + sourceMap.url, originalPosition.source); + return originalPosition; + } + } + + return position; +} + +// Parses code generated by FormatEvalOrigin(), a function inside V8: +// https://code.google.com/p/v8/source/browse/trunk/src/messages.js +function mapEvalOrigin(origin) { + // Most eval() calls are in this format + var match = /^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(origin); + if (match) { + var position = mapSourcePosition({ + source: match[2], + line: +match[3], + column: match[4] - 1 + }); + return 'eval at ' + match[1] + ' (' + position.source + ':' + + position.line + ':' + (position.column + 1) + ')'; + } + + // Parse nested eval() calls using recursion + match = /^eval at ([^(]+) \((.+)\)$/.exec(origin); + if (match) { + return 'eval at ' + match[1] + ' (' + mapEvalOrigin(match[2]) + ')'; + } + + // Make sure we still return useful information if we didn't find anything + return origin; +} + +// This is copied almost verbatim from the V8 source code at +// https://code.google.com/p/v8/source/browse/trunk/src/messages.js. The +// implementation of wrapCallSite() used to just forward to the actual source +// code of CallSite.prototype.toString but unfortunately a new release of V8 +// did something to the prototype chain and broke the shim. The only fix I +// could find was copy/paste. +function CallSiteToString() { + var fileName; + var fileLocation = ""; + if (this.isNative()) { + fileLocation = "native"; + } else { + fileName = this.getScriptNameOrSourceURL(); + if (!fileName && this.isEval()) { + fileLocation = this.getEvalOrigin(); + fileLocation += ", "; // Expecting source position to follow. + } + + if (fileName) { + fileLocation += fileName; + } else { + // Source code does not originate from a file and is not native, but we + // can still get the source position inside the source string, e.g. in + // an eval string. + fileLocation += ""; + } + var lineNumber = this.getLineNumber(); + if (lineNumber != null) { + fileLocation += ":" + lineNumber; + var columnNumber = this.getColumnNumber(); + if (columnNumber) { + fileLocation += ":" + columnNumber; + } + } + } + + var line = ""; + var functionName = this.getFunctionName(); + var addSuffix = true; + var isConstructor = this.isConstructor(); + var isMethodCall = !(this.isToplevel() || isConstructor); + if (isMethodCall) { + var typeName = this.getTypeName(); + // Fixes shim to be backward compatable with Node v0 to v4 + if (typeName === "[object Object]") { + typeName = "null"; + } + var methodName = this.getMethodName(); + if (functionName) { + if (typeName && functionName.indexOf(typeName) != 0) { + line += typeName + "."; + } + line += functionName; + if (methodName && functionName.indexOf("." + methodName) != functionName.length - methodName.length - 1) { + line += " [as " + methodName + "]"; + } + } else { + line += typeName + "." + (methodName || ""); + } + } else if (isConstructor) { + line += "new " + (functionName || ""); + } else if (functionName) { + line += functionName; + } else { + line += fileLocation; + addSuffix = false; + } + if (addSuffix) { + line += " (" + fileLocation + ")"; + } + return line; +} + +function cloneCallSite(frame) { + var object = {}; + Object.getOwnPropertyNames(Object.getPrototypeOf(frame)).forEach(function(name) { + object[name] = /^(?:is|get)/.test(name) ? function() { return frame[name].call(frame); } : frame[name]; + }); + object.toString = CallSiteToString; + return object; +} + +function wrapCallSite(frame, state) { + // provides interface backward compatibility + if (state === undefined) { + state = { nextPosition: null, curPosition: null } + } + if(frame.isNative()) { + state.curPosition = null; + return frame; + } + + // Most call sites will return the source file from getFileName(), but code + // passed to eval() ending in "//# sourceURL=..." will return the source file + // from getScriptNameOrSourceURL() instead + var source = frame.getFileName() || frame.getScriptNameOrSourceURL(); + if (source) { + var line = frame.getLineNumber(); + var column = frame.getColumnNumber() - 1; + + // Fix position in Node where some (internal) code is prepended. + // See https://github.com/evanw/node-source-map-support/issues/36 + // Header removed in node at ^10.16 || >=11.11.0 + // v11 is not an LTS candidate, we can just test the one version with it. + // Test node versions for: 10.16-19, 10.20+, 12-19, 20-99, 100+, or 11.11 + var noHeader = /^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/; + var headerLength = noHeader.test(globalProcessVersion()) ? 0 : 62; + if (line === 1 && column > headerLength && !isInBrowser() && !frame.isEval()) { + column -= headerLength; + } + + var position = mapSourcePosition({ + source: source, + line: line, + column: column + }); + state.curPosition = position; + frame = cloneCallSite(frame); + var originalFunctionName = frame.getFunctionName; + frame.getFunctionName = function() { + if (state.nextPosition == null) { + return originalFunctionName(); + } + return state.nextPosition.name || originalFunctionName(); + }; + frame.getFileName = function() { return position.source; }; + frame.getLineNumber = function() { return position.line; }; + frame.getColumnNumber = function() { return position.column + 1; }; + frame.getScriptNameOrSourceURL = function() { return position.source; }; + return frame; + } + + // Code called using eval() needs special handling + var origin = frame.isEval() && frame.getEvalOrigin(); + if (origin) { + origin = mapEvalOrigin(origin); + frame = cloneCallSite(frame); + frame.getEvalOrigin = function() { return origin; }; + return frame; + } + + // If we get here then we were unable to change the source position + return frame; +} + +// This function is part of the V8 stack trace API, for more info see: +// https://v8.dev/docs/stack-trace-api +function prepareStackTrace(error, stack) { + if (emptyCacheBetweenOperations) { + fileContentsCache = {}; + sourceMapCache = {}; + } + + var name = error.name || 'Error'; + var message = error.message || ''; + var errorString = name + ": " + message; + + var state = { nextPosition: null, curPosition: null }; + var processedStack = []; + for (var i = stack.length - 1; i >= 0; i--) { + processedStack.push('\n at ' + wrapCallSite(stack[i], state)); + state.nextPosition = state.curPosition; + } + state.curPosition = state.nextPosition = null; + return errorString + processedStack.reverse().join(''); +} + +// Generate position and snippet of original source with pointer +function getErrorSource(error) { + var match = /\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(error.stack); + if (match) { + var source = match[1]; + var line = +match[2]; + var column = +match[3]; + + // Support the inline sourceContents inside the source map + var contents = fileContentsCache[source]; + + // Support files on disk + if (!contents && fs && fs.existsSync(source)) { + try { + contents = fs.readFileSync(source, 'utf8'); + } catch (er) { + contents = ''; + } + } + + // Format the line from the original source code like node does + if (contents) { + var code = contents.split(/(?:\r\n|\r|\n)/)[line - 1]; + if (code) { + return source + ':' + line + '\n' + code + '\n' + + new Array(column).join(' ') + '^'; + } + } + } + return null; +} + +function printErrorAndExit (error) { + var source = getErrorSource(error); + + // Ensure error is printed synchronously and not truncated + var stderr = globalProcessStderr(); + if (stderr && stderr._handle && stderr._handle.setBlocking) { + stderr._handle.setBlocking(true); + } + + if (source) { + console.error(); + console.error(source); + } + + console.error(error.stack); + globalProcessExit(1); +} + +function shimEmitUncaughtException () { + var origEmit = process.emit; + + process.emit = function (type) { + if (type === 'uncaughtException') { + var hasStack = (arguments[1] && arguments[1].stack); + var hasListeners = (this.listeners(type).length > 0); + + if (hasStack && !hasListeners) { + return printErrorAndExit(arguments[1]); + } + } + + return origEmit.apply(this, arguments); + }; +} + +var originalRetrieveFileHandlers = retrieveFileHandlers.slice(0); +var originalRetrieveMapHandlers = retrieveMapHandlers.slice(0); + +exports.wrapCallSite = wrapCallSite; +exports.getErrorSource = getErrorSource; +exports.mapSourcePosition = mapSourcePosition; +exports.retrieveSourceMap = retrieveSourceMap; + +exports.install = function(options) { + options = options || {}; + + if (options.environment) { + environment = options.environment; + if (["node", "browser", "auto"].indexOf(environment) === -1) { + throw new Error("environment " + environment + " was unknown. Available options are {auto, browser, node}") + } + } + + // Allow sources to be found by methods other than reading the files + // directly from disk. + if (options.retrieveFile) { + if (options.overrideRetrieveFile) { + retrieveFileHandlers.length = 0; + } + + retrieveFileHandlers.unshift(options.retrieveFile); + } + + // Allow source maps to be found by methods other than reading the files + // directly from disk. + if (options.retrieveSourceMap) { + if (options.overrideRetrieveSourceMap) { + retrieveMapHandlers.length = 0; + } + + retrieveMapHandlers.unshift(options.retrieveSourceMap); + } + + // Support runtime transpilers that include inline source maps + if (options.hookRequire && !isInBrowser()) { + // Use dynamicRequire to avoid including in browser bundles + var Module = dynamicRequire(module, 'module'); + var $compile = Module.prototype._compile; + + if (!$compile.__sourceMapSupport) { + Module.prototype._compile = function(content, filename) { + fileContentsCache[filename] = content; + sourceMapCache[filename] = undefined; + return $compile.call(this, content, filename); + }; + + Module.prototype._compile.__sourceMapSupport = true; + } + } + + // Configure options + if (!emptyCacheBetweenOperations) { + emptyCacheBetweenOperations = 'emptyCacheBetweenOperations' in options ? + options.emptyCacheBetweenOperations : false; + } + + // Install the error reformatter + if (!errorFormatterInstalled) { + errorFormatterInstalled = true; + Error.prepareStackTrace = prepareStackTrace; + } + + if (!uncaughtShimInstalled) { + var installHandler = 'handleUncaughtExceptions' in options ? + options.handleUncaughtExceptions : true; + + // Do not override 'uncaughtException' with our own handler in Node.js + // Worker threads. Workers pass the error to the main thread as an event, + // rather than printing something to stderr and exiting. + try { + // We need to use `dynamicRequire` because `require` on it's own will be optimized by WebPack/Browserify. + var worker_threads = dynamicRequire(module, 'worker_threads'); + if (worker_threads.isMainThread === false) { + installHandler = false; + } + } catch(e) {} + + // Provide the option to not install the uncaught exception handler. This is + // to support other uncaught exception handlers (in test frameworks, for + // example). If this handler is not installed and there are no other uncaught + // exception handlers, uncaught exceptions will be caught by node's built-in + // exception handler and the process will still be terminated. However, the + // generated JavaScript code will be shown above the stack trace instead of + // the original source code. + if (installHandler && hasGlobalProcessEventEmitter()) { + uncaughtShimInstalled = true; + shimEmitUncaughtException(); + } + } +}; + +exports.resetRetrieveHandlers = function() { + retrieveFileHandlers.length = 0; + retrieveMapHandlers.length = 0; + + retrieveFileHandlers = originalRetrieveFileHandlers.slice(0); + retrieveMapHandlers = originalRetrieveMapHandlers.slice(0); + + retrieveSourceMap = handlerExec(retrieveMapHandlers); + retrieveFile = handlerExec(retrieveFileHandlers); +} + + +/***/ }), + +/***/ 26375: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var util = __nccwpck_require__(12344); +var has = Object.prototype.hasOwnProperty; +var hasNativeMap = typeof Map !== "undefined"; + +/** + * A data structure which is a combination of an array and a set. Adding a new + * member is O(1), testing for membership is O(1), and finding the index of an + * element is O(1). Removing elements from the set is not supported. Only + * strings are supported for membership. + */ +function ArraySet() { + this._array = []; + this._set = hasNativeMap ? new Map() : Object.create(null); +} + +/** + * Static method for creating ArraySet instances from an existing array. + */ +ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { + var set = new ArraySet(); + for (var i = 0, len = aArray.length; i < len; i++) { + set.add(aArray[i], aAllowDuplicates); + } + return set; +}; + +/** + * Return how many unique items are in this ArraySet. If duplicates have been + * added, than those do not count towards the size. + * + * @returns Number + */ +ArraySet.prototype.size = function ArraySet_size() { + return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; +}; + +/** + * Add the given string to this set. + * + * @param String aStr + */ +ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { + var sStr = hasNativeMap ? aStr : util.toSetString(aStr); + var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); + var idx = this._array.length; + if (!isDuplicate || aAllowDuplicates) { + this._array.push(aStr); + } + if (!isDuplicate) { + if (hasNativeMap) { + this._set.set(aStr, idx); + } else { + this._set[sStr] = idx; + } + } +}; + +/** + * Is the given string a member of this set? + * + * @param String aStr + */ +ArraySet.prototype.has = function ArraySet_has(aStr) { + if (hasNativeMap) { + return this._set.has(aStr); + } else { + var sStr = util.toSetString(aStr); + return has.call(this._set, sStr); + } +}; + +/** + * What is the index of the given string in the array? + * + * @param String aStr + */ +ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { + if (hasNativeMap) { + var idx = this._set.get(aStr); + if (idx >= 0) { + return idx; + } + } else { + var sStr = util.toSetString(aStr); + if (has.call(this._set, sStr)) { + return this._set[sStr]; + } + } + + throw new Error('"' + aStr + '" is not in the set.'); +}; + +/** + * What is the element at the given index? + * + * @param Number aIdx + */ +ArraySet.prototype.at = function ArraySet_at(aIdx) { + if (aIdx >= 0 && aIdx < this._array.length) { + return this._array[aIdx]; + } + throw new Error('No element indexed by ' + aIdx); +}; + +/** + * Returns the array representation of this set (which has the proper indices + * indicated by indexOf). Note that this is a copy of the internal array used + * for storing the members so that no one can mess with internal state. + */ +ArraySet.prototype.toArray = function ArraySet_toArray() { + return this._array.slice(); +}; + +exports.I = ArraySet; + + +/***/ }), + +/***/ 10975: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + * + * Based on the Base 64 VLQ implementation in Closure Compiler: + * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java + * + * Copyright 2011 The Closure Compiler Authors. All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +var base64 = __nccwpck_require__(6156); + +// A single base 64 digit can contain 6 bits of data. For the base 64 variable +// length quantities we use in the source map spec, the first bit is the sign, +// the next four bits are the actual value, and the 6th bit is the +// continuation bit. The continuation bit tells us whether there are more +// digits in this value following this digit. +// +// Continuation +// | Sign +// | | +// V V +// 101011 + +var VLQ_BASE_SHIFT = 5; + +// binary: 100000 +var VLQ_BASE = 1 << VLQ_BASE_SHIFT; + +// binary: 011111 +var VLQ_BASE_MASK = VLQ_BASE - 1; + +// binary: 100000 +var VLQ_CONTINUATION_BIT = VLQ_BASE; + +/** + * Converts from a two-complement value to a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) + * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) + */ +function toVLQSigned(aValue) { + return aValue < 0 + ? ((-aValue) << 1) + 1 + : (aValue << 1) + 0; +} + +/** + * Converts to a two-complement value from a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 + * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 + */ +function fromVLQSigned(aValue) { + var isNegative = (aValue & 1) === 1; + var shifted = aValue >> 1; + return isNegative + ? -shifted + : shifted; +} + +/** + * Returns the base 64 VLQ encoded value. + */ +exports.encode = function base64VLQ_encode(aValue) { + var encoded = ""; + var digit; + + var vlq = toVLQSigned(aValue); + + do { + digit = vlq & VLQ_BASE_MASK; + vlq >>>= VLQ_BASE_SHIFT; + if (vlq > 0) { + // There are still more digits in this value, so we must make sure the + // continuation bit is marked. + digit |= VLQ_CONTINUATION_BIT; + } + encoded += base64.encode(digit); + } while (vlq > 0); + + return encoded; +}; + +/** + * Decodes the next base 64 VLQ value from the given string and returns the + * value and the rest of the string via the out parameter. + */ +exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { + var strLen = aStr.length; + var result = 0; + var shift = 0; + var continuation, digit; + + do { + if (aIndex >= strLen) { + throw new Error("Expected more digits in base 64 VLQ value."); + } + + digit = base64.decode(aStr.charCodeAt(aIndex++)); + if (digit === -1) { + throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); + } + + continuation = !!(digit & VLQ_CONTINUATION_BIT); + digit &= VLQ_BASE_MASK; + result = result + (digit << shift); + shift += VLQ_BASE_SHIFT; + } while (continuation); + + aOutParam.value = fromVLQSigned(result); + aOutParam.rest = aIndex; +}; + + +/***/ }), + +/***/ 6156: +/***/ ((__unused_webpack_module, exports) => { + +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); + +/** + * Encode an integer in the range of 0 to 63 to a single base 64 digit. + */ +exports.encode = function (number) { + if (0 <= number && number < intToCharMap.length) { + return intToCharMap[number]; + } + throw new TypeError("Must be between 0 and 63: " + number); +}; + +/** + * Decode a single base 64 character code digit to an integer. Returns -1 on + * failure. + */ +exports.decode = function (charCode) { + var bigA = 65; // 'A' + var bigZ = 90; // 'Z' + + var littleA = 97; // 'a' + var littleZ = 122; // 'z' + + var zero = 48; // '0' + var nine = 57; // '9' + + var plus = 43; // '+' + var slash = 47; // '/' + + var littleOffset = 26; + var numberOffset = 52; + + // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ + if (bigA <= charCode && charCode <= bigZ) { + return (charCode - bigA); + } + + // 26 - 51: abcdefghijklmnopqrstuvwxyz + if (littleA <= charCode && charCode <= littleZ) { + return (charCode - littleA + littleOffset); + } + + // 52 - 61: 0123456789 + if (zero <= charCode && charCode <= nine) { + return (charCode - zero + numberOffset); + } + + // 62: + + if (charCode == plus) { + return 62; + } + + // 63: / + if (charCode == slash) { + return 63; + } + + // Invalid base64 digit. + return -1; +}; + + +/***/ }), + +/***/ 33600: +/***/ ((__unused_webpack_module, exports) => { + +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +exports.GREATEST_LOWER_BOUND = 1; +exports.LEAST_UPPER_BOUND = 2; + +/** + * Recursive implementation of binary search. + * + * @param aLow Indices here and lower do not contain the needle. + * @param aHigh Indices here and higher do not contain the needle. + * @param aNeedle The element being searched for. + * @param aHaystack The non-empty array being searched. + * @param aCompare Function which takes two elements and returns -1, 0, or 1. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + */ +function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { + // This function terminates when one of the following is true: + // + // 1. We find the exact element we are looking for. + // + // 2. We did not find the exact element, but we can return the index of + // the next-closest element. + // + // 3. We did not find the exact element, and there is no next-closest + // element than the one we are searching for, so we return -1. + var mid = Math.floor((aHigh - aLow) / 2) + aLow; + var cmp = aCompare(aNeedle, aHaystack[mid], true); + if (cmp === 0) { + // Found the element we are looking for. + return mid; + } + else if (cmp > 0) { + // Our needle is greater than aHaystack[mid]. + if (aHigh - mid > 1) { + // The element is in the upper half. + return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); + } + + // The exact needle element was not found in this haystack. Determine if + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return aHigh < aHaystack.length ? aHigh : -1; + } else { + return mid; + } + } + else { + // Our needle is less than aHaystack[mid]. + if (mid - aLow > 1) { + // The element is in the lower half. + return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); + } + + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return mid; + } else { + return aLow < 0 ? -1 : aLow; + } + } +} + +/** + * This is an implementation of binary search which will always try and return + * the index of the closest element if there is no exact hit. This is because + * mappings between original and generated line/col pairs are single points, + * and there is an implicit region between each of them, so a miss just means + * that you aren't on the very start of a region. + * + * @param aNeedle The element you are looking for. + * @param aHaystack The array that is being searched. + * @param aCompare A function which takes the needle and an element in the + * array and returns -1, 0, or 1 depending on whether the needle is less + * than, equal to, or greater than the element, respectively. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. + */ +exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { + if (aHaystack.length === 0) { + return -1; + } + + var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, + aCompare, aBias || exports.GREATEST_LOWER_BOUND); + if (index < 0) { + return -1; + } + + // We have found either the exact element, or the next-closest element than + // the one we are searching for. However, there may be more than one such + // element. Make sure we always return the smallest of these. + while (index - 1 >= 0) { + if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { + break; + } + --index; + } + + return index; +}; + + +/***/ }), + +/***/ 86817: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2014 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var util = __nccwpck_require__(12344); + +/** + * Determine whether mappingB is after mappingA with respect to generated + * position. + */ +function generatedPositionAfter(mappingA, mappingB) { + // Optimized for most common case + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; + return lineB > lineA || lineB == lineA && columnB >= columnA || + util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; +} + +/** + * A data structure to provide a sorted view of accumulated mappings in a + * performance conscious manner. It trades a neglibable overhead in general + * case for a large speedup in case of mappings being added in order. + */ +function MappingList() { + this._array = []; + this._sorted = true; + // Serves as infimum + this._last = {generatedLine: -1, generatedColumn: 0}; +} + +/** + * Iterate through internal items. This method takes the same arguments that + * `Array.prototype.forEach` takes. + * + * NOTE: The order of the mappings is NOT guaranteed. + */ +MappingList.prototype.unsortedForEach = + function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); + }; + +/** + * Add the given source mapping. + * + * @param Object aMapping + */ +MappingList.prototype.add = function MappingList_add(aMapping) { + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + this._array.push(aMapping); + } else { + this._sorted = false; + this._array.push(aMapping); + } +}; + +/** + * Returns the flat, sorted array of mappings. The mappings are sorted by + * generated position. + * + * WARNING: This method returns internal data without copying, for + * performance. The return value must NOT be mutated, and should be treated as + * an immutable borrow. If you want to take ownership, you must make your own + * copy. + */ +MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositionsInflated); + this._sorted = true; + } + return this._array; +}; + +exports.H = MappingList; + + +/***/ }), + +/***/ 73254: +/***/ ((__unused_webpack_module, exports) => { + +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +// It turns out that some (most?) JavaScript engines don't self-host +// `Array.prototype.sort`. This makes sense because C++ will likely remain +// faster than JS when doing raw CPU-intensive sorting. However, when using a +// custom comparator function, calling back and forth between the VM's C++ and +// JIT'd JS is rather slow *and* loses JIT type information, resulting in +// worse generated code for the comparator function than would be optimal. In +// fact, when sorting with a comparator, these costs outweigh the benefits of +// sorting in C++. By using our own JS-implemented Quick Sort (below), we get +// a ~3500ms mean speed-up in `bench/bench.html`. + +/** + * Swap the elements indexed by `x` and `y` in the array `ary`. + * + * @param {Array} ary + * The array. + * @param {Number} x + * The index of the first item. + * @param {Number} y + * The index of the second item. + */ +function swap(ary, x, y) { + var temp = ary[x]; + ary[x] = ary[y]; + ary[y] = temp; +} + +/** + * Returns a random integer within the range `low .. high` inclusive. + * + * @param {Number} low + * The lower bound on the range. + * @param {Number} high + * The upper bound on the range. + */ +function randomIntInRange(low, high) { + return Math.round(low + (Math.random() * (high - low))); +} + +/** + * The Quick Sort algorithm. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + * @param {Number} p + * Start index of the array + * @param {Number} r + * End index of the array + */ +function doQuickSort(ary, comparator, p, r) { + // If our lower bound is less than our upper bound, we (1) partition the + // array into two pieces and (2) recurse on each half. If it is not, this is + // the empty array and our base case. + + if (p < r) { + // (1) Partitioning. + // + // The partitioning chooses a pivot between `p` and `r` and moves all + // elements that are less than or equal to the pivot to the before it, and + // all the elements that are greater than it after it. The effect is that + // once partition is done, the pivot is in the exact place it will be when + // the array is put in sorted order, and it will not need to be moved + // again. This runs in O(n) time. + + // Always choose a random pivot so that an input array which is reverse + // sorted does not cause O(n^2) running time. + var pivotIndex = randomIntInRange(p, r); + var i = p - 1; + + swap(ary, pivotIndex, r); + var pivot = ary[r]; + + // Immediately after `j` is incremented in this loop, the following hold + // true: + // + // * Every element in `ary[p .. i]` is less than or equal to the pivot. + // + // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. + for (var j = p; j < r; j++) { + if (comparator(ary[j], pivot) <= 0) { + i += 1; + swap(ary, i, j); + } + } + + swap(ary, i + 1, j); + var q = i + 1; + + // (2) Recurse on each half. + + doQuickSort(ary, comparator, p, q - 1); + doQuickSort(ary, comparator, q + 1, r); + } +} + +/** + * Sort the given array in-place with the given comparator function. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + */ +exports.U = function (ary, comparator) { + doQuickSort(ary, comparator, 0, ary.length - 1); +}; + + +/***/ }), + +/***/ 75155: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var __webpack_unused_export__; +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var util = __nccwpck_require__(12344); +var binarySearch = __nccwpck_require__(33600); +var ArraySet = (__nccwpck_require__(26375)/* .ArraySet */ .I); +var base64VLQ = __nccwpck_require__(10975); +var quickSort = (__nccwpck_require__(73254)/* .quickSort */ .U); + +function SourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + return sourceMap.sections != null + ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) + : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); +} + +SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { + return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); +} + +/** + * The version of the source mapping spec that we are consuming. + */ +SourceMapConsumer.prototype._version = 3; + +// `__generatedMappings` and `__originalMappings` are arrays that hold the +// parsed mapping coordinates from the source map's "mappings" attribute. They +// are lazily instantiated, accessed via the `_generatedMappings` and +// `_originalMappings` getters respectively, and we only parse the mappings +// and create these arrays once queried for a source location. We jump through +// these hoops because there can be many thousands of mappings, and parsing +// them is expensive, so we only want to do it if we must. +// +// Each object in the arrays is of the form: +// +// { +// generatedLine: The line number in the generated code, +// generatedColumn: The column number in the generated code, +// source: The path to the original source file that generated this +// chunk of code, +// originalLine: The line number in the original source that +// corresponds to this chunk of generated code, +// originalColumn: The column number in the original source that +// corresponds to this chunk of generated code, +// name: The name of the original symbol which generated this chunk of +// code. +// } +// +// All properties except for `generatedLine` and `generatedColumn` can be +// `null`. +// +// `_generatedMappings` is ordered by the generated positions. +// +// `_originalMappings` is ordered by the original positions. + +SourceMapConsumer.prototype.__generatedMappings = null; +Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__generatedMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__generatedMappings; + } +}); + +SourceMapConsumer.prototype.__originalMappings = null; +Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__originalMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__originalMappings; + } +}); + +SourceMapConsumer.prototype._charIsMappingSeparator = + function SourceMapConsumer_charIsMappingSeparator(aStr, index) { + var c = aStr.charAt(index); + return c === ";" || c === ","; + }; + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ +SourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + throw new Error("Subclasses must implement _parseMappings"); + }; + +SourceMapConsumer.GENERATED_ORDER = 1; +SourceMapConsumer.ORIGINAL_ORDER = 2; + +SourceMapConsumer.GREATEST_LOWER_BOUND = 1; +SourceMapConsumer.LEAST_UPPER_BOUND = 2; + +/** + * Iterate over each mapping between an original source/line/column and a + * generated line/column in this source map. + * + * @param Function aCallback + * The function that is called with each mapping. + * @param Object aContext + * Optional. If specified, this object will be the value of `this` every + * time that `aCallback` is called. + * @param aOrder + * Either `SourceMapConsumer.GENERATED_ORDER` or + * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to + * iterate over the mappings sorted by the generated file's line/column + * order or the original's source/line/column order, respectively. Defaults to + * `SourceMapConsumer.GENERATED_ORDER`. + */ +SourceMapConsumer.prototype.eachMapping = + function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { + var context = aContext || null; + var order = aOrder || SourceMapConsumer.GENERATED_ORDER; + + var mappings; + switch (order) { + case SourceMapConsumer.GENERATED_ORDER: + mappings = this._generatedMappings; + break; + case SourceMapConsumer.ORIGINAL_ORDER: + mappings = this._originalMappings; + break; + default: + throw new Error("Unknown order of iteration."); + } + + var sourceRoot = this.sourceRoot; + mappings.map(function (mapping) { + var source = mapping.source === null ? null : this._sources.at(mapping.source); + source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); + return { + source: source, + generatedLine: mapping.generatedLine, + generatedColumn: mapping.generatedColumn, + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: mapping.name === null ? null : this._names.at(mapping.name) + }; + }, this).forEach(aCallback, context); + }; + +/** + * Returns all generated line and column information for the original source, + * line, and column provided. If no column is provided, returns all mappings + * corresponding to a either the line we are searching for or the next + * closest line that has any mappings. Otherwise, returns all mappings + * corresponding to the given line and either the column we are searching for + * or the next closest column that has any offsets. + * + * The only argument is an object with the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number is 1-based. + * - column: Optional. the column number in the original source. + * The column number is 0-based. + * + * and an array of objects is returned, each with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ +SourceMapConsumer.prototype.allGeneratedPositionsFor = + function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + var line = util.getArg(aArgs, 'line'); + + // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping + // returns the index of the closest mapping less than the needle. By + // setting needle.originalColumn to 0, we thus find the last mapping for + // the given line, provided such a mapping exists. + var needle = { + source: util.getArg(aArgs, 'source'), + originalLine: line, + originalColumn: util.getArg(aArgs, 'column', 0) + }; + + needle.source = this._findSourceIndex(needle.source); + if (needle.source < 0) { + return []; + } + + var mappings = []; + + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + binarySearch.LEAST_UPPER_BOUND); + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (aArgs.column === undefined) { + var originalLine = mapping.originalLine; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we found. Since + // mappings are sorted, this is guaranteed to find all mappings for + // the line we found. + while (mapping && mapping.originalLine === originalLine) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } else { + var originalColumn = mapping.originalColumn; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we were searching for. + // Since mappings are sorted, this is guaranteed to find all mappings for + // the line we are searching for. + while (mapping && + mapping.originalLine === line && + mapping.originalColumn == originalColumn) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } + } + + return mappings; + }; + +exports.SourceMapConsumer = SourceMapConsumer; + +/** + * A BasicSourceMapConsumer instance represents a parsed source map which we can + * query for information about the original file positions by giving it a file + * position in the generated source. + * + * The first parameter is the raw source map (either as a JSON string, or + * already parsed to an object). According to the spec, source maps have the + * following attributes: + * + * - version: Which version of the source map spec this map is following. + * - sources: An array of URLs to the original source files. + * - names: An array of identifiers which can be referrenced by individual mappings. + * - sourceRoot: Optional. The URL root from which all sources are relative. + * - sourcesContent: Optional. An array of contents of the original source files. + * - mappings: A string of base64 VLQs which contain the actual mappings. + * - file: Optional. The generated file this source map is associated with. + * + * Here is an example source map, taken from the source map spec[0]: + * + * { + * version : 3, + * file: "out.js", + * sourceRoot : "", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AA,AB;;ABCDE;" + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# + */ +function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sources = util.getArg(sourceMap, 'sources'); + // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which + // requires the array) to play nice here. + var names = util.getArg(sourceMap, 'names', []); + var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); + var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); + var mappings = util.getArg(sourceMap, 'mappings'); + var file = util.getArg(sourceMap, 'file', null); + + // Once again, Sass deviates from the spec and supplies the version as a + // string rather than a number, so we use loose equality checking here. + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + if (sourceRoot) { + sourceRoot = util.normalize(sourceRoot); + } + + sources = sources + .map(String) + // Some source maps produce relative source paths like "./foo.js" instead of + // "foo.js". Normalize these first so that future comparisons will succeed. + // See bugzil.la/1090768. + .map(util.normalize) + // Always ensure that absolute sources are internally stored relative to + // the source root, if the source root is absolute. Not doing this would + // be particularly problematic when the source root is a prefix of the + // source (valid, but why??). See github issue #199 and bugzil.la/1188982. + .map(function (source) { + return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) + ? util.relative(sourceRoot, source) + : source; + }); + + // Pass `true` below to allow duplicate names and sources. While source maps + // are intended to be compressed and deduplicated, the TypeScript compiler + // sometimes generates source maps with duplicates in them. See Github issue + // #72 and bugzil.la/889492. + this._names = ArraySet.fromArray(names.map(String), true); + this._sources = ArraySet.fromArray(sources, true); + + this._absoluteSources = this._sources.toArray().map(function (s) { + return util.computeSourceURL(sourceRoot, s, aSourceMapURL); + }); + + this.sourceRoot = sourceRoot; + this.sourcesContent = sourcesContent; + this._mappings = mappings; + this._sourceMapURL = aSourceMapURL; + this.file = file; +} + +BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); +BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; + +/** + * Utility function to find the index of a source. Returns -1 if not + * found. + */ +BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + if (this._sources.has(relativeSource)) { + return this._sources.indexOf(relativeSource); + } + + // Maybe aSource is an absolute URL as returned by |sources|. In + // this case we can't simply undo the transform. + var i; + for (i = 0; i < this._absoluteSources.length; ++i) { + if (this._absoluteSources[i] == aSource) { + return i; + } + } + + return -1; +}; + +/** + * Create a BasicSourceMapConsumer from a SourceMapGenerator. + * + * @param SourceMapGenerator aSourceMap + * The source map that will be consumed. + * @param String aSourceMapURL + * The URL at which the source map can be found (optional) + * @returns BasicSourceMapConsumer + */ +BasicSourceMapConsumer.fromSourceMap = + function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { + var smc = Object.create(BasicSourceMapConsumer.prototype); + + var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); + var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); + smc.sourceRoot = aSourceMap._sourceRoot; + smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), + smc.sourceRoot); + smc.file = aSourceMap._file; + smc._sourceMapURL = aSourceMapURL; + smc._absoluteSources = smc._sources.toArray().map(function (s) { + return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); + }); + + // Because we are modifying the entries (by converting string sources and + // names to indices into the sources and names ArraySets), we have to make + // a copy of the entry or else bad things happen. Shared mutable state + // strikes again! See github issue #191. + + var generatedMappings = aSourceMap._mappings.toArray().slice(); + var destGeneratedMappings = smc.__generatedMappings = []; + var destOriginalMappings = smc.__originalMappings = []; + + for (var i = 0, length = generatedMappings.length; i < length; i++) { + var srcMapping = generatedMappings[i]; + var destMapping = new Mapping; + destMapping.generatedLine = srcMapping.generatedLine; + destMapping.generatedColumn = srcMapping.generatedColumn; + + if (srcMapping.source) { + destMapping.source = sources.indexOf(srcMapping.source); + destMapping.originalLine = srcMapping.originalLine; + destMapping.originalColumn = srcMapping.originalColumn; + + if (srcMapping.name) { + destMapping.name = names.indexOf(srcMapping.name); + } + + destOriginalMappings.push(destMapping); + } + + destGeneratedMappings.push(destMapping); + } + + quickSort(smc.__originalMappings, util.compareByOriginalPositions); + + return smc; + }; + +/** + * The version of the source mapping spec that we are consuming. + */ +BasicSourceMapConsumer.prototype._version = 3; + +/** + * The list of original sources. + */ +Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { + get: function () { + return this._absoluteSources.slice(); + } +}); + +/** + * Provide the JIT with a nice shape / hidden class. + */ +function Mapping() { + this.generatedLine = 0; + this.generatedColumn = 0; + this.source = null; + this.originalLine = null; + this.originalColumn = null; + this.name = null; +} + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ +BasicSourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + var generatedLine = 1; + var previousGeneratedColumn = 0; + var previousOriginalLine = 0; + var previousOriginalColumn = 0; + var previousSource = 0; + var previousName = 0; + var length = aStr.length; + var index = 0; + var cachedSegments = {}; + var temp = {}; + var originalMappings = []; + var generatedMappings = []; + var mapping, str, segment, end, value; + + while (index < length) { + if (aStr.charAt(index) === ';') { + generatedLine++; + index++; + previousGeneratedColumn = 0; + } + else if (aStr.charAt(index) === ',') { + index++; + } + else { + mapping = new Mapping(); + mapping.generatedLine = generatedLine; + + // Because each offset is encoded relative to the previous one, + // many segments often have the same encoding. We can exploit this + // fact by caching the parsed variable length fields of each segment, + // allowing us to avoid a second parse if we encounter the same + // segment again. + for (end = index; end < length; end++) { + if (this._charIsMappingSeparator(aStr, end)) { + break; + } + } + str = aStr.slice(index, end); + + segment = cachedSegments[str]; + if (segment) { + index += str.length; + } else { + segment = []; + while (index < end) { + base64VLQ.decode(aStr, index, temp); + value = temp.value; + index = temp.rest; + segment.push(value); + } + + if (segment.length === 2) { + throw new Error('Found a source, but no line and column'); + } + + if (segment.length === 3) { + throw new Error('Found a source and line, but no column'); + } + + cachedSegments[str] = segment; + } + + // Generated column. + mapping.generatedColumn = previousGeneratedColumn + segment[0]; + previousGeneratedColumn = mapping.generatedColumn; + + if (segment.length > 1) { + // Original source. + mapping.source = previousSource + segment[1]; + previousSource += segment[1]; + + // Original line. + mapping.originalLine = previousOriginalLine + segment[2]; + previousOriginalLine = mapping.originalLine; + // Lines are stored 0-based + mapping.originalLine += 1; + + // Original column. + mapping.originalColumn = previousOriginalColumn + segment[3]; + previousOriginalColumn = mapping.originalColumn; + + if (segment.length > 4) { + // Original name. + mapping.name = previousName + segment[4]; + previousName += segment[4]; + } + } + + generatedMappings.push(mapping); + if (typeof mapping.originalLine === 'number') { + originalMappings.push(mapping); + } + } + } + + quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); + this.__generatedMappings = generatedMappings; + + quickSort(originalMappings, util.compareByOriginalPositions); + this.__originalMappings = originalMappings; + }; + +/** + * Find the mapping that best matches the hypothetical "needle" mapping that + * we are searching for in the given "haystack" of mappings. + */ +BasicSourceMapConsumer.prototype._findMapping = + function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, + aColumnName, aComparator, aBias) { + // To return the position we are searching for, we must first find the + // mapping for the given position and then return the opposite position it + // points to. Because the mappings are sorted, we can use binary search to + // find the best mapping. + + if (aNeedle[aLineName] <= 0) { + throw new TypeError('Line must be greater than or equal to 1, got ' + + aNeedle[aLineName]); + } + if (aNeedle[aColumnName] < 0) { + throw new TypeError('Column must be greater than or equal to 0, got ' + + aNeedle[aColumnName]); + } + + return binarySearch.search(aNeedle, aMappings, aComparator, aBias); + }; + +/** + * Compute the last column for each generated mapping. The last column is + * inclusive. + */ +BasicSourceMapConsumer.prototype.computeColumnSpans = + function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; + + // Mappings do not contain a field for the last generated columnt. We + // can come up with an optimistic estimate, however, by assuming that + // mappings are contiguous (i.e. given two consecutive mappings, the + // first mapping ends where the second one starts). + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; + } + } + + // The last mapping for each line spans the entire line. + mapping.lastGeneratedColumn = Infinity; + } + }; + +/** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ +BasicSourceMapConsumer.prototype.originalPositionFor = + function SourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._generatedMappings, + "generatedLine", + "generatedColumn", + util.compareByGeneratedPositionsDeflated, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._generatedMappings[index]; + + if (mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, 'source', null); + if (source !== null) { + source = this._sources.at(source); + source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); + } + var name = util.getArg(mapping, 'name', null); + if (name !== null) { + name = this._names.at(name); + } + return { + source: source, + line: util.getArg(mapping, 'originalLine', null), + column: util.getArg(mapping, 'originalColumn', null), + name: name + }; + } + } + + return { + source: null, + line: null, + column: null, + name: null + }; + }; + +/** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ +BasicSourceMapConsumer.prototype.hasContentsOfAllSources = + function BasicSourceMapConsumer_hasContentsOfAllSources() { + if (!this.sourcesContent) { + return false; + } + return this.sourcesContent.length >= this._sources.size() && + !this.sourcesContent.some(function (sc) { return sc == null; }); + }; + +/** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ +BasicSourceMapConsumer.prototype.sourceContentFor = + function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + if (!this.sourcesContent) { + return null; + } + + var index = this._findSourceIndex(aSource); + if (index >= 0) { + return this.sourcesContent[index]; + } + + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + var url; + if (this.sourceRoot != null + && (url = util.urlParse(this.sourceRoot))) { + // XXX: file:// URIs and absolute paths lead to unexpected behavior for + // many users. We can help them out when they expect file:// URIs to + // behave like it would if they were running a local HTTP server. See + // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. + var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); + if (url.scheme == "file" + && this._sources.has(fileUriAbsPath)) { + return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] + } + + if ((!url.path || url.path == "/") + && this._sources.has("/" + relativeSource)) { + return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; + } + } + + // This function is used recursively from + // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we + // don't want to throw if we can't find the source - we just want to + // return null, so we provide a flag to exit gracefully. + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + relativeSource + '" is not in the SourceMap.'); + } + }; + +/** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ +BasicSourceMapConsumer.prototype.generatedPositionFor = + function SourceMapConsumer_generatedPositionFor(aArgs) { + var source = util.getArg(aArgs, 'source'); + source = this._findSourceIndex(source); + if (source < 0) { + return { + line: null, + column: null, + lastColumn: null + }; + } + + var needle = { + source: source, + originalLine: util.getArg(aArgs, 'line'), + originalColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (mapping.source === needle.source) { + return { + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }; + } + } + + return { + line: null, + column: null, + lastColumn: null + }; + }; + +__webpack_unused_export__ = BasicSourceMapConsumer; + +/** + * An IndexedSourceMapConsumer instance represents a parsed source map which + * we can query for information. It differs from BasicSourceMapConsumer in + * that it takes "indexed" source maps (i.e. ones with a "sections" field) as + * input. + * + * The first parameter is a raw source map (either as a JSON string, or already + * parsed to an object). According to the spec for indexed source maps, they + * have the following attributes: + * + * - version: Which version of the source map spec this map is following. + * - file: Optional. The generated file this source map is associated with. + * - sections: A list of section definitions. + * + * Each value under the "sections" field has two fields: + * - offset: The offset into the original specified at which this section + * begins to apply, defined as an object with a "line" and "column" + * field. + * - map: A source map definition. This source map could also be indexed, + * but doesn't have to be. + * + * Instead of the "map" field, it's also possible to have a "url" field + * specifying a URL to retrieve a source map from, but that's currently + * unsupported. + * + * Here's an example source map, taken from the source map spec[0], but + * modified to omit a section which uses the "url" field. + * + * { + * version : 3, + * file: "app.js", + * sections: [{ + * offset: {line:100, column:10}, + * map: { + * version : 3, + * file: "section.js", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AAAA,E;;ABCDE;" + * } + * }], + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt + */ +function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sections = util.getArg(sourceMap, 'sections'); + + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + this._sources = new ArraySet(); + this._names = new ArraySet(); + + var lastOffset = { + line: -1, + column: 0 + }; + this._sections = sections.map(function (s) { + if (s.url) { + // The url field will require support for asynchronicity. + // See https://github.com/mozilla/source-map/issues/16 + throw new Error('Support for url field in sections not implemented.'); + } + var offset = util.getArg(s, 'offset'); + var offsetLine = util.getArg(offset, 'line'); + var offsetColumn = util.getArg(offset, 'column'); + + if (offsetLine < lastOffset.line || + (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { + throw new Error('Section offsets must be ordered and non-overlapping.'); + } + lastOffset = offset; + + return { + generatedOffset: { + // The offset fields are 0-based, but we use 1-based indices when + // encoding/decoding from VLQ. + generatedLine: offsetLine + 1, + generatedColumn: offsetColumn + 1 + }, + consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) + } + }); +} + +IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); +IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; + +/** + * The version of the source mapping spec that we are consuming. + */ +IndexedSourceMapConsumer.prototype._version = 3; + +/** + * The list of original sources. + */ +Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { + get: function () { + var sources = []; + for (var i = 0; i < this._sections.length; i++) { + for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { + sources.push(this._sections[i].consumer.sources[j]); + } + } + return sources; + } +}); + +/** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ +IndexedSourceMapConsumer.prototype.originalPositionFor = + function IndexedSourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + // Find the section containing the generated position we're trying to map + // to an original position. + var sectionIndex = binarySearch.search(needle, this._sections, + function(needle, section) { + var cmp = needle.generatedLine - section.generatedOffset.generatedLine; + if (cmp) { + return cmp; + } + + return (needle.generatedColumn - + section.generatedOffset.generatedColumn); + }); + var section = this._sections[sectionIndex]; + + if (!section) { + return { + source: null, + line: null, + column: null, + name: null + }; + } + + return section.consumer.originalPositionFor({ + line: needle.generatedLine - + (section.generatedOffset.generatedLine - 1), + column: needle.generatedColumn - + (section.generatedOffset.generatedLine === needle.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + bias: aArgs.bias + }); + }; + +/** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ +IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = + function IndexedSourceMapConsumer_hasContentsOfAllSources() { + return this._sections.every(function (s) { + return s.consumer.hasContentsOfAllSources(); + }); + }; + +/** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ +IndexedSourceMapConsumer.prototype.sourceContentFor = + function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + var content = section.consumer.sourceContentFor(aSource, true); + if (content) { + return content; + } + } + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; + +/** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ +IndexedSourceMapConsumer.prototype.generatedPositionFor = + function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + // Only consider this section if the requested source is in the list of + // sources of the consumer. + if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { + continue; + } + var generatedPosition = section.consumer.generatedPositionFor(aArgs); + if (generatedPosition) { + var ret = { + line: generatedPosition.line + + (section.generatedOffset.generatedLine - 1), + column: generatedPosition.column + + (section.generatedOffset.generatedLine === generatedPosition.line + ? section.generatedOffset.generatedColumn - 1 + : 0) + }; + return ret; + } + } + + return { + line: null, + column: null + }; + }; + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ +IndexedSourceMapConsumer.prototype._parseMappings = + function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { + this.__generatedMappings = []; + this.__originalMappings = []; + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + var sectionMappings = section.consumer._generatedMappings; + for (var j = 0; j < sectionMappings.length; j++) { + var mapping = sectionMappings[j]; + + var source = section.consumer._sources.at(mapping.source); + source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); + this._sources.add(source); + source = this._sources.indexOf(source); + + var name = null; + if (mapping.name) { + name = section.consumer._names.at(mapping.name); + this._names.add(name); + name = this._names.indexOf(name); + } + + // The mappings coming from the consumer for the section have + // generated positions relative to the start of the section, so we + // need to offset them to be relative to the start of the concatenated + // generated file. + var adjustedMapping = { + source: source, + generatedLine: mapping.generatedLine + + (section.generatedOffset.generatedLine - 1), + generatedColumn: mapping.generatedColumn + + (section.generatedOffset.generatedLine === mapping.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: name + }; + + this.__generatedMappings.push(adjustedMapping); + if (typeof adjustedMapping.originalLine === 'number') { + this.__originalMappings.push(adjustedMapping); + } + } + } + + quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); + quickSort(this.__originalMappings, util.compareByOriginalPositions); + }; + +__webpack_unused_export__ = IndexedSourceMapConsumer; + + +/***/ }), + +/***/ 69425: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var base64VLQ = __nccwpck_require__(10975); +var util = __nccwpck_require__(12344); +var ArraySet = (__nccwpck_require__(26375)/* .ArraySet */ .I); +var MappingList = (__nccwpck_require__(86817)/* .MappingList */ .H); + +/** + * An instance of the SourceMapGenerator represents a source map which is + * being built incrementally. You may pass an object with the following + * properties: + * + * - file: The filename of the generated source. + * - sourceRoot: A root for all relative URLs in this source map. + */ +function SourceMapGenerator(aArgs) { + if (!aArgs) { + aArgs = {}; + } + this._file = util.getArg(aArgs, 'file', null); + this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); + this._skipValidation = util.getArg(aArgs, 'skipValidation', false); + this._sources = new ArraySet(); + this._names = new ArraySet(); + this._mappings = new MappingList(); + this._sourcesContents = null; +} + +SourceMapGenerator.prototype._version = 3; + +/** + * Creates a new SourceMapGenerator based on a SourceMapConsumer + * + * @param aSourceMapConsumer The SourceMap. + */ +SourceMapGenerator.fromSourceMap = + function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { + var sourceRoot = aSourceMapConsumer.sourceRoot; + var generator = new SourceMapGenerator({ + file: aSourceMapConsumer.file, + sourceRoot: sourceRoot + }); + aSourceMapConsumer.eachMapping(function (mapping) { + var newMapping = { + generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn + } + }; + + if (mapping.source != null) { + newMapping.source = mapping.source; + if (sourceRoot != null) { + newMapping.source = util.relative(sourceRoot, newMapping.source); + } + + newMapping.original = { + line: mapping.originalLine, + column: mapping.originalColumn + }; + + if (mapping.name != null) { + newMapping.name = mapping.name; + } + } + + generator.addMapping(newMapping); + }); + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var sourceRelative = sourceFile; + if (sourceRoot !== null) { + sourceRelative = util.relative(sourceRoot, sourceFile); + } + + if (!generator._sources.has(sourceRelative)) { + generator._sources.add(sourceRelative); + } + + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + generator.setSourceContent(sourceFile, content); + } + }); + return generator; + }; + +/** + * Add a single mapping from original source line and column to the generated + * source's line and column for this source map being created. The mapping + * object should have the following properties: + * + * - generated: An object with the generated line and column positions. + * - original: An object with the original line and column positions. + * - source: The original source file (relative to the sourceRoot). + * - name: An optional original token name for this mapping. + */ +SourceMapGenerator.prototype.addMapping = + function SourceMapGenerator_addMapping(aArgs) { + var generated = util.getArg(aArgs, 'generated'); + var original = util.getArg(aArgs, 'original', null); + var source = util.getArg(aArgs, 'source', null); + var name = util.getArg(aArgs, 'name', null); + + if (!this._skipValidation) { + this._validateMapping(generated, original, source, name); + } + + if (source != null) { + source = String(source); + if (!this._sources.has(source)) { + this._sources.add(source); + } + } + + if (name != null) { + name = String(name); + if (!this._names.has(name)) { + this._names.add(name); + } + } + + this._mappings.add({ + generatedLine: generated.line, + generatedColumn: generated.column, + originalLine: original != null && original.line, + originalColumn: original != null && original.column, + source: source, + name: name + }); + }; + +/** + * Set the source content for a source file. + */ +SourceMapGenerator.prototype.setSourceContent = + function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { + var source = aSourceFile; + if (this._sourceRoot != null) { + source = util.relative(this._sourceRoot, source); + } + + if (aSourceContent != null) { + // Add the source content to the _sourcesContents map. + // Create a new _sourcesContents map if the property is null. + if (!this._sourcesContents) { + this._sourcesContents = Object.create(null); + } + this._sourcesContents[util.toSetString(source)] = aSourceContent; + } else if (this._sourcesContents) { + // Remove the source file from the _sourcesContents map. + // If the _sourcesContents map is empty, set the property to null. + delete this._sourcesContents[util.toSetString(source)]; + if (Object.keys(this._sourcesContents).length === 0) { + this._sourcesContents = null; + } + } + }; + +/** + * Applies the mappings of a sub-source-map for a specific source file to the + * source map being generated. Each mapping to the supplied source file is + * rewritten using the supplied source map. Note: The resolution for the + * resulting mappings is the minimium of this map and the supplied map. + * + * @param aSourceMapConsumer The source map to be applied. + * @param aSourceFile Optional. The filename of the source file. + * If omitted, SourceMapConsumer's file property will be used. + * @param aSourceMapPath Optional. The dirname of the path to the source map + * to be applied. If relative, it is relative to the SourceMapConsumer. + * This parameter is needed when the two source maps aren't in the same + * directory, and the source map to be applied contains relative source + * paths. If so, those relative source paths need to be rewritten + * relative to the SourceMapGenerator. + */ +SourceMapGenerator.prototype.applySourceMap = + function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { + var sourceFile = aSourceFile; + // If aSourceFile is omitted, we will use the file property of the SourceMap + if (aSourceFile == null) { + if (aSourceMapConsumer.file == null) { + throw new Error( + 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + + 'or the source map\'s "file" property. Both were omitted.' + ); + } + sourceFile = aSourceMapConsumer.file; + } + var sourceRoot = this._sourceRoot; + // Make "sourceFile" relative if an absolute Url is passed. + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + // Applying the SourceMap can add and remove items from the sources and + // the names array. + var newSources = new ArraySet(); + var newNames = new ArraySet(); + + // Find mappings for the "sourceFile" + this._mappings.unsortedForEach(function (mapping) { + if (mapping.source === sourceFile && mapping.originalLine != null) { + // Check if it can be mapped by the source map, then update the mapping. + var original = aSourceMapConsumer.originalPositionFor({ + line: mapping.originalLine, + column: mapping.originalColumn + }); + if (original.source != null) { + // Copy mapping + mapping.source = original.source; + if (aSourceMapPath != null) { + mapping.source = util.join(aSourceMapPath, mapping.source) + } + if (sourceRoot != null) { + mapping.source = util.relative(sourceRoot, mapping.source); + } + mapping.originalLine = original.line; + mapping.originalColumn = original.column; + if (original.name != null) { + mapping.name = original.name; + } + } + } + + var source = mapping.source; + if (source != null && !newSources.has(source)) { + newSources.add(source); + } + + var name = mapping.name; + if (name != null && !newNames.has(name)) { + newNames.add(name); + } + + }, this); + this._sources = newSources; + this._names = newNames; + + // Copy sourcesContents of applied map. + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aSourceMapPath != null) { + sourceFile = util.join(aSourceMapPath, sourceFile); + } + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + this.setSourceContent(sourceFile, content); + } + }, this); + }; + +/** + * A mapping can have one of the three levels of data: + * + * 1. Just the generated position. + * 2. The Generated position, original position, and original source. + * 3. Generated and original position, original source, as well as a name + * token. + * + * To maintain consistency, we validate that any new mapping being added falls + * in to one of these categories. + */ +SourceMapGenerator.prototype._validateMapping = + function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, + aName) { + // When aOriginal is truthy but has empty values for .line and .column, + // it is most likely a programmer error. In this case we throw a very + // specific error message to try to guide them the right way. + // For example: https://github.com/Polymer/polymer-bundler/pull/519 + if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { + throw new Error( + 'original.line and original.column are not numbers -- you probably meant to omit ' + + 'the original mapping entirely and only map the generated position. If so, pass ' + + 'null for the original mapping instead of an object with empty or null values.' + ); + } + + if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aGenerated.line > 0 && aGenerated.column >= 0 + && !aOriginal && !aSource && !aName) { + // Case 1. + return; + } + else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aOriginal && 'line' in aOriginal && 'column' in aOriginal + && aGenerated.line > 0 && aGenerated.column >= 0 + && aOriginal.line > 0 && aOriginal.column >= 0 + && aSource) { + // Cases 2 and 3. + return; + } + else { + throw new Error('Invalid mapping: ' + JSON.stringify({ + generated: aGenerated, + source: aSource, + original: aOriginal, + name: aName + })); + } + }; + +/** + * Serialize the accumulated mappings in to the stream of base 64 VLQs + * specified by the source map format. + */ +SourceMapGenerator.prototype._serializeMappings = + function SourceMapGenerator_serializeMappings() { + var previousGeneratedColumn = 0; + var previousGeneratedLine = 1; + var previousOriginalColumn = 0; + var previousOriginalLine = 0; + var previousName = 0; + var previousSource = 0; + var result = ''; + var next; + var mapping; + var nameIdx; + var sourceIdx; + + var mappings = this._mappings.toArray(); + for (var i = 0, len = mappings.length; i < len; i++) { + mapping = mappings[i]; + next = '' + + if (mapping.generatedLine !== previousGeneratedLine) { + previousGeneratedColumn = 0; + while (mapping.generatedLine !== previousGeneratedLine) { + next += ';'; + previousGeneratedLine++; + } + } + else { + if (i > 0) { + if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { + continue; + } + next += ','; + } + } + + next += base64VLQ.encode(mapping.generatedColumn + - previousGeneratedColumn); + previousGeneratedColumn = mapping.generatedColumn; + + if (mapping.source != null) { + sourceIdx = this._sources.indexOf(mapping.source); + next += base64VLQ.encode(sourceIdx - previousSource); + previousSource = sourceIdx; + + // lines are stored 0-based in SourceMap spec version 3 + next += base64VLQ.encode(mapping.originalLine - 1 + - previousOriginalLine); + previousOriginalLine = mapping.originalLine - 1; + + next += base64VLQ.encode(mapping.originalColumn + - previousOriginalColumn); + previousOriginalColumn = mapping.originalColumn; + + if (mapping.name != null) { + nameIdx = this._names.indexOf(mapping.name); + next += base64VLQ.encode(nameIdx - previousName); + previousName = nameIdx; + } + } + + result += next; + } + + return result; + }; + +SourceMapGenerator.prototype._generateSourcesContent = + function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { + return aSources.map(function (source) { + if (!this._sourcesContents) { + return null; + } + if (aSourceRoot != null) { + source = util.relative(aSourceRoot, source); + } + var key = util.toSetString(source); + return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) + ? this._sourcesContents[key] + : null; + }, this); + }; + +/** + * Externalize the source map. + */ +SourceMapGenerator.prototype.toJSON = + function SourceMapGenerator_toJSON() { + var map = { + version: this._version, + sources: this._sources.toArray(), + names: this._names.toArray(), + mappings: this._serializeMappings() + }; + if (this._file != null) { + map.file = this._file; + } + if (this._sourceRoot != null) { + map.sourceRoot = this._sourceRoot; + } + if (this._sourcesContents) { + map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); + } + + return map; + }; + +/** + * Render the source map being generated to a string. + */ +SourceMapGenerator.prototype.toString = + function SourceMapGenerator_toString() { + return JSON.stringify(this.toJSON()); + }; + +exports.h = SourceMapGenerator; + + +/***/ }), + +/***/ 92616: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var __webpack_unused_export__; +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var SourceMapGenerator = (__nccwpck_require__(69425)/* .SourceMapGenerator */ .h); +var util = __nccwpck_require__(12344); + +// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other +// operating systems these days (capturing the result). +var REGEX_NEWLINE = /(\r?\n)/; + +// Newline character code for charCodeAt() comparisons +var NEWLINE_CODE = 10; + +// Private symbol for identifying `SourceNode`s when multiple versions of +// the source-map library are loaded. This MUST NOT CHANGE across +// versions! +var isSourceNode = "$$$isSourceNode$$$"; + +/** + * SourceNodes provide a way to abstract over interpolating/concatenating + * snippets of generated JavaScript source code while maintaining the line and + * column information associated with the original source code. + * + * @param aLine The original line number. + * @param aColumn The original column number. + * @param aSource The original source's filename. + * @param aChunks Optional. An array of strings which are snippets of + * generated JS, or other SourceNodes. + * @param aName The original identifier. + */ +function SourceNode(aLine, aColumn, aSource, aChunks, aName) { + this.children = []; + this.sourceContents = {}; + this.line = aLine == null ? null : aLine; + this.column = aColumn == null ? null : aColumn; + this.source = aSource == null ? null : aSource; + this.name = aName == null ? null : aName; + this[isSourceNode] = true; + if (aChunks != null) this.add(aChunks); +} + +/** + * Creates a SourceNode from generated code and a SourceMapConsumer. + * + * @param aGeneratedCode The generated code + * @param aSourceMapConsumer The SourceMap for the generated code + * @param aRelativePath Optional. The path that relative sources in the + * SourceMapConsumer should be relative to. + */ +SourceNode.fromStringWithSourceMap = + function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { + // The SourceNode we want to fill with the generated code + // and the SourceMap + var node = new SourceNode(); + + // All even indices of this array are one line of the generated code, + // while all odd indices are the newlines between two adjacent lines + // (since `REGEX_NEWLINE` captures its match). + // Processed fragments are accessed by calling `shiftNextLine`. + var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); + var remainingLinesIndex = 0; + var shiftNextLine = function() { + var lineContents = getNextLine(); + // The last line of a file might not have a newline. + var newLine = getNextLine() || ""; + return lineContents + newLine; + + function getNextLine() { + return remainingLinesIndex < remainingLines.length ? + remainingLines[remainingLinesIndex++] : undefined; + } + }; + + // We need to remember the position of "remainingLines" + var lastGeneratedLine = 1, lastGeneratedColumn = 0; + + // The generate SourceNodes we need a code range. + // To extract it current and last mapping is used. + // Here we store the last mapping. + var lastMapping = null; + + aSourceMapConsumer.eachMapping(function (mapping) { + if (lastMapping !== null) { + // We add the code from "lastMapping" to "mapping": + // First check if there is a new line in between. + if (lastGeneratedLine < mapping.generatedLine) { + // Associate first line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + lastGeneratedLine++; + lastGeneratedColumn = 0; + // The remaining code is added without mapping + } else { + // There is no new line in between. + // Associate the code between "lastGeneratedColumn" and + // "mapping.generatedColumn" with "lastMapping" + var nextLine = remainingLines[remainingLinesIndex] || ''; + var code = nextLine.substr(0, mapping.generatedColumn - + lastGeneratedColumn); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - + lastGeneratedColumn); + lastGeneratedColumn = mapping.generatedColumn; + addMappingWithCode(lastMapping, code); + // No more remaining code, continue + lastMapping = mapping; + return; + } + } + // We add the generated code until the first mapping + // to the SourceNode without any mapping. + // Each line is added as separate string. + while (lastGeneratedLine < mapping.generatedLine) { + node.add(shiftNextLine()); + lastGeneratedLine++; + } + if (lastGeneratedColumn < mapping.generatedColumn) { + var nextLine = remainingLines[remainingLinesIndex] || ''; + node.add(nextLine.substr(0, mapping.generatedColumn)); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); + lastGeneratedColumn = mapping.generatedColumn; + } + lastMapping = mapping; + }, this); + // We have processed all mappings. + if (remainingLinesIndex < remainingLines.length) { + if (lastMapping) { + // Associate the remaining code in the current line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + } + // and add the remaining lines without any mapping + node.add(remainingLines.splice(remainingLinesIndex).join("")); + } + + // Copy sourcesContent into SourceNode + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aRelativePath != null) { + sourceFile = util.join(aRelativePath, sourceFile); + } + node.setSourceContent(sourceFile, content); + } + }); + + return node; + + function addMappingWithCode(mapping, code) { + if (mapping === null || mapping.source === undefined) { + node.add(code); + } else { + var source = aRelativePath + ? util.join(aRelativePath, mapping.source) + : mapping.source; + node.add(new SourceNode(mapping.originalLine, + mapping.originalColumn, + source, + code, + mapping.name)); + } + } + }; + +/** + * Add a chunk of generated JS to this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ +SourceNode.prototype.add = function SourceNode_add(aChunk) { + if (Array.isArray(aChunk)) { + aChunk.forEach(function (chunk) { + this.add(chunk); + }, this); + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + if (aChunk) { + this.children.push(aChunk); + } + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; +}; + +/** + * Add a chunk of generated JS to the beginning of this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ +SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { + if (Array.isArray(aChunk)) { + for (var i = aChunk.length-1; i >= 0; i--) { + this.prepend(aChunk[i]); + } + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + this.children.unshift(aChunk); + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; +}; + +/** + * Walk over the tree of JS snippets in this node and its children. The + * walking function is called once for each snippet of JS and is passed that + * snippet and the its original associated source's line/column location. + * + * @param aFn The traversal function. + */ +SourceNode.prototype.walk = function SourceNode_walk(aFn) { + var chunk; + for (var i = 0, len = this.children.length; i < len; i++) { + chunk = this.children[i]; + if (chunk[isSourceNode]) { + chunk.walk(aFn); + } + else { + if (chunk !== '') { + aFn(chunk, { source: this.source, + line: this.line, + column: this.column, + name: this.name }); + } + } + } +}; + +/** + * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between + * each of `this.children`. + * + * @param aSep The separator. + */ +SourceNode.prototype.join = function SourceNode_join(aSep) { + var newChildren; + var i; + var len = this.children.length; + if (len > 0) { + newChildren = []; + for (i = 0; i < len-1; i++) { + newChildren.push(this.children[i]); + newChildren.push(aSep); + } + newChildren.push(this.children[i]); + this.children = newChildren; + } + return this; +}; + +/** + * Call String.prototype.replace on the very right-most source snippet. Useful + * for trimming whitespace from the end of a source node, etc. + * + * @param aPattern The pattern to replace. + * @param aReplacement The thing to replace the pattern with. + */ +SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { + var lastChild = this.children[this.children.length - 1]; + if (lastChild[isSourceNode]) { + lastChild.replaceRight(aPattern, aReplacement); + } + else if (typeof lastChild === 'string') { + this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); + } + else { + this.children.push(''.replace(aPattern, aReplacement)); + } + return this; +}; + +/** + * Set the source content for a source file. This will be added to the SourceMapGenerator + * in the sourcesContent field. + * + * @param aSourceFile The filename of the source file + * @param aSourceContent The content of the source file + */ +SourceNode.prototype.setSourceContent = + function SourceNode_setSourceContent(aSourceFile, aSourceContent) { + this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; + }; + +/** + * Walk over the tree of SourceNodes. The walking function is called for each + * source file content and is passed the filename and source content. + * + * @param aFn The traversal function. + */ +SourceNode.prototype.walkSourceContents = + function SourceNode_walkSourceContents(aFn) { + for (var i = 0, len = this.children.length; i < len; i++) { + if (this.children[i][isSourceNode]) { + this.children[i].walkSourceContents(aFn); + } + } + + var sources = Object.keys(this.sourceContents); + for (var i = 0, len = sources.length; i < len; i++) { + aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); + } + }; + +/** + * Return the string representation of this source node. Walks over the tree + * and concatenates all the various snippets together to one string. + */ +SourceNode.prototype.toString = function SourceNode_toString() { + var str = ""; + this.walk(function (chunk) { + str += chunk; + }); + return str; +}; + +/** + * Returns the string representation of this source node along with a source + * map. + */ +SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { + var generated = { + code: "", + line: 1, + column: 0 + }; + var map = new SourceMapGenerator(aArgs); + var sourceMappingActive = false; + var lastOriginalSource = null; + var lastOriginalLine = null; + var lastOriginalColumn = null; + var lastOriginalName = null; + this.walk(function (chunk, original) { + generated.code += chunk; + if (original.source !== null + && original.line !== null + && original.column !== null) { + if(lastOriginalSource !== original.source + || lastOriginalLine !== original.line + || lastOriginalColumn !== original.column + || lastOriginalName !== original.name) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + lastOriginalSource = original.source; + lastOriginalLine = original.line; + lastOriginalColumn = original.column; + lastOriginalName = original.name; + sourceMappingActive = true; + } else if (sourceMappingActive) { + map.addMapping({ + generated: { + line: generated.line, + column: generated.column + } + }); + lastOriginalSource = null; + sourceMappingActive = false; + } + for (var idx = 0, length = chunk.length; idx < length; idx++) { + if (chunk.charCodeAt(idx) === NEWLINE_CODE) { + generated.line++; + generated.column = 0; + // Mappings end at eol + if (idx + 1 === length) { + lastOriginalSource = null; + sourceMappingActive = false; + } else if (sourceMappingActive) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + } else { + generated.column++; + } + } + }); + this.walkSourceContents(function (sourceFile, sourceContent) { + map.setSourceContent(sourceFile, sourceContent); + }); + + return { code: generated.code, map: map }; +}; + +__webpack_unused_export__ = SourceNode; + + +/***/ }), + +/***/ 12344: +/***/ ((__unused_webpack_module, exports) => { + +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +/** + * This is a helper function for getting values from parameter/options + * objects. + * + * @param args The object we are extracting values from + * @param name The name of the property we are getting. + * @param defaultValue An optional value to return if the property is missing + * from the object. If this is not specified and the property is missing, an + * error will be thrown. + */ +function getArg(aArgs, aName, aDefaultValue) { + if (aName in aArgs) { + return aArgs[aName]; + } else if (arguments.length === 3) { + return aDefaultValue; + } else { + throw new Error('"' + aName + '" is a required argument.'); + } +} +exports.getArg = getArg; + +var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; +var dataUrlRegexp = /^data:.+\,.+$/; + +function urlParse(aUrl) { + var match = aUrl.match(urlRegexp); + if (!match) { + return null; + } + return { + scheme: match[1], + auth: match[2], + host: match[3], + port: match[4], + path: match[5] + }; +} +exports.urlParse = urlParse; + +function urlGenerate(aParsedUrl) { + var url = ''; + if (aParsedUrl.scheme) { + url += aParsedUrl.scheme + ':'; + } + url += '//'; + if (aParsedUrl.auth) { + url += aParsedUrl.auth + '@'; + } + if (aParsedUrl.host) { + url += aParsedUrl.host; + } + if (aParsedUrl.port) { + url += ":" + aParsedUrl.port + } + if (aParsedUrl.path) { + url += aParsedUrl.path; + } + return url; +} +exports.urlGenerate = urlGenerate; + +/** + * Normalizes a path, or the path portion of a URL: + * + * - Replaces consecutive slashes with one slash. + * - Removes unnecessary '.' parts. + * - Removes unnecessary '/..' parts. + * + * Based on code in the Node.js 'path' core module. + * + * @param aPath The path or url to normalize. + */ +function normalize(aPath) { + var path = aPath; + var url = urlParse(aPath); + if (url) { + if (!url.path) { + return aPath; + } + path = url.path; + } + var isAbsolute = exports.isAbsolute(path); + + var parts = path.split(/\/+/); + for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { + part = parts[i]; + if (part === '.') { + parts.splice(i, 1); + } else if (part === '..') { + up++; + } else if (up > 0) { + if (part === '') { + // The first part is blank if the path is absolute. Trying to go + // above the root is a no-op. Therefore we can remove all '..' parts + // directly after the root. + parts.splice(i + 1, up); + up = 0; + } else { + parts.splice(i, 2); + up--; + } + } + } + path = parts.join('/'); + + if (path === '') { + path = isAbsolute ? '/' : '.'; + } + + if (url) { + url.path = path; + return urlGenerate(url); + } + return path; +} +exports.normalize = normalize; + +/** + * Joins two paths/URLs. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be joined with the root. + * + * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a + * scheme-relative URL: Then the scheme of aRoot, if any, is prepended + * first. + * - Otherwise aPath is a path. If aRoot is a URL, then its path portion + * is updated with the result and aRoot is returned. Otherwise the result + * is returned. + * - If aPath is absolute, the result is aPath. + * - Otherwise the two paths are joined with a slash. + * - Joining for example 'http://' and 'www.example.com' is also supported. + */ +function join(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + if (aPath === "") { + aPath = "."; + } + var aPathUrl = urlParse(aPath); + var aRootUrl = urlParse(aRoot); + if (aRootUrl) { + aRoot = aRootUrl.path || '/'; + } + + // `join(foo, '//www.example.org')` + if (aPathUrl && !aPathUrl.scheme) { + if (aRootUrl) { + aPathUrl.scheme = aRootUrl.scheme; + } + return urlGenerate(aPathUrl); + } + + if (aPathUrl || aPath.match(dataUrlRegexp)) { + return aPath; + } + + // `join('http://', 'www.example.com')` + if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { + aRootUrl.host = aPath; + return urlGenerate(aRootUrl); + } + + var joined = aPath.charAt(0) === '/' + ? aPath + : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); + + if (aRootUrl) { + aRootUrl.path = joined; + return urlGenerate(aRootUrl); + } + return joined; +} +exports.join = join; + +exports.isAbsolute = function (aPath) { + return aPath.charAt(0) === '/' || urlRegexp.test(aPath); +}; + +/** + * Make a path relative to a URL or another path. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be made relative to aRoot. + */ +function relative(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + + aRoot = aRoot.replace(/\/$/, ''); + + // It is possible for the path to be above the root. In this case, simply + // checking whether the root is a prefix of the path won't work. Instead, we + // need to remove components from the root one by one, until either we find + // a prefix that fits, or we run out of components to remove. + var level = 0; + while (aPath.indexOf(aRoot + '/') !== 0) { + var index = aRoot.lastIndexOf("/"); + if (index < 0) { + return aPath; + } + + // If the only part of the root that is left is the scheme (i.e. http://, + // file:///, etc.), one or more slashes (/), or simply nothing at all, we + // have exhausted all components, so the path is not relative to the root. + aRoot = aRoot.slice(0, index); + if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { + return aPath; + } + + ++level; + } + + // Make sure we add a "../" for each component we removed from the root. + return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); +} +exports.relative = relative; + +var supportsNullProto = (function () { + var obj = Object.create(null); + return !('__proto__' in obj); +}()); + +function identity (s) { + return s; +} + +/** + * Because behavior goes wacky when you set `__proto__` on objects, we + * have to prefix all the strings in our set with an arbitrary character. + * + * See https://github.com/mozilla/source-map/pull/31 and + * https://github.com/mozilla/source-map/issues/30 + * + * @param String aStr + */ +function toSetString(aStr) { + if (isProtoString(aStr)) { + return '$' + aStr; + } + + return aStr; +} +exports.toSetString = supportsNullProto ? identity : toSetString; + +function fromSetString(aStr) { + if (isProtoString(aStr)) { + return aStr.slice(1); + } + + return aStr; +} +exports.fromSetString = supportsNullProto ? identity : fromSetString; + +function isProtoString(s) { + if (!s) { + return false; + } + + var length = s.length; + + if (length < 9 /* "__proto__".length */) { + return false; + } + + if (s.charCodeAt(length - 1) !== 95 /* '_' */ || + s.charCodeAt(length - 2) !== 95 /* '_' */ || + s.charCodeAt(length - 3) !== 111 /* 'o' */ || + s.charCodeAt(length - 4) !== 116 /* 't' */ || + s.charCodeAt(length - 5) !== 111 /* 'o' */ || + s.charCodeAt(length - 6) !== 114 /* 'r' */ || + s.charCodeAt(length - 7) !== 112 /* 'p' */ || + s.charCodeAt(length - 8) !== 95 /* '_' */ || + s.charCodeAt(length - 9) !== 95 /* '_' */) { + return false; + } + + for (var i = length - 10; i >= 0; i--) { + if (s.charCodeAt(i) !== 36 /* '$' */) { + return false; + } + } + + return true; +} + +/** + * Comparator between two mappings where the original positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same original source/line/column, but different generated + * line and column the same. Useful when searching for a mapping with a + * stubbed out mapping. + */ +function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { + var cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByOriginalPositions = compareByOriginalPositions; + +/** + * Comparator between two mappings with deflated source and name indices where + * the generated positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same generated line and column, but different + * source/name/original line and column the same. Useful when searching for a + * mapping with a stubbed out mapping. + */ +function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; + +function strcmp(aStr1, aStr2) { + if (aStr1 === aStr2) { + return 0; + } + + if (aStr1 === null) { + return 1; // aStr2 !== null + } + + if (aStr2 === null) { + return -1; // aStr1 !== null + } + + if (aStr1 > aStr2) { + return 1; + } + + return -1; +} + +/** + * Comparator between two mappings with inflated source and name strings where + * the generated positions are compared. + */ +function compareByGeneratedPositionsInflated(mappingA, mappingB) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; + +/** + * Strip any JSON XSSI avoidance prefix from the string (as documented + * in the source maps specification), and then parse the string as + * JSON. + */ +function parseSourceMapInput(str) { + return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); +} +exports.parseSourceMapInput = parseSourceMapInput; + +/** + * Compute the URL of a source given the the source root, the source's + * URL, and the source map's URL. + */ +function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { + sourceURL = sourceURL || ''; + + if (sourceRoot) { + // This follows what Chrome does. + if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { + sourceRoot += '/'; + } + // The spec says: + // Line 4: An optional source root, useful for relocating source + // files on a server or removing repeated values in the + // “sources” entry. This value is prepended to the individual + // entries in the “source” field. + sourceURL = sourceRoot + sourceURL; + } + + // Historically, SourceMapConsumer did not take the sourceMapURL as + // a parameter. This mode is still somewhat supported, which is why + // this code block is conditional. However, it's preferable to pass + // the source map URL to SourceMapConsumer, so that this function + // can implement the source URL resolution algorithm as outlined in + // the spec. This block is basically the equivalent of: + // new URL(sourceURL, sourceMapURL).toString() + // ... except it avoids using URL, which wasn't available in the + // older releases of node still supported by this library. + // + // The spec says: + // If the sources are not absolute URLs after prepending of the + // “sourceRoot”, the sources are resolved relative to the + // SourceMap (like resolving script src in a html document). + if (sourceMapURL) { + var parsed = urlParse(sourceMapURL); + if (!parsed) { + throw new Error("sourceMapURL could not be parsed"); + } + if (parsed.path) { + // Strip the last path component, but keep the "/". + var index = parsed.path.lastIndexOf('/'); + if (index >= 0) { + parsed.path = parsed.path.substring(0, index + 1); + } + } + sourceURL = join(urlGenerate(parsed), sourceURL); + } + + return normalize(sourceURL); +} +exports.computeSourceURL = computeSourceURL; + + +/***/ }), + +/***/ 56594: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +/* + * Copyright 2009-2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE.txt or: + * http://opensource.org/licenses/BSD-3-Clause + */ +/* unused reexport */ __nccwpck_require__(69425)/* .SourceMapGenerator */ .h; +exports.SourceMapConsumer = __nccwpck_require__(75155).SourceMapConsumer; +/* unused reexport */ __nccwpck_require__(92616); + + +/***/ }), + +/***/ 94841: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + + + +/**/ + +var Buffer = (__nccwpck_require__(21867).Buffer); +/**/ + +var isEncoding = Buffer.isEncoding || function (encoding) { + encoding = '' + encoding; + switch (encoding && encoding.toLowerCase()) { + case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': + return true; + default: + return false; + } +}; + +function _normalizeEncoding(enc) { + if (!enc) return 'utf8'; + var retried; + while (true) { + switch (enc) { + case 'utf8': + case 'utf-8': + return 'utf8'; + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return 'utf16le'; + case 'latin1': + case 'binary': + return 'latin1'; + case 'base64': + case 'ascii': + case 'hex': + return enc; + default: + if (retried) return; // undefined + enc = ('' + enc).toLowerCase(); + retried = true; + } + } +}; + +// Do not cache `Buffer.isEncoding` when checking encoding names as some +// modules monkey-patch it to support additional encodings +function normalizeEncoding(enc) { + var nenc = _normalizeEncoding(enc); + if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); + return nenc || enc; +} + +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. +exports.s = StringDecoder; +function StringDecoder(encoding) { + this.encoding = normalizeEncoding(encoding); + var nb; + switch (this.encoding) { + case 'utf16le': + this.text = utf16Text; + this.end = utf16End; + nb = 4; + break; + case 'utf8': + this.fillLast = utf8FillLast; + nb = 4; + break; + case 'base64': + this.text = base64Text; + this.end = base64End; + nb = 3; + break; + default: + this.write = simpleWrite; + this.end = simpleEnd; + return; + } + this.lastNeed = 0; + this.lastTotal = 0; + this.lastChar = Buffer.allocUnsafe(nb); +} + +StringDecoder.prototype.write = function (buf) { + if (buf.length === 0) return ''; + var r; + var i; + if (this.lastNeed) { + r = this.fillLast(buf); + if (r === undefined) return ''; + i = this.lastNeed; + this.lastNeed = 0; + } else { + i = 0; + } + if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); + return r || ''; +}; + +StringDecoder.prototype.end = utf8End; + +// Returns only complete characters in a Buffer +StringDecoder.prototype.text = utf8Text; + +// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer +StringDecoder.prototype.fillLast = function (buf) { + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); + this.lastNeed -= buf.length; +}; + +// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a +// continuation byte. If an invalid byte is detected, -2 is returned. +function utf8CheckByte(byte) { + if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; + return byte >> 6 === 0x02 ? -1 : -2; +} + +// Checks at most 3 bytes at the end of a Buffer in order to detect an +// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) +// needed to complete the UTF-8 character (if applicable) are returned. +function utf8CheckIncomplete(self, buf, i) { + var j = buf.length - 1; + if (j < i) return 0; + var nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 1; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 2; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) { + if (nb === 2) nb = 0;else self.lastNeed = nb - 3; + } + return nb; + } + return 0; +} + +// Validates as many continuation bytes for a multi-byte UTF-8 character as +// needed or are available. If we see a non-continuation byte where we expect +// one, we "replace" the validated continuation bytes we've seen so far with +// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding +// behavior. The continuation byte check is included three times in the case +// where all of the continuation bytes for a character exist in the same buffer. +// It is also done this way as a slight performance increase instead of using a +// loop. +function utf8CheckExtraBytes(self, buf, p) { + if ((buf[0] & 0xC0) !== 0x80) { + self.lastNeed = 0; + return '\ufffd'; + } + if (self.lastNeed > 1 && buf.length > 1) { + if ((buf[1] & 0xC0) !== 0x80) { + self.lastNeed = 1; + return '\ufffd'; + } + if (self.lastNeed > 2 && buf.length > 2) { + if ((buf[2] & 0xC0) !== 0x80) { + self.lastNeed = 2; + return '\ufffd'; + } + } + } +} + +// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. +function utf8FillLast(buf) { + var p = this.lastTotal - this.lastNeed; + var r = utf8CheckExtraBytes(this, buf, p); + if (r !== undefined) return r; + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, p, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, p, 0, buf.length); + this.lastNeed -= buf.length; +} + +// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a +// partial character, the character's bytes are buffered until the required +// number of bytes are available. +function utf8Text(buf, i) { + var total = utf8CheckIncomplete(this, buf, i); + if (!this.lastNeed) return buf.toString('utf8', i); + this.lastTotal = total; + var end = buf.length - (total - this.lastNeed); + buf.copy(this.lastChar, 0, end); + return buf.toString('utf8', i, end); +} + +// For UTF-8, a replacement character is added when ending on a partial +// character. +function utf8End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + '\ufffd'; + return r; +} + +// UTF-16LE typically needs two bytes per character, but even if we have an even +// number of bytes available, we need to check if we end on a leading/high +// surrogate. In that case, we need to wait for the next two bytes in order to +// decode the last character properly. +function utf16Text(buf, i) { + if ((buf.length - i) % 2 === 0) { + var r = buf.toString('utf16le', i); + if (r) { + var c = r.charCodeAt(r.length - 1); + if (c >= 0xD800 && c <= 0xDBFF) { + this.lastNeed = 2; + this.lastTotal = 4; + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + return r.slice(0, -1); + } + } + return r; + } + this.lastNeed = 1; + this.lastTotal = 2; + this.lastChar[0] = buf[buf.length - 1]; + return buf.toString('utf16le', i, buf.length - 1); +} + +// For UTF-16LE we do not explicitly append special replacement characters if we +// end on a partial character, we simply let v8 handle that. +function utf16End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) { + var end = this.lastTotal - this.lastNeed; + return r + this.lastChar.toString('utf16le', 0, end); + } + return r; +} + +function base64Text(buf, i) { + var n = (buf.length - i) % 3; + if (n === 0) return buf.toString('base64', i); + this.lastNeed = 3 - n; + this.lastTotal = 3; + if (n === 1) { + this.lastChar[0] = buf[buf.length - 1]; + } else { + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + } + return buf.toString('base64', i, buf.length - n); +} + +function base64End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); + return r; +} + +// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) +function simpleWrite(buf) { + return buf.toString(this.encoding); +} + +function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ''; +} + +/***/ }), + +/***/ 59318: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +const os = __nccwpck_require__(22037); +const hasFlag = __nccwpck_require__(81533); + +const env = process.env; + +let forceColor; +if (hasFlag('no-color') || + hasFlag('no-colors') || + hasFlag('color=false')) { + forceColor = false; +} else if (hasFlag('color') || + hasFlag('colors') || + hasFlag('color=true') || + hasFlag('color=always')) { + forceColor = true; +} +if ('FORCE_COLOR' in env) { + forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0; +} + +function translateLevel(level) { + if (level === 0) { + return false; + } + + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; +} + +function supportsColor(stream) { + if (forceColor === false) { + return 0; + } + + if (hasFlag('color=16m') || + hasFlag('color=full') || + hasFlag('color=truecolor')) { + return 3; + } + + if (hasFlag('color=256')) { + return 2; + } + + if (stream && !stream.isTTY && forceColor !== true) { + return 0; + } + + const min = forceColor ? 1 : 0; + + if (process.platform === 'win32') { + // Node.js 7.5.0 is the first version of Node.js to include a patch to + // libuv that enables 256 color output on Windows. Anything earlier and it + // won't work. However, here we target Node.js 8 at minimum as it is an LTS + // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows + // release that supports 256 colors. Windows 10 build 14931 is the first release + // that supports 16m/TrueColor. + const osRelease = os.release().split('.'); + if ( + Number(process.versions.node.split('.')[0]) >= 8 && + Number(osRelease[0]) >= 10 && + Number(osRelease[2]) >= 10586 + ) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; + } + + return 1; + } + + if ('CI' in env) { + if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') { + return 1; + } + + return min; + } + + if ('TEAMCITY_VERSION' in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + } + + if (env.COLORTERM === 'truecolor') { + return 3; + } + + if ('TERM_PROGRAM' in env) { + const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); + + switch (env.TERM_PROGRAM) { + case 'iTerm.app': + return version >= 3 ? 3 : 2; + case 'Apple_Terminal': + return 2; + // No default + } + } + + if (/-256(color)?$/i.test(env.TERM)) { + return 2; + } + + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; + } + + if ('COLORTERM' in env) { + return 1; + } + + if (env.TERM === 'dumb') { + return min; + } + + return min; +} + +function getSupportLevel(stream) { + const level = supportsColor(stream); + return translateLevel(level); +} + +module.exports = { + supportsColor: getSupportLevel, + stdout: getSupportLevel(process.stdout), + stderr: getSupportLevel(process.stderr) +}; + + +/***/ }), + +/***/ 81533: +/***/ ((module) => { + +"use strict"; + +module.exports = (flag, argv) => { + argv = argv || process.argv; + const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); + const pos = argv.indexOf(prefix + flag); + const terminatorPos = argv.indexOf('--'); + return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); +}; + + +/***/ }), + +/***/ 57882: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var util = __nccwpck_require__(73837) +var bl = __nccwpck_require__(20336) +var headers = __nccwpck_require__(68860) + +var Writable = (__nccwpck_require__(51642).Writable) +var PassThrough = (__nccwpck_require__(51642).PassThrough) + +var noop = function () {} + +var overflow = function (size) { + size &= 511 + return size && 512 - size +} + +var emptyStream = function (self, offset) { + var s = new Source(self, offset) + s.end() + return s +} + +var mixinPax = function (header, pax) { + if (pax.path) header.name = pax.path + if (pax.linkpath) header.linkname = pax.linkpath + if (pax.size) header.size = parseInt(pax.size, 10) + header.pax = pax + return header +} + +var Source = function (self, offset) { + this._parent = self + this.offset = offset + PassThrough.call(this, { autoDestroy: false }) +} + +util.inherits(Source, PassThrough) + +Source.prototype.destroy = function (err) { + this._parent.destroy(err) +} + +var Extract = function (opts) { + if (!(this instanceof Extract)) return new Extract(opts) + Writable.call(this, opts) + + opts = opts || {} + + this._offset = 0 + this._buffer = bl() + this._missing = 0 + this._partial = false + this._onparse = noop + this._header = null + this._stream = null + this._overflow = null + this._cb = null + this._locked = false + this._destroyed = false + this._pax = null + this._paxGlobal = null + this._gnuLongPath = null + this._gnuLongLinkPath = null + + var self = this + var b = self._buffer + + var oncontinue = function () { + self._continue() + } + + var onunlock = function (err) { + self._locked = false + if (err) return self.destroy(err) + if (!self._stream) oncontinue() + } + + var onstreamend = function () { + self._stream = null + var drain = overflow(self._header.size) + if (drain) self._parse(drain, ondrain) + else self._parse(512, onheader) + if (!self._locked) oncontinue() + } + + var ondrain = function () { + self._buffer.consume(overflow(self._header.size)) + self._parse(512, onheader) + oncontinue() + } + + var onpaxglobalheader = function () { + var size = self._header.size + self._paxGlobal = headers.decodePax(b.slice(0, size)) + b.consume(size) + onstreamend() + } + + var onpaxheader = function () { + var size = self._header.size + self._pax = headers.decodePax(b.slice(0, size)) + if (self._paxGlobal) self._pax = Object.assign({}, self._paxGlobal, self._pax) + b.consume(size) + onstreamend() + } + + var ongnulongpath = function () { + var size = self._header.size + this._gnuLongPath = headers.decodeLongPath(b.slice(0, size), opts.filenameEncoding) + b.consume(size) + onstreamend() + } + + var ongnulonglinkpath = function () { + var size = self._header.size + this._gnuLongLinkPath = headers.decodeLongPath(b.slice(0, size), opts.filenameEncoding) + b.consume(size) + onstreamend() + } + + var onheader = function () { + var offset = self._offset + var header + try { + header = self._header = headers.decode(b.slice(0, 512), opts.filenameEncoding, opts.allowUnknownFormat) + } catch (err) { + self.emit('error', err) + } + b.consume(512) + + if (!header) { + self._parse(512, onheader) + oncontinue() + return + } + if (header.type === 'gnu-long-path') { + self._parse(header.size, ongnulongpath) + oncontinue() + return + } + if (header.type === 'gnu-long-link-path') { + self._parse(header.size, ongnulonglinkpath) + oncontinue() + return + } + if (header.type === 'pax-global-header') { + self._parse(header.size, onpaxglobalheader) + oncontinue() + return + } + if (header.type === 'pax-header') { + self._parse(header.size, onpaxheader) + oncontinue() + return + } + + if (self._gnuLongPath) { + header.name = self._gnuLongPath + self._gnuLongPath = null + } + + if (self._gnuLongLinkPath) { + header.linkname = self._gnuLongLinkPath + self._gnuLongLinkPath = null + } + + if (self._pax) { + self._header = header = mixinPax(header, self._pax) + self._pax = null + } + + self._locked = true + + if (!header.size || header.type === 'directory') { + self._parse(512, onheader) + self.emit('entry', header, emptyStream(self, offset), onunlock) + return + } + + self._stream = new Source(self, offset) + + self.emit('entry', header, self._stream, onunlock) + self._parse(header.size, onstreamend) + oncontinue() + } + + this._onheader = onheader + this._parse(512, onheader) +} + +util.inherits(Extract, Writable) + +Extract.prototype.destroy = function (err) { + if (this._destroyed) return + this._destroyed = true + + if (err) this.emit('error', err) + this.emit('close') + if (this._stream) this._stream.emit('close') +} + +Extract.prototype._parse = function (size, onparse) { + if (this._destroyed) return + this._offset += size + this._missing = size + if (onparse === this._onheader) this._partial = false + this._onparse = onparse +} + +Extract.prototype._continue = function () { + if (this._destroyed) return + var cb = this._cb + this._cb = noop + if (this._overflow) this._write(this._overflow, undefined, cb) + else cb() +} + +Extract.prototype._write = function (data, enc, cb) { + if (this._destroyed) return + + var s = this._stream + var b = this._buffer + var missing = this._missing + if (data.length) this._partial = true + + // we do not reach end-of-chunk now. just forward it + + if (data.length < missing) { + this._missing -= data.length + this._overflow = null + if (s) return s.write(data, cb) + b.append(data) + return cb() + } + + // end-of-chunk. the parser should call cb. + + this._cb = cb + this._missing = 0 + + var overflow = null + if (data.length > missing) { + overflow = data.slice(missing) + data = data.slice(0, missing) + } + + if (s) s.end(data) + else b.append(data) + + this._overflow = overflow + this._onparse() +} + +Extract.prototype._final = function (cb) { + if (this._partial) return this.destroy(new Error('Unexpected end of data')) + cb() +} + +module.exports = Extract + + +/***/ }), + +/***/ 68860: +/***/ ((__unused_webpack_module, exports) => { + +var alloc = Buffer.alloc + +var ZEROS = '0000000000000000000' +var SEVENS = '7777777777777777777' +var ZERO_OFFSET = '0'.charCodeAt(0) +var USTAR_MAGIC = Buffer.from('ustar\x00', 'binary') +var USTAR_VER = Buffer.from('00', 'binary') +var GNU_MAGIC = Buffer.from('ustar\x20', 'binary') +var GNU_VER = Buffer.from('\x20\x00', 'binary') +var MASK = parseInt('7777', 8) +var MAGIC_OFFSET = 257 +var VERSION_OFFSET = 263 + +var clamp = function (index, len, defaultValue) { + if (typeof index !== 'number') return defaultValue + index = ~~index // Coerce to integer. + if (index >= len) return len + if (index >= 0) return index + index += len + if (index >= 0) return index + return 0 +} + +var toType = function (flag) { + switch (flag) { + case 0: + return 'file' + case 1: + return 'link' + case 2: + return 'symlink' + case 3: + return 'character-device' + case 4: + return 'block-device' + case 5: + return 'directory' + case 6: + return 'fifo' + case 7: + return 'contiguous-file' + case 72: + return 'pax-header' + case 55: + return 'pax-global-header' + case 27: + return 'gnu-long-link-path' + case 28: + case 30: + return 'gnu-long-path' + } + + return null +} + +var toTypeflag = function (flag) { + switch (flag) { + case 'file': + return 0 + case 'link': + return 1 + case 'symlink': + return 2 + case 'character-device': + return 3 + case 'block-device': + return 4 + case 'directory': + return 5 + case 'fifo': + return 6 + case 'contiguous-file': + return 7 + case 'pax-header': + return 72 + } + + return 0 +} + +var indexOf = function (block, num, offset, end) { + for (; offset < end; offset++) { + if (block[offset] === num) return offset + } + return end +} + +var cksum = function (block) { + var sum = 8 * 32 + for (var i = 0; i < 148; i++) sum += block[i] + for (var j = 156; j < 512; j++) sum += block[j] + return sum +} + +var encodeOct = function (val, n) { + val = val.toString(8) + if (val.length > n) return SEVENS.slice(0, n) + ' ' + else return ZEROS.slice(0, n - val.length) + val + ' ' +} + +/* Copied from the node-tar repo and modified to meet + * tar-stream coding standard. + * + * Source: https://github.com/npm/node-tar/blob/51b6627a1f357d2eb433e7378e5f05e83b7aa6cd/lib/header.js#L349 + */ +function parse256 (buf) { + // first byte MUST be either 80 or FF + // 80 for positive, FF for 2's comp + var positive + if (buf[0] === 0x80) positive = true + else if (buf[0] === 0xFF) positive = false + else return null + + // build up a base-256 tuple from the least sig to the highest + var tuple = [] + for (var i = buf.length - 1; i > 0; i--) { + var byte = buf[i] + if (positive) tuple.push(byte) + else tuple.push(0xFF - byte) + } + + var sum = 0 + var l = tuple.length + for (i = 0; i < l; i++) { + sum += tuple[i] * Math.pow(256, i) + } + + return positive ? sum : -1 * sum +} + +var decodeOct = function (val, offset, length) { + val = val.slice(offset, offset + length) + offset = 0 + + // If prefixed with 0x80 then parse as a base-256 integer + if (val[offset] & 0x80) { + return parse256(val) + } else { + // Older versions of tar can prefix with spaces + while (offset < val.length && val[offset] === 32) offset++ + var end = clamp(indexOf(val, 32, offset, val.length), val.length, val.length) + while (offset < end && val[offset] === 0) offset++ + if (end === offset) return 0 + return parseInt(val.slice(offset, end).toString(), 8) + } +} + +var decodeStr = function (val, offset, length, encoding) { + return val.slice(offset, indexOf(val, 0, offset, offset + length)).toString(encoding) +} + +var addLength = function (str) { + var len = Buffer.byteLength(str) + var digits = Math.floor(Math.log(len) / Math.log(10)) + 1 + if (len + digits >= Math.pow(10, digits)) digits++ + + return (len + digits) + str +} + +exports.decodeLongPath = function (buf, encoding) { + return decodeStr(buf, 0, buf.length, encoding) +} + +exports.encodePax = function (opts) { // TODO: encode more stuff in pax + var result = '' + if (opts.name) result += addLength(' path=' + opts.name + '\n') + if (opts.linkname) result += addLength(' linkpath=' + opts.linkname + '\n') + var pax = opts.pax + if (pax) { + for (var key in pax) { + result += addLength(' ' + key + '=' + pax[key] + '\n') + } + } + return Buffer.from(result) +} + +exports.decodePax = function (buf) { + var result = {} + + while (buf.length) { + var i = 0 + while (i < buf.length && buf[i] !== 32) i++ + var len = parseInt(buf.slice(0, i).toString(), 10) + if (!len) return result + + var b = buf.slice(i + 1, len - 1).toString() + var keyIndex = b.indexOf('=') + if (keyIndex === -1) return result + result[b.slice(0, keyIndex)] = b.slice(keyIndex + 1) + + buf = buf.slice(len) + } + + return result +} + +exports.encode = function (opts) { + var buf = alloc(512) + var name = opts.name + var prefix = '' + + if (opts.typeflag === 5 && name[name.length - 1] !== '/') name += '/' + if (Buffer.byteLength(name) !== name.length) return null // utf-8 + + while (Buffer.byteLength(name) > 100) { + var i = name.indexOf('/') + if (i === -1) return null + prefix += prefix ? '/' + name.slice(0, i) : name.slice(0, i) + name = name.slice(i + 1) + } + + if (Buffer.byteLength(name) > 100 || Buffer.byteLength(prefix) > 155) return null + if (opts.linkname && Buffer.byteLength(opts.linkname) > 100) return null + + buf.write(name) + buf.write(encodeOct(opts.mode & MASK, 6), 100) + buf.write(encodeOct(opts.uid, 6), 108) + buf.write(encodeOct(opts.gid, 6), 116) + buf.write(encodeOct(opts.size, 11), 124) + buf.write(encodeOct((opts.mtime.getTime() / 1000) | 0, 11), 136) + + buf[156] = ZERO_OFFSET + toTypeflag(opts.type) + + if (opts.linkname) buf.write(opts.linkname, 157) + + USTAR_MAGIC.copy(buf, MAGIC_OFFSET) + USTAR_VER.copy(buf, VERSION_OFFSET) + if (opts.uname) buf.write(opts.uname, 265) + if (opts.gname) buf.write(opts.gname, 297) + buf.write(encodeOct(opts.devmajor || 0, 6), 329) + buf.write(encodeOct(opts.devminor || 0, 6), 337) + + if (prefix) buf.write(prefix, 345) + + buf.write(encodeOct(cksum(buf), 6), 148) + + return buf +} + +exports.decode = function (buf, filenameEncoding, allowUnknownFormat) { + var typeflag = buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET + + var name = decodeStr(buf, 0, 100, filenameEncoding) + var mode = decodeOct(buf, 100, 8) + var uid = decodeOct(buf, 108, 8) + var gid = decodeOct(buf, 116, 8) + var size = decodeOct(buf, 124, 12) + var mtime = decodeOct(buf, 136, 12) + var type = toType(typeflag) + var linkname = buf[157] === 0 ? null : decodeStr(buf, 157, 100, filenameEncoding) + var uname = decodeStr(buf, 265, 32) + var gname = decodeStr(buf, 297, 32) + var devmajor = decodeOct(buf, 329, 8) + var devminor = decodeOct(buf, 337, 8) + + var c = cksum(buf) + + // checksum is still initial value if header was null. + if (c === 8 * 32) return null + + // valid checksum + if (c !== decodeOct(buf, 148, 8)) throw new Error('Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?') + + if (USTAR_MAGIC.compare(buf, MAGIC_OFFSET, MAGIC_OFFSET + 6) === 0) { + // ustar (posix) format. + // prepend prefix, if present. + if (buf[345]) name = decodeStr(buf, 345, 155, filenameEncoding) + '/' + name + } else if (GNU_MAGIC.compare(buf, MAGIC_OFFSET, MAGIC_OFFSET + 6) === 0 && + GNU_VER.compare(buf, VERSION_OFFSET, VERSION_OFFSET + 2) === 0) { + // 'gnu'/'oldgnu' format. Similar to ustar, but has support for incremental and + // multi-volume tarballs. + } else { + if (!allowUnknownFormat) { + throw new Error('Invalid tar header: unknown format.') + } + } + + // to support old tar versions that use trailing / to indicate dirs + if (typeflag === 0 && name && name[name.length - 1] === '/') typeflag = 5 + + return { + name, + mode, + uid, + gid, + size, + mtime: new Date(1000 * mtime), + type, + linkname, + uname, + gname, + devmajor, + devminor + } +} + + +/***/ }), + +/***/ 2283: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +exports.extract = __nccwpck_require__(57882) +exports.pack = __nccwpck_require__(94930) + + +/***/ }), + +/***/ 94930: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var constants = __nccwpck_require__(73186) +var eos = __nccwpck_require__(81205) +var inherits = __nccwpck_require__(44124) +var alloc = Buffer.alloc + +var Readable = (__nccwpck_require__(51642).Readable) +var Writable = (__nccwpck_require__(51642).Writable) +var StringDecoder = (__nccwpck_require__(71576).StringDecoder) + +var headers = __nccwpck_require__(68860) + +var DMODE = parseInt('755', 8) +var FMODE = parseInt('644', 8) + +var END_OF_TAR = alloc(1024) + +var noop = function () {} + +var overflow = function (self, size) { + size &= 511 + if (size) self.push(END_OF_TAR.slice(0, 512 - size)) +} + +function modeToType (mode) { + switch (mode & constants.S_IFMT) { + case constants.S_IFBLK: return 'block-device' + case constants.S_IFCHR: return 'character-device' + case constants.S_IFDIR: return 'directory' + case constants.S_IFIFO: return 'fifo' + case constants.S_IFLNK: return 'symlink' + } + + return 'file' +} + +var Sink = function (to) { + Writable.call(this) + this.written = 0 + this._to = to + this._destroyed = false +} + +inherits(Sink, Writable) + +Sink.prototype._write = function (data, enc, cb) { + this.written += data.length + if (this._to.push(data)) return cb() + this._to._drain = cb +} + +Sink.prototype.destroy = function () { + if (this._destroyed) return + this._destroyed = true + this.emit('close') +} + +var LinkSink = function () { + Writable.call(this) + this.linkname = '' + this._decoder = new StringDecoder('utf-8') + this._destroyed = false +} + +inherits(LinkSink, Writable) + +LinkSink.prototype._write = function (data, enc, cb) { + this.linkname += this._decoder.write(data) + cb() +} + +LinkSink.prototype.destroy = function () { + if (this._destroyed) return + this._destroyed = true + this.emit('close') +} + +var Void = function () { + Writable.call(this) + this._destroyed = false +} + +inherits(Void, Writable) + +Void.prototype._write = function (data, enc, cb) { + cb(new Error('No body allowed for this entry')) +} + +Void.prototype.destroy = function () { + if (this._destroyed) return + this._destroyed = true + this.emit('close') +} + +var Pack = function (opts) { + if (!(this instanceof Pack)) return new Pack(opts) + Readable.call(this, opts) + + this._drain = noop + this._finalized = false + this._finalizing = false + this._destroyed = false + this._stream = null +} + +inherits(Pack, Readable) + +Pack.prototype.entry = function (header, buffer, callback) { + if (this._stream) throw new Error('already piping an entry') + if (this._finalized || this._destroyed) return + + if (typeof buffer === 'function') { + callback = buffer + buffer = null + } + + if (!callback) callback = noop + + var self = this + + if (!header.size || header.type === 'symlink') header.size = 0 + if (!header.type) header.type = modeToType(header.mode) + if (!header.mode) header.mode = header.type === 'directory' ? DMODE : FMODE + if (!header.uid) header.uid = 0 + if (!header.gid) header.gid = 0 + if (!header.mtime) header.mtime = new Date() + + if (typeof buffer === 'string') buffer = Buffer.from(buffer) + if (Buffer.isBuffer(buffer)) { + header.size = buffer.length + this._encode(header) + var ok = this.push(buffer) + overflow(self, header.size) + if (ok) process.nextTick(callback) + else this._drain = callback + return new Void() + } + + if (header.type === 'symlink' && !header.linkname) { + var linkSink = new LinkSink() + eos(linkSink, function (err) { + if (err) { // stream was closed + self.destroy() + return callback(err) + } + + header.linkname = linkSink.linkname + self._encode(header) + callback() + }) + + return linkSink + } + + this._encode(header) + + if (header.type !== 'file' && header.type !== 'contiguous-file') { + process.nextTick(callback) + return new Void() + } + + var sink = new Sink(this) + + this._stream = sink + + eos(sink, function (err) { + self._stream = null + + if (err) { // stream was closed + self.destroy() + return callback(err) + } + + if (sink.written !== header.size) { // corrupting tar + self.destroy() + return callback(new Error('size mismatch')) + } + + overflow(self, header.size) + if (self._finalizing) self.finalize() + callback() + }) + + return sink +} + +Pack.prototype.finalize = function () { + if (this._stream) { + this._finalizing = true + return + } + + if (this._finalized) return + this._finalized = true + this.push(END_OF_TAR) + this.push(null) +} + +Pack.prototype.destroy = function (err) { + if (this._destroyed) return + this._destroyed = true + + if (err) this.emit('error', err) + this.emit('close') + if (this._stream && this._stream.destroy) this._stream.destroy() +} + +Pack.prototype._encode = function (header) { + if (!header.pax) { + var buf = headers.encode(header) + if (buf) { + this.push(buf) + return + } + } + this._encodePax(header) +} + +Pack.prototype._encodePax = function (header) { + var paxHeader = headers.encodePax({ + name: header.name, + linkname: header.linkname, + pax: header.pax + }) + + var newHeader = { + name: 'PaxHeader', + mode: header.mode, + uid: header.uid, + gid: header.gid, + size: paxHeader.length, + mtime: header.mtime, + type: 'pax-header', + linkname: header.linkname && 'PaxHeader', + uname: header.uname, + gname: header.gname, + devmajor: header.devmajor, + devminor: header.devminor + } + + this.push(headers.encode(newHeader)) + this.push(paxHeader) + overflow(this, paxHeader.length) + + newHeader.size = header.size + newHeader.type = header.type + this.push(headers.encode(newHeader)) +} + +Pack.prototype._read = function (n) { + var drain = this._drain + this._drain = noop + drain() +} + +module.exports = Pack + + +/***/ }), + +/***/ 8517: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +/*! + * Tmp + * + * Copyright (c) 2011-2017 KARASZI Istvan + * + * MIT Licensed + */ + +/* + * Module dependencies. + */ +const fs = __nccwpck_require__(57147); +const os = __nccwpck_require__(22037); +const path = __nccwpck_require__(71017); +const crypto = __nccwpck_require__(6113); +const _c = { fs: fs.constants, os: os.constants }; +const rimraf = __nccwpck_require__(14959); + +/* + * The working inner variables. + */ +const + // the random characters to choose from + RANDOM_CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', + + TEMPLATE_PATTERN = /XXXXXX/, + + DEFAULT_TRIES = 3, + + CREATE_FLAGS = (_c.O_CREAT || _c.fs.O_CREAT) | (_c.O_EXCL || _c.fs.O_EXCL) | (_c.O_RDWR || _c.fs.O_RDWR), + + // constants are off on the windows platform and will not match the actual errno codes + IS_WIN32 = os.platform() === 'win32', + EBADF = _c.EBADF || _c.os.errno.EBADF, + ENOENT = _c.ENOENT || _c.os.errno.ENOENT, + + DIR_MODE = 0o700 /* 448 */, + FILE_MODE = 0o600 /* 384 */, + + EXIT = 'exit', + + // this will hold the objects need to be removed on exit + _removeObjects = [], + + // API change in fs.rmdirSync leads to error when passing in a second parameter, e.g. the callback + FN_RMDIR_SYNC = fs.rmdirSync.bind(fs), + FN_RIMRAF_SYNC = rimraf.sync; + +let + _gracefulCleanup = false; + +/** + * Gets a temporary file name. + * + * @param {(Options|tmpNameCallback)} options options or callback + * @param {?tmpNameCallback} callback the callback function + */ +function tmpName(options, callback) { + const + args = _parseArguments(options, callback), + opts = args[0], + cb = args[1]; + + try { + _assertAndSanitizeOptions(opts); + } catch (err) { + return cb(err); + } + + let tries = opts.tries; + (function _getUniqueName() { + try { + const name = _generateTmpName(opts); + + // check whether the path exists then retry if needed + fs.stat(name, function (err) { + /* istanbul ignore else */ + if (!err) { + /* istanbul ignore else */ + if (tries-- > 0) return _getUniqueName(); + + return cb(new Error('Could not get a unique tmp filename, max tries reached ' + name)); + } + + cb(null, name); + }); + } catch (err) { + cb(err); + } + }()); +} + +/** + * Synchronous version of tmpName. + * + * @param {Object} options + * @returns {string} the generated random name + * @throws {Error} if the options are invalid or could not generate a filename + */ +function tmpNameSync(options) { + const + args = _parseArguments(options), + opts = args[0]; + + _assertAndSanitizeOptions(opts); + + let tries = opts.tries; + do { + const name = _generateTmpName(opts); + try { + fs.statSync(name); + } catch (e) { + return name; + } + } while (tries-- > 0); + + throw new Error('Could not get a unique tmp filename, max tries reached'); +} + +/** + * Creates and opens a temporary file. + * + * @param {(Options|null|undefined|fileCallback)} options the config options or the callback function or null or undefined + * @param {?fileCallback} callback + */ +function file(options, callback) { + const + args = _parseArguments(options, callback), + opts = args[0], + cb = args[1]; + + // gets a temporary filename + tmpName(opts, function _tmpNameCreated(err, name) { + /* istanbul ignore else */ + if (err) return cb(err); + + // create and open the file + fs.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err, fd) { + /* istanbu ignore else */ + if (err) return cb(err); + + if (opts.discardDescriptor) { + return fs.close(fd, function _discardCallback(possibleErr) { + // the chance of getting an error on close here is rather low and might occur in the most edgiest cases only + return cb(possibleErr, name, undefined, _prepareTmpFileRemoveCallback(name, -1, opts, false)); + }); + } else { + // detachDescriptor passes the descriptor whereas discardDescriptor closes it, either way, we no longer care + // about the descriptor + const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor; + cb(null, name, fd, _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts, false)); + } + }); + }); +} + +/** + * Synchronous version of file. + * + * @param {Options} options + * @returns {FileSyncObject} object consists of name, fd and removeCallback + * @throws {Error} if cannot create a file + */ +function fileSync(options) { + const + args = _parseArguments(options), + opts = args[0]; + + const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor; + const name = tmpNameSync(opts); + var fd = fs.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE); + /* istanbul ignore else */ + if (opts.discardDescriptor) { + fs.closeSync(fd); + fd = undefined; + } + + return { + name: name, + fd: fd, + removeCallback: _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts, true) + }; +} + +/** + * Creates a temporary directory. + * + * @param {(Options|dirCallback)} options the options or the callback function + * @param {?dirCallback} callback + */ +function dir(options, callback) { + const + args = _parseArguments(options, callback), + opts = args[0], + cb = args[1]; + + // gets a temporary filename + tmpName(opts, function _tmpNameCreated(err, name) { + /* istanbul ignore else */ + if (err) return cb(err); + + // create the directory + fs.mkdir(name, opts.mode || DIR_MODE, function _dirCreated(err) { + /* istanbul ignore else */ + if (err) return cb(err); + + cb(null, name, _prepareTmpDirRemoveCallback(name, opts, false)); + }); + }); +} + +/** + * Synchronous version of dir. + * + * @param {Options} options + * @returns {DirSyncObject} object consists of name and removeCallback + * @throws {Error} if it cannot create a directory + */ +function dirSync(options) { + const + args = _parseArguments(options), + opts = args[0]; + + const name = tmpNameSync(opts); + fs.mkdirSync(name, opts.mode || DIR_MODE); + + return { + name: name, + removeCallback: _prepareTmpDirRemoveCallback(name, opts, true) + }; +} + +/** + * Removes files asynchronously. + * + * @param {Object} fdPath + * @param {Function} next + * @private + */ +function _removeFileAsync(fdPath, next) { + const _handler = function (err) { + if (err && !_isENOENT(err)) { + // reraise any unanticipated error + return next(err); + } + next(); + }; + + if (0 <= fdPath[0]) + fs.close(fdPath[0], function () { + fs.unlink(fdPath[1], _handler); + }); + else fs.unlink(fdPath[1], _handler); +} + +/** + * Removes files synchronously. + * + * @param {Object} fdPath + * @private + */ +function _removeFileSync(fdPath) { + let rethrownException = null; + try { + if (0 <= fdPath[0]) fs.closeSync(fdPath[0]); + } catch (e) { + // reraise any unanticipated error + if (!_isEBADF(e) && !_isENOENT(e)) throw e; + } finally { + try { + fs.unlinkSync(fdPath[1]); + } + catch (e) { + // reraise any unanticipated error + if (!_isENOENT(e)) rethrownException = e; + } + } + if (rethrownException !== null) { + throw rethrownException; + } +} + +/** + * Prepares the callback for removal of the temporary file. + * + * Returns either a sync callback or a async callback depending on whether + * fileSync or file was called, which is expressed by the sync parameter. + * + * @param {string} name the path of the file + * @param {number} fd file descriptor + * @param {Object} opts + * @param {boolean} sync + * @returns {fileCallback | fileCallbackSync} + * @private + */ +function _prepareTmpFileRemoveCallback(name, fd, opts, sync) { + const removeCallbackSync = _prepareRemoveCallback(_removeFileSync, [fd, name], sync); + const removeCallback = _prepareRemoveCallback(_removeFileAsync, [fd, name], sync, removeCallbackSync); + + if (!opts.keep) _removeObjects.unshift(removeCallbackSync); + + return sync ? removeCallbackSync : removeCallback; +} + +/** + * Prepares the callback for removal of the temporary directory. + * + * Returns either a sync callback or a async callback depending on whether + * tmpFileSync or tmpFile was called, which is expressed by the sync parameter. + * + * @param {string} name + * @param {Object} opts + * @param {boolean} sync + * @returns {Function} the callback + * @private + */ +function _prepareTmpDirRemoveCallback(name, opts, sync) { + const removeFunction = opts.unsafeCleanup ? rimraf : fs.rmdir.bind(fs); + const removeFunctionSync = opts.unsafeCleanup ? FN_RIMRAF_SYNC : FN_RMDIR_SYNC; + const removeCallbackSync = _prepareRemoveCallback(removeFunctionSync, name, sync); + const removeCallback = _prepareRemoveCallback(removeFunction, name, sync, removeCallbackSync); + if (!opts.keep) _removeObjects.unshift(removeCallbackSync); + + return sync ? removeCallbackSync : removeCallback; +} + +/** + * Creates a guarded function wrapping the removeFunction call. + * + * The cleanup callback is save to be called multiple times. + * Subsequent invocations will be ignored. + * + * @param {Function} removeFunction + * @param {string} fileOrDirName + * @param {boolean} sync + * @param {cleanupCallbackSync?} cleanupCallbackSync + * @returns {cleanupCallback | cleanupCallbackSync} + * @private + */ +function _prepareRemoveCallback(removeFunction, fileOrDirName, sync, cleanupCallbackSync) { + let called = false; + + // if sync is true, the next parameter will be ignored + return function _cleanupCallback(next) { + + /* istanbul ignore else */ + if (!called) { + // remove cleanupCallback from cache + const toRemove = cleanupCallbackSync || _cleanupCallback; + const index = _removeObjects.indexOf(toRemove); + /* istanbul ignore else */ + if (index >= 0) _removeObjects.splice(index, 1); + + called = true; + if (sync || removeFunction === FN_RMDIR_SYNC || removeFunction === FN_RIMRAF_SYNC) { + return removeFunction(fileOrDirName); + } else { + return removeFunction(fileOrDirName, next || function() {}); + } + } + }; +} + +/** + * The garbage collector. + * + * @private + */ +function _garbageCollector() { + /* istanbul ignore else */ + if (!_gracefulCleanup) return; + + // the function being called removes itself from _removeObjects, + // loop until _removeObjects is empty + while (_removeObjects.length) { + try { + _removeObjects[0](); + } catch (e) { + // already removed? + } + } +} + +/** + * Random name generator based on crypto. + * Adapted from http://blog.tompawlak.org/how-to-generate-random-values-nodejs-javascript + * + * @param {number} howMany + * @returns {string} the generated random name + * @private + */ +function _randomChars(howMany) { + let + value = [], + rnd = null; + + // make sure that we do not fail because we ran out of entropy + try { + rnd = crypto.randomBytes(howMany); + } catch (e) { + rnd = crypto.pseudoRandomBytes(howMany); + } + + for (var i = 0; i < howMany; i++) { + value.push(RANDOM_CHARS[rnd[i] % RANDOM_CHARS.length]); + } + + return value.join(''); +} + +/** + * Helper which determines whether a string s is blank, that is undefined, or empty or null. + * + * @private + * @param {string} s + * @returns {Boolean} true whether the string s is blank, false otherwise + */ +function _isBlank(s) { + return s === null || _isUndefined(s) || !s.trim(); +} + +/** + * Checks whether the `obj` parameter is defined or not. + * + * @param {Object} obj + * @returns {boolean} true if the object is undefined + * @private + */ +function _isUndefined(obj) { + return typeof obj === 'undefined'; +} + +/** + * Parses the function arguments. + * + * This function helps to have optional arguments. + * + * @param {(Options|null|undefined|Function)} options + * @param {?Function} callback + * @returns {Array} parsed arguments + * @private + */ +function _parseArguments(options, callback) { + /* istanbul ignore else */ + if (typeof options === 'function') { + return [{}, options]; + } + + /* istanbul ignore else */ + if (_isUndefined(options)) { + return [{}, callback]; + } + + // copy options so we do not leak the changes we make internally + const actualOptions = {}; + for (const key of Object.getOwnPropertyNames(options)) { + actualOptions[key] = options[key]; + } + + return [actualOptions, callback]; +} + +/** + * Generates a new temporary name. + * + * @param {Object} opts + * @returns {string} the new random name according to opts + * @private + */ +function _generateTmpName(opts) { + + const tmpDir = opts.tmpdir; + + /* istanbul ignore else */ + if (!_isUndefined(opts.name)) + return path.join(tmpDir, opts.dir, opts.name); + + /* istanbul ignore else */ + if (!_isUndefined(opts.template)) + return path.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6)); + + // prefix and postfix + const name = [ + opts.prefix ? opts.prefix : 'tmp', + '-', + process.pid, + '-', + _randomChars(12), + opts.postfix ? '-' + opts.postfix : '' + ].join(''); + + return path.join(tmpDir, opts.dir, name); +} + +/** + * Asserts whether the specified options are valid, also sanitizes options and provides sane defaults for missing + * options. + * + * @param {Options} options + * @private + */ +function _assertAndSanitizeOptions(options) { + + options.tmpdir = _getTmpDir(options); + + const tmpDir = options.tmpdir; + + /* istanbul ignore else */ + if (!_isUndefined(options.name)) + _assertIsRelative(options.name, 'name', tmpDir); + /* istanbul ignore else */ + if (!_isUndefined(options.dir)) + _assertIsRelative(options.dir, 'dir', tmpDir); + /* istanbul ignore else */ + if (!_isUndefined(options.template)) { + _assertIsRelative(options.template, 'template', tmpDir); + if (!options.template.match(TEMPLATE_PATTERN)) + throw new Error(`Invalid template, found "${options.template}".`); + } + /* istanbul ignore else */ + if (!_isUndefined(options.tries) && isNaN(options.tries) || options.tries < 0) + throw new Error(`Invalid tries, found "${options.tries}".`); + + // if a name was specified we will try once + options.tries = _isUndefined(options.name) ? options.tries || DEFAULT_TRIES : 1; + options.keep = !!options.keep; + options.detachDescriptor = !!options.detachDescriptor; + options.discardDescriptor = !!options.discardDescriptor; + options.unsafeCleanup = !!options.unsafeCleanup; + + // sanitize dir, also keep (multiple) blanks if the user, purportedly sane, requests us to + options.dir = _isUndefined(options.dir) ? '' : path.relative(tmpDir, _resolvePath(options.dir, tmpDir)); + options.template = _isUndefined(options.template) ? undefined : path.relative(tmpDir, _resolvePath(options.template, tmpDir)); + // sanitize further if template is relative to options.dir + options.template = _isBlank(options.template) ? undefined : path.relative(options.dir, options.template); + + // for completeness' sake only, also keep (multiple) blanks if the user, purportedly sane, requests us to + options.name = _isUndefined(options.name) ? undefined : _sanitizeName(options.name); + options.prefix = _isUndefined(options.prefix) ? '' : options.prefix; + options.postfix = _isUndefined(options.postfix) ? '' : options.postfix; +} + +/** + * Resolve the specified path name in respect to tmpDir. + * + * The specified name might include relative path components, e.g. ../ + * so we need to resolve in order to be sure that is is located inside tmpDir + * + * @param name + * @param tmpDir + * @returns {string} + * @private + */ +function _resolvePath(name, tmpDir) { + const sanitizedName = _sanitizeName(name); + if (sanitizedName.startsWith(tmpDir)) { + return path.resolve(sanitizedName); + } else { + return path.resolve(path.join(tmpDir, sanitizedName)); + } +} + +/** + * Sanitize the specified path name by removing all quote characters. + * + * @param name + * @returns {string} + * @private + */ +function _sanitizeName(name) { + if (_isBlank(name)) { + return name; + } + return name.replace(/["']/g, ''); +} + +/** + * Asserts whether specified name is relative to the specified tmpDir. + * + * @param {string} name + * @param {string} option + * @param {string} tmpDir + * @throws {Error} + * @private + */ +function _assertIsRelative(name, option, tmpDir) { + if (option === 'name') { + // assert that name is not absolute and does not contain a path + if (path.isAbsolute(name)) + throw new Error(`${option} option must not contain an absolute path, found "${name}".`); + // must not fail on valid . or .. or similar such constructs + let basename = path.basename(name); + if (basename === '..' || basename === '.' || basename !== name) + throw new Error(`${option} option must not contain a path, found "${name}".`); + } + else { // if (option === 'dir' || option === 'template') { + // assert that dir or template are relative to tmpDir + if (path.isAbsolute(name) && !name.startsWith(tmpDir)) { + throw new Error(`${option} option must be relative to "${tmpDir}", found "${name}".`); + } + let resolvedPath = _resolvePath(name, tmpDir); + if (!resolvedPath.startsWith(tmpDir)) + throw new Error(`${option} option must be relative to "${tmpDir}", found "${resolvedPath}".`); + } +} + +/** + * Helper for testing against EBADF to compensate changes made to Node 7.x under Windows. + * + * @private + */ +function _isEBADF(error) { + return _isExpectedError(error, -EBADF, 'EBADF'); +} + +/** + * Helper for testing against ENOENT to compensate changes made to Node 7.x under Windows. + * + * @private + */ +function _isENOENT(error) { + return _isExpectedError(error, -ENOENT, 'ENOENT'); +} + +/** + * Helper to determine whether the expected error code matches the actual code and errno, + * which will differ between the supported node versions. + * + * - Node >= 7.0: + * error.code {string} + * error.errno {number} any numerical value will be negated + * + * CAVEAT + * + * On windows, the errno for EBADF is -4083 but os.constants.errno.EBADF is different and we must assume that ENOENT + * is no different here. + * + * @param {SystemError} error + * @param {number} errno + * @param {string} code + * @private + */ +function _isExpectedError(error, errno, code) { + return IS_WIN32 ? error.code === code : error.code === code && error.errno === errno; +} + +/** + * Sets the graceful cleanup. + * + * If graceful cleanup is set, tmp will remove all controlled temporary objects on process exit, otherwise the + * temporary objects will remain in place, waiting to be cleaned up on system restart or otherwise scheduled temporary + * object removals. + */ +function setGracefulCleanup() { + _gracefulCleanup = true; +} + +/** + * Returns the currently configured tmp dir from os.tmpdir(). + * + * @private + * @param {?Options} options + * @returns {string} the currently configured tmp dir + */ +function _getTmpDir(options) { + return path.resolve(_sanitizeName(options && options.tmpdir || os.tmpdir())); +} + +// Install process exit listener +process.addListener(EXIT, _garbageCollector); + +/** + * Configuration options. + * + * @typedef {Object} Options + * @property {?boolean} keep the temporary object (file or dir) will not be garbage collected + * @property {?number} tries the number of tries before give up the name generation + * @property (?int) mode the access mode, defaults are 0o700 for directories and 0o600 for files + * @property {?string} template the "mkstemp" like filename template + * @property {?string} name fixed name relative to tmpdir or the specified dir option + * @property {?string} dir tmp directory relative to the root tmp directory in use + * @property {?string} prefix prefix for the generated name + * @property {?string} postfix postfix for the generated name + * @property {?string} tmpdir the root tmp directory which overrides the os tmpdir + * @property {?boolean} unsafeCleanup recursively removes the created temporary directory, even when it's not empty + * @property {?boolean} detachDescriptor detaches the file descriptor, caller is responsible for closing the file, tmp will no longer try closing the file during garbage collection + * @property {?boolean} discardDescriptor discards the file descriptor (closes file, fd is -1), tmp will no longer try closing the file during garbage collection + */ + +/** + * @typedef {Object} FileSyncObject + * @property {string} name the name of the file + * @property {string} fd the file descriptor or -1 if the fd has been discarded + * @property {fileCallback} removeCallback the callback function to remove the file + */ + +/** + * @typedef {Object} DirSyncObject + * @property {string} name the name of the directory + * @property {fileCallback} removeCallback the callback function to remove the directory + */ + +/** + * @callback tmpNameCallback + * @param {?Error} err the error object if anything goes wrong + * @param {string} name the temporary file name + */ + +/** + * @callback fileCallback + * @param {?Error} err the error object if anything goes wrong + * @param {string} name the temporary file name + * @param {number} fd the file descriptor or -1 if the fd had been discarded + * @param {cleanupCallback} fn the cleanup callback function + */ + +/** + * @callback fileCallbackSync + * @param {?Error} err the error object if anything goes wrong + * @param {string} name the temporary file name + * @param {number} fd the file descriptor or -1 if the fd had been discarded + * @param {cleanupCallbackSync} fn the cleanup callback function + */ + +/** + * @callback dirCallback + * @param {?Error} err the error object if anything goes wrong + * @param {string} name the temporary file name + * @param {cleanupCallback} fn the cleanup callback function + */ + +/** + * @callback dirCallbackSync + * @param {?Error} err the error object if anything goes wrong + * @param {string} name the temporary file name + * @param {cleanupCallbackSync} fn the cleanup callback function + */ + +/** + * Removes the temporary created file or directory. + * + * @callback cleanupCallback + * @param {simpleCallback} [next] function to call whenever the tmp object needs to be removed + */ + +/** + * Removes the temporary created file or directory. + * + * @callback cleanupCallbackSync + */ + +/** + * Callback function for function composition. + * @see {@link https://github.com/raszi/node-tmp/issues/57|raszi/node-tmp#57} + * + * @callback simpleCallback + */ + +// exporting all the needed methods + +// evaluate _getTmpDir() lazily, mainly for simplifying testing but it also will +// allow users to reconfigure the temporary directory +Object.defineProperty(module.exports, "tmpdir", ({ + enumerable: true, + configurable: false, + get: function () { + return _getTmpDir(); + } +})); + +module.exports.dir = dir; +module.exports.dirSync = dirSync; + +module.exports.file = file; +module.exports.fileSync = fileSync; + +module.exports.tmpName = tmpName; +module.exports.tmpNameSync = tmpNameSync; + +module.exports.setGracefulCleanup = setGracefulCleanup; + + +/***/ }), + +/***/ 88375: +/***/ ((module) => { + +// Copied from https://github.com/nodejs/node/blob/master/lib/internal/constants.js +module.exports = { + CHAR_FORWARD_SLASH: 47, /* / */ +}; + + +/***/ }), + +/***/ 61858: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +const path = __nccwpck_require__(71017); + +exports.codes = { + ERR_INPUT_TYPE_NOT_ALLOWED: createErrorCtor(joinArgs('ERR_INPUT_TYPE_NOT_ALLOWED')), + ERR_INVALID_ARG_VALUE: createErrorCtor(joinArgs('ERR_INVALID_ARG_VALUE')), + ERR_INVALID_MODULE_SPECIFIER: createErrorCtor(joinArgs('ERR_INVALID_MODULE_SPECIFIER')), + ERR_INVALID_PACKAGE_CONFIG: createErrorCtor(joinArgs('ERR_INVALID_PACKAGE_CONFIG')), + ERR_INVALID_PACKAGE_TARGET: createErrorCtor(joinArgs('ERR_INVALID_PACKAGE_TARGET')), + ERR_MANIFEST_DEPENDENCY_MISSING: createErrorCtor(joinArgs('ERR_MANIFEST_DEPENDENCY_MISSING')), + ERR_MODULE_NOT_FOUND: createErrorCtor((path, base, type = 'package') => { + return `Cannot find ${type} '${path}' imported from ${base}` + }), + ERR_PACKAGE_IMPORT_NOT_DEFINED: createErrorCtor(joinArgs('ERR_PACKAGE_IMPORT_NOT_DEFINED')), + ERR_PACKAGE_PATH_NOT_EXPORTED: createErrorCtor(joinArgs('ERR_PACKAGE_PATH_NOT_EXPORTED')), + ERR_UNSUPPORTED_DIR_IMPORT: createErrorCtor(joinArgs('ERR_UNSUPPORTED_DIR_IMPORT')), + ERR_UNSUPPORTED_ESM_URL_SCHEME: createErrorCtor(joinArgs('ERR_UNSUPPORTED_ESM_URL_SCHEME')), + ERR_UNKNOWN_FILE_EXTENSION: createErrorCtor(joinArgs('ERR_UNKNOWN_FILE_EXTENSION')), +} + +function joinArgs(name) { + return (...args) => { + return [name, ...args].join(' ') + } +} + +function createErrorCtor(errorMessageCreator) { + return class CustomError extends Error { + constructor(...args) { + super(errorMessageCreator(...args)) + } + } +} +exports.createErrRequireEsm = createErrRequireEsm; + +// Native ERR_REQUIRE_ESM Error is declared here: +// https://github.com/nodejs/node/blob/2d5d77306f6dff9110c1f77fefab25f973415770/lib/internal/errors.js#L1294-L1313 +// Error class factory is implemented here: +// function E: https://github.com/nodejs/node/blob/2d5d77306f6dff9110c1f77fefab25f973415770/lib/internal/errors.js#L323-L341 +// function makeNodeErrorWithCode: https://github.com/nodejs/node/blob/2d5d77306f6dff9110c1f77fefab25f973415770/lib/internal/errors.js#L251-L278 +// The code below should create an error that matches the native error as closely as possible. +// Third-party libraries which attempt to catch the native ERR_REQUIRE_ESM should recognize our imitation error. +function createErrRequireEsm(filename, parentPath, packageJsonPath) { + const code = 'ERR_REQUIRE_ESM' + const err = new Error(getErrRequireEsmMessage(filename, parentPath, packageJsonPath)) + // Set `name` to be used in stack trace, generate stack trace with that name baked in, then re-declare the `name` field. + // This trick is copied from node's source. + err.name = `Error [${ code }]` + err.stack + Object.defineProperty(err, 'name', { + value: 'Error', + enumerable: false, + writable: true, + configurable: true + }) + err.code = code + return err +} + +// Copy-pasted from https://github.com/nodejs/node/blob/b533fb3508009e5f567cc776daba8fbf665386a6/lib/internal/errors.js#L1293-L1311 +// so that our error message is identical to the native message. +function getErrRequireEsmMessage(filename, parentPath = null, packageJsonPath = null) { + const ext = path.extname(filename) + let msg = `Must use import to load ES Module: ${filename}`; + if (parentPath && packageJsonPath) { + const path = __nccwpck_require__(71017); + const basename = path.basename(filename) === path.basename(parentPath) ? + filename : path.basename(filename); + msg += + '\nrequire() of ES modules is not supported.\nrequire() of ' + + `${filename} ${parentPath ? `from ${parentPath} ` : ''}` + + `is an ES module file as it is a ${ext} file whose nearest parent ` + + `package.json contains "type": "module" which defines all ${ext} ` + + 'files in that package scope as ES modules.\nInstead ' + + 'change the requiring code to use ' + + 'import(), or remove "type": "module" from ' + + `${packageJsonPath}.\n`; + return msg; + } + return msg; +} + + +/***/ }), + +/***/ 66755: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +// Copied from https://github.com/nodejs/node/blob/v17.0.1/lib/internal/modules/cjs/helpers.js + + + +const { + ArrayPrototypeForEach, + ObjectDefineProperty, + ObjectPrototypeHasOwnProperty, + SafeSet, + StringPrototypeIncludes, + StringPrototypeStartsWith, +} = __nccwpck_require__(26326); + +const { getOptionValue } = __nccwpck_require__(40690); +const userConditions = getOptionValue('--conditions'); + +const noAddons = getOptionValue('--no-addons'); +const addonConditions = noAddons ? [] : ['node-addons']; + +// TODO: Use this set when resolving pkg#exports conditions in loader.js. +const cjsConditions = new SafeSet([ + 'require', + 'node', + ...addonConditions, + ...userConditions, +]); + +/** + * @param {any} object + * @param {string} [dummyModuleName] + * @return {void} + */ +function addBuiltinLibsToObject(object, dummyModuleName) { + // Make built-in modules available directly (loaded lazily). + const Module = (__nccwpck_require__(98188).Module); + const { builtinModules } = Module; + + // To require built-in modules in user-land and ignore modules whose + // `canBeRequiredByUsers` is false. So we create a dummy module object and not + // use `require()` directly. + const dummyModule = new Module(dummyModuleName); + + ArrayPrototypeForEach(builtinModules, (name) => { + // Neither add underscored modules, nor ones that contain slashes (e.g., + // 'fs/promises') or ones that are already defined. + if (StringPrototypeStartsWith(name, '_') || + StringPrototypeIncludes(name, '/') || + ObjectPrototypeHasOwnProperty(object, name)) { + return; + } + // Goals of this mechanism are: + // - Lazy loading of built-in modules + // - Having all built-in modules available as non-enumerable properties + // - Allowing the user to re-assign these variables as if there were no + // pre-existing globals with the same name. + + const setReal = (val) => { + // Deleting the property before re-assigning it disables the + // getter/setter mechanism. + delete object[name]; + object[name] = val; + }; + + ObjectDefineProperty(object, name, { + get: () => { + // Node 12 hack; remove when we drop node12 support + const lib = (dummyModule.require || require)(name); + + // Disable the current getter/setter and set up a new + // non-enumerable property. + delete object[name]; + ObjectDefineProperty(object, name, { + get: () => lib, + set: setReal, + configurable: true, + enumerable: false + }); + + return lib; + }, + set: setReal, + configurable: true, + enumerable: false + }); + }); +} + +exports.addBuiltinLibsToObject = addBuiltinLibsToObject; +exports.cjsConditions = cjsConditions; + + +/***/ }), + +/***/ 51633: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// Copied from several files in node's source code. +// https://github.com/nodejs/node/blob/2d5d77306f6dff9110c1f77fefab25f973415770/lib/internal/modules/cjs/loader.js +// Each function and variable below must have a comment linking to the source in node's github repo. + + + +const { + ArrayIsArray, + ArrayPrototypeIncludes, + ArrayPrototypeJoin, + ArrayPrototypePush, + JSONParse, + ObjectKeys, + RegExpPrototypeTest, + SafeMap, + SafeWeakMap, + StringPrototypeCharCodeAt, + StringPrototypeEndsWith, + StringPrototypeLastIndexOf, + StringPrototypeIndexOf, + StringPrototypeMatch, + StringPrototypeSlice, + StringPrototypeStartsWith, +} = __nccwpck_require__(26326); +const { NativeModule } = __nccwpck_require__(81597); +const { pathToFileURL, fileURLToPath } = __nccwpck_require__(57310); +const fs = __nccwpck_require__(57147); +const path = __nccwpck_require__(71017); +const { sep } = path; +const { internalModuleStat } = __nccwpck_require__(3601); +const packageJsonReader = __nccwpck_require__(53348); +const { + cjsConditions, +} = __nccwpck_require__(66755); +const { getOptionValue } = __nccwpck_require__(40690); +const preserveSymlinks = getOptionValue('--preserve-symlinks'); +const preserveSymlinksMain = getOptionValue('--preserve-symlinks-main'); +const {normalizeSlashes} = __nccwpck_require__(64745); +const {createErrRequireEsm} = __nccwpck_require__(61858); +const { + codes: { + ERR_INVALID_MODULE_SPECIFIER, + }, +} = __nccwpck_require__(61858); + +const { + CHAR_FORWARD_SLASH, +} = __nccwpck_require__(88375); + +const Module = __nccwpck_require__(98188); + +const isWindows = process.platform === 'win32'; + +let statCache = null; + +function stat(filename) { + filename = path.toNamespacedPath(filename); + if (statCache !== null) { + const result = statCache.get(filename); + if (result !== undefined) return result; + } + const result = internalModuleStat(filename); + if (statCache !== null && result >= 0) { + // Only set cache when `internalModuleStat(filename)` succeeds. + statCache.set(filename, result); + } + return result; +} + +// Note: +// we cannot get access to node's internal cache, which is populated from +// within node's Module constructor. So the cache here will always be empty. +// It's possible we could approximate our own cache by building it up with +// hacky workarounds, but it's not worth the complexity and flakiness. +const moduleParentCache = new SafeWeakMap(); + +// Given a module name, and a list of paths to test, returns the first +// matching file in the following precedence. +// +// require("a.") +// -> a. +// +// require("a") +// -> a +// -> a. +// -> a/index. + +const packageJsonCache = new SafeMap(); + +function readPackage(requestPath) { + const jsonPath = path.resolve(requestPath, 'package.json'); + + const existing = packageJsonCache.get(jsonPath); + if (existing !== undefined) return existing; + + const result = packageJsonReader.read(jsonPath); + const json = result.containsKeys === false ? '{}' : result.string; + if (json === undefined) { + packageJsonCache.set(jsonPath, false); + return false; + } + + try { + const parsed = JSONParse(json); + const filtered = { + name: parsed.name, + main: parsed.main, + exports: parsed.exports, + imports: parsed.imports, + type: parsed.type + }; + packageJsonCache.set(jsonPath, filtered); + return filtered; + } catch (e) { + e.path = jsonPath; + e.message = 'Error parsing ' + jsonPath + ': ' + e.message; + throw e; + } +} + +function readPackageScope(checkPath) { + const rootSeparatorIndex = StringPrototypeIndexOf(checkPath, sep); + let separatorIndex; + do { + separatorIndex = StringPrototypeLastIndexOf(checkPath, sep); + checkPath = StringPrototypeSlice(checkPath, 0, separatorIndex); + if (StringPrototypeEndsWith(checkPath, sep + 'node_modules')) + return false; + const pjson = readPackage(checkPath + sep); + if (pjson) return { + data: pjson, + path: checkPath, + }; + } while (separatorIndex > rootSeparatorIndex); + return false; +} + +/** + * @param {{ + * nodeEsmResolver: ReturnType, + * extensions: import('../src/file-extensions').Extensions, + * preferTsExts + * }} opts + */ +function createCjsLoader(opts) { +const {nodeEsmResolver, preferTsExts} = opts; +const {replacementsForCjs, replacementsForJs, replacementsForMjs, replacementsForJsx} = opts.extensions; +const { + encodedSepRegEx, + packageExportsResolve, + packageImportsResolve +} = nodeEsmResolver; + +function tryPackage(requestPath, exts, isMain, originalPath) { + // const pkg = readPackage(requestPath)?.main; + const tmp = readPackage(requestPath) + const pkg = tmp != null ? tmp.main : undefined; + + if (!pkg) { + return tryExtensions(path.resolve(requestPath, 'index'), exts, isMain); + } + + const filename = path.resolve(requestPath, pkg); + let actual = tryReplacementExtensions(filename, isMain) || + tryFile(filename, isMain) || + tryExtensions(filename, exts, isMain) || + tryExtensions(path.resolve(filename, 'index'), exts, isMain); + if (actual === false) { + actual = tryExtensions(path.resolve(requestPath, 'index'), exts, isMain); + if (!actual) { + // eslint-disable-next-line no-restricted-syntax + const err = new Error( + `Cannot find module '${filename}'. ` + + 'Please verify that the package.json has a valid "main" entry' + ); + err.code = 'MODULE_NOT_FOUND'; + err.path = path.resolve(requestPath, 'package.json'); + err.requestPath = originalPath; + // TODO(BridgeAR): Add the requireStack as well. + throw err; + } else { + const jsonPath = path.resolve(requestPath, 'package.json'); + process.emitWarning( + `Invalid 'main' field in '${jsonPath}' of '${pkg}'. ` + + 'Please either fix that or report it to the module author', + 'DeprecationWarning', + 'DEP0128' + ); + } + } + return actual; +} + +// In order to minimize unnecessary lstat() calls, +// this cache is a list of known-real paths. +// Set to an empty Map to reset. +const realpathCache = new SafeMap(); + +// Check if the file exists and is not a directory +// if using --preserve-symlinks and isMain is false, +// keep symlinks intact, otherwise resolve to the +// absolute realpath. +function tryFile(requestPath, isMain) { + const rc = stat(requestPath); + if (rc !== 0) return; + if (preserveSymlinks && !isMain) { + return path.resolve(requestPath); + } + return toRealPath(requestPath); +} + +function toRealPath(requestPath) { + return fs.realpathSync(requestPath, { + // [internalFS.realpathCacheKey]: realpathCache + }); +} + +function statReplacementExtensions(p) { + const lastDotIndex = p.lastIndexOf('.'); + if(lastDotIndex >= 0) { + const ext = p.slice(lastDotIndex); + if (ext === '.js' || ext === '.jsx' || ext === '.mjs' || ext === '.cjs') { + const pathnameWithoutExtension = p.slice(0, lastDotIndex); + const replacementExts = + ext === '.js' ? replacementsForJs + : ext === '.jsx' ? replacementsForJsx + : ext === '.mjs' ? replacementsForMjs + : replacementsForCjs; + for (let i = 0; i < replacementExts.length; i++) { + const filename = pathnameWithoutExtension + replacementExts[i]; + const rc = stat(filename); + if (rc === 0) { + return [rc, filename]; + } + } + } + } + return [stat(p), p]; +} +function tryReplacementExtensions(p, isMain) { + const lastDotIndex = p.lastIndexOf('.'); + if(lastDotIndex >= 0) { + const ext = p.slice(lastDotIndex); + if (ext === '.js' || ext === '.jsx' || ext === '.mjs' || ext === '.cjs') { + const pathnameWithoutExtension = p.slice(0, lastDotIndex); + const replacementExts = + ext === '.js' ? replacementsForJs + : ext === '.jsx' ? replacementsForJsx + : ext === '.mjs' ? replacementsForMjs + : replacementsForCjs; + for (let i = 0; i < replacementExts.length; i++) { + const filename = tryFile(pathnameWithoutExtension + replacementExts[i], isMain); + if (filename) { + return filename; + } + } + } + } + return false; +} + +// Given a path, check if the file exists with any of the set extensions +function tryExtensions(p, exts, isMain) { + for (let i = 0; i < exts.length; i++) { + const filename = tryFile(p + exts[i], isMain); + + if (filename) { + return filename; + } + } + return false; +} + +function trySelfParentPath(parent) { + if (!parent) return false; + + if (parent.filename) { + return parent.filename; + } else if (parent.id === '' || parent.id === 'internal/preload') { + try { + return process.cwd() + path.sep; + } catch { + return false; + } + } +} + +function trySelf(parentPath, request) { + if (!parentPath) return false; + + const { data: pkg, path: pkgPath } = readPackageScope(parentPath) || {}; + if (!pkg || pkg.exports === undefined) return false; + if (typeof pkg.name !== 'string') return false; + + let expansion; + if (request === pkg.name) { + expansion = '.'; + } else if (StringPrototypeStartsWith(request, `${pkg.name}/`)) { + expansion = '.' + StringPrototypeSlice(request, pkg.name.length); + } else { + return false; + } + + try { + return finalizeEsmResolution(packageExportsResolve( + pathToFileURL(pkgPath + '/package.json'), expansion, pkg, + pathToFileURL(parentPath), cjsConditions).resolved, parentPath, pkgPath); + } catch (e) { + if (e.code === 'ERR_MODULE_NOT_FOUND') + throw createEsmNotFoundErr(request, pkgPath + '/package.json'); + throw e; + } +} + +// This only applies to requests of a specific form: +// 1. name/.* +// 2. @scope/name/.* +const EXPORTS_PATTERN = /^((?:@[^/\\%]+\/)?[^./\\%][^/\\%]*)(\/.*)?$/; +function resolveExports(nmPath, request) { + // The implementation's behavior is meant to mirror resolution in ESM. + const { 1: name, 2: expansion = '' } = + StringPrototypeMatch(request, EXPORTS_PATTERN) || []; + if (!name) + return; + const pkgPath = path.resolve(nmPath, name); + const pkg = readPackage(pkgPath); + // if (pkg?.exports != null) { + if (pkg != null && pkg.exports != null) { + try { + return finalizeEsmResolution(packageExportsResolve( + pathToFileURL(pkgPath + '/package.json'), '.' + expansion, pkg, null, + cjsConditions).resolved, null, pkgPath); + } catch (e) { + if (e.code === 'ERR_MODULE_NOT_FOUND') + throw createEsmNotFoundErr(request, pkgPath + '/package.json'); + throw e; + } + } +} + +// Backwards compat for old node versions +const hasModulePathCache = !!(__nccwpck_require__(98188)._pathCache); +const Module_pathCache = Object.create(null); +const Module_pathCache_get = hasModulePathCache ? (cacheKey) => Module._pathCache[cacheKey] : (cacheKey) => Module_pathCache[cacheKey]; +const Module_pathCache_set = hasModulePathCache ? (cacheKey, value) => (Module._pathCache[cacheKey] = value) : (cacheKey) => (Module_pathCache[cacheKey] = value); + +const trailingSlashRegex = /(?:^|\/)\.?\.$/; +const Module_findPath = function _findPath(request, paths, isMain) { + const absoluteRequest = path.isAbsolute(request); + if (absoluteRequest) { + paths = ['']; + } else if (!paths || paths.length === 0) { + return false; + } + + const cacheKey = request + '\x00' + ArrayPrototypeJoin(paths, '\x00'); + const entry = Module_pathCache_get(cacheKey); + if (entry) + return entry; + + let exts; + let trailingSlash = request.length > 0 && + StringPrototypeCharCodeAt(request, request.length - 1) === + CHAR_FORWARD_SLASH; + if (!trailingSlash) { + trailingSlash = RegExpPrototypeTest(trailingSlashRegex, request); + } + + // For each path + for (let i = 0; i < paths.length; i++) { + // Don't search further if path doesn't exist + const curPath = paths[i]; + if (curPath && stat(curPath) < 1) continue; + + if (!absoluteRequest) { + const exportsResolved = resolveExports(curPath, request); + if (exportsResolved) + return exportsResolved; + } + + const _basePath = path.resolve(curPath, request); + let filename; + + const [rc, basePath] = statReplacementExtensions(_basePath); + if (!trailingSlash) { + if (rc === 0) { // File. + if (!isMain) { + if (preserveSymlinks) { + filename = path.resolve(basePath); + } else { + filename = toRealPath(basePath); + } + } else if (preserveSymlinksMain) { + // For the main module, we use the preserveSymlinksMain flag instead + // mainly for backward compatibility, as the preserveSymlinks flag + // historically has not applied to the main module. Most likely this + // was intended to keep .bin/ binaries working, as following those + // symlinks is usually required for the imports in the corresponding + // files to resolve; that said, in some use cases following symlinks + // causes bigger problems which is why the preserveSymlinksMain option + // is needed. + filename = path.resolve(basePath); + } else { + filename = toRealPath(basePath); + } + } + + if (!filename) { + // Try it with each of the extensions + if (exts === undefined) + exts = ObjectKeys(Module._extensions); + filename = tryExtensions(basePath, exts, isMain); + } + } + + if (!filename && rc === 1) { // Directory. + // try it with each of the extensions at "index" + if (exts === undefined) + exts = ObjectKeys(Module._extensions); + filename = tryPackage(basePath, exts, isMain, request); + } + + if (filename) { + Module_pathCache_set(cacheKey, filename); + return filename; + } + } + + return false; +}; + +const Module_resolveFilename = function _resolveFilename(request, parent, isMain, options) { + if (StringPrototypeStartsWith(request, 'node:') || + NativeModule.canBeRequiredByUsers(request)) { + return request; + } + + let paths; + + if (typeof options === 'object' && options !== null) { + if (ArrayIsArray(options.paths)) { + const isRelative = StringPrototypeStartsWith(request, './') || + StringPrototypeStartsWith(request, '../') || + ((isWindows && StringPrototypeStartsWith(request, '.\\')) || + StringPrototypeStartsWith(request, '..\\')); + + if (isRelative) { + paths = options.paths; + } else { + const fakeParent = new Module('', null); + + paths = []; + + for (let i = 0; i < options.paths.length; i++) { + const path = options.paths[i]; + fakeParent.paths = Module._nodeModulePaths(path); + const lookupPaths = Module._resolveLookupPaths(request, fakeParent); + + for (let j = 0; j < lookupPaths.length; j++) { + if (!ArrayPrototypeIncludes(paths, lookupPaths[j])) + ArrayPrototypePush(paths, lookupPaths[j]); + } + } + } + } else if (options.paths === undefined) { + paths = Module._resolveLookupPaths(request, parent); + } else { + throw new ERR_INVALID_ARG_VALUE('options.paths', options.paths); + } + } else { + paths = Module._resolveLookupPaths(request, parent); + } + + // if (parent?.filename) { + // node 12 hack + if (parent != null && parent.filename) { + if (request[0] === '#') { + const pkg = readPackageScope(parent.filename) || {}; + + // if (pkg.data?.imports != null) { + // node 12 hack + if (pkg.data != null && pkg.data.imports != null) { + try { + return finalizeEsmResolution( + packageImportsResolve(request, pathToFileURL(parent.filename), + cjsConditions), parent.filename, + pkg.path); + } catch (e) { + if (e.code === 'ERR_MODULE_NOT_FOUND') + throw createEsmNotFoundErr(request); + throw e; + } + } + } + } + + // Try module self resolution first + const parentPath = trySelfParentPath(parent); + const selfResolved = trySelf(parentPath, request); + if (selfResolved) { + const cacheKey = request + '\x00' + + (paths.length === 1 ? paths[0] : ArrayPrototypeJoin(paths, '\x00')); + Module._pathCache[cacheKey] = selfResolved; + return selfResolved; + } + + // Look up the filename first, since that's the cache key. + const filename = Module._findPath(request, paths, isMain, false); + if (filename) return filename; + const requireStack = []; + for (let cursor = parent; + cursor; + cursor = moduleParentCache.get(cursor)) { + ArrayPrototypePush(requireStack, cursor.filename || cursor.id); + } + let message = `Cannot find module '${request}'`; + if (requireStack.length > 0) { + message = message + '\nRequire stack:\n- ' + + ArrayPrototypeJoin(requireStack, '\n- '); + } + // eslint-disable-next-line no-restricted-syntax + const err = new Error(message); + err.code = 'MODULE_NOT_FOUND'; + err.requireStack = requireStack; + throw err; +}; + +function finalizeEsmResolution(resolved, parentPath, pkgPath) { + if (RegExpPrototypeTest(encodedSepRegEx, resolved)) + throw new ERR_INVALID_MODULE_SPECIFIER( + resolved, 'must not include encoded "/" or "\\" characters', parentPath); + const filename = fileURLToPath(resolved); + const actual = tryReplacementExtensions(filename) || tryFile(filename); + if (actual) + return actual; + const err = createEsmNotFoundErr(filename, + path.resolve(pkgPath, 'package.json')); + throw err; +} + +function createEsmNotFoundErr(request, path) { + // eslint-disable-next-line no-restricted-syntax + const err = new Error(`Cannot find module '${request}'`); + err.code = 'MODULE_NOT_FOUND'; + if (path) + err.path = path; + // TODO(BridgeAR): Add the requireStack as well. + return err; +} + + +return { + Module_findPath, + Module_resolveFilename +} + +} + +/** + * copied from Module._extensions['.js'] + * https://github.com/nodejs/node/blob/v15.3.0/lib/internal/modules/cjs/loader.js#L1113-L1120 + * @param {import('../src/index').Service} service + * @param {NodeJS.Module} module + * @param {string} filename + */ +function assertScriptCanLoadAsCJSImpl(service, module, filename) { + const pkg = readPackageScope(filename); + + // ts-node modification: allow our configuration to override + const tsNodeClassification = service.moduleTypeClassifier.classifyModuleByModuleTypeOverrides(normalizeSlashes(filename)); + if(tsNodeClassification.moduleType === 'cjs') return; + + // ignore package.json when file extension is ESM-only or CJS-only + // [MUST_UPDATE_FOR_NEW_FILE_EXTENSIONS] + const lastDotIndex = filename.lastIndexOf('.'); + const ext = lastDotIndex >= 0 ? filename.slice(lastDotIndex) : ''; + + if((ext === '.cts' || ext === '.cjs') && tsNodeClassification.moduleType === 'auto') return; + + // Function require shouldn't be used in ES modules. + if (ext === '.mts' || ext === '.mjs' || tsNodeClassification.moduleType === 'esm' || (pkg && pkg.data && pkg.data.type === 'module')) { + const parentPath = module.parent && module.parent.filename; + const packageJsonPath = pkg ? path.resolve(pkg.path, 'package.json') : null; + throw createErrRequireEsm(filename, parentPath, packageJsonPath); + } +} + + +module.exports = { + createCjsLoader, + assertScriptCanLoadAsCJSImpl, + readPackageScope +}; + + +/***/ }), + +/***/ 37207: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// Copied from https://raw.githubusercontent.com/nodejs/node/v15.3.0/lib/internal/modules/esm/get_format.js + + +const { + RegExpPrototypeExec, + StringPrototypeStartsWith, +} = __nccwpck_require__(26326); +const { extname } = __nccwpck_require__(71017); +const { getOptionValue } = __nccwpck_require__(40690); + +const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(s => parseInt(s, 10)); +const experimentalJsonModules = + nodeMajor > 17 + || (nodeMajor === 17 && nodeMinor >= 5) + || (nodeMajor === 16 && nodeMinor >= 15) + || getOptionValue('--experimental-json-modules'); +const experimentalWasmModules = getOptionValue('--experimental-wasm-modules'); +const { URL, fileURLToPath } = __nccwpck_require__(57310); +const { ERR_UNKNOWN_FILE_EXTENSION } = (__nccwpck_require__(61858).codes); + +const extensionFormatMap = { + '__proto__': null, + '.cjs': 'commonjs', + '.js': 'module', + '.mjs': 'module' +}; + +const legacyExtensionFormatMap = { + '__proto__': null, + '.cjs': 'commonjs', + '.js': 'commonjs', + '.json': 'commonjs', + '.mjs': 'module', + '.node': 'commonjs' +}; + +if (experimentalWasmModules) + extensionFormatMap['.wasm'] = legacyExtensionFormatMap['.wasm'] = 'wasm'; + +if (experimentalJsonModules) + extensionFormatMap['.json'] = legacyExtensionFormatMap['.json'] = 'json'; + +/** + * + * @param {'node' | 'explicit'} [tsNodeExperimentalSpecifierResolution] + * @param {ReturnType< + * typeof import('../dist-raw/node-internal-modules-esm-resolve').createResolve + * >} nodeEsmResolver + */ +function createGetFormat(tsNodeExperimentalSpecifierResolution, nodeEsmResolver) { +// const experimentalSpeciferResolution = tsNodeExperimentalSpecifierResolution ?? getOptionValue('--experimental-specifier-resolution'); +let experimentalSpeciferResolution = tsNodeExperimentalSpecifierResolution != null ? tsNodeExperimentalSpecifierResolution : getOptionValue('--experimental-specifier-resolution'); +const { getPackageType } = nodeEsmResolver; + +/** + * @param {string} url + * @param {{}} context + * @param {any} defaultGetFormatUnused + * @returns {ReturnType} + */ +function defaultGetFormat(url, context, defaultGetFormatUnused) { + if (StringPrototypeStartsWith(url, 'node:')) { + return { format: 'builtin' }; + } + const parsed = new URL(url); + if (parsed.protocol === 'data:') { + const [ , mime ] = RegExpPrototypeExec( + /^([^/]+\/[^;,]+)(?:[^,]*?)(;base64)?,/, + parsed.pathname, + ) || [ null, null, null ]; + const format = ({ + '__proto__': null, + 'text/javascript': 'module', + 'application/json': experimentalJsonModules ? 'json' : null, + 'application/wasm': experimentalWasmModules ? 'wasm' : null + })[mime] || null; + return { format }; + } else if (parsed.protocol === 'file:') { + const ext = extname(parsed.pathname); + let format; + if (ext === '.js') { + format = getPackageType(parsed.href) === 'module' ? 'module' : 'commonjs'; + } else { + format = extensionFormatMap[ext]; + } + if (!format) { + if (experimentalSpeciferResolution === 'node') { + process.emitWarning( + 'The Node.js specifier resolution in ESM is experimental.', + 'ExperimentalWarning'); + format = legacyExtensionFormatMap[ext]; + } else { + throw new ERR_UNKNOWN_FILE_EXTENSION(ext, fileURLToPath(url)); + } + } + return { format: format || null }; + } + return { format: null }; +} + +return {defaultGetFormat}; +} + +module.exports = { + createGetFormat +}; + + +/***/ }), + +/***/ 67968: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// Copied from https://raw.githubusercontent.com/nodejs/node/v15.3.0/lib/internal/modules/esm/resolve.js + + + +const {versionGteLt} = __nccwpck_require__(64745); + +// Test for node >14.13.1 || (>=12.20.0 && <13) +const builtinModuleProtocol = + versionGteLt(process.versions.node, '14.13.1') || + versionGteLt(process.versions.node, '12.20.0', '13.0.0') + ? 'node:' + : 'nodejs:'; + +const { + ArrayIsArray, + ArrayPrototypeJoin, + ArrayPrototypeShift, + JSONParse, + JSONStringify, + ObjectFreeze, + ObjectGetOwnPropertyNames, + ObjectPrototypeHasOwnProperty, + RegExpPrototypeTest, + SafeMap, + SafeSet, + StringPrototypeEndsWith, + StringPrototypeIndexOf, + StringPrototypeLastIndexOf, + StringPrototypeReplace, + StringPrototypeSlice, + StringPrototypeSplit, + StringPrototypeStartsWith, + StringPrototypeSubstr, +} = __nccwpck_require__(26326); + +// const internalFS = require('internal/fs/utils'); +const Module = __nccwpck_require__(98188); +const { NativeModule } = __nccwpck_require__(81597); +const { + realpathSync, + statSync, + Stats, +} = __nccwpck_require__(57147); +// const { getOptionValue } = require('internal/options'); +const { getOptionValue } = __nccwpck_require__(40690); +// // Do not eagerly grab .manifest, it may be in TDZ +// const policy = getOptionValue('--experimental-policy') ? +// require('internal/process/policy') : +// null; +// disabled for now. I am not sure if/how we should support this +const policy = null; +const { sep, relative } = __nccwpck_require__(71017); +const preserveSymlinks = getOptionValue('--preserve-symlinks'); +const preserveSymlinksMain = getOptionValue('--preserve-symlinks-main'); +const typeFlag = getOptionValue('--input-type'); +// const { URL, pathToFileURL, fileURLToPath } = require('internal/url'); +const { URL, pathToFileURL, fileURLToPath } = __nccwpck_require__(57310); +const { + ERR_INPUT_TYPE_NOT_ALLOWED, + ERR_INVALID_ARG_VALUE, + ERR_INVALID_MODULE_SPECIFIER, + ERR_INVALID_PACKAGE_CONFIG, + ERR_INVALID_PACKAGE_TARGET, + ERR_MANIFEST_DEPENDENCY_MISSING, + ERR_MODULE_NOT_FOUND, + ERR_PACKAGE_IMPORT_NOT_DEFINED, + ERR_PACKAGE_PATH_NOT_EXPORTED, + ERR_UNSUPPORTED_DIR_IMPORT, + ERR_UNSUPPORTED_ESM_URL_SCHEME, +// } = require('internal/errors').codes; +} = (__nccwpck_require__(61858).codes); + +// const { Module: CJSModule } = require('internal/modules/cjs/loader'); +const CJSModule = Module; + +// const packageJsonReader = require('internal/modules/package_json_reader'); +const packageJsonReader = __nccwpck_require__(53348); +const userConditions = getOptionValue('--conditions'); +const DEFAULT_CONDITIONS = ObjectFreeze(['node', 'import', ...userConditions]); +const DEFAULT_CONDITIONS_SET = new SafeSet(DEFAULT_CONDITIONS); + +const pendingDeprecation = getOptionValue('--pending-deprecation'); + +/** + * @param {{ + * extensions: import('../src/file-extensions').Extensions, + * preferTsExts: boolean | undefined; + * tsNodeExperimentalSpecifierResolution: import('../src/index').ExperimentalSpecifierResolution | undefined; + * }} opts + */ +function createResolve(opts) { +// TODO receive cached fs implementations here +const {preferTsExts, tsNodeExperimentalSpecifierResolution, extensions} = opts; +const esrnExtensions = extensions.experimentalSpecifierResolutionAddsIfOmitted; +const {legacyMainResolveAddsIfOmitted, replacementsForCjs, replacementsForJs, replacementsForMjs, replacementsForJsx} = extensions; +// const experimentalSpecifierResolution = tsNodeExperimentalSpecifierResolution ?? getOptionValue('--experimental-specifier-resolution'); +const experimentalSpecifierResolution = tsNodeExperimentalSpecifierResolution != null ? tsNodeExperimentalSpecifierResolution : getOptionValue('--experimental-specifier-resolution'); + +const emittedPackageWarnings = new SafeSet(); +function emitFolderMapDeprecation(match, pjsonUrl, isExports, base) { + const pjsonPath = fileURLToPath(pjsonUrl); + if (!pendingDeprecation) { + const nodeModulesIndex = StringPrototypeLastIndexOf(pjsonPath, + '/node_modules/'); + if (nodeModulesIndex !== -1) { + const afterNodeModulesPath = StringPrototypeSlice(pjsonPath, + nodeModulesIndex + 14, + -13); + try { + const { packageSubpath } = parsePackageName(afterNodeModulesPath); + if (packageSubpath === '.') + return; + } catch {} + } + } + if (emittedPackageWarnings.has(pjsonPath + '|' + match)) + return; + emittedPackageWarnings.add(pjsonPath + '|' + match); + process.emitWarning( + `Use of deprecated folder mapping "${match}" in the ${isExports ? + '"exports"' : '"imports"'} field module resolution of the package at ${ + pjsonPath}${base ? ` imported from ${fileURLToPath(base)}` : ''}.\n` + + `Update this package.json to use a subpath pattern like "${match}*".`, + 'DeprecationWarning', + 'DEP0148' + ); +} + +function getConditionsSet(conditions) { + if (conditions !== undefined && conditions !== DEFAULT_CONDITIONS) { + if (!ArrayIsArray(conditions)) { + throw new ERR_INVALID_ARG_VALUE('conditions', conditions, + 'expected an array'); + } + return new SafeSet(conditions); + } + return DEFAULT_CONDITIONS_SET; +} + +const realpathCache = new SafeMap(); +const packageJSONCache = new SafeMap(); /* string -> PackageConfig */ + +const statSupportsThrowIfNoEntry = versionGteLt(process.versions.node, '15.3.0') || + versionGteLt(process.versions.node, '14.17.0', '15.0.0'); +const tryStatSync = statSupportsThrowIfNoEntry ? tryStatSyncWithoutErrors : tryStatSyncWithErrors; +const statsIfNotFound = new Stats(); +function tryStatSyncWithoutErrors(path) { + const stats = statSync(path, { throwIfNoEntry: false }); + if(stats != null) return stats; + return statsIfNotFound; +} +function tryStatSyncWithErrors(path) { + try { + return statSync(path); + } catch { + return statsIfNotFound; + } +} + +function getPackageConfig(path, specifier, base) { + const existing = packageJSONCache.get(path); + if (existing !== undefined) { + return existing; + } + const source = packageJsonReader.read(path).string; + if (source === undefined) { + const packageConfig = { + pjsonPath: path, + exists: false, + main: undefined, + name: undefined, + type: 'none', + exports: undefined, + imports: undefined, + }; + packageJSONCache.set(path, packageConfig); + return packageConfig; + } + + let packageJSON; + try { + packageJSON = JSONParse(source); + } catch (error) { + throw new ERR_INVALID_PACKAGE_CONFIG( + path, + (base ? `"${specifier}" from ` : '') + fileURLToPath(base || specifier), + error.message + ); + } + + let { imports, main, name, type } = packageJSON; + const { exports } = packageJSON; + if (typeof imports !== 'object' || imports === null) imports = undefined; + if (typeof main !== 'string') main = undefined; + if (typeof name !== 'string') name = undefined; + // Ignore unknown types for forwards compatibility + if (type !== 'module' && type !== 'commonjs') type = 'none'; + + const packageConfig = { + pjsonPath: path, + exists: true, + main, + name, + type, + exports, + imports, + }; + packageJSONCache.set(path, packageConfig); + return packageConfig; +} + +function getPackageScopeConfig(resolved) { + let packageJSONUrl = new URL('./package.json', resolved); + while (true) { + const packageJSONPath = packageJSONUrl.pathname; + if (StringPrototypeEndsWith(packageJSONPath, 'node_modules/package.json')) + break; + const packageConfig = getPackageConfig(fileURLToPath(packageJSONUrl), + resolved); + if (packageConfig.exists) return packageConfig; + + const lastPackageJSONUrl = packageJSONUrl; + packageJSONUrl = new URL('../package.json', packageJSONUrl); + + // Terminates at root where ../package.json equals ../../package.json + // (can't just check "/package.json" for Windows support). + if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) break; + } + const packageJSONPath = fileURLToPath(packageJSONUrl); + const packageConfig = { + pjsonPath: packageJSONPath, + exists: false, + main: undefined, + name: undefined, + type: 'none', + exports: undefined, + imports: undefined, + }; + packageJSONCache.set(packageJSONPath, packageConfig); + return packageConfig; +} + +/* + * Legacy CommonJS main resolution: + * 1. let M = pkg_url + (json main field) + * 2. TRY(M, M.js, M.json, M.node) + * 3. TRY(M/index.js, M/index.json, M/index.node) + * 4. TRY(pkg_url/index.js, pkg_url/index.json, pkg_url/index.node) + * 5. NOT_FOUND + */ +function fileExists(url) { + return tryStatSync(fileURLToPath(url)).isFile(); +} + +function legacyMainResolve(packageJSONUrl, packageConfig, base) { + let guess; + if (packageConfig.main !== undefined) { + // Note: fs check redundances will be handled by Descriptor cache here. + if(guess = resolveReplacementExtensions(new URL(`./${packageConfig.main}`, packageJSONUrl))) { + return guess; + } + if (fileExists(guess = new URL(`./${packageConfig.main}`, + packageJSONUrl))) { + return guess; + } + for(const extension of legacyMainResolveAddsIfOmitted) { + if (fileExists(guess = new URL(`./${packageConfig.main}${extension}`, + packageJSONUrl))) { + return guess; + } + } + for(const extension of legacyMainResolveAddsIfOmitted) { + if (fileExists(guess = new URL(`./${packageConfig.main}/index${extension}`, + packageJSONUrl))) { + return guess; + } + } + // Fallthrough. + } + for(const extension of legacyMainResolveAddsIfOmitted) { + if (fileExists(guess = new URL(`./index${extension}`, packageJSONUrl))) { + return guess; + } + } + // Not found. + throw new ERR_MODULE_NOT_FOUND( + fileURLToPath(new URL('.', packageJSONUrl)), fileURLToPath(base)); +} + +/** attempts replacement extensions, then tries exact name, then attempts appending extensions */ +function resolveExtensionsWithTryExactName(search) { + const resolvedReplacementExtension = resolveReplacementExtensions(search); + if(resolvedReplacementExtension) return resolvedReplacementExtension; + if (fileExists(search)) return search; + return resolveExtensions(search); +} + +// This appends missing extensions +function resolveExtensions(search) { + for (let i = 0; i < esrnExtensions.length; i++) { + const extension = esrnExtensions[i]; + const guess = new URL(`${search.pathname}${extension}`, search); + if (fileExists(guess)) return guess; + } + return undefined; +} + +/** This replaces JS with TS extensions */ +function resolveReplacementExtensions(search) { + const lastDotIndex = search.pathname.lastIndexOf('.'); + if(lastDotIndex >= 0) { + const ext = search.pathname.slice(lastDotIndex); + if (ext === '.js' || ext === '.jsx' || ext === '.mjs' || ext === '.cjs') { + const pathnameWithoutExtension = search.pathname.slice(0, lastDotIndex); + const replacementExts = + ext === '.js' ? replacementsForJs + : ext === '.jsx' ? replacementsForJsx + : ext === '.mjs' ? replacementsForMjs + : replacementsForCjs; + const guess = new URL(search.toString()); + for (let i = 0; i < replacementExts.length; i++) { + const extension = replacementExts[i]; + guess.pathname = `${pathnameWithoutExtension}${extension}`; + if (fileExists(guess)) return guess; + } + } + } + return undefined; +} + +function resolveIndex(search) { + return resolveExtensions(new URL('index', search)); +} + +const encodedSepRegEx = /%2F|%2C/i; +function finalizeResolution(resolved, base) { + if (RegExpPrototypeTest(encodedSepRegEx, resolved.pathname)) + throw new ERR_INVALID_MODULE_SPECIFIER( + resolved.pathname, 'must not include encoded "/" or "\\" characters', + fileURLToPath(base)); + + if (experimentalSpecifierResolution === 'node') { + const path = fileURLToPath(resolved); + let file = resolveExtensionsWithTryExactName(resolved); + if (file !== undefined) return file; + if (!StringPrototypeEndsWith(path, '/')) { + file = resolveIndex(new URL(`${resolved}/`)); + if (file !== undefined) return file; + } else { + return resolveIndex(resolved) || resolved; + } + throw new ERR_MODULE_NOT_FOUND( + resolved.pathname, fileURLToPath(base), 'module'); + } + + const file = resolveReplacementExtensions(resolved) || resolved; + const path = fileURLToPath(file); + + const stats = tryStatSync(StringPrototypeEndsWith(path, '/') ? + StringPrototypeSlice(path, -1) : path); + if (stats.isDirectory()) { + const err = new ERR_UNSUPPORTED_DIR_IMPORT(path, fileURLToPath(base)); + err.url = String(resolved); + throw err; + } else if (!stats.isFile()) { + throw new ERR_MODULE_NOT_FOUND( + path || resolved.pathname, fileURLToPath(base), 'module'); + } + + return file; +} + +function throwImportNotDefined(specifier, packageJSONUrl, base) { + throw new ERR_PACKAGE_IMPORT_NOT_DEFINED( + specifier, packageJSONUrl && fileURLToPath(new URL('.', packageJSONUrl)), + fileURLToPath(base)); +} + +function throwExportsNotFound(subpath, packageJSONUrl, base) { + throw new ERR_PACKAGE_PATH_NOT_EXPORTED( + fileURLToPath(new URL('.', packageJSONUrl)), subpath, + base && fileURLToPath(base)); +} + +function throwInvalidSubpath(subpath, packageJSONUrl, internal, base) { + const reason = `request is not a valid subpath for the "${internal ? + 'imports' : 'exports'}" resolution of ${fileURLToPath(packageJSONUrl)}`; + throw new ERR_INVALID_MODULE_SPECIFIER(subpath, reason, + base && fileURLToPath(base)); +} + +function throwInvalidPackageTarget( + subpath, target, packageJSONUrl, internal, base) { + if (typeof target === 'object' && target !== null) { + target = JSONStringify(target, null, ''); + } else { + target = `${target}`; + } + throw new ERR_INVALID_PACKAGE_TARGET( + fileURLToPath(new URL('.', packageJSONUrl)), subpath, target, + internal, base && fileURLToPath(base)); +} + +const invalidSegmentRegEx = /(^|\\|\/)(\.\.?|node_modules)(\\|\/|$)/; +const patternRegEx = /\*/g; + +function resolvePackageTargetString( + target, subpath, match, packageJSONUrl, base, pattern, internal, conditions) { + if (subpath !== '' && !pattern && target[target.length - 1] !== '/') + throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); + + if (!StringPrototypeStartsWith(target, './')) { + if (internal && !StringPrototypeStartsWith(target, '../') && + !StringPrototypeStartsWith(target, '/')) { + let isURL = false; + try { + new URL(target); + isURL = true; + } catch {} + if (!isURL) { + const exportTarget = pattern ? + StringPrototypeReplace(target, patternRegEx, subpath) : + target + subpath; + return packageResolve(exportTarget, packageJSONUrl, conditions); + } + } + throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); + } + + if (RegExpPrototypeTest(invalidSegmentRegEx, StringPrototypeSlice(target, 2))) + throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); + + const resolved = new URL(target, packageJSONUrl); + const resolvedPath = resolved.pathname; + const packagePath = new URL('.', packageJSONUrl).pathname; + + if (!StringPrototypeStartsWith(resolvedPath, packagePath)) + throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); + + if (subpath === '') return resolved; + + if (RegExpPrototypeTest(invalidSegmentRegEx, subpath)) + throwInvalidSubpath(match + subpath, packageJSONUrl, internal, base); + + if (pattern) + return new URL(StringPrototypeReplace(resolved.href, patternRegEx, + subpath)); + return new URL(subpath, resolved); +} + +/** + * @param {string} key + * @returns {boolean} + */ +function isArrayIndex(key) { + const keyNum = +key; + if (`${keyNum}` !== key) return false; + return keyNum >= 0 && keyNum < 0xFFFF_FFFF; +} + +function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath, + base, pattern, internal, conditions) { + if (typeof target === 'string') { + return resolvePackageTargetString( + target, subpath, packageSubpath, packageJSONUrl, base, pattern, internal, + conditions); + } else if (ArrayIsArray(target)) { + if (target.length === 0) + return null; + + let lastException; + for (let i = 0; i < target.length; i++) { + const targetItem = target[i]; + let resolved; + try { + resolved = resolvePackageTarget( + packageJSONUrl, targetItem, subpath, packageSubpath, base, pattern, + internal, conditions); + } catch (e) { + lastException = e; + if (e.code === 'ERR_INVALID_PACKAGE_TARGET') + continue; + throw e; + } + if (resolved === undefined) + continue; + if (resolved === null) { + lastException = null; + continue; + } + return resolved; + } + if (lastException === undefined || lastException === null) + return lastException; + throw lastException; + } else if (typeof target === 'object' && target !== null) { + const keys = ObjectGetOwnPropertyNames(target); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + if (isArrayIndex(key)) { + throw new ERR_INVALID_PACKAGE_CONFIG( + fileURLToPath(packageJSONUrl), base, + '"exports" cannot contain numeric property keys.'); + } + } + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + if (key === 'default' || conditions.has(key)) { + const conditionalTarget = target[key]; + const resolved = resolvePackageTarget( + packageJSONUrl, conditionalTarget, subpath, packageSubpath, base, + pattern, internal, conditions); + if (resolved === undefined) + continue; + return resolved; + } + } + return undefined; + } else if (target === null) { + return null; + } + throwInvalidPackageTarget(packageSubpath, target, packageJSONUrl, internal, + base); +} + +function isConditionalExportsMainSugar(exports, packageJSONUrl, base) { + if (typeof exports === 'string' || ArrayIsArray(exports)) return true; + if (typeof exports !== 'object' || exports === null) return false; + + const keys = ObjectGetOwnPropertyNames(exports); + let isConditionalSugar = false; + let i = 0; + for (let j = 0; j < keys.length; j++) { + const key = keys[j]; + const curIsConditionalSugar = key === '' || key[0] !== '.'; + if (i++ === 0) { + isConditionalSugar = curIsConditionalSugar; + } else if (isConditionalSugar !== curIsConditionalSugar) { + throw new ERR_INVALID_PACKAGE_CONFIG( + fileURLToPath(packageJSONUrl), base, + '"exports" cannot contain some keys starting with \'.\' and some not.' + + ' The exports object must either be an object of package subpath keys' + + ' or an object of main entry condition name keys only.'); + } + } + return isConditionalSugar; +} + +/** + * @param {URL} packageJSONUrl + * @param {string} packageSubpath + * @param {object} packageConfig + * @param {string} base + * @param {Set} conditions + * @returns {{resolved: URL, exact: boolean}} + */ +function packageExportsResolve( + packageJSONUrl, packageSubpath, packageConfig, base, conditions) { + let exports = packageConfig.exports; + if (isConditionalExportsMainSugar(exports, packageJSONUrl, base)) + exports = { '.': exports }; + + if (ObjectPrototypeHasOwnProperty(exports, packageSubpath)) { + const target = exports[packageSubpath]; + const resolved = resolvePackageTarget( + packageJSONUrl, target, '', packageSubpath, base, false, false, conditions + ); + if (resolved === null || resolved === undefined) + throwExportsNotFound(packageSubpath, packageJSONUrl, base); + return { resolved, exact: true }; + } + + let bestMatch = ''; + const keys = ObjectGetOwnPropertyNames(exports); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + if (key[key.length - 1] === '*' && + StringPrototypeStartsWith(packageSubpath, + StringPrototypeSlice(key, 0, -1)) && + packageSubpath.length >= key.length && + key.length > bestMatch.length) { + bestMatch = key; + } else if (key[key.length - 1] === '/' && + StringPrototypeStartsWith(packageSubpath, key) && + key.length > bestMatch.length) { + bestMatch = key; + } + } + + if (bestMatch) { + const target = exports[bestMatch]; + const pattern = bestMatch[bestMatch.length - 1] === '*'; + const subpath = StringPrototypeSubstr(packageSubpath, bestMatch.length - + (pattern ? 1 : 0)); + const resolved = resolvePackageTarget(packageJSONUrl, target, subpath, + bestMatch, base, pattern, false, + conditions); + if (resolved === null || resolved === undefined) + throwExportsNotFound(packageSubpath, packageJSONUrl, base); + if (!pattern) + emitFolderMapDeprecation(bestMatch, packageJSONUrl, true, base); + return { resolved, exact: pattern }; + } + + throwExportsNotFound(packageSubpath, packageJSONUrl, base); +} + +function packageImportsResolve(name, base, conditions) { + if (name === '#' || StringPrototypeStartsWith(name, '#/')) { + const reason = 'is not a valid internal imports specifier name'; + throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, fileURLToPath(base)); + } + let packageJSONUrl; + const packageConfig = getPackageScopeConfig(base); + if (packageConfig.exists) { + packageJSONUrl = pathToFileURL(packageConfig.pjsonPath); + const imports = packageConfig.imports; + if (imports) { + if (ObjectPrototypeHasOwnProperty(imports, name)) { + const resolved = resolvePackageTarget( + packageJSONUrl, imports[name], '', name, base, false, true, conditions + ); + if (resolved !== null) + return { resolved, exact: true }; + } else { + let bestMatch = ''; + const keys = ObjectGetOwnPropertyNames(imports); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + if (key[key.length - 1] === '*' && + StringPrototypeStartsWith(name, + StringPrototypeSlice(key, 0, -1)) && + name.length >= key.length && + key.length > bestMatch.length) { + bestMatch = key; + } else if (key[key.length - 1] === '/' && + StringPrototypeStartsWith(name, key) && + key.length > bestMatch.length) { + bestMatch = key; + } + } + + if (bestMatch) { + const target = imports[bestMatch]; + const pattern = bestMatch[bestMatch.length - 1] === '*'; + const subpath = StringPrototypeSubstr(name, bestMatch.length - + (pattern ? 1 : 0)); + const resolved = resolvePackageTarget( + packageJSONUrl, target, subpath, bestMatch, base, pattern, true, + conditions); + if (resolved !== null) { + if (!pattern) + emitFolderMapDeprecation(bestMatch, packageJSONUrl, false, base); + return { resolved, exact: pattern }; + } + } + } + } + } + throwImportNotDefined(name, packageJSONUrl, base); +} + +function getPackageType(url) { + const packageConfig = getPackageScopeConfig(url); + return packageConfig.type; +} + +function parsePackageName(specifier, base) { + let separatorIndex = StringPrototypeIndexOf(specifier, '/'); + let validPackageName = true; + let isScoped = false; + if (specifier[0] === '@') { + isScoped = true; + if (separatorIndex === -1 || specifier.length === 0) { + validPackageName = false; + } else { + separatorIndex = StringPrototypeIndexOf( + specifier, '/', separatorIndex + 1); + } + } + + const packageName = separatorIndex === -1 ? + specifier : StringPrototypeSlice(specifier, 0, separatorIndex); + + // Package name cannot have leading . and cannot have percent-encoding or + // separators. + for (let i = 0; i < packageName.length; i++) { + if (packageName[i] === '%' || packageName[i] === '\\') { + validPackageName = false; + break; + } + } + + if (!validPackageName) { + throw new ERR_INVALID_MODULE_SPECIFIER( + specifier, 'is not a valid package name', fileURLToPath(base)); + } + + const packageSubpath = '.' + (separatorIndex === -1 ? '' : + StringPrototypeSlice(specifier, separatorIndex)); + + return { packageName, packageSubpath, isScoped }; +} + +/** + * @param {string} specifier + * @param {URL} base + * @param {Set} conditions + * @returns {URL} + */ +function packageResolve(specifier, base, conditions) { + const { packageName, packageSubpath, isScoped } = + parsePackageName(specifier, base); + + // ResolveSelf + const packageConfig = getPackageScopeConfig(base); + if (packageConfig.exists) { + const packageJSONUrl = pathToFileURL(packageConfig.pjsonPath); + if (packageConfig.name === packageName && + packageConfig.exports !== undefined && packageConfig.exports !== null) { + return packageExportsResolve( + packageJSONUrl, packageSubpath, packageConfig, base, conditions + ).resolved; + } + } + + let packageJSONUrl = + new URL('./node_modules/' + packageName + '/package.json', base); + let packageJSONPath = fileURLToPath(packageJSONUrl); + let lastPath; + do { + const stat = tryStatSync(StringPrototypeSlice(packageJSONPath, 0, + packageJSONPath.length - 13)); + if (!stat.isDirectory()) { + lastPath = packageJSONPath; + packageJSONUrl = new URL((isScoped ? + '../../../../node_modules/' : '../../../node_modules/') + + packageName + '/package.json', packageJSONUrl); + packageJSONPath = fileURLToPath(packageJSONUrl); + continue; + } + + // Package match. + const packageConfig = getPackageConfig(packageJSONPath, specifier, base); + if (packageConfig.exports !== undefined && packageConfig.exports !== null) + return packageExportsResolve( + packageJSONUrl, packageSubpath, packageConfig, base, conditions + ).resolved; + if (packageSubpath === '.') + return legacyMainResolve(packageJSONUrl, packageConfig, base); + return new URL(packageSubpath, packageJSONUrl); + // Cross-platform root check. + } while (packageJSONPath.length !== lastPath.length); + + // eslint can't handle the above code. + // eslint-disable-next-line no-unreachable + throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base)); +} + +function isBareSpecifier(specifier) { + return specifier[0] && specifier[0] !== '/' && specifier[0] !== '.'; +} + +function isRelativeSpecifier(specifier) { + if (specifier[0] === '.') { + if (specifier.length === 1 || specifier[1] === '/') return true; + if (specifier[1] === '.') { + if (specifier.length === 2 || specifier[2] === '/') return true; + } + } + return false; +} + +function shouldBeTreatedAsRelativeOrAbsolutePath(specifier) { + if (specifier === '') return false; + if (specifier[0] === '/') return true; + return isRelativeSpecifier(specifier); +} + +/** + * @param {string} specifier + * @param {URL} base + * @param {Set} conditions + * @returns {URL} + */ +function moduleResolve(specifier, base, conditions) { + // Order swapped from spec for minor perf gain. + // Ok since relative URLs cannot parse as URLs. + let resolved; + if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) { + resolved = new URL(specifier, base); + } else if (specifier[0] === '#') { + ({ resolved } = packageImportsResolve(specifier, base, conditions)); + } else { + try { + resolved = new URL(specifier); + } catch { + resolved = packageResolve(specifier, base, conditions); + } + } + return finalizeResolution(resolved, base); +} + +/** + * Try to resolve an import as a CommonJS module + * @param {string} specifier + * @param {string} parentURL + * @returns {boolean|string} + */ +function resolveAsCommonJS(specifier, parentURL) { + try { + const parent = fileURLToPath(parentURL); + const tmpModule = new CJSModule(parent, null); + tmpModule.paths = CJSModule._nodeModulePaths(parent); + + let found = CJSModule._resolveFilename(specifier, tmpModule, false); + + // If it is a relative specifier return the relative path + // to the parent + if (isRelativeSpecifier(specifier)) { + found = relative(parent, found); + // Add '.separator if the path does not start with '..separator' + // This should be a safe assumption because when loading + // esm modules there should be always a file specified so + // there should not be a specifier like '..' or '.' + if (!StringPrototypeStartsWith(found, `..${sep}`)) { + found = `.${sep}${found}`; + } + } else if (isBareSpecifier(specifier)) { + // If it is a bare specifier return the relative path within the + // module + const pkg = StringPrototypeSplit(specifier, '/')[0]; + const index = StringPrototypeIndexOf(found, pkg); + if (index !== -1) { + found = StringPrototypeSlice(found, index); + } + } + // Normalize the path separator to give a valid suggestion + // on Windows + if (process.platform === 'win32') { + found = StringPrototypeReplace(found, new RegExp(`\\${sep}`, 'g'), '/'); + } + return found; + } catch { + return false; + } +} + +function defaultResolve(specifier, context = {}, defaultResolveUnused) { + let { parentURL, conditions } = context; + if (parentURL && policy != null && policy.manifest) { + const redirects = policy.manifest.getDependencyMapper(parentURL); + if (redirects) { + const { resolve, reaction } = redirects; + const destination = resolve(specifier, new SafeSet(conditions)); + let missing = true; + if (destination === true) { + missing = false; + } else if (destination) { + const href = destination.href; + return { url: href }; + } + if (missing) { + reaction(new ERR_MANIFEST_DEPENDENCY_MISSING( + parentURL, + specifier, + ArrayPrototypeJoin([...conditions], ', ')) + ); + } + } + } + let parsed; + try { + parsed = new URL(specifier); + if (parsed.protocol === 'data:') { + return { + url: specifier + }; + } + } catch {} + if (parsed && parsed.protocol === builtinModuleProtocol) + return { url: specifier }; + if (parsed && parsed.protocol !== 'file:' && parsed.protocol !== 'data:') + throw new ERR_UNSUPPORTED_ESM_URL_SCHEME(parsed); + if (NativeModule.canBeRequiredByUsers(specifier)) { + return { + url: builtinModuleProtocol + specifier + }; + } + if (parentURL && StringPrototypeStartsWith(parentURL, 'data:')) { + // This is gonna blow up, we want the error + new URL(specifier, parentURL); + } + + const isMain = parentURL === undefined; + if (isMain) { + parentURL = pathToFileURL(`${process.cwd()}/`).href; + + // This is the initial entry point to the program, and --input-type has + // been passed as an option; but --input-type can only be used with + // --eval, --print or STDIN string input. It is not allowed with file + // input, to avoid user confusion over how expansive the effect of the + // flag should be (i.e. entry point only, package scope surrounding the + // entry point, etc.). + if (typeFlag) + throw new ERR_INPUT_TYPE_NOT_ALLOWED(); + } + + conditions = getConditionsSet(conditions); + let url; + try { + url = moduleResolve(specifier, parentURL, conditions); + } catch (error) { + // Try to give the user a hint of what would have been the + // resolved CommonJS module + if (error.code === 'ERR_MODULE_NOT_FOUND' || + error.code === 'ERR_UNSUPPORTED_DIR_IMPORT') { + if (StringPrototypeStartsWith(specifier, 'file://')) { + specifier = fileURLToPath(specifier); + } + const found = resolveAsCommonJS(specifier, parentURL); + if (found) { + // Modify the stack and message string to include the hint + const lines = StringPrototypeSplit(error.stack, '\n'); + const hint = `Did you mean to import ${found}?`; + error.stack = + ArrayPrototypeShift(lines) + '\n' + + hint + '\n' + + ArrayPrototypeJoin(lines, '\n'); + error.message += `\n${hint}`; + } + } + throw error; + } + + if (isMain ? !preserveSymlinksMain : !preserveSymlinks) { + const urlPath = fileURLToPath(url); + const real = realpathSync(urlPath, { + // [internalFS.realpathCacheKey]: realpathCache + }); + const old = url; + url = pathToFileURL( + real + (StringPrototypeEndsWith(urlPath, sep) ? '/' : '')); + url.search = old.search; + url.hash = old.hash; + } + + return { url: `${url}` }; +} + +return { + DEFAULT_CONDITIONS, + defaultResolve, + encodedSepRegEx, + getPackageType, + packageExportsResolve, + packageImportsResolve +}; +} +module.exports = { + createResolve +}; + + +/***/ }), + +/***/ 53348: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// copied from https://github.com/nodejs/node/blob/v15.3.0/lib/internal/modules/package_json_reader.js + + +const { SafeMap } = __nccwpck_require__(26326); +const { internalModuleReadJSON } = __nccwpck_require__(3601); +const { pathToFileURL } = __nccwpck_require__(57310); +const { toNamespacedPath } = __nccwpck_require__(71017); +// const { getOptionValue } = require('./node-options'); + +const cache = new SafeMap(); + +let manifest; + +/** + * @param {string} jsonPath + * @return {{string: string, containsKeys: boolean}} + */ +function read(jsonPath) { + if (cache.has(jsonPath)) { + return cache.get(jsonPath); + } + + const [string, containsKeys] = internalModuleReadJSON( + toNamespacedPath(jsonPath) + ); + const result = { string, containsKeys }; + if (string !== undefined) { + if (manifest === undefined) { + // manifest = getOptionValue('--experimental-policy') ? + // require('internal/process/policy').manifest : + // null; + // disabled for now. I am not sure if/how we should support this + manifest = null; + } + if (manifest !== null) { + const jsonURL = pathToFileURL(jsonPath); + manifest.assertIntegrity(jsonURL, string); + } + } + cache.set(jsonPath, result); + return result; +} + +module.exports = { read }; + + +/***/ }), + +/***/ 75818: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// copied from https://github.com/nodejs/node/blob/88799930794045795e8abac874730f9eba7e2300/lib/internal/repl/await.js + + +const { + ArrayFrom, + ArrayPrototypeForEach, + ArrayPrototypeIncludes, + ArrayPrototypeJoin, + ArrayPrototypePop, + ArrayPrototypePush, + FunctionPrototype, + ObjectKeys, + RegExpPrototypeSymbolReplace, + StringPrototypeEndsWith, + StringPrototypeIncludes, + StringPrototypeIndexOf, + StringPrototypeRepeat, + StringPrototypeSplit, + StringPrototypeStartsWith, + SyntaxError, +} = __nccwpck_require__(26326); + +const parser = (__nccwpck_require__(80390).Parser); +const walk = __nccwpck_require__(88390); +const { Recoverable } = __nccwpck_require__(38102); + +function isTopLevelDeclaration(state) { + return state.ancestors[state.ancestors.length - 2] === state.body; +} + +const noop = FunctionPrototype; +const visitorsWithoutAncestors = { + ClassDeclaration(node, state, c) { + if (isTopLevelDeclaration(state)) { + state.prepend(node, `${node.id.name}=`); + ArrayPrototypePush( + state.hoistedDeclarationStatements, + `let ${node.id.name}; ` + ); + } + + walk.base.ClassDeclaration(node, state, c); + }, + ForOfStatement(node, state, c) { + if (node.await === true) { + state.containsAwait = true; + } + walk.base.ForOfStatement(node, state, c); + }, + FunctionDeclaration(node, state, c) { + state.prepend(node, `${node.id.name}=`); + ArrayPrototypePush( + state.hoistedDeclarationStatements, + `var ${node.id.name}; ` + ); + }, + FunctionExpression: noop, + ArrowFunctionExpression: noop, + MethodDefinition: noop, + AwaitExpression(node, state, c) { + state.containsAwait = true; + walk.base.AwaitExpression(node, state, c); + }, + ReturnStatement(node, state, c) { + state.containsReturn = true; + walk.base.ReturnStatement(node, state, c); + }, + VariableDeclaration(node, state, c) { + const variableKind = node.kind; + const isIterableForDeclaration = ArrayPrototypeIncludes( + ['ForOfStatement', 'ForInStatement'], + state.ancestors[state.ancestors.length - 2].type + ); + + if (variableKind === 'var' || isTopLevelDeclaration(state)) { + state.replace( + node.start, + node.start + variableKind.length + (isIterableForDeclaration ? 1 : 0), + variableKind === 'var' && isIterableForDeclaration ? + '' : + 'void' + (node.declarations.length === 1 ? '' : ' (') + ); + + if (!isIterableForDeclaration) { + ArrayPrototypeForEach(node.declarations, (decl) => { + state.prepend(decl, '('); + state.append(decl, decl.init ? ')' : '=undefined)'); + }); + + if (node.declarations.length !== 1) { + state.append(node.declarations[node.declarations.length - 1], ')'); + } + } + + const variableIdentifiersToHoist = [ + ['var', []], + ['let', []], + ]; + function registerVariableDeclarationIdentifiers(node) { + switch (node.type) { + case 'Identifier': + ArrayPrototypePush( + variableIdentifiersToHoist[variableKind === 'var' ? 0 : 1][1], + node.name + ); + break; + case 'ObjectPattern': + ArrayPrototypeForEach(node.properties, (property) => { + registerVariableDeclarationIdentifiers(property.value); + }); + break; + case 'ArrayPattern': + ArrayPrototypeForEach(node.elements, (element) => { + registerVariableDeclarationIdentifiers(element); + }); + break; + } + } + + ArrayPrototypeForEach(node.declarations, (decl) => { + registerVariableDeclarationIdentifiers(decl.id); + }); + + ArrayPrototypeForEach( + variableIdentifiersToHoist, + ({ 0: kind, 1: identifiers }) => { + if (identifiers.length > 0) { + ArrayPrototypePush( + state.hoistedDeclarationStatements, + `${kind} ${ArrayPrototypeJoin(identifiers, ', ')}; ` + ); + } + } + ); + } + + walk.base.VariableDeclaration(node, state, c); + } +}; + +const visitors = {}; +for (const nodeType of ObjectKeys(walk.base)) { + const callback = visitorsWithoutAncestors[nodeType] || walk.base[nodeType]; + visitors[nodeType] = (node, state, c) => { + const isNew = node !== state.ancestors[state.ancestors.length - 1]; + if (isNew) { + ArrayPrototypePush(state.ancestors, node); + } + callback(node, state, c); + if (isNew) { + ArrayPrototypePop(state.ancestors); + } + }; +} + +function processTopLevelAwait(src) { + const wrapPrefix = '(async () => { '; + const wrapped = `${wrapPrefix}${src} })()`; + const wrappedArray = ArrayFrom(wrapped); + let root; + try { + root = parser.parse(wrapped, { ecmaVersion: 'latest' }); + } catch (e) { + if (StringPrototypeStartsWith(e.message, 'Unterminated ')) + throw new Recoverable(e); + // If the parse error is before the first "await", then use the execution + // error. Otherwise we must emit this parse error, making it look like a + // proper syntax error. + const awaitPos = StringPrototypeIndexOf(src, 'await'); + const errPos = e.pos - wrapPrefix.length; + if (awaitPos > errPos) + return null; + // Convert keyword parse errors on await into their original errors when + // possible. + if (errPos === awaitPos + 6 && + StringPrototypeIncludes(e.message, 'Expecting Unicode escape sequence')) + return null; + if (errPos === awaitPos + 7 && + StringPrototypeIncludes(e.message, 'Unexpected token')) + return null; + const line = e.loc.line; + const column = line === 1 ? e.loc.column - wrapPrefix.length : e.loc.column; + let message = '\n' + StringPrototypeSplit(src, '\n')[line - 1] + '\n' + + StringPrototypeRepeat(' ', column) + + '^\n\n' + RegExpPrototypeSymbolReplace(/ \([^)]+\)/, e.message, ''); + // V8 unexpected token errors include the token string. + if (StringPrototypeEndsWith(message, 'Unexpected token')) + message += " '" + + // Wrapper end may cause acorn to report error position after the source + ((src.length - 1) >= (e.pos - wrapPrefix.length) + ? src[e.pos - wrapPrefix.length] + : src[src.length - 1]) + + "'"; + // eslint-disable-next-line no-restricted-syntax + throw new SyntaxError(message); + } + const body = root.body[0].expression.callee.body; + const state = { + body, + ancestors: [], + hoistedDeclarationStatements: [], + replace(from, to, str) { + for (let i = from; i < to; i++) { + wrappedArray[i] = ''; + } + if (from === to) str += wrappedArray[from]; + wrappedArray[from] = str; + }, + prepend(node, str) { + wrappedArray[node.start] = str + wrappedArray[node.start]; + }, + append(node, str) { + wrappedArray[node.end - 1] += str; + }, + containsAwait: false, + containsReturn: false + }; + + walk.recursive(body, state, visitors); + + // Do not transform if + // 1. False alarm: there isn't actually an await expression. + // 2. There is a top-level return, which is not allowed. + if (!state.containsAwait || state.containsReturn) { + return null; + } + + const last = body.body[body.body.length - 1]; + if (last.type === 'ExpressionStatement') { + // For an expression statement of the form + // ( expr ) ; + // ^^^^^^^^^^ // last + // ^^^^ // last.expression + // + // We do not want the left parenthesis before the `return` keyword; + // therefore we prepend the `return (` to `last`. + // + // On the other hand, we do not want the right parenthesis after the + // semicolon. Since there can only be more right parentheses between + // last.expression.end and the semicolon, appending one more to + // last.expression should be fine. + state.prepend(last, 'return ('); + state.append(last.expression, ')'); + } + + return ( + ArrayPrototypeJoin(state.hoistedDeclarationStatements, '') + + ArrayPrototypeJoin(wrappedArray, '') + ); +} + +module.exports = { + processTopLevelAwait +}; + + +/***/ }), + +/***/ 3601: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const fs = __nccwpck_require__(57147); +const {versionGteLt} = __nccwpck_require__(64745); + +// In node's core, this is implemented in C +// https://github.com/nodejs/node/blob/v15.3.0/src/node_file.cc#L891-L985 +/** + * @param {string} path + * @returns {[] | [string, boolean]} + */ +function internalModuleReadJSON(path) { + let string + try { + string = fs.readFileSync(path, 'utf8') + } catch (e) { + if (e.code === 'ENOENT') return [] + throw e + } + // Node's implementation checks for the presence of relevant keys: main, name, type, exports, imports + // Node does this for performance to skip unnecessary parsing. + // This would slow us down and, based on our usage, we can skip it. + const containsKeys = true + return [string, containsKeys] +} + +// In node's core, this is implemented in C +// https://github.com/nodejs/node/blob/63e7dc1e5c71b70c80ed9eda230991edb00811e2/src/node_file.cc#L987-L1005 +/** + * @param {string} path + * @returns {number} 0 = file, 1 = dir, negative = error + */ +function internalModuleStat(path) { + const stat = fs.statSync(path, { throwIfNoEntry: false }); + if(!stat) return -1; + if(stat.isFile()) return 0; + if(stat.isDirectory()) return 1; +} + +/** + * @param {string} path + * @returns {number} 0 = file, 1 = dir, negative = error + */ +function internalModuleStatInefficient(path) { + try { + const stat = fs.statSync(path); + if(stat.isFile()) return 0; + if(stat.isDirectory()) return 1; + } catch(e) { + return -e.errno || -1; + } +} + +const statSupportsThrowIfNoEntry = versionGteLt(process.versions.node, '15.3.0') || + versionGteLt(process.versions.node, '14.17.0', '15.0.0'); + +module.exports = { + internalModuleReadJSON, + internalModuleStat: statSupportsThrowIfNoEntry ? internalModuleStat : internalModuleStatInefficient +}; + + +/***/ }), + +/***/ 81597: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + +// Node imports this from 'internal/bootstrap/loaders' +const Module = __nccwpck_require__(98188); +const NativeModule = { + canBeRequiredByUsers(specifier) { + return Module.builtinModules.includes(specifier) + } +}; +exports.NativeModule = NativeModule; + + +/***/ }), + +/***/ 40690: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +// Replacement for node's internal 'internal/options' module + +exports.getOptionValue = getOptionValue; +function getOptionValue(opt) { + parseOptions(); + return options[opt]; +} + +let options; +function parseOptions() { + if (!options) { + options = { + '--preserve-symlinks': false, + '--preserve-symlinks-main': false, + '--input-type': undefined, + '--experimental-specifier-resolution': 'explicit', + '--experimental-policy': undefined, + '--conditions': [], + '--pending-deprecation': false, + ...parseArgv(getNodeOptionsEnvArgv()), + ...parseArgv(process.execArgv), + ...getOptionValuesFromOtherEnvVars() + } + } +} + +function parseArgv(argv) { + return __nccwpck_require__(59482)({ + '--preserve-symlinks': Boolean, + '--preserve-symlinks-main': Boolean, + '--input-type': String, + '--experimental-specifier-resolution': String, + // Legacy alias for node versions prior to 12.16 + '--es-module-specifier-resolution': '--experimental-specifier-resolution', + '--experimental-policy': String, + '--conditions': [String], + '--pending-deprecation': Boolean, + '--experimental-json-modules': Boolean, + '--experimental-wasm-modules': Boolean, + }, { + argv, + permissive: true + }); +} + +function getNodeOptionsEnvArgv() { + const errors = []; + const envArgv = ParseNodeOptionsEnvVar(process.env.NODE_OPTIONS || '', errors); + if (errors.length !== 0) { + // TODO: handle errors somehow + } + return envArgv; +} + +// Direct JS port of C implementation: https://github.com/nodejs/node/blob/67ba825037b4082d5d16f922fb9ce54516b4a869/src/node_options.cc#L1024-L1063 +function ParseNodeOptionsEnvVar(node_options, errors) { + const env_argv = []; + + let is_in_string = false; + let will_start_new_arg = true; + for (let index = 0; index < node_options.length; ++index) { + let c = node_options[index]; + + // Backslashes escape the following character + if (c === '\\' && is_in_string) { + if (index + 1 === node_options.length) { + errors.push("invalid value for NODE_OPTIONS " + + "(invalid escape)\n"); + return env_argv; + } else { + c = node_options[++index]; + } + } else if (c === ' ' && !is_in_string) { + will_start_new_arg = true; + continue; + } else if (c === '"') { + is_in_string = !is_in_string; + continue; + } + + if (will_start_new_arg) { + env_argv.push(c); + will_start_new_arg = false; + } else { + env_argv[env_argv.length - 1] += c; + } + } + + if (is_in_string) { + errors.push("invalid value for NODE_OPTIONS " + + "(unterminated string)\n"); + } + return env_argv; +} + +// Get option values that can be specified via env vars besides NODE_OPTIONS +function getOptionValuesFromOtherEnvVars() { + const options = {}; + if(process.env.NODE_PENDING_DEPRECATION === '1') { + options['--pending-deprecation'] = true; + } + return options; +} + + +/***/ }), + +/***/ 26326: +/***/ ((module) => { + +module.exports = { + ArrayFrom: Array.from, + ArrayIsArray: Array.isArray, + ArrayPrototypeShift: (obj) => Array.prototype.shift.call(obj), + ArrayPrototypeForEach: (arr, ...rest) => Array.prototype.forEach.apply(arr, rest), + ArrayPrototypeIncludes: (arr, ...rest) => Array.prototype.includes.apply(arr, rest), + ArrayPrototypeJoin: (arr, ...rest) => Array.prototype.join.apply(arr, rest), + ArrayPrototypePop: (arr, ...rest) => Array.prototype.pop.apply(arr, rest), + ArrayPrototypePush: (arr, ...rest) => Array.prototype.push.apply(arr, rest), + FunctionPrototype: Function.prototype, + JSONParse: JSON.parse, + JSONStringify: JSON.stringify, + ObjectFreeze: Object.freeze, + ObjectKeys: Object.keys, + ObjectGetOwnPropertyNames: Object.getOwnPropertyNames, + ObjectDefineProperty: Object.defineProperty, + ObjectPrototypeHasOwnProperty: (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop), + RegExpPrototypeExec: (obj, string) => RegExp.prototype.exec.call(obj, string), + RegExpPrototypeTest: (obj, string) => RegExp.prototype.test.call(obj, string), + RegExpPrototypeSymbolReplace: (obj, ...rest) => RegExp.prototype[Symbol.replace].apply(obj, rest), + SafeMap: Map, + SafeSet: Set, + SafeWeakMap: WeakMap, + StringPrototypeEndsWith: (str, ...rest) => String.prototype.endsWith.apply(str, rest), + StringPrototypeIncludes: (str, ...rest) => String.prototype.includes.apply(str, rest), + StringPrototypeLastIndexOf: (str, ...rest) => String.prototype.lastIndexOf.apply(str, rest), + StringPrototypeIndexOf: (str, ...rest) => String.prototype.indexOf.apply(str, rest), + StringPrototypeRepeat: (str, ...rest) => String.prototype.repeat.apply(str, rest), + StringPrototypeReplace: (str, ...rest) => String.prototype.replace.apply(str, rest), + StringPrototypeSlice: (str, ...rest) => String.prototype.slice.apply(str, rest), + StringPrototypeSplit: (str, ...rest) => String.prototype.split.apply(str, rest), + StringPrototypeStartsWith: (str, ...rest) => String.prototype.startsWith.apply(str, rest), + StringPrototypeSubstr: (str, ...rest) => String.prototype.substr.apply(str, rest), + StringPrototypeCharCodeAt: (str, ...rest) => String.prototype.charCodeAt.apply(str, rest), + StringPrototypeMatch: (str, ...rest) => String.prototype.match.apply(str, rest), + SyntaxError: SyntaxError +}; + + +/***/ }), + +/***/ 64414: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.installCommonjsResolveHooksIfNecessary = void 0; +/** + * @internal + */ +function installCommonjsResolveHooksIfNecessary(tsNodeService) { + const Module = __nccwpck_require__(98188); + const originalResolveFilename = Module._resolveFilename; + const originalFindPath = Module._findPath; + const shouldInstallHook = tsNodeService.options.experimentalResolver; + if (shouldInstallHook) { + const { Module_findPath, Module_resolveFilename } = tsNodeService.getNodeCjsLoader(); + Module._resolveFilename = _resolveFilename; + Module._findPath = _findPath; + function _resolveFilename(request, parent, isMain, options, ...rest) { + if (!tsNodeService.enabled()) + return originalResolveFilename.call(this, request, parent, isMain, options, ...rest); + return Module_resolveFilename.call(this, request, parent, isMain, options, ...rest); + } + function _findPath() { + if (!tsNodeService.enabled()) + return originalFindPath.apply(this, arguments); + return Module_findPath.apply(this, arguments); + } + } +} +exports.installCommonjsResolveHooksIfNecessary = installCommonjsResolveHooksIfNecessary; +//# sourceMappingURL=cjs-resolve-hooks.js.map + +/***/ }), + +/***/ 29906: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getTsConfigDefaults = exports.ComputeAsCommonRootOfFiles = exports.loadCompiler = exports.resolveAndLoadCompiler = exports.readConfig = exports.findAndReadConfig = void 0; +const path_1 = __nccwpck_require__(71017); +const index_1 = __nccwpck_require__(72719); +const ts_internals_1 = __nccwpck_require__(14851); +const tsconfigs_1 = __nccwpck_require__(91533); +const util_1 = __nccwpck_require__(64745); +/** + * TypeScript compiler option values required by `ts-node` which cannot be overridden. + */ +const TS_NODE_COMPILER_OPTIONS = { + sourceMap: true, + inlineSourceMap: false, + inlineSources: true, + declaration: false, + noEmit: false, + outDir: '.ts-node', +}; +/* + * Do post-processing on config options to support `ts-node`. + */ +function fixConfig(ts, config) { + // Delete options that *should not* be passed through. + delete config.options.out; + delete config.options.outFile; + delete config.options.composite; + delete config.options.declarationDir; + delete config.options.declarationMap; + delete config.options.emitDeclarationOnly; + // Target ES5 output by default (instead of ES3). + if (config.options.target === undefined) { + config.options.target = ts.ScriptTarget.ES5; + } + // Target CommonJS modules by default (instead of magically switching to ES6 when the target is ES6). + if (config.options.module === undefined) { + config.options.module = ts.ModuleKind.CommonJS; + } + return config; +} +/** @internal */ +function findAndReadConfig(rawOptions) { + var _a, _b, _c, _d, _e; + const cwd = (0, path_1.resolve)((_c = (_b = (_a = rawOptions.cwd) !== null && _a !== void 0 ? _a : rawOptions.dir) !== null && _b !== void 0 ? _b : index_1.DEFAULTS.cwd) !== null && _c !== void 0 ? _c : process.cwd()); + const compilerName = (_d = rawOptions.compiler) !== null && _d !== void 0 ? _d : index_1.DEFAULTS.compiler; + // Compute minimum options to read the config file. + let projectLocalResolveDir = (0, util_1.getBasePathForProjectLocalDependencyResolution)(undefined, rawOptions.projectSearchDir, rawOptions.project, cwd); + let { compiler, ts } = resolveAndLoadCompiler(compilerName, projectLocalResolveDir); + // Read config file and merge new options between env and CLI options. + const { configFilePath, config, tsNodeOptionsFromTsconfig, optionBasePaths } = readConfig(cwd, ts, rawOptions); + const options = (0, util_1.assign)({}, index_1.DEFAULTS, tsNodeOptionsFromTsconfig || {}, { optionBasePaths }, rawOptions); + options.require = [ + ...(tsNodeOptionsFromTsconfig.require || []), + ...(rawOptions.require || []), + ]; + // Re-resolve the compiler in case it has changed. + // Compiler is loaded relative to tsconfig.json, so tsconfig discovery may cause us to load a + // different compiler than we did above, even if the name has not changed. + if (configFilePath) { + projectLocalResolveDir = (0, util_1.getBasePathForProjectLocalDependencyResolution)(configFilePath, rawOptions.projectSearchDir, rawOptions.project, cwd); + ({ compiler } = resolveCompiler(options.compiler, (_e = optionBasePaths.compiler) !== null && _e !== void 0 ? _e : projectLocalResolveDir)); + } + return { + options, + config, + projectLocalResolveDir, + optionBasePaths, + configFilePath, + cwd, + compiler, + }; +} +exports.findAndReadConfig = findAndReadConfig; +/** + * Load TypeScript configuration. Returns the parsed TypeScript config and + * any `ts-node` options specified in the config file. + * + * Even when a tsconfig.json is not loaded, this function still handles merging + * compilerOptions from various sources: API, environment variables, etc. + * + * @internal + */ +function readConfig(cwd, ts, rawApiOptions) { + var _a, _b, _c; + // Ordered [a, b, c] where config a extends b extends c + const configChain = []; + let config = { compilerOptions: {} }; + let basePath = cwd; + let configFilePath = undefined; + const projectSearchDir = (0, path_1.resolve)(cwd, (_a = rawApiOptions.projectSearchDir) !== null && _a !== void 0 ? _a : cwd); + const { fileExists = ts.sys.fileExists, readFile = ts.sys.readFile, skipProject = index_1.DEFAULTS.skipProject, project = index_1.DEFAULTS.project, tsTrace = index_1.DEFAULTS.tsTrace, } = rawApiOptions; + // Read project configuration when available. + if (!skipProject) { + if (project) { + const resolved = (0, path_1.resolve)(cwd, project); + const nested = (0, path_1.join)(resolved, 'tsconfig.json'); + configFilePath = fileExists(nested) ? nested : resolved; + } + else { + configFilePath = ts.findConfigFile(projectSearchDir, fileExists); + } + if (configFilePath) { + let pathToNextConfigInChain = configFilePath; + const tsInternals = (0, ts_internals_1.createTsInternals)(ts); + const errors = []; + // Follow chain of "extends" + while (true) { + const result = ts.readConfigFile(pathToNextConfigInChain, readFile); + // Return diagnostics. + if (result.error) { + return { + configFilePath, + config: { errors: [result.error], fileNames: [], options: {} }, + tsNodeOptionsFromTsconfig: {}, + optionBasePaths: {}, + }; + } + const c = result.config; + const bp = (0, path_1.dirname)(pathToNextConfigInChain); + configChain.push({ + config: c, + basePath: bp, + configPath: pathToNextConfigInChain, + }); + if (c.extends == null) + break; + const resolvedExtendedConfigPath = tsInternals.getExtendsConfigPath(c.extends, { + fileExists, + readDirectory: ts.sys.readDirectory, + readFile, + useCaseSensitiveFileNames: ts.sys.useCaseSensitiveFileNames, + trace: tsTrace, + }, bp, errors, ts.createCompilerDiagnostic); + if (errors.length) { + return { + configFilePath, + config: { errors, fileNames: [], options: {} }, + tsNodeOptionsFromTsconfig: {}, + optionBasePaths: {}, + }; + } + if (resolvedExtendedConfigPath == null) + break; + pathToNextConfigInChain = resolvedExtendedConfigPath; + } + ({ config, basePath } = configChain[0]); + } + } + // Merge and fix ts-node options that come from tsconfig.json(s) + const tsNodeOptionsFromTsconfig = {}; + const optionBasePaths = {}; + for (let i = configChain.length - 1; i >= 0; i--) { + const { config, basePath, configPath } = configChain[i]; + const options = filterRecognizedTsConfigTsNodeOptions(config['ts-node']).recognized; + // Some options are relative to the config file, so must be converted to absolute paths here + if (options.require) { + // Modules are found relative to the tsconfig file, not the `dir` option + const tsconfigRelativeResolver = (0, util_1.createProjectLocalResolveHelper)((0, path_1.dirname)(configPath)); + options.require = options.require.map((path) => tsconfigRelativeResolver(path, false)); + } + if (options.scopeDir) { + options.scopeDir = (0, path_1.resolve)(basePath, options.scopeDir); + } + // Downstream code uses the basePath; we do not do that here. + if (options.moduleTypes) { + optionBasePaths.moduleTypes = basePath; + } + if (options.transpiler != null) { + optionBasePaths.transpiler = basePath; + } + if (options.compiler != null) { + optionBasePaths.compiler = basePath; + } + if (options.swc != null) { + optionBasePaths.swc = basePath; + } + (0, util_1.assign)(tsNodeOptionsFromTsconfig, options); + } + // Remove resolution of "files". + const files = (_c = (_b = rawApiOptions.files) !== null && _b !== void 0 ? _b : tsNodeOptionsFromTsconfig.files) !== null && _c !== void 0 ? _c : index_1.DEFAULTS.files; + // Only if a config file is *not* loaded, load an implicit configuration from @tsconfig/bases + const skipDefaultCompilerOptions = configFilePath != null; + const defaultCompilerOptionsForNodeVersion = skipDefaultCompilerOptions + ? undefined + : { + ...(0, tsconfigs_1.getDefaultTsconfigJsonForNodeVersion)(ts).compilerOptions, + types: ['node'], + }; + // Merge compilerOptions from all sources + config.compilerOptions = Object.assign({}, + // automatically-applied options from @tsconfig/bases + defaultCompilerOptionsForNodeVersion, + // tsconfig.json "compilerOptions" + config.compilerOptions, + // from env var + index_1.DEFAULTS.compilerOptions, + // tsconfig.json "ts-node": "compilerOptions" + tsNodeOptionsFromTsconfig.compilerOptions, + // passed programmatically + rawApiOptions.compilerOptions, + // overrides required by ts-node, cannot be changed + TS_NODE_COMPILER_OPTIONS); + const fixedConfig = fixConfig(ts, ts.parseJsonConfigFileContent(config, { + fileExists, + readFile, + // Only used for globbing "files", "include", "exclude" + // When `files` option disabled, we want to avoid the fs calls + readDirectory: files ? ts.sys.readDirectory : () => [], + useCaseSensitiveFileNames: ts.sys.useCaseSensitiveFileNames, + }, basePath, undefined, configFilePath)); + return { + configFilePath, + config: fixedConfig, + tsNodeOptionsFromTsconfig, + optionBasePaths, + }; +} +exports.readConfig = readConfig; +/** + * Load the typescript compiler. It is required to load the tsconfig but might + * be changed by the tsconfig, so we have to do this twice. + * @internal + */ +function resolveAndLoadCompiler(name, relativeToPath) { + const { compiler } = resolveCompiler(name, relativeToPath); + const ts = loadCompiler(compiler); + return { compiler, ts }; +} +exports.resolveAndLoadCompiler = resolveAndLoadCompiler; +function resolveCompiler(name, relativeToPath) { + const projectLocalResolveHelper = (0, util_1.createProjectLocalResolveHelper)(relativeToPath); + const compiler = projectLocalResolveHelper(name || 'typescript', true); + return { compiler }; +} +/** @internal */ +function loadCompiler(compiler) { + return (0, util_1.attemptRequireWithV8CompileCache)(require, compiler); +} +exports.loadCompiler = loadCompiler; +/** + * Given the raw "ts-node" sub-object from a tsconfig, return an object with only the properties + * recognized by "ts-node" + */ +function filterRecognizedTsConfigTsNodeOptions(jsonObject) { + if (jsonObject == null) + return { recognized: {}, unrecognized: {} }; + const { compiler, compilerHost, compilerOptions, emit, files, ignore, ignoreDiagnostics, logError, preferTsExts, pretty, require, skipIgnore, transpileOnly, typeCheck, transpiler, scope, scopeDir, moduleTypes, experimentalReplAwait, swc, experimentalResolver, esm, experimentalSpecifierResolution, experimentalTsImportSpecifiers, ...unrecognized } = jsonObject; + const filteredTsConfigOptions = { + compiler, + compilerHost, + compilerOptions, + emit, + experimentalReplAwait, + files, + ignore, + ignoreDiagnostics, + logError, + preferTsExts, + pretty, + require, + skipIgnore, + transpileOnly, + typeCheck, + transpiler, + scope, + scopeDir, + moduleTypes, + swc, + experimentalResolver, + esm, + experimentalSpecifierResolution, + experimentalTsImportSpecifiers, + }; + // Use the typechecker to make sure this implementation has the correct set of properties + const catchExtraneousProps = null; + const catchMissingProps = null; + return { recognized: filteredTsConfigOptions, unrecognized }; +} +/** @internal */ +exports.ComputeAsCommonRootOfFiles = Symbol(); +/** + * Some TS compiler options have defaults which are not provided by TS's config parsing functions. + * This function centralizes the logic for computing those defaults. + * @internal + */ +function getTsConfigDefaults(config, basePath, _files, _include, _exclude) { + const { composite = false } = config.options; + let rootDir = config.options.rootDir; + if (rootDir == null) { + if (composite) + rootDir = basePath; + // Return this symbol to avoid computing from `files`, which would require fs calls + else + rootDir = exports.ComputeAsCommonRootOfFiles; + } + const { outDir = rootDir } = config.options; + // Docs are wrong: https://www.typescriptlang.org/tsconfig#include + // Docs say **, but it's actually **/*; compiler throws error for ** + const include = _files ? [] : ['**/*']; + const files = _files !== null && _files !== void 0 ? _files : []; + // Docs are misleading: https://www.typescriptlang.org/tsconfig#exclude + // Docs say it excludes node_modules, bower_components, jspm_packages, but actually those are excluded via behavior of "include" + const exclude = _exclude !== null && _exclude !== void 0 ? _exclude : [outDir]; // TODO technically, outDir is absolute path, but exclude should be relative glob pattern? + // TODO compute baseUrl + return { rootDir, outDir, include, files, exclude, composite }; +} +exports.getTsConfigDefaults = getTsConfigDefaults; +//# sourceMappingURL=configuration.js.map + +/***/ }), + +/***/ 84998: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +var __webpack_unused_export__; + +__webpack_unused_export__ = ({ value: true }); +exports.lT = __webpack_unused_export__ = __webpack_unused_export__ = void 0; +const index_1 = __nccwpck_require__(72719); +const url_1 = __nccwpck_require__(57310); +const path_1 = __nccwpck_require__(71017); +const assert = __nccwpck_require__(39491); +const util_1 = __nccwpck_require__(64745); +const module_1 = __nccwpck_require__(98188); +// The hooks API changed in node version X so we need to check for backwards compatibility. +const newHooksAPI = (0, util_1.versionGteLt)(process.versions.node, '16.12.0'); +/** @internal */ +function filterHooksByAPIVersion(hooks) { + const { getFormat, load, resolve, transformSource } = hooks; + // Explicit return type to avoid TS's non-ideal inferred type + const hooksAPI = newHooksAPI + ? { resolve, load, getFormat: undefined, transformSource: undefined } + : { resolve, getFormat, transformSource, load: undefined }; + return hooksAPI; +} +__webpack_unused_export__ = filterHooksByAPIVersion; +/** @internal */ +function registerAndCreateEsmHooks(opts) { + // Automatically performs registration just like `-r ts-node/register` + const tsNodeInstance = (0, index_1.register)(opts); + return createEsmHooks(tsNodeInstance); +} +__webpack_unused_export__ = registerAndCreateEsmHooks; +function createEsmHooks(tsNodeService) { + tsNodeService.enableExperimentalEsmLoaderInterop(); + // Custom implementation that considers additional file extensions and automatically adds file extensions + const nodeResolveImplementation = tsNodeService.getNodeEsmResolver(); + const nodeGetFormatImplementation = tsNodeService.getNodeEsmGetFormat(); + const extensions = tsNodeService.extensions; + const hooksAPI = filterHooksByAPIVersion({ + resolve, + load, + getFormat, + transformSource, + }); + function isFileUrlOrNodeStyleSpecifier(parsed) { + // We only understand file:// URLs, but in node, the specifier can be a node-style `./foo` or `foo` + const { protocol } = parsed; + return protocol === null || protocol === 'file:'; + } + /** + * Named "probably" as a reminder that this is a guess. + * node does not explicitly tell us if we're resolving the entrypoint or not. + */ + function isProbablyEntrypoint(specifier, parentURL) { + return parentURL === undefined && specifier.startsWith('file://'); + } + // Side-channel between `resolve()` and `load()` hooks + const rememberIsProbablyEntrypoint = new Set(); + const rememberResolvedViaCommonjsFallback = new Set(); + async function resolve(specifier, context, defaultResolve) { + const defer = async () => { + const r = await defaultResolve(specifier, context, defaultResolve); + return r; + }; + // See: https://github.com/nodejs/node/discussions/41711 + // nodejs will likely implement a similar fallback. Till then, we can do our users a favor and fallback today. + async function entrypointFallback(cb) { + try { + const resolution = await cb(); + if ((resolution === null || resolution === void 0 ? void 0 : resolution.url) && + isProbablyEntrypoint(specifier, context.parentURL)) + rememberIsProbablyEntrypoint.add(resolution.url); + return resolution; + } + catch (esmResolverError) { + if (!isProbablyEntrypoint(specifier, context.parentURL)) + throw esmResolverError; + try { + let cjsSpecifier = specifier; + // Attempt to convert from ESM file:// to CommonJS path + try { + if (specifier.startsWith('file://')) + cjsSpecifier = (0, url_1.fileURLToPath)(specifier); + } + catch { } + const resolution = (0, url_1.pathToFileURL)((0, module_1.createRequire)(process.cwd()).resolve(cjsSpecifier)).toString(); + rememberIsProbablyEntrypoint.add(resolution); + rememberResolvedViaCommonjsFallback.add(resolution); + return { url: resolution, format: 'commonjs' }; + } + catch (commonjsResolverError) { + throw esmResolverError; + } + } + } + return addShortCircuitFlag(async () => { + const parsed = (0, url_1.parse)(specifier); + const { pathname, protocol, hostname } = parsed; + if (!isFileUrlOrNodeStyleSpecifier(parsed)) { + return entrypointFallback(defer); + } + if (protocol !== null && protocol !== 'file:') { + return entrypointFallback(defer); + } + // Malformed file:// URL? We should always see `null` or `''` + if (hostname) { + // TODO file://./foo sets `hostname` to `'.'`. Perhaps we should special-case this. + return entrypointFallback(defer); + } + // pathname is the path to be resolved + return entrypointFallback(() => nodeResolveImplementation.defaultResolve(specifier, context, defaultResolve)); + }); + } + // `load` from new loader hook API (See description at the top of this file) + async function load(url, context, defaultLoad) { + return addShortCircuitFlag(async () => { + var _a; + // If we get a format hint from resolve() on the context then use it + // otherwise call the old getFormat() hook using node's old built-in defaultGetFormat() that ships with ts-node + const format = (_a = context.format) !== null && _a !== void 0 ? _a : (await getFormat(url, context, nodeGetFormatImplementation.defaultGetFormat)).format; + let source = undefined; + if (format !== 'builtin' && format !== 'commonjs') { + // Call the new defaultLoad() to get the source + const { source: rawSource } = await defaultLoad(url, { + ...context, + format, + }, defaultLoad); + if (rawSource === undefined || rawSource === null) { + throw new Error(`Failed to load raw source: Format was '${format}' and url was '${url}''.`); + } + // Emulate node's built-in old defaultTransformSource() so we can re-use the old transformSource() hook + const defaultTransformSource = async (source, _context, _defaultTransformSource) => ({ source }); + // Call the old hook + const { source: transformedSource } = await transformSource(rawSource, { url, format }, defaultTransformSource); + source = transformedSource; + } + return { format, source }; + }); + } + async function getFormat(url, context, defaultGetFormat) { + const defer = (overrideUrl = url) => defaultGetFormat(overrideUrl, context, defaultGetFormat); + // See: https://github.com/nodejs/node/discussions/41711 + // nodejs will likely implement a similar fallback. Till then, we can do our users a favor and fallback today. + async function entrypointFallback(cb) { + try { + return await cb(); + } + catch (getFormatError) { + if (!rememberIsProbablyEntrypoint.has(url)) + throw getFormatError; + return { format: 'commonjs' }; + } + } + const parsed = (0, url_1.parse)(url); + if (!isFileUrlOrNodeStyleSpecifier(parsed)) { + return entrypointFallback(defer); + } + const { pathname } = parsed; + assert(pathname !== null, 'ESM getFormat() hook: URL should never have null pathname'); + const nativePath = (0, url_1.fileURLToPath)(url); + let nodeSays; + // If file has extension not understood by node, then ask node how it would treat the emitted extension. + // E.g. .mts compiles to .mjs, so ask node how to classify an .mjs file. + const ext = (0, path_1.extname)(nativePath); + const tsNodeIgnored = tsNodeService.ignored(nativePath); + const nodeEquivalentExt = extensions.nodeEquivalents.get(ext); + if (nodeEquivalentExt && !tsNodeIgnored) { + nodeSays = await entrypointFallback(() => defer((0, url_1.format)((0, url_1.pathToFileURL)(nativePath + nodeEquivalentExt)))); + } + else { + try { + nodeSays = await entrypointFallback(defer); + } + catch (e) { + if (e instanceof Error && + tsNodeIgnored && + extensions.nodeDoesNotUnderstand.includes(ext)) { + e.message += + `\n\n` + + `Hint:\n` + + `ts-node is configured to ignore this file.\n` + + `If you want ts-node to handle this file, consider enabling the "skipIgnore" option or adjusting your "ignore" patterns.\n` + + `https://typestrong.org/ts-node/docs/scope\n`; + } + throw e; + } + } + // For files compiled by ts-node that node believes are either CJS or ESM, check if we should override that classification + if (!tsNodeService.ignored(nativePath) && + (nodeSays.format === 'commonjs' || nodeSays.format === 'module')) { + const { moduleType } = tsNodeService.moduleTypeClassifier.classifyModuleByModuleTypeOverrides((0, util_1.normalizeSlashes)(nativePath)); + if (moduleType === 'cjs') { + return { format: 'commonjs' }; + } + else if (moduleType === 'esm') { + return { format: 'module' }; + } + } + return nodeSays; + } + async function transformSource(source, context, defaultTransformSource) { + if (source === null || source === undefined) { + throw new Error('No source'); + } + const defer = () => defaultTransformSource(source, context, defaultTransformSource); + const sourceAsString = typeof source === 'string' ? source : source.toString('utf8'); + const { url } = context; + const parsed = (0, url_1.parse)(url); + if (!isFileUrlOrNodeStyleSpecifier(parsed)) { + return defer(); + } + const nativePath = (0, url_1.fileURLToPath)(url); + if (tsNodeService.ignored(nativePath)) { + return defer(); + } + const emittedJs = tsNodeService.compile(sourceAsString, nativePath); + return { source: emittedJs }; + } + return hooksAPI; +} +exports.lT = createEsmHooks; +async function addShortCircuitFlag(fn) { + const ret = await fn(); + // Not sure if this is necessary; being lazy. Can revisit in the future. + if (ret == null) + return ret; + return { + ...ret, + shortCircuit: true, + }; +} +//# sourceMappingURL=esm.js.map + +/***/ }), + +/***/ 5183: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getExtensions = void 0; +const util_1 = __nccwpck_require__(64745); +const nodeEquivalents = new Map([ + ['.ts', '.js'], + ['.tsx', '.js'], + ['.jsx', '.js'], + ['.mts', '.mjs'], + ['.cts', '.cjs'], +]); +const tsResolverEquivalents = new Map([ + ['.ts', ['.js']], + ['.tsx', ['.js', '.jsx']], + ['.mts', ['.mjs']], + ['.cts', ['.cjs']], +]); +// All extensions understood by vanilla node +const vanillaNodeExtensions = [ + '.js', + '.json', + '.node', + '.mjs', + '.cjs', +]; +// Extensions added by vanilla node's require() if you omit them: +// js, json, node +// Extensions added by vanilla node if you omit them with --experimental-specifier-resolution=node +// js, json, node, mjs +// Extensions added by ESM codepath's legacy package.json "main" resolver +// js, json, node (not mjs!) +const nodeDoesNotUnderstand = [ + '.ts', + '.tsx', + '.jsx', + '.cts', + '.mts', +]; +/** + * [MUST_UPDATE_FOR_NEW_FILE_EXTENSIONS] + * @internal + */ +function getExtensions(config, options, tsVersion) { + // TS 4.5 is first version to understand .cts, .mts, .cjs, and .mjs extensions + const tsSupportsMtsCtsExts = (0, util_1.versionGteLt)(tsVersion, '4.5.0'); + const requiresHigherTypescriptVersion = []; + if (!tsSupportsMtsCtsExts) + requiresHigherTypescriptVersion.push('.cts', '.cjs', '.mts', '.mjs'); + const allPossibleExtensionsSortedByPreference = Array.from(new Set([ + ...(options.preferTsExts ? nodeDoesNotUnderstand : []), + ...vanillaNodeExtensions, + ...nodeDoesNotUnderstand, + ])); + const compiledJsUnsorted = ['.ts']; + const compiledJsxUnsorted = []; + if (config.options.jsx) + compiledJsxUnsorted.push('.tsx'); + if (tsSupportsMtsCtsExts) + compiledJsUnsorted.push('.mts', '.cts'); + if (config.options.allowJs) { + compiledJsUnsorted.push('.js'); + if (config.options.jsx) + compiledJsxUnsorted.push('.jsx'); + if (tsSupportsMtsCtsExts) + compiledJsUnsorted.push('.mjs', '.cjs'); + } + const compiledUnsorted = [...compiledJsUnsorted, ...compiledJsxUnsorted]; + const compiled = allPossibleExtensionsSortedByPreference.filter((ext) => compiledUnsorted.includes(ext)); + const compiledNodeDoesNotUnderstand = nodeDoesNotUnderstand.filter((ext) => compiled.includes(ext)); + /** + * TS's resolver can resolve foo.js to foo.ts, by replacing .js extension with several source extensions. + * IMPORTANT: Must preserve ordering according to preferTsExts! + * Must include the .js/.mjs/.cjs extension in the array! + * This affects resolution behavior! + * [MUST_UPDATE_FOR_NEW_FILE_EXTENSIONS] + */ + const r = allPossibleExtensionsSortedByPreference.filter((ext) => [...compiledUnsorted, '.js', '.mjs', '.cjs', '.mts', '.cts'].includes(ext)); + const replacementsForJs = r.filter((ext) => ['.js', '.jsx', '.ts', '.tsx'].includes(ext)); + const replacementsForJsx = r.filter((ext) => ['.jsx', '.tsx'].includes(ext)); + const replacementsForMjs = r.filter((ext) => ['.mjs', '.mts'].includes(ext)); + const replacementsForCjs = r.filter((ext) => ['.cjs', '.cts'].includes(ext)); + const replacementsForJsOrMjs = r.filter((ext) => ['.js', '.jsx', '.ts', '.tsx', '.mjs', '.mts'].includes(ext)); + // Node allows omitting .js or .mjs extension in certain situations (CJS, ESM w/experimental flag) + // So anything that compiles to .js or .mjs can also be omitted. + const experimentalSpecifierResolutionAddsIfOmitted = Array.from(new Set([...replacementsForJsOrMjs, '.json', '.node'])); + // Same as above, except node curiuosly doesn't do .mjs here + const legacyMainResolveAddsIfOmitted = Array.from(new Set([...replacementsForJs, '.json', '.node'])); + return { + /** All file extensions we transform, ordered by resolution preference according to preferTsExts */ + compiled, + /** Resolved extensions that vanilla node will not understand; we should handle them */ + nodeDoesNotUnderstand, + /** Like the above, but only the ones we're compiling */ + compiledNodeDoesNotUnderstand, + /** + * Mapping from extensions understood by tsc to the equivalent for node, + * as far as getFormat is concerned. + */ + nodeEquivalents, + /** + * Mapping from extensions rejected by TSC in import specifiers, to the + * possible alternatives that TS's resolver will accept. + * + * When we allow users to opt-in to .ts extensions in import specifiers, TS's + * resolver requires us to replace the .ts extensions with .js alternatives. + * Otherwise, resolution fails. + * + * Note TS's resolver is only used by, and only required for, typechecking. + * This is separate from node's resolver, which we hook separately and which + * does not require this mapping. + */ + tsResolverEquivalents, + /** + * Extensions that we can support if the user upgrades their typescript version. + * Used when raising hints. + */ + requiresHigherTypescriptVersion, + /** + * --experimental-specifier-resolution=node will add these extensions. + */ + experimentalSpecifierResolutionAddsIfOmitted, + /** + * ESM loader will add these extensions to package.json "main" field + */ + legacyMainResolveAddsIfOmitted, + replacementsForMjs, + replacementsForCjs, + replacementsForJsx, + replacementsForJs, + }; +} +exports.getExtensions = getExtensions; +//# sourceMappingURL=file-extensions.js.map + +/***/ }), + +/***/ 72719: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +var _a, _b; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createEsmHooks = exports.createFromPreloadedConfig = exports.create = exports.register = exports.TSError = exports.DEFAULTS = exports.VERSION = exports.debug = exports.INSPECT_CUSTOM = exports.env = exports.REGISTER_INSTANCE = exports.createRepl = void 0; +const path_1 = __nccwpck_require__(71017); +const module_1 = __nccwpck_require__(98188); +const util = __nccwpck_require__(73837); +const url_1 = __nccwpck_require__(57310); +const make_error_1 = __nccwpck_require__(21381); +const util_1 = __nccwpck_require__(64745); +const configuration_1 = __nccwpck_require__(29906); +const module_type_classifier_1 = __nccwpck_require__(23922); +const resolver_functions_1 = __nccwpck_require__(19148); +const cjs_resolve_hooks_1 = __nccwpck_require__(64414); +const node_module_type_classifier_1 = __nccwpck_require__(80812); +const file_extensions_1 = __nccwpck_require__(5183); +const ts_transpile_module_1 = __nccwpck_require__(4444); +var repl_1 = __nccwpck_require__(10204); +Object.defineProperty(exports, "createRepl", ({ enumerable: true, get: function () { return repl_1.createRepl; } })); +/** + * Does this version of node obey the package.json "type" field + * and throw ERR_REQUIRE_ESM when attempting to require() an ESM modules. + */ +const engineSupportsPackageTypeField = parseInt(process.versions.node.split('.')[0], 10) >= 12; +/** + * Assert that script can be loaded as CommonJS when we attempt to require it. + * If it should be loaded as ESM, throw ERR_REQUIRE_ESM like node does. + * + * Loaded conditionally so we don't need to support older node versions + */ +let assertScriptCanLoadAsCJS = engineSupportsPackageTypeField + ? (__nccwpck_require__(51633).assertScriptCanLoadAsCJSImpl) + : () => { + /* noop */ + }; +/** + * Registered `ts-node` instance information. + */ +exports.REGISTER_INSTANCE = Symbol.for('ts-node.register.instance'); +/** @internal */ +exports.env = process.env; +/** + * @internal + */ +exports.INSPECT_CUSTOM = util.inspect.custom || 'inspect'; +/** + * Debugging `ts-node`. + */ +const shouldDebug = (0, util_1.yn)(exports.env.TS_NODE_DEBUG); +/** @internal */ +exports.debug = shouldDebug + ? (...args) => console.log(`[ts-node ${new Date().toISOString()}]`, ...args) + : () => undefined; +const debugFn = shouldDebug + ? (key, fn) => { + let i = 0; + return (x) => { + (0, exports.debug)(key, x, ++i); + return fn(x); + }; + } + : (_, fn) => fn; +/** + * Export the current version. + */ +exports.VERSION = __nccwpck_require__(46686).version; +/** + * Default register options, including values specified via environment + * variables. + * @internal + */ +exports.DEFAULTS = { + cwd: (_a = exports.env.TS_NODE_CWD) !== null && _a !== void 0 ? _a : exports.env.TS_NODE_DIR, + emit: (0, util_1.yn)(exports.env.TS_NODE_EMIT), + scope: (0, util_1.yn)(exports.env.TS_NODE_SCOPE), + scopeDir: exports.env.TS_NODE_SCOPE_DIR, + files: (0, util_1.yn)(exports.env.TS_NODE_FILES), + pretty: (0, util_1.yn)(exports.env.TS_NODE_PRETTY), + compiler: exports.env.TS_NODE_COMPILER, + compilerOptions: (0, util_1.parse)(exports.env.TS_NODE_COMPILER_OPTIONS), + ignore: (0, util_1.split)(exports.env.TS_NODE_IGNORE), + project: exports.env.TS_NODE_PROJECT, + skipProject: (0, util_1.yn)(exports.env.TS_NODE_SKIP_PROJECT), + skipIgnore: (0, util_1.yn)(exports.env.TS_NODE_SKIP_IGNORE), + preferTsExts: (0, util_1.yn)(exports.env.TS_NODE_PREFER_TS_EXTS), + ignoreDiagnostics: (0, util_1.split)(exports.env.TS_NODE_IGNORE_DIAGNOSTICS), + transpileOnly: (0, util_1.yn)(exports.env.TS_NODE_TRANSPILE_ONLY), + typeCheck: (0, util_1.yn)(exports.env.TS_NODE_TYPE_CHECK), + compilerHost: (0, util_1.yn)(exports.env.TS_NODE_COMPILER_HOST), + logError: (0, util_1.yn)(exports.env.TS_NODE_LOG_ERROR), + experimentalReplAwait: (_b = (0, util_1.yn)(exports.env.TS_NODE_EXPERIMENTAL_REPL_AWAIT)) !== null && _b !== void 0 ? _b : undefined, + tsTrace: console.log.bind(console), +}; +/** + * TypeScript diagnostics error. + */ +class TSError extends make_error_1.BaseError { + constructor(diagnosticText, diagnosticCodes, diagnostics = []) { + super(`⨯ Unable to compile TypeScript:\n${diagnosticText}`); + this.diagnosticCodes = diagnosticCodes; + this.name = 'TSError'; + Object.defineProperty(this, 'diagnosticText', { + configurable: true, + writable: true, + value: diagnosticText, + }); + Object.defineProperty(this, 'diagnostics', { + configurable: true, + writable: true, + value: diagnostics, + }); + } + /** + * @internal + */ + [exports.INSPECT_CUSTOM]() { + return this.diagnosticText; + } +} +exports.TSError = TSError; +const TS_NODE_SERVICE_BRAND = Symbol('TS_NODE_SERVICE_BRAND'); +function register(serviceOrOpts) { + // Is this a Service or a RegisterOptions? + let service = serviceOrOpts; + if (!(serviceOrOpts === null || serviceOrOpts === void 0 ? void 0 : serviceOrOpts[TS_NODE_SERVICE_BRAND])) { + // Not a service; is options + service = create((serviceOrOpts !== null && serviceOrOpts !== void 0 ? serviceOrOpts : {})); + } + const originalJsHandler = require.extensions['.js']; + // Expose registered instance globally. + process[exports.REGISTER_INSTANCE] = service; + // Register the extensions. + registerExtensions(service.options.preferTsExts, service.extensions.compiled, service, originalJsHandler); + (0, cjs_resolve_hooks_1.installCommonjsResolveHooksIfNecessary)(service); + // Require specified modules before start-up. + module_1.Module._preloadModules(service.options.require); + return service; +} +exports.register = register; +/** + * Create TypeScript compiler instance. + * + * @category Basic + */ +function create(rawOptions = {}) { + const foundConfigResult = (0, configuration_1.findAndReadConfig)(rawOptions); + return createFromPreloadedConfig(foundConfigResult); +} +exports.create = create; +/** @internal */ +function createFromPreloadedConfig(foundConfigResult) { + var _a, _b, _c, _d; + const { configFilePath, cwd, options, config, compiler, projectLocalResolveDir, optionBasePaths, } = foundConfigResult; + const projectLocalResolveHelper = (0, util_1.createProjectLocalResolveHelper)(projectLocalResolveDir); + const ts = (0, configuration_1.loadCompiler)(compiler); + // Experimental REPL await is not compatible targets lower than ES2018 + const targetSupportsTla = config.options.target >= ts.ScriptTarget.ES2018; + if (options.experimentalReplAwait === true && !targetSupportsTla) { + throw new Error('Experimental REPL await is not compatible with targets lower than ES2018'); + } + // Top-level await was added in TS 3.8 + const tsVersionSupportsTla = (0, util_1.versionGteLt)(ts.version, '3.8.0'); + if (options.experimentalReplAwait === true && !tsVersionSupportsTla) { + throw new Error('Experimental REPL await is not compatible with TypeScript versions older than 3.8'); + } + const shouldReplAwait = options.experimentalReplAwait !== false && + tsVersionSupportsTla && + targetSupportsTla; + // swc implies two other options + // typeCheck option was implemented specifically to allow overriding tsconfig transpileOnly from the command-line + // So we should allow using typeCheck to override swc + if (options.swc && !options.typeCheck) { + if (options.transpileOnly === false) { + throw new Error("Cannot enable 'swc' option with 'transpileOnly: false'. 'swc' implies 'transpileOnly'."); + } + if (options.transpiler) { + throw new Error("Cannot specify both 'swc' and 'transpiler' options. 'swc' uses the built-in swc transpiler."); + } + } + const readFile = options.readFile || ts.sys.readFile; + const fileExists = options.fileExists || ts.sys.fileExists; + // typeCheck can override transpileOnly, useful for CLI flag to override config file + const transpileOnly = (options.transpileOnly === true || options.swc === true) && + options.typeCheck !== true; + let transpiler = undefined; + let transpilerBasePath = undefined; + if (options.transpiler) { + transpiler = options.transpiler; + transpilerBasePath = optionBasePaths.transpiler; + } + else if (options.swc) { + transpiler = __nccwpck_require__.ab + "swc.js"; + transpilerBasePath = optionBasePaths.swc; + } + const transformers = options.transformers || undefined; + const diagnosticFilters = [ + { + appliesToAllFiles: true, + filenamesAbsolute: [], + diagnosticsIgnored: [ + 6059, + 18002, + 18003, + ...(options.experimentalTsImportSpecifiers + ? [ + 2691, // "An import path cannot end with a '.ts' extension. Consider importing '' instead." + ] + : []), + ...(options.ignoreDiagnostics || []), + ].map(Number), + }, + ]; + const configDiagnosticList = filterDiagnostics(config.errors, diagnosticFilters); + const outputCache = new Map(); + const configFileDirname = configFilePath ? (0, path_1.dirname)(configFilePath) : null; + const scopeDir = (_c = (_b = (_a = options.scopeDir) !== null && _a !== void 0 ? _a : config.options.rootDir) !== null && _b !== void 0 ? _b : configFileDirname) !== null && _c !== void 0 ? _c : cwd; + const ignoreBaseDir = configFileDirname !== null && configFileDirname !== void 0 ? configFileDirname : cwd; + const isScoped = options.scope + ? (fileName) => (0, path_1.relative)(scopeDir, fileName).charAt(0) !== '.' + : () => true; + const shouldIgnore = createIgnore(ignoreBaseDir, options.skipIgnore + ? [] + : (options.ignore || ['(?:^|/)node_modules/']).map((str) => new RegExp(str))); + const diagnosticHost = { + getNewLine: () => ts.sys.newLine, + getCurrentDirectory: () => cwd, + // TODO switch to getCanonicalFileName we already create later in scope + getCanonicalFileName: ts.sys.useCaseSensitiveFileNames + ? (x) => x + : (x) => x.toLowerCase(), + }; + if (options.transpileOnly && typeof transformers === 'function') { + throw new TypeError('Transformers function is unavailable in "--transpile-only"'); + } + let createTranspiler = initializeTranspilerFactory(); + function initializeTranspilerFactory() { + var _a; + if (__nccwpck_require__.ab + "swc.js") { + if (!transpileOnly) + throw new Error('Custom transpiler can only be used when transpileOnly is enabled.'); + const transpilerName = typeof transpiler === 'string' ? transpiler : transpiler[0]; + const transpilerOptions = typeof transpiler === 'string' ? {} : (_a = transpiler[1]) !== null && _a !== void 0 ? _a : {}; + const transpilerConfigLocalResolveHelper = transpilerBasePath + ? (0, util_1.createProjectLocalResolveHelper)(transpilerBasePath) + : projectLocalResolveHelper; + const transpilerPath = transpilerConfigLocalResolveHelper(transpilerName, true); + const transpilerFactory = __nccwpck_require__(3833)(transpilerPath) + .create; + return createTranspiler; + function createTranspiler(compilerOptions, nodeModuleEmitKind) { + return transpilerFactory === null || transpilerFactory === void 0 ? void 0 : transpilerFactory({ + service: { + options, + config: { + ...config, + options: compilerOptions, + }, + projectLocalResolveHelper, + }, + transpilerConfigLocalResolveHelper, + nodeModuleEmitKind, + ...transpilerOptions, + }); + } + } + } + /** + * True if require() hooks should interop with experimental ESM loader. + * Enabled explicitly via a flag since it is a breaking change. + */ + let experimentalEsmLoader = false; + function enableExperimentalEsmLoaderInterop() { + experimentalEsmLoader = true; + } + // Install source map support and read from memory cache. + installSourceMapSupport(); + function installSourceMapSupport() { + const sourceMapSupport = __nccwpck_require__(99964); + sourceMapSupport.install({ + environment: 'node', + retrieveFile(pathOrUrl) { + var _a; + let path = pathOrUrl; + // If it's a file URL, convert to local path + // Note: fileURLToPath does not exist on early node v10 + // I could not find a way to handle non-URLs except to swallow an error + if (experimentalEsmLoader && path.startsWith('file://')) { + try { + path = (0, url_1.fileURLToPath)(path); + } + catch (e) { + /* swallow error */ + } + } + path = (0, util_1.normalizeSlashes)(path); + return ((_a = outputCache.get(path)) === null || _a === void 0 ? void 0 : _a.content) || ''; + }, + redirectConflictingLibrary: true, + onConflictingLibraryRedirect(request, parent, isMain, options, redirectedRequest) { + (0, exports.debug)(`Redirected an attempt to require source-map-support to instead receive @cspotcode/source-map-support. "${parent.filename}" attempted to require or resolve "${request}" and was redirected to "${redirectedRequest}".`); + }, + }); + } + const shouldHavePrettyErrors = options.pretty === undefined ? process.stdout.isTTY : options.pretty; + const formatDiagnostics = shouldHavePrettyErrors + ? ts.formatDiagnosticsWithColorAndContext || ts.formatDiagnostics + : ts.formatDiagnostics; + function createTSError(diagnostics) { + const diagnosticText = formatDiagnostics(diagnostics, diagnosticHost); + const diagnosticCodes = diagnostics.map((x) => x.code); + return new TSError(diagnosticText, diagnosticCodes, diagnostics); + } + function reportTSError(configDiagnosticList) { + const error = createTSError(configDiagnosticList); + if (options.logError) { + // Print error in red color and continue execution. + console.error('\x1b[31m%s\x1b[0m', error); + } + else { + // Throw error and exit the script. + throw error; + } + } + // Render the configuration errors. + if (configDiagnosticList.length) + reportTSError(configDiagnosticList); + const jsxEmitPreserve = config.options.jsx === ts.JsxEmit.Preserve; + /** + * Get the extension for a transpiled file. + * [MUST_UPDATE_FOR_NEW_FILE_EXTENSIONS] + */ + function getEmitExtension(path) { + const lastDotIndex = path.lastIndexOf('.'); + if (lastDotIndex >= 0) { + const ext = path.slice(lastDotIndex); + switch (ext) { + case '.js': + case '.ts': + return '.js'; + case '.jsx': + case '.tsx': + return jsxEmitPreserve ? '.jsx' : '.js'; + case '.mjs': + case '.mts': + return '.mjs'; + case '.cjs': + case '.cts': + return '.cjs'; + } + } + return '.js'; + } + /** + * Get output from TS compiler w/typechecking. `undefined` in `transpileOnly` + * mode. + */ + let getOutput; + let getTypeInfo; + const getCanonicalFileName = ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames); + const moduleTypeClassifier = (0, module_type_classifier_1.createModuleTypeClassifier)({ + basePath: (_d = options.optionBasePaths) === null || _d === void 0 ? void 0 : _d.moduleTypes, + patterns: options.moduleTypes, + }); + const extensions = (0, file_extensions_1.getExtensions)(config, options, ts.version); + // Use full language services when the fast option is disabled. + if (!transpileOnly) { + const fileContents = new Map(); + const rootFileNames = new Set(config.fileNames); + const cachedReadFile = (0, util_1.cachedLookup)(debugFn('readFile', readFile)); + // Use language services by default + if (!options.compilerHost) { + let projectVersion = 1; + const fileVersions = new Map(Array.from(rootFileNames).map((fileName) => [fileName, 0])); + const getCustomTransformers = () => { + if (typeof transformers === 'function') { + const program = service.getProgram(); + return program ? transformers(program) : undefined; + } + return transformers; + }; + // Create the compiler host for type checking. + const serviceHost = { + getProjectVersion: () => String(projectVersion), + getScriptFileNames: () => Array.from(rootFileNames), + getScriptVersion: (fileName) => { + const version = fileVersions.get(fileName); + return version ? version.toString() : ''; + }, + getScriptSnapshot(fileName) { + // TODO ordering of this with getScriptVersion? Should they sync up? + let contents = fileContents.get(fileName); + // Read contents into TypeScript memory cache. + if (contents === undefined) { + contents = cachedReadFile(fileName); + if (contents === undefined) + return; + fileVersions.set(fileName, 1); + fileContents.set(fileName, contents); + projectVersion++; + } + return ts.ScriptSnapshot.fromString(contents); + }, + readFile: cachedReadFile, + readDirectory: ts.sys.readDirectory, + getDirectories: (0, util_1.cachedLookup)(debugFn('getDirectories', ts.sys.getDirectories)), + fileExists: (0, util_1.cachedLookup)(debugFn('fileExists', fileExists)), + directoryExists: (0, util_1.cachedLookup)(debugFn('directoryExists', ts.sys.directoryExists)), + realpath: ts.sys.realpath + ? (0, util_1.cachedLookup)(debugFn('realpath', ts.sys.realpath)) + : undefined, + getNewLine: () => ts.sys.newLine, + useCaseSensitiveFileNames: () => ts.sys.useCaseSensitiveFileNames, + getCurrentDirectory: () => cwd, + getCompilationSettings: () => config.options, + getDefaultLibFileName: () => ts.getDefaultLibFilePath(config.options), + getCustomTransformers: getCustomTransformers, + trace: options.tsTrace, + }; + const { resolveModuleNames, getResolvedModuleWithFailedLookupLocationsFromCache, resolveTypeReferenceDirectives, isFileKnownToBeInternal, markBucketOfFilenameInternal, } = (0, resolver_functions_1.createResolverFunctions)({ + host: serviceHost, + getCanonicalFileName, + ts, + cwd, + config, + projectLocalResolveHelper, + options, + extensions, + }); + serviceHost.resolveModuleNames = resolveModuleNames; + serviceHost.getResolvedModuleWithFailedLookupLocationsFromCache = + getResolvedModuleWithFailedLookupLocationsFromCache; + serviceHost.resolveTypeReferenceDirectives = + resolveTypeReferenceDirectives; + const registry = ts.createDocumentRegistry(ts.sys.useCaseSensitiveFileNames, cwd); + const service = ts.createLanguageService(serviceHost, registry); + const updateMemoryCache = (contents, fileName) => { + // Add to `rootFiles` as necessary, either to make TS include a file it has not seen, + // or to trigger a re-classification of files from external to internal. + if (!rootFileNames.has(fileName) && + !isFileKnownToBeInternal(fileName)) { + markBucketOfFilenameInternal(fileName); + rootFileNames.add(fileName); + // Increment project version for every change to rootFileNames. + projectVersion++; + } + const previousVersion = fileVersions.get(fileName) || 0; + const previousContents = fileContents.get(fileName); + // Avoid incrementing cache when nothing has changed. + if (contents !== previousContents) { + fileVersions.set(fileName, previousVersion + 1); + fileContents.set(fileName, contents); + // Increment project version for every file change. + projectVersion++; + } + }; + let previousProgram = undefined; + getOutput = (code, fileName) => { + updateMemoryCache(code, fileName); + const programBefore = service.getProgram(); + if (programBefore !== previousProgram) { + (0, exports.debug)(`compiler rebuilt Program instance when getting output for ${fileName}`); + } + const output = service.getEmitOutput(fileName); + // Get the relevant diagnostics - this is 3x faster than `getPreEmitDiagnostics`. + const diagnostics = service + .getSemanticDiagnostics(fileName) + .concat(service.getSyntacticDiagnostics(fileName)); + const programAfter = service.getProgram(); + (0, exports.debug)('invariant: Is service.getProject() identical before and after getting emit output and diagnostics? (should always be true) ', programBefore === programAfter); + previousProgram = programAfter; + const diagnosticList = filterDiagnostics(diagnostics, diagnosticFilters); + if (diagnosticList.length) + reportTSError(diagnosticList); + if (output.emitSkipped) { + return [undefined, undefined, true]; + } + // Throw an error when requiring `.d.ts` files. + if (output.outputFiles.length === 0) { + throw new TypeError(`Unable to require file: ${(0, path_1.relative)(cwd, fileName)}\n` + + 'This is usually the result of a faulty configuration or import. ' + + 'Make sure there is a `.js`, `.json` or other executable extension with ' + + 'loader attached before `ts-node` available.'); + } + return [output.outputFiles[1].text, output.outputFiles[0].text, false]; + }; + getTypeInfo = (code, fileName, position) => { + const normalizedFileName = (0, util_1.normalizeSlashes)(fileName); + updateMemoryCache(code, normalizedFileName); + const info = service.getQuickInfoAtPosition(normalizedFileName, position); + const name = ts.displayPartsToString(info ? info.displayParts : []); + const comment = ts.displayPartsToString(info ? info.documentation : []); + return { name, comment }; + }; + } + else { + const sys = { + ...ts.sys, + ...diagnosticHost, + readFile: (fileName) => { + const cacheContents = fileContents.get(fileName); + if (cacheContents !== undefined) + return cacheContents; + const contents = cachedReadFile(fileName); + if (contents) + fileContents.set(fileName, contents); + return contents; + }, + readDirectory: ts.sys.readDirectory, + getDirectories: (0, util_1.cachedLookup)(debugFn('getDirectories', ts.sys.getDirectories)), + fileExists: (0, util_1.cachedLookup)(debugFn('fileExists', fileExists)), + directoryExists: (0, util_1.cachedLookup)(debugFn('directoryExists', ts.sys.directoryExists)), + resolvePath: (0, util_1.cachedLookup)(debugFn('resolvePath', ts.sys.resolvePath)), + realpath: ts.sys.realpath + ? (0, util_1.cachedLookup)(debugFn('realpath', ts.sys.realpath)) + : undefined, + }; + const host = ts.createIncrementalCompilerHost + ? ts.createIncrementalCompilerHost(config.options, sys) + : { + ...sys, + getSourceFile: (fileName, languageVersion) => { + const contents = sys.readFile(fileName); + if (contents === undefined) + return; + return ts.createSourceFile(fileName, contents, languageVersion); + }, + getDefaultLibLocation: () => (0, util_1.normalizeSlashes)((0, path_1.dirname)(compiler)), + getDefaultLibFileName: () => (0, util_1.normalizeSlashes)((0, path_1.join)((0, path_1.dirname)(compiler), ts.getDefaultLibFileName(config.options))), + useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames, + }; + host.trace = options.tsTrace; + const { resolveModuleNames, resolveTypeReferenceDirectives, isFileKnownToBeInternal, markBucketOfFilenameInternal, } = (0, resolver_functions_1.createResolverFunctions)({ + host, + cwd, + config, + ts, + getCanonicalFileName, + projectLocalResolveHelper, + options, + extensions, + }); + host.resolveModuleNames = resolveModuleNames; + host.resolveTypeReferenceDirectives = resolveTypeReferenceDirectives; + // Fallback for older TypeScript releases without incremental API. + let builderProgram = ts.createIncrementalProgram + ? ts.createIncrementalProgram({ + rootNames: Array.from(rootFileNames), + options: config.options, + host, + configFileParsingDiagnostics: config.errors, + projectReferences: config.projectReferences, + }) + : ts.createEmitAndSemanticDiagnosticsBuilderProgram(Array.from(rootFileNames), config.options, host, undefined, config.errors, config.projectReferences); + // Read and cache custom transformers. + const customTransformers = typeof transformers === 'function' + ? transformers(builderProgram.getProgram()) + : transformers; + // Set the file contents into cache manually. + const updateMemoryCache = (contents, fileName) => { + const previousContents = fileContents.get(fileName); + const contentsChanged = previousContents !== contents; + if (contentsChanged) { + fileContents.set(fileName, contents); + } + // Add to `rootFiles` when discovered by compiler for the first time. + let addedToRootFileNames = false; + if (!rootFileNames.has(fileName) && + !isFileKnownToBeInternal(fileName)) { + markBucketOfFilenameInternal(fileName); + rootFileNames.add(fileName); + addedToRootFileNames = true; + } + // Update program when file changes. + if (addedToRootFileNames || contentsChanged) { + builderProgram = ts.createEmitAndSemanticDiagnosticsBuilderProgram(Array.from(rootFileNames), config.options, host, builderProgram, config.errors, config.projectReferences); + } + }; + getOutput = (code, fileName) => { + let outText = ''; + let outMap = ''; + updateMemoryCache(code, fileName); + const sourceFile = builderProgram.getSourceFile(fileName); + if (!sourceFile) + throw new TypeError(`Unable to read file: ${fileName}`); + const program = builderProgram.getProgram(); + const diagnostics = ts.getPreEmitDiagnostics(program, sourceFile); + const diagnosticList = filterDiagnostics(diagnostics, diagnosticFilters); + if (diagnosticList.length) + reportTSError(diagnosticList); + const result = builderProgram.emit(sourceFile, (path, file, writeByteOrderMark) => { + if (path.endsWith('.map')) { + outMap = file; + } + else { + outText = file; + } + if (options.emit) + sys.writeFile(path, file, writeByteOrderMark); + }, undefined, undefined, customTransformers); + if (result.emitSkipped) { + return [undefined, undefined, true]; + } + // Throw an error when requiring files that cannot be compiled. + if (outText === '') { + if (program.isSourceFileFromExternalLibrary(sourceFile)) { + throw new TypeError(`Unable to compile file from external library: ${(0, path_1.relative)(cwd, fileName)}`); + } + throw new TypeError(`Unable to require file: ${(0, path_1.relative)(cwd, fileName)}\n` + + 'This is usually the result of a faulty configuration or import. ' + + 'Make sure there is a `.js`, `.json` or other executable extension with ' + + 'loader attached before `ts-node` available.'); + } + return [outText, outMap, false]; + }; + getTypeInfo = (code, fileName, position) => { + const normalizedFileName = (0, util_1.normalizeSlashes)(fileName); + updateMemoryCache(code, normalizedFileName); + const sourceFile = builderProgram.getSourceFile(normalizedFileName); + if (!sourceFile) + throw new TypeError(`Unable to read file: ${fileName}`); + const node = getTokenAtPosition(ts, sourceFile, position); + const checker = builderProgram.getProgram().getTypeChecker(); + const symbol = checker.getSymbolAtLocation(node); + if (!symbol) + return { name: '', comment: '' }; + const type = checker.getTypeOfSymbolAtLocation(symbol, node); + const signatures = [ + ...type.getConstructSignatures(), + ...type.getCallSignatures(), + ]; + return { + name: signatures.length + ? signatures.map((x) => checker.signatureToString(x)).join('\n') + : checker.typeToString(type), + comment: ts.displayPartsToString(symbol ? symbol.getDocumentationComment(checker) : []), + }; + }; + // Write `.tsbuildinfo` when `--build` is enabled. + if (options.emit && config.options.incremental) { + process.on('exit', () => { + // Emits `.tsbuildinfo` to filesystem. + builderProgram.getProgram().emitBuildInfo(); + }); + } + } + } + else { + getTypeInfo = () => { + throw new TypeError('Type information is unavailable in "--transpile-only"'); + }; + } + function createTranspileOnlyGetOutputFunction(overrideModuleType, nodeModuleEmitKind) { + const compilerOptions = { ...config.options }; + if (overrideModuleType !== undefined) + compilerOptions.module = overrideModuleType; + let customTranspiler = createTranspiler === null || createTranspiler === void 0 ? void 0 : createTranspiler(compilerOptions, nodeModuleEmitKind); + let tsTranspileModule = (0, util_1.versionGteLt)(ts.version, '4.7.0') + ? (0, ts_transpile_module_1.createTsTranspileModule)(ts, { + compilerOptions, + reportDiagnostics: true, + transformers: transformers, + }) + : undefined; + return (code, fileName) => { + let result; + if (customTranspiler) { + result = customTranspiler.transpile(code, { + fileName, + }); + } + else if (tsTranspileModule) { + result = tsTranspileModule(code, { + fileName, + }, nodeModuleEmitKind === 'nodeesm' ? 'module' : 'commonjs'); + } + else { + result = ts.transpileModule(code, { + fileName, + compilerOptions, + reportDiagnostics: true, + transformers: transformers, + }); + } + const diagnosticList = filterDiagnostics(result.diagnostics || [], diagnosticFilters); + if (diagnosticList.length) + reportTSError(diagnosticList); + return [result.outputText, result.sourceMapText, false]; + }; + } + // When true, these mean that a `moduleType` override will cause a different emit + // than the TypeScript compiler, so we *must* overwrite the emit. + const shouldOverwriteEmitWhenForcingCommonJS = config.options.module !== ts.ModuleKind.CommonJS; + // [MUST_UPDATE_FOR_NEW_MODULEKIND] + const shouldOverwriteEmitWhenForcingEsm = !(config.options.module === ts.ModuleKind.ES2015 || + (ts.ModuleKind.ES2020 && config.options.module === ts.ModuleKind.ES2020) || + (ts.ModuleKind.ES2022 && config.options.module === ts.ModuleKind.ES2022) || + config.options.module === ts.ModuleKind.ESNext); + /** + * node16 or nodenext + * [MUST_UPDATE_FOR_NEW_MODULEKIND] + */ + const isNodeModuleType = (ts.ModuleKind.Node16 && config.options.module === ts.ModuleKind.Node16) || + (ts.ModuleKind.NodeNext && + config.options.module === ts.ModuleKind.NodeNext); + const getOutputForceCommonJS = createTranspileOnlyGetOutputFunction(ts.ModuleKind.CommonJS); + const getOutputForceNodeCommonJS = createTranspileOnlyGetOutputFunction(ts.ModuleKind.NodeNext, 'nodecjs'); + const getOutputForceNodeESM = createTranspileOnlyGetOutputFunction(ts.ModuleKind.NodeNext, 'nodeesm'); + // [MUST_UPDATE_FOR_NEW_MODULEKIND] + const getOutputForceESM = createTranspileOnlyGetOutputFunction(ts.ModuleKind.ES2022 || ts.ModuleKind.ES2020 || ts.ModuleKind.ES2015); + const getOutputTranspileOnly = createTranspileOnlyGetOutputFunction(); + // Create a simple TypeScript compiler proxy. + function compile(code, fileName, lineOffset = 0) { + const normalizedFileName = (0, util_1.normalizeSlashes)(fileName); + const classification = moduleTypeClassifier.classifyModuleByModuleTypeOverrides(normalizedFileName); + let value = ''; + let sourceMap = ''; + let emitSkipped = true; + if (getOutput) { + // Must always call normal getOutput to throw typechecking errors + [value, sourceMap, emitSkipped] = getOutput(code, normalizedFileName); + } + // If module classification contradicts the above, call the relevant transpiler + if (classification.moduleType === 'cjs' && + (shouldOverwriteEmitWhenForcingCommonJS || emitSkipped)) { + [value, sourceMap] = getOutputForceCommonJS(code, normalizedFileName); + } + else if (classification.moduleType === 'esm' && + (shouldOverwriteEmitWhenForcingEsm || emitSkipped)) { + [value, sourceMap] = getOutputForceESM(code, normalizedFileName); + } + else if (emitSkipped) { + // Happens when ts compiler skips emit or in transpileOnly mode + const classification = (0, node_module_type_classifier_1.classifyModule)(fileName, isNodeModuleType); + [value, sourceMap] = + classification === 'nodecjs' + ? getOutputForceNodeCommonJS(code, normalizedFileName) + : classification === 'nodeesm' + ? getOutputForceNodeESM(code, normalizedFileName) + : classification === 'cjs' + ? getOutputForceCommonJS(code, normalizedFileName) + : classification === 'esm' + ? getOutputForceESM(code, normalizedFileName) + : getOutputTranspileOnly(code, normalizedFileName); + } + const output = updateOutput(value, normalizedFileName, sourceMap, getEmitExtension); + outputCache.set(normalizedFileName, { content: output }); + return output; + } + let active = true; + const enabled = (enabled) => enabled === undefined ? active : (active = !!enabled); + const ignored = (fileName) => { + if (!active) + return true; + const ext = (0, path_1.extname)(fileName); + if (extensions.compiled.includes(ext)) { + return !isScoped(fileName) || shouldIgnore(fileName); + } + return true; + }; + function addDiagnosticFilter(filter) { + diagnosticFilters.push({ + ...filter, + filenamesAbsolute: filter.filenamesAbsolute.map((f) => (0, util_1.normalizeSlashes)(f)), + }); + } + const getNodeEsmResolver = (0, util_1.once)(() => (__nccwpck_require__(67968).createResolve)({ + extensions, + preferTsExts: options.preferTsExts, + tsNodeExperimentalSpecifierResolution: options.experimentalSpecifierResolution, + })); + const getNodeEsmGetFormat = (0, util_1.once)(() => (__nccwpck_require__(37207).createGetFormat)(options.experimentalSpecifierResolution, getNodeEsmResolver())); + const getNodeCjsLoader = (0, util_1.once)(() => (__nccwpck_require__(51633).createCjsLoader)({ + extensions, + preferTsExts: options.preferTsExts, + nodeEsmResolver: getNodeEsmResolver(), + })); + return { + [TS_NODE_SERVICE_BRAND]: true, + ts, + compilerPath: compiler, + config, + compile, + getTypeInfo, + ignored, + enabled, + options, + configFilePath, + moduleTypeClassifier, + shouldReplAwait, + addDiagnosticFilter, + installSourceMapSupport, + enableExperimentalEsmLoaderInterop, + transpileOnly, + projectLocalResolveHelper, + getNodeEsmResolver, + getNodeEsmGetFormat, + getNodeCjsLoader, + extensions, + }; +} +exports.createFromPreloadedConfig = createFromPreloadedConfig; +/** + * Check if the filename should be ignored. + */ +function createIgnore(ignoreBaseDir, ignore) { + return (fileName) => { + const relname = (0, path_1.relative)(ignoreBaseDir, fileName); + const path = (0, util_1.normalizeSlashes)(relname); + return ignore.some((x) => x.test(path)); + }; +} +/** + * Register the extensions to support when importing files. + */ +function registerExtensions(preferTsExts, extensions, service, originalJsHandler) { + const exts = new Set(extensions); + // Can't add these extensions cuz would allow omitting file extension; node requires ext for .cjs and .mjs + // Unless they're already registered by something else (nyc does this): + // then we *must* hook them or else our transformer will not be called. + for (const cannotAdd of ['.mts', '.cts', '.mjs', '.cjs']) { + if (exts.has(cannotAdd) && !(0, util_1.hasOwnProperty)(require.extensions, cannotAdd)) { + // Unrecognized file exts can be transformed via the `.js` handler. + exts.add('.js'); + exts.delete(cannotAdd); + } + } + // Register new extensions. + for (const ext of exts) { + registerExtension(ext, service, originalJsHandler); + } + if (preferTsExts) { + const preferredExtensions = new Set([ + ...exts, + ...Object.keys(require.extensions), + ]); + // Re-sort iteration order of Object.keys() + for (const ext of preferredExtensions) { + const old = Object.getOwnPropertyDescriptor(require.extensions, ext); + delete require.extensions[ext]; + Object.defineProperty(require.extensions, ext, old); + } + } +} +/** + * Register the extension for node. + */ +function registerExtension(ext, service, originalHandler) { + const old = require.extensions[ext] || originalHandler; + require.extensions[ext] = function (m, filename) { + if (service.ignored(filename)) + return old(m, filename); + assertScriptCanLoadAsCJS(service, m, filename); + const _compile = m._compile; + m._compile = function (code, fileName) { + (0, exports.debug)('module._compile', fileName); + const result = service.compile(code, fileName); + return _compile.call(this, result, fileName); + }; + return old(m, filename); + }; +} +/** + * Update the output remapping the source map. + */ +function updateOutput(outputText, fileName, sourceMap, getEmitExtension) { + const base64Map = Buffer.from(updateSourceMap(sourceMap, fileName), 'utf8').toString('base64'); + const sourceMapContent = `//# sourceMappingURL=data:application/json;charset=utf-8;base64,${base64Map}`; + // Expected form: `//# sourceMappingURL=foo bar.js.map` or `//# sourceMappingURL=foo%20bar.js.map` for input file "foo bar.tsx" + // Percent-encoding behavior added in TS 4.1.1: https://github.com/microsoft/TypeScript/issues/40951 + const prefix = '//# sourceMappingURL='; + const prefixLength = prefix.length; + const baseName = /*foo.tsx*/ (0, path_1.basename)(fileName); + const extName = /*.tsx*/ (0, path_1.extname)(fileName); + const extension = /*.js*/ getEmitExtension(fileName); + const sourcemapFilename = baseName.slice(0, -extName.length) + extension + '.map'; + const sourceMapLengthWithoutPercentEncoding = prefixLength + sourcemapFilename.length; + /* + * Only rewrite if existing directive exists at the location we expect, to support: + * a) compilers that do not append a sourcemap directive + * b) situations where we did the math wrong + * Not ideal, but appending our sourcemap *after* a pre-existing sourcemap still overrides, so the end-user is happy. + */ + if (outputText.substr(-sourceMapLengthWithoutPercentEncoding, prefixLength) === + prefix) { + return (outputText.slice(0, -sourceMapLengthWithoutPercentEncoding) + + sourceMapContent); + } + // If anyone asks why we're not using URL, the URL equivalent is: `u = new URL('http://d'); u.pathname = "/" + sourcemapFilename; return u.pathname.slice(1); + const sourceMapLengthWithPercentEncoding = prefixLength + encodeURI(sourcemapFilename).length; + if (outputText.substr(-sourceMapLengthWithPercentEncoding, prefixLength) === + prefix) { + return (outputText.slice(0, -sourceMapLengthWithPercentEncoding) + + sourceMapContent); + } + return `${outputText}\n${sourceMapContent}`; +} +/** + * Update the source map contents for improved output. + */ +function updateSourceMap(sourceMapText, fileName) { + const sourceMap = JSON.parse(sourceMapText); + sourceMap.file = fileName; + sourceMap.sources = [fileName]; + delete sourceMap.sourceRoot; + return JSON.stringify(sourceMap); +} +/** + * Filter diagnostics. + */ +function filterDiagnostics(diagnostics, filters) { + return diagnostics.filter((d) => filters.every((f) => { + var _a; + return (!f.appliesToAllFiles && + f.filenamesAbsolute.indexOf((_a = d.file) === null || _a === void 0 ? void 0 : _a.fileName) === -1) || + f.diagnosticsIgnored.indexOf(d.code) === -1; + })); +} +/** + * Get token at file position. + * + * Reference: https://github.com/microsoft/TypeScript/blob/fcd9334f57d85b73dd66ad2d21c02e84822f4841/src/services/utilities.ts#L705-L731 + */ +function getTokenAtPosition(ts, sourceFile, position) { + let current = sourceFile; + outer: while (true) { + for (const child of current.getChildren(sourceFile)) { + const start = child.getFullStart(); + if (start > position) + break; + const end = child.getEnd(); + if (position <= end) { + current = child; + continue outer; + } + } + return current; + } +} +/** + * Create an implementation of node's ESM loader hooks. + * + * This may be useful if you + * want to wrap or compose the loader hooks to add additional functionality or + * combine with another loader. + * + * Node changed the hooks API, so there are two possible APIs. This function + * detects your node version and returns the appropriate API. + * + * @category ESM Loader + */ +const createEsmHooks = (tsNodeService) => (__nccwpck_require__(84998)/* .createEsmHooks */ .lT)(tsNodeService); +exports.createEsmHooks = createEsmHooks; +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 23922: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createModuleTypeClassifier = void 0; +const ts_internals_1 = __nccwpck_require__(14851); +const util_1 = __nccwpck_require__(64745); +/** + * @internal + * May receive non-normalized options -- basePath and patterns -- and will normalize them + * internally. + * However, calls to `classifyModule` must pass pre-normalized paths! + */ +function createModuleTypeClassifier(options) { + const { patterns, basePath: _basePath } = options; + const basePath = _basePath !== undefined + ? (0, util_1.normalizeSlashes)(_basePath).replace(/\/$/, '') + : undefined; + const patternTypePairs = Object.entries(patterns !== null && patterns !== void 0 ? patterns : []).map(([_pattern, type]) => { + const pattern = (0, util_1.normalizeSlashes)(_pattern); + return { pattern: parsePattern(basePath, pattern), type }; + }); + const classifications = { + package: { + moduleType: 'auto', + }, + cjs: { + moduleType: 'cjs', + }, + esm: { + moduleType: 'esm', + }, + }; + const auto = classifications.package; + // Passed path must be normalized! + function classifyModuleNonCached(path) { + const matched = matchPatterns(patternTypePairs, (_) => _.pattern, path); + if (matched) + return classifications[matched.type]; + return auto; + } + const classifyModule = (0, util_1.cachedLookup)(classifyModuleNonCached); + function classifyModuleAuto(path) { + return auto; + } + return { + classifyModuleByModuleTypeOverrides: patternTypePairs.length + ? classifyModule + : classifyModuleAuto, + }; +} +exports.createModuleTypeClassifier = createModuleTypeClassifier; +function parsePattern(basePath, patternString) { + const pattern = (0, ts_internals_1.getPatternFromSpec)(patternString, basePath); + return pattern !== undefined ? new RegExp(pattern) : /(?:)/; +} +function matchPatterns(objects, getPattern, candidate) { + for (let i = objects.length - 1; i >= 0; i--) { + const object = objects[i]; + const pattern = getPattern(object); + if (pattern === null || pattern === void 0 ? void 0 : pattern.test(candidate)) { + return object; + } + } +} +//# sourceMappingURL=module-type-classifier.js.map + +/***/ }), + +/***/ 80812: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.classifyModule = void 0; +const node_internal_modules_cjs_loader_1 = __nccwpck_require__(51633); +/** + * Determine how to emit a module based on tsconfig "module" and package.json "type" + * + * Supports module=nodenext/node16 with transpileOnly, where we cannot ask the + * TS typechecker to tell us if a file is CJS or ESM. + * + * Return values indicate: + * - cjs + * - esm + * - nodecjs == node-flavored cjs where dynamic imports are *not* transformed into `require()` + * - undefined == emit according to tsconfig `module` config, whatever that is + * @internal + */ +function classifyModule(nativeFilename, isNodeModuleType) { + // [MUST_UPDATE_FOR_NEW_FILE_EXTENSIONS] + const lastDotIndex = nativeFilename.lastIndexOf('.'); + const ext = lastDotIndex >= 0 ? nativeFilename.slice(lastDotIndex) : ''; + switch (ext) { + case '.cjs': + case '.cts': + return isNodeModuleType ? 'nodecjs' : 'cjs'; + case '.mjs': + case '.mts': + return isNodeModuleType ? 'nodeesm' : 'esm'; + } + if (isNodeModuleType) { + const packageScope = (0, node_internal_modules_cjs_loader_1.readPackageScope)(nativeFilename); + if (packageScope && packageScope.data.type === 'module') + return 'nodeesm'; + return 'nodecjs'; + } + return undefined; +} +exports.classifyModule = classifyModule; +//# sourceMappingURL=node-module-type-classifier.js.map + +/***/ }), + +/***/ 10204: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.setupContext = exports.createEvalAwarePartialHost = exports.EvalState = exports.createRepl = exports.REPL_NAME = exports.REPL_FILENAME = exports.STDIN_NAME = exports.STDIN_FILENAME = exports.EVAL_NAME = exports.EVAL_FILENAME = void 0; +const os_1 = __nccwpck_require__(22037); +const path_1 = __nccwpck_require__(71017); +const repl_1 = __nccwpck_require__(38102); +const vm_1 = __nccwpck_require__(26144); +const index_1 = __nccwpck_require__(72719); +const fs_1 = __nccwpck_require__(57147); +const console_1 = __nccwpck_require__(96206); +const assert = __nccwpck_require__(39491); +const module_1 = __nccwpck_require__(98188); +// Lazy-loaded. +let _processTopLevelAwait; +function getProcessTopLevelAwait() { + if (_processTopLevelAwait === undefined) { + ({ + processTopLevelAwait: _processTopLevelAwait, + } = __nccwpck_require__(75818)); + } + return _processTopLevelAwait; +} +let diff; +function getDiffLines() { + if (diff === undefined) { + diff = __nccwpck_require__(71672); + } + return diff.diffLines; +} +/** @internal */ +exports.EVAL_FILENAME = `[eval].ts`; +/** @internal */ +exports.EVAL_NAME = `[eval]`; +/** @internal */ +exports.STDIN_FILENAME = `[stdin].ts`; +/** @internal */ +exports.STDIN_NAME = `[stdin]`; +/** @internal */ +exports.REPL_FILENAME = '.ts'; +/** @internal */ +exports.REPL_NAME = ''; +/** + * Create a ts-node REPL instance. + * + * Pay close attention to the example below. Today, the API requires a few lines + * of boilerplate to correctly bind the `ReplService` to the ts-node `Service` and + * vice-versa. + * + * Usage example: + * + * const repl = tsNode.createRepl(); + * const service = tsNode.create({...repl.evalAwarePartialHost}); + * repl.setService(service); + * repl.start(); + * + * @category REPL + */ +function createRepl(options = {}) { + var _a, _b, _c, _d, _e; + const { ignoreDiagnosticsThatAreAnnoyingInInteractiveRepl = true } = options; + let service = options.service; + let nodeReplServer; + // If `useGlobal` is not true, then REPL creates a context when started. + // This stores a reference to it or to `global`, whichever is used, after REPL has started. + let context; + const state = (_a = options.state) !== null && _a !== void 0 ? _a : new EvalState((0, path_1.join)(process.cwd(), exports.REPL_FILENAME)); + const evalAwarePartialHost = createEvalAwarePartialHost(state, options.composeWithEvalAwarePartialHost); + const stdin = (_b = options.stdin) !== null && _b !== void 0 ? _b : process.stdin; + const stdout = (_c = options.stdout) !== null && _c !== void 0 ? _c : process.stdout; + const stderr = (_d = options.stderr) !== null && _d !== void 0 ? _d : process.stderr; + const _console = stdout === process.stdout && stderr === process.stderr + ? console + : new console_1.Console(stdout, stderr); + const replService = { + state: (_e = options.state) !== null && _e !== void 0 ? _e : new EvalState((0, path_1.join)(process.cwd(), exports.EVAL_FILENAME)), + setService, + evalCode, + evalCodeInternal, + nodeEval, + evalAwarePartialHost, + start, + startInternal, + stdin, + stdout, + stderr, + console: _console, + }; + return replService; + function setService(_service) { + service = _service; + if (ignoreDiagnosticsThatAreAnnoyingInInteractiveRepl) { + service.addDiagnosticFilter({ + appliesToAllFiles: false, + filenamesAbsolute: [state.path], + diagnosticsIgnored: [ + 2393, + 6133, + 7027, + ...(service.shouldReplAwait ? topLevelAwaitDiagnosticCodes : []), + ], + }); + } + } + function evalCode(code) { + const result = appendCompileAndEvalInput({ + service: service, + state, + input: code, + context, + overrideIsCompletion: false, + }); + assert(result.containsTopLevelAwait === false); + return result.value; + } + function evalCodeInternal(options) { + const { code, enableTopLevelAwait, context } = options; + return appendCompileAndEvalInput({ + service: service, + state, + input: code, + enableTopLevelAwait, + context, + }); + } + function nodeEval(code, context, _filename, callback) { + // TODO: Figure out how to handle completion here. + if (code === '.scope') { + callback(null); + return; + } + try { + const evalResult = evalCodeInternal({ + code, + enableTopLevelAwait: true, + context, + }); + if (evalResult.containsTopLevelAwait) { + (async () => { + try { + callback(null, await evalResult.valuePromise); + } + catch (promiseError) { + handleError(promiseError); + } + })(); + } + else { + callback(null, evalResult.value); + } + } + catch (error) { + handleError(error); + } + // Log TSErrors, check if they're recoverable, log helpful hints for certain + // well-known errors, and invoke `callback()` + // TODO should evalCode API get the same error-handling benefits? + function handleError(error) { + var _a, _b; + // Don't show TLA hint if the user explicitly disabled repl top level await + const canLogTopLevelAwaitHint = service.options.experimentalReplAwait !== false && + !service.shouldReplAwait; + if (error instanceof index_1.TSError) { + // Support recoverable compilations using >= node 6. + if (repl_1.Recoverable && isRecoverable(error)) { + callback(new repl_1.Recoverable(error)); + return; + } + else { + _console.error(error); + if (canLogTopLevelAwaitHint && + error.diagnosticCodes.some((dC) => topLevelAwaitDiagnosticCodes.includes(dC))) { + _console.error(getTopLevelAwaitHint()); + } + callback(null); + } + } + else { + let _error = error; + if (canLogTopLevelAwaitHint && + _error instanceof SyntaxError && + ((_a = _error.message) === null || _a === void 0 ? void 0 : _a.includes('await is only valid'))) { + try { + // Only way I know to make our hint appear after the error + _error.message += `\n\n${getTopLevelAwaitHint()}`; + _error.stack = (_b = _error.stack) === null || _b === void 0 ? void 0 : _b.replace(/(SyntaxError:.*)/, (_, $1) => `${$1}\n\n${getTopLevelAwaitHint()}`); + } + catch { } + } + callback(_error); + } + } + function getTopLevelAwaitHint() { + return `Hint: REPL top-level await requires TypeScript version 3.8 or higher and target ES2018 or higher. You are using TypeScript ${service.ts.version} and target ${service.ts.ScriptTarget[service.config.options.target]}.`; + } + } + // Note: `code` argument is deprecated + function start(code) { + startInternal({ code }); + } + // Note: `code` argument is deprecated + function startInternal(options) { + const { code, forceToBeModule = true, ...optionsOverride } = options !== null && options !== void 0 ? options : {}; + // TODO assert that `service` is set; remove all `service!` non-null assertions + // Eval incoming code before the REPL starts. + // Note: deprecated + if (code) { + try { + evalCode(`${code}\n`); + } + catch (err) { + _console.error(err); + // Note: should not be killing the process here, but this codepath is deprecated anyway + process.exit(1); + } + } + // In case the typescript compiler hasn't compiled anything yet, + // make it run though compilation at least one time before + // the REPL starts for a snappier user experience on startup. + service === null || service === void 0 ? void 0 : service.compile('', state.path); + const repl = (0, repl_1.start)({ + prompt: '> ', + input: replService.stdin, + output: replService.stdout, + // Mimicking node's REPL implementation: https://github.com/nodejs/node/blob/168b22ba073ee1cbf8d0bcb4ded7ff3099335d04/lib/internal/repl.js#L28-L30 + terminal: stdout.isTTY && + !parseInt(index_1.env.NODE_NO_READLINE, 10), + eval: nodeEval, + useGlobal: true, + ...optionsOverride, + }); + nodeReplServer = repl; + context = repl.context; + // Bookmark the point where we should reset the REPL state. + const resetEval = appendToEvalState(state, ''); + function reset() { + resetEval(); + // Hard fix for TypeScript forcing `Object.defineProperty(exports, ...)`. + runInContext('exports = module.exports', state.path, context); + if (forceToBeModule) { + state.input += 'export {};void 0;\n'; + } + // Declare node builtins. + // Skip the same builtins as `addBuiltinLibsToObject`: + // those starting with _ + // those containing / + // those that already exist as globals + // Intentionally suppress type errors in case @types/node does not declare any of them, and because + // `declare import` is technically invalid syntax. + // Avoid this when in transpileOnly, because third-party transpilers may not handle `declare import`. + if (!(service === null || service === void 0 ? void 0 : service.transpileOnly)) { + state.input += `// @ts-ignore\n${module_1.builtinModules + .filter((name) => !name.startsWith('_') && + !name.includes('/') && + !['console', 'module', 'process'].includes(name)) + .map((name) => `declare import ${name} = require('${name}')`) + .join(';')}\n`; + } + } + reset(); + repl.on('reset', reset); + repl.defineCommand('type', { + help: 'Check the type of a TypeScript identifier', + action: function (identifier) { + if (!identifier) { + repl.displayPrompt(); + return; + } + const undo = appendToEvalState(state, identifier); + const { name, comment } = service.getTypeInfo(state.input, state.path, state.input.length); + undo(); + if (name) + repl.outputStream.write(`${name}\n`); + if (comment) + repl.outputStream.write(`${comment}\n`); + repl.displayPrompt(); + }, + }); + // Set up REPL history when available natively via node.js >= 11. + if (repl.setupHistory) { + const historyPath = index_1.env.TS_NODE_HISTORY || (0, path_1.join)((0, os_1.homedir)(), '.ts_node_repl_history'); + repl.setupHistory(historyPath, (err) => { + if (!err) + return; + _console.error(err); + process.exit(1); + }); + } + return repl; + } +} +exports.createRepl = createRepl; +/** + * Eval state management. Stores virtual `[eval].ts` file + */ +class EvalState { + constructor(path) { + this.path = path; + /** @internal */ + this.input = ''; + /** @internal */ + this.output = ''; + /** @internal */ + this.version = 0; + /** @internal */ + this.lines = 0; + } +} +exports.EvalState = EvalState; +function createEvalAwarePartialHost(state, composeWith) { + function readFile(path) { + if (path === state.path) + return state.input; + if (composeWith === null || composeWith === void 0 ? void 0 : composeWith.readFile) + return composeWith.readFile(path); + try { + return (0, fs_1.readFileSync)(path, 'utf8'); + } + catch (err) { + /* Ignore. */ + } + } + function fileExists(path) { + if (path === state.path) + return true; + if (composeWith === null || composeWith === void 0 ? void 0 : composeWith.fileExists) + return composeWith.fileExists(path); + try { + const stats = (0, fs_1.statSync)(path); + return stats.isFile() || stats.isFIFO(); + } + catch (err) { + return false; + } + } + return { readFile, fileExists }; +} +exports.createEvalAwarePartialHost = createEvalAwarePartialHost; +const sourcemapCommentRe = /\/\/# ?sourceMappingURL=\S+[\s\r\n]*$/; +/** + * Evaluate the code snippet. + * + * Append it to virtual .ts file, compile, handle compiler errors, compute a diff of the JS, and eval any code that + * appears as "added" in the diff. + */ +function appendCompileAndEvalInput(options) { + const { service, state, wrappedErr, enableTopLevelAwait = false, context, overrideIsCompletion, } = options; + let { input } = options; + // It's confusing for `{ a: 1 }` to be interpreted as a block statement + // rather than an object literal. So, we first try to wrap it in + // parentheses, so that it will be interpreted as an expression. + // Based on https://github.com/nodejs/node/blob/c2e6822153bad023ab7ebd30a6117dcc049e475c/lib/repl.js#L413-L422 + let wrappedCmd = false; + if (!wrappedErr && /^\s*{/.test(input) && !/;\s*$/.test(input)) { + input = `(${input.trim()})\n`; + wrappedCmd = true; + } + const lines = state.lines; + const isCompletion = overrideIsCompletion !== null && overrideIsCompletion !== void 0 ? overrideIsCompletion : !/\n$/.test(input); + const undo = appendToEvalState(state, input); + let output; + // Based on https://github.com/nodejs/node/blob/92573721c7cff104ccb82b6ed3e8aa69c4b27510/lib/repl.js#L457-L461 + function adjustUseStrict(code) { + // "void 0" keeps the repl from returning "use strict" as the result + // value for statements and declarations that don't return a value. + return code.replace(/^"use strict";/, '"use strict"; void 0;'); + } + try { + output = service.compile(state.input, state.path, -lines); + } + catch (err) { + undo(); + if (wrappedCmd) { + if (err instanceof index_1.TSError && err.diagnosticCodes[0] === 2339) { + // Ensure consistent and more sane behavior between { a: 1 }['b'] and ({ a: 1 }['b']) + throw err; + } + // Unwrap and try again + return appendCompileAndEvalInput({ + ...options, + wrappedErr: err, + }); + } + if (wrappedErr) + throw wrappedErr; + throw err; + } + output = adjustUseStrict(output); + // Note: REPL does not respect sourcemaps! + // To properly do that, we'd need to prefix the code we eval -- which comes + // from `diffLines` -- with newlines so that it's at the proper line numbers. + // Then we'd need to ensure each bit of eval-ed code, if there are multiples, + // has the sourcemap appended to it. + // We might also need to integrate with our sourcemap hooks' cache; I'm not sure. + const outputWithoutSourcemapComment = output.replace(sourcemapCommentRe, ''); + const oldOutputWithoutSourcemapComment = state.output.replace(sourcemapCommentRe, ''); + // Use `diff` to check for new JavaScript to execute. + const changes = getDiffLines()(oldOutputWithoutSourcemapComment, outputWithoutSourcemapComment); + if (isCompletion) { + undo(); + } + else { + state.output = output; + // Insert a semicolon to make sure that the code doesn't interact with the next line, + // for example to prevent `2\n+ 2` from producing 4. + // This is safe since the output will not change since we can only get here with successful inputs, + // and adding a semicolon to the end of a successful input won't ever change the output. + state.input = state.input.replace(/([^\n\s])([\n\s]*)$/, (all, lastChar, whitespace) => { + if (lastChar !== ';') + return `${lastChar};${whitespace}`; + return all; + }); + } + let commands = []; + let containsTopLevelAwait = false; + // Build a list of "commands": bits of JS code in the diff that must be executed. + for (const change of changes) { + if (change.added) { + if (enableTopLevelAwait && + service.shouldReplAwait && + change.value.indexOf('await') > -1) { + const processTopLevelAwait = getProcessTopLevelAwait(); + // Newline prevents comments to mess with wrapper + const wrappedResult = processTopLevelAwait(change.value + '\n'); + if (wrappedResult !== null) { + containsTopLevelAwait = true; + commands.push({ + mustAwait: true, + execCommand: () => runInContext(wrappedResult, state.path, context), + }); + continue; + } + } + commands.push({ + execCommand: () => runInContext(change.value, state.path, context), + }); + } + } + // Execute all commands asynchronously if necessary, returning the result or a + // promise of the result. + if (containsTopLevelAwait) { + return { + containsTopLevelAwait, + valuePromise: (async () => { + let value; + for (const command of commands) { + const r = command.execCommand(); + value = command.mustAwait ? await r : r; + } + return value; + })(), + }; + } + else { + return { + containsTopLevelAwait: false, + value: commands.reduce((_, c) => c.execCommand(), undefined), + }; + } +} +/** + * Low-level execution of JS code in context + */ +function runInContext(code, filename, context) { + const script = new vm_1.Script(code, { filename }); + if (context === undefined || context === global) { + return script.runInThisContext(); + } + else { + return script.runInContext(context); + } +} +/** + * Append to the eval instance and return an undo function. + */ +function appendToEvalState(state, input) { + const undoInput = state.input; + const undoVersion = state.version; + const undoOutput = state.output; + const undoLines = state.lines; + state.input += input; + state.lines += lineCount(input); + state.version++; + return function () { + state.input = undoInput; + state.output = undoOutput; + state.version = undoVersion; + state.lines = undoLines; + }; +} +/** + * Count the number of lines. + */ +function lineCount(value) { + let count = 0; + for (const char of value) { + if (char === '\n') { + count++; + } + } + return count; +} +/** + * TS diagnostic codes which are recoverable, meaning that the user likely entered an incomplete line of code + * and should be prompted for the next. For example, starting a multi-line for() loop and not finishing it. + * null value means code is always recoverable. `Set` means code is only recoverable when occurring alongside at least one + * of the other codes. + */ +const RECOVERY_CODES = new Map([ + [1003, null], + [1005, null], + [1109, null], + [1126, null], + [ + 1136, + new Set([1005]), // happens when typing out an object literal or block scope across multiple lines: '{ foo: 123,' + ], + [1160, null], + [1161, null], + [2355, null], + [2391, null], + [ + 7010, + new Set([1005]), // happens when fn signature spread across multiple lines: 'function a(\nb: any\n) {' + ], +]); +/** + * Diagnostic codes raised when using top-level await. + * These are suppressed when top-level await is enabled. + * When it is *not* enabled, these trigger a helpful hint about enabling top-level await. + */ +const topLevelAwaitDiagnosticCodes = [ + 1375, + 1378, + 1431, + 1432, // Top-level 'for await' loops are only allowed when the 'module' option is set to 'esnext' or 'system', and the 'target' option is set to 'es2017' or higher. +]; +/** + * Check if a function can recover gracefully. + */ +function isRecoverable(error) { + return error.diagnosticCodes.every((code) => { + const deps = RECOVERY_CODES.get(code); + return (deps === null || + (deps && error.diagnosticCodes.some((code) => deps.has(code)))); + }); +} +/** + * @internal + * Set properties on `context` before eval-ing [stdin] or [eval] input. + */ +function setupContext(context, module, filenameAndDirname) { + if (filenameAndDirname) { + context.__dirname = '.'; + context.__filename = `[${filenameAndDirname}]`; + } + context.module = module; + context.exports = module.exports; + context.require = __nccwpck_require__(3833).bind(module); +} +exports.setupContext = setupContext; +//# sourceMappingURL=repl.js.map + +/***/ }), + +/***/ 19148: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createResolverFunctions = void 0; +const path_1 = __nccwpck_require__(71017); +/** + * @internal + * In a factory because these are shared across both CompilerHost and LanguageService codepaths + */ +function createResolverFunctions(kwargs) { + const { host, ts, config, cwd, getCanonicalFileName, projectLocalResolveHelper, options, extensions, } = kwargs; + const moduleResolutionCache = ts.createModuleResolutionCache(cwd, getCanonicalFileName, config.options); + const knownInternalFilenames = new Set(); + /** "Buckets" (module directories) whose contents should be marked "internal" */ + const internalBuckets = new Set(); + // Get bucket for a source filename. Bucket is the containing `./node_modules/*/` directory + // For '/project/node_modules/foo/node_modules/bar/lib/index.js' bucket is '/project/node_modules/foo/node_modules/bar/' + // For '/project/node_modules/foo/node_modules/@scope/bar/lib/index.js' bucket is '/project/node_modules/foo/node_modules/@scope/bar/' + const moduleBucketRe = /.*\/node_modules\/(?:@[^\/]+\/)?[^\/]+\//; + function getModuleBucket(filename) { + const find = moduleBucketRe.exec(filename); + if (find) + return find[0]; + return ''; + } + // Mark that this file and all siblings in its bucket should be "internal" + function markBucketOfFilenameInternal(filename) { + internalBuckets.add(getModuleBucket(filename)); + } + function isFileInInternalBucket(filename) { + return internalBuckets.has(getModuleBucket(filename)); + } + function isFileKnownToBeInternal(filename) { + return knownInternalFilenames.has(filename); + } + /** + * If we need to emit JS for a file, force TS to consider it non-external + */ + const fixupResolvedModule = (resolvedModule) => { + const { resolvedFileName } = resolvedModule; + if (resolvedFileName === undefined) + return; + // [MUST_UPDATE_FOR_NEW_FILE_EXTENSIONS] + // .ts,.mts,.cts is always switched to internal + // .js is switched on-demand + if (resolvedModule.isExternalLibraryImport && + ((resolvedFileName.endsWith('.ts') && + !resolvedFileName.endsWith('.d.ts')) || + (resolvedFileName.endsWith('.cts') && + !resolvedFileName.endsWith('.d.cts')) || + (resolvedFileName.endsWith('.mts') && + !resolvedFileName.endsWith('.d.mts')) || + isFileKnownToBeInternal(resolvedFileName) || + isFileInInternalBucket(resolvedFileName))) { + resolvedModule.isExternalLibraryImport = false; + } + if (!resolvedModule.isExternalLibraryImport) { + knownInternalFilenames.add(resolvedFileName); + } + }; + /* + * NOTE: + * Older ts versions do not pass `redirectedReference` nor `options`. + * We must pass `redirectedReference` to newer ts versions, but cannot rely on `options`, hence the weird argument name + */ + const resolveModuleNames = (moduleNames, containingFile, reusedNames, redirectedReference, optionsOnlyWithNewerTsVersions, containingSourceFile) => { + return moduleNames.map((moduleName, i) => { + var _a, _b; + const mode = containingSourceFile + ? (_b = (_a = ts).getModeForResolutionAtIndex) === null || _b === void 0 ? void 0 : _b.call(_a, containingSourceFile, i) + : undefined; + let { resolvedModule } = ts.resolveModuleName(moduleName, containingFile, config.options, host, moduleResolutionCache, redirectedReference, mode); + if (!resolvedModule && options.experimentalTsImportSpecifiers) { + const lastDotIndex = moduleName.lastIndexOf('.'); + const ext = lastDotIndex >= 0 ? moduleName.slice(lastDotIndex) : ''; + if (ext) { + const replacements = extensions.tsResolverEquivalents.get(ext); + for (const replacementExt of replacements !== null && replacements !== void 0 ? replacements : []) { + ({ resolvedModule } = ts.resolveModuleName(moduleName.slice(0, -ext.length) + replacementExt, containingFile, config.options, host, moduleResolutionCache, redirectedReference, mode)); + if (resolvedModule) + break; + } + } + } + if (resolvedModule) { + fixupResolvedModule(resolvedModule); + } + return resolvedModule; + }); + }; + // language service never calls this, but TS docs recommend that we implement it + const getResolvedModuleWithFailedLookupLocationsFromCache = (moduleName, containingFile, resolutionMode) => { + const ret = ts.resolveModuleNameFromCache(moduleName, containingFile, moduleResolutionCache, resolutionMode); + if (ret && ret.resolvedModule) { + fixupResolvedModule(ret.resolvedModule); + } + return ret; + }; + const resolveTypeReferenceDirectives = (typeDirectiveNames, containingFile, redirectedReference, options, containingFileMode // new impliedNodeFormat is accepted by compilerHost + ) => { + // Note: seems to be called with empty typeDirectiveNames array for all files. + // TODO consider using `ts.loadWithTypeDirectiveCache` + return typeDirectiveNames.map((typeDirectiveName) => { + // Copy-pasted from TS source: + const nameIsString = typeof typeDirectiveName === 'string'; + const mode = nameIsString + ? undefined + : ts.getModeForFileReference(typeDirectiveName, containingFileMode); + const strName = nameIsString + ? typeDirectiveName + : typeDirectiveName.fileName.toLowerCase(); + let { resolvedTypeReferenceDirective } = ts.resolveTypeReferenceDirective(strName, containingFile, config.options, host, redirectedReference, undefined, mode); + if (typeDirectiveName === 'node' && !resolvedTypeReferenceDirective) { + // Resolve @types/node relative to project first, then __dirname (copy logic from elsewhere / refactor into reusable function) + let typesNodePackageJsonPath; + try { + typesNodePackageJsonPath = projectLocalResolveHelper('@types/node/package.json', true); + } + catch { } // gracefully do nothing when @types/node is not installed for any reason + if (typesNodePackageJsonPath) { + const typeRoots = [(0, path_1.resolve)(typesNodePackageJsonPath, '../..')]; + ({ resolvedTypeReferenceDirective } = + ts.resolveTypeReferenceDirective(typeDirectiveName, containingFile, { + ...config.options, + typeRoots, + }, host, redirectedReference)); + } + } + if (resolvedTypeReferenceDirective) { + fixupResolvedModule(resolvedTypeReferenceDirective); + } + return resolvedTypeReferenceDirective; + }); + }; + return { + resolveModuleNames, + getResolvedModuleWithFailedLookupLocationsFromCache, + resolveTypeReferenceDirectives, + isFileKnownToBeInternal, + markBucketOfFilenameInternal, + }; +} +exports.createResolverFunctions = createResolverFunctions; +//# sourceMappingURL=resolver-functions.js.map + +/***/ }), + +/***/ 14851: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getEmitScriptTarget = exports.getUseDefineForClassFields = exports.getPatternFromSpec = exports.createTsInternals = void 0; +const path_1 = __nccwpck_require__(71017); +const util_1 = __nccwpck_require__(64745); +/** @internal */ +exports.createTsInternals = (0, util_1.cachedLookup)(createTsInternalsUncached); +/** + * Given a reference to the TS compiler, return some TS internal functions that we + * could not or did not want to grab off the `ts` object. + * These have been copy-pasted from TS's source and tweaked as necessary. + * + * NOTE: This factory returns *only* functions which need a reference to the TS + * compiler. Other functions do not need a reference to the TS compiler so are + * exported directly from this file. + */ +function createTsInternalsUncached(_ts) { + const ts = _ts; + /** + * Copied from: + * https://github.com/microsoft/TypeScript/blob/v4.3.2/src/compiler/commandLineParser.ts#L2821-L2846 + */ + function getExtendsConfigPath(extendedConfig, host, basePath, errors, createDiagnostic) { + extendedConfig = (0, util_1.normalizeSlashes)(extendedConfig); + if (isRootedDiskPath(extendedConfig) || + startsWith(extendedConfig, './') || + startsWith(extendedConfig, '../')) { + let extendedConfigPath = getNormalizedAbsolutePath(extendedConfig, basePath); + if (!host.fileExists(extendedConfigPath) && + !endsWith(extendedConfigPath, ts.Extension.Json)) { + extendedConfigPath = `${extendedConfigPath}.json`; + if (!host.fileExists(extendedConfigPath)) { + errors.push(createDiagnostic(ts.Diagnostics.File_0_not_found, extendedConfig)); + return undefined; + } + } + return extendedConfigPath; + } + // If the path isn't a rooted or relative path, resolve like a module + const tsGte5_3_0 = (0, util_1.versionGteLt)(ts.version, '5.3.0'); + const resolved = ts.nodeModuleNameResolver(extendedConfig, combinePaths(basePath, 'tsconfig.json'), { moduleResolution: ts.ModuleResolutionKind.NodeJs }, host, + /*cache*/ undefined, + /*projectRefs*/ undefined, + /*conditionsOrIsConfigLookup*/ tsGte5_3_0 ? undefined : true, + /*isConfigLookup*/ tsGte5_3_0 ? true : undefined); + if (resolved.resolvedModule) { + return resolved.resolvedModule.resolvedFileName; + } + errors.push(createDiagnostic(ts.Diagnostics.File_0_not_found, extendedConfig)); + return undefined; + } + return { getExtendsConfigPath }; +} +// These functions have alternative implementation to avoid copying too much from TS +function isRootedDiskPath(path) { + return (0, path_1.isAbsolute)(path); +} +function combinePaths(path, ...paths) { + return (0, util_1.normalizeSlashes)((0, path_1.resolve)(path, ...paths.filter((path) => path))); +} +function getNormalizedAbsolutePath(fileName, currentDirectory) { + return (0, util_1.normalizeSlashes)(currentDirectory != null + ? (0, path_1.resolve)(currentDirectory, fileName) + : (0, path_1.resolve)(fileName)); +} +function startsWith(str, prefix) { + return str.lastIndexOf(prefix, 0) === 0; +} +function endsWith(str, suffix) { + const expectedPos = str.length - suffix.length; + return expectedPos >= 0 && str.indexOf(suffix, expectedPos) === expectedPos; +} +// Reserved characters, forces escaping of any non-word (or digit), non-whitespace character. +// It may be inefficient (we could just match (/[-[\]{}()*+?.,\\^$|#\s]/g), but this is future +// proof. +const reservedCharacterPattern = /[^\w\s\/]/g; +/** + * @internal + * See also: getRegularExpressionForWildcard, which seems to do almost the same thing + */ +function getPatternFromSpec(spec, basePath) { + const pattern = spec && getSubPatternFromSpec(spec, basePath, excludeMatcher); + return pattern && `^(${pattern})${'($|/)'}`; +} +exports.getPatternFromSpec = getPatternFromSpec; +function getSubPatternFromSpec(spec, basePath, { singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter, }) { + let subpattern = ''; + let hasWrittenComponent = false; + const components = getNormalizedPathComponents(spec, basePath); + const lastComponent = last(components); + // getNormalizedPathComponents includes the separator for the root component. + // We need to remove to create our regex correctly. + components[0] = removeTrailingDirectorySeparator(components[0]); + if (isImplicitGlob(lastComponent)) { + components.push('**', '*'); + } + let optionalCount = 0; + for (let component of components) { + if (component === '**') { + subpattern += doubleAsteriskRegexFragment; + } + else { + if (hasWrittenComponent) { + subpattern += directorySeparator; + } + subpattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter); + } + hasWrittenComponent = true; + } + while (optionalCount > 0) { + subpattern += ')?'; + optionalCount--; + } + return subpattern; +} +const directoriesMatcher = { + singleAsteriskRegexFragment: '[^/]*', + /** + * Regex for the ** wildcard. Matches any num of subdirectories. When used for including + * files or directories, does not match subdirectories that start with a . character + */ + doubleAsteriskRegexFragment: `(/[^/.][^/]*)*?`, + replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment), +}; +const excludeMatcher = { + singleAsteriskRegexFragment: '[^/]*', + doubleAsteriskRegexFragment: '(/.+?)?', + replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, excludeMatcher.singleAsteriskRegexFragment), +}; +function getNormalizedPathComponents(path, currentDirectory) { + return reducePathComponents(getPathComponents(path, currentDirectory)); +} +function getPathComponents(path, currentDirectory = '') { + path = combinePaths(currentDirectory, path); + return pathComponents(path, getRootLength(path)); +} +function reducePathComponents(components) { + if (!some(components)) + return []; + const reduced = [components[0]]; + for (let i = 1; i < components.length; i++) { + const component = components[i]; + if (!component) + continue; + if (component === '.') + continue; + if (component === '..') { + if (reduced.length > 1) { + if (reduced[reduced.length - 1] !== '..') { + reduced.pop(); + continue; + } + } + else if (reduced[0]) + continue; + } + reduced.push(component); + } + return reduced; +} +function getRootLength(path) { + const rootLength = getEncodedRootLength(path); + return rootLength < 0 ? ~rootLength : rootLength; +} +function getEncodedRootLength(path) { + if (!path) + return 0; + const ch0 = path.charCodeAt(0); + // POSIX or UNC + if (ch0 === 47 /* CharacterCodes.slash */ || ch0 === 92 /* CharacterCodes.backslash */) { + if (path.charCodeAt(1) !== ch0) + return 1; // POSIX: "/" (or non-normalized "\") + const p1 = path.indexOf(ch0 === 47 /* CharacterCodes.slash */ ? directorySeparator : altDirectorySeparator, 2); + if (p1 < 0) + return path.length; // UNC: "//server" or "\\server" + return p1 + 1; // UNC: "//server/" or "\\server\" + } + // DOS + if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58 /* CharacterCodes.colon */) { + const ch2 = path.charCodeAt(2); + if (ch2 === 47 /* CharacterCodes.slash */ || ch2 === 92 /* CharacterCodes.backslash */) + return 3; // DOS: "c:/" or "c:\" + if (path.length === 2) + return 2; // DOS: "c:" (but not "c:d") + } + // URL + const schemeEnd = path.indexOf(urlSchemeSeparator); + if (schemeEnd !== -1) { + const authorityStart = schemeEnd + urlSchemeSeparator.length; + const authorityEnd = path.indexOf(directorySeparator, authorityStart); + if (authorityEnd !== -1) { + // URL: "file:///", "file://server/", "file://server/path" + // For local "file" URLs, include the leading DOS volume (if present). + // Per https://www.ietf.org/rfc/rfc1738.txt, a host of "" or "localhost" is a + // special case interpreted as "the machine from which the URL is being interpreted". + const scheme = path.slice(0, schemeEnd); + const authority = path.slice(authorityStart, authorityEnd); + if (scheme === 'file' && + (authority === '' || authority === 'localhost') && + isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) { + const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2); + if (volumeSeparatorEnd !== -1) { + if (path.charCodeAt(volumeSeparatorEnd) === 47 /* CharacterCodes.slash */) { + // URL: "file:///c:/", "file://localhost/c:/", "file:///c%3a/", "file://localhost/c%3a/" + return ~(volumeSeparatorEnd + 1); + } + if (volumeSeparatorEnd === path.length) { + // URL: "file:///c:", "file://localhost/c:", "file:///c$3a", "file://localhost/c%3a" + // but not "file:///c:d" or "file:///c%3ad" + return ~volumeSeparatorEnd; + } + } + } + return ~(authorityEnd + 1); // URL: "file://server/", "http://server/" + } + return ~path.length; // URL: "file://server", "http://server" + } + // relative + return 0; +} +function ensureTrailingDirectorySeparator(path) { + if (!hasTrailingDirectorySeparator(path)) { + return path + directorySeparator; + } + return path; +} +function hasTrailingDirectorySeparator(path) { + return (path.length > 0 && isAnyDirectorySeparator(path.charCodeAt(path.length - 1))); +} +function isAnyDirectorySeparator(charCode) { + return (charCode === 47 /* CharacterCodes.slash */ || charCode === 92 /* CharacterCodes.backslash */); +} +function removeTrailingDirectorySeparator(path) { + if (hasTrailingDirectorySeparator(path)) { + return path.substr(0, path.length - 1); + } + return path; +} +const directorySeparator = '/'; +const altDirectorySeparator = '\\'; +const urlSchemeSeparator = '://'; +function isVolumeCharacter(charCode) { + return ((charCode >= 97 /* CharacterCodes.a */ && charCode <= 122 /* CharacterCodes.z */) || + (charCode >= 65 /* CharacterCodes.A */ && charCode <= 90 /* CharacterCodes.Z */)); +} +function getFileUrlVolumeSeparatorEnd(url, start) { + const ch0 = url.charCodeAt(start); + if (ch0 === 58 /* CharacterCodes.colon */) + return start + 1; + if (ch0 === 37 /* CharacterCodes.percent */ && + url.charCodeAt(start + 1) === 51 /* CharacterCodes._3 */) { + const ch2 = url.charCodeAt(start + 2); + if (ch2 === 97 /* CharacterCodes.a */ || ch2 === 65 /* CharacterCodes.A */) + return start + 3; + } + return -1; +} +function some(array, predicate) { + if (array) { + if (predicate) { + for (const v of array) { + if (predicate(v)) { + return true; + } + } + } + else { + return array.length > 0; + } + } + return false; +} +function pathComponents(path, rootLength) { + const root = path.substring(0, rootLength); + const rest = path.substring(rootLength).split(directorySeparator); + if (rest.length && !lastOrUndefined(rest)) + rest.pop(); + return [root, ...rest]; +} +function lastOrUndefined(array) { + return array.length === 0 ? undefined : array[array.length - 1]; +} +function last(array) { + // Debug.assert(array.length !== 0); + return array[array.length - 1]; +} +function replaceWildcardCharacter(match, singleAsteriskRegexFragment) { + return match === '*' + ? singleAsteriskRegexFragment + : match === '?' + ? '[^/]' + : '\\' + match; +} +/** + * An "includes" path "foo" is implicitly a glob "foo/** /*" (without the space) if its last component has no extension, + * and does not contain any glob characters itself. + */ +function isImplicitGlob(lastPathComponent) { + return !/[.*?]/.test(lastPathComponent); +} +const ts_ScriptTarget_ES5 = 1; +const ts_ScriptTarget_ES2022 = 9; +const ts_ScriptTarget_ESNext = 99; +const ts_ModuleKind_Node16 = 100; +const ts_ModuleKind_NodeNext = 199; +// https://github.com/microsoft/TypeScript/blob/fc418a2e611c88cf9afa0115ff73490b2397d311/src/compiler/utilities.ts#L8761 +function getUseDefineForClassFields(compilerOptions) { + return compilerOptions.useDefineForClassFields === undefined + ? getEmitScriptTarget(compilerOptions) >= ts_ScriptTarget_ES2022 + : compilerOptions.useDefineForClassFields; +} +exports.getUseDefineForClassFields = getUseDefineForClassFields; +// https://github.com/microsoft/TypeScript/blob/fc418a2e611c88cf9afa0115ff73490b2397d311/src/compiler/utilities.ts#L8556 +function getEmitScriptTarget(compilerOptions) { + var _a; + return ((_a = compilerOptions.target) !== null && _a !== void 0 ? _a : ((compilerOptions.module === ts_ModuleKind_Node16 && ts_ScriptTarget_ES2022) || + (compilerOptions.module === ts_ModuleKind_NodeNext && ts_ScriptTarget_ESNext) || + ts_ScriptTarget_ES5)); +} +exports.getEmitScriptTarget = getEmitScriptTarget; +//# sourceMappingURL=ts-internals.js.map + +/***/ }), + +/***/ 4444: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createTsTranspileModule = void 0; +/** @internal */ +function createTsTranspileModule(ts, transpileOptions) { + const { createProgram, createSourceFile, getDefaultCompilerOptions, getImpliedNodeFormatForFile, fixupCompilerOptions, transpileOptionValueCompilerOptions, getNewLineCharacter, fileExtensionIs, normalizePath, Debug, toPath, getSetExternalModuleIndicator, getEntries, addRange, hasProperty, getEmitScriptTarget, getDirectoryPath, } = ts; + const compilerOptionsDiagnostics = []; + const options = transpileOptions.compilerOptions + ? fixupCompilerOptions(transpileOptions.compilerOptions, compilerOptionsDiagnostics) + : {}; + // mix in default options + const defaultOptions = getDefaultCompilerOptions(); + for (const key in defaultOptions) { + if (hasProperty(defaultOptions, key) && options[key] === undefined) { + options[key] = defaultOptions[key]; + } + } + for (const option of transpileOptionValueCompilerOptions) { + options[option.name] = option.transpileOptionValue; + } + // transpileModule does not write anything to disk so there is no need to verify that there are no conflicts between input and output paths. + options.suppressOutputPathCheck = true; + // Filename can be non-ts file. + options.allowNonTsExtensions = true; + const newLine = getNewLineCharacter(options); + // Create a compilerHost object to allow the compiler to read and write files + const compilerHost = { + getSourceFile: (fileName) => fileName === normalizePath(inputFileName) ? sourceFile : undefined, + writeFile: (name, text) => { + if (fileExtensionIs(name, '.map')) { + Debug.assertEqual(sourceMapText, undefined, 'Unexpected multiple source map outputs, file:', name); + sourceMapText = text; + } + else { + Debug.assertEqual(outputText, undefined, 'Unexpected multiple outputs, file:', name); + outputText = text; + } + }, + getDefaultLibFileName: () => 'lib.d.ts', + useCaseSensitiveFileNames: () => true, + getCanonicalFileName: (fileName) => fileName, + getCurrentDirectory: () => '', + getNewLine: () => newLine, + fileExists: (fileName) => fileName === inputFileName || fileName === packageJsonFileName, + readFile: (fileName) => fileName === packageJsonFileName ? `{"type": "${_packageJsonType}"}` : '', + directoryExists: () => true, + getDirectories: () => [], + }; + let inputFileName; + let packageJsonFileName; + let _packageJsonType; + let sourceFile; + let outputText; + let sourceMapText; + return transpileModule; + function transpileModule(input, transpileOptions2, packageJsonType = 'commonjs') { + // if jsx is specified then treat file as .tsx + inputFileName = + transpileOptions2.fileName || + (transpileOptions.compilerOptions && transpileOptions.compilerOptions.jsx + ? 'module.tsx' + : 'module.ts'); + packageJsonFileName = getDirectoryPath(inputFileName) + '/package.json'; + _packageJsonType = packageJsonType; + sourceFile = createSourceFile(inputFileName, input, { + languageVersion: getEmitScriptTarget(options), + impliedNodeFormat: getImpliedNodeFormatForFile(toPath(inputFileName, '', compilerHost.getCanonicalFileName), + /*cache*/ undefined, compilerHost, options), + setExternalModuleIndicator: getSetExternalModuleIndicator(options), + }); + if (transpileOptions2.moduleName) { + sourceFile.moduleName = transpileOptions2.moduleName; + } + if (transpileOptions2.renamedDependencies) { + sourceFile.renamedDependencies = new Map(getEntries(transpileOptions2.renamedDependencies)); + } + // Output + outputText = undefined; + sourceMapText = undefined; + const program = createProgram([inputFileName], options, compilerHost); + const diagnostics = compilerOptionsDiagnostics.slice(); + if (transpileOptions.reportDiagnostics) { + addRange( + /*to*/ diagnostics, + /*from*/ program.getSyntacticDiagnostics(sourceFile)); + addRange(/*to*/ diagnostics, /*from*/ program.getOptionsDiagnostics()); + } + // Emit + program.emit( + /*targetSourceFile*/ undefined, + /*writeFile*/ undefined, + /*cancellationToken*/ undefined, + /*emitOnlyDtsFiles*/ undefined, transpileOptions.transformers); + if (outputText === undefined) + return Debug.fail('Output generation failed'); + return { outputText, diagnostics, sourceMapText }; + } +} +exports.createTsTranspileModule = createTsTranspileModule; +//# sourceMappingURL=ts-transpile-module.js.map + +/***/ }), + +/***/ 91533: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getDefaultTsconfigJsonForNodeVersion = void 0; +const nodeMajor = parseInt(process.versions.node.split('.')[0], 10); +/** + * return parsed JSON of the bundled @tsconfig/bases config appropriate for the + * running version of nodejs + * @internal + */ +function getDefaultTsconfigJsonForNodeVersion(ts) { + const tsInternal = ts; + if (nodeMajor >= 16) { + const config = __nccwpck_require__(39777); + if (configCompatible(config)) + return config; + } + if (nodeMajor >= 14) { + const config = __nccwpck_require__(83754); + if (configCompatible(config)) + return config; + } + if (nodeMajor >= 12) { + const config = __nccwpck_require__(56049); + if (configCompatible(config)) + return config; + } + return __nccwpck_require__(78250); + // Verify that tsconfig target and lib options are compatible with TypeScript compiler + function configCompatible(config) { + return (typeof ts.ScriptTarget[config.compilerOptions.target.toUpperCase()] === 'number' && + tsInternal.libs && + config.compilerOptions.lib.every((lib) => tsInternal.libs.includes(lib))); + } +} +exports.getDefaultTsconfigJsonForNodeVersion = getDefaultTsconfigJsonForNodeVersion; +//# sourceMappingURL=tsconfigs.js.map + +/***/ }), + +/***/ 64745: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +var _a; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.versionGteLt = exports.once = exports.getBasePathForProjectLocalDependencyResolution = exports.createProjectLocalResolveHelper = exports.attemptRequireWithV8CompileCache = exports.cachedLookup = exports.hasOwnProperty = exports.normalizeSlashes = exports.parse = exports.split = exports.assign = exports.yn = exports.createRequire = void 0; +const module_1 = __nccwpck_require__(98188); +const ynModule = __nccwpck_require__(79647); +const path_1 = __nccwpck_require__(71017); +/** @internal */ +exports.createRequire = (_a = module_1.createRequire !== null && module_1.createRequire !== void 0 ? module_1.createRequire : module_1.createRequireFromPath) !== null && _a !== void 0 ? _a : __nccwpck_require__(45830); +/** + * Wrapper around yn module that returns `undefined` instead of `null`. + * This is implemented by yn v4, but we're staying on v3 to avoid v4's node 10 requirement. + * @internal + */ +function yn(value) { + var _a; + return (_a = ynModule(value)) !== null && _a !== void 0 ? _a : undefined; +} +exports.yn = yn; +/** + * Like `Object.assign`, but ignores `undefined` properties. + * + * @internal + */ +function assign(initialValue, ...sources) { + for (const source of sources) { + for (const key of Object.keys(source)) { + const value = source[key]; + if (value !== undefined) + initialValue[key] = value; + } + } + return initialValue; +} +exports.assign = assign; +/** + * Split a string array of values + * and remove empty strings from the resulting array. + * @internal + */ +function split(value) { + return typeof value === 'string' + ? value.split(/ *, */g).filter((v) => v !== '') + : undefined; +} +exports.split = split; +/** + * Parse a string as JSON. + * @internal + */ +function parse(value) { + return typeof value === 'string' ? JSON.parse(value) : undefined; +} +exports.parse = parse; +const directorySeparator = '/'; +const backslashRegExp = /\\/g; +/** + * Replace backslashes with forward slashes. + * @internal + */ +function normalizeSlashes(value) { + return value.replace(backslashRegExp, directorySeparator); +} +exports.normalizeSlashes = normalizeSlashes; +/** + * Safe `hasOwnProperty` + * @internal + */ +function hasOwnProperty(object, property) { + return Object.prototype.hasOwnProperty.call(object, property); +} +exports.hasOwnProperty = hasOwnProperty; +/** + * Cached fs operation wrapper. + */ +function cachedLookup(fn) { + const cache = new Map(); + return (arg) => { + if (!cache.has(arg)) { + const v = fn(arg); + cache.set(arg, v); + return v; + } + return cache.get(arg); + }; +} +exports.cachedLookup = cachedLookup; +/** + * @internal + * Require something with v8-compile-cache, which should make subsequent requires faster. + * Do lots of error-handling so that, worst case, we require without the cache, and users are not blocked. + */ +function attemptRequireWithV8CompileCache(requireFn, specifier) { + try { + const v8CC = (__nccwpck_require__(70416).install)(); + try { + return requireFn(specifier); + } + finally { + v8CC === null || v8CC === void 0 ? void 0 : v8CC.uninstall(); + } + } + catch (e) { + return requireFn(specifier); + } +} +exports.attemptRequireWithV8CompileCache = attemptRequireWithV8CompileCache; +/** + * Helper to discover dependencies relative to a user's project, optionally + * falling back to relative to ts-node. This supports global installations of + * ts-node, for example where someone does `#!/usr/bin/env -S ts-node --swc` and + * we need to fallback to a global install of @swc/core + * @internal + */ +function createProjectLocalResolveHelper(localDirectory) { + return function projectLocalResolveHelper(specifier, fallbackToTsNodeRelative) { + return require.resolve(specifier, { + paths: fallbackToTsNodeRelative + ? [localDirectory, __dirname] + : [localDirectory], + }); + }; +} +exports.createProjectLocalResolveHelper = createProjectLocalResolveHelper; +/** + * Used as a reminder of all the factors we must consider when finding project-local dependencies and when a config file + * on disk may or may not exist. + * @internal + */ +function getBasePathForProjectLocalDependencyResolution(configFilePath, projectSearchDirOption, projectOption, cwdOption) { + var _a; + if (configFilePath != null) + return (0, path_1.dirname)(configFilePath); + return (_a = projectSearchDirOption !== null && projectSearchDirOption !== void 0 ? projectSearchDirOption : projectOption) !== null && _a !== void 0 ? _a : cwdOption; + // TODO technically breaks if projectOption is path to a file, not a directory, + // and we attempt to resolve relative specifiers. By the time we resolve relative specifiers, + // should have configFilePath, so not reach this codepath. +} +exports.getBasePathForProjectLocalDependencyResolution = getBasePathForProjectLocalDependencyResolution; +/** @internal */ +function once(fn) { + let value; + let ran = false; + function onceFn(...args) { + if (ran) + return value; + value = fn(...args); + ran = true; + return value; + } + return onceFn; +} +exports.once = once; +/** @internal */ +function versionGteLt(version, gteRequirement, ltRequirement) { + const [major, minor, patch, extra] = parse(version); + const [gteMajor, gteMinor, gtePatch] = parse(gteRequirement); + const isGte = major > gteMajor || + (major === gteMajor && + (minor > gteMinor || (minor === gteMinor && patch >= gtePatch))); + let isLt = true; + if (ltRequirement) { + const [ltMajor, ltMinor, ltPatch] = parse(ltRequirement); + isLt = + major < ltMajor || + (major === ltMajor && + (minor < ltMinor || (minor === ltMinor && patch < ltPatch))); + } + return isGte && isLt; + function parse(requirement) { + return requirement.split(/[\.-]/).map((s) => parseInt(s, 10)); + } +} +exports.versionGteLt = versionGteLt; +//# sourceMappingURL=util.js.map + +/***/ }), + +/***/ 12077: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.configLoader = exports.loadConfig = void 0; +var TsConfigLoader2 = __nccwpck_require__(5214); +var path = __nccwpck_require__(71017); +function loadConfig(cwd) { + if (cwd === void 0) { cwd = process.cwd(); } + return configLoader({ cwd: cwd }); +} +exports.loadConfig = loadConfig; +function configLoader(_a) { + var cwd = _a.cwd, explicitParams = _a.explicitParams, _b = _a.tsConfigLoader, tsConfigLoader = _b === void 0 ? TsConfigLoader2.tsConfigLoader : _b; + if (explicitParams) { + var absoluteBaseUrl = path.isAbsolute(explicitParams.baseUrl) + ? explicitParams.baseUrl + : path.join(cwd, explicitParams.baseUrl); + return { + resultType: "success", + configFileAbsolutePath: "", + baseUrl: explicitParams.baseUrl, + absoluteBaseUrl: absoluteBaseUrl, + paths: explicitParams.paths, + mainFields: explicitParams.mainFields, + addMatchAll: explicitParams.addMatchAll, + }; + } + // Load tsconfig and create path matching function + var loadResult = tsConfigLoader({ + cwd: cwd, + getEnv: function (key) { return process.env[key]; }, + }); + if (!loadResult.tsConfigPath) { + return { + resultType: "failed", + message: "Couldn't find tsconfig.json", + }; + } + return { + resultType: "success", + configFileAbsolutePath: loadResult.tsConfigPath, + baseUrl: loadResult.baseUrl, + absoluteBaseUrl: path.resolve(path.dirname(loadResult.tsConfigPath), loadResult.baseUrl || ""), + paths: loadResult.paths || {}, + addMatchAll: loadResult.baseUrl !== undefined, + }; +} +exports.configLoader = configLoader; +//# sourceMappingURL=config-loader.js.map + +/***/ }), + +/***/ 55775: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.removeExtension = exports.fileExistsAsync = exports.readJsonFromDiskAsync = exports.readJsonFromDiskSync = exports.fileExistsSync = void 0; +var fs = __nccwpck_require__(57147); +function fileExistsSync(path) { + // If the file doesn't exist, avoid throwing an exception over the native barrier for every miss + if (!fs.existsSync(path)) { + return false; + } + try { + var stats = fs.statSync(path); + return stats.isFile(); + } + catch (err) { + // If error, assume file did not exist + return false; + } +} +exports.fileExistsSync = fileExistsSync; +/** + * Reads package.json from disk + * + * @param file Path to package.json + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function readJsonFromDiskSync(packageJsonPath) { + if (!fs.existsSync(packageJsonPath)) { + return undefined; + } + // eslint-disable-next-line @typescript-eslint/no-require-imports + return require(packageJsonPath); +} +exports.readJsonFromDiskSync = readJsonFromDiskSync; +function readJsonFromDiskAsync(path, +// eslint-disable-next-line @typescript-eslint/no-explicit-any +callback) { + fs.readFile(path, "utf8", function (err, result) { + // If error, assume file did not exist + if (err || !result) { + return callback(); + } + var json = JSON.parse(result); + return callback(undefined, json); + }); +} +exports.readJsonFromDiskAsync = readJsonFromDiskAsync; +function fileExistsAsync(path2, callback2) { + fs.stat(path2, function (err, stats) { + if (err) { + // If error assume file does not exist + return callback2(undefined, false); + } + callback2(undefined, stats ? stats.isFile() : false); + }); +} +exports.fileExistsAsync = fileExistsAsync; +function removeExtension(path) { + return path.substring(0, path.lastIndexOf(".")) || path; +} +exports.removeExtension = removeExtension; +//# sourceMappingURL=filesystem.js.map + +/***/ }), + +/***/ 56143: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.loadConfig = exports.register = exports.matchFromAbsolutePathsAsync = exports.createMatchPathAsync = exports.matchFromAbsolutePaths = exports.createMatchPath = void 0; +// register is used from register.js in root dir +var match_path_sync_1 = __nccwpck_require__(21810); +Object.defineProperty(exports, "createMatchPath", ({ enumerable: true, get: function () { return match_path_sync_1.createMatchPath; } })); +Object.defineProperty(exports, "matchFromAbsolutePaths", ({ enumerable: true, get: function () { return match_path_sync_1.matchFromAbsolutePaths; } })); +var match_path_async_1 = __nccwpck_require__(74479); +Object.defineProperty(exports, "createMatchPathAsync", ({ enumerable: true, get: function () { return match_path_async_1.createMatchPathAsync; } })); +Object.defineProperty(exports, "matchFromAbsolutePathsAsync", ({ enumerable: true, get: function () { return match_path_async_1.matchFromAbsolutePathsAsync; } })); +var register_1 = __nccwpck_require__(25174); +Object.defineProperty(exports, "register", ({ enumerable: true, get: function () { return register_1.register; } })); +var config_loader_1 = __nccwpck_require__(12077); +Object.defineProperty(exports, "loadConfig", ({ enumerable: true, get: function () { return config_loader_1.loadConfig; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 25121: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getAbsoluteMappingEntries = void 0; +var path = __nccwpck_require__(71017); +/** + * Converts an absolute baseUrl and paths to an array of absolute mapping entries. + * The array is sorted by longest prefix. + * Having an array with entries allows us to keep a sorting order rather than + * sort by keys each time we use the mappings. + * + * @param absoluteBaseUrl + * @param paths + * @param addMatchAll + */ +function getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll) { + // Resolve all paths to absolute form once here, and sort them by + // longest prefix once here, this saves time on each request later. + // We need to put them in an array to preserve the sorting order. + var sortedKeys = sortByLongestPrefix(Object.keys(paths)); + var absolutePaths = []; + for (var _i = 0, sortedKeys_1 = sortedKeys; _i < sortedKeys_1.length; _i++) { + var key = sortedKeys_1[_i]; + absolutePaths.push({ + pattern: key, + paths: paths[key].map(function (pathToResolve) { + return path.resolve(absoluteBaseUrl, pathToResolve); + }), + }); + } + // If there is no match-all path specified in the paths section of tsconfig, then try to match + // all paths relative to baseUrl, this is how typescript works. + if (!paths["*"] && addMatchAll) { + absolutePaths.push({ + pattern: "*", + paths: ["".concat(absoluteBaseUrl.replace(/\/$/, ""), "/*")], + }); + } + return absolutePaths; +} +exports.getAbsoluteMappingEntries = getAbsoluteMappingEntries; +/** + * Sort path patterns. + * If a module name can be matched with multiple patterns then pattern with the longest prefix will be picked. + */ +function sortByLongestPrefix(arr) { + return arr + .concat() + .sort(function (a, b) { return getPrefixLength(b) - getPrefixLength(a); }); +} +function getPrefixLength(pattern) { + var prefixLength = pattern.indexOf("*"); + return pattern.substr(0, prefixLength).length; +} +//# sourceMappingURL=mapping-entry.js.map + +/***/ }), + +/***/ 74479: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.matchFromAbsolutePathsAsync = exports.createMatchPathAsync = void 0; +var path = __nccwpck_require__(71017); +var TryPath = __nccwpck_require__(44231); +var MappingEntry = __nccwpck_require__(25121); +var Filesystem = __nccwpck_require__(55775); +/** + * See the sync version for docs. + */ +function createMatchPathAsync(absoluteBaseUrl, paths, mainFields, addMatchAll) { + if (mainFields === void 0) { mainFields = ["main"]; } + if (addMatchAll === void 0) { addMatchAll = true; } + var absolutePaths = MappingEntry.getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll); + return function (requestedModule, readJson, fileExists, extensions, callback) { + return matchFromAbsolutePathsAsync(absolutePaths, requestedModule, readJson, fileExists, extensions, callback, mainFields); + }; +} +exports.createMatchPathAsync = createMatchPathAsync; +/** + * See the sync version for docs. + */ +function matchFromAbsolutePathsAsync(absolutePathMappings, requestedModule, readJson, fileExists, extensions, callback, mainFields) { + if (readJson === void 0) { readJson = Filesystem.readJsonFromDiskAsync; } + if (fileExists === void 0) { fileExists = Filesystem.fileExistsAsync; } + if (extensions === void 0) { extensions = Object.keys(require.extensions); } + if (mainFields === void 0) { mainFields = ["main"]; } + var tryPaths = TryPath.getPathsToTry(extensions, absolutePathMappings, requestedModule); + if (!tryPaths) { + return callback(); + } + findFirstExistingPath(tryPaths, readJson, fileExists, callback, 0, mainFields); +} +exports.matchFromAbsolutePathsAsync = matchFromAbsolutePathsAsync; +function findFirstExistingMainFieldMappedFile(packageJson, mainFields, packageJsonPath, fileExistsAsync, doneCallback, index) { + if (index === void 0) { index = 0; } + if (index >= mainFields.length) { + return doneCallback(undefined, undefined); + } + var tryNext = function () { + return findFirstExistingMainFieldMappedFile(packageJson, mainFields, packageJsonPath, fileExistsAsync, doneCallback, index + 1); + }; + var mainFieldSelector = mainFields[index]; + var mainFieldMapping = typeof mainFieldSelector === "string" + ? packageJson[mainFieldSelector] + : mainFieldSelector.reduce(function (obj, key) { return obj[key]; }, packageJson); + if (typeof mainFieldMapping !== "string") { + // Skip mappings that are not pointers to replacement files + return tryNext(); + } + var mappedFilePath = path.join(path.dirname(packageJsonPath), mainFieldMapping); + fileExistsAsync(mappedFilePath, function (err, exists) { + if (err) { + return doneCallback(err); + } + if (exists) { + return doneCallback(undefined, mappedFilePath); + } + return tryNext(); + }); +} +// Recursive loop to probe for physical files +function findFirstExistingPath(tryPaths, readJson, fileExists, doneCallback, index, mainFields) { + if (index === void 0) { index = 0; } + if (mainFields === void 0) { mainFields = ["main"]; } + var tryPath = tryPaths[index]; + if (tryPath.type === "file" || + tryPath.type === "extension" || + tryPath.type === "index") { + fileExists(tryPath.path, function (err, exists) { + if (err) { + return doneCallback(err); + } + if (exists) { + return doneCallback(undefined, TryPath.getStrippedPath(tryPath)); + } + if (index === tryPaths.length - 1) { + return doneCallback(); + } + // Continue with the next path + return findFirstExistingPath(tryPaths, readJson, fileExists, doneCallback, index + 1, mainFields); + }); + } + else if (tryPath.type === "package") { + readJson(tryPath.path, function (err, packageJson) { + if (err) { + return doneCallback(err); + } + if (packageJson) { + return findFirstExistingMainFieldMappedFile(packageJson, mainFields, tryPath.path, fileExists, function (mainFieldErr, mainFieldMappedFile) { + if (mainFieldErr) { + return doneCallback(mainFieldErr); + } + if (mainFieldMappedFile) { + return doneCallback(undefined, mainFieldMappedFile); + } + // No field in package json was a valid option. Continue with the next path. + return findFirstExistingPath(tryPaths, readJson, fileExists, doneCallback, index + 1, mainFields); + }); + } + // This is async code, we need to return unconditionally, otherwise the code still falls + // through and keeps recursing. While this might work in general, libraries that use neo-async + // like Webpack will actually not allow you to call the same callback twice. + // + // An example of where this caused issues: + // https://github.com/dividab/tsconfig-paths-webpack-plugin/issues/11 + // + // Continue with the next path + return findFirstExistingPath(tryPaths, readJson, fileExists, doneCallback, index + 1, mainFields); + }); + } + else { + TryPath.exhaustiveTypeException(tryPath.type); + } +} +//# sourceMappingURL=match-path-async.js.map + +/***/ }), + +/***/ 21810: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.matchFromAbsolutePaths = exports.createMatchPath = void 0; +var path = __nccwpck_require__(71017); +var Filesystem = __nccwpck_require__(55775); +var MappingEntry = __nccwpck_require__(25121); +var TryPath = __nccwpck_require__(44231); +/** + * Creates a function that can resolve paths according to tsconfig paths property. + * + * @param absoluteBaseUrl Absolute version of baseUrl as specified in tsconfig. + * @param paths The paths as specified in tsconfig. + * @param mainFields A list of package.json field names to try when resolving module files. Select a nested field using an array of field names. + * @param addMatchAll Add a match-all "*" rule if none is present + * @returns a function that can resolve paths. + */ +function createMatchPath(absoluteBaseUrl, paths, mainFields, addMatchAll) { + if (mainFields === void 0) { mainFields = ["main"]; } + if (addMatchAll === void 0) { addMatchAll = true; } + var absolutePaths = MappingEntry.getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll); + return function (requestedModule, readJson, fileExists, extensions) { + return matchFromAbsolutePaths(absolutePaths, requestedModule, readJson, fileExists, extensions, mainFields); + }; +} +exports.createMatchPath = createMatchPath; +/** + * Finds a path from tsconfig that matches a module load request. + * + * @param absolutePathMappings The paths to try as specified in tsconfig but resolved to absolute form. + * @param requestedModule The required module name. + * @param readJson Function that can read json from a path (useful for testing). + * @param fileExists Function that checks for existence of a file at a path (useful for testing). + * @param extensions File extensions to probe for (useful for testing). + * @param mainFields A list of package.json field names to try when resolving module files. Select a nested field using an array of field names. + * @returns the found path, or undefined if no path was found. + */ +function matchFromAbsolutePaths(absolutePathMappings, requestedModule, readJson, fileExists, extensions, mainFields) { + if (readJson === void 0) { readJson = Filesystem.readJsonFromDiskSync; } + if (fileExists === void 0) { fileExists = Filesystem.fileExistsSync; } + if (extensions === void 0) { extensions = Object.keys(require.extensions); } + if (mainFields === void 0) { mainFields = ["main"]; } + var tryPaths = TryPath.getPathsToTry(extensions, absolutePathMappings, requestedModule); + if (!tryPaths) { + return undefined; + } + return findFirstExistingPath(tryPaths, readJson, fileExists, mainFields); +} +exports.matchFromAbsolutePaths = matchFromAbsolutePaths; +function findFirstExistingMainFieldMappedFile(packageJson, mainFields, packageJsonPath, fileExists) { + for (var index = 0; index < mainFields.length; index++) { + var mainFieldSelector = mainFields[index]; + var candidateMapping = typeof mainFieldSelector === "string" + ? packageJson[mainFieldSelector] + : mainFieldSelector.reduce(function (obj, key) { return obj[key]; }, packageJson); + if (candidateMapping && typeof candidateMapping === "string") { + var candidateFilePath = path.join(path.dirname(packageJsonPath), candidateMapping); + if (fileExists(candidateFilePath)) { + return candidateFilePath; + } + } + } + return undefined; +} +function findFirstExistingPath(tryPaths, readJson, fileExists, mainFields) { + if (readJson === void 0) { readJson = Filesystem.readJsonFromDiskSync; } + if (mainFields === void 0) { mainFields = ["main"]; } + for (var _i = 0, tryPaths_1 = tryPaths; _i < tryPaths_1.length; _i++) { + var tryPath = tryPaths_1[_i]; + if (tryPath.type === "file" || + tryPath.type === "extension" || + tryPath.type === "index") { + if (fileExists(tryPath.path)) { + return TryPath.getStrippedPath(tryPath); + } + } + else if (tryPath.type === "package") { + var packageJson = readJson(tryPath.path); + if (packageJson) { + var mainFieldMappedFile = findFirstExistingMainFieldMappedFile(packageJson, mainFields, tryPath.path, fileExists); + if (mainFieldMappedFile) { + return mainFieldMappedFile; + } + } + } + else { + TryPath.exhaustiveTypeException(tryPath.type); + } + } + return undefined; +} +//# sourceMappingURL=match-path-sync.js.map + +/***/ }), + +/***/ 25174: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.register = void 0; +var match_path_sync_1 = __nccwpck_require__(21810); +var config_loader_1 = __nccwpck_require__(12077); +var noOp = function () { return void 0; }; +function getCoreModules(builtinModules) { + builtinModules = builtinModules || [ + "assert", + "buffer", + "child_process", + "cluster", + "crypto", + "dgram", + "dns", + "domain", + "events", + "fs", + "http", + "https", + "net", + "os", + "path", + "punycode", + "querystring", + "readline", + "stream", + "string_decoder", + "tls", + "tty", + "url", + "util", + "v8", + "vm", + "zlib", + ]; + var coreModules = {}; + for (var _i = 0, builtinModules_1 = builtinModules; _i < builtinModules_1.length; _i++) { + var module_1 = builtinModules_1[_i]; + coreModules[module_1] = true; + } + return coreModules; +} +/** + * Installs a custom module load function that can adhere to paths in tsconfig. + * Returns a function to undo paths registration. + */ +function register(params) { + var cwd; + var explicitParams; + if (params) { + cwd = params.cwd; + if (params.baseUrl || params.paths) { + explicitParams = params; + } + } + else { + // eslint-disable-next-line + var minimist = __nccwpck_require__(35871); + var argv = minimist(process.argv.slice(2), { + // eslint-disable-next-line id-denylist + string: ["project"], + alias: { + project: ["P"], + }, + }); + cwd = argv.project; + } + var configLoaderResult = (0, config_loader_1.configLoader)({ + cwd: cwd !== null && cwd !== void 0 ? cwd : process.cwd(), + explicitParams: explicitParams, + }); + if (configLoaderResult.resultType === "failed") { + console.warn("".concat(configLoaderResult.message, ". tsconfig-paths will be skipped")); + return noOp; + } + var matchPath = (0, match_path_sync_1.createMatchPath)(configLoaderResult.absoluteBaseUrl, configLoaderResult.paths, configLoaderResult.mainFields, configLoaderResult.addMatchAll); + // Patch node's module loading + // eslint-disable-next-line @typescript-eslint/no-require-imports,@typescript-eslint/no-var-requires + var Module = __nccwpck_require__(98188); + // eslint-disable-next-line no-underscore-dangle + var originalResolveFilename = Module._resolveFilename; + var coreModules = getCoreModules(Module.builtinModules); + // eslint-disable-next-line @typescript-eslint/no-explicit-any,no-underscore-dangle + Module._resolveFilename = function (request, _parent) { + var isCoreModule = coreModules.hasOwnProperty(request); + if (!isCoreModule) { + var found = matchPath(request); + if (found) { + var modifiedArguments = __spreadArray([found], [].slice.call(arguments, 1), true); // Passes all arguments. Even those that is not specified above. + return originalResolveFilename.apply(this, modifiedArguments); + } + } + return originalResolveFilename.apply(this, arguments); + }; + return function () { + // Return node's module loading to original state. + // eslint-disable-next-line no-underscore-dangle + Module._resolveFilename = originalResolveFilename; + }; +} +exports.register = register; +//# sourceMappingURL=register.js.map + +/***/ }), + +/***/ 44231: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.exhaustiveTypeException = exports.getStrippedPath = exports.getPathsToTry = void 0; +var path = __nccwpck_require__(71017); +var path_1 = __nccwpck_require__(71017); +var filesystem_1 = __nccwpck_require__(55775); +/** + * Builds a list of all physical paths to try by: + * 1. Check for file named exactly as request. + * 2. Check for files named as request ending in any of the extensions. + * 3. Check for file specified in package.json's main property. + * 4. Check for files named as request ending in "index" with any of the extensions. + */ +function getPathsToTry(extensions, absolutePathMappings, requestedModule) { + if (!absolutePathMappings || !requestedModule || requestedModule[0] === ".") { + return undefined; + } + var pathsToTry = []; + for (var _i = 0, absolutePathMappings_1 = absolutePathMappings; _i < absolutePathMappings_1.length; _i++) { + var entry = absolutePathMappings_1[_i]; + var starMatch = entry.pattern === requestedModule + ? "" + : matchStar(entry.pattern, requestedModule); + if (starMatch !== undefined) { + var _loop_1 = function (physicalPathPattern) { + var physicalPath = physicalPathPattern.replace("*", starMatch); + pathsToTry.push({ type: "file", path: physicalPath }); + pathsToTry.push.apply(pathsToTry, extensions.map(function (e) { return ({ type: "extension", path: physicalPath + e }); })); + pathsToTry.push({ + type: "package", + path: path.join(physicalPath, "/package.json"), + }); + var indexPath = path.join(physicalPath, "/index"); + pathsToTry.push.apply(pathsToTry, extensions.map(function (e) { return ({ type: "index", path: indexPath + e }); })); + }; + for (var _a = 0, _b = entry.paths; _a < _b.length; _a++) { + var physicalPathPattern = _b[_a]; + _loop_1(physicalPathPattern); + } + } + } + return pathsToTry.length === 0 ? undefined : pathsToTry; +} +exports.getPathsToTry = getPathsToTry; +// Not sure why we don't just return the full found path? +function getStrippedPath(tryPath) { + return tryPath.type === "index" + ? (0, path_1.dirname)(tryPath.path) + : tryPath.type === "file" + ? tryPath.path + : tryPath.type === "extension" + ? (0, filesystem_1.removeExtension)(tryPath.path) + : tryPath.type === "package" + ? tryPath.path + : exhaustiveTypeException(tryPath.type); +} +exports.getStrippedPath = getStrippedPath; +function exhaustiveTypeException(check) { + throw new Error("Unknown type ".concat(check)); +} +exports.exhaustiveTypeException = exhaustiveTypeException; +/** + * Matches pattern with a single star against search. + * Star must match at least one character to be considered a match. + * + * @param patttern for example "foo*" + * @param search for example "fooawesomebar" + * @returns the part of search that * matches, or undefined if no match. + */ +function matchStar(pattern, search) { + if (search.length < pattern.length) { + return undefined; + } + if (pattern === "*") { + return search; + } + var star = pattern.indexOf("*"); + if (star === -1) { + return undefined; + } + var part1 = pattern.substring(0, star); + var part2 = pattern.substring(star + 1); + if (search.substr(0, star) !== part1) { + return undefined; + } + if (search.substr(search.length - part2.length) !== part2) { + return undefined; + } + return search.substr(star, search.length - part2.length); +} +//# sourceMappingURL=try-path.js.map + +/***/ }), + +/***/ 5214: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.loadTsconfig = exports.walkForTsConfig = exports.tsConfigLoader = void 0; +var path = __nccwpck_require__(71017); +var fs = __nccwpck_require__(57147); +// eslint-disable-next-line @typescript-eslint/no-require-imports +var JSON5 = __nccwpck_require__(86904); +// eslint-disable-next-line @typescript-eslint/no-require-imports +var StripBom = __nccwpck_require__(55831); +function tsConfigLoader(_a) { + var getEnv = _a.getEnv, cwd = _a.cwd, _b = _a.loadSync, loadSync = _b === void 0 ? loadSyncDefault : _b; + var TS_NODE_PROJECT = getEnv("TS_NODE_PROJECT"); + var TS_NODE_BASEURL = getEnv("TS_NODE_BASEURL"); + // tsconfig.loadSync handles if TS_NODE_PROJECT is a file or directory + // and also overrides baseURL if TS_NODE_BASEURL is available. + var loadResult = loadSync(cwd, TS_NODE_PROJECT, TS_NODE_BASEURL); + return loadResult; +} +exports.tsConfigLoader = tsConfigLoader; +function loadSyncDefault(cwd, filename, baseUrl) { + // Tsconfig.loadSync uses path.resolve. This is why we can use an absolute path as filename + var configPath = resolveConfigPath(cwd, filename); + if (!configPath) { + return { + tsConfigPath: undefined, + baseUrl: undefined, + paths: undefined, + }; + } + var config = loadTsconfig(configPath); + return { + tsConfigPath: configPath, + baseUrl: baseUrl || + (config && config.compilerOptions && config.compilerOptions.baseUrl), + paths: config && config.compilerOptions && config.compilerOptions.paths, + }; +} +function resolveConfigPath(cwd, filename) { + if (filename) { + var absolutePath = fs.lstatSync(filename).isDirectory() + ? path.resolve(filename, "./tsconfig.json") + : path.resolve(cwd, filename); + return absolutePath; + } + if (fs.statSync(cwd).isFile()) { + return path.resolve(cwd); + } + var configAbsolutePath = walkForTsConfig(cwd); + return configAbsolutePath ? path.resolve(configAbsolutePath) : undefined; +} +function walkForTsConfig(directory, readdirSync) { + if (readdirSync === void 0) { readdirSync = fs.readdirSync; } + var files = readdirSync(directory); + var filesToCheck = ["tsconfig.json", "jsconfig.json"]; + for (var _i = 0, filesToCheck_1 = filesToCheck; _i < filesToCheck_1.length; _i++) { + var fileToCheck = filesToCheck_1[_i]; + if (files.indexOf(fileToCheck) !== -1) { + return path.join(directory, fileToCheck); + } + } + var parentDirectory = path.dirname(directory); + // If we reached the top + if (directory === parentDirectory) { + return undefined; + } + return walkForTsConfig(parentDirectory, readdirSync); +} +exports.walkForTsConfig = walkForTsConfig; +function loadTsconfig(configFilePath, +// eslint-disable-next-line no-shadow +existsSync, readFileSync) { + if (existsSync === void 0) { existsSync = fs.existsSync; } + if (readFileSync === void 0) { readFileSync = function (filename) { + return fs.readFileSync(filename, "utf8"); + }; } + if (!existsSync(configFilePath)) { + return undefined; + } + var configString = readFileSync(configFilePath); + var cleanedJson = StripBom(configString); + var config; + try { + config = JSON5.parse(cleanedJson); + } + catch (e) { + throw new Error("".concat(configFilePath, " is malformed ").concat(e.message)); + } + var extendedConfig = config.extends; + if (extendedConfig) { + var base = void 0; + if (Array.isArray(extendedConfig)) { + base = extendedConfig.reduce(function (currBase, extendedConfigElement) { + return mergeTsconfigs(currBase, loadTsconfigFromExtends(configFilePath, extendedConfigElement, existsSync, readFileSync)); + }, {}); + } + else { + base = loadTsconfigFromExtends(configFilePath, extendedConfig, existsSync, readFileSync); + } + return mergeTsconfigs(base, config); + } + return config; +} +exports.loadTsconfig = loadTsconfig; +/** + * Intended to be called only from loadTsconfig. + * Parameters don't have defaults because they should use the same as loadTsconfig. + */ +function loadTsconfigFromExtends(configFilePath, extendedConfigValue, +// eslint-disable-next-line no-shadow +existsSync, readFileSync) { + var _a; + if (typeof extendedConfigValue === "string" && + extendedConfigValue.indexOf(".json") === -1) { + extendedConfigValue += ".json"; + } + var currentDir = path.dirname(configFilePath); + var extendedConfigPath = path.join(currentDir, extendedConfigValue); + if (extendedConfigValue.indexOf("/") !== -1 && + extendedConfigValue.indexOf(".") !== -1 && + !existsSync(extendedConfigPath)) { + extendedConfigPath = path.join(currentDir, "node_modules", extendedConfigValue); + } + var config = loadTsconfig(extendedConfigPath, existsSync, readFileSync) || {}; + // baseUrl should be interpreted as relative to extendedConfigPath, + // but we need to update it so it is relative to the original tsconfig being loaded + if ((_a = config.compilerOptions) === null || _a === void 0 ? void 0 : _a.baseUrl) { + var extendsDir = path.dirname(extendedConfigValue); + config.compilerOptions.baseUrl = path.join(extendsDir, config.compilerOptions.baseUrl); + } + return config; +} +function mergeTsconfigs(base, config) { + base = base || {}; + config = config || {}; + return __assign(__assign(__assign({}, base), config), { compilerOptions: __assign(__assign({}, base.compilerOptions), config.compilerOptions) }); +} +//# sourceMappingURL=tsconfig-loader.js.map + +/***/ }), + +/***/ 55831: +/***/ ((module) => { + +"use strict"; + +module.exports = x => { + if (typeof x !== 'string') { + throw new TypeError('Expected a string, got ' + typeof x); + } + + // Catches EFBBBF (UTF-8 BOM) because the buffer-to-string + // conversion translates it to FEFF (UTF-16 BOM) + if (x.charCodeAt(0) === 0xFEFF) { + return x.slice(1); + } + + return x; +}; + + +/***/ }), + +/***/ 4351: +/***/ ((module) => { + +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global global, define, Symbol, Reflect, Promise, SuppressedError */ +var __extends; +var __assign; +var __rest; +var __decorate; +var __param; +var __esDecorate; +var __runInitializers; +var __propKey; +var __setFunctionName; +var __metadata; +var __awaiter; +var __generator; +var __exportStar; +var __values; +var __read; +var __spread; +var __spreadArrays; +var __spreadArray; +var __await; +var __asyncGenerator; +var __asyncDelegator; +var __asyncValues; +var __makeTemplateObject; +var __importStar; +var __importDefault; +var __classPrivateFieldGet; +var __classPrivateFieldSet; +var __classPrivateFieldIn; +var __createBinding; +var __addDisposableResource; +var __disposeResources; +(function (factory) { + var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; + if (typeof define === "function" && define.amd) { + define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); + } + else if ( true && typeof module.exports === "object") { + factory(createExporter(root, createExporter(module.exports))); + } + else { + factory(createExporter(root)); + } + function createExporter(exports, previous) { + if (exports !== root) { + if (typeof Object.create === "function") { + Object.defineProperty(exports, "__esModule", { value: true }); + } + else { + exports.__esModule = true; + } + } + return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + } +}) +(function (exporter) { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + + __extends = function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + + __assign = Object.assign || function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + + __rest = function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + + __decorate = function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + + __param = function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } + }; + + __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } + else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; + }; + + __runInitializers = function (thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; + }; + + __propKey = function (x) { + return typeof x === "symbol" ? x : "".concat(x); + }; + + __setFunctionName = function (f, name, prefix) { + if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); + }; + + __metadata = function (metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + }; + + __awaiter = function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + + __generator = function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + + __exportStar = function(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); + }; + + __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); + }) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); + + __values = function (o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + }; + + __read = function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; + }; + + /** @deprecated */ + __spread = function () { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; + }; + + /** @deprecated */ + __spreadArrays = function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + }; + + __spreadArray = function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); + }; + + __await = function (v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); + }; + + __asyncGenerator = function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } + }; + + __asyncDelegator = function (o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } + }; + + __asyncValues = function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } + }; + + __makeTemplateObject = function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; + }; + + var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }; + + __importStar = function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; + }; + + __importDefault = function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; + }; + + __classPrivateFieldGet = function (receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); + }; + + __classPrivateFieldSet = function (receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; + }; + + __classPrivateFieldIn = function (state, receiver) { + if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); + return typeof state === "function" ? receiver === state : state.has(receiver); + }; + + __addDisposableResource = function (env, value, async) { + if (value !== null && value !== void 0) { + if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); + var dispose; + if (async) { + if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + } + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + env.stack.push({ value: value, dispose: dispose, async: async }); + } + else if (async) { + env.stack.push({ async: true }); + } + return value; + }; + + var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; + }; + + __disposeResources = function (env) { + function fail(e) { + env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; + env.hasError = true; + } + function next() { + while (env.stack.length) { + var rec = env.stack.pop(); + try { + var result = rec.dispose && rec.dispose.call(rec.value); + if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); + } + catch (e) { + fail(e); + } + } + if (env.hasError) throw env.error; + } + return next(); + }; + + exporter("__extends", __extends); + exporter("__assign", __assign); + exporter("__rest", __rest); + exporter("__decorate", __decorate); + exporter("__param", __param); + exporter("__esDecorate", __esDecorate); + exporter("__runInitializers", __runInitializers); + exporter("__propKey", __propKey); + exporter("__setFunctionName", __setFunctionName); + exporter("__metadata", __metadata); + exporter("__awaiter", __awaiter); + exporter("__generator", __generator); + exporter("__exportStar", __exportStar); + exporter("__createBinding", __createBinding); + exporter("__values", __values); + exporter("__read", __read); + exporter("__spread", __spread); + exporter("__spreadArrays", __spreadArrays); + exporter("__spreadArray", __spreadArray); + exporter("__await", __await); + exporter("__asyncGenerator", __asyncGenerator); + exporter("__asyncDelegator", __asyncDelegator); + exporter("__asyncValues", __asyncValues); + exporter("__makeTemplateObject", __makeTemplateObject); + exporter("__importStar", __importStar); + exporter("__importDefault", __importDefault); + exporter("__classPrivateFieldGet", __classPrivateFieldGet); + exporter("__classPrivateFieldSet", __classPrivateFieldSet); + exporter("__classPrivateFieldIn", __classPrivateFieldIn); + exporter("__addDisposableResource", __addDisposableResource); + exporter("__disposeResources", __disposeResources); +}); + + +/***/ }), + +/***/ 74294: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +module.exports = __nccwpck_require__(54219); + + +/***/ }), + +/***/ 54219: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var net = __nccwpck_require__(41808); +var tls = __nccwpck_require__(24404); +var http = __nccwpck_require__(13685); +var https = __nccwpck_require__(95687); +var events = __nccwpck_require__(82361); +var assert = __nccwpck_require__(39491); +var util = __nccwpck_require__(73837); + + +exports.httpOverHttp = httpOverHttp; +exports.httpsOverHttp = httpsOverHttp; +exports.httpOverHttps = httpOverHttps; +exports.httpsOverHttps = httpsOverHttps; + + +function httpOverHttp(options) { + var agent = new TunnelingAgent(options); + agent.request = http.request; + return agent; +} + +function httpsOverHttp(options) { + var agent = new TunnelingAgent(options); + agent.request = http.request; + agent.createSocket = createSecureSocket; + agent.defaultPort = 443; + return agent; +} + +function httpOverHttps(options) { + var agent = new TunnelingAgent(options); + agent.request = https.request; + return agent; +} + +function httpsOverHttps(options) { + var agent = new TunnelingAgent(options); + agent.request = https.request; + agent.createSocket = createSecureSocket; + agent.defaultPort = 443; + return agent; +} + + +function TunnelingAgent(options) { + var self = this; + self.options = options || {}; + self.proxyOptions = self.options.proxy || {}; + self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets; + self.requests = []; + self.sockets = []; + + self.on('free', function onFree(socket, host, port, localAddress) { + var options = toOptions(host, port, localAddress); + for (var i = 0, len = self.requests.length; i < len; ++i) { + var pending = self.requests[i]; + if (pending.host === options.host && pending.port === options.port) { + // Detect the request to connect same origin server, + // reuse the connection. + self.requests.splice(i, 1); + pending.request.onSocket(socket); + return; + } + } + socket.destroy(); + self.removeSocket(socket); + }); +} +util.inherits(TunnelingAgent, events.EventEmitter); + +TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) { + var self = this; + var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress)); + + if (self.sockets.length >= this.maxSockets) { + // We are over limit so we'll add it to the queue. + self.requests.push(options); + return; + } + + // If we are under maxSockets create a new one. + self.createSocket(options, function(socket) { + socket.on('free', onFree); + socket.on('close', onCloseOrRemove); + socket.on('agentRemove', onCloseOrRemove); + req.onSocket(socket); + + function onFree() { + self.emit('free', socket, options); + } + + function onCloseOrRemove(err) { + self.removeSocket(socket); + socket.removeListener('free', onFree); + socket.removeListener('close', onCloseOrRemove); + socket.removeListener('agentRemove', onCloseOrRemove); + } + }); +}; + +TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { + var self = this; + var placeholder = {}; + self.sockets.push(placeholder); + + var connectOptions = mergeOptions({}, self.proxyOptions, { + method: 'CONNECT', + path: options.host + ':' + options.port, + agent: false, + headers: { + host: options.host + ':' + options.port + } + }); + if (options.localAddress) { + connectOptions.localAddress = options.localAddress; + } + if (connectOptions.proxyAuth) { + connectOptions.headers = connectOptions.headers || {}; + connectOptions.headers['Proxy-Authorization'] = 'Basic ' + + new Buffer(connectOptions.proxyAuth).toString('base64'); + } + + debug('making CONNECT request'); + var connectReq = self.request(connectOptions); + connectReq.useChunkedEncodingByDefault = false; // for v0.6 + connectReq.once('response', onResponse); // for v0.6 + connectReq.once('upgrade', onUpgrade); // for v0.6 + connectReq.once('connect', onConnect); // for v0.7 or later + connectReq.once('error', onError); + connectReq.end(); + + function onResponse(res) { + // Very hacky. This is necessary to avoid http-parser leaks. + res.upgrade = true; + } + + function onUpgrade(res, socket, head) { + // Hacky. + process.nextTick(function() { + onConnect(res, socket, head); + }); + } + + function onConnect(res, socket, head) { + connectReq.removeAllListeners(); + socket.removeAllListeners(); + + if (res.statusCode !== 200) { + debug('tunneling socket could not be established, statusCode=%d', + res.statusCode); + socket.destroy(); + var error = new Error('tunneling socket could not be established, ' + + 'statusCode=' + res.statusCode); + error.code = 'ECONNRESET'; + options.request.emit('error', error); + self.removeSocket(placeholder); + return; + } + if (head.length > 0) { + debug('got illegal response body from proxy'); + socket.destroy(); + var error = new Error('got illegal response body from proxy'); + error.code = 'ECONNRESET'; + options.request.emit('error', error); + self.removeSocket(placeholder); + return; + } + debug('tunneling connection has established'); + self.sockets[self.sockets.indexOf(placeholder)] = socket; + return cb(socket); + } + + function onError(cause) { + connectReq.removeAllListeners(); + + debug('tunneling socket could not be established, cause=%s\n', + cause.message, cause.stack); + var error = new Error('tunneling socket could not be established, ' + + 'cause=' + cause.message); + error.code = 'ECONNRESET'; + options.request.emit('error', error); + self.removeSocket(placeholder); + } +}; + +TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { + var pos = this.sockets.indexOf(socket) + if (pos === -1) { + return; + } + this.sockets.splice(pos, 1); + + var pending = this.requests.shift(); + if (pending) { + // If we have pending requests and a socket gets closed a new one + // needs to be created to take over in the pool for the one that closed. + this.createSocket(pending, function(socket) { + pending.request.onSocket(socket); + }); + } +}; + +function createSecureSocket(options, cb) { + var self = this; + TunnelingAgent.prototype.createSocket.call(self, options, function(socket) { + var hostHeader = options.request.getHeader('host'); + var tlsOptions = mergeOptions({}, self.options, { + socket: socket, + servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host + }); + + // 0 is dummy port for v0.6 + var secureSocket = tls.connect(0, tlsOptions); + self.sockets[self.sockets.indexOf(socket)] = secureSocket; + cb(secureSocket); + }); +} + + +function toOptions(host, port, localAddress) { + if (typeof host === 'string') { // since v0.10 + return { + host: host, + port: port, + localAddress: localAddress + }; + } + return host; // for v0.11 or later +} + +function mergeOptions(target) { + for (var i = 1, len = arguments.length; i < len; ++i) { + var overrides = arguments[i]; + if (typeof overrides === 'object') { + var keys = Object.keys(overrides); + for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { + var k = keys[j]; + if (overrides[k] !== undefined) { + target[k] = overrides[k]; + } + } + } + } + return target; +} + + +var debug; +if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { + debug = function() { + var args = Array.prototype.slice.call(arguments); + if (typeof args[0] === 'string') { + args[0] = 'TUNNEL: ' + args[0]; + } else { + args.unshift('TUNNEL:'); + } + console.error.apply(console, args); + } +} else { + debug = function() {}; +} +exports.debug = debug; // for test + + +/***/ }), + +/***/ 37414: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + + + +var ts = (() => { + var __defProp = Object.defineProperty; + var __getOwnPropNames = Object.getOwnPropertyNames; + var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; + }; + var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; + }; + var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); + }; + + // src/compiler/corePublic.ts + var versionMajorMinor, version, Comparison; + var init_corePublic = __esm({ + "src/compiler/corePublic.ts"() { + "use strict"; + versionMajorMinor = "5.4"; + version = "5.4.5"; + Comparison = /* @__PURE__ */ ((Comparison3) => { + Comparison3[Comparison3["LessThan"] = -1] = "LessThan"; + Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo"; + Comparison3[Comparison3["GreaterThan"] = 1] = "GreaterThan"; + return Comparison3; + })(Comparison || {}); + } + }); + + // src/compiler/core.ts + function length(array) { + return array ? array.length : 0; + } + function forEach(array, callback) { + if (array) { + for (let i = 0; i < array.length; i++) { + const result = callback(array[i], i); + if (result) { + return result; + } + } + } + return void 0; + } + function forEachRight(array, callback) { + if (array) { + for (let i = array.length - 1; i >= 0; i--) { + const result = callback(array[i], i); + if (result) { + return result; + } + } + } + return void 0; + } + function firstDefined(array, callback) { + if (array === void 0) { + return void 0; + } + for (let i = 0; i < array.length; i++) { + const result = callback(array[i], i); + if (result !== void 0) { + return result; + } + } + return void 0; + } + function firstDefinedIterator(iter, callback) { + for (const value of iter) { + const result = callback(value); + if (result !== void 0) { + return result; + } + } + return void 0; + } + function reduceLeftIterator(iterator, f, initial) { + let result = initial; + if (iterator) { + let pos = 0; + for (const value of iterator) { + result = f(result, value, pos); + pos++; + } + } + return result; + } + function zipWith(arrayA, arrayB, callback) { + const result = []; + Debug.assertEqual(arrayA.length, arrayB.length); + for (let i = 0; i < arrayA.length; i++) { + result.push(callback(arrayA[i], arrayB[i], i)); + } + return result; + } + function intersperse(input, element) { + if (input.length <= 1) { + return input; + } + const result = []; + for (let i = 0, n = input.length; i < n; i++) { + if (i) + result.push(element); + result.push(input[i]); + } + return result; + } + function every(array, callback) { + if (array) { + for (let i = 0; i < array.length; i++) { + if (!callback(array[i], i)) { + return false; + } + } + } + return true; + } + function find(array, predicate, startIndex) { + if (array === void 0) + return void 0; + for (let i = startIndex ?? 0; i < array.length; i++) { + const value = array[i]; + if (predicate(value, i)) { + return value; + } + } + return void 0; + } + function findLast(array, predicate, startIndex) { + if (array === void 0) + return void 0; + for (let i = startIndex ?? array.length - 1; i >= 0; i--) { + const value = array[i]; + if (predicate(value, i)) { + return value; + } + } + return void 0; + } + function findIndex(array, predicate, startIndex) { + if (array === void 0) + return -1; + for (let i = startIndex ?? 0; i < array.length; i++) { + if (predicate(array[i], i)) { + return i; + } + } + return -1; + } + function findLastIndex(array, predicate, startIndex) { + if (array === void 0) + return -1; + for (let i = startIndex ?? array.length - 1; i >= 0; i--) { + if (predicate(array[i], i)) { + return i; + } + } + return -1; + } + function findMap(array, callback) { + for (let i = 0; i < array.length; i++) { + const result = callback(array[i], i); + if (result) { + return result; + } + } + return Debug.fail(); + } + function contains(array, value, equalityComparer = equateValues) { + if (array) { + for (const v of array) { + if (equalityComparer(v, value)) { + return true; + } + } + } + return false; + } + function arraysEqual(a, b, equalityComparer = equateValues) { + return a.length === b.length && a.every((x, i) => equalityComparer(x, b[i])); + } + function indexOfAnyCharCode(text, charCodes, start) { + for (let i = start || 0; i < text.length; i++) { + if (contains(charCodes, text.charCodeAt(i))) { + return i; + } + } + return -1; + } + function countWhere(array, predicate) { + let count = 0; + if (array) { + for (let i = 0; i < array.length; i++) { + const v = array[i]; + if (predicate(v, i)) { + count++; + } + } + } + return count; + } + function filter(array, f) { + if (array) { + const len = array.length; + let i = 0; + while (i < len && f(array[i])) + i++; + if (i < len) { + const result = array.slice(0, i); + i++; + while (i < len) { + const item = array[i]; + if (f(item)) { + result.push(item); + } + i++; + } + return result; + } + } + return array; + } + function filterMutate(array, f) { + let outIndex = 0; + for (let i = 0; i < array.length; i++) { + if (f(array[i], i, array)) { + array[outIndex] = array[i]; + outIndex++; + } + } + array.length = outIndex; + } + function clear(array) { + array.length = 0; + } + function map(array, f) { + let result; + if (array) { + result = []; + for (let i = 0; i < array.length; i++) { + result.push(f(array[i], i)); + } + } + return result; + } + function* mapIterator(iter, mapFn) { + for (const x of iter) { + yield mapFn(x); + } + } + function sameMap(array, f) { + if (array) { + for (let i = 0; i < array.length; i++) { + const item = array[i]; + const mapped = f(item, i); + if (item !== mapped) { + const result = array.slice(0, i); + result.push(mapped); + for (i++; i < array.length; i++) { + result.push(f(array[i], i)); + } + return result; + } + } + } + return array; + } + function flatten(array) { + const result = []; + for (const v of array) { + if (v) { + if (isArray(v)) { + addRange(result, v); + } else { + result.push(v); + } + } + } + return result; + } + function flatMap(array, mapfn) { + let result; + if (array) { + for (let i = 0; i < array.length; i++) { + const v = mapfn(array[i], i); + if (v) { + if (isArray(v)) { + result = addRange(result, v); + } else { + result = append(result, v); + } + } + } + } + return result || emptyArray; + } + function flatMapToMutable(array, mapfn) { + const result = []; + if (array) { + for (let i = 0; i < array.length; i++) { + const v = mapfn(array[i], i); + if (v) { + if (isArray(v)) { + addRange(result, v); + } else { + result.push(v); + } + } + } + } + return result; + } + function* flatMapIterator(iter, mapfn) { + for (const x of iter) { + const iter2 = mapfn(x); + if (!iter2) + continue; + yield* iter2; + } + } + function sameFlatMap(array, mapfn) { + let result; + if (array) { + for (let i = 0; i < array.length; i++) { + const item = array[i]; + const mapped = mapfn(item, i); + if (result || item !== mapped || isArray(mapped)) { + if (!result) { + result = array.slice(0, i); + } + if (isArray(mapped)) { + addRange(result, mapped); + } else { + result.push(mapped); + } + } + } + } + return result || array; + } + function mapAllOrFail(array, mapFn) { + const result = []; + for (let i = 0; i < array.length; i++) { + const mapped = mapFn(array[i], i); + if (mapped === void 0) { + return void 0; + } + result.push(mapped); + } + return result; + } + function mapDefined(array, mapFn) { + const result = []; + if (array) { + for (let i = 0; i < array.length; i++) { + const mapped = mapFn(array[i], i); + if (mapped !== void 0) { + result.push(mapped); + } + } + } + return result; + } + function* mapDefinedIterator(iter, mapFn) { + for (const x of iter) { + const value = mapFn(x); + if (value !== void 0) { + yield value; + } + } + } + function mapDefinedEntries(map2, f) { + if (!map2) { + return void 0; + } + const result = /* @__PURE__ */ new Map(); + map2.forEach((value, key) => { + const entry = f(key, value); + if (entry !== void 0) { + const [newKey, newValue] = entry; + if (newKey !== void 0 && newValue !== void 0) { + result.set(newKey, newValue); + } + } + }); + return result; + } + function getOrUpdate(map2, key, callback) { + if (map2.has(key)) { + return map2.get(key); + } + const value = callback(); + map2.set(key, value); + return value; + } + function tryAddToSet(set, value) { + if (!set.has(value)) { + set.add(value); + return true; + } + return false; + } + function* singleIterator(value) { + yield value; + } + function spanMap(array, keyfn, mapfn) { + let result; + if (array) { + result = []; + const len = array.length; + let previousKey; + let key; + let start = 0; + let pos = 0; + while (start < len) { + while (pos < len) { + const value = array[pos]; + key = keyfn(value, pos); + if (pos === 0) { + previousKey = key; + } else if (key !== previousKey) { + break; + } + pos++; + } + if (start < pos) { + const v = mapfn(array.slice(start, pos), previousKey, start, pos); + if (v) { + result.push(v); + } + start = pos; + } + previousKey = key; + pos++; + } + } + return result; + } + function mapEntries(map2, f) { + if (!map2) { + return void 0; + } + const result = /* @__PURE__ */ new Map(); + map2.forEach((value, key) => { + const [newKey, newValue] = f(key, value); + result.set(newKey, newValue); + }); + return result; + } + function some(array, predicate) { + if (array) { + if (predicate) { + for (const v of array) { + if (predicate(v)) { + return true; + } + } + } else { + return array.length > 0; + } + } + return false; + } + function getRangesWhere(arr, pred, cb) { + let start; + for (let i = 0; i < arr.length; i++) { + if (pred(arr[i])) { + start = start === void 0 ? i : start; + } else { + if (start !== void 0) { + cb(start, i); + start = void 0; + } + } + } + if (start !== void 0) + cb(start, arr.length); + } + function concatenate(array1, array2) { + if (!some(array2)) + return array1; + if (!some(array1)) + return array2; + return [...array1, ...array2]; + } + function selectIndex(_, i) { + return i; + } + function indicesOf(array) { + return array.map(selectIndex); + } + function deduplicateRelational(array, equalityComparer, comparer) { + const indices = indicesOf(array); + stableSortIndices(array, indices, comparer); + let last2 = array[indices[0]]; + const deduplicated = [indices[0]]; + for (let i = 1; i < indices.length; i++) { + const index = indices[i]; + const item = array[index]; + if (!equalityComparer(last2, item)) { + deduplicated.push(index); + last2 = item; + } + } + deduplicated.sort(); + return deduplicated.map((i) => array[i]); + } + function deduplicateEquality(array, equalityComparer) { + const result = []; + for (const item of array) { + pushIfUnique(result, item, equalityComparer); + } + return result; + } + function deduplicate(array, equalityComparer, comparer) { + return array.length === 0 ? [] : array.length === 1 ? array.slice() : comparer ? deduplicateRelational(array, equalityComparer, comparer) : deduplicateEquality(array, equalityComparer); + } + function deduplicateSorted(array, comparer) { + if (array.length === 0) + return emptyArray; + let last2 = array[0]; + const deduplicated = [last2]; + for (let i = 1; i < array.length; i++) { + const next = array[i]; + switch (comparer(next, last2)) { + case true: + case 0 /* EqualTo */: + continue; + case -1 /* LessThan */: + return Debug.fail("Array is unsorted."); + } + deduplicated.push(last2 = next); + } + return deduplicated; + } + function createSortedArray() { + return []; + } + function insertSorted(array, insert, compare, allowDuplicates) { + if (array.length === 0) { + array.push(insert); + return true; + } + const insertIndex = binarySearch(array, insert, identity, compare); + if (insertIndex < 0) { + array.splice(~insertIndex, 0, insert); + return true; + } + if (allowDuplicates) { + array.splice(insertIndex, 0, insert); + return true; + } + return false; + } + function sortAndDeduplicate(array, comparer, equalityComparer) { + return deduplicateSorted(sort(array, comparer), equalityComparer || comparer || compareStringsCaseSensitive); + } + function arrayIsSorted(array, comparer) { + if (array.length < 2) + return true; + for (let i = 1, len = array.length; i < len; i++) { + if (comparer(array[i - 1], array[i]) === 1 /* GreaterThan */) { + return false; + } + } + return true; + } + function detectSortCaseSensitivity(array, getString, compareStringsCaseSensitive2, compareStringsCaseInsensitive2) { + let kind = 3 /* Both */; + if (array.length < 2) + return kind; + let prevElement = getString(array[0]); + for (let i = 1, len = array.length; i < len && kind !== 0 /* None */; i++) { + const element = getString(array[i]); + if (kind & 1 /* CaseSensitive */ && compareStringsCaseSensitive2(prevElement, element) > 0) { + kind &= ~1 /* CaseSensitive */; + } + if (kind & 2 /* CaseInsensitive */ && compareStringsCaseInsensitive2(prevElement, element) > 0) { + kind &= ~2 /* CaseInsensitive */; + } + prevElement = element; + } + return kind; + } + function arrayIsEqualTo(array1, array2, equalityComparer = equateValues) { + if (!array1 || !array2) { + return array1 === array2; + } + if (array1.length !== array2.length) { + return false; + } + for (let i = 0; i < array1.length; i++) { + if (!equalityComparer(array1[i], array2[i], i)) { + return false; + } + } + return true; + } + function compact(array) { + let result; + if (array) { + for (let i = 0; i < array.length; i++) { + const v = array[i]; + if (result || !v) { + if (!result) { + result = array.slice(0, i); + } + if (v) { + result.push(v); + } + } + } + } + return result || array; + } + function relativeComplement(arrayA, arrayB, comparer) { + if (!arrayB || !arrayA || arrayB.length === 0 || arrayA.length === 0) + return arrayB; + const result = []; + loopB: + for (let offsetA = 0, offsetB = 0; offsetB < arrayB.length; offsetB++) { + if (offsetB > 0) { + Debug.assertGreaterThanOrEqual(comparer(arrayB[offsetB], arrayB[offsetB - 1]), 0 /* EqualTo */); + } + loopA: + for (const startA = offsetA; offsetA < arrayA.length; offsetA++) { + if (offsetA > startA) { + Debug.assertGreaterThanOrEqual(comparer(arrayA[offsetA], arrayA[offsetA - 1]), 0 /* EqualTo */); + } + switch (comparer(arrayB[offsetB], arrayA[offsetA])) { + case -1 /* LessThan */: + result.push(arrayB[offsetB]); + continue loopB; + case 0 /* EqualTo */: + continue loopB; + case 1 /* GreaterThan */: + continue loopA; + } + } + } + return result; + } + function append(to, value) { + if (value === void 0) + return to; + if (to === void 0) + return [value]; + to.push(value); + return to; + } + function combine(xs, ys) { + if (xs === void 0) + return ys; + if (ys === void 0) + return xs; + if (isArray(xs)) + return isArray(ys) ? concatenate(xs, ys) : append(xs, ys); + if (isArray(ys)) + return append(ys, xs); + return [xs, ys]; + } + function toOffset(array, offset) { + return offset < 0 ? array.length + offset : offset; + } + function addRange(to, from, start, end) { + if (from === void 0 || from.length === 0) + return to; + if (to === void 0) + return from.slice(start, end); + start = start === void 0 ? 0 : toOffset(from, start); + end = end === void 0 ? from.length : toOffset(from, end); + for (let i = start; i < end && i < from.length; i++) { + if (from[i] !== void 0) { + to.push(from[i]); + } + } + return to; + } + function pushIfUnique(array, toAdd, equalityComparer) { + if (contains(array, toAdd, equalityComparer)) { + return false; + } else { + array.push(toAdd); + return true; + } + } + function appendIfUnique(array, toAdd, equalityComparer) { + if (array) { + pushIfUnique(array, toAdd, equalityComparer); + return array; + } else { + return [toAdd]; + } + } + function stableSortIndices(array, indices, comparer) { + indices.sort((x, y) => comparer(array[x], array[y]) || compareValues(x, y)); + } + function sort(array, comparer) { + return array.length === 0 ? array : array.slice().sort(comparer); + } + function* arrayReverseIterator(array) { + for (let i = array.length - 1; i >= 0; i--) { + yield array[i]; + } + } + function stableSort(array, comparer) { + const indices = indicesOf(array); + stableSortIndices(array, indices, comparer); + return indices.map((i) => array[i]); + } + function rangeEquals(array1, array2, pos, end) { + while (pos < end) { + if (array1[pos] !== array2[pos]) { + return false; + } + pos++; + } + return true; + } + function firstOrUndefined(array) { + return array === void 0 || array.length === 0 ? void 0 : array[0]; + } + function firstOrUndefinedIterator(iter) { + if (iter) { + for (const value of iter) { + return value; + } + } + return void 0; + } + function first(array) { + Debug.assert(array.length !== 0); + return array[0]; + } + function firstIterator(iter) { + for (const value of iter) { + return value; + } + Debug.fail("iterator is empty"); + } + function lastOrUndefined(array) { + return array === void 0 || array.length === 0 ? void 0 : array[array.length - 1]; + } + function last(array) { + Debug.assert(array.length !== 0); + return array[array.length - 1]; + } + function singleOrUndefined(array) { + return array && array.length === 1 ? array[0] : void 0; + } + function single(array) { + return Debug.checkDefined(singleOrUndefined(array)); + } + function singleOrMany(array) { + return array && array.length === 1 ? array[0] : array; + } + function replaceElement(array, index, value) { + const result = array.slice(0); + result[index] = value; + return result; + } + function binarySearch(array, value, keySelector, keyComparer, offset) { + return binarySearchKey(array, keySelector(value), keySelector, keyComparer, offset); + } + function binarySearchKey(array, key, keySelector, keyComparer, offset) { + if (!some(array)) { + return -1; + } + let low = offset || 0; + let high = array.length - 1; + while (low <= high) { + const middle = low + (high - low >> 1); + const midKey = keySelector(array[middle], middle); + switch (keyComparer(midKey, key)) { + case -1 /* LessThan */: + low = middle + 1; + break; + case 0 /* EqualTo */: + return middle; + case 1 /* GreaterThan */: + high = middle - 1; + break; + } + } + return ~low; + } + function reduceLeft(array, f, initial, start, count) { + if (array && array.length > 0) { + const size = array.length; + if (size > 0) { + let pos = start === void 0 || start < 0 ? 0 : start; + const end = count === void 0 || pos + count > size - 1 ? size - 1 : pos + count; + let result; + if (arguments.length <= 2) { + result = array[pos]; + pos++; + } else { + result = initial; + } + while (pos <= end) { + result = f(result, array[pos], pos); + pos++; + } + return result; + } + } + return initial; + } + function hasProperty(map2, key) { + return hasOwnProperty.call(map2, key); + } + function getProperty(map2, key) { + return hasOwnProperty.call(map2, key) ? map2[key] : void 0; + } + function getOwnKeys(map2) { + const keys = []; + for (const key in map2) { + if (hasOwnProperty.call(map2, key)) { + keys.push(key); + } + } + return keys; + } + function getAllKeys(obj) { + const result = []; + do { + const names = Object.getOwnPropertyNames(obj); + for (const name of names) { + pushIfUnique(result, name); + } + } while (obj = Object.getPrototypeOf(obj)); + return result; + } + function getOwnValues(collection) { + const values = []; + for (const key in collection) { + if (hasOwnProperty.call(collection, key)) { + values.push(collection[key]); + } + } + return values; + } + function arrayOf(count, f) { + const result = new Array(count); + for (let i = 0; i < count; i++) { + result[i] = f(i); + } + return result; + } + function arrayFrom(iterator, map2) { + const result = []; + for (const value of iterator) { + result.push(map2 ? map2(value) : value); + } + return result; + } + function assign(t, ...args) { + for (const arg of args) { + if (arg === void 0) + continue; + for (const p in arg) { + if (hasProperty(arg, p)) { + t[p] = arg[p]; + } + } + } + return t; + } + function equalOwnProperties(left, right, equalityComparer = equateValues) { + if (left === right) + return true; + if (!left || !right) + return false; + for (const key in left) { + if (hasOwnProperty.call(left, key)) { + if (!hasOwnProperty.call(right, key)) + return false; + if (!equalityComparer(left[key], right[key])) + return false; + } + } + for (const key in right) { + if (hasOwnProperty.call(right, key)) { + if (!hasOwnProperty.call(left, key)) + return false; + } + } + return true; + } + function arrayToMap(array, makeKey, makeValue = identity) { + const result = /* @__PURE__ */ new Map(); + for (const value of array) { + const key = makeKey(value); + if (key !== void 0) + result.set(key, makeValue(value)); + } + return result; + } + function arrayToNumericMap(array, makeKey, makeValue = identity) { + const result = []; + for (const value of array) { + result[makeKey(value)] = makeValue(value); + } + return result; + } + function arrayToMultiMap(values, makeKey, makeValue = identity) { + const result = createMultiMap(); + for (const value of values) { + result.add(makeKey(value), makeValue(value)); + } + return result; + } + function group(values, getGroupId, resultSelector = identity) { + return arrayFrom(arrayToMultiMap(values, getGroupId).values(), resultSelector); + } + function groupBy(values, keySelector) { + const result = {}; + if (values) { + for (const value of values) { + const key = `${keySelector(value)}`; + const array = result[key] ?? (result[key] = []); + array.push(value); + } + } + return result; + } + function clone(object) { + const result = {}; + for (const id in object) { + if (hasOwnProperty.call(object, id)) { + result[id] = object[id]; + } + } + return result; + } + function extend(first2, second) { + const result = {}; + for (const id in second) { + if (hasOwnProperty.call(second, id)) { + result[id] = second[id]; + } + } + for (const id in first2) { + if (hasOwnProperty.call(first2, id)) { + result[id] = first2[id]; + } + } + return result; + } + function copyProperties(first2, second) { + for (const id in second) { + if (hasOwnProperty.call(second, id)) { + first2[id] = second[id]; + } + } + } + function maybeBind(obj, fn) { + return fn ? fn.bind(obj) : void 0; + } + function createMultiMap() { + const map2 = /* @__PURE__ */ new Map(); + map2.add = multiMapAdd; + map2.remove = multiMapRemove; + return map2; + } + function multiMapAdd(key, value) { + let values = this.get(key); + if (values) { + values.push(value); + } else { + this.set(key, values = [value]); + } + return values; + } + function multiMapRemove(key, value) { + const values = this.get(key); + if (values) { + unorderedRemoveItem(values, value); + if (!values.length) { + this.delete(key); + } + } + } + function createQueue(items) { + const elements = (items == null ? void 0 : items.slice()) || []; + let headIndex = 0; + function isEmpty() { + return headIndex === elements.length; + } + function enqueue(...items2) { + elements.push(...items2); + } + function dequeue() { + if (isEmpty()) { + throw new Error("Queue is empty"); + } + const result = elements[headIndex]; + elements[headIndex] = void 0; + headIndex++; + if (headIndex > 100 && headIndex > elements.length >> 1) { + const newLength = elements.length - headIndex; + elements.copyWithin( + /*target*/ + 0, + /*start*/ + headIndex + ); + elements.length = newLength; + headIndex = 0; + } + return result; + } + return { + enqueue, + dequeue, + isEmpty + }; + } + function createSet(getHashCode, equals) { + const multiMap = /* @__PURE__ */ new Map(); + let size = 0; + function* getElementIterator() { + for (const value of multiMap.values()) { + if (isArray(value)) { + yield* value; + } else { + yield value; + } + } + } + const set = { + has(element) { + const hash = getHashCode(element); + if (!multiMap.has(hash)) + return false; + const candidates = multiMap.get(hash); + if (!isArray(candidates)) + return equals(candidates, element); + for (const candidate of candidates) { + if (equals(candidate, element)) { + return true; + } + } + return false; + }, + add(element) { + const hash = getHashCode(element); + if (multiMap.has(hash)) { + const values = multiMap.get(hash); + if (isArray(values)) { + if (!contains(values, element, equals)) { + values.push(element); + size++; + } + } else { + const value = values; + if (!equals(value, element)) { + multiMap.set(hash, [value, element]); + size++; + } + } + } else { + multiMap.set(hash, element); + size++; + } + return this; + }, + delete(element) { + const hash = getHashCode(element); + if (!multiMap.has(hash)) + return false; + const candidates = multiMap.get(hash); + if (isArray(candidates)) { + for (let i = 0; i < candidates.length; i++) { + if (equals(candidates[i], element)) { + if (candidates.length === 1) { + multiMap.delete(hash); + } else if (candidates.length === 2) { + multiMap.set(hash, candidates[1 - i]); + } else { + unorderedRemoveItemAt(candidates, i); + } + size--; + return true; + } + } + } else { + const candidate = candidates; + if (equals(candidate, element)) { + multiMap.delete(hash); + size--; + return true; + } + } + return false; + }, + clear() { + multiMap.clear(); + size = 0; + }, + get size() { + return size; + }, + forEach(action) { + for (const elements of arrayFrom(multiMap.values())) { + if (isArray(elements)) { + for (const element of elements) { + action(element, element, set); + } + } else { + const element = elements; + action(element, element, set); + } + } + }, + keys() { + return getElementIterator(); + }, + values() { + return getElementIterator(); + }, + *entries() { + for (const value of getElementIterator()) { + yield [value, value]; + } + }, + [Symbol.iterator]: () => { + return getElementIterator(); + }, + [Symbol.toStringTag]: multiMap[Symbol.toStringTag] + }; + return set; + } + function isArray(value) { + return Array.isArray(value); + } + function toArray(value) { + return isArray(value) ? value : [value]; + } + function isString(text) { + return typeof text === "string"; + } + function isNumber(x) { + return typeof x === "number"; + } + function tryCast(value, test) { + return value !== void 0 && test(value) ? value : void 0; + } + function cast(value, test) { + if (value !== void 0 && test(value)) + return value; + return Debug.fail(`Invalid cast. The supplied value ${value} did not pass the test '${Debug.getFunctionName(test)}'.`); + } + function noop(_) { + } + function returnFalse() { + return false; + } + function returnTrue() { + return true; + } + function returnUndefined() { + return void 0; + } + function identity(x) { + return x; + } + function toLowerCase(x) { + return x.toLowerCase(); + } + function toFileNameLowerCase(x) { + return fileNameLowerCaseRegExp.test(x) ? x.replace(fileNameLowerCaseRegExp, toLowerCase) : x; + } + function notImplemented() { + throw new Error("Not implemented"); + } + function memoize(callback) { + let value; + return () => { + if (callback) { + value = callback(); + callback = void 0; + } + return value; + }; + } + function memoizeOne(callback) { + const map2 = /* @__PURE__ */ new Map(); + return (arg) => { + const key = `${typeof arg}:${arg}`; + let value = map2.get(key); + if (value === void 0 && !map2.has(key)) { + value = callback(arg); + map2.set(key, value); + } + return value; + }; + } + function memoizeWeak(callback) { + const map2 = /* @__PURE__ */ new WeakMap(); + return (arg) => { + let value = map2.get(arg); + if (value === void 0 && !map2.has(arg)) { + value = callback(arg); + map2.set(arg, value); + } + return value; + }; + } + function memoizeCached(callback, cache) { + return (...args) => { + let value = cache.get(args); + if (value === void 0 && !cache.has(args)) { + value = callback(...args); + cache.set(args, value); + } + return value; + }; + } + function compose(a, b, c, d, e) { + if (!!e) { + const args = []; + for (let i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; + } + return (t) => reduceLeft(args, (u, f) => f(u), t); + } else if (d) { + return (t) => d(c(b(a(t)))); + } else if (c) { + return (t) => c(b(a(t))); + } else if (b) { + return (t) => b(a(t)); + } else if (a) { + return (t) => a(t); + } else { + return (t) => t; + } + } + function equateValues(a, b) { + return a === b; + } + function equateStringsCaseInsensitive(a, b) { + return a === b || a !== void 0 && b !== void 0 && a.toUpperCase() === b.toUpperCase(); + } + function equateStringsCaseSensitive(a, b) { + return equateValues(a, b); + } + function compareComparableValues(a, b) { + return a === b ? 0 /* EqualTo */ : a === void 0 ? -1 /* LessThan */ : b === void 0 ? 1 /* GreaterThan */ : a < b ? -1 /* LessThan */ : 1 /* GreaterThan */; + } + function compareValues(a, b) { + return compareComparableValues(a, b); + } + function compareTextSpans(a, b) { + return compareValues(a == null ? void 0 : a.start, b == null ? void 0 : b.start) || compareValues(a == null ? void 0 : a.length, b == null ? void 0 : b.length); + } + function min(items, compare) { + return reduceLeft(items, (x, y) => compare(x, y) === -1 /* LessThan */ ? x : y); + } + function compareStringsCaseInsensitive(a, b) { + if (a === b) + return 0 /* EqualTo */; + if (a === void 0) + return -1 /* LessThan */; + if (b === void 0) + return 1 /* GreaterThan */; + a = a.toUpperCase(); + b = b.toUpperCase(); + return a < b ? -1 /* LessThan */ : a > b ? 1 /* GreaterThan */ : 0 /* EqualTo */; + } + function compareStringsCaseInsensitiveEslintCompatible(a, b) { + if (a === b) + return 0 /* EqualTo */; + if (a === void 0) + return -1 /* LessThan */; + if (b === void 0) + return 1 /* GreaterThan */; + a = a.toLowerCase(); + b = b.toLowerCase(); + return a < b ? -1 /* LessThan */ : a > b ? 1 /* GreaterThan */ : 0 /* EqualTo */; + } + function compareStringsCaseSensitive(a, b) { + return compareComparableValues(a, b); + } + function getStringComparer(ignoreCase) { + return ignoreCase ? compareStringsCaseInsensitive : compareStringsCaseSensitive; + } + function getUILocale() { + return uiLocale; + } + function setUILocale(value) { + if (uiLocale !== value) { + uiLocale = value; + uiComparerCaseSensitive = void 0; + } + } + function compareStringsCaseSensitiveUI(a, b) { + const comparer = uiComparerCaseSensitive || (uiComparerCaseSensitive = createUIStringComparer(uiLocale)); + return comparer(a, b); + } + function compareProperties(a, b, key, comparer) { + return a === b ? 0 /* EqualTo */ : a === void 0 ? -1 /* LessThan */ : b === void 0 ? 1 /* GreaterThan */ : comparer(a[key], b[key]); + } + function compareBooleans(a, b) { + return compareValues(a ? 1 : 0, b ? 1 : 0); + } + function getSpellingSuggestion(name, candidates, getName) { + const maximumLengthDifference = Math.max(2, Math.floor(name.length * 0.34)); + let bestDistance = Math.floor(name.length * 0.4) + 1; + let bestCandidate; + for (const candidate of candidates) { + const candidateName = getName(candidate); + if (candidateName !== void 0 && Math.abs(candidateName.length - name.length) <= maximumLengthDifference) { + if (candidateName === name) { + continue; + } + if (candidateName.length < 3 && candidateName.toLowerCase() !== name.toLowerCase()) { + continue; + } + const distance = levenshteinWithMax(name, candidateName, bestDistance - 0.1); + if (distance === void 0) { + continue; + } + Debug.assert(distance < bestDistance); + bestDistance = distance; + bestCandidate = candidate; + } + } + return bestCandidate; + } + function levenshteinWithMax(s1, s2, max) { + let previous = new Array(s2.length + 1); + let current = new Array(s2.length + 1); + const big = max + 0.01; + for (let i = 0; i <= s2.length; i++) { + previous[i] = i; + } + for (let i = 1; i <= s1.length; i++) { + const c1 = s1.charCodeAt(i - 1); + const minJ = Math.ceil(i > max ? i - max : 1); + const maxJ = Math.floor(s2.length > max + i ? max + i : s2.length); + current[0] = i; + let colMin = i; + for (let j = 1; j < minJ; j++) { + current[j] = big; + } + for (let j = minJ; j <= maxJ; j++) { + const substitutionDistance = s1[i - 1].toLowerCase() === s2[j - 1].toLowerCase() ? previous[j - 1] + 0.1 : previous[j - 1] + 2; + const dist = c1 === s2.charCodeAt(j - 1) ? previous[j - 1] : Math.min( + /*delete*/ + previous[j] + 1, + /*insert*/ + current[j - 1] + 1, + /*substitute*/ + substitutionDistance + ); + current[j] = dist; + colMin = Math.min(colMin, dist); + } + for (let j = maxJ + 1; j <= s2.length; j++) { + current[j] = big; + } + if (colMin > max) { + return void 0; + } + const temp = previous; + previous = current; + current = temp; + } + const res = previous[s2.length]; + return res > max ? void 0 : res; + } + function endsWith(str, suffix, ignoreCase) { + const expectedPos = str.length - suffix.length; + return expectedPos >= 0 && (ignoreCase ? equateStringsCaseInsensitive(str.slice(expectedPos), suffix) : str.indexOf(suffix, expectedPos) === expectedPos); + } + function removeSuffix(str, suffix) { + return endsWith(str, suffix) ? str.slice(0, str.length - suffix.length) : str; + } + function tryRemoveSuffix(str, suffix) { + return endsWith(str, suffix) ? str.slice(0, str.length - suffix.length) : void 0; + } + function removeMinAndVersionNumbers(fileName) { + let end = fileName.length; + for (let pos = end - 1; pos > 0; pos--) { + let ch = fileName.charCodeAt(pos); + if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) { + do { + --pos; + ch = fileName.charCodeAt(pos); + } while (pos > 0 && ch >= 48 /* _0 */ && ch <= 57 /* _9 */); + } else if (pos > 4 && (ch === 110 /* n */ || ch === 78 /* N */)) { + --pos; + ch = fileName.charCodeAt(pos); + if (ch !== 105 /* i */ && ch !== 73 /* I */) { + break; + } + --pos; + ch = fileName.charCodeAt(pos); + if (ch !== 109 /* m */ && ch !== 77 /* M */) { + break; + } + --pos; + ch = fileName.charCodeAt(pos); + } else { + break; + } + if (ch !== 45 /* minus */ && ch !== 46 /* dot */) { + break; + } + end = pos; + } + return end === fileName.length ? fileName : fileName.slice(0, end); + } + function orderedRemoveItem(array, item) { + for (let i = 0; i < array.length; i++) { + if (array[i] === item) { + orderedRemoveItemAt(array, i); + return true; + } + } + return false; + } + function orderedRemoveItemAt(array, index) { + for (let i = index; i < array.length - 1; i++) { + array[i] = array[i + 1]; + } + array.pop(); + } + function unorderedRemoveItemAt(array, index) { + array[index] = array[array.length - 1]; + array.pop(); + } + function unorderedRemoveItem(array, item) { + return unorderedRemoveFirstItemWhere(array, (element) => element === item); + } + function unorderedRemoveFirstItemWhere(array, predicate) { + for (let i = 0; i < array.length; i++) { + if (predicate(array[i])) { + unorderedRemoveItemAt(array, i); + return true; + } + } + return false; + } + function createGetCanonicalFileName(useCaseSensitiveFileNames2) { + return useCaseSensitiveFileNames2 ? identity : toFileNameLowerCase; + } + function patternText({ prefix, suffix }) { + return `${prefix}*${suffix}`; + } + function matchedText(pattern, candidate) { + Debug.assert(isPatternMatch(pattern, candidate)); + return candidate.substring(pattern.prefix.length, candidate.length - pattern.suffix.length); + } + function findBestPatternMatch(values, getPattern, candidate) { + let matchedValue; + let longestMatchPrefixLength = -1; + for (const v of values) { + const pattern = getPattern(v); + if (isPatternMatch(pattern, candidate) && pattern.prefix.length > longestMatchPrefixLength) { + longestMatchPrefixLength = pattern.prefix.length; + matchedValue = v; + } + } + return matchedValue; + } + function startsWith(str, prefix, ignoreCase) { + return ignoreCase ? equateStringsCaseInsensitive(str.slice(0, prefix.length), prefix) : str.lastIndexOf(prefix, 0) === 0; + } + function removePrefix(str, prefix) { + return startsWith(str, prefix) ? str.substr(prefix.length) : str; + } + function tryRemovePrefix(str, prefix, getCanonicalFileName = identity) { + return startsWith(getCanonicalFileName(str), getCanonicalFileName(prefix)) ? str.substring(prefix.length) : void 0; + } + function isPatternMatch({ prefix, suffix }, candidate) { + return candidate.length >= prefix.length + suffix.length && startsWith(candidate, prefix) && endsWith(candidate, suffix); + } + function and(f, g) { + return (arg) => f(arg) && g(arg); + } + function or(...fs) { + return (...args) => { + let lastResult; + for (const f of fs) { + lastResult = f(...args); + if (lastResult) { + return lastResult; + } + } + return lastResult; + }; + } + function not(fn) { + return (...args) => !fn(...args); + } + function assertType(_) { + } + function singleElementArray(t) { + return t === void 0 ? void 0 : [t]; + } + function enumerateInsertsAndDeletes(newItems, oldItems, comparer, inserted, deleted, unchanged) { + unchanged = unchanged || noop; + let newIndex = 0; + let oldIndex = 0; + const newLen = newItems.length; + const oldLen = oldItems.length; + let hasChanges = false; + while (newIndex < newLen && oldIndex < oldLen) { + const newItem = newItems[newIndex]; + const oldItem = oldItems[oldIndex]; + const compareResult = comparer(newItem, oldItem); + if (compareResult === -1 /* LessThan */) { + inserted(newItem); + newIndex++; + hasChanges = true; + } else if (compareResult === 1 /* GreaterThan */) { + deleted(oldItem); + oldIndex++; + hasChanges = true; + } else { + unchanged(oldItem, newItem); + newIndex++; + oldIndex++; + } + } + while (newIndex < newLen) { + inserted(newItems[newIndex++]); + hasChanges = true; + } + while (oldIndex < oldLen) { + deleted(oldItems[oldIndex++]); + hasChanges = true; + } + return hasChanges; + } + function cartesianProduct(arrays) { + const result = []; + cartesianProductWorker( + arrays, + result, + /*outer*/ + void 0, + 0 + ); + return result; + } + function cartesianProductWorker(arrays, result, outer, index) { + for (const element of arrays[index]) { + let inner; + if (outer) { + inner = outer.slice(); + inner.push(element); + } else { + inner = [element]; + } + if (index === arrays.length - 1) { + result.push(inner); + } else { + cartesianProductWorker(arrays, result, inner, index + 1); + } + } + } + function takeWhile(array, predicate) { + if (array) { + const len = array.length; + let index = 0; + while (index < len && predicate(array[index])) { + index++; + } + return array.slice(0, index); + } + } + function skipWhile(array, predicate) { + if (array) { + const len = array.length; + let index = 0; + while (index < len && predicate(array[index])) { + index++; + } + return array.slice(index); + } + } + function isNodeLikeSystem() { + return typeof process !== "undefined" && !!process.nextTick && !process.browser && "object" === "object"; + } + var emptyArray, emptyMap, emptySet, SortKind, elementAt, hasOwnProperty, fileNameLowerCaseRegExp, AssertionLevel, createUIStringComparer, uiComparerCaseSensitive, uiLocale; + var init_core = __esm({ + "src/compiler/core.ts"() { + "use strict"; + init_ts2(); + emptyArray = []; + emptyMap = /* @__PURE__ */ new Map(); + emptySet = /* @__PURE__ */ new Set(); + SortKind = /* @__PURE__ */ ((SortKind2) => { + SortKind2[SortKind2["None"] = 0] = "None"; + SortKind2[SortKind2["CaseSensitive"] = 1] = "CaseSensitive"; + SortKind2[SortKind2["CaseInsensitive"] = 2] = "CaseInsensitive"; + SortKind2[SortKind2["Both"] = 3] = "Both"; + return SortKind2; + })(SortKind || {}); + elementAt = !!Array.prototype.at ? (array, offset) => array == null ? void 0 : array.at(offset) : (array, offset) => { + if (array) { + offset = toOffset(array, offset); + if (offset < array.length) { + return array[offset]; + } + } + return void 0; + }; + hasOwnProperty = Object.prototype.hasOwnProperty; + fileNameLowerCaseRegExp = /[^\u0130\u0131\u00DFa-z0-9\\/:\-_. ]+/g; + AssertionLevel = /* @__PURE__ */ ((AssertionLevel2) => { + AssertionLevel2[AssertionLevel2["None"] = 0] = "None"; + AssertionLevel2[AssertionLevel2["Normal"] = 1] = "Normal"; + AssertionLevel2[AssertionLevel2["Aggressive"] = 2] = "Aggressive"; + AssertionLevel2[AssertionLevel2["VeryAggressive"] = 3] = "VeryAggressive"; + return AssertionLevel2; + })(AssertionLevel || {}); + createUIStringComparer = /* @__PURE__ */ (() => { + return createIntlCollatorStringComparer; + function compareWithCallback(a, b, comparer) { + if (a === b) + return 0 /* EqualTo */; + if (a === void 0) + return -1 /* LessThan */; + if (b === void 0) + return 1 /* GreaterThan */; + const value = comparer(a, b); + return value < 0 ? -1 /* LessThan */ : value > 0 ? 1 /* GreaterThan */ : 0 /* EqualTo */; + } + function createIntlCollatorStringComparer(locale) { + const comparer = new Intl.Collator(locale, { usage: "sort", sensitivity: "variant" }).compare; + return (a, b) => compareWithCallback(a, b, comparer); + } + })(); + } + }); + + // src/compiler/debug.ts + var LogLevel, Debug; + var init_debug = __esm({ + "src/compiler/debug.ts"() { + "use strict"; + init_ts2(); + init_ts2(); + LogLevel = /* @__PURE__ */ ((LogLevel3) => { + LogLevel3[LogLevel3["Off"] = 0] = "Off"; + LogLevel3[LogLevel3["Error"] = 1] = "Error"; + LogLevel3[LogLevel3["Warning"] = 2] = "Warning"; + LogLevel3[LogLevel3["Info"] = 3] = "Info"; + LogLevel3[LogLevel3["Verbose"] = 4] = "Verbose"; + return LogLevel3; + })(LogLevel || {}); + ((Debug2) => { + let currentAssertionLevel = 0 /* None */; + Debug2.currentLogLevel = 2 /* Warning */; + Debug2.isDebugging = false; + function shouldLog(level) { + return Debug2.currentLogLevel <= level; + } + Debug2.shouldLog = shouldLog; + function logMessage(level, s) { + if (Debug2.loggingHost && shouldLog(level)) { + Debug2.loggingHost.log(level, s); + } + } + function log(s) { + logMessage(3 /* Info */, s); + } + Debug2.log = log; + ((_log) => { + function error2(s) { + logMessage(1 /* Error */, s); + } + _log.error = error2; + function warn(s) { + logMessage(2 /* Warning */, s); + } + _log.warn = warn; + function log2(s) { + logMessage(3 /* Info */, s); + } + _log.log = log2; + function trace2(s) { + logMessage(4 /* Verbose */, s); + } + _log.trace = trace2; + })(log = Debug2.log || (Debug2.log = {})); + const assertionCache = {}; + function getAssertionLevel() { + return currentAssertionLevel; + } + Debug2.getAssertionLevel = getAssertionLevel; + function setAssertionLevel(level) { + const prevAssertionLevel = currentAssertionLevel; + currentAssertionLevel = level; + if (level > prevAssertionLevel) { + for (const key of getOwnKeys(assertionCache)) { + const cachedFunc = assertionCache[key]; + if (cachedFunc !== void 0 && Debug2[key] !== cachedFunc.assertion && level >= cachedFunc.level) { + Debug2[key] = cachedFunc; + assertionCache[key] = void 0; + } + } + } + } + Debug2.setAssertionLevel = setAssertionLevel; + function shouldAssert(level) { + return currentAssertionLevel >= level; + } + Debug2.shouldAssert = shouldAssert; + function shouldAssertFunction(level, name) { + if (!shouldAssert(level)) { + assertionCache[name] = { level, assertion: Debug2[name] }; + Debug2[name] = noop; + return false; + } + return true; + } + function fail(message, stackCrawlMark) { + debugger; + const e = new Error(message ? `Debug Failure. ${message}` : "Debug Failure."); + if (Error.captureStackTrace) { + Error.captureStackTrace(e, stackCrawlMark || fail); + } + throw e; + } + Debug2.fail = fail; + function failBadSyntaxKind(node, message, stackCrawlMark) { + return fail( + `${message || "Unexpected node."}\r +Node ${formatSyntaxKind(node.kind)} was unexpected.`, + stackCrawlMark || failBadSyntaxKind + ); + } + Debug2.failBadSyntaxKind = failBadSyntaxKind; + function assert(expression, message, verboseDebugInfo, stackCrawlMark) { + if (!expression) { + message = message ? `False expression: ${message}` : "False expression."; + if (verboseDebugInfo) { + message += "\r\nVerbose Debug Information: " + (typeof verboseDebugInfo === "string" ? verboseDebugInfo : verboseDebugInfo()); + } + fail(message, stackCrawlMark || assert); + } + } + Debug2.assert = assert; + function assertEqual(a, b, msg, msg2, stackCrawlMark) { + if (a !== b) { + const message = msg ? msg2 ? `${msg} ${msg2}` : msg : ""; + fail(`Expected ${a} === ${b}. ${message}`, stackCrawlMark || assertEqual); + } + } + Debug2.assertEqual = assertEqual; + function assertLessThan(a, b, msg, stackCrawlMark) { + if (a >= b) { + fail(`Expected ${a} < ${b}. ${msg || ""}`, stackCrawlMark || assertLessThan); + } + } + Debug2.assertLessThan = assertLessThan; + function assertLessThanOrEqual(a, b, stackCrawlMark) { + if (a > b) { + fail(`Expected ${a} <= ${b}`, stackCrawlMark || assertLessThanOrEqual); + } + } + Debug2.assertLessThanOrEqual = assertLessThanOrEqual; + function assertGreaterThanOrEqual(a, b, stackCrawlMark) { + if (a < b) { + fail(`Expected ${a} >= ${b}`, stackCrawlMark || assertGreaterThanOrEqual); + } + } + Debug2.assertGreaterThanOrEqual = assertGreaterThanOrEqual; + function assertIsDefined(value, message, stackCrawlMark) { + if (value === void 0 || value === null) { + fail(message, stackCrawlMark || assertIsDefined); + } + } + Debug2.assertIsDefined = assertIsDefined; + function checkDefined(value, message, stackCrawlMark) { + assertIsDefined(value, message, stackCrawlMark || checkDefined); + return value; + } + Debug2.checkDefined = checkDefined; + function assertEachIsDefined(value, message, stackCrawlMark) { + for (const v of value) { + assertIsDefined(v, message, stackCrawlMark || assertEachIsDefined); + } + } + Debug2.assertEachIsDefined = assertEachIsDefined; + function checkEachDefined(value, message, stackCrawlMark) { + assertEachIsDefined(value, message, stackCrawlMark || checkEachDefined); + return value; + } + Debug2.checkEachDefined = checkEachDefined; + function assertNever(member, message = "Illegal value:", stackCrawlMark) { + const detail = typeof member === "object" && hasProperty(member, "kind") && hasProperty(member, "pos") ? "SyntaxKind: " + formatSyntaxKind(member.kind) : JSON.stringify(member); + return fail(`${message} ${detail}`, stackCrawlMark || assertNever); + } + Debug2.assertNever = assertNever; + function assertEachNode(nodes, test, message, stackCrawlMark) { + if (shouldAssertFunction(1 /* Normal */, "assertEachNode")) { + assert( + test === void 0 || every(nodes, test), + message || "Unexpected node.", + () => `Node array did not pass test '${getFunctionName(test)}'.`, + stackCrawlMark || assertEachNode + ); + } + } + Debug2.assertEachNode = assertEachNode; + function assertNode(node, test, message, stackCrawlMark) { + if (shouldAssertFunction(1 /* Normal */, "assertNode")) { + assert( + node !== void 0 && (test === void 0 || test(node)), + message || "Unexpected node.", + () => `Node ${formatSyntaxKind(node == null ? void 0 : node.kind)} did not pass test '${getFunctionName(test)}'.`, + stackCrawlMark || assertNode + ); + } + } + Debug2.assertNode = assertNode; + function assertNotNode(node, test, message, stackCrawlMark) { + if (shouldAssertFunction(1 /* Normal */, "assertNotNode")) { + assert( + node === void 0 || test === void 0 || !test(node), + message || "Unexpected node.", + () => `Node ${formatSyntaxKind(node.kind)} should not have passed test '${getFunctionName(test)}'.`, + stackCrawlMark || assertNotNode + ); + } + } + Debug2.assertNotNode = assertNotNode; + function assertOptionalNode(node, test, message, stackCrawlMark) { + if (shouldAssertFunction(1 /* Normal */, "assertOptionalNode")) { + assert( + test === void 0 || node === void 0 || test(node), + message || "Unexpected node.", + () => `Node ${formatSyntaxKind(node == null ? void 0 : node.kind)} did not pass test '${getFunctionName(test)}'.`, + stackCrawlMark || assertOptionalNode + ); + } + } + Debug2.assertOptionalNode = assertOptionalNode; + function assertOptionalToken(node, kind, message, stackCrawlMark) { + if (shouldAssertFunction(1 /* Normal */, "assertOptionalToken")) { + assert( + kind === void 0 || node === void 0 || node.kind === kind, + message || "Unexpected node.", + () => `Node ${formatSyntaxKind(node == null ? void 0 : node.kind)} was not a '${formatSyntaxKind(kind)}' token.`, + stackCrawlMark || assertOptionalToken + ); + } + } + Debug2.assertOptionalToken = assertOptionalToken; + function assertMissingNode(node, message, stackCrawlMark) { + if (shouldAssertFunction(1 /* Normal */, "assertMissingNode")) { + assert( + node === void 0, + message || "Unexpected node.", + () => `Node ${formatSyntaxKind(node.kind)} was unexpected'.`, + stackCrawlMark || assertMissingNode + ); + } + } + Debug2.assertMissingNode = assertMissingNode; + function type(_value) { + } + Debug2.type = type; + function getFunctionName(func) { + if (typeof func !== "function") { + return ""; + } else if (hasProperty(func, "name")) { + return func.name; + } else { + const text = Function.prototype.toString.call(func); + const match = /^function\s+([\w$]+)\s*\(/.exec(text); + return match ? match[1] : ""; + } + } + Debug2.getFunctionName = getFunctionName; + function formatSymbol(symbol) { + return `{ name: ${unescapeLeadingUnderscores(symbol.escapedName)}; flags: ${formatSymbolFlags(symbol.flags)}; declarations: ${map(symbol.declarations, (node) => formatSyntaxKind(node.kind))} }`; + } + Debug2.formatSymbol = formatSymbol; + function formatEnum(value = 0, enumObject, isFlags) { + const members = getEnumMembers(enumObject); + if (value === 0) { + return members.length > 0 && members[0][0] === 0 ? members[0][1] : "0"; + } + if (isFlags) { + const result = []; + let remainingFlags = value; + for (const [enumValue, enumName] of members) { + if (enumValue > value) { + break; + } + if (enumValue !== 0 && enumValue & value) { + result.push(enumName); + remainingFlags &= ~enumValue; + } + } + if (remainingFlags === 0) { + return result.join("|"); + } + } else { + for (const [enumValue, enumName] of members) { + if (enumValue === value) { + return enumName; + } + } + } + return value.toString(); + } + Debug2.formatEnum = formatEnum; + const enumMemberCache = /* @__PURE__ */ new Map(); + function getEnumMembers(enumObject) { + const existing = enumMemberCache.get(enumObject); + if (existing) { + return existing; + } + const result = []; + for (const name in enumObject) { + const value = enumObject[name]; + if (typeof value === "number") { + result.push([value, name]); + } + } + const sorted = stableSort(result, (x, y) => compareValues(x[0], y[0])); + enumMemberCache.set(enumObject, sorted); + return sorted; + } + function formatSyntaxKind(kind) { + return formatEnum( + kind, + SyntaxKind, + /*isFlags*/ + false + ); + } + Debug2.formatSyntaxKind = formatSyntaxKind; + function formatSnippetKind(kind) { + return formatEnum( + kind, + SnippetKind, + /*isFlags*/ + false + ); + } + Debug2.formatSnippetKind = formatSnippetKind; + function formatScriptKind(kind) { + return formatEnum( + kind, + ScriptKind, + /*isFlags*/ + false + ); + } + Debug2.formatScriptKind = formatScriptKind; + function formatNodeFlags(flags) { + return formatEnum( + flags, + NodeFlags, + /*isFlags*/ + true + ); + } + Debug2.formatNodeFlags = formatNodeFlags; + function formatModifierFlags(flags) { + return formatEnum( + flags, + ModifierFlags, + /*isFlags*/ + true + ); + } + Debug2.formatModifierFlags = formatModifierFlags; + function formatTransformFlags(flags) { + return formatEnum( + flags, + TransformFlags, + /*isFlags*/ + true + ); + } + Debug2.formatTransformFlags = formatTransformFlags; + function formatEmitFlags(flags) { + return formatEnum( + flags, + EmitFlags, + /*isFlags*/ + true + ); + } + Debug2.formatEmitFlags = formatEmitFlags; + function formatSymbolFlags(flags) { + return formatEnum( + flags, + SymbolFlags, + /*isFlags*/ + true + ); + } + Debug2.formatSymbolFlags = formatSymbolFlags; + function formatTypeFlags(flags) { + return formatEnum( + flags, + TypeFlags, + /*isFlags*/ + true + ); + } + Debug2.formatTypeFlags = formatTypeFlags; + function formatSignatureFlags(flags) { + return formatEnum( + flags, + SignatureFlags, + /*isFlags*/ + true + ); + } + Debug2.formatSignatureFlags = formatSignatureFlags; + function formatObjectFlags(flags) { + return formatEnum( + flags, + ObjectFlags, + /*isFlags*/ + true + ); + } + Debug2.formatObjectFlags = formatObjectFlags; + function formatFlowFlags(flags) { + return formatEnum( + flags, + FlowFlags, + /*isFlags*/ + true + ); + } + Debug2.formatFlowFlags = formatFlowFlags; + function formatRelationComparisonResult(result) { + return formatEnum( + result, + RelationComparisonResult, + /*isFlags*/ + true + ); + } + Debug2.formatRelationComparisonResult = formatRelationComparisonResult; + function formatCheckMode(mode) { + return formatEnum( + mode, + CheckMode, + /*isFlags*/ + true + ); + } + Debug2.formatCheckMode = formatCheckMode; + function formatSignatureCheckMode(mode) { + return formatEnum( + mode, + SignatureCheckMode, + /*isFlags*/ + true + ); + } + Debug2.formatSignatureCheckMode = formatSignatureCheckMode; + function formatTypeFacts(facts) { + return formatEnum( + facts, + TypeFacts, + /*isFlags*/ + true + ); + } + Debug2.formatTypeFacts = formatTypeFacts; + let isDebugInfoEnabled = false; + let flowNodeProto; + function attachFlowNodeDebugInfoWorker(flowNode) { + if (!("__debugFlowFlags" in flowNode)) { + Object.defineProperties(flowNode, { + // for use with vscode-js-debug's new customDescriptionGenerator in launch.json + __tsDebuggerDisplay: { + value() { + const flowHeader = this.flags & 2 /* Start */ ? "FlowStart" : this.flags & 4 /* BranchLabel */ ? "FlowBranchLabel" : this.flags & 8 /* LoopLabel */ ? "FlowLoopLabel" : this.flags & 16 /* Assignment */ ? "FlowAssignment" : this.flags & 32 /* TrueCondition */ ? "FlowTrueCondition" : this.flags & 64 /* FalseCondition */ ? "FlowFalseCondition" : this.flags & 128 /* SwitchClause */ ? "FlowSwitchClause" : this.flags & 256 /* ArrayMutation */ ? "FlowArrayMutation" : this.flags & 512 /* Call */ ? "FlowCall" : this.flags & 1024 /* ReduceLabel */ ? "FlowReduceLabel" : this.flags & 1 /* Unreachable */ ? "FlowUnreachable" : "UnknownFlow"; + const remainingFlags = this.flags & ~(2048 /* Referenced */ - 1); + return `${flowHeader}${remainingFlags ? ` (${formatFlowFlags(remainingFlags)})` : ""}`; + } + }, + __debugFlowFlags: { + get() { + return formatEnum( + this.flags, + FlowFlags, + /*isFlags*/ + true + ); + } + }, + __debugToString: { + value() { + return formatControlFlowGraph(this); + } + } + }); + } + } + function attachFlowNodeDebugInfo(flowNode) { + if (isDebugInfoEnabled) { + if (typeof Object.setPrototypeOf === "function") { + if (!flowNodeProto) { + flowNodeProto = Object.create(Object.prototype); + attachFlowNodeDebugInfoWorker(flowNodeProto); + } + Object.setPrototypeOf(flowNode, flowNodeProto); + } else { + attachFlowNodeDebugInfoWorker(flowNode); + } + } + } + Debug2.attachFlowNodeDebugInfo = attachFlowNodeDebugInfo; + let nodeArrayProto; + function attachNodeArrayDebugInfoWorker(array) { + if (!("__tsDebuggerDisplay" in array)) { + Object.defineProperties(array, { + __tsDebuggerDisplay: { + value(defaultValue) { + defaultValue = String(defaultValue).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/, "]"); + return `NodeArray ${defaultValue}`; + } + } + }); + } + } + function attachNodeArrayDebugInfo(array) { + if (isDebugInfoEnabled) { + if (typeof Object.setPrototypeOf === "function") { + if (!nodeArrayProto) { + nodeArrayProto = Object.create(Array.prototype); + attachNodeArrayDebugInfoWorker(nodeArrayProto); + } + Object.setPrototypeOf(array, nodeArrayProto); + } else { + attachNodeArrayDebugInfoWorker(array); + } + } + } + Debug2.attachNodeArrayDebugInfo = attachNodeArrayDebugInfo; + function enableDebugInfo() { + if (isDebugInfoEnabled) + return; + const weakTypeTextMap = /* @__PURE__ */ new WeakMap(); + const weakNodeTextMap = /* @__PURE__ */ new WeakMap(); + Object.defineProperties(objectAllocator.getSymbolConstructor().prototype, { + // for use with vscode-js-debug's new customDescriptionGenerator in launch.json + __tsDebuggerDisplay: { + value() { + const symbolHeader = this.flags & 33554432 /* Transient */ ? "TransientSymbol" : "Symbol"; + const remainingSymbolFlags = this.flags & ~33554432 /* Transient */; + return `${symbolHeader} '${symbolName(this)}'${remainingSymbolFlags ? ` (${formatSymbolFlags(remainingSymbolFlags)})` : ""}`; + } + }, + __debugFlags: { + get() { + return formatSymbolFlags(this.flags); + } + } + }); + Object.defineProperties(objectAllocator.getTypeConstructor().prototype, { + // for use with vscode-js-debug's new customDescriptionGenerator in launch.json + __tsDebuggerDisplay: { + value() { + const typeHeader = this.flags & 67359327 /* Intrinsic */ ? `IntrinsicType ${this.intrinsicName}${this.debugIntrinsicName ? ` (${this.debugIntrinsicName})` : ""}` : this.flags & 98304 /* Nullable */ ? "NullableType" : this.flags & 384 /* StringOrNumberLiteral */ ? `LiteralType ${JSON.stringify(this.value)}` : this.flags & 2048 /* BigIntLiteral */ ? `LiteralType ${this.value.negative ? "-" : ""}${this.value.base10Value}n` : this.flags & 8192 /* UniqueESSymbol */ ? "UniqueESSymbolType" : this.flags & 32 /* Enum */ ? "EnumType" : this.flags & 1048576 /* Union */ ? "UnionType" : this.flags & 2097152 /* Intersection */ ? "IntersectionType" : this.flags & 4194304 /* Index */ ? "IndexType" : this.flags & 8388608 /* IndexedAccess */ ? "IndexedAccessType" : this.flags & 16777216 /* Conditional */ ? "ConditionalType" : this.flags & 33554432 /* Substitution */ ? "SubstitutionType" : this.flags & 262144 /* TypeParameter */ ? "TypeParameter" : this.flags & 524288 /* Object */ ? this.objectFlags & 3 /* ClassOrInterface */ ? "InterfaceType" : this.objectFlags & 4 /* Reference */ ? "TypeReference" : this.objectFlags & 8 /* Tuple */ ? "TupleType" : this.objectFlags & 16 /* Anonymous */ ? "AnonymousType" : this.objectFlags & 32 /* Mapped */ ? "MappedType" : this.objectFlags & 1024 /* ReverseMapped */ ? "ReverseMappedType" : this.objectFlags & 256 /* EvolvingArray */ ? "EvolvingArrayType" : "ObjectType" : "Type"; + const remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~1343 /* ObjectTypeKindMask */ : 0; + return `${typeHeader}${this.symbol ? ` '${symbolName(this.symbol)}'` : ""}${remainingObjectFlags ? ` (${formatObjectFlags(remainingObjectFlags)})` : ""}`; + } + }, + __debugFlags: { + get() { + return formatTypeFlags(this.flags); + } + }, + __debugObjectFlags: { + get() { + return this.flags & 524288 /* Object */ ? formatObjectFlags(this.objectFlags) : ""; + } + }, + __debugTypeToString: { + value() { + let text = weakTypeTextMap.get(this); + if (text === void 0) { + text = this.checker.typeToString(this); + weakTypeTextMap.set(this, text); + } + return text; + } + } + }); + Object.defineProperties(objectAllocator.getSignatureConstructor().prototype, { + __debugFlags: { + get() { + return formatSignatureFlags(this.flags); + } + }, + __debugSignatureToString: { + value() { + var _a; + return (_a = this.checker) == null ? void 0 : _a.signatureToString(this); + } + } + }); + const nodeConstructors = [ + objectAllocator.getNodeConstructor(), + objectAllocator.getIdentifierConstructor(), + objectAllocator.getTokenConstructor(), + objectAllocator.getSourceFileConstructor() + ]; + for (const ctor of nodeConstructors) { + if (!hasProperty(ctor.prototype, "__debugKind")) { + Object.defineProperties(ctor.prototype, { + // for use with vscode-js-debug's new customDescriptionGenerator in launch.json + __tsDebuggerDisplay: { + value() { + const nodeHeader = isGeneratedIdentifier(this) ? "GeneratedIdentifier" : isIdentifier(this) ? `Identifier '${idText(this)}'` : isPrivateIdentifier(this) ? `PrivateIdentifier '${idText(this)}'` : isStringLiteral(this) ? `StringLiteral ${JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...")}` : isNumericLiteral(this) ? `NumericLiteral ${this.text}` : isBigIntLiteral(this) ? `BigIntLiteral ${this.text}n` : isTypeParameterDeclaration(this) ? "TypeParameterDeclaration" : isParameter(this) ? "ParameterDeclaration" : isConstructorDeclaration(this) ? "ConstructorDeclaration" : isGetAccessorDeclaration(this) ? "GetAccessorDeclaration" : isSetAccessorDeclaration(this) ? "SetAccessorDeclaration" : isCallSignatureDeclaration(this) ? "CallSignatureDeclaration" : isConstructSignatureDeclaration(this) ? "ConstructSignatureDeclaration" : isIndexSignatureDeclaration(this) ? "IndexSignatureDeclaration" : isTypePredicateNode(this) ? "TypePredicateNode" : isTypeReferenceNode(this) ? "TypeReferenceNode" : isFunctionTypeNode(this) ? "FunctionTypeNode" : isConstructorTypeNode(this) ? "ConstructorTypeNode" : isTypeQueryNode(this) ? "TypeQueryNode" : isTypeLiteralNode(this) ? "TypeLiteralNode" : isArrayTypeNode(this) ? "ArrayTypeNode" : isTupleTypeNode(this) ? "TupleTypeNode" : isOptionalTypeNode(this) ? "OptionalTypeNode" : isRestTypeNode(this) ? "RestTypeNode" : isUnionTypeNode(this) ? "UnionTypeNode" : isIntersectionTypeNode(this) ? "IntersectionTypeNode" : isConditionalTypeNode(this) ? "ConditionalTypeNode" : isInferTypeNode(this) ? "InferTypeNode" : isParenthesizedTypeNode(this) ? "ParenthesizedTypeNode" : isThisTypeNode(this) ? "ThisTypeNode" : isTypeOperatorNode(this) ? "TypeOperatorNode" : isIndexedAccessTypeNode(this) ? "IndexedAccessTypeNode" : isMappedTypeNode(this) ? "MappedTypeNode" : isLiteralTypeNode(this) ? "LiteralTypeNode" : isNamedTupleMember(this) ? "NamedTupleMember" : isImportTypeNode(this) ? "ImportTypeNode" : formatSyntaxKind(this.kind); + return `${nodeHeader}${this.flags ? ` (${formatNodeFlags(this.flags)})` : ""}`; + } + }, + __debugKind: { + get() { + return formatSyntaxKind(this.kind); + } + }, + __debugNodeFlags: { + get() { + return formatNodeFlags(this.flags); + } + }, + __debugModifierFlags: { + get() { + return formatModifierFlags(getEffectiveModifierFlagsNoCache(this)); + } + }, + __debugTransformFlags: { + get() { + return formatTransformFlags(this.transformFlags); + } + }, + __debugIsParseTreeNode: { + get() { + return isParseTreeNode(this); + } + }, + __debugEmitFlags: { + get() { + return formatEmitFlags(getEmitFlags(this)); + } + }, + __debugGetText: { + value(includeTrivia) { + if (nodeIsSynthesized(this)) + return ""; + let text = weakNodeTextMap.get(this); + if (text === void 0) { + const parseNode = getParseTreeNode(this); + const sourceFile = parseNode && getSourceFileOfNode(parseNode); + text = sourceFile ? getSourceTextOfNodeFromSourceFile(sourceFile, parseNode, includeTrivia) : ""; + weakNodeTextMap.set(this, text); + } + return text; + } + } + }); + } + } + isDebugInfoEnabled = true; + } + Debug2.enableDebugInfo = enableDebugInfo; + function formatVariance(varianceFlags) { + const variance = varianceFlags & 7 /* VarianceMask */; + let result = variance === 0 /* Invariant */ ? "in out" : variance === 3 /* Bivariant */ ? "[bivariant]" : variance === 2 /* Contravariant */ ? "in" : variance === 1 /* Covariant */ ? "out" : variance === 4 /* Independent */ ? "[independent]" : ""; + if (varianceFlags & 8 /* Unmeasurable */) { + result += " (unmeasurable)"; + } else if (varianceFlags & 16 /* Unreliable */) { + result += " (unreliable)"; + } + return result; + } + Debug2.formatVariance = formatVariance; + class DebugTypeMapper { + __debugToString() { + var _a; + type(this); + switch (this.kind) { + case 3 /* Function */: + return ((_a = this.debugInfo) == null ? void 0 : _a.call(this)) || "(function mapper)"; + case 0 /* Simple */: + return `${this.source.__debugTypeToString()} -> ${this.target.__debugTypeToString()}`; + case 1 /* Array */: + return zipWith( + this.sources, + this.targets || map(this.sources, () => "any"), + (s, t) => `${s.__debugTypeToString()} -> ${typeof t === "string" ? t : t.__debugTypeToString()}` + ).join(", "); + case 2 /* Deferred */: + return zipWith( + this.sources, + this.targets, + (s, t) => `${s.__debugTypeToString()} -> ${t().__debugTypeToString()}` + ).join(", "); + case 5 /* Merged */: + case 4 /* Composite */: + return `m1: ${this.mapper1.__debugToString().split("\n").join("\n ")} +m2: ${this.mapper2.__debugToString().split("\n").join("\n ")}`; + default: + return assertNever(this); + } + } + } + Debug2.DebugTypeMapper = DebugTypeMapper; + function attachDebugPrototypeIfDebug(mapper) { + if (Debug2.isDebugging) { + return Object.setPrototypeOf(mapper, DebugTypeMapper.prototype); + } + return mapper; + } + Debug2.attachDebugPrototypeIfDebug = attachDebugPrototypeIfDebug; + function printControlFlowGraph(flowNode) { + return console.log(formatControlFlowGraph(flowNode)); + } + Debug2.printControlFlowGraph = printControlFlowGraph; + function formatControlFlowGraph(flowNode) { + let nextDebugFlowId = -1; + function getDebugFlowNodeId(f) { + if (!f.id) { + f.id = nextDebugFlowId; + nextDebugFlowId--; + } + return f.id; + } + let BoxCharacter; + ((BoxCharacter2) => { + BoxCharacter2["lr"] = "\u2500"; + BoxCharacter2["ud"] = "\u2502"; + BoxCharacter2["dr"] = "\u256D"; + BoxCharacter2["dl"] = "\u256E"; + BoxCharacter2["ul"] = "\u256F"; + BoxCharacter2["ur"] = "\u2570"; + BoxCharacter2["udr"] = "\u251C"; + BoxCharacter2["udl"] = "\u2524"; + BoxCharacter2["dlr"] = "\u252C"; + BoxCharacter2["ulr"] = "\u2534"; + BoxCharacter2["udlr"] = "\u256B"; + })(BoxCharacter || (BoxCharacter = {})); + let Connection; + ((Connection2) => { + Connection2[Connection2["None"] = 0] = "None"; + Connection2[Connection2["Up"] = 1] = "Up"; + Connection2[Connection2["Down"] = 2] = "Down"; + Connection2[Connection2["Left"] = 4] = "Left"; + Connection2[Connection2["Right"] = 8] = "Right"; + Connection2[Connection2["UpDown"] = 3] = "UpDown"; + Connection2[Connection2["LeftRight"] = 12] = "LeftRight"; + Connection2[Connection2["UpLeft"] = 5] = "UpLeft"; + Connection2[Connection2["UpRight"] = 9] = "UpRight"; + Connection2[Connection2["DownLeft"] = 6] = "DownLeft"; + Connection2[Connection2["DownRight"] = 10] = "DownRight"; + Connection2[Connection2["UpDownLeft"] = 7] = "UpDownLeft"; + Connection2[Connection2["UpDownRight"] = 11] = "UpDownRight"; + Connection2[Connection2["UpLeftRight"] = 13] = "UpLeftRight"; + Connection2[Connection2["DownLeftRight"] = 14] = "DownLeftRight"; + Connection2[Connection2["UpDownLeftRight"] = 15] = "UpDownLeftRight"; + Connection2[Connection2["NoChildren"] = 16] = "NoChildren"; + })(Connection || (Connection = {})); + const hasAntecedentFlags = 16 /* Assignment */ | 96 /* Condition */ | 128 /* SwitchClause */ | 256 /* ArrayMutation */ | 512 /* Call */ | 1024 /* ReduceLabel */; + const hasNodeFlags = 2 /* Start */ | 16 /* Assignment */ | 512 /* Call */ | 96 /* Condition */ | 256 /* ArrayMutation */; + const links = /* @__PURE__ */ Object.create( + /*o*/ + null + ); + const nodes = []; + const edges = []; + const root = buildGraphNode(flowNode, /* @__PURE__ */ new Set()); + for (const node of nodes) { + node.text = renderFlowNode(node.flowNode, node.circular); + computeLevel(node); + } + const height = computeHeight(root); + const columnWidths = computeColumnWidths(height); + computeLanes(root, 0); + return renderGraph(); + function isFlowSwitchClause(f) { + return !!(f.flags & 128 /* SwitchClause */); + } + function hasAntecedents(f) { + return !!(f.flags & 12 /* Label */) && !!f.antecedents; + } + function hasAntecedent(f) { + return !!(f.flags & hasAntecedentFlags); + } + function hasNode(f) { + return !!(f.flags & hasNodeFlags); + } + function getChildren(node) { + const children = []; + for (const edge of node.edges) { + if (edge.source === node) { + children.push(edge.target); + } + } + return children; + } + function getParents(node) { + const parents = []; + for (const edge of node.edges) { + if (edge.target === node) { + parents.push(edge.source); + } + } + return parents; + } + function buildGraphNode(flowNode2, seen) { + const id = getDebugFlowNodeId(flowNode2); + let graphNode = links[id]; + if (graphNode && seen.has(flowNode2)) { + graphNode.circular = true; + graphNode = { + id: -1, + flowNode: flowNode2, + edges: [], + text: "", + lane: -1, + endLane: -1, + level: -1, + circular: "circularity" + }; + nodes.push(graphNode); + return graphNode; + } + seen.add(flowNode2); + if (!graphNode) { + links[id] = graphNode = { id, flowNode: flowNode2, edges: [], text: "", lane: -1, endLane: -1, level: -1, circular: false }; + nodes.push(graphNode); + if (hasAntecedents(flowNode2)) { + for (const antecedent of flowNode2.antecedents) { + buildGraphEdge(graphNode, antecedent, seen); + } + } else if (hasAntecedent(flowNode2)) { + buildGraphEdge(graphNode, flowNode2.antecedent, seen); + } + } + seen.delete(flowNode2); + return graphNode; + } + function buildGraphEdge(source, antecedent, seen) { + const target = buildGraphNode(antecedent, seen); + const edge = { source, target }; + edges.push(edge); + source.edges.push(edge); + target.edges.push(edge); + } + function computeLevel(node) { + if (node.level !== -1) { + return node.level; + } + let level = 0; + for (const parent2 of getParents(node)) { + level = Math.max(level, computeLevel(parent2) + 1); + } + return node.level = level; + } + function computeHeight(node) { + let height2 = 0; + for (const child of getChildren(node)) { + height2 = Math.max(height2, computeHeight(child)); + } + return height2 + 1; + } + function computeColumnWidths(height2) { + const columns = fill(Array(height2), 0); + for (const node of nodes) { + columns[node.level] = Math.max(columns[node.level], node.text.length); + } + return columns; + } + function computeLanes(node, lane) { + if (node.lane === -1) { + node.lane = lane; + node.endLane = lane; + const children = getChildren(node); + for (let i = 0; i < children.length; i++) { + if (i > 0) + lane++; + const child = children[i]; + computeLanes(child, lane); + if (child.endLane > node.endLane) { + lane = child.endLane; + } + } + node.endLane = lane; + } + } + function getHeader(flags) { + if (flags & 2 /* Start */) + return "Start"; + if (flags & 4 /* BranchLabel */) + return "Branch"; + if (flags & 8 /* LoopLabel */) + return "Loop"; + if (flags & 16 /* Assignment */) + return "Assignment"; + if (flags & 32 /* TrueCondition */) + return "True"; + if (flags & 64 /* FalseCondition */) + return "False"; + if (flags & 128 /* SwitchClause */) + return "SwitchClause"; + if (flags & 256 /* ArrayMutation */) + return "ArrayMutation"; + if (flags & 512 /* Call */) + return "Call"; + if (flags & 1024 /* ReduceLabel */) + return "ReduceLabel"; + if (flags & 1 /* Unreachable */) + return "Unreachable"; + throw new Error(); + } + function getNodeText(node) { + const sourceFile = getSourceFileOfNode(node); + return getSourceTextOfNodeFromSourceFile( + sourceFile, + node, + /*includeTrivia*/ + false + ); + } + function renderFlowNode(flowNode2, circular) { + let text = getHeader(flowNode2.flags); + if (circular) { + text = `${text}#${getDebugFlowNodeId(flowNode2)}`; + } + if (hasNode(flowNode2)) { + if (flowNode2.node) { + text += ` (${getNodeText(flowNode2.node)})`; + } + } else if (isFlowSwitchClause(flowNode2)) { + const clauses = []; + for (let i = flowNode2.clauseStart; i < flowNode2.clauseEnd; i++) { + const clause = flowNode2.switchStatement.caseBlock.clauses[i]; + if (isDefaultClause(clause)) { + clauses.push("default"); + } else { + clauses.push(getNodeText(clause.expression)); + } + } + text += ` (${clauses.join(", ")})`; + } + return circular === "circularity" ? `Circular(${text})` : text; + } + function renderGraph() { + const columnCount = columnWidths.length; + const laneCount = nodes.reduce((x, n) => Math.max(x, n.lane), 0) + 1; + const lanes = fill(Array(laneCount), ""); + const grid = columnWidths.map(() => Array(laneCount)); + const connectors = columnWidths.map(() => fill(Array(laneCount), 0)); + for (const node of nodes) { + grid[node.level][node.lane] = node; + const children = getChildren(node); + for (let i = 0; i < children.length; i++) { + const child = children[i]; + let connector = 8 /* Right */; + if (child.lane === node.lane) + connector |= 4 /* Left */; + if (i > 0) + connector |= 1 /* Up */; + if (i < children.length - 1) + connector |= 2 /* Down */; + connectors[node.level][child.lane] |= connector; + } + if (children.length === 0) { + connectors[node.level][node.lane] |= 16 /* NoChildren */; + } + const parents = getParents(node); + for (let i = 0; i < parents.length; i++) { + const parent2 = parents[i]; + let connector = 4 /* Left */; + if (i > 0) + connector |= 1 /* Up */; + if (i < parents.length - 1) + connector |= 2 /* Down */; + connectors[node.level - 1][parent2.lane] |= connector; + } + } + for (let column = 0; column < columnCount; column++) { + for (let lane = 0; lane < laneCount; lane++) { + const left = column > 0 ? connectors[column - 1][lane] : 0; + const above = lane > 0 ? connectors[column][lane - 1] : 0; + let connector = connectors[column][lane]; + if (!connector) { + if (left & 8 /* Right */) + connector |= 12 /* LeftRight */; + if (above & 2 /* Down */) + connector |= 3 /* UpDown */; + connectors[column][lane] = connector; + } + } + } + for (let column = 0; column < columnCount; column++) { + for (let lane = 0; lane < lanes.length; lane++) { + const connector = connectors[column][lane]; + const fill2 = connector & 4 /* Left */ ? "\u2500" /* lr */ : " "; + const node = grid[column][lane]; + if (!node) { + if (column < columnCount - 1) { + writeLane(lane, repeat(fill2, columnWidths[column] + 1)); + } + } else { + writeLane(lane, node.text); + if (column < columnCount - 1) { + writeLane(lane, " "); + writeLane(lane, repeat(fill2, columnWidths[column] - node.text.length)); + } + } + writeLane(lane, getBoxCharacter(connector)); + writeLane(lane, connector & 8 /* Right */ && column < columnCount - 1 && !grid[column + 1][lane] ? "\u2500" /* lr */ : " "); + } + } + return ` +${lanes.join("\n")} +`; + function writeLane(lane, text) { + lanes[lane] += text; + } + } + function getBoxCharacter(connector) { + switch (connector) { + case 3 /* UpDown */: + return "\u2502" /* ud */; + case 12 /* LeftRight */: + return "\u2500" /* lr */; + case 5 /* UpLeft */: + return "\u256F" /* ul */; + case 9 /* UpRight */: + return "\u2570" /* ur */; + case 6 /* DownLeft */: + return "\u256E" /* dl */; + case 10 /* DownRight */: + return "\u256D" /* dr */; + case 7 /* UpDownLeft */: + return "\u2524" /* udl */; + case 11 /* UpDownRight */: + return "\u251C" /* udr */; + case 13 /* UpLeftRight */: + return "\u2534" /* ulr */; + case 14 /* DownLeftRight */: + return "\u252C" /* dlr */; + case 15 /* UpDownLeftRight */: + return "\u256B" /* udlr */; + } + return " "; + } + function fill(array, value) { + if (array.fill) { + array.fill(value); + } else { + for (let i = 0; i < array.length; i++) { + array[i] = value; + } + } + return array; + } + function repeat(ch, length2) { + if (ch.repeat) { + return length2 > 0 ? ch.repeat(length2) : ""; + } + let s = ""; + while (s.length < length2) { + s += ch; + } + return s; + } + } + Debug2.formatControlFlowGraph = formatControlFlowGraph; + })(Debug || (Debug = {})); + } + }); + + // src/compiler/semver.ts + function tryParseComponents(text) { + const match = versionRegExp.exec(text); + if (!match) + return void 0; + const [, major, minor = "0", patch = "0", prerelease = "", build2 = ""] = match; + if (prerelease && !prereleaseRegExp.test(prerelease)) + return void 0; + if (build2 && !buildRegExp.test(build2)) + return void 0; + return { + major: parseInt(major, 10), + minor: parseInt(minor, 10), + patch: parseInt(patch, 10), + prerelease, + build: build2 + }; + } + function comparePrereleaseIdentifiers(left, right) { + if (left === right) + return 0 /* EqualTo */; + if (left.length === 0) + return right.length === 0 ? 0 /* EqualTo */ : 1 /* GreaterThan */; + if (right.length === 0) + return -1 /* LessThan */; + const length2 = Math.min(left.length, right.length); + for (let i = 0; i < length2; i++) { + const leftIdentifier = left[i]; + const rightIdentifier = right[i]; + if (leftIdentifier === rightIdentifier) + continue; + const leftIsNumeric = numericIdentifierRegExp.test(leftIdentifier); + const rightIsNumeric = numericIdentifierRegExp.test(rightIdentifier); + if (leftIsNumeric || rightIsNumeric) { + if (leftIsNumeric !== rightIsNumeric) + return leftIsNumeric ? -1 /* LessThan */ : 1 /* GreaterThan */; + const result = compareValues(+leftIdentifier, +rightIdentifier); + if (result) + return result; + } else { + const result = compareStringsCaseSensitive(leftIdentifier, rightIdentifier); + if (result) + return result; + } + } + return compareValues(left.length, right.length); + } + function parseRange(text) { + const alternatives = []; + for (let range of text.trim().split(logicalOrRegExp)) { + if (!range) + continue; + const comparators = []; + range = range.trim(); + const match = hyphenRegExp.exec(range); + if (match) { + if (!parseHyphen(match[1], match[2], comparators)) + return void 0; + } else { + for (const simple of range.split(whitespaceRegExp)) { + const match2 = rangeRegExp.exec(simple.trim()); + if (!match2 || !parseComparator(match2[1], match2[2], comparators)) + return void 0; + } + } + alternatives.push(comparators); + } + return alternatives; + } + function parsePartial(text) { + const match = partialRegExp.exec(text); + if (!match) + return void 0; + const [, major, minor = "*", patch = "*", prerelease, build2] = match; + const version2 = new Version( + isWildcard(major) ? 0 : parseInt(major, 10), + isWildcard(major) || isWildcard(minor) ? 0 : parseInt(minor, 10), + isWildcard(major) || isWildcard(minor) || isWildcard(patch) ? 0 : parseInt(patch, 10), + prerelease, + build2 + ); + return { version: version2, major, minor, patch }; + } + function parseHyphen(left, right, comparators) { + const leftResult = parsePartial(left); + if (!leftResult) + return false; + const rightResult = parsePartial(right); + if (!rightResult) + return false; + if (!isWildcard(leftResult.major)) { + comparators.push(createComparator(">=", leftResult.version)); + } + if (!isWildcard(rightResult.major)) { + comparators.push( + isWildcard(rightResult.minor) ? createComparator("<", rightResult.version.increment("major")) : isWildcard(rightResult.patch) ? createComparator("<", rightResult.version.increment("minor")) : createComparator("<=", rightResult.version) + ); + } + return true; + } + function parseComparator(operator, text, comparators) { + const result = parsePartial(text); + if (!result) + return false; + const { version: version2, major, minor, patch } = result; + if (!isWildcard(major)) { + switch (operator) { + case "~": + comparators.push(createComparator(">=", version2)); + comparators.push(createComparator( + "<", + version2.increment( + isWildcard(minor) ? "major" : "minor" + ) + )); + break; + case "^": + comparators.push(createComparator(">=", version2)); + comparators.push(createComparator( + "<", + version2.increment( + version2.major > 0 || isWildcard(minor) ? "major" : version2.minor > 0 || isWildcard(patch) ? "minor" : "patch" + ) + )); + break; + case "<": + case ">=": + comparators.push( + isWildcard(minor) || isWildcard(patch) ? createComparator(operator, version2.with({ prerelease: "0" })) : createComparator(operator, version2) + ); + break; + case "<=": + case ">": + comparators.push( + isWildcard(minor) ? createComparator(operator === "<=" ? "<" : ">=", version2.increment("major").with({ prerelease: "0" })) : isWildcard(patch) ? createComparator(operator === "<=" ? "<" : ">=", version2.increment("minor").with({ prerelease: "0" })) : createComparator(operator, version2) + ); + break; + case "=": + case void 0: + if (isWildcard(minor) || isWildcard(patch)) { + comparators.push(createComparator(">=", version2.with({ prerelease: "0" }))); + comparators.push(createComparator("<", version2.increment(isWildcard(minor) ? "major" : "minor").with({ prerelease: "0" }))); + } else { + comparators.push(createComparator("=", version2)); + } + break; + default: + return false; + } + } else if (operator === "<" || operator === ">") { + comparators.push(createComparator("<", Version.zero)); + } + return true; + } + function isWildcard(part) { + return part === "*" || part === "x" || part === "X"; + } + function createComparator(operator, operand) { + return { operator, operand }; + } + function testDisjunction(version2, alternatives) { + if (alternatives.length === 0) + return true; + for (const alternative of alternatives) { + if (testAlternative(version2, alternative)) + return true; + } + return false; + } + function testAlternative(version2, comparators) { + for (const comparator of comparators) { + if (!testComparator(version2, comparator.operator, comparator.operand)) + return false; + } + return true; + } + function testComparator(version2, operator, operand) { + const cmp = version2.compareTo(operand); + switch (operator) { + case "<": + return cmp < 0; + case "<=": + return cmp <= 0; + case ">": + return cmp > 0; + case ">=": + return cmp >= 0; + case "=": + return cmp === 0; + default: + return Debug.assertNever(operator); + } + } + function formatDisjunction(alternatives) { + return map(alternatives, formatAlternative).join(" || ") || "*"; + } + function formatAlternative(comparators) { + return map(comparators, formatComparator).join(" "); + } + function formatComparator(comparator) { + return `${comparator.operator}${comparator.operand}`; + } + var versionRegExp, prereleaseRegExp, prereleasePartRegExp, buildRegExp, buildPartRegExp, numericIdentifierRegExp, _Version, Version, VersionRange, logicalOrRegExp, whitespaceRegExp, partialRegExp, hyphenRegExp, rangeRegExp; + var init_semver = __esm({ + "src/compiler/semver.ts"() { + "use strict"; + init_ts2(); + versionRegExp = /^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i; + prereleaseRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i; + prereleasePartRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)$/i; + buildRegExp = /^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i; + buildPartRegExp = /^[a-z0-9-]+$/i; + numericIdentifierRegExp = /^(0|[1-9]\d*)$/; + _Version = class _Version { + constructor(major, minor = 0, patch = 0, prerelease = "", build2 = "") { + if (typeof major === "string") { + const result = Debug.checkDefined(tryParseComponents(major), "Invalid version"); + ({ major, minor, patch, prerelease, build: build2 } = result); + } + Debug.assert(major >= 0, "Invalid argument: major"); + Debug.assert(minor >= 0, "Invalid argument: minor"); + Debug.assert(patch >= 0, "Invalid argument: patch"); + const prereleaseArray = prerelease ? isArray(prerelease) ? prerelease : prerelease.split(".") : emptyArray; + const buildArray = build2 ? isArray(build2) ? build2 : build2.split(".") : emptyArray; + Debug.assert(every(prereleaseArray, (s) => prereleasePartRegExp.test(s)), "Invalid argument: prerelease"); + Debug.assert(every(buildArray, (s) => buildPartRegExp.test(s)), "Invalid argument: build"); + this.major = major; + this.minor = minor; + this.patch = patch; + this.prerelease = prereleaseArray; + this.build = buildArray; + } + static tryParse(text) { + const result = tryParseComponents(text); + if (!result) + return void 0; + const { major, minor, patch, prerelease, build: build2 } = result; + return new _Version(major, minor, patch, prerelease, build2); + } + compareTo(other) { + if (this === other) + return 0 /* EqualTo */; + if (other === void 0) + return 1 /* GreaterThan */; + return compareValues(this.major, other.major) || compareValues(this.minor, other.minor) || compareValues(this.patch, other.patch) || comparePrereleaseIdentifiers(this.prerelease, other.prerelease); + } + increment(field) { + switch (field) { + case "major": + return new _Version(this.major + 1, 0, 0); + case "minor": + return new _Version(this.major, this.minor + 1, 0); + case "patch": + return new _Version(this.major, this.minor, this.patch + 1); + default: + return Debug.assertNever(field); + } + } + with(fields) { + const { + major = this.major, + minor = this.minor, + patch = this.patch, + prerelease = this.prerelease, + build: build2 = this.build + } = fields; + return new _Version(major, minor, patch, prerelease, build2); + } + toString() { + let result = `${this.major}.${this.minor}.${this.patch}`; + if (some(this.prerelease)) + result += `-${this.prerelease.join(".")}`; + if (some(this.build)) + result += `+${this.build.join(".")}`; + return result; + } + }; + _Version.zero = new _Version(0, 0, 0, ["0"]); + Version = _Version; + VersionRange = class _VersionRange { + constructor(spec) { + this._alternatives = spec ? Debug.checkDefined(parseRange(spec), "Invalid range spec.") : emptyArray; + } + static tryParse(text) { + const sets = parseRange(text); + if (sets) { + const range = new _VersionRange(""); + range._alternatives = sets; + return range; + } + return void 0; + } + /** + * Tests whether a version matches the range. This is equivalent to `satisfies(version, range, { includePrerelease: true })`. + * in `node-semver`. + */ + test(version2) { + if (typeof version2 === "string") + version2 = new Version(version2); + return testDisjunction(version2, this._alternatives); + } + toString() { + return formatDisjunction(this._alternatives); + } + }; + logicalOrRegExp = /\|\|/g; + whitespaceRegExp = /\s+/g; + partialRegExp = /^([xX*0]|[1-9]\d*)(?:\.([xX*0]|[1-9]\d*)(?:\.([xX*0]|[1-9]\d*)(?:-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i; + hyphenRegExp = /^\s*([a-z0-9-+.*]+)\s+-\s+([a-z0-9-+.*]+)\s*$/i; + rangeRegExp = /^(~|\^|<|<=|>|>=|=)?\s*([a-z0-9-+.*]+)$/i; + } + }); + + // src/compiler/performanceCore.ts + function hasRequiredAPI(performance2, PerformanceObserver2) { + return typeof performance2 === "object" && typeof performance2.timeOrigin === "number" && typeof performance2.mark === "function" && typeof performance2.measure === "function" && typeof performance2.now === "function" && typeof performance2.clearMarks === "function" && typeof performance2.clearMeasures === "function" && typeof PerformanceObserver2 === "function"; + } + function tryGetWebPerformanceHooks() { + if (typeof performance === "object" && typeof PerformanceObserver === "function" && hasRequiredAPI(performance, PerformanceObserver)) { + return { + // For now we always write native performance events when running in the browser. We may + // make this conditional in the future if we find that native web performance hooks + // in the browser also slow down compilation. + shouldWriteNativeEvents: true, + performance, + PerformanceObserver + }; + } + } + function tryGetNodePerformanceHooks() { + if (isNodeLikeSystem()) { + try { + const { performance: performance2, PerformanceObserver: PerformanceObserver2 } = __nccwpck_require__(4074); + if (hasRequiredAPI(performance2, PerformanceObserver2)) { + return { + // By default, only write native events when generating a cpu profile or using the v8 profiler. + shouldWriteNativeEvents: false, + performance: performance2, + PerformanceObserver: PerformanceObserver2 + }; + } + } catch { + } + } + } + function tryGetNativePerformanceHooks() { + return nativePerformanceHooks; + } + var nativePerformanceHooks, nativePerformance, timestamp; + var init_performanceCore = __esm({ + "src/compiler/performanceCore.ts"() { + "use strict"; + init_ts2(); + nativePerformanceHooks = tryGetWebPerformanceHooks() || tryGetNodePerformanceHooks(); + nativePerformance = nativePerformanceHooks == null ? void 0 : nativePerformanceHooks.performance; + timestamp = nativePerformance ? () => nativePerformance.now() : Date.now ? Date.now : () => +/* @__PURE__ */ new Date(); + } + }); + + // src/compiler/perfLogger.ts + var etwModule, perfLogger; + var init_perfLogger = __esm({ + "src/compiler/perfLogger.ts"() { + "use strict"; + try { + const etwModulePath = process.env.TS_ETW_MODULE_PATH ?? "./node_modules/@microsoft/typescript-etw"; + etwModule = require(etwModulePath); + } catch (e) { + etwModule = void 0; + } + perfLogger = (etwModule == null ? void 0 : etwModule.logEvent) ? etwModule : void 0; + } + }); + + // src/compiler/performance.ts + function createTimerIf(condition, measureName, startMarkName, endMarkName) { + return condition ? createTimer(measureName, startMarkName, endMarkName) : nullTimer; + } + function createTimer(measureName, startMarkName, endMarkName) { + let enterCount = 0; + return { + enter, + exit + }; + function enter() { + if (++enterCount === 1) { + mark(startMarkName); + } + } + function exit() { + if (--enterCount === 0) { + mark(endMarkName); + measure(measureName, startMarkName, endMarkName); + } else if (enterCount < 0) { + Debug.fail("enter/exit count does not match."); + } + } + } + function mark(markName) { + if (enabled) { + const count = counts.get(markName) ?? 0; + counts.set(markName, count + 1); + marks.set(markName, timestamp()); + performanceImpl == null ? void 0 : performanceImpl.mark(markName); + if (typeof onProfilerEvent === "function") { + onProfilerEvent(markName); + } + } + } + function measure(measureName, startMarkName, endMarkName) { + if (enabled) { + const end = (endMarkName !== void 0 ? marks.get(endMarkName) : void 0) ?? timestamp(); + const start = (startMarkName !== void 0 ? marks.get(startMarkName) : void 0) ?? timeorigin; + const previousDuration = durations.get(measureName) || 0; + durations.set(measureName, previousDuration + (end - start)); + performanceImpl == null ? void 0 : performanceImpl.measure(measureName, startMarkName, endMarkName); + } + } + function getCount(markName) { + return counts.get(markName) || 0; + } + function getDuration(measureName) { + return durations.get(measureName) || 0; + } + function forEachMeasure(cb) { + durations.forEach((duration, measureName) => cb(measureName, duration)); + } + function forEachMark(cb) { + marks.forEach((_time, markName) => cb(markName)); + } + function clearMeasures(name) { + if (name !== void 0) + durations.delete(name); + else + durations.clear(); + performanceImpl == null ? void 0 : performanceImpl.clearMeasures(name); + } + function clearMarks(name) { + if (name !== void 0) { + counts.delete(name); + marks.delete(name); + } else { + counts.clear(); + marks.clear(); + } + performanceImpl == null ? void 0 : performanceImpl.clearMarks(name); + } + function isEnabled() { + return enabled; + } + function enable(system = sys) { + var _a; + if (!enabled) { + enabled = true; + perfHooks || (perfHooks = tryGetNativePerformanceHooks()); + if (perfHooks) { + timeorigin = perfHooks.performance.timeOrigin; + if (perfHooks.shouldWriteNativeEvents || ((_a = system == null ? void 0 : system.cpuProfilingEnabled) == null ? void 0 : _a.call(system)) || (system == null ? void 0 : system.debugMode)) { + performanceImpl = perfHooks.performance; + } + } + } + return true; + } + function disable() { + if (enabled) { + marks.clear(); + counts.clear(); + durations.clear(); + performanceImpl = void 0; + enabled = false; + } + } + var perfHooks, performanceImpl, nullTimer, enabled, timeorigin, marks, counts, durations; + var init_performance = __esm({ + "src/compiler/performance.ts"() { + "use strict"; + init_ts2(); + nullTimer = { enter: noop, exit: noop }; + enabled = false; + timeorigin = timestamp(); + marks = /* @__PURE__ */ new Map(); + counts = /* @__PURE__ */ new Map(); + durations = /* @__PURE__ */ new Map(); + } + }); + + // src/compiler/_namespaces/ts.performance.ts + var ts_performance_exports = {}; + __export(ts_performance_exports, { + clearMarks: () => clearMarks, + clearMeasures: () => clearMeasures, + createTimer: () => createTimer, + createTimerIf: () => createTimerIf, + disable: () => disable, + enable: () => enable, + forEachMark: () => forEachMark, + forEachMeasure: () => forEachMeasure, + getCount: () => getCount, + getDuration: () => getDuration, + isEnabled: () => isEnabled, + mark: () => mark, + measure: () => measure, + nullTimer: () => nullTimer + }); + var init_ts_performance = __esm({ + "src/compiler/_namespaces/ts.performance.ts"() { + "use strict"; + init_performance(); + } + }); + + // src/compiler/tracing.ts + var tracing, tracingEnabled, startTracing, dumpTracingLegend; + var init_tracing = __esm({ + "src/compiler/tracing.ts"() { + "use strict"; + init_ts2(); + init_ts_performance(); + ((tracingEnabled2) => { + let fs; + let traceCount = 0; + let traceFd = 0; + let mode; + const typeCatalog = []; + let legendPath; + const legend = []; + function startTracing2(tracingMode, traceDir, configFilePath) { + Debug.assert(!tracing, "Tracing already started"); + if (fs === void 0) { + try { + fs = __nccwpck_require__(57147); + } catch (e) { + throw new Error(`tracing requires having fs +(original error: ${e.message || e})`); + } + } + mode = tracingMode; + typeCatalog.length = 0; + if (legendPath === void 0) { + legendPath = combinePaths(traceDir, "legend.json"); + } + if (!fs.existsSync(traceDir)) { + fs.mkdirSync(traceDir, { recursive: true }); + } + const countPart = mode === "build" ? `.${process.pid}-${++traceCount}` : mode === "server" ? `.${process.pid}` : ``; + const tracePath = combinePaths(traceDir, `trace${countPart}.json`); + const typesPath = combinePaths(traceDir, `types${countPart}.json`); + legend.push({ + configFilePath, + tracePath, + typesPath + }); + traceFd = fs.openSync(tracePath, "w"); + tracing = tracingEnabled2; + const meta = { cat: "__metadata", ph: "M", ts: 1e3 * timestamp(), pid: 1, tid: 1 }; + fs.writeSync( + traceFd, + "[\n" + [{ name: "process_name", args: { name: "tsc" }, ...meta }, { name: "thread_name", args: { name: "Main" }, ...meta }, { name: "TracingStartedInBrowser", ...meta, cat: "disabled-by-default-devtools.timeline" }].map((v) => JSON.stringify(v)).join(",\n") + ); + } + tracingEnabled2.startTracing = startTracing2; + function stopTracing() { + Debug.assert(tracing, "Tracing is not in progress"); + Debug.assert(!!typeCatalog.length === (mode !== "server")); + fs.writeSync(traceFd, ` +] +`); + fs.closeSync(traceFd); + tracing = void 0; + if (typeCatalog.length) { + dumpTypes(typeCatalog); + } else { + legend[legend.length - 1].typesPath = void 0; + } + } + tracingEnabled2.stopTracing = stopTracing; + function recordType(type) { + if (mode !== "server") { + typeCatalog.push(type); + } + } + tracingEnabled2.recordType = recordType; + let Phase; + ((Phase2) => { + Phase2["Parse"] = "parse"; + Phase2["Program"] = "program"; + Phase2["Bind"] = "bind"; + Phase2["Check"] = "check"; + Phase2["CheckTypes"] = "checkTypes"; + Phase2["Emit"] = "emit"; + Phase2["Session"] = "session"; + })(Phase = tracingEnabled2.Phase || (tracingEnabled2.Phase = {})); + function instant(phase, name, args) { + writeEvent("I", phase, name, args, `"s":"g"`); + } + tracingEnabled2.instant = instant; + const eventStack = []; + function push(phase, name, args, separateBeginAndEnd = false) { + if (separateBeginAndEnd) { + writeEvent("B", phase, name, args); + } + eventStack.push({ phase, name, args, time: 1e3 * timestamp(), separateBeginAndEnd }); + } + tracingEnabled2.push = push; + function pop(results) { + Debug.assert(eventStack.length > 0); + writeStackEvent(eventStack.length - 1, 1e3 * timestamp(), results); + eventStack.length--; + } + tracingEnabled2.pop = pop; + function popAll() { + const endTime = 1e3 * timestamp(); + for (let i = eventStack.length - 1; i >= 0; i--) { + writeStackEvent(i, endTime); + } + eventStack.length = 0; + } + tracingEnabled2.popAll = popAll; + const sampleInterval = 1e3 * 10; + function writeStackEvent(index, endTime, results) { + const { phase, name, args, time, separateBeginAndEnd } = eventStack[index]; + if (separateBeginAndEnd) { + Debug.assert(!results, "`results` are not supported for events with `separateBeginAndEnd`"); + writeEvent( + "E", + phase, + name, + args, + /*extras*/ + void 0, + endTime + ); + } else if (sampleInterval - time % sampleInterval <= endTime - time) { + writeEvent("X", phase, name, { ...args, results }, `"dur":${endTime - time}`, time); + } + } + function writeEvent(eventType, phase, name, args, extras, time = 1e3 * timestamp()) { + if (mode === "server" && phase === "checkTypes" /* CheckTypes */) + return; + mark("beginTracing"); + fs.writeSync(traceFd, `, +{"pid":1,"tid":1,"ph":"${eventType}","cat":"${phase}","ts":${time},"name":"${name}"`); + if (extras) + fs.writeSync(traceFd, `,${extras}`); + if (args) + fs.writeSync(traceFd, `,"args":${JSON.stringify(args)}`); + fs.writeSync(traceFd, `}`); + mark("endTracing"); + measure("Tracing", "beginTracing", "endTracing"); + } + function getLocation(node) { + const file = getSourceFileOfNode(node); + return !file ? void 0 : { + path: file.path, + start: indexFromOne(getLineAndCharacterOfPosition(file, node.pos)), + end: indexFromOne(getLineAndCharacterOfPosition(file, node.end)) + }; + function indexFromOne(lc) { + return { + line: lc.line + 1, + character: lc.character + 1 + }; + } + } + function dumpTypes(types) { + var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s; + mark("beginDumpTypes"); + const typesPath = legend[legend.length - 1].typesPath; + const typesFd = fs.openSync(typesPath, "w"); + const recursionIdentityMap = /* @__PURE__ */ new Map(); + fs.writeSync(typesFd, "["); + const numTypes = types.length; + for (let i = 0; i < numTypes; i++) { + const type = types[i]; + const objectFlags = type.objectFlags; + const symbol = type.aliasSymbol ?? type.symbol; + let display; + if (objectFlags & 16 /* Anonymous */ | type.flags & 2944 /* Literal */) { + try { + display = (_a = type.checker) == null ? void 0 : _a.typeToString(type); + } catch { + display = void 0; + } + } + let indexedAccessProperties = {}; + if (type.flags & 8388608 /* IndexedAccess */) { + const indexedAccessType = type; + indexedAccessProperties = { + indexedAccessObjectType: (_b = indexedAccessType.objectType) == null ? void 0 : _b.id, + indexedAccessIndexType: (_c = indexedAccessType.indexType) == null ? void 0 : _c.id + }; + } + let referenceProperties = {}; + if (objectFlags & 4 /* Reference */) { + const referenceType = type; + referenceProperties = { + instantiatedType: (_d = referenceType.target) == null ? void 0 : _d.id, + typeArguments: (_e = referenceType.resolvedTypeArguments) == null ? void 0 : _e.map((t) => t.id), + referenceLocation: getLocation(referenceType.node) + }; + } + let conditionalProperties = {}; + if (type.flags & 16777216 /* Conditional */) { + const conditionalType = type; + conditionalProperties = { + conditionalCheckType: (_f = conditionalType.checkType) == null ? void 0 : _f.id, + conditionalExtendsType: (_g = conditionalType.extendsType) == null ? void 0 : _g.id, + conditionalTrueType: ((_h = conditionalType.resolvedTrueType) == null ? void 0 : _h.id) ?? -1, + conditionalFalseType: ((_i = conditionalType.resolvedFalseType) == null ? void 0 : _i.id) ?? -1 + }; + } + let substitutionProperties = {}; + if (type.flags & 33554432 /* Substitution */) { + const substitutionType = type; + substitutionProperties = { + substitutionBaseType: (_j = substitutionType.baseType) == null ? void 0 : _j.id, + constraintType: (_k = substitutionType.constraint) == null ? void 0 : _k.id + }; + } + let reverseMappedProperties = {}; + if (objectFlags & 1024 /* ReverseMapped */) { + const reverseMappedType = type; + reverseMappedProperties = { reverseMappedSourceType: (_l = reverseMappedType.source) == null ? void 0 : _l.id, reverseMappedMappedType: (_m = reverseMappedType.mappedType) == null ? void 0 : _m.id, reverseMappedConstraintType: (_n = reverseMappedType.constraintType) == null ? void 0 : _n.id @@ -59163,9 +93051,9 @@ ${lanes.join("\n")} const byteOrderMarkIndicator = "\uFEFF"; function getNodeSystem() { const nativePattern = /^native |^\([^)]+\)$|^(internal[\\/]|[a-zA-Z0-9_\s]+(\.js)?$)/; - const _fs = __nccwpck_require__(7147); - const _path = __nccwpck_require__(1017); - const _os = __nccwpck_require__(2037); + const _fs = __nccwpck_require__(57147); + const _path = __nccwpck_require__(71017); + const _os = __nccwpck_require__(22037); let _crypto; try { _crypto = __nccwpck_require__(6113); @@ -59174,7 +93062,7 @@ ${lanes.join("\n")} } let activeSession; let profilePath = "./profile.cpuprofile"; - const Buffer2 = (__nccwpck_require__(4300).Buffer); + const Buffer2 = (__nccwpck_require__(14300).Buffer); const isMacOs = process.platform === "darwin"; const isLinuxOrMacOs = process.platform === "linux" || isMacOs; const platform = _os.platform(); @@ -59313,7 +93201,7 @@ ${lanes.join("\n")} cb(); return false; } - const inspector = __nccwpck_require__(1405); + const inspector = __nccwpck_require__(31405); if (!inspector || !inspector.Session) { cb(); return false; @@ -243854,7 +277742,7 @@ if ( true && module.exports) { module.exports = ts; } /***/ }), -/***/ 1463: +/***/ 9046: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -243886,7 +277774,7 @@ exports.fromPromise = function (fn) { /***/ }), -/***/ 7127: +/***/ 65278: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { @@ -243894,12 +277782,12 @@ exports.fromPromise = function (fn) { * For Node.js, simply re-export the core `util.deprecate` function. */ -module.exports = __nccwpck_require__(3837).deprecate; +module.exports = __nccwpck_require__(73837).deprecate; /***/ }), -/***/ 5840: +/***/ 75840: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -243963,23 +277851,23 @@ Object.defineProperty(exports, "parse", ({ } })); -var _v = _interopRequireDefault(__nccwpck_require__(8628)); +var _v = _interopRequireDefault(__nccwpck_require__(78628)); -var _v2 = _interopRequireDefault(__nccwpck_require__(6409)); +var _v2 = _interopRequireDefault(__nccwpck_require__(86409)); -var _v3 = _interopRequireDefault(__nccwpck_require__(5122)); +var _v3 = _interopRequireDefault(__nccwpck_require__(85122)); -var _v4 = _interopRequireDefault(__nccwpck_require__(9120)); +var _v4 = _interopRequireDefault(__nccwpck_require__(79120)); -var _nil = _interopRequireDefault(__nccwpck_require__(5332)); +var _nil = _interopRequireDefault(__nccwpck_require__(25332)); -var _version = _interopRequireDefault(__nccwpck_require__(1595)); +var _version = _interopRequireDefault(__nccwpck_require__(81595)); -var _validate = _interopRequireDefault(__nccwpck_require__(6900)); +var _validate = _interopRequireDefault(__nccwpck_require__(66900)); -var _stringify = _interopRequireDefault(__nccwpck_require__(8950)); +var _stringify = _interopRequireDefault(__nccwpck_require__(18950)); -var _parse = _interopRequireDefault(__nccwpck_require__(2746)); +var _parse = _interopRequireDefault(__nccwpck_require__(62746)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -244015,7 +277903,7 @@ exports["default"] = _default; /***/ }), -/***/ 5332: +/***/ 25332: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -244030,7 +277918,7 @@ exports["default"] = _default; /***/ }), -/***/ 2746: +/***/ 62746: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -244041,7 +277929,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _validate = _interopRequireDefault(__nccwpck_require__(6900)); +var _validate = _interopRequireDefault(__nccwpck_require__(66900)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -244082,7 +277970,7 @@ exports["default"] = _default; /***/ }), -/***/ 814: +/***/ 40814: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -244097,7 +277985,7 @@ exports["default"] = _default; /***/ }), -/***/ 807: +/***/ 50807: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -244128,7 +278016,7 @@ function rng() { /***/ }), -/***/ 5274: +/***/ 85274: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -244158,7 +278046,7 @@ exports["default"] = _default; /***/ }), -/***/ 8950: +/***/ 18950: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -244169,7 +278057,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _validate = _interopRequireDefault(__nccwpck_require__(6900)); +var _validate = _interopRequireDefault(__nccwpck_require__(66900)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -244204,7 +278092,7 @@ exports["default"] = _default; /***/ }), -/***/ 8628: +/***/ 78628: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -244215,9 +278103,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _rng = _interopRequireDefault(__nccwpck_require__(807)); +var _rng = _interopRequireDefault(__nccwpck_require__(50807)); -var _stringify = _interopRequireDefault(__nccwpck_require__(8950)); +var _stringify = _interopRequireDefault(__nccwpck_require__(18950)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -244318,7 +278206,7 @@ exports["default"] = _default; /***/ }), -/***/ 6409: +/***/ 86409: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -244329,7 +278217,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _v = _interopRequireDefault(__nccwpck_require__(5998)); +var _v = _interopRequireDefault(__nccwpck_require__(65998)); var _md = _interopRequireDefault(__nccwpck_require__(4569)); @@ -244341,7 +278229,7 @@ exports["default"] = _default; /***/ }), -/***/ 5998: +/***/ 65998: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -244353,9 +278241,9 @@ Object.defineProperty(exports, "__esModule", ({ exports["default"] = _default; exports.URL = exports.DNS = void 0; -var _stringify = _interopRequireDefault(__nccwpck_require__(8950)); +var _stringify = _interopRequireDefault(__nccwpck_require__(18950)); -var _parse = _interopRequireDefault(__nccwpck_require__(2746)); +var _parse = _interopRequireDefault(__nccwpck_require__(62746)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -244426,7 +278314,7 @@ function _default(name, version, hashfunc) { /***/ }), -/***/ 5122: +/***/ 85122: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -244437,9 +278325,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _rng = _interopRequireDefault(__nccwpck_require__(807)); +var _rng = _interopRequireDefault(__nccwpck_require__(50807)); -var _stringify = _interopRequireDefault(__nccwpck_require__(8950)); +var _stringify = _interopRequireDefault(__nccwpck_require__(18950)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -244470,7 +278358,7 @@ exports["default"] = _default; /***/ }), -/***/ 9120: +/***/ 79120: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -244481,9 +278369,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _v = _interopRequireDefault(__nccwpck_require__(5998)); +var _v = _interopRequireDefault(__nccwpck_require__(65998)); -var _sha = _interopRequireDefault(__nccwpck_require__(5274)); +var _sha = _interopRequireDefault(__nccwpck_require__(85274)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -244493,7 +278381,7 @@ exports["default"] = _default; /***/ }), -/***/ 6900: +/***/ 66900: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -244504,7 +278392,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _regex = _interopRequireDefault(__nccwpck_require__(814)); +var _regex = _interopRequireDefault(__nccwpck_require__(40814)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -244517,7 +278405,7 @@ exports["default"] = _default; /***/ }), -/***/ 1595: +/***/ 81595: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -244528,7 +278416,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _validate = _interopRequireDefault(__nccwpck_require__(6900)); +var _validate = _interopRequireDefault(__nccwpck_require__(66900)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -244545,18 +278433,18 @@ exports["default"] = _default; /***/ }), -/***/ 416: +/***/ 70416: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const Module = __nccwpck_require__(8188); +const Module = __nccwpck_require__(98188); const crypto = __nccwpck_require__(6113); -const fs = __nccwpck_require__(7147); -const path = __nccwpck_require__(1017); -const vm = __nccwpck_require__(6144); -const os = __nccwpck_require__(2037); +const fs = __nccwpck_require__(57147); +const path = __nccwpck_require__(71017); +const vm = __nccwpck_require__(26144); +const os = __nccwpck_require__(22037); const hasOwnProperty = Object.prototype.hasOwnProperty; @@ -244944,7 +278832,7 @@ module.exports.__TEST__ = { /***/ }), -/***/ 2940: +/***/ 62940: /***/ ((module) => { // Returns a wrapper function that returns a wrapped callback @@ -244984,12 +278872,462 @@ function wrappy (fn, cb) { /***/ }), -/***/ 9647: +/***/ 4091: +/***/ ((module) => { + +"use strict"; + +module.exports = function (Yallist) { + Yallist.prototype[Symbol.iterator] = function* () { + for (let walker = this.head; walker; walker = walker.next) { + yield walker.value + } + } +} + + +/***/ }), + +/***/ 40665: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +module.exports = Yallist + +Yallist.Node = Node +Yallist.create = Yallist + +function Yallist (list) { + var self = this + if (!(self instanceof Yallist)) { + self = new Yallist() + } + + self.tail = null + self.head = null + self.length = 0 + + if (list && typeof list.forEach === 'function') { + list.forEach(function (item) { + self.push(item) + }) + } else if (arguments.length > 0) { + for (var i = 0, l = arguments.length; i < l; i++) { + self.push(arguments[i]) + } + } + + return self +} + +Yallist.prototype.removeNode = function (node) { + if (node.list !== this) { + throw new Error('removing node which does not belong to this list') + } + + var next = node.next + var prev = node.prev + + if (next) { + next.prev = prev + } + + if (prev) { + prev.next = next + } + + if (node === this.head) { + this.head = next + } + if (node === this.tail) { + this.tail = prev + } + + node.list.length-- + node.next = null + node.prev = null + node.list = null + + return next +} + +Yallist.prototype.unshiftNode = function (node) { + if (node === this.head) { + return + } + + if (node.list) { + node.list.removeNode(node) + } + + var head = this.head + node.list = this + node.next = head + if (head) { + head.prev = node + } + + this.head = node + if (!this.tail) { + this.tail = node + } + this.length++ +} + +Yallist.prototype.pushNode = function (node) { + if (node === this.tail) { + return + } + + if (node.list) { + node.list.removeNode(node) + } + + var tail = this.tail + node.list = this + node.prev = tail + if (tail) { + tail.next = node + } + + this.tail = node + if (!this.head) { + this.head = node + } + this.length++ +} + +Yallist.prototype.push = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + push(this, arguments[i]) + } + return this.length +} + +Yallist.prototype.unshift = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + unshift(this, arguments[i]) + } + return this.length +} + +Yallist.prototype.pop = function () { + if (!this.tail) { + return undefined + } + + var res = this.tail.value + this.tail = this.tail.prev + if (this.tail) { + this.tail.next = null + } else { + this.head = null + } + this.length-- + return res +} + +Yallist.prototype.shift = function () { + if (!this.head) { + return undefined + } + + var res = this.head.value + this.head = this.head.next + if (this.head) { + this.head.prev = null + } else { + this.tail = null + } + this.length-- + return res +} + +Yallist.prototype.forEach = function (fn, thisp) { + thisp = thisp || this + for (var walker = this.head, i = 0; walker !== null; i++) { + fn.call(thisp, walker.value, i, this) + walker = walker.next + } +} + +Yallist.prototype.forEachReverse = function (fn, thisp) { + thisp = thisp || this + for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { + fn.call(thisp, walker.value, i, this) + walker = walker.prev + } +} + +Yallist.prototype.get = function (n) { + for (var i = 0, walker = this.head; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.next + } + if (i === n && walker !== null) { + return walker.value + } +} + +Yallist.prototype.getReverse = function (n) { + for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.prev + } + if (i === n && walker !== null) { + return walker.value + } +} + +Yallist.prototype.map = function (fn, thisp) { + thisp = thisp || this + var res = new Yallist() + for (var walker = this.head; walker !== null;) { + res.push(fn.call(thisp, walker.value, this)) + walker = walker.next + } + return res +} + +Yallist.prototype.mapReverse = function (fn, thisp) { + thisp = thisp || this + var res = new Yallist() + for (var walker = this.tail; walker !== null;) { + res.push(fn.call(thisp, walker.value, this)) + walker = walker.prev + } + return res +} + +Yallist.prototype.reduce = function (fn, initial) { + var acc + var walker = this.head + if (arguments.length > 1) { + acc = initial + } else if (this.head) { + walker = this.head.next + acc = this.head.value + } else { + throw new TypeError('Reduce of empty list with no initial value') + } + + for (var i = 0; walker !== null; i++) { + acc = fn(acc, walker.value, i) + walker = walker.next + } + + return acc +} + +Yallist.prototype.reduceReverse = function (fn, initial) { + var acc + var walker = this.tail + if (arguments.length > 1) { + acc = initial + } else if (this.tail) { + walker = this.tail.prev + acc = this.tail.value + } else { + throw new TypeError('Reduce of empty list with no initial value') + } + + for (var i = this.length - 1; walker !== null; i--) { + acc = fn(acc, walker.value, i) + walker = walker.prev + } + + return acc +} + +Yallist.prototype.toArray = function () { + var arr = new Array(this.length) + for (var i = 0, walker = this.head; walker !== null; i++) { + arr[i] = walker.value + walker = walker.next + } + return arr +} + +Yallist.prototype.toArrayReverse = function () { + var arr = new Array(this.length) + for (var i = 0, walker = this.tail; walker !== null; i++) { + arr[i] = walker.value + walker = walker.prev + } + return arr +} + +Yallist.prototype.slice = function (from, to) { + to = to || this.length + if (to < 0) { + to += this.length + } + from = from || 0 + if (from < 0) { + from += this.length + } + var ret = new Yallist() + if (to < from || to < 0) { + return ret + } + if (from < 0) { + from = 0 + } + if (to > this.length) { + to = this.length + } + for (var i = 0, walker = this.head; walker !== null && i < from; i++) { + walker = walker.next + } + for (; walker !== null && i < to; i++, walker = walker.next) { + ret.push(walker.value) + } + return ret +} + +Yallist.prototype.sliceReverse = function (from, to) { + to = to || this.length + if (to < 0) { + to += this.length + } + from = from || 0 + if (from < 0) { + from += this.length + } + var ret = new Yallist() + if (to < from || to < 0) { + return ret + } + if (from < 0) { + from = 0 + } + if (to > this.length) { + to = this.length + } + for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { + walker = walker.prev + } + for (; walker !== null && i > from; i--, walker = walker.prev) { + ret.push(walker.value) + } + return ret +} + +Yallist.prototype.splice = function (start, deleteCount, ...nodes) { + if (start > this.length) { + start = this.length - 1 + } + if (start < 0) { + start = this.length + start; + } + + for (var i = 0, walker = this.head; walker !== null && i < start; i++) { + walker = walker.next + } + + var ret = [] + for (var i = 0; walker && i < deleteCount; i++) { + ret.push(walker.value) + walker = this.removeNode(walker) + } + if (walker === null) { + walker = this.tail + } + + if (walker !== this.head && walker !== this.tail) { + walker = walker.prev + } + + for (var i = 0; i < nodes.length; i++) { + walker = insert(this, walker, nodes[i]) + } + return ret; +} + +Yallist.prototype.reverse = function () { + var head = this.head + var tail = this.tail + for (var walker = head; walker !== null; walker = walker.prev) { + var p = walker.prev + walker.prev = walker.next + walker.next = p + } + this.head = tail + this.tail = head + return this +} + +function insert (self, node, value) { + var inserted = node === self.head ? + new Node(value, null, node, self) : + new Node(value, node, node.next, self) + + if (inserted.next === null) { + self.tail = inserted + } + if (inserted.prev === null) { + self.head = inserted + } + + self.length++ + + return inserted +} + +function push (self, item) { + self.tail = new Node(item, self.tail, null, self) + if (!self.head) { + self.head = self.tail + } + self.length++ +} + +function unshift (self, item) { + self.head = new Node(item, null, self.head, self) + if (!self.tail) { + self.tail = self.head + } + self.length++ +} + +function Node (value, prev, next, list) { + if (!(this instanceof Node)) { + return new Node(value, prev, next, list) + } + + this.list = list + this.value = value + + if (prev) { + prev.next = this + this.prev = prev + } else { + this.prev = null + } + + if (next) { + next.prev = this + this.next = next + } else { + this.next = null + } +} + +try { + // add if support for Symbol.iterator is present + __nccwpck_require__(4091)(Yallist) +} catch (er) {} + + +/***/ }), + +/***/ 79647: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const lenient = __nccwpck_require__(266); +const lenient = __nccwpck_require__(40266); const yn = (input, options) => { input = String(input).trim(); @@ -245025,7 +279363,7 @@ module.exports["default"] = yn; /***/ }), -/***/ 266: +/***/ 40266: /***/ ((module) => { "use strict"; @@ -245138,7 +279476,7 @@ module.exports = (input, options) => { /***/ }), -/***/ 9444: +/***/ 19444: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -245153,7 +279491,7 @@ exports.buildCommand = buildCommand; /***/ }), -/***/ 4574: +/***/ 54574: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -245161,9 +279499,9 @@ exports.buildCommand = buildCommand; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.execCommand = exports.ChildProcess = void 0; const tslib_1 = __nccwpck_require__(4351); -const child_process_1 = __nccwpck_require__(8493); +const child_process_1 = __nccwpck_require__(32081); Object.defineProperty(exports, "ChildProcess", ({ enumerable: true, get: function () { return child_process_1.ChildProcess; } })); -const shell = tslib_1.__importStar(__nccwpck_require__(3516)); +const shell = tslib_1.__importStar(__nccwpck_require__(33516)); const execCommand = (command, options = { asString: false, asJSON: false @@ -245192,7 +279530,7 @@ exports.execCommand = execCommand; /***/ }), -/***/ 6126: +/***/ 96126: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -245200,7 +279538,7 @@ exports.execCommand = execCommand; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.hasOneOfRequiredTags = exports.cleanLogConditions = void 0; const tslib_1 = __nccwpck_require__(4351); -const core = tslib_1.__importStar(__nccwpck_require__(2186)); +const core = tslib_1.__importStar(__nccwpck_require__(42186)); function hasTagMatchingCondition(condition, tags) { if (condition.includes('=')) { // If it includes a "," it's a AND condition @@ -245265,7 +279603,7 @@ exports.hasOneOfRequiredTags = hasOneOfRequiredTags; /***/ }), -/***/ 2695: +/***/ 52695: /***/ ((module) => { module.exports = eval("require")("./nx.android-arm-eabi.node"); @@ -245273,7 +279611,7 @@ module.exports = eval("require")("./nx.android-arm-eabi.node"); /***/ }), -/***/ 9706: +/***/ 69706: /***/ ((module) => { module.exports = eval("require")("./nx.android-arm64.node"); @@ -245281,7 +279619,7 @@ module.exports = eval("require")("./nx.android-arm64.node"); /***/ }), -/***/ 3449: +/***/ 43449: /***/ ((module) => { module.exports = eval("require")("./nx.darwin-arm64.node"); @@ -245289,7 +279627,7 @@ module.exports = eval("require")("./nx.darwin-arm64.node"); /***/ }), -/***/ 9697: +/***/ 69697: /***/ ((module) => { module.exports = eval("require")("./nx.darwin-universal.node"); @@ -245305,7 +279643,7 @@ module.exports = eval("require")("./nx.darwin-x64.node"); /***/ }), -/***/ 5319: +/***/ 85319: /***/ ((module) => { module.exports = eval("require")("./nx.freebsd-x64.node"); @@ -245321,7 +279659,7 @@ module.exports = eval("require")("./nx.linux-arm-gnueabihf.node"); /***/ }), -/***/ 8032: +/***/ 98032: /***/ ((module) => { module.exports = eval("require")("./nx.linux-arm64-gnu.node"); @@ -245329,7 +279667,7 @@ module.exports = eval("require")("./nx.linux-arm64-gnu.node"); /***/ }), -/***/ 2282: +/***/ 72282: /***/ ((module) => { module.exports = eval("require")("./nx.linux-arm64-musl.node"); @@ -245337,7 +279675,7 @@ module.exports = eval("require")("./nx.linux-arm64-musl.node"); /***/ }), -/***/ 4000: +/***/ 54000: /***/ ((module) => { module.exports = eval("require")("./nx.linux-x64-gnu.node"); @@ -245345,7 +279683,7 @@ module.exports = eval("require")("./nx.linux-x64-gnu.node"); /***/ }), -/***/ 497: +/***/ 40497: /***/ ((module) => { module.exports = eval("require")("./nx.linux-x64-musl.node"); @@ -245361,7 +279699,7 @@ module.exports = eval("require")("./nx.win32-arm64-msvc.node"); /***/ }), -/***/ 7077: +/***/ 17077: /***/ ((module) => { module.exports = eval("require")("./nx.win32-ia32-msvc.node"); @@ -245369,7 +279707,7 @@ module.exports = eval("require")("./nx.win32-ia32-msvc.node"); /***/ }), -/***/ 155: +/***/ 10155: /***/ ((module) => { module.exports = eval("require")("./nx.win32-x64-msvc.node"); @@ -245377,7 +279715,7 @@ module.exports = eval("require")("./nx.win32-x64-msvc.node"); /***/ }), -/***/ 4560: +/***/ 64560: /***/ ((module) => { module.exports = eval("require")("./swc.android-arm-eabi.node"); @@ -245385,7 +279723,7 @@ module.exports = eval("require")("./swc.android-arm-eabi.node"); /***/ }), -/***/ 7816: +/***/ 77816: /***/ ((module) => { module.exports = eval("require")("./swc.android-arm64.node"); @@ -245393,7 +279731,7 @@ module.exports = eval("require")("./swc.android-arm64.node"); /***/ }), -/***/ 5918: +/***/ 35918: /***/ ((module) => { module.exports = eval("require")("./swc.darwin-arm64.node"); @@ -245401,7 +279739,7 @@ module.exports = eval("require")("./swc.darwin-arm64.node"); /***/ }), -/***/ 8310: +/***/ 38310: /***/ ((module) => { module.exports = eval("require")("./swc.darwin-universal.node"); @@ -245409,7 +279747,7 @@ module.exports = eval("require")("./swc.darwin-universal.node"); /***/ }), -/***/ 9243: +/***/ 59243: /***/ ((module) => { module.exports = eval("require")("./swc.darwin-x64.node"); @@ -245417,7 +279755,7 @@ module.exports = eval("require")("./swc.darwin-x64.node"); /***/ }), -/***/ 6350: +/***/ 56350: /***/ ((module) => { module.exports = eval("require")("./swc.freebsd-arm64.node"); @@ -245425,7 +279763,7 @@ module.exports = eval("require")("./swc.freebsd-arm64.node"); /***/ }), -/***/ 3003: +/***/ 43003: /***/ ((module) => { module.exports = eval("require")("./swc.freebsd-x64.node"); @@ -245441,7 +279779,7 @@ module.exports = eval("require")("./swc.linux-arm-gnueabihf.node"); /***/ }), -/***/ 3068: +/***/ 83068: /***/ ((module) => { module.exports = eval("require")("./swc.linux-arm64-gnu.node"); @@ -245449,7 +279787,7 @@ module.exports = eval("require")("./swc.linux-arm64-gnu.node"); /***/ }), -/***/ 5712: +/***/ 35712: /***/ ((module) => { module.exports = eval("require")("./swc.linux-arm64-musl.node"); @@ -245457,7 +279795,7 @@ module.exports = eval("require")("./swc.linux-arm64-musl.node"); /***/ }), -/***/ 2752: +/***/ 72752: /***/ ((module) => { module.exports = eval("require")("./swc.linux-riscv64-gnu.node"); @@ -245465,7 +279803,7 @@ module.exports = eval("require")("./swc.linux-riscv64-gnu.node"); /***/ }), -/***/ 7917: +/***/ 37917: /***/ ((module) => { module.exports = eval("require")("./swc.linux-riscv64-musl.node"); @@ -245473,7 +279811,7 @@ module.exports = eval("require")("./swc.linux-riscv64-musl.node"); /***/ }), -/***/ 2097: +/***/ 52097: /***/ ((module) => { module.exports = eval("require")("./swc.linux-s390x-gnu.node"); @@ -245481,7 +279819,7 @@ module.exports = eval("require")("./swc.linux-s390x-gnu.node"); /***/ }), -/***/ 5701: +/***/ 75701: /***/ ((module) => { module.exports = eval("require")("./swc.linux-x64-gnu.node"); @@ -245489,7 +279827,7 @@ module.exports = eval("require")("./swc.linux-x64-gnu.node"); /***/ }), -/***/ 9698: +/***/ 79698: /***/ ((module) => { module.exports = eval("require")("./swc.linux-x64-musl.node"); @@ -245497,7 +279835,7 @@ module.exports = eval("require")("./swc.linux-x64-musl.node"); /***/ }), -/***/ 2465: +/***/ 82465: /***/ ((module) => { module.exports = eval("require")("./swc.wasi.cjs"); @@ -245505,7 +279843,7 @@ module.exports = eval("require")("./swc.wasi.cjs"); /***/ }), -/***/ 3222: +/***/ 13222: /***/ ((module) => { module.exports = eval("require")("./swc.win32-arm64-msvc.node"); @@ -245513,7 +279851,7 @@ module.exports = eval("require")("./swc.win32-arm64-msvc.node"); /***/ }), -/***/ 2846: +/***/ 12846: /***/ ((module) => { module.exports = eval("require")("./swc.win32-ia32-msvc.node"); @@ -245521,7 +279859,7 @@ module.exports = eval("require")("./swc.win32-ia32-msvc.node"); /***/ }), -/***/ 3410: +/***/ 23410: /***/ ((module) => { module.exports = eval("require")("./swc.win32-x64-msvc.node"); @@ -245529,7 +279867,7 @@ module.exports = eval("require")("./swc.win32-x64-msvc.node"); /***/ }), -/***/ 952: +/***/ 20952: /***/ ((module) => { module.exports = eval("require")("@nx/nx-android-arm-eabi"); @@ -245537,7 +279875,7 @@ module.exports = eval("require")("@nx/nx-android-arm-eabi"); /***/ }), -/***/ 9409: +/***/ 29409: /***/ ((module) => { module.exports = eval("require")("@nx/nx-android-arm64"); @@ -245545,7 +279883,7 @@ module.exports = eval("require")("@nx/nx-android-arm64"); /***/ }), -/***/ 2353: +/***/ 32353: /***/ ((module) => { module.exports = eval("require")("@nx/nx-darwin-arm64"); @@ -245553,7 +279891,7 @@ module.exports = eval("require")("@nx/nx-darwin-arm64"); /***/ }), -/***/ 2446: +/***/ 42446: /***/ ((module) => { module.exports = eval("require")("@nx/nx-darwin-universal"); @@ -245561,7 +279899,7 @@ module.exports = eval("require")("@nx/nx-darwin-universal"); /***/ }), -/***/ 3629: +/***/ 43629: /***/ ((module) => { module.exports = eval("require")("@nx/nx-darwin-x64"); @@ -245577,7 +279915,7 @@ module.exports = eval("require")("@nx/nx-freebsd-x64"); /***/ }), -/***/ 8834: +/***/ 58834: /***/ ((module) => { module.exports = eval("require")("@nx/nx-linux-arm-gnueabihf"); @@ -245585,7 +279923,7 @@ module.exports = eval("require")("@nx/nx-linux-arm-gnueabihf"); /***/ }), -/***/ 7652: +/***/ 27652: /***/ ((module) => { module.exports = eval("require")("@nx/nx-linux-arm64-gnu"); @@ -245593,7 +279931,7 @@ module.exports = eval("require")("@nx/nx-linux-arm64-gnu"); /***/ }), -/***/ 7052: +/***/ 77052: /***/ ((module) => { module.exports = eval("require")("@nx/nx-linux-arm64-musl"); @@ -245601,7 +279939,7 @@ module.exports = eval("require")("@nx/nx-linux-arm64-musl"); /***/ }), -/***/ 6272: +/***/ 76272: /***/ ((module) => { module.exports = eval("require")("@nx/nx-linux-x64-musl"); @@ -245609,7 +279947,7 @@ module.exports = eval("require")("@nx/nx-linux-x64-musl"); /***/ }), -/***/ 8468: +/***/ 88468: /***/ ((module) => { module.exports = eval("require")("@nx/nx-win32-arm64-msvc"); @@ -245617,7 +279955,7 @@ module.exports = eval("require")("@nx/nx-win32-arm64-msvc"); /***/ }), -/***/ 1934: +/***/ 91934: /***/ ((module) => { module.exports = eval("require")("@nx/nx-win32-ia32-msvc"); @@ -245625,7 +279963,7 @@ module.exports = eval("require")("@nx/nx-win32-ia32-msvc"); /***/ }), -/***/ 2309: +/***/ 72309: /***/ ((module) => { module.exports = eval("require")("@nx/nx-win32-x64-msvc"); @@ -245633,7 +279971,15 @@ module.exports = eval("require")("@nx/nx-win32-x64-msvc"); /***/ }), -/***/ 6276: +/***/ 10420: +/***/ ((module) => { + +module.exports = eval("require")("@nx/vue"); + + +/***/ }), + +/***/ 76276: /***/ ((module) => { module.exports = eval("require")("@swc/core-android-arm-eabi"); @@ -245641,7 +279987,7 @@ module.exports = eval("require")("@swc/core-android-arm-eabi"); /***/ }), -/***/ 2210: +/***/ 42210: /***/ ((module) => { module.exports = eval("require")("@swc/core-android-arm64"); @@ -245649,7 +279995,7 @@ module.exports = eval("require")("@swc/core-android-arm64"); /***/ }), -/***/ 225: +/***/ 60225: /***/ ((module) => { module.exports = eval("require")("@swc/core-darwin-arm64"); @@ -245657,7 +280003,7 @@ module.exports = eval("require")("@swc/core-darwin-arm64"); /***/ }), -/***/ 3011: +/***/ 73011: /***/ ((module) => { module.exports = eval("require")("@swc/core-darwin-universal"); @@ -245665,7 +280011,7 @@ module.exports = eval("require")("@swc/core-darwin-universal"); /***/ }), -/***/ 5794: +/***/ 95794: /***/ ((module) => { module.exports = eval("require")("@swc/core-darwin-x64"); @@ -245673,7 +280019,7 @@ module.exports = eval("require")("@swc/core-darwin-x64"); /***/ }), -/***/ 2514: +/***/ 72514: /***/ ((module) => { module.exports = eval("require")("@swc/core-freebsd-arm64"); @@ -245681,7 +280027,7 @@ module.exports = eval("require")("@swc/core-freebsd-arm64"); /***/ }), -/***/ 4546: +/***/ 44546: /***/ ((module) => { module.exports = eval("require")("@swc/core-freebsd-x64"); @@ -245689,7 +280035,7 @@ module.exports = eval("require")("@swc/core-freebsd-x64"); /***/ }), -/***/ 5083: +/***/ 15083: /***/ ((module) => { module.exports = eval("require")("@swc/core-linux-arm-gnueabihf"); @@ -245697,7 +280043,7 @@ module.exports = eval("require")("@swc/core-linux-arm-gnueabihf"); /***/ }), -/***/ 6336: +/***/ 66336: /***/ ((module) => { module.exports = eval("require")("@swc/core-linux-arm64-gnu"); @@ -245713,7 +280059,7 @@ module.exports = eval("require")("@swc/core-linux-arm64-musl"); /***/ }), -/***/ 2574: +/***/ 72574: /***/ ((module) => { module.exports = eval("require")("@swc/core-linux-riscv64-gnu"); @@ -245721,7 +280067,7 @@ module.exports = eval("require")("@swc/core-linux-riscv64-gnu"); /***/ }), -/***/ 1978: +/***/ 11978: /***/ ((module) => { module.exports = eval("require")("@swc/core-linux-riscv64-musl"); @@ -245729,7 +280075,7 @@ module.exports = eval("require")("@swc/core-linux-riscv64-musl"); /***/ }), -/***/ 7035: +/***/ 47035: /***/ ((module) => { module.exports = eval("require")("@swc/core-linux-s390x-gnu"); @@ -245745,7 +280091,7 @@ module.exports = eval("require")("@swc/core-linux-x64-musl"); /***/ }), -/***/ 4068: +/***/ 74068: /***/ ((module) => { module.exports = eval("require")("@swc/core-wasm32-wasi"); @@ -245753,7 +280099,7 @@ module.exports = eval("require")("@swc/core-wasm32-wasi"); /***/ }), -/***/ 9104: +/***/ 69104: /***/ ((module) => { module.exports = eval("require")("@swc/core-win32-arm64-msvc"); @@ -245761,7 +280107,7 @@ module.exports = eval("require")("@swc/core-win32-arm64-msvc"); /***/ }), -/***/ 9635: +/***/ 89635: /***/ ((module) => { module.exports = eval("require")("@swc/core-win32-ia32-msvc"); @@ -245769,3435 +280115,6567 @@ module.exports = eval("require")("@swc/core-win32-ia32-msvc"); /***/ }), -/***/ 5610: -/***/ ((module) => { +/***/ 65610: +/***/ ((module) => { + +module.exports = eval("require")("@swc/core-win32-x64-msvc"); + + +/***/ }), + +/***/ 93469: +/***/ ((module) => { + +module.exports = eval("require")("@swc/wasm"); + + +/***/ }), + +/***/ 87739: +/***/ ((module) => { + +function webpackEmptyContext(req) { + var e = new Error("Cannot find module '" + req + "'"); + e.code = 'MODULE_NOT_FOUND'; + throw e; +} +webpackEmptyContext.keys = () => ([]); +webpackEmptyContext.resolve = webpackEmptyContext; +webpackEmptyContext.id = 87739; +module.exports = webpackEmptyContext; + +/***/ }), + +/***/ 35115: +/***/ ((module) => { + +function webpackEmptyContext(req) { + var e = new Error("Cannot find module '" + req + "'"); + e.code = 'MODULE_NOT_FOUND'; + throw e; +} +webpackEmptyContext.keys = () => ([]); +webpackEmptyContext.resolve = webpackEmptyContext; +webpackEmptyContext.id = 35115; +module.exports = webpackEmptyContext; + +/***/ }), + +/***/ 3833: +/***/ ((module) => { + +function webpackEmptyContext(req) { + var e = new Error("Cannot find module '" + req + "'"); + e.code = 'MODULE_NOT_FOUND'; + throw e; +} +webpackEmptyContext.keys = () => ([]); +webpackEmptyContext.resolve = webpackEmptyContext; +webpackEmptyContext.id = 3833; +module.exports = webpackEmptyContext; + +/***/ }), + +/***/ 39491: +/***/ ((module) => { + +"use strict"; +module.exports = require("assert"); + +/***/ }), + +/***/ 14300: +/***/ ((module) => { + +"use strict"; +module.exports = require("buffer"); + +/***/ }), + +/***/ 32081: +/***/ ((module) => { + +"use strict"; +module.exports = require("child_process"); + +/***/ }), + +/***/ 96206: +/***/ ((module) => { + +"use strict"; +module.exports = require("console"); + +/***/ }), + +/***/ 22057: +/***/ ((module) => { + +"use strict"; +module.exports = require("constants"); + +/***/ }), + +/***/ 6113: +/***/ ((module) => { + +"use strict"; +module.exports = require("crypto"); + +/***/ }), + +/***/ 82361: +/***/ ((module) => { + +"use strict"; +module.exports = require("events"); + +/***/ }), + +/***/ 57147: +/***/ ((module) => { + +"use strict"; +module.exports = require("fs"); + +/***/ }), + +/***/ 73292: +/***/ ((module) => { + +"use strict"; +module.exports = require("fs/promises"); + +/***/ }), + +/***/ 13685: +/***/ ((module) => { + +"use strict"; +module.exports = require("http"); + +/***/ }), + +/***/ 95687: +/***/ ((module) => { + +"use strict"; +module.exports = require("https"); + +/***/ }), + +/***/ 31405: +/***/ ((module) => { + +"use strict"; +module.exports = require("inspector"); + +/***/ }), + +/***/ 98188: +/***/ ((module) => { + +"use strict"; +module.exports = require("module"); + +/***/ }), + +/***/ 41808: +/***/ ((module) => { + +"use strict"; +module.exports = require("net"); + +/***/ }), + +/***/ 87561: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:fs"); + +/***/ }), + +/***/ 82033: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:module"); + +/***/ }), + +/***/ 49411: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:path"); + +/***/ }), + +/***/ 90410: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:path/posix"); + +/***/ }), + +/***/ 41041: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:url"); + +/***/ }), + +/***/ 22037: +/***/ ((module) => { + +"use strict"; +module.exports = require("os"); + +/***/ }), + +/***/ 71017: +/***/ ((module) => { + +"use strict"; +module.exports = require("path"); + +/***/ }), + +/***/ 4074: +/***/ ((module) => { + +"use strict"; +module.exports = require("perf_hooks"); + +/***/ }), + +/***/ 14521: +/***/ ((module) => { + +"use strict"; +module.exports = require("readline"); + +/***/ }), + +/***/ 38102: +/***/ ((module) => { + +"use strict"; +module.exports = require("repl"); + +/***/ }), + +/***/ 12781: +/***/ ((module) => { + +"use strict"; +module.exports = require("stream"); + +/***/ }), + +/***/ 71576: +/***/ ((module) => { + +"use strict"; +module.exports = require("string_decoder"); + +/***/ }), + +/***/ 24404: +/***/ ((module) => { + +"use strict"; +module.exports = require("tls"); + +/***/ }), + +/***/ 76224: +/***/ ((module) => { + +"use strict"; +module.exports = require("tty"); + +/***/ }), + +/***/ 57310: +/***/ ((module) => { + +"use strict"; +module.exports = require("url"); + +/***/ }), + +/***/ 73837: +/***/ ((module) => { + +"use strict"; +module.exports = require("util"); + +/***/ }), + +/***/ 26144: +/***/ ((module) => { + +"use strict"; +module.exports = require("vm"); + +/***/ }), + +/***/ 59796: +/***/ ((module) => { + +"use strict"; +module.exports = require("zlib"); + +/***/ }), + +/***/ 37840: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.assertValidPattern = void 0; +const MAX_PATTERN_LENGTH = 1024 * 64; +const assertValidPattern = (pattern) => { + if (typeof pattern !== 'string') { + throw new TypeError('invalid pattern'); + } + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError('pattern is too long'); + } +}; +exports.assertValidPattern = assertValidPattern; +//# sourceMappingURL=assert-valid-pattern.js.map + +/***/ }), + +/***/ 81227: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +// parse a single path portion +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AST = void 0; +const brace_expressions_js_1 = __nccwpck_require__(65180); +const unescape_js_1 = __nccwpck_require__(40391); +const types = new Set(['!', '?', '+', '*', '@']); +const isExtglobType = (c) => types.has(c); +// Patterns that get prepended to bind to the start of either the +// entire string, or just a single path portion, to prevent dots +// and/or traversal patterns, when needed. +// Exts don't need the ^ or / bit, because the root binds that already. +const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))'; +const startNoDot = '(?!\\.)'; +// characters that indicate a start of pattern needs the "no dots" bit, +// because a dot *might* be matched. ( is not in the list, because in +// the case of a child extglob, it will handle the prevention itself. +const addPatternStart = new Set(['[', '.']); +// cases where traversal is A-OK, no dot prevention needed +const justDots = new Set(['..', '.']); +const reSpecials = new Set('().*{}+?[]^$\\!'); +const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +// any single thing other than / +const qmark = '[^/]'; +// * => any number of characters +const star = qmark + '*?'; +// use + when we need to ensure that *something* matches, because the * is +// the only thing in the path portion. +const starNoEmpty = qmark + '+?'; +// remove the \ chars that we added if we end up doing a nonmagic compare +// const deslash = (s: string) => s.replace(/\\(.)/g, '$1') +class AST { + type; + #root; + #hasMagic; + #uflag = false; + #parts = []; + #parent; + #parentIndex; + #negs; + #filledNegs = false; + #options; + #toString; + // set to true if it's an extglob with no children + // (which really means one child of '') + #emptyExt = false; + constructor(type, parent, options = {}) { + this.type = type; + // extglobs are inherently magical + if (type) + this.#hasMagic = true; + this.#parent = parent; + this.#root = this.#parent ? this.#parent.#root : this; + this.#options = this.#root === this ? options : this.#root.#options; + this.#negs = this.#root === this ? [] : this.#root.#negs; + if (type === '!' && !this.#root.#filledNegs) + this.#negs.push(this); + this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0; + } + get hasMagic() { + /* c8 ignore start */ + if (this.#hasMagic !== undefined) + return this.#hasMagic; + /* c8 ignore stop */ + for (const p of this.#parts) { + if (typeof p === 'string') + continue; + if (p.type || p.hasMagic) + return (this.#hasMagic = true); + } + // note: will be undefined until we generate the regexp src and find out + return this.#hasMagic; + } + // reconstructs the pattern + toString() { + if (this.#toString !== undefined) + return this.#toString; + if (!this.type) { + return (this.#toString = this.#parts.map(p => String(p)).join('')); + } + else { + return (this.#toString = + this.type + '(' + this.#parts.map(p => String(p)).join('|') + ')'); + } + } + #fillNegs() { + /* c8 ignore start */ + if (this !== this.#root) + throw new Error('should only call on root'); + if (this.#filledNegs) + return this; + /* c8 ignore stop */ + // call toString() once to fill this out + this.toString(); + this.#filledNegs = true; + let n; + while ((n = this.#negs.pop())) { + if (n.type !== '!') + continue; + // walk up the tree, appending everthing that comes AFTER parentIndex + let p = n; + let pp = p.#parent; + while (pp) { + for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) { + for (const part of n.#parts) { + /* c8 ignore start */ + if (typeof part === 'string') { + throw new Error('string part in extglob AST??'); + } + /* c8 ignore stop */ + part.copyIn(pp.#parts[i]); + } + } + p = pp; + pp = p.#parent; + } + } + return this; + } + push(...parts) { + for (const p of parts) { + if (p === '') + continue; + /* c8 ignore start */ + if (typeof p !== 'string' && !(p instanceof AST && p.#parent === this)) { + throw new Error('invalid part: ' + p); + } + /* c8 ignore stop */ + this.#parts.push(p); + } + } + toJSON() { + const ret = this.type === null + ? this.#parts.slice().map(p => (typeof p === 'string' ? p : p.toJSON())) + : [this.type, ...this.#parts.map(p => p.toJSON())]; + if (this.isStart() && !this.type) + ret.unshift([]); + if (this.isEnd() && + (this === this.#root || + (this.#root.#filledNegs && this.#parent?.type === '!'))) { + ret.push({}); + } + return ret; + } + isStart() { + if (this.#root === this) + return true; + // if (this.type) return !!this.#parent?.isStart() + if (!this.#parent?.isStart()) + return false; + if (this.#parentIndex === 0) + return true; + // if everything AHEAD of this is a negation, then it's still the "start" + const p = this.#parent; + for (let i = 0; i < this.#parentIndex; i++) { + const pp = p.#parts[i]; + if (!(pp instanceof AST && pp.type === '!')) { + return false; + } + } + return true; + } + isEnd() { + if (this.#root === this) + return true; + if (this.#parent?.type === '!') + return true; + if (!this.#parent?.isEnd()) + return false; + if (!this.type) + return this.#parent?.isEnd(); + // if not root, it'll always have a parent + /* c8 ignore start */ + const pl = this.#parent ? this.#parent.#parts.length : 0; + /* c8 ignore stop */ + return this.#parentIndex === pl - 1; + } + copyIn(part) { + if (typeof part === 'string') + this.push(part); + else + this.push(part.clone(this)); + } + clone(parent) { + const c = new AST(this.type, parent); + for (const p of this.#parts) { + c.copyIn(p); + } + return c; + } + static #parseAST(str, ast, pos, opt) { + let escaping = false; + let inBrace = false; + let braceStart = -1; + let braceNeg = false; + if (ast.type === null) { + // outside of a extglob, append until we find a start + let i = pos; + let acc = ''; + while (i < str.length) { + const c = str.charAt(i++); + // still accumulate escapes at this point, but we do ignore + // starts that are escaped + if (escaping || c === '\\') { + escaping = !escaping; + acc += c; + continue; + } + if (inBrace) { + if (i === braceStart + 1) { + if (c === '^' || c === '!') { + braceNeg = true; + } + } + else if (c === ']' && !(i === braceStart + 2 && braceNeg)) { + inBrace = false; + } + acc += c; + continue; + } + else if (c === '[') { + inBrace = true; + braceStart = i; + braceNeg = false; + acc += c; + continue; + } + if (!opt.noext && isExtglobType(c) && str.charAt(i) === '(') { + ast.push(acc); + acc = ''; + const ext = new AST(c, ast); + i = AST.#parseAST(str, ext, i, opt); + ast.push(ext); + continue; + } + acc += c; + } + ast.push(acc); + return i; + } + // some kind of extglob, pos is at the ( + // find the next | or ) + let i = pos + 1; + let part = new AST(null, ast); + const parts = []; + let acc = ''; + while (i < str.length) { + const c = str.charAt(i++); + // still accumulate escapes at this point, but we do ignore + // starts that are escaped + if (escaping || c === '\\') { + escaping = !escaping; + acc += c; + continue; + } + if (inBrace) { + if (i === braceStart + 1) { + if (c === '^' || c === '!') { + braceNeg = true; + } + } + else if (c === ']' && !(i === braceStart + 2 && braceNeg)) { + inBrace = false; + } + acc += c; + continue; + } + else if (c === '[') { + inBrace = true; + braceStart = i; + braceNeg = false; + acc += c; + continue; + } + if (isExtglobType(c) && str.charAt(i) === '(') { + part.push(acc); + acc = ''; + const ext = new AST(c, part); + part.push(ext); + i = AST.#parseAST(str, ext, i, opt); + continue; + } + if (c === '|') { + part.push(acc); + acc = ''; + parts.push(part); + part = new AST(null, ast); + continue; + } + if (c === ')') { + if (acc === '' && ast.#parts.length === 0) { + ast.#emptyExt = true; + } + part.push(acc); + acc = ''; + ast.push(...parts, part); + return i; + } + acc += c; + } + // unfinished extglob + // if we got here, it was a malformed extglob! not an extglob, but + // maybe something else in there. + ast.type = null; + ast.#hasMagic = undefined; + ast.#parts = [str.substring(pos - 1)]; + return i; + } + static fromGlob(pattern, options = {}) { + const ast = new AST(null, undefined, options); + AST.#parseAST(pattern, ast, 0, options); + return ast; + } + // returns the regular expression if there's magic, or the unescaped + // string if not. + toMMPattern() { + // should only be called on root + /* c8 ignore start */ + if (this !== this.#root) + return this.#root.toMMPattern(); + /* c8 ignore stop */ + const glob = this.toString(); + const [re, body, hasMagic, uflag] = this.toRegExpSource(); + // if we're in nocase mode, and not nocaseMagicOnly, then we do + // still need a regular expression if we have to case-insensitively + // match capital/lowercase characters. + const anyMagic = hasMagic || + this.#hasMagic || + (this.#options.nocase && + !this.#options.nocaseMagicOnly && + glob.toUpperCase() !== glob.toLowerCase()); + if (!anyMagic) { + return body; + } + const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : ''); + return Object.assign(new RegExp(`^${re}$`, flags), { + _src: re, + _glob: glob, + }); + } + // returns the string match, the regexp source, whether there's magic + // in the regexp (so a regular expression is required) and whether or + // not the uflag is needed for the regular expression (for posix classes) + // TODO: instead of injecting the start/end at this point, just return + // the BODY of the regexp, along with the start/end portions suitable + // for binding the start/end in either a joined full-path makeRe context + // (where we bind to (^|/), or a standalone matchPart context (where + // we bind to ^, and not /). Otherwise slashes get duped! + // + // In part-matching mode, the start is: + // - if not isStart: nothing + // - if traversal possible, but not allowed: ^(?!\.\.?$) + // - if dots allowed or not possible: ^ + // - if dots possible and not allowed: ^(?!\.) + // end is: + // - if not isEnd(): nothing + // - else: $ + // + // In full-path matching mode, we put the slash at the START of the + // pattern, so start is: + // - if first pattern: same as part-matching mode + // - if not isStart(): nothing + // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/)) + // - if dots allowed or not possible: / + // - if dots possible and not allowed: /(?!\.) + // end is: + // - if last pattern, same as part-matching mode + // - else nothing + // + // Always put the (?:$|/) on negated tails, though, because that has to be + // there to bind the end of the negated pattern portion, and it's easier to + // just stick it in now rather than try to inject it later in the middle of + // the pattern. + // + // We can just always return the same end, and leave it up to the caller + // to know whether it's going to be used joined or in parts. + // And, if the start is adjusted slightly, can do the same there: + // - if not isStart: nothing + // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$) + // - if dots allowed or not possible: (?:/|^) + // - if dots possible and not allowed: (?:/|^)(?!\.) + // + // But it's better to have a simpler binding without a conditional, for + // performance, so probably better to return both start options. + // + // Then the caller just ignores the end if it's not the first pattern, + // and the start always gets applied. + // + // But that's always going to be $ if it's the ending pattern, or nothing, + // so the caller can just attach $ at the end of the pattern when building. + // + // So the todo is: + // - better detect what kind of start is needed + // - return both flavors of starting pattern + // - attach $ at the end of the pattern when creating the actual RegExp + // + // Ah, but wait, no, that all only applies to the root when the first pattern + // is not an extglob. If the first pattern IS an extglob, then we need all + // that dot prevention biz to live in the extglob portions, because eg + // +(*|.x*) can match .xy but not .yx. + // + // So, return the two flavors if it's #root and the first child is not an + // AST, otherwise leave it to the child AST to handle it, and there, + // use the (?:^|/) style of start binding. + // + // Even simplified further: + // - Since the start for a join is eg /(?!\.) and the start for a part + // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root + // or start or whatever) and prepend ^ or / at the Regexp construction. + toRegExpSource(allowDot) { + const dot = allowDot ?? !!this.#options.dot; + if (this.#root === this) + this.#fillNegs(); + if (!this.type) { + const noEmpty = this.isStart() && this.isEnd(); + const src = this.#parts + .map(p => { + const [re, _, hasMagic, uflag] = typeof p === 'string' + ? AST.#parseGlob(p, this.#hasMagic, noEmpty) + : p.toRegExpSource(allowDot); + this.#hasMagic = this.#hasMagic || hasMagic; + this.#uflag = this.#uflag || uflag; + return re; + }) + .join(''); + let start = ''; + if (this.isStart()) { + if (typeof this.#parts[0] === 'string') { + // this is the string that will match the start of the pattern, + // so we need to protect against dots and such. + // '.' and '..' cannot match unless the pattern is that exactly, + // even if it starts with . or dot:true is set. + const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]); + if (!dotTravAllowed) { + const aps = addPatternStart; + // check if we have a possibility of matching . or .., + // and prevent that. + const needNoTrav = + // dots are allowed, and the pattern starts with [ or . + (dot && aps.has(src.charAt(0))) || + // the pattern starts with \., and then [ or . + (src.startsWith('\\.') && aps.has(src.charAt(2))) || + // the pattern starts with \.\., and then [ or . + (src.startsWith('\\.\\.') && aps.has(src.charAt(4))); + // no need to prevent dots if it can't match a dot, or if a + // sub-pattern will be preventing it anyway. + const needNoDot = !dot && !allowDot && aps.has(src.charAt(0)); + start = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : ''; + } + } + } + // append the "end of path portion" pattern to negation tails + let end = ''; + if (this.isEnd() && + this.#root.#filledNegs && + this.#parent?.type === '!') { + end = '(?:$|\\/)'; + } + const final = start + src + end; + return [ + final, + (0, unescape_js_1.unescape)(src), + (this.#hasMagic = !!this.#hasMagic), + this.#uflag, + ]; + } + // We need to calculate the body *twice* if it's a repeat pattern + // at the start, once in nodot mode, then again in dot mode, so a + // pattern like *(?) can match 'x.y' + const repeated = this.type === '*' || this.type === '+'; + // some kind of extglob + const start = this.type === '!' ? '(?:(?!(?:' : '(?:'; + let body = this.#partsToRegExp(dot); + if (this.isStart() && this.isEnd() && !body && this.type !== '!') { + // invalid extglob, has to at least be *something* present, if it's + // the entire path portion. + const s = this.toString(); + this.#parts = [s]; + this.type = null; + this.#hasMagic = undefined; + return [s, (0, unescape_js_1.unescape)(this.toString()), false, false]; + } + // XXX abstract out this map method + let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot + ? '' + : this.#partsToRegExp(true); + if (bodyDotAllowed === body) { + bodyDotAllowed = ''; + } + if (bodyDotAllowed) { + body = `(?:${body})(?:${bodyDotAllowed})*?`; + } + // an empty !() is exactly equivalent to a starNoEmpty + let final = ''; + if (this.type === '!' && this.#emptyExt) { + final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty; + } + else { + const close = this.type === '!' + ? // !() must match something,but !(x) can match '' + '))' + + (this.isStart() && !dot && !allowDot ? startNoDot : '') + + star + + ')' + : this.type === '@' + ? ')' + : this.type === '?' + ? ')?' + : this.type === '+' && bodyDotAllowed + ? ')' + : this.type === '*' && bodyDotAllowed + ? `)?` + : `)${this.type}`; + final = start + body + close; + } + return [ + final, + (0, unescape_js_1.unescape)(body), + (this.#hasMagic = !!this.#hasMagic), + this.#uflag, + ]; + } + #partsToRegExp(dot) { + return this.#parts + .map(p => { + // extglob ASTs should only contain parent ASTs + /* c8 ignore start */ + if (typeof p === 'string') { + throw new Error('string type in extglob ast??'); + } + /* c8 ignore stop */ + // can ignore hasMagic, because extglobs are already always magic + const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot); + this.#uflag = this.#uflag || uflag; + return re; + }) + .filter(p => !(this.isStart() && this.isEnd()) || !!p) + .join('|'); + } + static #parseGlob(glob, hasMagic, noEmpty = false) { + let escaping = false; + let re = ''; + let uflag = false; + for (let i = 0; i < glob.length; i++) { + const c = glob.charAt(i); + if (escaping) { + escaping = false; + re += (reSpecials.has(c) ? '\\' : '') + c; + continue; + } + if (c === '\\') { + if (i === glob.length - 1) { + re += '\\\\'; + } + else { + escaping = true; + } + continue; + } + if (c === '[') { + const [src, needUflag, consumed, magic] = (0, brace_expressions_js_1.parseClass)(glob, i); + if (consumed) { + re += src; + uflag = uflag || needUflag; + i += consumed - 1; + hasMagic = hasMagic || magic; + continue; + } + } + if (c === '*') { + if (noEmpty && glob === '*') + re += starNoEmpty; + else + re += star; + hasMagic = true; + continue; + } + if (c === '?') { + re += qmark; + hasMagic = true; + continue; + } + re += regExpEscape(c); + } + return [re, (0, unescape_js_1.unescape)(glob), !!hasMagic, uflag]; + } +} +exports.AST = AST; +//# sourceMappingURL=ast.js.map + +/***/ }), + +/***/ 65180: +/***/ ((__unused_webpack_module, exports) => { -module.exports = eval("require")("@swc/core-win32-x64-msvc"); +"use strict"; +// translate the various posix character classes into unicode properties +// this works across all unicode locales +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.parseClass = void 0; +// { : [, /u flag required, negated] +const posixClasses = { + '[:alnum:]': ['\\p{L}\\p{Nl}\\p{Nd}', true], + '[:alpha:]': ['\\p{L}\\p{Nl}', true], + '[:ascii:]': ['\\x' + '00-\\x' + '7f', false], + '[:blank:]': ['\\p{Zs}\\t', true], + '[:cntrl:]': ['\\p{Cc}', true], + '[:digit:]': ['\\p{Nd}', true], + '[:graph:]': ['\\p{Z}\\p{C}', true, true], + '[:lower:]': ['\\p{Ll}', true], + '[:print:]': ['\\p{C}', true], + '[:punct:]': ['\\p{P}', true], + '[:space:]': ['\\p{Z}\\t\\r\\n\\v\\f', true], + '[:upper:]': ['\\p{Lu}', true], + '[:word:]': ['\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}', true], + '[:xdigit:]': ['A-Fa-f0-9', false], +}; +// only need to escape a few things inside of brace expressions +// escapes: [ \ ] - +const braceEscape = (s) => s.replace(/[[\]\\-]/g, '\\$&'); +// escape all regexp magic characters +const regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +// everything has already been escaped, we just have to join +const rangesToString = (ranges) => ranges.join(''); +// takes a glob string at a posix brace expression, and returns +// an equivalent regular expression source, and boolean indicating +// whether the /u flag needs to be applied, and the number of chars +// consumed to parse the character class. +// This also removes out of order ranges, and returns ($.) if the +// entire class just no good. +const parseClass = (glob, position) => { + const pos = position; + /* c8 ignore start */ + if (glob.charAt(pos) !== '[') { + throw new Error('not in a brace expression'); + } + /* c8 ignore stop */ + const ranges = []; + const negs = []; + let i = pos + 1; + let sawStart = false; + let uflag = false; + let escaping = false; + let negate = false; + let endPos = pos; + let rangeStart = ''; + WHILE: while (i < glob.length) { + const c = glob.charAt(i); + if ((c === '!' || c === '^') && i === pos + 1) { + negate = true; + i++; + continue; + } + if (c === ']' && sawStart && !escaping) { + endPos = i + 1; + break; + } + sawStart = true; + if (c === '\\') { + if (!escaping) { + escaping = true; + i++; + continue; + } + // escaped \ char, fall through and treat like normal char + } + if (c === '[' && !escaping) { + // either a posix class, a collation equivalent, or just a [ + for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) { + if (glob.startsWith(cls, i)) { + // invalid, [a-[] is fine, but not [a-[:alpha]] + if (rangeStart) { + return ['$.', false, glob.length - pos, true]; + } + i += cls.length; + if (neg) + negs.push(unip); + else + ranges.push(unip); + uflag = uflag || u; + continue WHILE; + } + } + } + // now it's just a normal character, effectively + escaping = false; + if (rangeStart) { + // throw this range away if it's not valid, but others + // can still match. + if (c > rangeStart) { + ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c)); + } + else if (c === rangeStart) { + ranges.push(braceEscape(c)); + } + rangeStart = ''; + i++; + continue; + } + // now might be the start of a range. + // can be either c-d or c-] or c] or c] at this point + if (glob.startsWith('-]', i + 1)) { + ranges.push(braceEscape(c + '-')); + i += 2; + continue; + } + if (glob.startsWith('-', i + 1)) { + rangeStart = c; + i += 2; + continue; + } + // not the start of a range, just a single character + ranges.push(braceEscape(c)); + i++; + } + if (endPos < i) { + // didn't see the end of the class, not a valid class, + // but might still be valid as a literal match. + return ['', false, 0, false]; + } + // if we got no ranges and no negates, then we have a range that + // cannot possibly match anything, and that poisons the whole glob + if (!ranges.length && !negs.length) { + return ['$.', false, glob.length - pos, true]; + } + // if we got one positive range, and it's a single character, then that's + // not actually a magic pattern, it's just that one literal character. + // we should not treat that as "magic", we should just return the literal + // character. [_] is a perfectly valid way to escape glob magic chars. + if (negs.length === 0 && + ranges.length === 1 && + /^\\?.$/.test(ranges[0]) && + !negate) { + const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]; + return [regexpEscape(r), false, endPos - pos, false]; + } + const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']'; + const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']'; + const comb = ranges.length && negs.length + ? '(' + sranges + '|' + snegs + ')' + : ranges.length + ? sranges + : snegs; + return [comb, uflag, endPos - pos, true]; +}; +exports.parseClass = parseClass; +//# sourceMappingURL=brace-expressions.js.map /***/ }), -/***/ 3469: -/***/ ((module) => { +/***/ 67350: +/***/ ((__unused_webpack_module, exports) => { -module.exports = eval("require")("@swc/wasm"); +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.escape = void 0; +/** + * Escape all magic characters in a glob pattern. + * + * If the {@link windowsPathsNoEscape | GlobOptions.windowsPathsNoEscape} + * option is used, then characters are escaped by wrapping in `[]`, because + * a magic character wrapped in a character class can only be satisfied by + * that exact character. In this mode, `\` is _not_ escaped, because it is + * not interpreted as a magic character, but instead as a path separator. + */ +const escape = (s, { windowsPathsNoEscape = false, } = {}) => { + // don't need to escape +@! because we escape the parens + // that make those magic, and escaping ! as [!] isn't valid, + // because [!]] is a valid glob class meaning not ']'. + return windowsPathsNoEscape + ? s.replace(/[?*()[\]]/g, '[$&]') + : s.replace(/[?*()[\]\\]/g, '\\$&'); +}; +exports.escape = escape; +//# sourceMappingURL=escape.js.map /***/ }), -/***/ 5115: -/***/ ((module) => { - -function webpackEmptyContext(req) { - var e = new Error("Cannot find module '" + req + "'"); - e.code = 'MODULE_NOT_FOUND'; - throw e; -} -webpackEmptyContext.keys = () => ([]); -webpackEmptyContext.resolve = webpackEmptyContext; -webpackEmptyContext.id = 5115; -module.exports = webpackEmptyContext; - -/***/ }), +/***/ 20681: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -/***/ 3833: -/***/ ((module) => { +"use strict"; -function webpackEmptyContext(req) { - var e = new Error("Cannot find module '" + req + "'"); - e.code = 'MODULE_NOT_FOUND'; - throw e; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.unescape = exports.escape = exports.AST = exports.Minimatch = exports.match = exports.makeRe = exports.braceExpand = exports.defaults = exports.filter = exports.GLOBSTAR = exports.sep = exports.minimatch = void 0; +const brace_expansion_1 = __importDefault(__nccwpck_require__(33717)); +const assert_valid_pattern_js_1 = __nccwpck_require__(37840); +const ast_js_1 = __nccwpck_require__(81227); +const escape_js_1 = __nccwpck_require__(67350); +const unescape_js_1 = __nccwpck_require__(40391); +const minimatch = (p, pattern, options = {}) => { + (0, assert_valid_pattern_js_1.assertValidPattern)(pattern); + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false; + } + return new Minimatch(pattern, options).match(p); +}; +exports.minimatch = minimatch; +// Optimized checking for the most common glob patterns. +const starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/; +const starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext); +const starDotExtTestDot = (ext) => (f) => f.endsWith(ext); +const starDotExtTestNocase = (ext) => { + ext = ext.toLowerCase(); + return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext); +}; +const starDotExtTestNocaseDot = (ext) => { + ext = ext.toLowerCase(); + return (f) => f.toLowerCase().endsWith(ext); +}; +const starDotStarRE = /^\*+\.\*+$/; +const starDotStarTest = (f) => !f.startsWith('.') && f.includes('.'); +const starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.'); +const dotStarRE = /^\.\*+$/; +const dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.'); +const starRE = /^\*+$/; +const starTest = (f) => f.length !== 0 && !f.startsWith('.'); +const starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..'; +const qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/; +const qmarksTestNocase = ([$0, ext = '']) => { + const noext = qmarksTestNoExt([$0]); + if (!ext) + return noext; + ext = ext.toLowerCase(); + return (f) => noext(f) && f.toLowerCase().endsWith(ext); +}; +const qmarksTestNocaseDot = ([$0, ext = '']) => { + const noext = qmarksTestNoExtDot([$0]); + if (!ext) + return noext; + ext = ext.toLowerCase(); + return (f) => noext(f) && f.toLowerCase().endsWith(ext); +}; +const qmarksTestDot = ([$0, ext = '']) => { + const noext = qmarksTestNoExtDot([$0]); + return !ext ? noext : (f) => noext(f) && f.endsWith(ext); +}; +const qmarksTest = ([$0, ext = '']) => { + const noext = qmarksTestNoExt([$0]); + return !ext ? noext : (f) => noext(f) && f.endsWith(ext); +}; +const qmarksTestNoExt = ([$0]) => { + const len = $0.length; + return (f) => f.length === len && !f.startsWith('.'); +}; +const qmarksTestNoExtDot = ([$0]) => { + const len = $0.length; + return (f) => f.length === len && f !== '.' && f !== '..'; +}; +/* c8 ignore start */ +const defaultPlatform = (typeof process === 'object' && process + ? (typeof process.env === 'object' && + process.env && + process.env.__MINIMATCH_TESTING_PLATFORM__) || + process.platform + : 'posix'); +const path = { + win32: { sep: '\\' }, + posix: { sep: '/' }, +}; +/* c8 ignore stop */ +exports.sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep; +exports.minimatch.sep = exports.sep; +exports.GLOBSTAR = Symbol('globstar **'); +exports.minimatch.GLOBSTAR = exports.GLOBSTAR; +// any single thing other than / +// don't need to escape / when using new RegExp() +const qmark = '[^/]'; +// * => any number of characters +const star = qmark + '*?'; +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +const twoStarDot = '(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?'; +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +const twoStarNoDot = '(?:(?!(?:\\/|^)\\.).)*?'; +const filter = (pattern, options = {}) => (p) => (0, exports.minimatch)(p, pattern, options); +exports.filter = filter; +exports.minimatch.filter = exports.filter; +const ext = (a, b = {}) => Object.assign({}, a, b); +const defaults = (def) => { + if (!def || typeof def !== 'object' || !Object.keys(def).length) { + return exports.minimatch; + } + const orig = exports.minimatch; + const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options)); + return Object.assign(m, { + Minimatch: class Minimatch extends orig.Minimatch { + constructor(pattern, options = {}) { + super(pattern, ext(def, options)); + } + static defaults(options) { + return orig.defaults(ext(def, options)).Minimatch; + } + }, + AST: class AST extends orig.AST { + /* c8 ignore start */ + constructor(type, parent, options = {}) { + super(type, parent, ext(def, options)); + } + /* c8 ignore stop */ + static fromGlob(pattern, options = {}) { + return orig.AST.fromGlob(pattern, ext(def, options)); + } + }, + unescape: (s, options = {}) => orig.unescape(s, ext(def, options)), + escape: (s, options = {}) => orig.escape(s, ext(def, options)), + filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)), + defaults: (options) => orig.defaults(ext(def, options)), + makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)), + braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)), + match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)), + sep: orig.sep, + GLOBSTAR: exports.GLOBSTAR, + }); +}; +exports.defaults = defaults; +exports.minimatch.defaults = exports.defaults; +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +const braceExpand = (pattern, options = {}) => { + (0, assert_valid_pattern_js_1.assertValidPattern)(pattern); + // Thanks to Yeting Li for + // improving this regexp to avoid a ReDOS vulnerability. + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + // shortcut. no need to expand. + return [pattern]; + } + return (0, brace_expansion_1.default)(pattern); +}; +exports.braceExpand = braceExpand; +exports.minimatch.braceExpand = exports.braceExpand; +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe(); +exports.makeRe = makeRe; +exports.minimatch.makeRe = exports.makeRe; +const match = (list, pattern, options = {}) => { + const mm = new Minimatch(pattern, options); + list = list.filter(f => mm.match(f)); + if (mm.options.nonull && !list.length) { + list.push(pattern); + } + return list; +}; +exports.match = match; +exports.minimatch.match = exports.match; +// replace stuff like \* with * +const globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/; +const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +class Minimatch { + options; + set; + pattern; + windowsPathsNoEscape; + nonegate; + negate; + comment; + empty; + preserveMultipleSlashes; + partial; + globSet; + globParts; + nocase; + isWindows; + platform; + windowsNoMagicRoot; + regexp; + constructor(pattern, options = {}) { + (0, assert_valid_pattern_js_1.assertValidPattern)(pattern); + options = options || {}; + this.options = options; + this.pattern = pattern; + this.platform = options.platform || defaultPlatform; + this.isWindows = this.platform === 'win32'; + this.windowsPathsNoEscape = + !!options.windowsPathsNoEscape || options.allowWindowsEscape === false; + if (this.windowsPathsNoEscape) { + this.pattern = this.pattern.replace(/\\/g, '/'); + } + this.preserveMultipleSlashes = !!options.preserveMultipleSlashes; + this.regexp = null; + this.negate = false; + this.nonegate = !!options.nonegate; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + this.nocase = !!this.options.nocase; + this.windowsNoMagicRoot = + options.windowsNoMagicRoot !== undefined + ? options.windowsNoMagicRoot + : !!(this.isWindows && this.nocase); + this.globSet = []; + this.globParts = []; + this.set = []; + // make the set of regexps etc. + this.make(); + } + hasMagic() { + if (this.options.magicalBraces && this.set.length > 1) { + return true; + } + for (const pattern of this.set) { + for (const part of pattern) { + if (typeof part !== 'string') + return true; + } + } + return false; + } + debug(..._) { } + make() { + const pattern = this.pattern; + const options = this.options; + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true; + return; + } + if (!pattern) { + this.empty = true; + return; + } + // step 1: figure out negation, etc. + this.parseNegate(); + // step 2: expand braces + this.globSet = [...new Set(this.braceExpand())]; + if (options.debug) { + this.debug = (...args) => console.error(...args); + } + this.debug(this.pattern, this.globSet); + // step 3: now we have a set, so turn each one into a series of + // path-portion matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + // + // First, we preprocess to make the glob pattern sets a bit simpler + // and deduped. There are some perf-killing patterns that can cause + // problems with a glob walk, but we can simplify them down a bit. + const rawGlobParts = this.globSet.map(s => this.slashSplit(s)); + this.globParts = this.preprocess(rawGlobParts); + this.debug(this.pattern, this.globParts); + // glob --> regexps + let set = this.globParts.map((s, _, __) => { + if (this.isWindows && this.windowsNoMagicRoot) { + // check if it's a drive or unc path. + const isUNC = s[0] === '' && + s[1] === '' && + (s[2] === '?' || !globMagic.test(s[2])) && + !globMagic.test(s[3]); + const isDrive = /^[a-z]:/i.test(s[0]); + if (isUNC) { + return [...s.slice(0, 4), ...s.slice(4).map(ss => this.parse(ss))]; + } + else if (isDrive) { + return [s[0], ...s.slice(1).map(ss => this.parse(ss))]; + } + } + return s.map(ss => this.parse(ss)); + }); + this.debug(this.pattern, set); + // filter out everything that didn't compile properly. + this.set = set.filter(s => s.indexOf(false) === -1); + // do not treat the ? in UNC paths as magic + if (this.isWindows) { + for (let i = 0; i < this.set.length; i++) { + const p = this.set[i]; + if (p[0] === '' && + p[1] === '' && + this.globParts[i][2] === '?' && + typeof p[3] === 'string' && + /^[a-z]:$/i.test(p[3])) { + p[2] = '?'; + } + } + } + this.debug(this.pattern, this.set); + } + // various transforms to equivalent pattern sets that are + // faster to process in a filesystem walk. The goal is to + // eliminate what we can, and push all ** patterns as far + // to the right as possible, even if it increases the number + // of patterns that we have to process. + preprocess(globParts) { + // if we're not in globstar mode, then turn all ** into * + if (this.options.noglobstar) { + for (let i = 0; i < globParts.length; i++) { + for (let j = 0; j < globParts[i].length; j++) { + if (globParts[i][j] === '**') { + globParts[i][j] = '*'; + } + } + } + } + const { optimizationLevel = 1 } = this.options; + if (optimizationLevel >= 2) { + // aggressive optimization for the purpose of fs walking + globParts = this.firstPhasePreProcess(globParts); + globParts = this.secondPhasePreProcess(globParts); + } + else if (optimizationLevel >= 1) { + // just basic optimizations to remove some .. parts + globParts = this.levelOneOptimize(globParts); + } + else { + globParts = this.adjascentGlobstarOptimize(globParts); + } + return globParts; + } + // just get rid of adjascent ** portions + adjascentGlobstarOptimize(globParts) { + return globParts.map(parts => { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let i = gs; + while (parts[i + 1] === '**') { + i++; + } + if (i !== gs) { + parts.splice(gs, i - gs); + } + } + return parts; + }); + } + // get rid of adjascent ** and resolve .. portions + levelOneOptimize(globParts) { + return globParts.map(parts => { + parts = parts.reduce((set, part) => { + const prev = set[set.length - 1]; + if (part === '**' && prev === '**') { + return set; + } + if (part === '..') { + if (prev && prev !== '..' && prev !== '.' && prev !== '**') { + set.pop(); + return set; + } + } + set.push(part); + return set; + }, []); + return parts.length === 0 ? [''] : parts; + }); + } + levelTwoFileOptimize(parts) { + if (!Array.isArray(parts)) { + parts = this.slashSplit(parts); + } + let didSomething = false; + do { + didSomething = false; + //
// -> 
/
+            if (!this.preserveMultipleSlashes) {
+                for (let i = 1; i < parts.length - 1; i++) {
+                    const p = parts[i];
+                    // don't squeeze out UNC patterns
+                    if (i === 1 && p === '' && parts[0] === '')
+                        continue;
+                    if (p === '.' || p === '') {
+                        didSomething = true;
+                        parts.splice(i, 1);
+                        i--;
+                    }
+                }
+                if (parts[0] === '.' &&
+                    parts.length === 2 &&
+                    (parts[1] === '.' || parts[1] === '')) {
+                    didSomething = true;
+                    parts.pop();
+                }
+            }
+            // 
/

/../ ->

/
+            let dd = 0;
+            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                const p = parts[dd - 1];
+                if (p && p !== '.' && p !== '..' && p !== '**') {
+                    didSomething = true;
+                    parts.splice(dd - 1, 2);
+                    dd -= 2;
+                }
+            }
+        } while (didSomething);
+        return parts.length === 0 ? [''] : parts;
+    }
+    // First phase: single-pattern processing
+    // 
 is 1 or more portions
+    //  is 1 or more portions
+    // 

is any portion other than ., .., '', or ** + // is . or '' + // + // **/.. is *brutal* for filesystem walking performance, because + // it effectively resets the recursive walk each time it occurs, + // and ** cannot be reduced out by a .. pattern part like a regexp + // or most strings (other than .., ., and '') can be. + // + //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + //

// -> 
/
+    // 
/

/../ ->

/
+    // **/**/ -> **/
+    //
+    // **/*/ -> */**/ <== not valid because ** doesn't follow
+    // this WOULD be allowed if ** did follow symlinks, or * didn't
+    firstPhasePreProcess(globParts) {
+        let didSomething = false;
+        do {
+            didSomething = false;
+            // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + for (let parts of globParts) { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let gss = gs; + while (parts[gss + 1] === '**') { + //

/**/**/ -> 
/**/
+                        gss++;
+                    }
+                    // eg, if gs is 2 and gss is 4, that means we have 3 **
+                    // parts, and can remove 2 of them.
+                    if (gss > gs) {
+                        parts.splice(gs + 1, gss - gs);
+                    }
+                    let next = parts[gs + 1];
+                    const p = parts[gs + 2];
+                    const p2 = parts[gs + 3];
+                    if (next !== '..')
+                        continue;
+                    if (!p ||
+                        p === '.' ||
+                        p === '..' ||
+                        !p2 ||
+                        p2 === '.' ||
+                        p2 === '..') {
+                        continue;
+                    }
+                    didSomething = true;
+                    // edit parts in place, and push the new one
+                    parts.splice(gs, 1);
+                    const other = parts.slice(0);
+                    other[gs] = '**';
+                    globParts.push(other);
+                    gs--;
+                }
+                // 
// -> 
/
+                if (!this.preserveMultipleSlashes) {
+                    for (let i = 1; i < parts.length - 1; i++) {
+                        const p = parts[i];
+                        // don't squeeze out UNC patterns
+                        if (i === 1 && p === '' && parts[0] === '')
+                            continue;
+                        if (p === '.' || p === '') {
+                            didSomething = true;
+                            parts.splice(i, 1);
+                            i--;
+                        }
+                    }
+                    if (parts[0] === '.' &&
+                        parts.length === 2 &&
+                        (parts[1] === '.' || parts[1] === '')) {
+                        didSomething = true;
+                        parts.pop();
+                    }
+                }
+                // 
/

/../ ->

/
+                let dd = 0;
+                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                    const p = parts[dd - 1];
+                    if (p && p !== '.' && p !== '..' && p !== '**') {
+                        didSomething = true;
+                        const needDot = dd === 1 && parts[dd + 1] === '**';
+                        const splin = needDot ? ['.'] : [];
+                        parts.splice(dd - 1, 2, ...splin);
+                        if (parts.length === 0)
+                            parts.push('');
+                        dd -= 2;
+                    }
+                }
+            }
+        } while (didSomething);
+        return globParts;
+    }
+    // second phase: multi-pattern dedupes
+    // {
/*/,
/

/} ->

/*/
+    // {
/,
/} -> 
/
+    // {
/**/,
/} -> 
/**/
+    //
+    // {
/**/,
/**/

/} ->

/**/
+    // ^-- not valid because ** doens't follow symlinks
+    secondPhasePreProcess(globParts) {
+        for (let i = 0; i < globParts.length - 1; i++) {
+            for (let j = i + 1; j < globParts.length; j++) {
+                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
+                if (!matched)
+                    continue;
+                globParts[i] = matched;
+                globParts[j] = [];
+            }
+        }
+        return globParts.filter(gs => gs.length);
+    }
+    partsMatch(a, b, emptyGSMatch = false) {
+        let ai = 0;
+        let bi = 0;
+        let result = [];
+        let which = '';
+        while (ai < a.length && bi < b.length) {
+            if (a[ai] === b[bi]) {
+                result.push(which === 'b' ? b[bi] : a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {
+                result.push(a[ai]);
+                ai++;
+            }
+            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {
+                result.push(b[bi]);
+                bi++;
+            }
+            else if (a[ai] === '*' &&
+                b[bi] &&
+                (this.options.dot || !b[bi].startsWith('.')) &&
+                b[bi] !== '**') {
+                if (which === 'b')
+                    return false;
+                which = 'a';
+                result.push(a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (b[bi] === '*' &&
+                a[ai] &&
+                (this.options.dot || !a[ai].startsWith('.')) &&
+                a[ai] !== '**') {
+                if (which === 'a')
+                    return false;
+                which = 'b';
+                result.push(b[bi]);
+                ai++;
+                bi++;
+            }
+            else {
+                return false;
+            }
+        }
+        // if we fall out of the loop, it means they two are identical
+        // as long as their lengths match
+        return a.length === b.length && result;
+    }
+    parseNegate() {
+        if (this.nonegate)
+            return;
+        const pattern = this.pattern;
+        let negate = false;
+        let negateOffset = 0;
+        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
+            negate = !negate;
+            negateOffset++;
+        }
+        if (negateOffset)
+            this.pattern = pattern.slice(negateOffset);
+        this.negate = negate;
+    }
+    // set partial to true to test if, for example,
+    // "/a/b" matches the start of "/*/b/*/d"
+    // Partial means, if you run out of file before you run
+    // out of pattern, then that's fine, as long as all
+    // the parts match.
+    matchOne(file, pattern, partial = false) {
+        const options = this.options;
+        // UNC paths like //?/X:/... can match X:/... and vice versa
+        // Drive letters in absolute drive or unc paths are always compared
+        // case-insensitively.
+        if (this.isWindows) {
+            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);
+            const fileUNC = !fileDrive &&
+                file[0] === '' &&
+                file[1] === '' &&
+                file[2] === '?' &&
+                /^[a-z]:$/i.test(file[3]);
+            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);
+            const patternUNC = !patternDrive &&
+                pattern[0] === '' &&
+                pattern[1] === '' &&
+                pattern[2] === '?' &&
+                typeof pattern[3] === 'string' &&
+                /^[a-z]:$/i.test(pattern[3]);
+            const fdi = fileUNC ? 3 : fileDrive ? 0 : undefined;
+            const pdi = patternUNC ? 3 : patternDrive ? 0 : undefined;
+            if (typeof fdi === 'number' && typeof pdi === 'number') {
+                const [fd, pd] = [file[fdi], pattern[pdi]];
+                if (fd.toLowerCase() === pd.toLowerCase()) {
+                    pattern[pdi] = fd;
+                    if (pdi > fdi) {
+                        pattern = pattern.slice(pdi);
+                    }
+                    else if (fdi > pdi) {
+                        file = file.slice(fdi);
+                    }
+                }
+            }
+        }
+        // resolve and reduce . and .. portions in the file as well.
+        // dont' need to do the second phase, because it's only one string[]
+        const { optimizationLevel = 1 } = this.options;
+        if (optimizationLevel >= 2) {
+            file = this.levelTwoFileOptimize(file);
+        }
+        this.debug('matchOne', this, { file, pattern });
+        this.debug('matchOne', file.length, pattern.length);
+        for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
+            this.debug('matchOne loop');
+            var p = pattern[pi];
+            var f = file[fi];
+            this.debug(pattern, p, f);
+            // should be impossible.
+            // some invalid regexp stuff in the set.
+            /* c8 ignore start */
+            if (p === false) {
+                return false;
+            }
+            /* c8 ignore stop */
+            if (p === exports.GLOBSTAR) {
+                this.debug('GLOBSTAR', [pattern, p, f]);
+                // "**"
+                // a/**/b/**/c would match the following:
+                // a/b/x/y/z/c
+                // a/x/y/z/b/c
+                // a/b/x/b/x/c
+                // a/b/c
+                // To do this, take the rest of the pattern after
+                // the **, and see if it would match the file remainder.
+                // If so, return success.
+                // If not, the ** "swallows" a segment, and try again.
+                // This is recursively awful.
+                //
+                // a/**/b/**/c matching a/b/x/y/z/c
+                // - a matches a
+                // - doublestar
+                //   - matchOne(b/x/y/z/c, b/**/c)
+                //     - b matches b
+                //     - doublestar
+                //       - matchOne(x/y/z/c, c) -> no
+                //       - matchOne(y/z/c, c) -> no
+                //       - matchOne(z/c, c) -> no
+                //       - matchOne(c, c) yes, hit
+                var fr = fi;
+                var pr = pi + 1;
+                if (pr === pl) {
+                    this.debug('** at the end');
+                    // a ** at the end will just swallow the rest.
+                    // We have found a match.
+                    // however, it will not swallow /.x, unless
+                    // options.dot is set.
+                    // . and .. are *never* matched by **, for explosively
+                    // exponential reasons.
+                    for (; fi < fl; fi++) {
+                        if (file[fi] === '.' ||
+                            file[fi] === '..' ||
+                            (!options.dot && file[fi].charAt(0) === '.'))
+                            return false;
+                    }
+                    return true;
+                }
+                // ok, let's see if we can swallow whatever we can.
+                while (fr < fl) {
+                    var swallowee = file[fr];
+                    this.debug('\nglobstar while', file, fr, pattern, pr, swallowee);
+                    // XXX remove this slice.  Just pass the start index.
+                    if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
+                        this.debug('globstar found match!', fr, fl, swallowee);
+                        // found a match.
+                        return true;
+                    }
+                    else {
+                        // can't swallow "." or ".." ever.
+                        // can only swallow ".foo" when explicitly asked.
+                        if (swallowee === '.' ||
+                            swallowee === '..' ||
+                            (!options.dot && swallowee.charAt(0) === '.')) {
+                            this.debug('dot detected!', file, fr, pattern, pr);
+                            break;
+                        }
+                        // ** swallows a segment, and continue.
+                        this.debug('globstar swallow a segment, and continue');
+                        fr++;
+                    }
+                }
+                // no match was found.
+                // However, in partial mode, we can't say this is necessarily over.
+                /* c8 ignore start */
+                if (partial) {
+                    // ran out of file
+                    this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
+                    if (fr === fl) {
+                        return true;
+                    }
+                }
+                /* c8 ignore stop */
+                return false;
+            }
+            // something other than **
+            // non-magic patterns just have to match exactly
+            // patterns with magic have been turned into regexps.
+            let hit;
+            if (typeof p === 'string') {
+                hit = f === p;
+                this.debug('string match', p, f, hit);
+            }
+            else {
+                hit = p.test(f);
+                this.debug('pattern match', p, f, hit);
+            }
+            if (!hit)
+                return false;
+        }
+        // Note: ending in / means that we'll get a final ""
+        // at the end of the pattern.  This can only match a
+        // corresponding "" at the end of the file.
+        // If the file ends in /, then it can only match a
+        // a pattern that ends in /, unless the pattern just
+        // doesn't have any more for it. But, a/b/ should *not*
+        // match "a/b/*", even though "" matches against the
+        // [^/]*? pattern, except in partial mode, where it might
+        // simply not be reached yet.
+        // However, a/b/ should still satisfy a/*
+        // now either we fell off the end of the pattern, or we're done.
+        if (fi === fl && pi === pl) {
+            // ran out of pattern and filename at the same time.
+            // an exact hit!
+            return true;
+        }
+        else if (fi === fl) {
+            // ran out of file, but still had pattern left.
+            // this is ok if we're doing the match as part of
+            // a glob fs traversal.
+            return partial;
+        }
+        else if (pi === pl) {
+            // ran out of pattern, still have file left.
+            // this is only acceptable if we're on the very last
+            // empty segment of a file with a trailing slash.
+            // a/* should match a/b/
+            return fi === fl - 1 && file[fi] === '';
+            /* c8 ignore start */
+        }
+        else {
+            // should be unreachable.
+            throw new Error('wtf?');
+        }
+        /* c8 ignore stop */
+    }
+    braceExpand() {
+        return (0, exports.braceExpand)(this.pattern, this.options);
+    }
+    parse(pattern) {
+        (0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
+        const options = this.options;
+        // shortcuts
+        if (pattern === '**')
+            return exports.GLOBSTAR;
+        if (pattern === '')
+            return '';
+        // far and away, the most common glob pattern parts are
+        // *, *.*, and *.  Add a fast check method for those.
+        let m;
+        let fastTest = null;
+        if ((m = pattern.match(starRE))) {
+            fastTest = options.dot ? starTestDot : starTest;
+        }
+        else if ((m = pattern.match(starDotExtRE))) {
+            fastTest = (options.nocase
+                ? options.dot
+                    ? starDotExtTestNocaseDot
+                    : starDotExtTestNocase
+                : options.dot
+                    ? starDotExtTestDot
+                    : starDotExtTest)(m[1]);
+        }
+        else if ((m = pattern.match(qmarksRE))) {
+            fastTest = (options.nocase
+                ? options.dot
+                    ? qmarksTestNocaseDot
+                    : qmarksTestNocase
+                : options.dot
+                    ? qmarksTestDot
+                    : qmarksTest)(m);
+        }
+        else if ((m = pattern.match(starDotStarRE))) {
+            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
+        }
+        else if ((m = pattern.match(dotStarRE))) {
+            fastTest = dotStarTest;
+        }
+        const re = ast_js_1.AST.fromGlob(pattern, this.options).toMMPattern();
+        return fastTest ? Object.assign(re, { test: fastTest }) : re;
+    }
+    makeRe() {
+        if (this.regexp || this.regexp === false)
+            return this.regexp;
+        // at this point, this.set is a 2d array of partial
+        // pattern strings, or "**".
+        //
+        // It's better to use .match().  This function shouldn't
+        // be used, really, but it's pretty convenient sometimes,
+        // when you just want to work with a regex.
+        const set = this.set;
+        if (!set.length) {
+            this.regexp = false;
+            return this.regexp;
+        }
+        const options = this.options;
+        const twoStar = options.noglobstar
+            ? star
+            : options.dot
+                ? twoStarDot
+                : twoStarNoDot;
+        const flags = new Set(options.nocase ? ['i'] : []);
+        // regexpify non-globstar patterns
+        // if ** is only item, then we just do one twoStar
+        // if ** is first, and there are more, prepend (\/|twoStar\/)? to next
+        // if ** is last, append (\/twoStar|) to previous
+        // if ** is in the middle, append (\/|\/twoStar\/) to previous
+        // then filter out GLOBSTAR symbols
+        let re = set
+            .map(pattern => {
+            const pp = pattern.map(p => {
+                if (p instanceof RegExp) {
+                    for (const f of p.flags.split(''))
+                        flags.add(f);
+                }
+                return typeof p === 'string'
+                    ? regExpEscape(p)
+                    : p === exports.GLOBSTAR
+                        ? exports.GLOBSTAR
+                        : p._src;
+            });
+            pp.forEach((p, i) => {
+                const next = pp[i + 1];
+                const prev = pp[i - 1];
+                if (p !== exports.GLOBSTAR || prev === exports.GLOBSTAR) {
+                    return;
+                }
+                if (prev === undefined) {
+                    if (next !== undefined && next !== exports.GLOBSTAR) {
+                        pp[i + 1] = '(?:\\/|' + twoStar + '\\/)?' + next;
+                    }
+                    else {
+                        pp[i] = twoStar;
+                    }
+                }
+                else if (next === undefined) {
+                    pp[i - 1] = prev + '(?:\\/|' + twoStar + ')?';
+                }
+                else if (next !== exports.GLOBSTAR) {
+                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
+                    pp[i + 1] = exports.GLOBSTAR;
+                }
+            });
+            return pp.filter(p => p !== exports.GLOBSTAR).join('/');
+        })
+            .join('|');
+        // need to wrap in parens if we had more than one thing with |,
+        // otherwise only the first will be anchored to ^ and the last to $
+        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];
+        // must match entire pattern
+        // ending in a * or ** will make it less strict.
+        re = '^' + open + re + close + '$';
+        // can match anything, as long as it's not this.
+        if (this.negate)
+            re = '^(?!' + re + ').+$';
+        try {
+            this.regexp = new RegExp(re, [...flags].join(''));
+            /* c8 ignore start */
+        }
+        catch (ex) {
+            // should be impossible
+            this.regexp = false;
+        }
+        /* c8 ignore stop */
+        return this.regexp;
+    }
+    slashSplit(p) {
+        // if p starts with // on windows, we preserve that
+        // so that UNC paths aren't broken.  Otherwise, any number of
+        // / characters are coalesced into one, unless
+        // preserveMultipleSlashes is set to true.
+        if (this.preserveMultipleSlashes) {
+            return p.split('/');
+        }
+        else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
+            // add an extra '' for the one we lose
+            return ['', ...p.split(/\/+/)];
+        }
+        else {
+            return p.split(/\/+/);
+        }
+    }
+    match(f, partial = this.partial) {
+        this.debug('match', f, this.pattern);
+        // short-circuit in the case of busted things.
+        // comments, etc.
+        if (this.comment) {
+            return false;
+        }
+        if (this.empty) {
+            return f === '';
+        }
+        if (f === '/' && partial) {
+            return true;
+        }
+        const options = this.options;
+        // windows: need to use /, not \
+        if (this.isWindows) {
+            f = f.split('\\').join('/');
+        }
+        // treat the test path as a set of pathparts.
+        const ff = this.slashSplit(f);
+        this.debug(this.pattern, 'split', ff);
+        // just ONE of the pattern sets in this.set needs to match
+        // in order for it to be valid.  If negating, then just one
+        // match means that we have failed.
+        // Either way, return on the first hit.
+        const set = this.set;
+        this.debug(this.pattern, 'set', set);
+        // Find the basename of the path by looking for the last non-empty segment
+        let filename = ff[ff.length - 1];
+        if (!filename) {
+            for (let i = ff.length - 2; !filename && i >= 0; i--) {
+                filename = ff[i];
+            }
+        }
+        for (let i = 0; i < set.length; i++) {
+            const pattern = set[i];
+            let file = ff;
+            if (options.matchBase && pattern.length === 1) {
+                file = [filename];
+            }
+            const hit = this.matchOne(file, pattern, partial);
+            if (hit) {
+                if (options.flipNegate) {
+                    return true;
+                }
+                return !this.negate;
+            }
+        }
+        // didn't get any hits.  this is success if it's a negative
+        // pattern, failure otherwise.
+        if (options.flipNegate) {
+            return false;
+        }
+        return this.negate;
+    }
+    static defaults(def) {
+        return exports.minimatch.defaults(def).Minimatch;
+    }
 }
-webpackEmptyContext.keys = () => ([]);
-webpackEmptyContext.resolve = webpackEmptyContext;
-webpackEmptyContext.id = 3833;
-module.exports = webpackEmptyContext;
-
-/***/ }),
-
-/***/ 9491:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("assert");
-
-/***/ }),
-
-/***/ 4300:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("buffer");
-
-/***/ }),
-
-/***/ 8493:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("child_process");
-
-/***/ }),
-
-/***/ 6206:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("console");
-
-/***/ }),
-
-/***/ 2057:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("constants");
-
-/***/ }),
-
-/***/ 6113:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("crypto");
-
-/***/ }),
-
-/***/ 2361:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("events");
-
-/***/ }),
-
-/***/ 7147:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("fs");
-
-/***/ }),
-
-/***/ 3292:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("fs/promises");
-
-/***/ }),
-
-/***/ 3685:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("http");
-
-/***/ }),
-
-/***/ 5687:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("https");
-
-/***/ }),
-
-/***/ 1405:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("inspector");
-
-/***/ }),
-
-/***/ 8188:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("module");
-
-/***/ }),
-
-/***/ 1808:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("net");
+exports.Minimatch = Minimatch;
+/* c8 ignore start */
+var ast_js_2 = __nccwpck_require__(81227);
+Object.defineProperty(exports, "AST", ({ enumerable: true, get: function () { return ast_js_2.AST; } }));
+var escape_js_2 = __nccwpck_require__(67350);
+Object.defineProperty(exports, "escape", ({ enumerable: true, get: function () { return escape_js_2.escape; } }));
+var unescape_js_2 = __nccwpck_require__(40391);
+Object.defineProperty(exports, "unescape", ({ enumerable: true, get: function () { return unescape_js_2.unescape; } }));
+/* c8 ignore stop */
+exports.minimatch.AST = ast_js_1.AST;
+exports.minimatch.Minimatch = Minimatch;
+exports.minimatch.escape = escape_js_1.escape;
+exports.minimatch.unescape = unescape_js_1.unescape;
+//# sourceMappingURL=index.js.map
 
 /***/ }),
 
-/***/ 7561:
-/***/ ((module) => {
+/***/ 40391:
+/***/ ((__unused_webpack_module, exports) => {
 
 "use strict";
-module.exports = require("node:fs");
-
-/***/ }),
-
-/***/ 2033:
-/***/ ((module) => {
 
-"use strict";
-module.exports = require("node:module");
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.unescape = void 0;
+/**
+ * Un-escape a string that has been escaped with {@link escape}.
+ *
+ * If the {@link windowsPathsNoEscape} option is used, then square-brace
+ * escapes are removed, but not backslash escapes.  For example, it will turn
+ * the string `'[*]'` into `*`, but it will not turn `'\\*'` into `'*'`,
+ * becuase `\` is a path separator in `windowsPathsNoEscape` mode.
+ *
+ * When `windowsPathsNoEscape` is not set, then both brace escapes and
+ * backslash escapes are removed.
+ *
+ * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
+ * or unescaped.
+ */
+const unescape = (s, { windowsPathsNoEscape = false, } = {}) => {
+    return windowsPathsNoEscape
+        ? s.replace(/\[([^\/\\])\]/g, '$1')
+        : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2').replace(/\\([^\/])/g, '$1');
+};
+exports.unescape = unescape;
+//# sourceMappingURL=unescape.js.map
 
 /***/ }),
 
-/***/ 9411:
-/***/ ((module) => {
+/***/ 45205:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
-module.exports = require("node:path");
-
-/***/ }),
 
-/***/ 410:
-/***/ ((module) => {
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.renamePropertyWithStableKeys = exports.toOldFormat = exports.toNewFormat = exports.isAngularPluginInstalled = exports.shouldMergeAngularProjects = exports.NxAngularJsonPlugin = exports.NX_ANGULAR_JSON_PLUGIN_NAME = void 0;
+const fs_1 = __nccwpck_require__(57147);
+const path = __nccwpck_require__(71017);
+const fileutils_1 = __nccwpck_require__(40910);
+exports.NX_ANGULAR_JSON_PLUGIN_NAME = 'nx-angular-json-plugin';
+exports.NxAngularJsonPlugin = {
+    name: exports.NX_ANGULAR_JSON_PLUGIN_NAME,
+    createNodes: [
+        'angular.json',
+        (f, _, ctx) => ({
+            projects: readAngularJson(ctx.workspaceRoot),
+        }),
+    ],
+};
+exports["default"] = exports.NxAngularJsonPlugin;
+function shouldMergeAngularProjects(root, includeProjectsFromAngularJson) {
+    if ((0, fs_1.existsSync)(path.join(root, 'angular.json')) &&
+        // Include projects from angular.json if explicitly required.
+        // e.g. when invoked from `packages/devkit/src/utils/convert-nx-executor.ts`
+        (includeProjectsFromAngularJson ||
+            // Or if a workspace has `@nrwl/angular`/`@nx/angular` installed then projects from `angular.json` to be considered by Nx.
+            isAngularPluginInstalled())) {
+        return true;
+    }
+    else {
+        return false;
+    }
+}
+exports.shouldMergeAngularProjects = shouldMergeAngularProjects;
+function isAngularPluginInstalled() {
+    try {
+        // nx-ignore-next-line
+        require.resolve('@nx/angular');
+        return true;
+    }
+    catch {
+        try {
+            require.resolve('@nrwl/angular');
+            return true;
+        }
+        catch {
+            return false;
+        }
+    }
+}
+exports.isAngularPluginInstalled = isAngularPluginInstalled;
+function readAngularJson(angularCliWorkspaceRoot) {
+    return toNewFormat((0, fileutils_1.readJsonFile)(path.join(angularCliWorkspaceRoot, 'angular.json'))).projects;
+}
+function toNewFormat(w) {
+    if (!w.projects) {
+        return w;
+    }
+    for (const name in w.projects ?? {}) {
+        const projectConfig = w.projects[name];
+        if (projectConfig.architect) {
+            renamePropertyWithStableKeys(projectConfig, 'architect', 'targets');
+        }
+        if (projectConfig.schematics) {
+            renamePropertyWithStableKeys(projectConfig, 'schematics', 'generators');
+        }
+        if (!projectConfig.name) {
+            projectConfig.name = name;
+        }
+        Object.values(projectConfig.targets || {}).forEach((target) => {
+            if (target.builder !== undefined) {
+                renamePropertyWithStableKeys(target, 'builder', 'executor');
+            }
+        });
+    }
+    if (w.schematics) {
+        renamePropertyWithStableKeys(w, 'schematics', 'generators');
+    }
+    if (w.version !== 2) {
+        w.version = 2;
+    }
+    return w;
+}
+exports.toNewFormat = toNewFormat;
+function toOldFormat(w) {
+    if (w.projects) {
+        for (const name in w.projects) {
+            const projectConfig = w.projects[name];
+            if (typeof projectConfig === 'string') {
+                throw new Error("'project.json' files are incompatible with version 1 workspace schemas.");
+            }
+            if (projectConfig.targets) {
+                renamePropertyWithStableKeys(projectConfig, 'targets', 'architect');
+            }
+            if (projectConfig.generators) {
+                renamePropertyWithStableKeys(projectConfig, 'generators', 'schematics');
+            }
+            delete projectConfig.name;
+            Object.values(projectConfig.architect || {}).forEach((target) => {
+                if (target.executor !== undefined) {
+                    renamePropertyWithStableKeys(target, 'executor', 'builder');
+                }
+            });
+        }
+    }
+    if (w.generators) {
+        renamePropertyWithStableKeys(w, 'generators', 'schematics');
+    }
+    if (w.version !== 1) {
+        w.version = 1;
+    }
+    return w;
+}
+exports.toOldFormat = toOldFormat;
+// we have to do it this way to preserve the order of properties
+// not to screw up the formatting
+function renamePropertyWithStableKeys(obj, from, to) {
+    const copy = { ...obj };
+    Object.keys(obj).forEach((k) => {
+        delete obj[k];
+    });
+    Object.keys(copy).forEach((k) => {
+        if (k === from) {
+            obj[to] = copy[k];
+        }
+        else {
+            obj[k] = copy[k];
+        }
+    });
+}
+exports.renamePropertyWithStableKeys = renamePropertyWithStableKeys;
 
-"use strict";
-module.exports = require("node:path/posix");
 
 /***/ }),
 
-/***/ 1041:
-/***/ ((module) => {
+/***/ 84678:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
-module.exports = require("node:url");
-
-/***/ }),
 
-/***/ 2037:
-/***/ ((module) => {
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.getExecutorInformation = exports.normalizeExecutorSchema = void 0;
+const path_1 = __nccwpck_require__(71017);
+const plugins_1 = __nccwpck_require__(69461);
+const fileutils_1 = __nccwpck_require__(40910);
+const schema_utils_1 = __nccwpck_require__(62607);
+const installation_directory_1 = __nccwpck_require__(87836);
+function normalizeExecutorSchema(schema) {
+    const version = (schema.version ??= 1);
+    return {
+        version,
+        outputCapture: schema.outputCapture ?? version < 2 ? 'direct-nodejs' : 'pipe',
+        properties: !schema.properties || typeof schema.properties !== 'object'
+            ? {}
+            : schema.properties,
+        ...schema,
+    };
+}
+exports.normalizeExecutorSchema = normalizeExecutorSchema;
+function cacheKey(nodeModule, executor, root) {
+    return `${root}:${nodeModule}:${executor}`;
+}
+const cachedExecutorInformation = {};
+function getExecutorInformation(nodeModule, executor, root, projects) {
+    try {
+        const key = cacheKey(nodeModule, executor, root);
+        if (cachedExecutorInformation[key])
+            return cachedExecutorInformation[key];
+        const { executorsFilePath, executorConfig, isNgCompat } = readExecutorJson(nodeModule, executor, root, projects);
+        const executorsDir = (0, path_1.dirname)(executorsFilePath);
+        const schemaPath = (0, schema_utils_1.resolveSchema)(executorConfig.schema, executorsDir);
+        const schema = normalizeExecutorSchema((0, fileutils_1.readJsonFile)(schemaPath));
+        const implementationFactory = (0, schema_utils_1.getImplementationFactory)(executorConfig.implementation, executorsDir);
+        const batchImplementationFactory = executorConfig.batchImplementation
+            ? (0, schema_utils_1.getImplementationFactory)(executorConfig.batchImplementation, executorsDir)
+            : null;
+        const hasherFactory = executorConfig.hasher
+            ? (0, schema_utils_1.getImplementationFactory)(executorConfig.hasher, executorsDir)
+            : null;
+        const res = {
+            schema,
+            implementationFactory,
+            batchImplementationFactory,
+            hasherFactory,
+            isNgCompat,
+            isNxExecutor: !isNgCompat,
+        };
+        cachedExecutorInformation[key] = res;
+        return res;
+    }
+    catch (e) {
+        throw new Error(`Unable to resolve ${nodeModule}:${executor}.\n${e.message}`);
+    }
+}
+exports.getExecutorInformation = getExecutorInformation;
+function readExecutorJson(nodeModule, executor, root, projects) {
+    const { json: packageJson, path: packageJsonPath } = (0, plugins_1.readPluginPackageJson)(nodeModule, projects, root
+        ? [root, __dirname, process.cwd(), ...(0, installation_directory_1.getNxRequirePaths)()]
+        : [__dirname, process.cwd(), ...(0, installation_directory_1.getNxRequirePaths)()]);
+    const executorsFile = packageJson.executors ?? packageJson.builders;
+    if (!executorsFile) {
+        throw new Error(`The "${nodeModule}" package does not support Nx executors.`);
+    }
+    const executorsFilePath = /*require.resolve*/(__nccwpck_require__(87739).resolve((0, path_1.join)((0, path_1.dirname)(packageJsonPath), executorsFile)));
+    const executorsJson = (0, fileutils_1.readJsonFile)(executorsFilePath);
+    const executorConfig = executorsJson.executors?.[executor] || executorsJson.builders?.[executor];
+    if (!executorConfig) {
+        throw new Error(`Cannot find executor '${executor}' in ${executorsFilePath}.`);
+    }
+    const isNgCompat = !executorsJson.executors?.[executor];
+    return { executorsFilePath, executorConfig, isNgCompat };
+}
 
-"use strict";
-module.exports = require("os");
 
 /***/ }),
 
-/***/ 1017:
-/***/ ((module) => {
+/***/ 29966:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
-module.exports = require("path");
 
-/***/ }),
-
-/***/ 4074:
-/***/ ((module) => {
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.findMatchingProjectInCwd = exports.calculateDefaultProjectName = void 0;
+const find_project_for_path_1 = __nccwpck_require__(69621);
+const path_1 = __nccwpck_require__(71017);
+function calculateDefaultProjectName(cwd, root, { projects }, nxJson) {
+    const relativeCwd = (0, path_1.relative)(root, cwd).replace(/\\/g, '/') ?? null;
+    if (relativeCwd !== null) {
+        const matchingProject = findMatchingProjectInCwd(projects, relativeCwd);
+        // We have found a project
+        if (matchingProject) {
+            // That is not at the root
+            if (projects[matchingProject].root !== '.' &&
+                projects[matchingProject].root !== '') {
+                return matchingProject;
+                // But its at the root, and NX_DEFAULT_PROJECT is set
+            }
+            else if (process.env.NX_DEFAULT_PROJECT) {
+                return process.env.NX_DEFAULT_PROJECT;
+                // Its root, and NX_DEFAULT_PROJECT is not set
+            }
+            else {
+                return matchingProject;
+            }
+        }
+    }
+    // There was no matching project in cwd.
+    return (process.env.NX_DEFAULT_PROJECT ??
+        nxJson.cli?.defaultProjectName ??
+        nxJson?.defaultProject);
+}
+exports.calculateDefaultProjectName = calculateDefaultProjectName;
+function findMatchingProjectInCwd(projects, relativeCwd) {
+    const projectRootMappings = new Map();
+    for (const projectName of Object.keys(projects)) {
+        const { root } = projects[projectName];
+        projectRootMappings.set((0, find_project_for_path_1.normalizeProjectRoot)(root), projectName);
+    }
+    const matchingProject = (0, find_project_for_path_1.findProjectForPath)(relativeCwd, projectRootMappings);
+    return matchingProject;
+}
+exports.findMatchingProjectInCwd = findMatchingProjectInCwd;
 
-"use strict";
-module.exports = require("perf_hooks");
 
 /***/ }),
 
-/***/ 4521:
-/***/ ((module) => {
+/***/ 34333:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
-module.exports = require("readline");
 
-/***/ }),
-
-/***/ 8102:
-/***/ ((module) => {
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.readNxJson = exports.workspaceLayout = void 0;
+const nx_json_1 = __nccwpck_require__(21173);
+/**
+ * Returns information about where apps and libs will be created.
+ */
+function workspaceLayout() {
+    const nxJson = (0, nx_json_1.readNxJson)();
+    return {
+        appsDir: nxJson.workspaceLayout?.appsDir ?? 'apps',
+        libsDir: nxJson.workspaceLayout?.libsDir ?? 'libs',
+    };
+}
+exports.workspaceLayout = workspaceLayout;
+var nx_json_2 = __nccwpck_require__(21173);
+Object.defineProperty(exports, "readNxJson", ({ enumerable: true, get: function () { return nx_json_2.readNxJson; } }));
 
-"use strict";
-module.exports = require("repl");
 
 /***/ }),
 
-/***/ 2781:
-/***/ ((module) => {
+/***/ 21173:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
-module.exports = require("stream");
-
-/***/ }),
 
-/***/ 1576:
-/***/ ((module) => {
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.hasNxJson = exports.readNxJson = void 0;
+const fs_1 = __nccwpck_require__(57147);
+const path_1 = __nccwpck_require__(71017);
+const fileutils_1 = __nccwpck_require__(40910);
+const workspace_root_1 = __nccwpck_require__(64393);
+function readNxJson(root = workspace_root_1.workspaceRoot) {
+    const nxJson = (0, path_1.join)(root, 'nx.json');
+    if ((0, fs_1.existsSync)(nxJson)) {
+        const nxJsonConfiguration = (0, fileutils_1.readJsonFile)(nxJson);
+        if (nxJsonConfiguration.extends) {
+            const extendedNxJsonPath = require.resolve(nxJsonConfiguration.extends, {
+                paths: [(0, path_1.dirname)(nxJson)],
+            });
+            const baseNxJson = (0, fileutils_1.readJsonFile)(extendedNxJsonPath);
+            return {
+                ...baseNxJson,
+                ...nxJsonConfiguration,
+            };
+        }
+        else {
+            return nxJsonConfiguration;
+        }
+    }
+    else {
+        try {
+            return (0, fileutils_1.readJsonFile)((0, path_1.join)(__dirname, '..', '..', 'presets', 'core.json'));
+        }
+        catch (e) {
+            return {};
+        }
+    }
+}
+exports.readNxJson = readNxJson;
+function hasNxJson(root) {
+    const nxJson = (0, path_1.join)(root, 'nx.json');
+    return (0, fs_1.existsSync)(nxJson);
+}
+exports.hasNxJson = hasNxJson;
 
-"use strict";
-module.exports = require("string_decoder");
 
 /***/ }),
 
-/***/ 4404:
-/***/ ((module) => {
+/***/ 72733:
+/***/ ((__unused_webpack_module, exports) => {
 
 "use strict";
-module.exports = require("tls");
-
-/***/ }),
 
-/***/ 6224:
-/***/ ((module) => {
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.DependencyType = exports.fileDataDepType = exports.fileDataDepTarget = void 0;
+function fileDataDepTarget(dep) {
+    return typeof dep === 'string'
+        ? dep
+        : Array.isArray(dep) && dep.length === 2
+            ? dep[0]
+            : dep[1];
+}
+exports.fileDataDepTarget = fileDataDepTarget;
+function fileDataDepType(dep) {
+    return typeof dep === 'string'
+        ? 'static'
+        : Array.isArray(dep) && dep.length === 2
+            ? dep[1]
+            : dep[2];
+}
+exports.fileDataDepType = fileDataDepType;
+/**
+ * Type of dependency between projects
+ */
+var DependencyType;
+(function (DependencyType) {
+    /**
+     * Static dependencies are tied to the loading of the module
+     */
+    DependencyType["static"] = "static";
+    /**
+     * Dynamic dependencies are brought in by the module at run time
+     */
+    DependencyType["dynamic"] = "dynamic";
+    /**
+     * Implicit dependencies are inferred
+     */
+    DependencyType["implicit"] = "implicit";
+})(DependencyType || (exports.DependencyType = DependencyType = {}));
 
-"use strict";
-module.exports = require("tty");
 
 /***/ }),
 
-/***/ 7310:
-/***/ ((module) => {
+/***/ 62607:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
-module.exports = require("url");
-
-/***/ }),
 
-/***/ 3837:
-/***/ ((module) => {
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.resolveSchema = exports.resolveImplementation = exports.getImplementationFactory = void 0;
+const fs_1 = __nccwpck_require__(57147);
+const path_1 = __nccwpck_require__(71017);
+const plugins_1 = __nccwpck_require__(69461);
+/**
+ * This function is used to get the implementation factory of an executor or generator.
+ * @param implementation path to the implementation
+ * @param directory path to the directory
+ * @returns a function that returns the implementation
+ */
+function getImplementationFactory(implementation, directory) {
+    const [implementationModulePath, implementationExportName] = implementation.split('#');
+    return () => {
+        const modulePath = resolveImplementation(implementationModulePath, directory);
+        if ((0, path_1.extname)(modulePath) === '.ts') {
+            (0, plugins_1.registerPluginTSTranspiler)();
+        }
+        const module = require(modulePath);
+        return implementationExportName
+            ? module[implementationExportName]
+            : module.default ?? module;
+    };
+}
+exports.getImplementationFactory = getImplementationFactory;
+/**
+ * This function is used to resolve the implementation of an executor or generator.
+ * @param implementationModulePath
+ * @param directory
+ * @returns path to the implementation
+ */
+function resolveImplementation(implementationModulePath, directory) {
+    const validImplementations = ['', '.js', '.ts'].map((x) => implementationModulePath + x);
+    for (const maybeImplementation of validImplementations) {
+        const maybeImplementationPath = (0, path_1.join)(directory, maybeImplementation);
+        if ((0, fs_1.existsSync)(maybeImplementationPath)) {
+            return maybeImplementationPath;
+        }
+        try {
+            return require.resolve(maybeImplementation, {
+                paths: [directory],
+            });
+        }
+        catch { }
+    }
+    throw new Error(`Could not resolve "${implementationModulePath}" from "${directory}".`);
+}
+exports.resolveImplementation = resolveImplementation;
+function resolveSchema(schemaPath, directory) {
+    const maybeSchemaPath = (0, path_1.join)(directory, schemaPath);
+    if ((0, fs_1.existsSync)(maybeSchemaPath)) {
+        return maybeSchemaPath;
+    }
+    return require.resolve(schemaPath, {
+        paths: [directory],
+    });
+}
+exports.resolveSchema = resolveSchema;
 
-"use strict";
-module.exports = require("util");
 
 /***/ }),
 
-/***/ 6144:
-/***/ ((module) => {
+/***/ 10750:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
-module.exports = require("vm");
-
-/***/ }),
 
-/***/ 9796:
-/***/ ((module) => {
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.toProjectName = void 0;
+const path_1 = __nccwpck_require__(71017);
+/**
+ * Pulled from toFileName in names from @nx/devkit.
+ * Todo: Should refactor, not duplicate.
+ */
+function toProjectName(fileName) {
+    const parts = (0, path_1.dirname)(fileName).split(/[\/\\]/g);
+    return parts[parts.length - 1].toLowerCase();
+}
+exports.toProjectName = toProjectName;
 
-"use strict";
-module.exports = require("zlib");
 
 /***/ }),
 
-/***/ 7840:
-/***/ ((__unused_webpack_module, exports) => {
+/***/ 70800:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.assertValidPattern = void 0;
-const MAX_PATTERN_LENGTH = 1024 * 64;
-const assertValidPattern = (pattern) => {
-    if (typeof pattern !== 'string') {
-        throw new TypeError('invalid pattern');
+exports.getDaemonProcessIdSync = exports.safelyCleanUpExistingProcess = exports.writeDaemonJsonProcessCache = exports.deleteDaemonJsonProcessCache = exports.readDaemonProcessJsonCache = exports.serverProcessJsonPath = void 0;
+const fs_extra_1 = __nccwpck_require__(2103);
+const path_1 = __nccwpck_require__(71017);
+const tmp_dir_1 = __nccwpck_require__(71524);
+exports.serverProcessJsonPath = (0, path_1.join)(tmp_dir_1.DAEMON_DIR_FOR_CURRENT_WORKSPACE, 'server-process.json');
+async function readDaemonProcessJsonCache() {
+    if (!(0, fs_extra_1.existsSync)(exports.serverProcessJsonPath)) {
+        return null;
     }
-    if (pattern.length > MAX_PATTERN_LENGTH) {
-        throw new TypeError('pattern is too long');
+    return await (0, fs_extra_1.readJson)(exports.serverProcessJsonPath);
+}
+exports.readDaemonProcessJsonCache = readDaemonProcessJsonCache;
+function deleteDaemonJsonProcessCache() {
+    try {
+        if (getDaemonProcessIdSync() === process.pid) {
+            (0, fs_extra_1.unlinkSync)(exports.serverProcessJsonPath);
+        }
     }
-};
-exports.assertValidPattern = assertValidPattern;
-//# sourceMappingURL=assert-valid-pattern.js.map
+    catch { }
+}
+exports.deleteDaemonJsonProcessCache = deleteDaemonJsonProcessCache;
+async function writeDaemonJsonProcessCache(daemonJson) {
+    await (0, fs_extra_1.writeJson)(exports.serverProcessJsonPath, daemonJson);
+}
+exports.writeDaemonJsonProcessCache = writeDaemonJsonProcessCache;
+async function safelyCleanUpExistingProcess() {
+    const daemonProcessJson = await readDaemonProcessJsonCache();
+    if (daemonProcessJson && daemonProcessJson.processId) {
+        try {
+            process.kill(daemonProcessJson.processId);
+            // we wait for the process to actually shut down before returning
+            await new Promise((resolve, reject) => {
+                let count = 0;
+                const interval = setInterval(() => {
+                    try {
+                        // sending a signal 0 to a process checks if the process is running instead of actually killing it
+                        process.kill(daemonProcessJson.processId, 0);
+                    }
+                    catch (e) {
+                        clearInterval(interval);
+                        resolve();
+                    }
+                    if ((count += 1) > 200) {
+                        clearInterval(interval);
+                        reject(`Daemon process ${daemonProcessJson.processId} didn't exit after 2 seconds.`);
+                    }
+                }, 10);
+            });
+        }
+        catch { }
+    }
+    deleteDaemonJsonProcessCache();
+}
+exports.safelyCleanUpExistingProcess = safelyCleanUpExistingProcess;
+// Must be sync for the help output use case
+function getDaemonProcessIdSync() {
+    if (!(0, fs_extra_1.existsSync)(exports.serverProcessJsonPath)) {
+        return null;
+    }
+    try {
+        const daemonProcessJson = (0, fs_extra_1.readJsonSync)(exports.serverProcessJsonPath);
+        return daemonProcessJson.processId;
+    }
+    catch {
+        return null;
+    }
+}
+exports.getDaemonProcessIdSync = getDaemonProcessIdSync;
+
 
 /***/ }),
 
-/***/ 1227:
+/***/ 76940:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
-// parse a single path portion
 Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.AST = void 0;
-const brace_expressions_js_1 = __nccwpck_require__(5180);
-const unescape_js_1 = __nccwpck_require__(391);
-const types = new Set(['!', '?', '+', '*', '@']);
-const isExtglobType = (c) => types.has(c);
-// Patterns that get prepended to bind to the start of either the
-// entire string, or just a single path portion, to prevent dots
-// and/or traversal patterns, when needed.
-// Exts don't need the ^ or / bit, because the root binds that already.
-const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))';
-const startNoDot = '(?!\\.)';
-// characters that indicate a start of pattern needs the "no dots" bit,
-// because a dot *might* be matched. ( is not in the list, because in
-// the case of a child extglob, it will handle the prevention itself.
-const addPatternStart = new Set(['[', '.']);
-// cases where traversal is A-OK, no dot prevention needed
-const justDots = new Set(['..', '.']);
-const reSpecials = new Set('().*{}+?[]^$\\!');
-const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
-// any single thing other than /
-const qmark = '[^/]';
-// * => any number of characters
-const star = qmark + '*?';
-// use + when we need to ensure that *something* matches, because the * is
-// the only thing in the path portion.
-const starNoEmpty = qmark + '+?';
-// remove the \ chars that we added if we end up doing a nonmagic compare
-// const deslash = (s: string) => s.replace(/\\(.)/g, '$1')
-class AST {
-    type;
-    #root;
-    #hasMagic;
-    #uflag = false;
-    #parts = [];
-    #parent;
-    #parentIndex;
-    #negs;
-    #filledNegs = false;
-    #options;
-    #toString;
-    // set to true if it's an extglob with no children
-    // (which really means one child of '')
-    #emptyExt = false;
-    constructor(type, parent, options = {}) {
-        this.type = type;
-        // extglobs are inherently magical
-        if (type)
-            this.#hasMagic = true;
-        this.#parent = parent;
-        this.#root = this.#parent ? this.#parent.#root : this;
-        this.#options = this.#root === this ? options : this.#root.#options;
-        this.#negs = this.#root === this ? [] : this.#root.#negs;
-        if (type === '!' && !this.#root.#filledNegs)
-            this.#negs.push(this);
-        this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;
-    }
-    get hasMagic() {
-        /* c8 ignore start */
-        if (this.#hasMagic !== undefined)
-            return this.#hasMagic;
-        /* c8 ignore stop */
-        for (const p of this.#parts) {
-            if (typeof p === 'string')
-                continue;
-            if (p.type || p.hasMagic)
-                return (this.#hasMagic = true);
-        }
-        // note: will be undefined until we generate the regexp src and find out
-        return this.#hasMagic;
-    }
-    // reconstructs the pattern
-    toString() {
-        if (this.#toString !== undefined)
-            return this.#toString;
-        if (!this.type) {
-            return (this.#toString = this.#parts.map(p => String(p)).join(''));
-        }
-        else {
-            return (this.#toString =
-                this.type + '(' + this.#parts.map(p => String(p)).join('|') + ')');
+exports.daemonClient = exports.DaemonClient = void 0;
+const workspace_root_1 = __nccwpck_require__(64393);
+const child_process_1 = __nccwpck_require__(32081);
+const fs_1 = __nccwpck_require__(57147);
+const promises_1 = __nccwpck_require__(73292);
+const fs_extra_1 = __nccwpck_require__(2103);
+const net_1 = __nccwpck_require__(41808);
+const path_1 = __nccwpck_require__(71017);
+const perf_hooks_1 = __nccwpck_require__(4074);
+const output_1 = __nccwpck_require__(21862);
+const socket_utils_1 = __nccwpck_require__(58935);
+const tmp_dir_1 = __nccwpck_require__(71524);
+const is_ci_1 = __nccwpck_require__(48590);
+const configuration_1 = __nccwpck_require__(34333);
+const promised_based_queue_1 = __nccwpck_require__(25340);
+const nx_json_1 = __nccwpck_require__(21173);
+const daemon_socket_messenger_1 = __nccwpck_require__(81629);
+const cache_1 = __nccwpck_require__(70800);
+const error_types_1 = __nccwpck_require__(54403);
+const DAEMON_ENV_SETTINGS = {
+    NX_PROJECT_GLOB_CACHE: 'false',
+    NX_CACHE_PROJECTS_CONFIG: 'false',
+};
+var DaemonStatus;
+(function (DaemonStatus) {
+    DaemonStatus[DaemonStatus["CONNECTING"] = 0] = "CONNECTING";
+    DaemonStatus[DaemonStatus["DISCONNECTED"] = 1] = "DISCONNECTED";
+    DaemonStatus[DaemonStatus["CONNECTED"] = 2] = "CONNECTED";
+})(DaemonStatus || (DaemonStatus = {}));
+class DaemonClient {
+    constructor() {
+        this._daemonStatus = DaemonStatus.DISCONNECTED;
+        this._waitForDaemonReady = null;
+        this._daemonReady = null;
+        this._out = null;
+        this._err = null;
+        try {
+            this.nxJson = (0, configuration_1.readNxJson)();
         }
-    }
-    #fillNegs() {
-        /* c8 ignore start */
-        if (this !== this.#root)
-            throw new Error('should only call on root');
-        if (this.#filledNegs)
-            return this;
-        /* c8 ignore stop */
-        // call toString() once to fill this out
-        this.toString();
-        this.#filledNegs = true;
-        let n;
-        while ((n = this.#negs.pop())) {
-            if (n.type !== '!')
-                continue;
-            // walk up the tree, appending everthing that comes AFTER parentIndex
-            let p = n;
-            let pp = p.#parent;
-            while (pp) {
-                for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {
-                    for (const part of n.#parts) {
-                        /* c8 ignore start */
-                        if (typeof part === 'string') {
-                            throw new Error('string part in extglob AST??');
-                        }
-                        /* c8 ignore stop */
-                        part.copyIn(pp.#parts[i]);
-                    }
-                }
-                p = pp;
-                pp = p.#parent;
-            }
+        catch (e) {
+            this.nxJson = null;
         }
-        return this;
+        this.reset();
     }
-    push(...parts) {
-        for (const p of parts) {
-            if (p === '')
-                continue;
-            /* c8 ignore start */
-            if (typeof p !== 'string' && !(p instanceof AST && p.#parent === this)) {
-                throw new Error('invalid part: ' + p);
+    enabled() {
+        if (this._enabled === undefined) {
+            // TODO(v19): Add migration to move it out of existing configs and remove the ?? here.
+            const useDaemonProcessOption = this.nxJson?.useDaemonProcess ??
+                this.nxJson?.tasksRunnerOptions?.['default']?.options?.useDaemonProcess;
+            const env = process.env.NX_DAEMON;
+            // env takes precedence
+            // option=true,env=false => no daemon
+            // option=false,env=undefined => no daemon
+            // option=false,env=false => no daemon
+            // option=undefined,env=undefined => daemon
+            // option=true,env=true => daemon
+            // option=false,env=true => daemon
+            // CI=true,env=undefined => no daemon
+            // CI=true,env=false => no daemon
+            // CI=true,env=true => daemon
+            if (((0, is_ci_1.isCI)() && env !== 'true') ||
+                isDocker() ||
+                (0, tmp_dir_1.isDaemonDisabled)() ||
+                nxJsonIsNotPresent() ||
+                (useDaemonProcessOption === undefined && env === 'false') ||
+                (useDaemonProcessOption === true && env === 'false') ||
+                (useDaemonProcessOption === false && env === undefined) ||
+                (useDaemonProcessOption === false && env === 'false')) {
+                this._enabled = false;
+            }
+            else {
+                this._enabled = true;
             }
-            /* c8 ignore stop */
-            this.#parts.push(p);
         }
+        return this._enabled;
     }
-    toJSON() {
-        const ret = this.type === null
-            ? this.#parts.slice().map(p => (typeof p === 'string' ? p : p.toJSON()))
-            : [this.type, ...this.#parts.map(p => p.toJSON())];
-        if (this.isStart() && !this.type)
-            ret.unshift([]);
-        if (this.isEnd() &&
-            (this === this.#root ||
-                (this.#root.#filledNegs && this.#parent?.type === '!'))) {
-            ret.push({});
-        }
-        return ret;
+    reset() {
+        this.socketMessenger?.close();
+        this.socketMessenger = null;
+        this.queue = new promised_based_queue_1.PromisedBasedQueue();
+        this.currentMessage = null;
+        this.currentResolve = null;
+        this.currentReject = null;
+        this._enabled = undefined;
+        this._out?.close();
+        this._err?.close();
+        this._out = null;
+        this._err = null;
+        this._daemonStatus = DaemonStatus.DISCONNECTED;
+        this._waitForDaemonReady = new Promise((resolve) => (this._daemonReady = resolve));
     }
-    isStart() {
-        if (this.#root === this)
-            return true;
-        // if (this.type) return !!this.#parent?.isStart()
-        if (!this.#parent?.isStart())
-            return false;
-        if (this.#parentIndex === 0)
-            return true;
-        // if everything AHEAD of this is a negation, then it's still the "start"
-        const p = this.#parent;
-        for (let i = 0; i < this.#parentIndex; i++) {
-            const pp = p.#parts[i];
-            if (!(pp instanceof AST && pp.type === '!')) {
-                return false;
+    async requestShutdown() {
+        return this.sendToDaemonViaQueue({ type: 'REQUEST_SHUTDOWN' });
+    }
+    async getProjectGraphAndSourceMaps() {
+        try {
+            const response = await this.sendToDaemonViaQueue({
+                type: 'REQUEST_PROJECT_GRAPH',
+            });
+            return {
+                projectGraph: response.projectGraph,
+                sourceMaps: response.sourceMaps,
+            };
+        }
+        catch (e) {
+            if (e.name === error_types_1.DaemonProjectGraphError.name) {
+                throw error_types_1.ProjectGraphError.fromDaemonProjectGraphError(e);
+            }
+            else {
+                throw e;
             }
         }
-        return true;
     }
-    isEnd() {
-        if (this.#root === this)
-            return true;
-        if (this.#parent?.type === '!')
-            return true;
-        if (!this.#parent?.isEnd())
-            return false;
-        if (!this.type)
-            return this.#parent?.isEnd();
-        // if not root, it'll always have a parent
-        /* c8 ignore start */
-        const pl = this.#parent ? this.#parent.#parts.length : 0;
-        /* c8 ignore stop */
-        return this.#parentIndex === pl - 1;
+    async getAllFileData() {
+        return await this.sendToDaemonViaQueue({ type: 'REQUEST_FILE_DATA' });
     }
-    copyIn(part) {
-        if (typeof part === 'string')
-            this.push(part);
-        else
-            this.push(part.clone(this));
+    hashTasks(runnerOptions, tasks, taskGraph, env) {
+        return this.sendToDaemonViaQueue({
+            type: 'HASH_TASKS',
+            runnerOptions,
+            env,
+            tasks,
+            taskGraph,
+        });
     }
-    clone(parent) {
-        const c = new AST(this.type, parent);
-        for (const p of this.#parts) {
-            c.copyIn(p);
+    async registerFileWatcher(config, callback) {
+        try {
+            await this.getProjectGraphAndSourceMaps();
         }
-        return c;
-    }
-    static #parseAST(str, ast, pos, opt) {
-        let escaping = false;
-        let inBrace = false;
-        let braceStart = -1;
-        let braceNeg = false;
-        if (ast.type === null) {
-            // outside of a extglob, append until we find a start
-            let i = pos;
-            let acc = '';
-            while (i < str.length) {
-                const c = str.charAt(i++);
-                // still accumulate escapes at this point, but we do ignore
-                // starts that are escaped
-                if (escaping || c === '\\') {
-                    escaping = !escaping;
-                    acc += c;
-                    continue;
-                }
-                if (inBrace) {
-                    if (i === braceStart + 1) {
-                        if (c === '^' || c === '!') {
-                            braceNeg = true;
-                        }
-                    }
-                    else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
-                        inBrace = false;
-                    }
-                    acc += c;
-                    continue;
-                }
-                else if (c === '[') {
-                    inBrace = true;
-                    braceStart = i;
-                    braceNeg = false;
-                    acc += c;
-                    continue;
-                }
-                if (!opt.noext && isExtglobType(c) && str.charAt(i) === '(') {
-                    ast.push(acc);
-                    acc = '';
-                    const ext = new AST(c, ast);
-                    i = AST.#parseAST(str, ext, i, opt);
-                    ast.push(ext);
-                    continue;
-                }
-                acc += c;
+        catch (e) {
+            if (config.allowPartialGraph && e instanceof error_types_1.ProjectGraphError) {
+                // we are fine with partial graph
             }
-            ast.push(acc);
-            return i;
-        }
-        // some kind of extglob, pos is at the (
-        // find the next | or )
-        let i = pos + 1;
-        let part = new AST(null, ast);
-        const parts = [];
-        let acc = '';
-        while (i < str.length) {
-            const c = str.charAt(i++);
-            // still accumulate escapes at this point, but we do ignore
-            // starts that are escaped
-            if (escaping || c === '\\') {
-                escaping = !escaping;
-                acc += c;
-                continue;
+            else {
+                throw e;
             }
-            if (inBrace) {
-                if (i === braceStart + 1) {
-                    if (c === '^' || c === '!') {
-                        braceNeg = true;
-                    }
+        }
+        let messenger;
+        await this.queue.sendToQueue(() => {
+            messenger = new daemon_socket_messenger_1.DaemonSocketMessenger((0, net_1.connect)(socket_utils_1.FULL_OS_SOCKET_PATH)).listen((message) => {
+                try {
+                    const parsedMessage = JSON.parse(message);
+                    callback(null, parsedMessage);
                 }
-                else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
-                    inBrace = false;
+                catch (e) {
+                    callback(e, null);
                 }
-                acc += c;
-                continue;
+            }, () => {
+                callback('closed', null);
+            }, (err) => callback(err, null));
+            return messenger.sendMessage({ type: 'REGISTER_FILE_WATCHER', config });
+        });
+        return () => {
+            messenger?.close();
+        };
+    }
+    processInBackground(requirePath, data) {
+        return this.sendToDaemonViaQueue({
+            type: 'PROCESS_IN_BACKGROUND',
+            requirePath,
+            data,
+        });
+    }
+    recordOutputsHash(outputs, hash) {
+        return this.sendToDaemonViaQueue({
+            type: 'RECORD_OUTPUTS_HASH',
+            data: {
+                outputs,
+                hash,
+            },
+        });
+    }
+    outputsHashesMatch(outputs, hash) {
+        return this.sendToDaemonViaQueue({
+            type: 'OUTPUTS_HASHES_MATCH',
+            data: {
+                outputs,
+                hash,
+            },
+        });
+    }
+    async isServerAvailable() {
+        return new Promise((resolve) => {
+            try {
+                const socket = (0, net_1.connect)(socket_utils_1.FULL_OS_SOCKET_PATH, () => {
+                    socket.destroy();
+                    resolve(true);
+                });
+                socket.once('error', () => {
+                    resolve(false);
+                });
             }
-            else if (c === '[') {
-                inBrace = true;
-                braceStart = i;
-                braceNeg = false;
-                acc += c;
-                continue;
+            catch (err) {
+                resolve(false);
             }
-            if (isExtglobType(c) && str.charAt(i) === '(') {
-                part.push(acc);
-                acc = '';
-                const ext = new AST(c, part);
-                part.push(ext);
-                i = AST.#parseAST(str, ext, i, opt);
-                continue;
+        });
+    }
+    async sendToDaemonViaQueue(messageToDaemon) {
+        return this.queue.sendToQueue(() => this.sendMessageToDaemon(messageToDaemon));
+    }
+    setUpConnection() {
+        this.socketMessenger = new daemon_socket_messenger_1.DaemonSocketMessenger((0, net_1.connect)(socket_utils_1.FULL_OS_SOCKET_PATH)).listen((message) => this.handleMessage(message), () => {
+            // it's ok for the daemon to terminate if the client doesn't wait on
+            // any messages from the daemon
+            if (this.queue.isEmpty()) {
+                this.reset();
             }
-            if (c === '|') {
-                part.push(acc);
-                acc = '';
-                parts.push(part);
-                part = new AST(null, ast);
-                continue;
+            else {
+                output_1.output.error({
+                    title: 'Daemon process terminated and closed the connection',
+                    bodyLines: [
+                        'Please rerun the command, which will restart the daemon.',
+                        `If you get this error again, check for any errors in the daemon process logs found in: ${tmp_dir_1.DAEMON_OUTPUT_LOG_FILE}`,
+                    ],
+                });
+                this._daemonStatus = DaemonStatus.DISCONNECTED;
+                this.currentReject?.(daemonProcessException('Daemon process terminated and closed the connection'));
+                process.exit(1);
             }
-            if (c === ')') {
-                if (acc === '' && ast.#parts.length === 0) {
-                    ast.#emptyExt = true;
-                }
-                part.push(acc);
-                acc = '';
-                ast.push(...parts, part);
-                return i;
+        }, (err) => {
+            if (!err.message) {
+                return this.currentReject(daemonProcessException(err.toString()));
             }
-            acc += c;
-        }
-        // unfinished extglob
-        // if we got here, it was a malformed extglob! not an extglob, but
-        // maybe something else in there.
-        ast.type = null;
-        ast.#hasMagic = undefined;
-        ast.#parts = [str.substring(pos - 1)];
-        return i;
-    }
-    static fromGlob(pattern, options = {}) {
-        const ast = new AST(null, undefined, options);
-        AST.#parseAST(pattern, ast, 0, options);
-        return ast;
+            if (err.message.startsWith('LOCK-FILES-CHANGED')) {
+                // retry the current message
+                // we cannot send it via the queue because we are in the middle of processing
+                // a message from the queue
+                return this.sendMessageToDaemon(this.currentMessage).then(this.currentResolve, this.currentReject);
+            }
+            let error;
+            if (err.message.startsWith('connect ENOENT')) {
+                error = daemonProcessException('The Daemon Server is not running');
+            }
+            else if (err.message.startsWith('connect ECONNREFUSED')) {
+                error = daemonProcessException(`A server instance had not been fully shut down. Please try running the command again.`);
+                (0, socket_utils_1.killSocketOrPath)();
+            }
+            else if (err.message.startsWith('read ECONNRESET')) {
+                error = daemonProcessException(`Unable to connect to the daemon process.`);
+            }
+            else {
+                error = daemonProcessException(err.toString());
+            }
+            return this.currentReject(error);
+        });
     }
-    // returns the regular expression if there's magic, or the unescaped
-    // string if not.
-    toMMPattern() {
-        // should only be called on root
-        /* c8 ignore start */
-        if (this !== this.#root)
-            return this.#root.toMMPattern();
-        /* c8 ignore stop */
-        const glob = this.toString();
-        const [re, body, hasMagic, uflag] = this.toRegExpSource();
-        // if we're in nocase mode, and not nocaseMagicOnly, then we do
-        // still need a regular expression if we have to case-insensitively
-        // match capital/lowercase characters.
-        const anyMagic = hasMagic ||
-            this.#hasMagic ||
-            (this.#options.nocase &&
-                !this.#options.nocaseMagicOnly &&
-                glob.toUpperCase() !== glob.toLowerCase());
-        if (!anyMagic) {
-            return body;
+    async sendMessageToDaemon(message) {
+        if (this._daemonStatus == DaemonStatus.DISCONNECTED) {
+            this._daemonStatus = DaemonStatus.CONNECTING;
+            if (!(await this.isServerAvailable())) {
+                await this.startInBackground();
+            }
+            this.setUpConnection();
+            this._daemonStatus = DaemonStatus.CONNECTED;
+            this._daemonReady();
         }
-        const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '');
-        return Object.assign(new RegExp(`^${re}$`, flags), {
-            _src: re,
-            _glob: glob,
+        else if (this._daemonStatus == DaemonStatus.CONNECTING) {
+            await this._waitForDaemonReady;
+        }
+        return new Promise((resolve, reject) => {
+            perf_hooks_1.performance.mark('sendMessageToDaemon-start');
+            this.currentMessage = message;
+            this.currentResolve = resolve;
+            this.currentReject = reject;
+            this.socketMessenger.sendMessage(message);
         });
     }
-    // returns the string match, the regexp source, whether there's magic
-    // in the regexp (so a regular expression is required) and whether or
-    // not the uflag is needed for the regular expression (for posix classes)
-    // TODO: instead of injecting the start/end at this point, just return
-    // the BODY of the regexp, along with the start/end portions suitable
-    // for binding the start/end in either a joined full-path makeRe context
-    // (where we bind to (^|/), or a standalone matchPart context (where
-    // we bind to ^, and not /).  Otherwise slashes get duped!
-    //
-    // In part-matching mode, the start is:
-    // - if not isStart: nothing
-    // - if traversal possible, but not allowed: ^(?!\.\.?$)
-    // - if dots allowed or not possible: ^
-    // - if dots possible and not allowed: ^(?!\.)
-    // end is:
-    // - if not isEnd(): nothing
-    // - else: $
-    //
-    // In full-path matching mode, we put the slash at the START of the
-    // pattern, so start is:
-    // - if first pattern: same as part-matching mode
-    // - if not isStart(): nothing
-    // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
-    // - if dots allowed or not possible: /
-    // - if dots possible and not allowed: /(?!\.)
-    // end is:
-    // - if last pattern, same as part-matching mode
-    // - else nothing
-    //
-    // Always put the (?:$|/) on negated tails, though, because that has to be
-    // there to bind the end of the negated pattern portion, and it's easier to
-    // just stick it in now rather than try to inject it later in the middle of
-    // the pattern.
-    //
-    // We can just always return the same end, and leave it up to the caller
-    // to know whether it's going to be used joined or in parts.
-    // And, if the start is adjusted slightly, can do the same there:
-    // - if not isStart: nothing
-    // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
-    // - if dots allowed or not possible: (?:/|^)
-    // - if dots possible and not allowed: (?:/|^)(?!\.)
-    //
-    // But it's better to have a simpler binding without a conditional, for
-    // performance, so probably better to return both start options.
-    //
-    // Then the caller just ignores the end if it's not the first pattern,
-    // and the start always gets applied.
-    //
-    // But that's always going to be $ if it's the ending pattern, or nothing,
-    // so the caller can just attach $ at the end of the pattern when building.
-    //
-    // So the todo is:
-    // - better detect what kind of start is needed
-    // - return both flavors of starting pattern
-    // - attach $ at the end of the pattern when creating the actual RegExp
-    //
-    // Ah, but wait, no, that all only applies to the root when the first pattern
-    // is not an extglob. If the first pattern IS an extglob, then we need all
-    // that dot prevention biz to live in the extglob portions, because eg
-    // +(*|.x*) can match .xy but not .yx.
-    //
-    // So, return the two flavors if it's #root and the first child is not an
-    // AST, otherwise leave it to the child AST to handle it, and there,
-    // use the (?:^|/) style of start binding.
-    //
-    // Even simplified further:
-    // - Since the start for a join is eg /(?!\.) and the start for a part
-    // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
-    // or start or whatever) and prepend ^ or / at the Regexp construction.
-    toRegExpSource(allowDot) {
-        const dot = allowDot ?? !!this.#options.dot;
-        if (this.#root === this)
-            this.#fillNegs();
-        if (!this.type) {
-            const noEmpty = this.isStart() && this.isEnd();
-            const src = this.#parts
-                .map(p => {
-                const [re, _, hasMagic, uflag] = typeof p === 'string'
-                    ? AST.#parseGlob(p, this.#hasMagic, noEmpty)
-                    : p.toRegExpSource(allowDot);
-                this.#hasMagic = this.#hasMagic || hasMagic;
-                this.#uflag = this.#uflag || uflag;
-                return re;
-            })
-                .join('');
-            let start = '';
-            if (this.isStart()) {
-                if (typeof this.#parts[0] === 'string') {
-                    // this is the string that will match the start of the pattern,
-                    // so we need to protect against dots and such.
-                    // '.' and '..' cannot match unless the pattern is that exactly,
-                    // even if it starts with . or dot:true is set.
-                    const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);
-                    if (!dotTravAllowed) {
-                        const aps = addPatternStart;
-                        // check if we have a possibility of matching . or ..,
-                        // and prevent that.
-                        const needNoTrav = 
-                        // dots are allowed, and the pattern starts with [ or .
-                        (dot && aps.has(src.charAt(0))) ||
-                            // the pattern starts with \., and then [ or .
-                            (src.startsWith('\\.') && aps.has(src.charAt(2))) ||
-                            // the pattern starts with \.\., and then [ or .
-                            (src.startsWith('\\.\\.') && aps.has(src.charAt(4)));
-                        // no need to prevent dots if it can't match a dot, or if a
-                        // sub-pattern will be preventing it anyway.
-                        const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
-                        start = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : '';
-                    }
-                }
+    handleMessage(serializedResult) {
+        try {
+            perf_hooks_1.performance.mark('json-parse-start');
+            const parsedResult = JSON.parse(serializedResult);
+            perf_hooks_1.performance.mark('json-parse-end');
+            perf_hooks_1.performance.measure('deserialize daemon response', 'json-parse-start', 'json-parse-end');
+            if (parsedResult.error) {
+                this.currentReject(parsedResult.error);
             }
-            // append the "end of path portion" pattern to negation tails
-            let end = '';
-            if (this.isEnd() &&
-                this.#root.#filledNegs &&
-                this.#parent?.type === '!') {
-                end = '(?:$|\\/)';
+            else {
+                perf_hooks_1.performance.measure('total for sendMessageToDaemon()', 'sendMessageToDaemon-start', 'json-parse-end');
+                return this.currentResolve(parsedResult);
             }
-            const final = start + src + end;
-            return [
-                final,
-                (0, unescape_js_1.unescape)(src),
-                (this.#hasMagic = !!this.#hasMagic),
-                this.#uflag,
-            ];
         }
-        // We need to calculate the body *twice* if it's a repeat pattern
-        // at the start, once in nodot mode, then again in dot mode, so a
-        // pattern like *(?) can match 'x.y'
-        const repeated = this.type === '*' || this.type === '+';
-        // some kind of extglob
-        const start = this.type === '!' ? '(?:(?!(?:' : '(?:';
-        let body = this.#partsToRegExp(dot);
-        if (this.isStart() && this.isEnd() && !body && this.type !== '!') {
-            // invalid extglob, has to at least be *something* present, if it's
-            // the entire path portion.
-            const s = this.toString();
-            this.#parts = [s];
-            this.type = null;
-            this.#hasMagic = undefined;
-            return [s, (0, unescape_js_1.unescape)(this.toString()), false, false];
+        catch (e) {
+            const endOfResponse = serializedResult.length > 300
+                ? serializedResult.substring(serializedResult.length - 300)
+                : serializedResult;
+            this.currentReject(daemonProcessException([
+                'Could not deserialize response from Nx daemon.',
+                `Message: ${e.message}`,
+                '\n',
+                `Received:`,
+                endOfResponse,
+                '\n',
+            ].join('\n')));
         }
-        // XXX abstract out this map method
-        let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot
-            ? ''
-            : this.#partsToRegExp(true);
-        if (bodyDotAllowed === body) {
-            bodyDotAllowed = '';
+    }
+    async startInBackground() {
+        (0, fs_extra_1.ensureDirSync)(tmp_dir_1.DAEMON_DIR_FOR_CURRENT_WORKSPACE);
+        (0, fs_extra_1.ensureFileSync)(tmp_dir_1.DAEMON_OUTPUT_LOG_FILE);
+        this._out = await (0, promises_1.open)(tmp_dir_1.DAEMON_OUTPUT_LOG_FILE, 'a');
+        this._err = await (0, promises_1.open)(tmp_dir_1.DAEMON_OUTPUT_LOG_FILE, 'a');
+        const backgroundProcess = (0, child_process_1.spawn)(process.execPath, [(0, path_1.join)(__dirname, '../server/start.js')], {
+            cwd: workspace_root_1.workspaceRoot,
+            stdio: ['ignore', this._out.fd, this._err.fd],
+            detached: true,
+            windowsHide: true,
+            shell: false,
+            env: { ...process.env, ...DAEMON_ENV_SETTINGS },
+        });
+        backgroundProcess.unref();
+        /**
+         * Ensure the server is actually available to connect to via IPC before resolving
+         */
+        let attempts = 0;
+        return new Promise((resolve, reject) => {
+            const id = setInterval(async () => {
+                if (await this.isServerAvailable()) {
+                    clearInterval(id);
+                    resolve(backgroundProcess.pid);
+                }
+                else if (attempts > 6000) {
+                    // daemon fails to start, the process probably exited
+                    // we print the logs and exit the client
+                    reject(daemonProcessException('Failed to start or connect to the Nx Daemon process.'));
+                }
+                else {
+                    attempts++;
+                }
+            }, 10);
+        });
+    }
+    async stop() {
+        try {
+            await (0, cache_1.safelyCleanUpExistingProcess)();
         }
-        if (bodyDotAllowed) {
-            body = `(?:${body})(?:${bodyDotAllowed})*?`;
+        catch (err) {
+            output_1.output.error({
+                title: err?.message ||
+                    'Something unexpected went wrong when stopping the server',
+            });
         }
-        // an empty !() is exactly equivalent to a starNoEmpty
-        let final = '';
-        if (this.type === '!' && this.#emptyExt) {
-            final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty;
+        (0, tmp_dir_1.removeSocketDir)();
+    }
+}
+exports.DaemonClient = DaemonClient;
+exports.daemonClient = new DaemonClient();
+function isDocker() {
+    try {
+        (0, fs_1.statSync)('/.dockerenv');
+        return true;
+    }
+    catch {
+        try {
+            return (0, fs_1.readFileSync)('/proc/self/cgroup', 'utf8')?.includes('docker');
         }
-        else {
-            const close = this.type === '!'
-                ? // !() must match something,but !(x) can match ''
-                    '))' +
-                        (this.isStart() && !dot && !allowDot ? startNoDot : '') +
-                        star +
-                        ')'
-                : this.type === '@'
-                    ? ')'
-                    : this.type === '?'
-                        ? ')?'
-                        : this.type === '+' && bodyDotAllowed
-                            ? ')'
-                            : this.type === '*' && bodyDotAllowed
-                                ? `)?`
-                                : `)${this.type}`;
-            final = start + body + close;
+        catch { }
+        return false;
+    }
+}
+function nxJsonIsNotPresent() {
+    return !(0, nx_json_1.hasNxJson)(workspace_root_1.workspaceRoot);
+}
+function daemonProcessException(message) {
+    try {
+        let log = (0, fs_1.readFileSync)(tmp_dir_1.DAEMON_OUTPUT_LOG_FILE).toString().split('\n');
+        if (log.length > 20) {
+            log = log.slice(log.length - 20);
         }
-        return [
-            final,
-            (0, unescape_js_1.unescape)(body),
-            (this.#hasMagic = !!this.#hasMagic),
-            this.#uflag,
-        ];
+        const error = new Error([
+            message,
+            '',
+            'Messages from the log:',
+            ...log,
+            '\n',
+            `More information: ${tmp_dir_1.DAEMON_OUTPUT_LOG_FILE}`,
+        ].join('\n'));
+        error.internalDaemonError = true;
+        return error;
     }
-    #partsToRegExp(dot) {
-        return this.#parts
-            .map(p => {
-            // extglob ASTs should only contain parent ASTs
-            /* c8 ignore start */
-            if (typeof p === 'string') {
-                throw new Error('string type in extglob ast??');
-            }
-            /* c8 ignore stop */
-            // can ignore hasMagic, because extglobs are already always magic
-            const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);
-            this.#uflag = this.#uflag || uflag;
-            return re;
-        })
-            .filter(p => !(this.isStart() && this.isEnd()) || !!p)
-            .join('|');
+    catch (e) {
+        return new Error(message);
     }
-    static #parseGlob(glob, hasMagic, noEmpty = false) {
-        let escaping = false;
-        let re = '';
-        let uflag = false;
-        for (let i = 0; i < glob.length; i++) {
-            const c = glob.charAt(i);
-            if (escaping) {
-                escaping = false;
-                re += (reSpecials.has(c) ? '\\' : '') + c;
-                continue;
-            }
-            if (c === '\\') {
-                if (i === glob.length - 1) {
-                    re += '\\\\';
-                }
-                else {
-                    escaping = true;
-                }
-                continue;
-            }
-            if (c === '[') {
-                const [src, needUflag, consumed, magic] = (0, brace_expressions_js_1.parseClass)(glob, i);
-                if (consumed) {
-                    re += src;
-                    uflag = uflag || needUflag;
-                    i += consumed - 1;
-                    hasMagic = hasMagic || magic;
-                    continue;
-                }
-            }
-            if (c === '*') {
-                if (noEmpty && glob === '*')
-                    re += starNoEmpty;
-                else
-                    re += star;
-                hasMagic = true;
-                continue;
-            }
-            if (c === '?') {
-                re += qmark;
-                hasMagic = true;
-                continue;
-            }
-            re += regExpEscape(c);
-        }
-        return [re, (0, unescape_js_1.unescape)(glob), !!hasMagic, uflag];
+}
+
+
+/***/ }),
+
+/***/ 81629:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.DaemonSocketMessenger = void 0;
+const consume_messages_from_socket_1 = __nccwpck_require__(66696);
+class DaemonSocketMessenger {
+    constructor(socket) {
+        this.socket = socket;
+    }
+    async sendMessage(messageToDaemon) {
+        this.socket.write(JSON.stringify(messageToDaemon));
+        // send EOT to indicate that the message has been fully written
+        this.socket.write(String.fromCodePoint(4));
+    }
+    listen(onData, onClose = () => { }, onError = (err) => { }) {
+        this.socket.on('data', (0, consume_messages_from_socket_1.consumeMessagesFromSocket)(async (message) => {
+            onData(message);
+        }));
+        this.socket.on('close', onClose);
+        this.socket.on('error', onError);
+        return this;
+    }
+    close() {
+        this.socket.destroy();
     }
 }
-exports.AST = AST;
-//# sourceMappingURL=ast.js.map
+exports.DaemonSocketMessenger = DaemonSocketMessenger;
+
 
 /***/ }),
 
-/***/ 5180:
-/***/ ((__unused_webpack_module, exports) => {
+/***/ 58935:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
-// translate the various posix character classes into unicode properties
-// this works across all unicode locales
 Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.parseClass = void 0;
-// { : [, /u flag required, negated]
-const posixClasses = {
-    '[:alnum:]': ['\\p{L}\\p{Nl}\\p{Nd}', true],
-    '[:alpha:]': ['\\p{L}\\p{Nl}', true],
-    '[:ascii:]': ['\\x' + '00-\\x' + '7f', false],
-    '[:blank:]': ['\\p{Zs}\\t', true],
-    '[:cntrl:]': ['\\p{Cc}', true],
-    '[:digit:]': ['\\p{Nd}', true],
-    '[:graph:]': ['\\p{Z}\\p{C}', true, true],
-    '[:lower:]': ['\\p{Ll}', true],
-    '[:print:]': ['\\p{C}', true],
-    '[:punct:]': ['\\p{P}', true],
-    '[:space:]': ['\\p{Z}\\t\\r\\n\\v\\f', true],
-    '[:upper:]': ['\\p{Lu}', true],
-    '[:word:]': ['\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}', true],
-    '[:xdigit:]': ['A-Fa-f0-9', false],
+exports.serializeResult = exports.killSocketOrPath = exports.FORKED_PROCESS_OS_SOCKET_PATH = exports.FULL_OS_SOCKET_PATH = exports.isWindows = void 0;
+const fs_1 = __nccwpck_require__(57147);
+const os_1 = __nccwpck_require__(22037);
+const path_1 = __nccwpck_require__(71017);
+const tmp_dir_1 = __nccwpck_require__(71524);
+const serializable_error_1 = __nccwpck_require__(39268);
+exports.isWindows = (0, os_1.platform)() === 'win32';
+/**
+ * For IPC with the daemon server we use unix sockets or windows named pipes, depending on the user's operating system.
+ *
+ * See https://nodejs.org/dist/latest-v14.x/docs/api/net.html#net_identifying_paths_for_ipc_connections for a full breakdown
+ * of OS differences between Unix domain sockets and named pipes.
+ */
+exports.FULL_OS_SOCKET_PATH = exports.isWindows
+    ? '\\\\.\\pipe\\nx\\' + (0, path_1.resolve)(tmp_dir_1.DAEMON_SOCKET_PATH)
+    : (0, path_1.resolve)(tmp_dir_1.DAEMON_SOCKET_PATH);
+const FORKED_PROCESS_OS_SOCKET_PATH = (id) => {
+    let path = (0, path_1.resolve)((0, path_1.join)(tmp_dir_1.socketDir, 'fp' + id + '.sock'));
+    return exports.isWindows ? '\\\\.\\pipe\\nx\\' + (0, path_1.resolve)(path) : (0, path_1.resolve)(path);
 };
-// only need to escape a few things inside of brace expressions
-// escapes: [ \ ] -
-const braceEscape = (s) => s.replace(/[[\]\\-]/g, '\\$&');
-// escape all regexp magic characters
-const regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
-// everything has already been escaped, we just have to join
-const rangesToString = (ranges) => ranges.join('');
-// takes a glob string at a posix brace expression, and returns
-// an equivalent regular expression source, and boolean indicating
-// whether the /u flag needs to be applied, and the number of chars
-// consumed to parse the character class.
-// This also removes out of order ranges, and returns ($.) if the
-// entire class just no good.
-const parseClass = (glob, position) => {
-    const pos = position;
-    /* c8 ignore start */
-    if (glob.charAt(pos) !== '[') {
-        throw new Error('not in a brace expression');
+exports.FORKED_PROCESS_OS_SOCKET_PATH = FORKED_PROCESS_OS_SOCKET_PATH;
+function killSocketOrPath() {
+    try {
+        (0, fs_1.unlinkSync)(exports.FULL_OS_SOCKET_PATH);
     }
-    /* c8 ignore stop */
-    const ranges = [];
-    const negs = [];
-    let i = pos + 1;
-    let sawStart = false;
-    let uflag = false;
-    let escaping = false;
-    let negate = false;
-    let endPos = pos;
-    let rangeStart = '';
-    WHILE: while (i < glob.length) {
-        const c = glob.charAt(i);
-        if ((c === '!' || c === '^') && i === pos + 1) {
-            negate = true;
-            i++;
-            continue;
-        }
-        if (c === ']' && sawStart && !escaping) {
-            endPos = i + 1;
-            break;
-        }
-        sawStart = true;
-        if (c === '\\') {
-            if (!escaping) {
-                escaping = true;
-                i++;
-                continue;
-            }
-            // escaped \ char, fall through and treat like normal char
-        }
-        if (c === '[' && !escaping) {
-            // either a posix class, a collation equivalent, or just a [
-            for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
-                if (glob.startsWith(cls, i)) {
-                    // invalid, [a-[] is fine, but not [a-[:alpha]]
-                    if (rangeStart) {
-                        return ['$.', false, glob.length - pos, true];
-                    }
-                    i += cls.length;
-                    if (neg)
-                        negs.push(unip);
-                    else
-                        ranges.push(unip);
-                    uflag = uflag || u;
-                    continue WHILE;
-                }
-            }
-        }
-        // now it's just a normal character, effectively
-        escaping = false;
-        if (rangeStart) {
-            // throw this range away if it's not valid, but others
-            // can still match.
-            if (c > rangeStart) {
-                ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c));
-            }
-            else if (c === rangeStart) {
-                ranges.push(braceEscape(c));
-            }
-            rangeStart = '';
-            i++;
-            continue;
-        }
-        // now might be the start of a range.
-        // can be either c-d or c-] or c] or c] at this point
-        if (glob.startsWith('-]', i + 1)) {
-            ranges.push(braceEscape(c + '-'));
-            i += 2;
-            continue;
-        }
-        if (glob.startsWith('-', i + 1)) {
-            rangeStart = c;
-            i += 2;
-            continue;
-        }
-        // not the start of a range, just a single character
-        ranges.push(braceEscape(c));
-        i++;
+    catch { }
+}
+exports.killSocketOrPath = killSocketOrPath;
+// Prepare a serialized project graph result for sending over IPC from the server to the client
+function serializeResult(error, serializedProjectGraph, serializedSourceMaps) {
+    // We do not want to repeat work `JSON.stringify`ing an object containing the potentially large project graph so merge as strings
+    return `{ "error": ${JSON.stringify(error ? (0, serializable_error_1.createSerializableError)(error) : error)}, "projectGraph": ${serializedProjectGraph}, "sourceMaps": ${serializedSourceMaps} }`;
+}
+exports.serializeResult = serializeResult;
+
+
+/***/ }),
+
+/***/ 71524:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.removeSocketDir = exports.isDaemonDisabled = exports.markDaemonAsDisabled = exports.writeDaemonLogs = exports.DAEMON_SOCKET_PATH = exports.socketDir = exports.DAEMON_OUTPUT_LOG_FILE = exports.DAEMON_DIR_FOR_CURRENT_WORKSPACE = void 0;
+/**
+ * Per workspace (to avoid subtle differences and issues), we want to have a deterministic
+ * location within the OS's tmp directory where we write log files for background processes
+ * and where we create the actual unix socket/named pipe for the daemon.
+ */
+const fs_1 = __nccwpck_require__(57147);
+const fs_extra_1 = __nccwpck_require__(2103);
+const path_1 = __nccwpck_require__(71017);
+const cache_directory_1 = __nccwpck_require__(11622);
+const crypto_1 = __nccwpck_require__(6113);
+const tmp_1 = __nccwpck_require__(8517);
+const workspace_root_1 = __nccwpck_require__(64393);
+exports.DAEMON_DIR_FOR_CURRENT_WORKSPACE = (0, path_1.join)(cache_directory_1.projectGraphCacheDirectory, 'd');
+exports.DAEMON_OUTPUT_LOG_FILE = (0, path_1.join)(exports.DAEMON_DIR_FOR_CURRENT_WORKSPACE, 'daemon.log');
+exports.socketDir = createSocketDir();
+exports.DAEMON_SOCKET_PATH = (0, path_1.join)(exports.socketDir, 
+// As per notes above on socket/named pipe length limitations, we keep this intentionally short
+'d.sock');
+function writeDaemonLogs(error) {
+    const file = (0, path_1.join)(exports.DAEMON_DIR_FOR_CURRENT_WORKSPACE, 'daemon-error.log');
+    (0, fs_1.writeFileSync)(file, error);
+    return file;
+}
+exports.writeDaemonLogs = writeDaemonLogs;
+function markDaemonAsDisabled() {
+    (0, fs_1.writeFileSync)((0, path_1.join)(exports.DAEMON_DIR_FOR_CURRENT_WORKSPACE, 'disabled'), 'true');
+}
+exports.markDaemonAsDisabled = markDaemonAsDisabled;
+function isDaemonDisabled() {
+    try {
+        (0, fs_1.statSync)((0, path_1.join)(exports.DAEMON_DIR_FOR_CURRENT_WORKSPACE, 'disabled'));
+        return true;
     }
-    if (endPos < i) {
-        // didn't see the end of the class, not a valid class,
-        // but might still be valid as a literal match.
-        return ['', false, 0, false];
+    catch (e) {
+        return false;
     }
-    // if we got no ranges and no negates, then we have a range that
-    // cannot possibly match anything, and that poisons the whole glob
-    if (!ranges.length && !negs.length) {
-        return ['$.', false, glob.length - pos, true];
+}
+exports.isDaemonDisabled = isDaemonDisabled;
+function socketDirName() {
+    const hasher = (0, crypto_1.createHash)('sha256');
+    hasher.update(workspace_root_1.workspaceRoot.toLowerCase());
+    const unique = hasher.digest('hex').substring(0, 20);
+    return (0, path_1.join)(tmp_1.tmpdir, unique);
+}
+/**
+ * We try to create a socket file in a tmp dir, but if it doesn't work because
+ * for instance we don't have permissions, we create it in DAEMON_DIR_FOR_CURRENT_WORKSPACE
+ */
+function createSocketDir() {
+    try {
+        const dir = process.env.NX_DAEMON_SOCKET_DIR ?? socketDirName();
+        (0, fs_extra_1.ensureDirSync)(dir);
+        return dir;
+    }
+    catch (e) {
+        return exports.DAEMON_DIR_FOR_CURRENT_WORKSPACE;
+    }
+}
+function removeSocketDir() {
+    try {
+        (0, fs_extra_1.rmSync)(exports.socketDir, { recursive: true, force: true });
+    }
+    catch (e) { }
+}
+exports.removeSocketDir = removeSocketDir;
+
+
+/***/ }),
+
+/***/ 28970:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.registerTsProject = exports.loadNxPlugins = exports.LoadedNxPlugin = exports.retrieveProjectConfigurations = exports.findProjectForPath = exports.createProjectRootMappingsFromProjectConfigurations = exports.hashWithWorkspaceContext = exports.hashObject = exports.splitByColons = exports.readModulePackageJson = exports.stripIndent = exports.sortObjectByKeys = exports.combineOptionsForExecutor = exports.splitTarget = exports.isCompatibleTarget = exports.readProjectConfigurationsFromRootMap = exports.mergeTargetConfigurations = exports.retrieveProjectConfigurationsWithAngularProjects = exports.calculateDefaultProjectName = exports.readNxJsonFromDisk = exports.getExecutorInformation = exports.deepEquals = exports.createTempNpmDirectory = void 0;
+const tslib_1 = __nccwpck_require__(63085);
+/**
+ * Note to developers: STOP! These exports are available via requireNx in @nx/devkit.
+ *
+ * These may not be available in certain version of Nx, so be sure to check them first.
+ */
+var package_manager_1 = __nccwpck_require__(86822);
+Object.defineProperty(exports, "createTempNpmDirectory", ({ enumerable: true, get: function () { return package_manager_1.createTempNpmDirectory; } }));
+var json_diff_1 = __nccwpck_require__(37845);
+Object.defineProperty(exports, "deepEquals", ({ enumerable: true, get: function () { return json_diff_1.deepEquals; } }));
+var executor_utils_1 = __nccwpck_require__(84678);
+Object.defineProperty(exports, "getExecutorInformation", ({ enumerable: true, get: function () { return executor_utils_1.getExecutorInformation; } }));
+var nx_json_1 = __nccwpck_require__(21173);
+Object.defineProperty(exports, "readNxJsonFromDisk", ({ enumerable: true, get: function () { return nx_json_1.readNxJson; } }));
+var calculate_default_project_name_1 = __nccwpck_require__(29966);
+Object.defineProperty(exports, "calculateDefaultProjectName", ({ enumerable: true, get: function () { return calculate_default_project_name_1.calculateDefaultProjectName; } }));
+var retrieve_workspace_files_1 = __nccwpck_require__(25264);
+Object.defineProperty(exports, "retrieveProjectConfigurationsWithAngularProjects", ({ enumerable: true, get: function () { return retrieve_workspace_files_1.retrieveProjectConfigurationsWithAngularProjects; } }));
+var project_configuration_utils_1 = __nccwpck_require__(36818);
+Object.defineProperty(exports, "mergeTargetConfigurations", ({ enumerable: true, get: function () { return project_configuration_utils_1.mergeTargetConfigurations; } }));
+var project_configuration_utils_2 = __nccwpck_require__(36818);
+Object.defineProperty(exports, "readProjectConfigurationsFromRootMap", ({ enumerable: true, get: function () { return project_configuration_utils_2.readProjectConfigurationsFromRootMap; } }));
+Object.defineProperty(exports, "isCompatibleTarget", ({ enumerable: true, get: function () { return project_configuration_utils_2.isCompatibleTarget; } }));
+var split_target_1 = __nccwpck_require__(2792);
+Object.defineProperty(exports, "splitTarget", ({ enumerable: true, get: function () { return split_target_1.splitTarget; } }));
+var params_1 = __nccwpck_require__(55457);
+Object.defineProperty(exports, "combineOptionsForExecutor", ({ enumerable: true, get: function () { return params_1.combineOptionsForExecutor; } }));
+var object_sort_1 = __nccwpck_require__(74150);
+Object.defineProperty(exports, "sortObjectByKeys", ({ enumerable: true, get: function () { return object_sort_1.sortObjectByKeys; } }));
+var logger_1 = __nccwpck_require__(37270);
+Object.defineProperty(exports, "stripIndent", ({ enumerable: true, get: function () { return logger_1.stripIndent; } }));
+var package_json_1 = __nccwpck_require__(78618);
+Object.defineProperty(exports, "readModulePackageJson", ({ enumerable: true, get: function () { return package_json_1.readModulePackageJson; } }));
+var split_target_2 = __nccwpck_require__(2792);
+Object.defineProperty(exports, "splitByColons", ({ enumerable: true, get: function () { return split_target_2.splitByColons; } }));
+var file_hasher_1 = __nccwpck_require__(19482);
+Object.defineProperty(exports, "hashObject", ({ enumerable: true, get: function () { return file_hasher_1.hashObject; } }));
+var workspace_context_1 = __nccwpck_require__(98897);
+Object.defineProperty(exports, "hashWithWorkspaceContext", ({ enumerable: true, get: function () { return workspace_context_1.hashWithWorkspaceContext; } }));
+var find_project_for_path_1 = __nccwpck_require__(69621);
+Object.defineProperty(exports, "createProjectRootMappingsFromProjectConfigurations", ({ enumerable: true, get: function () { return find_project_for_path_1.createProjectRootMappingsFromProjectConfigurations; } }));
+Object.defineProperty(exports, "findProjectForPath", ({ enumerable: true, get: function () { return find_project_for_path_1.findProjectForPath; } }));
+var retrieve_workspace_files_2 = __nccwpck_require__(25264);
+Object.defineProperty(exports, "retrieveProjectConfigurations", ({ enumerable: true, get: function () { return retrieve_workspace_files_2.retrieveProjectConfigurations; } }));
+var internal_api_1 = __nccwpck_require__(19400);
+Object.defineProperty(exports, "LoadedNxPlugin", ({ enumerable: true, get: function () { return internal_api_1.LoadedNxPlugin; } }));
+Object.defineProperty(exports, "loadNxPlugins", ({ enumerable: true, get: function () { return internal_api_1.loadNxPlugins; } }));
+tslib_1.__exportStar(__nccwpck_require__(54403), exports);
+var register_1 = __nccwpck_require__(56413);
+Object.defineProperty(exports, "registerTsProject", ({ enumerable: true, get: function () { return register_1.registerTsProject; } }));
+
+
+/***/ }),
+
+/***/ 19482:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.hashObject = exports.hashArray = void 0;
+function hashArray(content) {
+    // Import as needed. There is also an issue running unit tests in Nx repo if this is a top-level import.
+    const { hashArray } = __nccwpck_require__(71926);
+    return hashArray(content);
+}
+exports.hashArray = hashArray;
+function hashObject(obj) {
+    const { hashArray } = __nccwpck_require__(71926);
+    const parts = [];
+    for (const key of Object.keys(obj).sort()) {
+        parts.push(key);
+        parts.push(JSON.stringify(obj[key]));
+    }
+    return hashArray(parts);
+}
+exports.hashObject = hashObject;
+
+
+/***/ }),
+
+/***/ 71926:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+const { join, basename } = __nccwpck_require__(71017);
+const { copyFileSync, existsSync, mkdirSync } = __nccwpck_require__(57147);
+const Module = __nccwpck_require__(98188);
+const { nxVersion } = __nccwpck_require__(10780);
+const { cacheDir } = __nccwpck_require__(11622);
+
+const nxPackages = new Set([
+  '@nx/nx-android-arm64',
+  '@nx/nx-android-arm-eabi',
+  '@nx/nx-win32-x64-msvc',
+  '@nx/nx-win32-ia32-msvc',
+  '@nx/nx-win32-arm64-msvc',
+  '@nx/nx-darwin-universal',
+  '@nx/nx-darwin-x64',
+  '@nx/nx-darwin-arm64',
+  '@nx/nx-freebsd-x64',
+  '@nx/nx-linux-x64-musl',
+  '@nx/nx-linux-x64-gnu',
+  '@nx/nx-linux-arm64-musl',
+  '@nx/nx-linux-arm64-gnu',
+  '@nx/nx-linux-arm-gnueabihf',
+]);
+
+const localNodeFiles = [
+  'nx.android-arm64.node',
+  'nx.android-arm-eabi.node',
+  'nx.win32-x64-msvc.node',
+  'nx.win32-ia32-msvc.node',
+  'nx.win32-arm64-msvc.node',
+  'nx.darwin-universal.node',
+  'nx.darwin-x64.node',
+  'nx.darwin-arm64.node',
+  'nx.freebsd-x64.node',
+  'nx.linux-x64-musl.node',
+  'nx.linux-x64-gnu.node',
+  'nx.linux-arm64-musl.node',
+  'nx.linux-arm64-gnu.node',
+  'nx.linux-arm-gnueabihf.node',
+];
+
+const originalLoad = Module._load;
+
+// We override the _load function so that when a native file is required,
+// we copy it to a cache directory and require it from there.
+// This prevents the file being loaded from node_modules and causing file locking issues.
+// Will only be called once because the require cache takes over afterwards.
+Module._load = function (request, parent, isMain) {
+  const modulePath = request;
+  if (
+    nxPackages.has(modulePath) ||
+    localNodeFiles.some((f) => modulePath.endsWith(f))
+  ) {
+    const nativeLocation = require.resolve(modulePath);
+    const fileName = basename(nativeLocation);
+    // we copy the file to the cache directory (.nx/cache by default) and prefix with nxVersion to avoid stale files being loaded
+    const tmpFile = join(cacheDir, nxVersion + '-' + fileName);
+    if (existsSync(tmpFile)) {
+      return originalLoad.apply(this, [tmpFile, parent, isMain]);
     }
-    // if we got one positive range, and it's a single character, then that's
-    // not actually a magic pattern, it's just that one literal character.
-    // we should not treat that as "magic", we should just return the literal
-    // character. [_] is a perfectly valid way to escape glob magic chars.
-    if (negs.length === 0 &&
-        ranges.length === 1 &&
-        /^\\?.$/.test(ranges[0]) &&
-        !negate) {
-        const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
-        return [regexpEscape(r), false, endPos - pos, false];
+    if (!existsSync(cacheDir)) {
+      mkdirSync(cacheDir, { recursive: true });
     }
-    const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']';
-    const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']';
-    const comb = ranges.length && negs.length
-        ? '(' + sranges + '|' + snegs + ')'
-        : ranges.length
-            ? sranges
-            : snegs;
-    return [comb, uflag, endPos - pos, true];
+    copyFileSync(nativeLocation, tmpFile);
+    return originalLoad.apply(this, [tmpFile, parent, isMain]);
+  } else {
+    // call the original _load function for everything else
+    return originalLoad.apply(this, arguments);
+  }
 };
-exports.parseClass = parseClass;
-//# sourceMappingURL=brace-expressions.js.map
-
-/***/ }),
 
-/***/ 7350:
-/***/ ((__unused_webpack_module, exports) => {
+const indexModulePath = __nccwpck_require__.ab + "native-bindings.js";
+delete require.cache[__nccwpck_require__.ab + "native-bindings.js"];
+const indexModule = __nccwpck_require__(65550);
 
-"use strict";
+module.exports = indexModule;
+Module._load = originalLoad;
 
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.escape = void 0;
-/**
- * Escape all magic characters in a glob pattern.
- *
- * If the {@link windowsPathsNoEscape | GlobOptions.windowsPathsNoEscape}
- * option is used, then characters are escaped by wrapping in `[]`, because
- * a magic character wrapped in a character class can only be satisfied by
- * that exact character.  In this mode, `\` is _not_ escaped, because it is
- * not interpreted as a magic character, but instead as a path separator.
- */
-const escape = (s, { windowsPathsNoEscape = false, } = {}) => {
-    // don't need to escape +@! because we escape the parens
-    // that make those magic, and escaping ! as [!] isn't valid,
-    // because [!]] is a valid glob class meaning not ']'.
-    return windowsPathsNoEscape
-        ? s.replace(/[?*()[\]]/g, '[$&]')
-        : s.replace(/[?*()[\]\\]/g, '\\$&');
-};
-exports.escape = escape;
-//# sourceMappingURL=escape.js.map
 
 /***/ }),
 
-/***/ 681:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
+/***/ 65550:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
-"use strict";
+const { existsSync, readFileSync } = __nccwpck_require__(57147)
+const { join } = __nccwpck_require__(71017)
 
-var __importDefault = (this && this.__importDefault) || function (mod) {
-    return (mod && mod.__esModule) ? mod : { "default": mod };
-};
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.unescape = exports.escape = exports.AST = exports.Minimatch = exports.match = exports.makeRe = exports.braceExpand = exports.defaults = exports.filter = exports.GLOBSTAR = exports.sep = exports.minimatch = void 0;
-const brace_expansion_1 = __importDefault(__nccwpck_require__(3717));
-const assert_valid_pattern_js_1 = __nccwpck_require__(7840);
-const ast_js_1 = __nccwpck_require__(1227);
-const escape_js_1 = __nccwpck_require__(7350);
-const unescape_js_1 = __nccwpck_require__(391);
-const minimatch = (p, pattern, options = {}) => {
-    (0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
-    // shortcut: comments match nothing.
-    if (!options.nocomment && pattern.charAt(0) === '#') {
-        return false;
-    }
-    return new Minimatch(pattern, options).match(p);
-};
-exports.minimatch = minimatch;
-// Optimized checking for the most common glob patterns.
-const starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
-const starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext);
-const starDotExtTestDot = (ext) => (f) => f.endsWith(ext);
-const starDotExtTestNocase = (ext) => {
-    ext = ext.toLowerCase();
-    return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext);
-};
-const starDotExtTestNocaseDot = (ext) => {
-    ext = ext.toLowerCase();
-    return (f) => f.toLowerCase().endsWith(ext);
-};
-const starDotStarRE = /^\*+\.\*+$/;
-const starDotStarTest = (f) => !f.startsWith('.') && f.includes('.');
-const starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.');
-const dotStarRE = /^\.\*+$/;
-const dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.');
-const starRE = /^\*+$/;
-const starTest = (f) => f.length !== 0 && !f.startsWith('.');
-const starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..';
-const qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
-const qmarksTestNocase = ([$0, ext = '']) => {
-    const noext = qmarksTestNoExt([$0]);
-    if (!ext)
-        return noext;
-    ext = ext.toLowerCase();
-    return (f) => noext(f) && f.toLowerCase().endsWith(ext);
-};
-const qmarksTestNocaseDot = ([$0, ext = '']) => {
-    const noext = qmarksTestNoExtDot([$0]);
-    if (!ext)
-        return noext;
-    ext = ext.toLowerCase();
-    return (f) => noext(f) && f.toLowerCase().endsWith(ext);
-};
-const qmarksTestDot = ([$0, ext = '']) => {
-    const noext = qmarksTestNoExtDot([$0]);
-    return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
-};
-const qmarksTest = ([$0, ext = '']) => {
-    const noext = qmarksTestNoExt([$0]);
-    return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
-};
-const qmarksTestNoExt = ([$0]) => {
-    const len = $0.length;
-    return (f) => f.length === len && !f.startsWith('.');
-};
-const qmarksTestNoExtDot = ([$0]) => {
-    const len = $0.length;
-    return (f) => f.length === len && f !== '.' && f !== '..';
-};
-/* c8 ignore start */
-const defaultPlatform = (typeof process === 'object' && process
-    ? (typeof process.env === 'object' &&
-        process.env &&
-        process.env.__MINIMATCH_TESTING_PLATFORM__) ||
-        process.platform
-    : 'posix');
-const path = {
-    win32: { sep: '\\' },
-    posix: { sep: '/' },
-};
-/* c8 ignore stop */
-exports.sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep;
-exports.minimatch.sep = exports.sep;
-exports.GLOBSTAR = Symbol('globstar **');
-exports.minimatch.GLOBSTAR = exports.GLOBSTAR;
-// any single thing other than /
-// don't need to escape / when using new RegExp()
-const qmark = '[^/]';
-// * => any number of characters
-const star = qmark + '*?';
-// ** when dots are allowed.  Anything goes, except .. and .
-// not (^ or / followed by one or two dots followed by $ or /),
-// followed by anything, any number of times.
-const twoStarDot = '(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?';
-// not a ^ or / followed by a dot,
-// followed by anything, any number of times.
-const twoStarNoDot = '(?:(?!(?:\\/|^)\\.).)*?';
-const filter = (pattern, options = {}) => (p) => (0, exports.minimatch)(p, pattern, options);
-exports.filter = filter;
-exports.minimatch.filter = exports.filter;
-const ext = (a, b = {}) => Object.assign({}, a, b);
-const defaults = (def) => {
-    if (!def || typeof def !== 'object' || !Object.keys(def).length) {
-        return exports.minimatch;
-    }
-    const orig = exports.minimatch;
-    const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
-    return Object.assign(m, {
-        Minimatch: class Minimatch extends orig.Minimatch {
-            constructor(pattern, options = {}) {
-                super(pattern, ext(def, options));
-            }
-            static defaults(options) {
-                return orig.defaults(ext(def, options)).Minimatch;
-            }
-        },
-        AST: class AST extends orig.AST {
-            /* c8 ignore start */
-            constructor(type, parent, options = {}) {
-                super(type, parent, ext(def, options));
-            }
-            /* c8 ignore stop */
-            static fromGlob(pattern, options = {}) {
-                return orig.AST.fromGlob(pattern, ext(def, options));
-            }
-        },
-        unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
-        escape: (s, options = {}) => orig.escape(s, ext(def, options)),
-        filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
-        defaults: (options) => orig.defaults(ext(def, options)),
-        makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
-        braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
-        match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
-        sep: orig.sep,
-        GLOBSTAR: exports.GLOBSTAR,
-    });
-};
-exports.defaults = defaults;
-exports.minimatch.defaults = exports.defaults;
-// Brace expansion:
-// a{b,c}d -> abd acd
-// a{b,}c -> abc ac
-// a{0..3}d -> a0d a1d a2d a3d
-// a{b,c{d,e}f}g -> abg acdfg acefg
-// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
-//
-// Invalid sets are not expanded.
-// a{2..}b -> a{2..}b
-// a{b}c -> a{b}c
-const braceExpand = (pattern, options = {}) => {
-    (0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
-    // Thanks to Yeting Li  for
-    // improving this regexp to avoid a ReDOS vulnerability.
-    if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
-        // shortcut. no need to expand.
-        return [pattern];
-    }
-    return (0, brace_expansion_1.default)(pattern);
-};
-exports.braceExpand = braceExpand;
-exports.minimatch.braceExpand = exports.braceExpand;
-// parse a component of the expanded set.
-// At this point, no pattern may contain "/" in it
-// so we're going to return a 2d array, where each entry is the full
-// pattern, split on '/', and then turned into a regular expression.
-// A regexp is made at the end which joins each array with an
-// escaped /, and another full one which joins each regexp with |.
-//
-// Following the lead of Bash 4.1, note that "**" only has special meaning
-// when it is the *only* thing in a path portion.  Otherwise, any series
-// of * is equivalent to a single *.  Globstar behavior is enabled by
-// default, and can be disabled by setting options.noglobstar.
-const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
-exports.makeRe = makeRe;
-exports.minimatch.makeRe = exports.makeRe;
-const match = (list, pattern, options = {}) => {
-    const mm = new Minimatch(pattern, options);
-    list = list.filter(f => mm.match(f));
-    if (mm.options.nonull && !list.length) {
-        list.push(pattern);
-    }
-    return list;
-};
-exports.match = match;
-exports.minimatch.match = exports.match;
-// replace stuff like \* with *
-const globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
-const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
-class Minimatch {
-    options;
-    set;
-    pattern;
-    windowsPathsNoEscape;
-    nonegate;
-    negate;
-    comment;
-    empty;
-    preserveMultipleSlashes;
-    partial;
-    globSet;
-    globParts;
-    nocase;
-    isWindows;
-    platform;
-    windowsNoMagicRoot;
-    regexp;
-    constructor(pattern, options = {}) {
-        (0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
-        options = options || {};
-        this.options = options;
-        this.pattern = pattern;
-        this.platform = options.platform || defaultPlatform;
-        this.isWindows = this.platform === 'win32';
-        this.windowsPathsNoEscape =
-            !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
-        if (this.windowsPathsNoEscape) {
-            this.pattern = this.pattern.replace(/\\/g, '/');
-        }
-        this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
-        this.regexp = null;
-        this.negate = false;
-        this.nonegate = !!options.nonegate;
-        this.comment = false;
-        this.empty = false;
-        this.partial = !!options.partial;
-        this.nocase = !!this.options.nocase;
-        this.windowsNoMagicRoot =
-            options.windowsNoMagicRoot !== undefined
-                ? options.windowsNoMagicRoot
-                : !!(this.isWindows && this.nocase);
-        this.globSet = [];
-        this.globParts = [];
-        this.set = [];
-        // make the set of regexps etc.
-        this.make();
+const { platform, arch } = process
+
+let nativeBinding = null
+let localFileExisted = false
+let loadError = null
+
+function isMusl() {
+  // For Node 10
+  if (!process.report || typeof process.report.getReport !== 'function') {
+    try {
+      const lddPath = (__nccwpck_require__(32081).execSync)('which ldd').toString().trim();
+      return readFileSync(lddPath, 'utf8').includes('musl')
+    } catch (e) {
+      return true
     }
-    hasMagic() {
-        if (this.options.magicalBraces && this.set.length > 1) {
-            return true;
+  } else {
+    const { glibcVersionRuntime } = process.report.getReport().header
+    return !glibcVersionRuntime
+  }
+}
+
+switch (platform) {
+  case 'android':
+    switch (arch) {
+      case 'arm64':
+        localFileExisted = existsSync(join(__dirname, 'nx.android-arm64.node'))
+        try {
+          if (localFileExisted) {
+            nativeBinding = __nccwpck_require__(69706)
+          } else {
+            nativeBinding = __nccwpck_require__(29409)
+          }
+        } catch (e) {
+          loadError = e
         }
-        for (const pattern of this.set) {
-            for (const part of pattern) {
-                if (typeof part !== 'string')
-                    return true;
-            }
+        break
+      case 'arm':
+        localFileExisted = existsSync(join(__dirname, 'nx.android-arm-eabi.node'))
+        try {
+          if (localFileExisted) {
+            nativeBinding = __nccwpck_require__(52695)
+          } else {
+            nativeBinding = __nccwpck_require__(20952)
+          }
+        } catch (e) {
+          loadError = e
         }
-        return false;
+        break
+      default:
+        throw new Error(`Unsupported architecture on Android ${arch}`)
     }
-    debug(..._) { }
-    make() {
-        const pattern = this.pattern;
-        const options = this.options;
-        // empty patterns and comments match nothing.
-        if (!options.nocomment && pattern.charAt(0) === '#') {
-            this.comment = true;
-            return;
-        }
-        if (!pattern) {
-            this.empty = true;
-            return;
+    break
+  case 'win32':
+    switch (arch) {
+      case 'x64':
+        localFileExisted = existsSync(
+          join(__dirname, 'nx.win32-x64-msvc.node')
+        )
+        try {
+          if (localFileExisted) {
+            nativeBinding = __nccwpck_require__(10155)
+          } else {
+            nativeBinding = __nccwpck_require__(72309)
+          }
+        } catch (e) {
+          loadError = e
         }
-        // step 1: figure out negation, etc.
-        this.parseNegate();
-        // step 2: expand braces
-        this.globSet = [...new Set(this.braceExpand())];
-        if (options.debug) {
-            this.debug = (...args) => console.error(...args);
+        break
+      case 'ia32':
+        localFileExisted = existsSync(
+          join(__dirname, 'nx.win32-ia32-msvc.node')
+        )
+        try {
+          if (localFileExisted) {
+            nativeBinding = __nccwpck_require__(17077)
+          } else {
+            nativeBinding = __nccwpck_require__(91934)
+          }
+        } catch (e) {
+          loadError = e
         }
-        this.debug(this.pattern, this.globSet);
-        // step 3: now we have a set, so turn each one into a series of
-        // path-portion matching patterns.
-        // These will be regexps, except in the case of "**", which is
-        // set to the GLOBSTAR object for globstar behavior,
-        // and will not contain any / characters
-        //
-        // First, we preprocess to make the glob pattern sets a bit simpler
-        // and deduped.  There are some perf-killing patterns that can cause
-        // problems with a glob walk, but we can simplify them down a bit.
-        const rawGlobParts = this.globSet.map(s => this.slashSplit(s));
-        this.globParts = this.preprocess(rawGlobParts);
-        this.debug(this.pattern, this.globParts);
-        // glob --> regexps
-        let set = this.globParts.map((s, _, __) => {
-            if (this.isWindows && this.windowsNoMagicRoot) {
-                // check if it's a drive or unc path.
-                const isUNC = s[0] === '' &&
-                    s[1] === '' &&
-                    (s[2] === '?' || !globMagic.test(s[2])) &&
-                    !globMagic.test(s[3]);
-                const isDrive = /^[a-z]:/i.test(s[0]);
-                if (isUNC) {
-                    return [...s.slice(0, 4), ...s.slice(4).map(ss => this.parse(ss))];
-                }
-                else if (isDrive) {
-                    return [s[0], ...s.slice(1).map(ss => this.parse(ss))];
-                }
-            }
-            return s.map(ss => this.parse(ss));
-        });
-        this.debug(this.pattern, set);
-        // filter out everything that didn't compile properly.
-        this.set = set.filter(s => s.indexOf(false) === -1);
-        // do not treat the ? in UNC paths as magic
-        if (this.isWindows) {
-            for (let i = 0; i < this.set.length; i++) {
-                const p = this.set[i];
-                if (p[0] === '' &&
-                    p[1] === '' &&
-                    this.globParts[i][2] === '?' &&
-                    typeof p[3] === 'string' &&
-                    /^[a-z]:$/i.test(p[3])) {
-                    p[2] = '?';
-                }
-            }
+        break
+      case 'arm64':
+        localFileExisted = existsSync(
+          join(__dirname, 'nx.win32-arm64-msvc.node')
+        )
+        try {
+          if (localFileExisted) {
+            nativeBinding = __nccwpck_require__(1722)
+          } else {
+            nativeBinding = __nccwpck_require__(88468)
+          }
+        } catch (e) {
+          loadError = e
         }
-        this.debug(this.pattern, this.set);
+        break
+      default:
+        throw new Error(`Unsupported architecture on Windows: ${arch}`)
     }
-    // various transforms to equivalent pattern sets that are
-    // faster to process in a filesystem walk.  The goal is to
-    // eliminate what we can, and push all ** patterns as far
-    // to the right as possible, even if it increases the number
-    // of patterns that we have to process.
-    preprocess(globParts) {
-        // if we're not in globstar mode, then turn all ** into *
-        if (this.options.noglobstar) {
-            for (let i = 0; i < globParts.length; i++) {
-                for (let j = 0; j < globParts[i].length; j++) {
-                    if (globParts[i][j] === '**') {
-                        globParts[i][j] = '*';
-                    }
-                }
-            }
-        }
-        const { optimizationLevel = 1 } = this.options;
-        if (optimizationLevel >= 2) {
-            // aggressive optimization for the purpose of fs walking
-            globParts = this.firstPhasePreProcess(globParts);
-            globParts = this.secondPhasePreProcess(globParts);
-        }
-        else if (optimizationLevel >= 1) {
-            // just basic optimizations to remove some .. parts
-            globParts = this.levelOneOptimize(globParts);
+    break
+  case 'darwin':
+    localFileExisted = existsSync(join(__dirname, 'nx.darwin-universal.node'))
+    try {
+      if (localFileExisted) {
+        nativeBinding = __nccwpck_require__(69697)
+      } else {
+        nativeBinding = __nccwpck_require__(42446)
+      }
+      break
+    } catch {}
+    switch (arch) {
+      case 'x64':
+        localFileExisted = existsSync(join(__dirname, 'nx.darwin-x64.node'))
+        try {
+          if (localFileExisted) {
+            nativeBinding = __nccwpck_require__(1715)
+          } else {
+            nativeBinding = __nccwpck_require__(43629)
+          }
+        } catch (e) {
+          loadError = e
         }
-        else {
-            globParts = this.adjascentGlobstarOptimize(globParts);
+        break
+      case 'arm64':
+        localFileExisted = existsSync(
+          join(__dirname, 'nx.darwin-arm64.node')
+        )
+        try {
+          if (localFileExisted) {
+            nativeBinding = __nccwpck_require__(43449)
+          } else {
+            nativeBinding = __nccwpck_require__(32353)
+          }
+        } catch (e) {
+          loadError = e
         }
-        return globParts;
-    }
-    // just get rid of adjascent ** portions
-    adjascentGlobstarOptimize(globParts) {
-        return globParts.map(parts => {
-            let gs = -1;
-            while (-1 !== (gs = parts.indexOf('**', gs + 1))) {
-                let i = gs;
-                while (parts[i + 1] === '**') {
-                    i++;
-                }
-                if (i !== gs) {
-                    parts.splice(gs, i - gs);
-                }
-            }
-            return parts;
-        });
+        break
+      default:
+        throw new Error(`Unsupported architecture on macOS: ${arch}`)
     }
-    // get rid of adjascent ** and resolve .. portions
-    levelOneOptimize(globParts) {
-        return globParts.map(parts => {
-            parts = parts.reduce((set, part) => {
-                const prev = set[set.length - 1];
-                if (part === '**' && prev === '**') {
-                    return set;
-                }
-                if (part === '..') {
-                    if (prev && prev !== '..' && prev !== '.' && prev !== '**') {
-                        set.pop();
-                        return set;
-                    }
-                }
-                set.push(part);
-                return set;
-            }, []);
-            return parts.length === 0 ? [''] : parts;
-        });
+    break
+  case 'freebsd':
+    if (arch !== 'x64') {
+      throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
     }
-    levelTwoFileOptimize(parts) {
-        if (!Array.isArray(parts)) {
-            parts = this.slashSplit(parts);
-        }
-        let didSomething = false;
-        do {
-            didSomething = false;
-            // 
// -> 
/
-            if (!this.preserveMultipleSlashes) {
-                for (let i = 1; i < parts.length - 1; i++) {
-                    const p = parts[i];
-                    // don't squeeze out UNC patterns
-                    if (i === 1 && p === '' && parts[0] === '')
-                        continue;
-                    if (p === '.' || p === '') {
-                        didSomething = true;
-                        parts.splice(i, 1);
-                        i--;
-                    }
-                }
-                if (parts[0] === '.' &&
-                    parts.length === 2 &&
-                    (parts[1] === '.' || parts[1] === '')) {
-                    didSomething = true;
-                    parts.pop();
-                }
-            }
-            // 
/

/../ ->

/
-            let dd = 0;
-            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
-                const p = parts[dd - 1];
-                if (p && p !== '.' && p !== '..' && p !== '**') {
-                    didSomething = true;
-                    parts.splice(dd - 1, 2);
-                    dd -= 2;
-                }
-            }
-        } while (didSomething);
-        return parts.length === 0 ? [''] : parts;
+    localFileExisted = existsSync(join(__dirname, 'nx.freebsd-x64.node'))
+    try {
+      if (localFileExisted) {
+        nativeBinding = __nccwpck_require__(85319)
+      } else {
+        nativeBinding = __nccwpck_require__(3163)
+      }
+    } catch (e) {
+      loadError = e
     }
-    // First phase: single-pattern processing
-    // 
 is 1 or more portions
-    //  is 1 or more portions
-    // 

is any portion other than ., .., '', or ** - // is . or '' - // - // **/.. is *brutal* for filesystem walking performance, because - // it effectively resets the recursive walk each time it occurs, - // and ** cannot be reduced out by a .. pattern part like a regexp - // or most strings (other than .., ., and '') can be. - // - //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/} - //

// -> 
/
-    // 
/

/../ ->

/
-    // **/**/ -> **/
-    //
-    // **/*/ -> */**/ <== not valid because ** doesn't follow
-    // this WOULD be allowed if ** did follow symlinks, or * didn't
-    firstPhasePreProcess(globParts) {
-        let didSomething = false;
-        do {
-            didSomething = false;
-            // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/} - for (let parts of globParts) { - let gs = -1; - while (-1 !== (gs = parts.indexOf('**', gs + 1))) { - let gss = gs; - while (parts[gss + 1] === '**') { - //

/**/**/ -> 
/**/
-                        gss++;
-                    }
-                    // eg, if gs is 2 and gss is 4, that means we have 3 **
-                    // parts, and can remove 2 of them.
-                    if (gss > gs) {
-                        parts.splice(gs + 1, gss - gs);
-                    }
-                    let next = parts[gs + 1];
-                    const p = parts[gs + 2];
-                    const p2 = parts[gs + 3];
-                    if (next !== '..')
-                        continue;
-                    if (!p ||
-                        p === '.' ||
-                        p === '..' ||
-                        !p2 ||
-                        p2 === '.' ||
-                        p2 === '..') {
-                        continue;
-                    }
-                    didSomething = true;
-                    // edit parts in place, and push the new one
-                    parts.splice(gs, 1);
-                    const other = parts.slice(0);
-                    other[gs] = '**';
-                    globParts.push(other);
-                    gs--;
-                }
-                // 
// -> 
/
-                if (!this.preserveMultipleSlashes) {
-                    for (let i = 1; i < parts.length - 1; i++) {
-                        const p = parts[i];
-                        // don't squeeze out UNC patterns
-                        if (i === 1 && p === '' && parts[0] === '')
-                            continue;
-                        if (p === '.' || p === '') {
-                            didSomething = true;
-                            parts.splice(i, 1);
-                            i--;
-                        }
-                    }
-                    if (parts[0] === '.' &&
-                        parts.length === 2 &&
-                        (parts[1] === '.' || parts[1] === '')) {
-                        didSomething = true;
-                        parts.pop();
-                    }
-                }
-                // 
/

/../ ->

/
-                let dd = 0;
-                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
-                    const p = parts[dd - 1];
-                    if (p && p !== '.' && p !== '..' && p !== '**') {
-                        didSomething = true;
-                        const needDot = dd === 1 && parts[dd + 1] === '**';
-                        const splin = needDot ? ['.'] : [];
-                        parts.splice(dd - 1, 2, ...splin);
-                        if (parts.length === 0)
-                            parts.push('');
-                        dd -= 2;
-                    }
-                }
+    break
+  case 'linux':
+    switch (arch) {
+      case 'x64':
+        if (isMusl()) {
+          localFileExisted = existsSync(
+            join(__dirname, 'nx.linux-x64-musl.node')
+          )
+          try {
+            if (localFileExisted) {
+              nativeBinding = __nccwpck_require__(40497)
+            } else {
+              nativeBinding = __nccwpck_require__(76272)
             }
-        } while (didSomething);
-        return globParts;
-    }
-    // second phase: multi-pattern dedupes
-    // {
/*/,
/

/} ->

/*/
-    // {
/,
/} -> 
/
-    // {
/**/,
/} -> 
/**/
-    //
-    // {
/**/,
/**/

/} ->

/**/
-    // ^-- not valid because ** doens't follow symlinks
-    secondPhasePreProcess(globParts) {
-        for (let i = 0; i < globParts.length - 1; i++) {
-            for (let j = i + 1; j < globParts.length; j++) {
-                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
-                if (!matched)
-                    continue;
-                globParts[i] = matched;
-                globParts[j] = [];
+          } catch (e) {
+            loadError = e
+          }
+        } else {
+          localFileExisted = existsSync(
+            join(__dirname, 'nx.linux-x64-gnu.node')
+          )
+          try {
+            if (localFileExisted) {
+              nativeBinding = __nccwpck_require__(54000)
+            } else {
+              nativeBinding = __nccwpck_require__(63471)
             }
+          } catch (e) {
+            loadError = e
+          }
         }
-        return globParts.filter(gs => gs.length);
-    }
-    partsMatch(a, b, emptyGSMatch = false) {
-        let ai = 0;
-        let bi = 0;
-        let result = [];
-        let which = '';
-        while (ai < a.length && bi < b.length) {
-            if (a[ai] === b[bi]) {
-                result.push(which === 'b' ? b[bi] : a[ai]);
-                ai++;
-                bi++;
-            }
-            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {
-                result.push(a[ai]);
-                ai++;
-            }
-            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {
-                result.push(b[bi]);
-                bi++;
-            }
-            else if (a[ai] === '*' &&
-                b[bi] &&
-                (this.options.dot || !b[bi].startsWith('.')) &&
-                b[bi] !== '**') {
-                if (which === 'b')
-                    return false;
-                which = 'a';
-                result.push(a[ai]);
-                ai++;
-                bi++;
-            }
-            else if (b[bi] === '*' &&
-                a[ai] &&
-                (this.options.dot || !a[ai].startsWith('.')) &&
-                a[ai] !== '**') {
-                if (which === 'a')
-                    return false;
-                which = 'b';
-                result.push(b[bi]);
-                ai++;
-                bi++;
+        break
+      case 'arm64':
+        if (isMusl()) {
+          localFileExisted = existsSync(
+            join(__dirname, 'nx.linux-arm64-musl.node')
+          )
+          try {
+            if (localFileExisted) {
+              nativeBinding = __nccwpck_require__(72282)
+            } else {
+              nativeBinding = __nccwpck_require__(77052)
             }
-            else {
-                return false;
+          } catch (e) {
+            loadError = e
+          }
+        } else {
+          localFileExisted = existsSync(
+            join(__dirname, 'nx.linux-arm64-gnu.node')
+          )
+          try {
+            if (localFileExisted) {
+              nativeBinding = __nccwpck_require__(98032)
+            } else {
+              nativeBinding = __nccwpck_require__(27652)
             }
+          } catch (e) {
+            loadError = e
+          }
         }
-        // if we fall out of the loop, it means they two are identical
-        // as long as their lengths match
-        return a.length === b.length && result;
-    }
-    parseNegate() {
-        if (this.nonegate)
-            return;
-        const pattern = this.pattern;
-        let negate = false;
-        let negateOffset = 0;
-        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
-            negate = !negate;
-            negateOffset++;
+        break
+      case 'arm':
+        localFileExisted = existsSync(
+          join(__dirname, 'nx.linux-arm-gnueabihf.node')
+        )
+        try {
+          if (localFileExisted) {
+            nativeBinding = __nccwpck_require__(7982)
+          } else {
+            nativeBinding = __nccwpck_require__(58834)
+          }
+        } catch (e) {
+          loadError = e
         }
-        if (negateOffset)
-            this.pattern = pattern.slice(negateOffset);
-        this.negate = negate;
+        break
+      default:
+        throw new Error(`Unsupported architecture on Linux: ${arch}`)
     }
-    // set partial to true to test if, for example,
-    // "/a/b" matches the start of "/*/b/*/d"
-    // Partial means, if you run out of file before you run
-    // out of pattern, then that's fine, as long as all
-    // the parts match.
-    matchOne(file, pattern, partial = false) {
-        const options = this.options;
-        // UNC paths like //?/X:/... can match X:/... and vice versa
-        // Drive letters in absolute drive or unc paths are always compared
-        // case-insensitively.
-        if (this.isWindows) {
-            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);
-            const fileUNC = !fileDrive &&
-                file[0] === '' &&
-                file[1] === '' &&
-                file[2] === '?' &&
-                /^[a-z]:$/i.test(file[3]);
-            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);
-            const patternUNC = !patternDrive &&
-                pattern[0] === '' &&
-                pattern[1] === '' &&
-                pattern[2] === '?' &&
-                typeof pattern[3] === 'string' &&
-                /^[a-z]:$/i.test(pattern[3]);
-            const fdi = fileUNC ? 3 : fileDrive ? 0 : undefined;
-            const pdi = patternUNC ? 3 : patternDrive ? 0 : undefined;
-            if (typeof fdi === 'number' && typeof pdi === 'number') {
-                const [fd, pd] = [file[fdi], pattern[pdi]];
-                if (fd.toLowerCase() === pd.toLowerCase()) {
-                    pattern[pdi] = fd;
-                    if (pdi > fdi) {
-                        pattern = pattern.slice(pdi);
-                    }
-                    else if (fdi > pdi) {
-                        file = file.slice(fdi);
-                    }
-                }
-            }
-        }
-        // resolve and reduce . and .. portions in the file as well.
-        // dont' need to do the second phase, because it's only one string[]
-        const { optimizationLevel = 1 } = this.options;
-        if (optimizationLevel >= 2) {
-            file = this.levelTwoFileOptimize(file);
-        }
-        this.debug('matchOne', this, { file, pattern });
-        this.debug('matchOne', file.length, pattern.length);
-        for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
-            this.debug('matchOne loop');
-            var p = pattern[pi];
-            var f = file[fi];
-            this.debug(pattern, p, f);
-            // should be impossible.
-            // some invalid regexp stuff in the set.
-            /* c8 ignore start */
-            if (p === false) {
-                return false;
-            }
-            /* c8 ignore stop */
-            if (p === exports.GLOBSTAR) {
-                this.debug('GLOBSTAR', [pattern, p, f]);
-                // "**"
-                // a/**/b/**/c would match the following:
-                // a/b/x/y/z/c
-                // a/x/y/z/b/c
-                // a/b/x/b/x/c
-                // a/b/c
-                // To do this, take the rest of the pattern after
-                // the **, and see if it would match the file remainder.
-                // If so, return success.
-                // If not, the ** "swallows" a segment, and try again.
-                // This is recursively awful.
-                //
-                // a/**/b/**/c matching a/b/x/y/z/c
-                // - a matches a
-                // - doublestar
-                //   - matchOne(b/x/y/z/c, b/**/c)
-                //     - b matches b
-                //     - doublestar
-                //       - matchOne(x/y/z/c, c) -> no
-                //       - matchOne(y/z/c, c) -> no
-                //       - matchOne(z/c, c) -> no
-                //       - matchOne(c, c) yes, hit
-                var fr = fi;
-                var pr = pi + 1;
-                if (pr === pl) {
-                    this.debug('** at the end');
-                    // a ** at the end will just swallow the rest.
-                    // We have found a match.
-                    // however, it will not swallow /.x, unless
-                    // options.dot is set.
-                    // . and .. are *never* matched by **, for explosively
-                    // exponential reasons.
-                    for (; fi < fl; fi++) {
-                        if (file[fi] === '.' ||
-                            file[fi] === '..' ||
-                            (!options.dot && file[fi].charAt(0) === '.'))
-                            return false;
-                    }
-                    return true;
-                }
-                // ok, let's see if we can swallow whatever we can.
-                while (fr < fl) {
-                    var swallowee = file[fr];
-                    this.debug('\nglobstar while', file, fr, pattern, pr, swallowee);
-                    // XXX remove this slice.  Just pass the start index.
-                    if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
-                        this.debug('globstar found match!', fr, fl, swallowee);
-                        // found a match.
-                        return true;
-                    }
-                    else {
-                        // can't swallow "." or ".." ever.
-                        // can only swallow ".foo" when explicitly asked.
-                        if (swallowee === '.' ||
-                            swallowee === '..' ||
-                            (!options.dot && swallowee.charAt(0) === '.')) {
-                            this.debug('dot detected!', file, fr, pattern, pr);
-                            break;
-                        }
-                        // ** swallows a segment, and continue.
-                        this.debug('globstar swallow a segment, and continue');
-                        fr++;
-                    }
-                }
-                // no match was found.
-                // However, in partial mode, we can't say this is necessarily over.
-                /* c8 ignore start */
-                if (partial) {
-                    // ran out of file
-                    this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
-                    if (fr === fl) {
-                        return true;
-                    }
-                }
-                /* c8 ignore stop */
-                return false;
-            }
-            // something other than **
-            // non-magic patterns just have to match exactly
-            // patterns with magic have been turned into regexps.
-            let hit;
-            if (typeof p === 'string') {
-                hit = f === p;
-                this.debug('string match', p, f, hit);
-            }
-            else {
-                hit = p.test(f);
-                this.debug('pattern match', p, f, hit);
-            }
-            if (!hit)
-                return false;
+    break
+  default:
+    throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`)
+}
+
+if (!nativeBinding) {
+  if (loadError) {
+    throw loadError
+  }
+  throw new Error(`Failed to load native binding`)
+}
+
+const { expandOutputs, getFilesForOutputs, remove, copy, hashArray, hashFile, ImportResult, findImports, transferProjectGraph, ChildProcess, RustPseudoTerminal, HashPlanner, TaskHasher, EventType, Watcher, WorkspaceContext, WorkspaceErrors, testOnlyTransferFileMap } = nativeBinding
+
+module.exports.expandOutputs = expandOutputs
+module.exports.getFilesForOutputs = getFilesForOutputs
+module.exports.remove = remove
+module.exports.copy = copy
+module.exports.hashArray = hashArray
+module.exports.hashFile = hashFile
+module.exports.ImportResult = ImportResult
+module.exports.findImports = findImports
+module.exports.transferProjectGraph = transferProjectGraph
+module.exports.ChildProcess = ChildProcess
+module.exports.RustPseudoTerminal = RustPseudoTerminal
+module.exports.HashPlanner = HashPlanner
+module.exports.TaskHasher = TaskHasher
+module.exports.EventType = EventType
+module.exports.Watcher = Watcher
+module.exports.WorkspaceContext = WorkspaceContext
+module.exports.WorkspaceErrors = WorkspaceErrors
+module.exports.testOnlyTransferFileMap = testOnlyTransferFileMap
+
+
+/***/ }),
+
+/***/ 43657:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.createDependencies = exports.createNodes = exports.name = void 0;
+const fs_1 = __nccwpck_require__(57147);
+const fs_extra_1 = __nccwpck_require__(2103);
+const path_1 = __nccwpck_require__(71017);
+const perf_hooks_1 = __nccwpck_require__(4074);
+const cache_directory_1 = __nccwpck_require__(11622);
+const globs_1 = __nccwpck_require__(30699);
+const lock_file_1 = __nccwpck_require__(58161);
+const build_dependencies_1 = __nccwpck_require__(98539);
+const config_1 = __nccwpck_require__(60244);
+const file_hasher_1 = __nccwpck_require__(19482);
+const package_manager_1 = __nccwpck_require__(86822);
+const workspace_root_1 = __nccwpck_require__(64393);
+const versions_1 = __nccwpck_require__(10780);
+exports.name = 'nx/js/dependencies-and-lockfile';
+let parsedLockFile = {};
+exports.createNodes = [
+    // Look for all lockfiles
+    (0, globs_1.combineGlobPatterns)(lock_file_1.LOCKFILES),
+    (lockFile, _, context) => {
+        const pluginConfig = (0, config_1.jsPluginConfig)(context.nxJsonConfiguration);
+        if (!pluginConfig.analyzeLockfile) {
+            return {};
         }
-        // Note: ending in / means that we'll get a final ""
-        // at the end of the pattern.  This can only match a
-        // corresponding "" at the end of the file.
-        // If the file ends in /, then it can only match a
-        // a pattern that ends in /, unless the pattern just
-        // doesn't have any more for it. But, a/b/ should *not*
-        // match "a/b/*", even though "" matches against the
-        // [^/]*? pattern, except in partial mode, where it might
-        // simply not be reached yet.
-        // However, a/b/ should still satisfy a/*
-        // now either we fell off the end of the pattern, or we're done.
-        if (fi === fl && pi === pl) {
-            // ran out of pattern and filename at the same time.
-            // an exact hit!
-            return true;
+        const packageManager = (0, package_manager_1.detectPackageManager)(workspace_root_1.workspaceRoot);
+        // Only process the correct lockfile
+        if (lockFile !== (0, lock_file_1.getLockFileName)(packageManager)) {
+            return {};
         }
-        else if (fi === fl) {
-            // ran out of file, but still had pattern left.
-            // this is ok if we're doing the match as part of
-            // a glob fs traversal.
-            return partial;
+        const lockFilePath = (0, path_1.join)(workspace_root_1.workspaceRoot, lockFile);
+        const lockFileContents = (0, fs_1.readFileSync)(lockFilePath).toString();
+        const lockFileHash = getLockFileHash(lockFileContents);
+        if (!lockFileNeedsReprocessing(lockFileHash)) {
+            const nodes = readCachedParsedLockFile().externalNodes;
+            parsedLockFile.externalNodes = nodes;
+            return {
+                externalNodes: nodes,
+            };
         }
-        else if (pi === pl) {
-            // ran out of pattern, still have file left.
-            // this is only acceptable if we're on the very last
-            // empty segment of a file with a trailing slash.
-            // a/* should match a/b/
-            return fi === fl - 1 && file[fi] === '';
-            /* c8 ignore start */
+        const externalNodes = (0, lock_file_1.getLockFileNodes)(packageManager, lockFileContents, lockFileHash, context);
+        parsedLockFile.externalNodes = externalNodes;
+        return {
+            externalNodes,
+        };
+    },
+];
+const createDependencies = (_, ctx) => {
+    const pluginConfig = (0, config_1.jsPluginConfig)(ctx.nxJsonConfiguration);
+    const packageManager = (0, package_manager_1.detectPackageManager)(workspace_root_1.workspaceRoot);
+    let lockfileDependencies = [];
+    // lockfile may not exist yet
+    if (pluginConfig.analyzeLockfile &&
+        (0, lock_file_1.lockFileExists)(packageManager) &&
+        parsedLockFile.externalNodes) {
+        const lockFilePath = (0, path_1.join)(workspace_root_1.workspaceRoot, (0, lock_file_1.getLockFileName)(packageManager));
+        const lockFileContents = (0, fs_1.readFileSync)(lockFilePath).toString();
+        const lockFileHash = getLockFileHash(lockFileContents);
+        if (!lockFileNeedsReprocessing(lockFileHash)) {
+            lockfileDependencies = readCachedParsedLockFile().dependencies ?? [];
         }
         else {
-            // should be unreachable.
-            throw new Error('wtf?');
+            lockfileDependencies = (0, lock_file_1.getLockFileDependencies)(packageManager, lockFileContents, lockFileHash, ctx);
+            parsedLockFile.dependencies = lockfileDependencies;
+            writeLastProcessedLockfileHash(lockFileHash, parsedLockFile);
         }
-        /* c8 ignore stop */
     }
-    braceExpand() {
-        return (0, exports.braceExpand)(this.pattern, this.options);
+    perf_hooks_1.performance.mark('build typescript dependencies - start');
+    const explicitProjectDependencies = (0, build_dependencies_1.buildExplicitDependencies)(pluginConfig, ctx);
+    perf_hooks_1.performance.mark('build typescript dependencies - end');
+    perf_hooks_1.performance.measure('build typescript dependencies', 'build typescript dependencies - start', 'build typescript dependencies - end');
+    return lockfileDependencies.concat(explicitProjectDependencies);
+};
+exports.createDependencies = createDependencies;
+function getLockFileHash(lockFileContents) {
+    return (0, file_hasher_1.hashArray)([versions_1.nxVersion, lockFileContents]);
+}
+function lockFileNeedsReprocessing(lockHash) {
+    try {
+        return (0, fs_1.readFileSync)(lockFileHashFile).toString() !== lockHash;
     }
-    parse(pattern) {
-        (0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
-        const options = this.options;
-        // shortcuts
-        if (pattern === '**')
-            return exports.GLOBSTAR;
-        if (pattern === '')
-            return '';
-        // far and away, the most common glob pattern parts are
-        // *, *.*, and *.  Add a fast check method for those.
-        let m;
-        let fastTest = null;
-        if ((m = pattern.match(starRE))) {
-            fastTest = options.dot ? starTestDot : starTest;
-        }
-        else if ((m = pattern.match(starDotExtRE))) {
-            fastTest = (options.nocase
-                ? options.dot
-                    ? starDotExtTestNocaseDot
-                    : starDotExtTestNocase
-                : options.dot
-                    ? starDotExtTestDot
-                    : starDotExtTest)(m[1]);
-        }
-        else if ((m = pattern.match(qmarksRE))) {
-            fastTest = (options.nocase
-                ? options.dot
-                    ? qmarksTestNocaseDot
-                    : qmarksTestNocase
-                : options.dot
-                    ? qmarksTestDot
-                    : qmarksTest)(m);
+    catch {
+        return true;
+    }
+}
+function writeLastProcessedLockfileHash(hash, lockFile) {
+    (0, fs_extra_1.ensureDirSync)((0, path_1.dirname)(lockFileHashFile));
+    (0, fs_1.writeFileSync)(cachedParsedLockFile, JSON.stringify(lockFile, null, 2));
+    (0, fs_1.writeFileSync)(lockFileHashFile, hash);
+}
+function readCachedParsedLockFile() {
+    return JSON.parse((0, fs_1.readFileSync)(cachedParsedLockFile).toString());
+}
+const lockFileHashFile = (0, path_1.join)(cache_directory_1.projectGraphCacheDirectory, 'lockfile.hash');
+const cachedParsedLockFile = (0, path_1.join)(cache_directory_1.projectGraphCacheDirectory, 'parsed-lock-file.json');
+
+
+/***/ }),
+
+/***/ 58161:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+"use strict";
+
+/**
+ * This is the main API for accessing the lock file functionality.
+ * It encapsulates the package manager specific logic and implementation details.
+ */
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.createLockFile = exports.getLockFileName = exports.lockFileExists = exports.getLockFileDependencies = exports.getLockFileNodes = exports.LOCKFILES = void 0;
+const fs_1 = __nccwpck_require__(57147);
+const path_1 = __nccwpck_require__(71017);
+const package_manager_1 = __nccwpck_require__(86822);
+const workspace_root_1 = __nccwpck_require__(64393);
+const output_1 = __nccwpck_require__(21862);
+const npm_parser_1 = __nccwpck_require__(84941);
+const pnpm_parser_1 = __nccwpck_require__(2697);
+const yarn_parser_1 = __nccwpck_require__(9998);
+const project_graph_pruning_1 = __nccwpck_require__(73283);
+const package_json_1 = __nccwpck_require__(46876);
+const fileutils_1 = __nccwpck_require__(40910);
+const YARN_LOCK_FILE = 'yarn.lock';
+const NPM_LOCK_FILE = 'package-lock.json';
+const PNPM_LOCK_FILE = 'pnpm-lock.yaml';
+exports.LOCKFILES = [YARN_LOCK_FILE, NPM_LOCK_FILE, PNPM_LOCK_FILE];
+const YARN_LOCK_PATH = (0, path_1.join)(workspace_root_1.workspaceRoot, YARN_LOCK_FILE);
+const NPM_LOCK_PATH = (0, path_1.join)(workspace_root_1.workspaceRoot, NPM_LOCK_FILE);
+const PNPM_LOCK_PATH = (0, path_1.join)(workspace_root_1.workspaceRoot, PNPM_LOCK_FILE);
+/**
+ * Parses lock file and maps dependencies and metadata to {@link LockFileGraph}
+ */
+function getLockFileNodes(packageManager, contents, lockFileHash, context) {
+    try {
+        if (packageManager === 'yarn') {
+            const packageJson = (0, fileutils_1.readJsonFile)((0, path_1.join)(context.workspaceRoot, 'package.json'));
+            return (0, yarn_parser_1.getYarnLockfileNodes)(contents, lockFileHash, packageJson);
         }
-        else if ((m = pattern.match(starDotStarRE))) {
-            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
+        if (packageManager === 'pnpm') {
+            return (0, pnpm_parser_1.getPnpmLockfileNodes)(contents, lockFileHash);
         }
-        else if ((m = pattern.match(dotStarRE))) {
-            fastTest = dotStarTest;
+        if (packageManager === 'npm') {
+            return (0, npm_parser_1.getNpmLockfileNodes)(contents, lockFileHash);
         }
-        const re = ast_js_1.AST.fromGlob(pattern, this.options).toMMPattern();
-        return fastTest ? Object.assign(re, { test: fastTest }) : re;
     }
-    makeRe() {
-        if (this.regexp || this.regexp === false)
-            return this.regexp;
-        // at this point, this.set is a 2d array of partial
-        // pattern strings, or "**".
-        //
-        // It's better to use .match().  This function shouldn't
-        // be used, really, but it's pretty convenient sometimes,
-        // when you just want to work with a regex.
-        const set = this.set;
-        if (!set.length) {
-            this.regexp = false;
-            return this.regexp;
-        }
-        const options = this.options;
-        const twoStar = options.noglobstar
-            ? star
-            : options.dot
-                ? twoStarDot
-                : twoStarNoDot;
-        const flags = new Set(options.nocase ? ['i'] : []);
-        // regexpify non-globstar patterns
-        // if ** is only item, then we just do one twoStar
-        // if ** is first, and there are more, prepend (\/|twoStar\/)? to next
-        // if ** is last, append (\/twoStar|) to previous
-        // if ** is in the middle, append (\/|\/twoStar\/) to previous
-        // then filter out GLOBSTAR symbols
-        let re = set
-            .map(pattern => {
-            const pp = pattern.map(p => {
-                if (p instanceof RegExp) {
-                    for (const f of p.flags.split(''))
-                        flags.add(f);
-                }
-                return typeof p === 'string'
-                    ? regExpEscape(p)
-                    : p === exports.GLOBSTAR
-                        ? exports.GLOBSTAR
-                        : p._src;
-            });
-            pp.forEach((p, i) => {
-                const next = pp[i + 1];
-                const prev = pp[i - 1];
-                if (p !== exports.GLOBSTAR || prev === exports.GLOBSTAR) {
-                    return;
-                }
-                if (prev === undefined) {
-                    if (next !== undefined && next !== exports.GLOBSTAR) {
-                        pp[i + 1] = '(?:\\/|' + twoStar + '\\/)?' + next;
-                    }
-                    else {
-                        pp[i] = twoStar;
-                    }
-                }
-                else if (next === undefined) {
-                    pp[i - 1] = prev + '(?:\\/|' + twoStar + ')?';
-                }
-                else if (next !== exports.GLOBSTAR) {
-                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
-                    pp[i + 1] = exports.GLOBSTAR;
-                }
+    catch (e) {
+        if (!isPostInstallProcess()) {
+            output_1.output.error({
+                title: `Failed to parse ${packageManager} lockfile`,
+                bodyLines: errorBodyLines(e),
             });
-            return pp.filter(p => p !== exports.GLOBSTAR).join('/');
-        })
-            .join('|');
-        // need to wrap in parens if we had more than one thing with |,
-        // otherwise only the first will be anchored to ^ and the last to $
-        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];
-        // must match entire pattern
-        // ending in a * or ** will make it less strict.
-        re = '^' + open + re + close + '$';
-        // can match anything, as long as it's not this.
-        if (this.negate)
-            re = '^(?!' + re + ').+$';
-        try {
-            this.regexp = new RegExp(re, [...flags].join(''));
-            /* c8 ignore start */
-        }
-        catch (ex) {
-            // should be impossible
-            this.regexp = false;
         }
-        /* c8 ignore stop */
-        return this.regexp;
+        throw e;
     }
-    slashSplit(p) {
-        // if p starts with // on windows, we preserve that
-        // so that UNC paths aren't broken.  Otherwise, any number of
-        // / characters are coalesced into one, unless
-        // preserveMultipleSlashes is set to true.
-        if (this.preserveMultipleSlashes) {
-            return p.split('/');
+    throw new Error(`Unknown package manager: ${packageManager}`);
+}
+exports.getLockFileNodes = getLockFileNodes;
+/**
+ * Parses lock file and maps dependencies and metadata to {@link LockFileGraph}
+ */
+function getLockFileDependencies(packageManager, contents, lockFileHash, context) {
+    try {
+        if (packageManager === 'yarn') {
+            return (0, yarn_parser_1.getYarnLockfileDependencies)(contents, lockFileHash, context);
         }
-        else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
-            // add an extra '' for the one we lose
-            return ['', ...p.split(/\/+/)];
+        if (packageManager === 'pnpm') {
+            return (0, pnpm_parser_1.getPnpmLockfileDependencies)(contents, lockFileHash, context);
         }
-        else {
-            return p.split(/\/+/);
+        if (packageManager === 'npm') {
+            return (0, npm_parser_1.getNpmLockfileDependencies)(contents, lockFileHash, context);
         }
     }
-    match(f, partial = this.partial) {
-        this.debug('match', f, this.pattern);
-        // short-circuit in the case of busted things.
-        // comments, etc.
-        if (this.comment) {
-            return false;
-        }
-        if (this.empty) {
-            return f === '';
+    catch (e) {
+        if (!isPostInstallProcess()) {
+            output_1.output.error({
+                title: `Failed to parse ${packageManager} lockfile`,
+                bodyLines: errorBodyLines(e),
+            });
         }
-        if (f === '/' && partial) {
-            return true;
+        throw e;
+    }
+    throw new Error(`Unknown package manager: ${packageManager}`);
+}
+exports.getLockFileDependencies = getLockFileDependencies;
+function lockFileExists(packageManager) {
+    if (packageManager === 'yarn') {
+        return (0, fs_1.existsSync)(YARN_LOCK_PATH);
+    }
+    if (packageManager === 'pnpm') {
+        return (0, fs_1.existsSync)(PNPM_LOCK_PATH);
+    }
+    if (packageManager === 'npm') {
+        return (0, fs_1.existsSync)(NPM_LOCK_PATH);
+    }
+    throw new Error(`Unknown package manager ${packageManager} or lock file missing`);
+}
+exports.lockFileExists = lockFileExists;
+/**
+ * Returns lock file name based on the detected package manager in the root
+ * @param packageManager
+ * @returns
+ */
+function getLockFileName(packageManager) {
+    if (packageManager === 'yarn') {
+        return YARN_LOCK_FILE;
+    }
+    if (packageManager === 'pnpm') {
+        return PNPM_LOCK_FILE;
+    }
+    if (packageManager === 'npm') {
+        return NPM_LOCK_FILE;
+    }
+    throw new Error(`Unknown package manager: ${packageManager}`);
+}
+exports.getLockFileName = getLockFileName;
+function getLockFilePath(packageManager) {
+    if (packageManager === 'yarn') {
+        return YARN_LOCK_PATH;
+    }
+    if (packageManager === 'pnpm') {
+        return PNPM_LOCK_PATH;
+    }
+    if (packageManager === 'npm') {
+        return NPM_LOCK_PATH;
+    }
+    throw new Error(`Unknown package manager: ${packageManager}`);
+}
+/**
+ * Create lock file based on the root level lock file and (pruned) package.json
+ *
+ * @param packageJson
+ * @param isProduction
+ * @param packageManager
+ * @returns
+ */
+function createLockFile(packageJson, graph, packageManager = (0, package_manager_1.detectPackageManager)(workspace_root_1.workspaceRoot)) {
+    const normalizedPackageJson = (0, package_json_1.normalizePackageJson)(packageJson);
+    const content = (0, fs_1.readFileSync)(getLockFilePath(packageManager), 'utf8');
+    try {
+        if (packageManager === 'yarn') {
+            const prunedGraph = (0, project_graph_pruning_1.pruneProjectGraph)(graph, packageJson);
+            return (0, yarn_parser_1.stringifyYarnLockfile)(prunedGraph, content, normalizedPackageJson);
         }
-        const options = this.options;
-        // windows: need to use /, not \
-        if (this.isWindows) {
-            f = f.split('\\').join('/');
+        if (packageManager === 'pnpm') {
+            const prunedGraph = (0, project_graph_pruning_1.pruneProjectGraph)(graph, packageJson);
+            return (0, pnpm_parser_1.stringifyPnpmLockfile)(prunedGraph, content, normalizedPackageJson);
         }
-        // treat the test path as a set of pathparts.
-        const ff = this.slashSplit(f);
-        this.debug(this.pattern, 'split', ff);
-        // just ONE of the pattern sets in this.set needs to match
-        // in order for it to be valid.  If negating, then just one
-        // match means that we have failed.
-        // Either way, return on the first hit.
-        const set = this.set;
-        this.debug(this.pattern, 'set', set);
-        // Find the basename of the path by looking for the last non-empty segment
-        let filename = ff[ff.length - 1];
-        if (!filename) {
-            for (let i = ff.length - 2; !filename && i >= 0; i--) {
-                filename = ff[i];
-            }
+        if (packageManager === 'npm') {
+            const prunedGraph = (0, project_graph_pruning_1.pruneProjectGraph)(graph, packageJson);
+            return (0, npm_parser_1.stringifyNpmLockfile)(prunedGraph, content, normalizedPackageJson);
         }
-        for (let i = 0; i < set.length; i++) {
-            const pattern = set[i];
-            let file = ff;
-            if (options.matchBase && pattern.length === 1) {
-                file = [filename];
+    }
+    catch (e) {
+        if (!isPostInstallProcess()) {
+            const additionalInfo = [
+                'To prevent the build from breaking we are returning the root lock file.',
+            ];
+            if (packageManager === 'npm') {
+                additionalInfo.push('If you run `npm install --package-lock-only` in your output folder it will regenerate the correct pruned lockfile.');
             }
-            const hit = this.matchOne(file, pattern, partial);
-            if (hit) {
-                if (options.flipNegate) {
-                    return true;
-                }
-                return !this.negate;
+            if (packageManager === 'pnpm') {
+                additionalInfo.push('If you run `pnpm install --lockfile-only` in your output folder it will regenerate the correct pruned lockfile.');
             }
+            output_1.output.error({
+                title: 'An error occured while creating pruned lockfile',
+                bodyLines: errorBodyLines(e, additionalInfo),
+            });
         }
-        // didn't get any hits.  this is success if it's a negative
-        // pattern, failure otherwise.
-        if (options.flipNegate) {
-            return false;
-        }
-        return this.negate;
-    }
-    static defaults(def) {
-        return exports.minimatch.defaults(def).Minimatch;
+        return content;
     }
 }
-exports.Minimatch = Minimatch;
-/* c8 ignore start */
-var ast_js_2 = __nccwpck_require__(1227);
-Object.defineProperty(exports, "AST", ({ enumerable: true, get: function () { return ast_js_2.AST; } }));
-var escape_js_2 = __nccwpck_require__(7350);
-Object.defineProperty(exports, "escape", ({ enumerable: true, get: function () { return escape_js_2.escape; } }));
-var unescape_js_2 = __nccwpck_require__(391);
-Object.defineProperty(exports, "unescape", ({ enumerable: true, get: function () { return unescape_js_2.unescape; } }));
-/* c8 ignore stop */
-exports.minimatch.AST = ast_js_1.AST;
-exports.minimatch.Minimatch = Minimatch;
-exports.minimatch.escape = escape_js_1.escape;
-exports.minimatch.unescape = unescape_js_1.unescape;
-//# sourceMappingURL=index.js.map
-
-/***/ }),
-
-/***/ 391:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
+exports.createLockFile = createLockFile;
+// generate body lines for error message
+function errorBodyLines(originalError, additionalInfo = []) {
+    return [
+        'Please open an issue at `https://github.com/nrwl/nx/issues/new?template=1-bug.yml` and provide a reproduction.',
+        ...additionalInfo,
+        `\nOriginal error: ${originalError.message}\n\n`,
+        originalError.stack,
+    ];
+}
+function isPostInstallProcess() {
+    return (process.env.npm_command === 'install' &&
+        process.env.npm_lifecycle_event === 'postinstall');
+}
 
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.unescape = void 0;
-/**
- * Un-escape a string that has been escaped with {@link escape}.
- *
- * If the {@link windowsPathsNoEscape} option is used, then square-brace
- * escapes are removed, but not backslash escapes.  For example, it will turn
- * the string `'[*]'` into `*`, but it will not turn `'\\*'` into `'*'`,
- * becuase `\` is a path separator in `windowsPathsNoEscape` mode.
- *
- * When `windowsPathsNoEscape` is not set, then both brace escapes and
- * backslash escapes are removed.
- *
- * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
- * or unescaped.
- */
-const unescape = (s, { windowsPathsNoEscape = false, } = {}) => {
-    return windowsPathsNoEscape
-        ? s.replace(/\[([^\/\\])\]/g, '$1')
-        : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2').replace(/\\([^\/])/g, '$1');
-};
-exports.unescape = unescape;
-//# sourceMappingURL=unescape.js.map
 
 /***/ }),
 
-/***/ 5205:
+/***/ 84941:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.renamePropertyWithStableKeys = exports.toOldFormat = exports.toNewFormat = exports.isAngularPluginInstalled = exports.shouldMergeAngularProjects = exports.NxAngularJsonPlugin = exports.NX_ANGULAR_JSON_PLUGIN_NAME = void 0;
-const fs_1 = __nccwpck_require__(7147);
-const path = __nccwpck_require__(1017);
-const fileutils_1 = __nccwpck_require__(910);
-exports.NX_ANGULAR_JSON_PLUGIN_NAME = 'nx-angular-json-plugin';
-exports.NxAngularJsonPlugin = {
-    name: exports.NX_ANGULAR_JSON_PLUGIN_NAME,
-    createNodes: [
-        'angular.json',
-        (f, _, ctx) => ({
-            projects: readAngularJson(ctx.workspaceRoot),
-        }),
-    ],
-};
-exports["default"] = exports.NxAngularJsonPlugin;
-function shouldMergeAngularProjects(root, includeProjectsFromAngularJson) {
-    if ((0, fs_1.existsSync)(path.join(root, 'angular.json')) &&
-        // Include projects from angular.json if explicitly required.
-        // e.g. when invoked from `packages/devkit/src/utils/convert-nx-executor.ts`
-        (includeProjectsFromAngularJson ||
-            // Or if a workspace has `@nrwl/angular`/`@nx/angular` installed then projects from `angular.json` to be considered by Nx.
-            isAngularPluginInstalled())) {
-        return true;
+exports.stringifyNpmLockfile = exports.getNpmLockfileDependencies = exports.getNpmLockfileNodes = void 0;
+const fs_1 = __nccwpck_require__(57147);
+const semver_1 = __nccwpck_require__(11383);
+const workspace_root_1 = __nccwpck_require__(64393);
+const operators_1 = __nccwpck_require__(26311);
+const project_graph_builder_1 = __nccwpck_require__(47667);
+const project_graph_1 = __nccwpck_require__(72733);
+const file_hasher_1 = __nccwpck_require__(19482);
+// we use key => node map to avoid duplicate work when parsing keys
+let keyMap = new Map();
+let currentLockFileHash;
+let parsedLockFile;
+function parsePackageLockFile(lockFileContent, lockFileHash) {
+    if (lockFileHash === currentLockFileHash) {
+        return parsedLockFile;
+    }
+    keyMap.clear();
+    const results = JSON.parse(lockFileContent);
+    parsedLockFile = results;
+    currentLockFileHash = lockFileHash;
+    return results;
+}
+function getNpmLockfileNodes(lockFileContent, lockFileHash) {
+    const data = parsePackageLockFile(lockFileContent, lockFileHash);
+    // we use key => node map to avoid duplicate work when parsing keys
+    return getNodes(data, keyMap);
+}
+exports.getNpmLockfileNodes = getNpmLockfileNodes;
+function getNpmLockfileDependencies(lockFileContent, lockFileHash, ctx) {
+    const data = parsePackageLockFile(lockFileContent, lockFileHash);
+    return getDependencies(data, keyMap, ctx);
+}
+exports.getNpmLockfileDependencies = getNpmLockfileDependencies;
+function getNodes(data, keyMap) {
+    const nodes = new Map();
+    if (data.lockfileVersion > 1) {
+        Object.entries(data.packages).forEach(([path, snapshot]) => {
+            // skip workspaces packages
+            if (path === '' || !path.includes('node_modules') || snapshot.link) {
+                return;
+            }
+            const packageName = path.split('node_modules/').pop();
+            const version = findV3Version(snapshot, packageName);
+            createNode(packageName, version, path, nodes, keyMap, snapshot);
+        });
     }
     else {
-        return false;
+        Object.entries(data.dependencies).forEach(([packageName, snapshot]) => {
+            // we only care about dependencies of workspace packages
+            if (snapshot.version?.startsWith('file:')) {
+                if (snapshot.dependencies) {
+                    Object.entries(snapshot.dependencies).forEach(([depName, depSnapshot]) => {
+                        addV1Node(depName, depSnapshot, `${snapshot.version.slice(5)}/node_modules/${depName}`, nodes, keyMap);
+                    });
+                }
+            }
+            else {
+                addV1Node(packageName, snapshot, `node_modules/${packageName}`, nodes, keyMap);
+            }
+        });
+    }
+    const results = {};
+    // some packages can be both hoisted and nested
+    // so we need to run this check once we have all the nodes and paths
+    for (const [packageName, versionMap] of nodes.entries()) {
+        const hoistedNode = keyMap.get(`node_modules/${packageName}`);
+        if (hoistedNode) {
+            hoistedNode.name = `npm:${packageName}`;
+        }
+        versionMap.forEach((node) => {
+            results[node.name] = node;
+        });
     }
+    return results;
 }
-exports.shouldMergeAngularProjects = shouldMergeAngularProjects;
-function isAngularPluginInstalled() {
-    try {
-        // nx-ignore-next-line
-        require.resolve('@nx/angular');
-        return true;
+function addV1Node(packageName, snapshot, path, nodes, keyMap) {
+    createNode(packageName, snapshot.version, path, nodes, keyMap, snapshot);
+    // traverse nested dependencies
+    if (snapshot.dependencies) {
+        Object.entries(snapshot.dependencies).forEach(([depName, depSnapshot]) => {
+            addV1Node(depName, depSnapshot, `${path}/node_modules/${depName}`, nodes, keyMap);
+        });
     }
-    catch {
-        try {
-            require.resolve('@nrwl/angular');
-            return true;
+}
+function createNode(packageName, version, key, nodes, keyMap, snapshot) {
+    const existingNode = nodes.get(packageName)?.get(version);
+    if (existingNode) {
+        keyMap.set(key, existingNode);
+        return;
+    }
+    const node = {
+        type: 'npm',
+        name: version ? `npm:${packageName}@${version}` : `npm:${packageName}`,
+        data: {
+            version,
+            packageName,
+            hash: snapshot.integrity ||
+                (0, file_hasher_1.hashArray)(snapshot.resolved
+                    ? [snapshot.resolved]
+                    : version
+                        ? [packageName, version]
+                        : [packageName]),
+        },
+    };
+    keyMap.set(key, node);
+    if (!nodes.has(packageName)) {
+        nodes.set(packageName, new Map([[version, node]]));
+    }
+    else {
+        nodes.get(packageName).set(version, node);
+    }
+}
+function findV3Version(snapshot, packageName) {
+    let version = snapshot.version;
+    const resolved = snapshot.resolved;
+    // for tarball packages version might not exist or be useless
+    if (!version || (resolved && !resolved.includes(version))) {
+        version = resolved;
+    }
+    // for alias packages name is set
+    if (snapshot.name && snapshot.name !== packageName) {
+        if (version) {
+            version = `npm:${snapshot.name}@${version}`;
         }
-        catch {
-            return false;
+        else {
+            version = `npm:${snapshot.name}`;
         }
     }
+    return version;
 }
-exports.isAngularPluginInstalled = isAngularPluginInstalled;
-function readAngularJson(angularCliWorkspaceRoot) {
-    return toNewFormat((0, fileutils_1.readJsonFile)(path.join(angularCliWorkspaceRoot, 'angular.json'))).projects;
+function getDependencies(data, keyMap, ctx) {
+    const dependencies = [];
+    if (data.lockfileVersion > 1) {
+        Object.entries(data.packages).forEach(([path, snapshot]) => {
+            // we are skipping workspaces packages
+            if (!keyMap.has(path)) {
+                return;
+            }
+            const sourceName = keyMap.get(path).name;
+            [
+                snapshot.peerDependencies,
+                snapshot.dependencies,
+                snapshot.optionalDependencies,
+            ].forEach((section) => {
+                if (section) {
+                    Object.entries(section).forEach(([name, versionRange]) => {
+                        const target = findTarget(path, keyMap, name, versionRange);
+                        if (target) {
+                            const dep = {
+                                source: sourceName,
+                                target: target.name,
+                                type: project_graph_1.DependencyType.static,
+                            };
+                            (0, project_graph_builder_1.validateDependency)(dep, ctx);
+                            dependencies.push(dep);
+                        }
+                    });
+                }
+            });
+        });
+    }
+    else {
+        Object.entries(data.dependencies).forEach(([packageName, snapshot]) => {
+            addV1NodeDependencies(`node_modules/${packageName}`, snapshot, dependencies, keyMap, ctx);
+        });
+    }
+    return dependencies;
 }
-function toNewFormat(w) {
-    if (!w.projects) {
-        return w;
+function findTarget(sourcePath, keyMap, targetName, versionRange) {
+    if (sourcePath && !sourcePath.endsWith('/')) {
+        sourcePath = `${sourcePath}/`;
     }
-    for (const name in w.projects ?? {}) {
-        const projectConfig = w.projects[name];
-        if (projectConfig.architect) {
-            renamePropertyWithStableKeys(projectConfig, 'architect', 'targets');
-        }
-        if (projectConfig.schematics) {
-            renamePropertyWithStableKeys(projectConfig, 'schematics', 'generators');
-        }
-        if (!projectConfig.name) {
-            projectConfig.name = name;
+    const searchPath = `${sourcePath}node_modules/${targetName}`;
+    if (keyMap.has(searchPath)) {
+        const child = keyMap.get(searchPath);
+        if (child.data.version === versionRange ||
+            (0, semver_1.satisfies)(child.data.version, versionRange)) {
+            return child;
         }
-        Object.values(projectConfig.targets || {}).forEach((target) => {
-            if (target.builder !== undefined) {
-                renamePropertyWithStableKeys(target, 'builder', 'executor');
+    }
+    // the hoisted package did not match, this dependency is missing
+    if (!sourcePath) {
+        return;
+    }
+    return findTarget(sourcePath.split('node_modules/').slice(0, -1).join('node_modules/'), keyMap, targetName, versionRange);
+}
+function addV1NodeDependencies(path, snapshot, dependencies, keyMap, ctx) {
+    if (keyMap.has(path) && snapshot.requires) {
+        const source = keyMap.get(path).name;
+        Object.entries(snapshot.requires).forEach(([name, versionRange]) => {
+            const target = findTarget(path, keyMap, name, versionRange);
+            if (target) {
+                const dep = {
+                    source: source,
+                    target: target.name,
+                    type: project_graph_1.DependencyType.static,
+                };
+                (0, project_graph_builder_1.validateDependency)(dep, ctx);
+                dependencies.push(dep);
             }
         });
     }
-    if (w.schematics) {
-        renamePropertyWithStableKeys(w, 'schematics', 'generators');
+    if (snapshot.dependencies) {
+        Object.entries(snapshot.dependencies).forEach(([depName, depSnapshot]) => {
+            addV1NodeDependencies(`${path}/node_modules/${depName}`, depSnapshot, dependencies, keyMap, ctx);
+        });
     }
-    if (w.version !== 2) {
-        w.version = 2;
+    const { peerDependencies } = getPeerDependencies(path);
+    if (peerDependencies) {
+        const node = keyMap.get(path);
+        Object.entries(peerDependencies).forEach(([depName, depSpec]) => {
+            const target = findTarget(path, keyMap, depName, depSpec);
+            if (target) {
+                const dep = {
+                    source: node.name,
+                    target: target.name,
+                    type: project_graph_1.DependencyType.static,
+                };
+                (0, project_graph_builder_1.validateDependency)(dep, ctx);
+                dependencies.push(dep);
+            }
+        });
     }
-    return w;
 }
-exports.toNewFormat = toNewFormat;
-function toOldFormat(w) {
-    if (w.projects) {
-        for (const name in w.projects) {
-            const projectConfig = w.projects[name];
-            if (typeof projectConfig === 'string') {
-                throw new Error("'project.json' files are incompatible with version 1 workspace schemas.");
-            }
-            if (projectConfig.targets) {
-                renamePropertyWithStableKeys(projectConfig, 'targets', 'architect');
-            }
-            if (projectConfig.generators) {
-                renamePropertyWithStableKeys(projectConfig, 'generators', 'schematics');
-            }
-            delete projectConfig.name;
-            Object.values(projectConfig.architect || {}).forEach((target) => {
-                if (target.executor !== undefined) {
-                    renamePropertyWithStableKeys(target, 'executor', 'builder');
-                }
-            });
-        }
+function stringifyNpmLockfile(graph, rootLockFileContent, packageJson) {
+    const rootLockFile = JSON.parse(rootLockFileContent);
+    const { lockfileVersion } = JSON.parse(rootLockFileContent);
+    const mappedPackages = mapSnapshots(rootLockFile, graph);
+    const output = {
+        name: packageJson.name || rootLockFile.name,
+        version: packageJson.version || '0.0.1',
+        lockfileVersion: rootLockFile.lockfileVersion,
+    };
+    if (rootLockFile.requires) {
+        output.requires = rootLockFile.requires;
     }
-    if (w.generators) {
-        renamePropertyWithStableKeys(w, 'generators', 'schematics');
+    if (lockfileVersion > 1) {
+        output.packages = mapV3Snapshots(mappedPackages, packageJson);
     }
-    if (w.version !== 1) {
-        w.version = 1;
+    if (lockfileVersion < 3) {
+        output.dependencies = mapV1Snapshots(mappedPackages);
     }
-    return w;
+    return JSON.stringify(output, null, 2);
 }
-exports.toOldFormat = toOldFormat;
-// we have to do it this way to preserve the order of properties
-// not to screw up the formatting
-function renamePropertyWithStableKeys(obj, from, to) {
-    const copy = { ...obj };
-    Object.keys(obj).forEach((k) => {
-        delete obj[k];
+exports.stringifyNpmLockfile = stringifyNpmLockfile;
+function mapV3Snapshots(mappedPackages, packageJson) {
+    const output = {};
+    output[''] = packageJson;
+    mappedPackages.forEach((p) => {
+        output[p.path] = p.valueV3;
     });
-    Object.keys(copy).forEach((k) => {
-        if (k === from) {
-            obj[to] = copy[k];
+    return output;
+}
+function mapV1Snapshots(mappedPackages) {
+    const output = {};
+    mappedPackages.forEach((p) => {
+        getPackageParent(p.path, output)[p.name] = p.valueV1;
+    });
+    return output;
+}
+function getPackageParent(path, packages) {
+    const segments = path.split(/\/?node_modules\//).slice(1, -1);
+    if (!segments.length) {
+        return packages;
+    }
+    let parent = packages[segments.shift()];
+    if (!parent.dependencies) {
+        parent.dependencies = {};
+    }
+    while (segments.length) {
+        parent = parent.dependencies[segments.shift()];
+        if (!parent.dependencies) {
+            parent.dependencies = {};
+        }
+    }
+    return parent.dependencies;
+}
+function mapSnapshots(rootLockFile, graph) {
+    const nestedNodes = new Set();
+    const visitedNodes = new Map();
+    const visitedPaths = new Set();
+    const remappedPackages = new Map();
+    // add first level children
+    Object.values(graph.externalNodes).forEach((node) => {
+        if (node.name === `npm:${node.data.packageName}`) {
+            const mappedPackage = mapPackage(rootLockFile, node.data.packageName, node.data.version);
+            remappedPackages.set(mappedPackage.path, mappedPackage);
+            visitedNodes.set(node, new Set([mappedPackage.path]));
+            visitedPaths.add(mappedPackage.path);
         }
         else {
-            obj[k] = copy[k];
+            nestedNodes.add(node);
         }
     });
+    let remappedPackagesArray;
+    if (nestedNodes.size) {
+        const invertedGraph = (0, operators_1.reverse)(graph);
+        nestMappedPackages(invertedGraph, remappedPackages, nestedNodes, visitedNodes, visitedPaths, rootLockFile);
+        // initially we naively map package paths to topParent/../parent/child
+        // but some of those should be nested higher up the tree
+        remappedPackagesArray = elevateNestedPaths(remappedPackages);
+    }
+    else {
+        remappedPackagesArray = Array.from(remappedPackages.values());
+    }
+    return remappedPackagesArray.sort((a, b) => a.path.localeCompare(b.path));
 }
-exports.renamePropertyWithStableKeys = renamePropertyWithStableKeys;
-
-
-/***/ }),
-
-/***/ 4333:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.readNxJson = exports.workspaceLayout = void 0;
-const nx_json_1 = __nccwpck_require__(1173);
-/**
- * Returns information about where apps and libs will be created.
- */
-function workspaceLayout() {
-    const nxJson = (0, nx_json_1.readNxJson)();
+function mapPackage(rootLockFile, packageName, version, parentPath = '') {
+    const lockfileVersion = rootLockFile.lockfileVersion;
+    let valueV3, valueV1;
+    if (lockfileVersion < 3) {
+        valueV1 = findMatchingPackageV1(rootLockFile.dependencies, packageName, version);
+    }
+    if (lockfileVersion > 1) {
+        valueV3 = findMatchingPackageV3(rootLockFile.packages, packageName, version);
+    }
     return {
-        appsDir: nxJson.workspaceLayout?.appsDir ?? 'apps',
-        libsDir: nxJson.workspaceLayout?.libsDir ?? 'libs',
+        path: parentPath + `node_modules/${packageName}`,
+        name: packageName,
+        valueV1,
+        valueV3,
     };
 }
-exports.workspaceLayout = workspaceLayout;
-var nx_json_2 = __nccwpck_require__(1173);
-Object.defineProperty(exports, "readNxJson", ({ enumerable: true, get: function () { return nx_json_2.readNxJson; } }));
+function nestMappedPackages(invertedGraph, result, nestedNodes, visitedNodes, visitedPaths, rootLockFile) {
+    const initialSize = nestedNodes.size;
+    if (!initialSize) {
+        return;
+    }
+    nestedNodes.forEach((node) => {
+        let unresolvedParents = invertedGraph.dependencies[node.name].length;
+        invertedGraph.dependencies[node.name].forEach(({ target }) => {
+            const targetNode = invertedGraph.externalNodes[target];
+            if (visitedNodes.has(targetNode)) {
+                visitedNodes.get(targetNode).forEach((path) => {
+                    const mappedPackage = mapPackage(rootLockFile, node.data.packageName, node.data.version, path + '/');
+                    result.set(mappedPackage.path, mappedPackage);
+                    if (visitedNodes.has(node)) {
+                        visitedNodes.get(node).add(mappedPackage.path);
+                    }
+                    else {
+                        visitedNodes.set(node, new Set([mappedPackage.path]));
+                    }
+                    visitedPaths.add(mappedPackage.path);
+                });
+                unresolvedParents--;
+            }
+        });
+        if (!unresolvedParents) {
+            nestedNodes.delete(node);
+        }
+    });
+    if (initialSize === nestedNodes.size) {
+        throw new Error([
+            'Following packages could not be mapped to the NPM lockfile:',
+            ...Array.from(nestedNodes).map((n) => `- ${n.name}`),
+        ].join('\n'));
+    }
+    else {
+        nestMappedPackages(invertedGraph, result, nestedNodes, visitedNodes, visitedPaths, rootLockFile);
+    }
+}
+// sort paths by number of segments and then alphabetically
+function sortMappedPackagesPaths(mappedPackages) {
+    return Array.from(mappedPackages.keys()).sort((a, b) => {
+        const aLength = a.split('/node_modules/').length;
+        const bLength = b.split('/node_modules/').length;
+        if (aLength > bLength) {
+            return 1;
+        }
+        if (aLength < bLength) {
+            return -1;
+        }
+        return a.localeCompare(b);
+    });
+}
+function elevateNestedPaths(remappedPackages) {
+    const result = new Map();
+    const sortedPaths = sortMappedPackagesPaths(remappedPackages);
+    sortedPaths.forEach((path) => {
+        const segments = path.split('/node_modules/');
+        const mappedPackage = remappedPackages.get(path);
+        // we keep hoisted packages intact
+        if (segments.length === 1) {
+            result.set(path, mappedPackage);
+            return;
+        }
+        const packageName = segments.pop();
+        const getNewPath = (segs) => `${segs.join('/node_modules/')}/node_modules/${packageName}`;
+        // check if grandparent has the same package
+        const shouldElevate = (segs) => {
+            const elevatedPath = getNewPath(segs.slice(0, -1));
+            if (result.has(elevatedPath)) {
+                const match = result.get(elevatedPath);
+                return (match.valueV1?.version === mappedPackage.valueV1?.version &&
+                    match.valueV3?.version === mappedPackage.valueV3?.version);
+            }
+            return true;
+        };
+        while (segments.length > 1 && shouldElevate(segments)) {
+            segments.pop();
+        }
+        const newPath = getNewPath(segments);
+        if (path !== newPath) {
+            if (!result.has(newPath)) {
+                mappedPackage.path = newPath;
+                result.set(newPath, mappedPackage);
+            }
+        }
+        else {
+            result.set(path, mappedPackage);
+        }
+    });
+    return Array.from(result.values());
+}
+function findMatchingPackageV3(packages, name, version) {
+    for (const [key, { dev, peer, ...snapshot }] of Object.entries(packages)) {
+        if (key.endsWith(`node_modules/${name}`)) {
+            if ([
+                snapshot.version,
+                snapshot.resolved,
+                `npm:${snapshot.name}@${snapshot.version}`,
+            ].includes(version)) {
+                return snapshot;
+            }
+        }
+    }
+}
+function findMatchingPackageV1(packages, name, version) {
+    for (const [packageName, { dev, peer, dependencies, ...snapshot },] of Object.entries(packages)) {
+        if (packageName === name) {
+            if (snapshot.version === version) {
+                return snapshot;
+            }
+        }
+        if (dependencies) {
+            const found = findMatchingPackageV1(dependencies, name, version);
+            if (found) {
+                return found;
+            }
+        }
+    }
+}
+// NPM V1 does not track the peer dependencies in the lock file
+// so we need to parse them directly from the package.json
+function getPeerDependencies(path) {
+    const fullPath = `${workspace_root_1.workspaceRoot}/${path}/package.json`;
+    if ((0, fs_1.existsSync)(fullPath)) {
+        const content = (0, fs_1.readFileSync)(fullPath, 'utf-8');
+        const { peerDependencies, peerDependenciesMeta } = JSON.parse(content);
+        return {
+            ...(peerDependencies && { peerDependencies }),
+            ...(peerDependenciesMeta && { peerDependenciesMeta }),
+        };
+    }
+    else {
+        if (process.env.NX_VERBOSE_LOGGING === 'true') {
+            console.warn(`Could not find package.json at "${path}"`);
+        }
+        return {};
+    }
+}
 
 
 /***/ }),
 
-/***/ 1173:
+/***/ 2697:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.hasNxJson = exports.readNxJson = void 0;
-const fs_1 = __nccwpck_require__(7147);
-const path_1 = __nccwpck_require__(1017);
-const fileutils_1 = __nccwpck_require__(910);
-const workspace_root_1 = __nccwpck_require__(4393);
-function readNxJson(root = workspace_root_1.workspaceRoot) {
-    const nxJson = (0, path_1.join)(root, 'nx.json');
-    if ((0, fs_1.existsSync)(nxJson)) {
-        const nxJsonConfiguration = (0, fileutils_1.readJsonFile)(nxJson);
-        if (nxJsonConfiguration.extends) {
-            const extendedNxJsonPath = require.resolve(nxJsonConfiguration.extends, {
-                paths: [(0, path_1.dirname)(nxJson)],
+exports.stringifyPnpmLockfile = exports.getPnpmLockfileDependencies = exports.getPnpmLockfileNodes = void 0;
+const pnpm_normalizer_1 = __nccwpck_require__(76637);
+const package_json_1 = __nccwpck_require__(46876);
+const object_sort_1 = __nccwpck_require__(74150);
+const project_graph_builder_1 = __nccwpck_require__(47667);
+const project_graph_1 = __nccwpck_require__(72733);
+const file_hasher_1 = __nccwpck_require__(19482);
+// we use key => node map to avoid duplicate work when parsing keys
+let keyMap = new Map();
+let currentLockFileHash;
+let parsedLockFile;
+function parsePnpmLockFile(lockFileContent, lockFileHash) {
+    if (lockFileHash === currentLockFileHash) {
+        return parsedLockFile;
+    }
+    keyMap.clear();
+    const results = (0, pnpm_normalizer_1.parseAndNormalizePnpmLockfile)(lockFileContent);
+    parsedLockFile = results;
+    currentLockFileHash = lockFileHash;
+    return results;
+}
+function getPnpmLockfileNodes(lockFileContent, lockFileHash) {
+    const data = parsePnpmLockFile(lockFileContent, lockFileHash);
+    const isV6 = (0, pnpm_normalizer_1.isV6Lockfile)(data);
+    return getNodes(data, keyMap, isV6);
+}
+exports.getPnpmLockfileNodes = getPnpmLockfileNodes;
+function getPnpmLockfileDependencies(lockFileContent, lockFileHash, ctx) {
+    const data = parsePnpmLockFile(lockFileContent, lockFileHash);
+    const isV6 = (0, pnpm_normalizer_1.isV6Lockfile)(data);
+    return getDependencies(data, keyMap, isV6, ctx);
+}
+exports.getPnpmLockfileDependencies = getPnpmLockfileDependencies;
+function matchPropValue(record, key, originalPackageName) {
+    if (!record) {
+        return undefined;
+    }
+    const index = Object.values(record).findIndex((version) => version === key);
+    if (index > -1) {
+        return Object.keys(record)[index];
+    }
+    // check if non-aliased name is found
+    if (record[originalPackageName] &&
+        key.startsWith(`/${originalPackageName}/${record[originalPackageName]}`)) {
+        return originalPackageName;
+    }
+}
+function matchedDependencyName(importer, key, originalPackageName) {
+    return (matchPropValue(importer.dependencies, key, originalPackageName) ||
+        matchPropValue(importer.optionalDependencies, key, originalPackageName) ||
+        matchPropValue(importer.peerDependencies, key, originalPackageName));
+}
+function createHashFromSnapshot(snapshot) {
+    return (snapshot.resolution?.['integrity'] ||
+        (snapshot.resolution?.['tarball']
+            ? (0, file_hasher_1.hashArray)([snapshot.resolution['tarball']])
+            : undefined));
+}
+function isLockFileKey(depVersion) {
+    return depVersion.startsWith('/');
+}
+function getNodes(data, keyMap, isV6) {
+    const nodes = new Map();
+    const maybeAliasedPackageVersions = new Map(); // 
+    const packageNames = new Set();
+    for (const [key, snapshot] of Object.entries(data.packages)) {
+        const originalPackageName = extractNameFromKey(key);
+        if (!originalPackageName) {
+            continue;
+        }
+        // snapshot already has a name
+        if (snapshot.name) {
+            packageNames.add({
+                key,
+                packageName: snapshot.name,
+                hash: createHashFromSnapshot(snapshot),
             });
-            const baseNxJson = (0, fileutils_1.readJsonFile)(extendedNxJsonPath);
-            return {
-                ...baseNxJson,
-                ...nxJsonConfiguration,
+        }
+        const rootDependencyName = matchedDependencyName(data.importers['.'], key, originalPackageName) ||
+            // only root importers have devDependencies
+            matchPropValue(data.importers['.'].devDependencies, key, originalPackageName);
+        if (rootDependencyName) {
+            packageNames.add({
+                key,
+                packageName: rootDependencyName,
+                hash: createHashFromSnapshot(snapshot),
+            });
+        }
+        if (!snapshot.name && !rootDependencyName) {
+            packageNames.add({
+                key,
+                packageName: originalPackageName,
+                hash: createHashFromSnapshot(snapshot),
+            });
+        }
+        if (snapshot.peerDependencies) {
+            for (const [depName, depVersion] of Object.entries(snapshot.peerDependencies)) {
+                if (isLockFileKey(depVersion)) {
+                    maybeAliasedPackageVersions.set(depVersion, depName);
+                }
+            }
+        }
+        if (snapshot.optionalDependencies) {
+            for (const [depName, depVersion] of Object.entries(snapshot.optionalDependencies)) {
+                if (isLockFileKey(depVersion)) {
+                    maybeAliasedPackageVersions.set(depVersion, depName);
+                }
+            }
+        }
+        if (snapshot.dependencies) {
+            for (const [depName, depVersion] of Object.entries(snapshot.dependencies)) {
+                if (isLockFileKey(depVersion)) {
+                    maybeAliasedPackageVersions.set(depVersion, depName);
+                }
+            }
+        }
+        const aliasedDep = maybeAliasedPackageVersions.get(key);
+        if (aliasedDep) {
+            packageNames.add({
+                key,
+                packageName: aliasedDep,
+                hash: createHashFromSnapshot(snapshot),
+            });
+        }
+    }
+    for (const { key, packageName, hash } of packageNames) {
+        const rawVersion = findVersion(key, packageName);
+        if (!rawVersion) {
+            continue;
+        }
+        const version = parseBaseVersion(rawVersion, isV6);
+        if (!version) {
+            continue;
+        }
+        if (!nodes.has(packageName)) {
+            nodes.set(packageName, new Map());
+        }
+        if (!nodes.get(packageName).has(version)) {
+            const node = {
+                type: 'npm',
+                name: version ? `npm:${packageName}@${version}` : `npm:${packageName}`,
+                data: {
+                    version,
+                    packageName,
+                    hash: hash ?? (0, file_hasher_1.hashArray)([packageName, version]),
+                },
             };
+            nodes.get(packageName).set(version, node);
+            keyMap.set(key, node);
         }
         else {
-            return nxJsonConfiguration;
+            keyMap.set(key, nodes.get(packageName).get(version));
         }
     }
-    else {
-        try {
-            return (0, fileutils_1.readJsonFile)((0, path_1.join)(__dirname, '..', '..', 'presets', 'core.json'));
+    const hoistedDeps = (0, pnpm_normalizer_1.loadPnpmHoistedDepsDefinition)();
+    const results = {};
+    for (const [packageName, versionMap] of nodes.entries()) {
+        let hoistedNode;
+        if (versionMap.size === 1) {
+            hoistedNode = versionMap.values().next().value;
         }
-        catch (e) {
-            return {};
+        else {
+            const hoistedVersion = getHoistedVersion(hoistedDeps, packageName, isV6);
+            hoistedNode = versionMap.get(hoistedVersion);
         }
+        if (hoistedNode) {
+            hoistedNode.name = `npm:${packageName}`;
+        }
+        versionMap.forEach((node) => {
+            results[node.name] = node;
+        });
     }
+    return results;
 }
-exports.readNxJson = readNxJson;
-function hasNxJson(root) {
-    const nxJson = (0, path_1.join)(root, 'nx.json');
-    return (0, fs_1.existsSync)(nxJson);
+function getHoistedVersion(hoistedDependencies, packageName, isV6) {
+    let version = (0, package_json_1.getHoistedPackageVersion)(packageName);
+    if (!version) {
+        const key = Object.keys(hoistedDependencies).find((k) => k.startsWith(`/${packageName}/`));
+        if (key) {
+            version = parseBaseVersion(getVersion(key, packageName), isV6);
+        }
+        else {
+            // pnpm might not hoist every package
+            // similarly those packages will not be available to be used via import
+            return;
+        }
+    }
+    return version;
+}
+function getDependencies(data, keyMap, isV6, ctx) {
+    const results = [];
+    Object.entries(data.packages).forEach(([key, snapshot]) => {
+        const node = keyMap.get(key);
+        [snapshot.dependencies, snapshot.optionalDependencies].forEach((section) => {
+            if (section) {
+                Object.entries(section).forEach(([name, versionRange]) => {
+                    const version = parseBaseVersion(findVersion(versionRange, name), isV6);
+                    const target = ctx.externalNodes[`npm:${name}@${version}`] ||
+                        ctx.externalNodes[`npm:${name}`];
+                    if (target) {
+                        const dep = {
+                            source: node.name,
+                            target: target.name,
+                            type: project_graph_1.DependencyType.static,
+                        };
+                        (0, project_graph_builder_1.validateDependency)(dep, ctx);
+                        results.push(dep);
+                    }
+                });
+            }
+        });
+    });
+    return results;
+}
+function parseBaseVersion(rawVersion, isV6) {
+    return isV6 ? rawVersion.split('(')[0] : rawVersion.split('_')[0];
+}
+function stringifyPnpmLockfile(graph, rootLockFileContent, packageJson) {
+    const data = (0, pnpm_normalizer_1.parseAndNormalizePnpmLockfile)(rootLockFileContent);
+    const { lockfileVersion, packages } = data;
+    const output = {
+        lockfileVersion,
+        importers: {
+            '.': mapRootSnapshot(packageJson, packages, graph.externalNodes),
+        },
+        packages: (0, object_sort_1.sortObjectByKeys)(mapSnapshots(data.packages, graph.externalNodes)),
+    };
+    return (0, pnpm_normalizer_1.stringifyToPnpmYaml)(output);
+}
+exports.stringifyPnpmLockfile = stringifyPnpmLockfile;
+function mapSnapshots(packages, nodes) {
+    const result = {};
+    Object.values(nodes).forEach((node) => {
+        const matchedKeys = findOriginalKeys(packages, node, {
+            returnFullKey: true,
+        });
+        // the package manager doesn't check for types of dependencies
+        // so we can safely set all to prod
+        matchedKeys.forEach(([key, snapshot]) => {
+            snapshot.dev = false;
+            result[key] = snapshot;
+        });
+    });
+    return result;
+}
+function findOriginalKeys(packages, { data: { packageName, version } }, { returnFullKey } = {}) {
+    const matchedKeys = [];
+    for (const key of Object.keys(packages)) {
+        const snapshot = packages[key];
+        // standard package
+        if (key.startsWith(`/${packageName}/${version}`)) {
+            matchedKeys.push([
+                returnFullKey ? key : getVersion(key, packageName),
+                snapshot,
+            ]);
+        }
+        // tarball package
+        if (key === version) {
+            matchedKeys.push([version, snapshot]);
+        }
+        // alias package
+        if (versionIsAlias(key, version)) {
+            matchedKeys.push([key, snapshot]);
+        }
+    }
+    return matchedKeys;
+}
+// check if version has a form of npm:packageName@version and
+// key starts with /packageName/version
+function versionIsAlias(key, versionExpr) {
+    const PREFIX = 'npm:';
+    if (!versionExpr.startsWith(PREFIX))
+        return false;
+    const indexOfVersionSeparator = versionExpr.indexOf('@', PREFIX.length + 1);
+    const packageName = versionExpr.slice(PREFIX.length, indexOfVersionSeparator);
+    const version = versionExpr.slice(indexOfVersionSeparator + 1);
+    return key.startsWith(`/${packageName}/${version}`);
+}
+function mapRootSnapshot(packageJson, packages, nodes) {
+    const snapshot = { specifiers: {} };
+    [
+        'dependencies',
+        'optionalDependencies',
+        'devDependencies',
+        'peerDependencies',
+    ].forEach((depType) => {
+        if (packageJson[depType]) {
+            Object.keys(packageJson[depType]).forEach((packageName) => {
+                const version = packageJson[depType][packageName];
+                const node = nodes[`npm:${packageName}@${version}`] || nodes[`npm:${packageName}`];
+                snapshot.specifiers[packageName] = version;
+                // peer dependencies are mapped to dependencies
+                let section = depType === 'peerDependencies' ? 'dependencies' : depType;
+                snapshot[section] = snapshot[section] || {};
+                snapshot[section][packageName] = findOriginalKeys(packages, node)[0][0];
+            });
+        }
+    });
+    Object.keys(snapshot).forEach((key) => {
+        snapshot[key] = (0, object_sort_1.sortObjectByKeys)(snapshot[key]);
+    });
+    return snapshot;
+}
+function findVersion(key, packageName) {
+    if (key.startsWith(`/${packageName}/`)) {
+        return getVersion(key, packageName);
+    }
+    // for alias packages prepend with "npm:"
+    if (key.startsWith('/')) {
+        const aliasName = key.slice(1, key.lastIndexOf('/'));
+        const version = getVersion(key, aliasName);
+        return `npm:${aliasName}@${version}`;
+    }
+    // for tarball package the entire key is the version spec
+    return key;
+}
+function getVersion(key, packageName) {
+    const KEY_NAME_SEPARATOR_LENGTH = 2; // leading and trailing slash
+    return key.slice(packageName.length + KEY_NAME_SEPARATOR_LENGTH);
+}
+function extractNameFromKey(key) {
+    // if package name contains org e.g. "/@babel/runtime/7.12.5"
+    // we want slice until the third slash
+    if (key.startsWith('/@')) {
+        // find the position of the '/' after org name
+        const startFrom = key.indexOf('/', 1);
+        return key.slice(1, key.indexOf('/', startFrom + 1));
+    }
+    if (key.startsWith('/')) {
+        // if package has just a name e.g. "/react/7.12.5..."
+        return key.slice(1, key.indexOf('/', 1));
+    }
+    return key;
 }
-exports.hasNxJson = hasNxJson;
 
 
 /***/ }),
 
-/***/ 2733:
-/***/ ((__unused_webpack_module, exports) => {
+/***/ 73283:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.DependencyType = exports.fileDataDepType = exports.fileDataDepTarget = void 0;
-function fileDataDepTarget(dep) {
-    return typeof dep === 'string'
-        ? dep
-        : Array.isArray(dep) && dep.length === 2
-            ? dep[0]
-            : dep[1];
-}
-exports.fileDataDepTarget = fileDataDepTarget;
-function fileDataDepType(dep) {
-    return typeof dep === 'string'
-        ? 'static'
-        : Array.isArray(dep) && dep.length === 2
-            ? dep[1]
-            : dep[2];
-}
-exports.fileDataDepType = fileDataDepType;
+exports.pruneProjectGraph = void 0;
+const semver_1 = __nccwpck_require__(11383);
+const project_graph_builder_1 = __nccwpck_require__(47667);
+const operators_1 = __nccwpck_require__(26311);
 /**
- * Type of dependency between projects
+ * Prune project graph's external nodes and their dependencies
+ * based on the pruned package.json
  */
-var DependencyType;
-(function (DependencyType) {
-    /**
-     * Static dependencies are tied to the loading of the module
-     */
-    DependencyType["static"] = "static";
-    /**
-     * Dynamic dependencies are brought in by the module at run time
-     */
-    DependencyType["dynamic"] = "dynamic";
-    /**
-     * Implicit dependencies are inferred
-     */
-    DependencyType["implicit"] = "implicit";
-})(DependencyType || (exports.DependencyType = DependencyType = {}));
+function pruneProjectGraph(graph, prunedPackageJson) {
+    const builder = new project_graph_builder_1.ProjectGraphBuilder();
+    const combinedDependencies = normalizeDependencies(prunedPackageJson, graph);
+    addNodesAndDependencies(graph, combinedDependencies, builder);
+    // for NPM (as well as the graph consistency)
+    // we need to distinguish between hoisted and non-hoisted dependencies
+    rehoistNodes(graph, combinedDependencies, builder);
+    return builder.getUpdatedProjectGraph();
+}
+exports.pruneProjectGraph = pruneProjectGraph;
+// ensure that dependency ranges from package.json (e.g. ^1.0.0)
+// are replaced with the actual version based on the available nodes (e.g. 1.0.1)
+function normalizeDependencies(packageJson, graph) {
+    const { dependencies, devDependencies, optionalDependencies, peerDependencies, } = packageJson;
+    const combinedDependencies = {
+        ...dependencies,
+        ...devDependencies,
+        ...optionalDependencies,
+        ...peerDependencies,
+    };
+    Object.entries(combinedDependencies).forEach(([packageName, versionRange]) => {
+        if (graph.externalNodes[`npm:${packageName}@${versionRange}`]) {
+            return;
+        }
+        if (graph.externalNodes[`npm:${packageName}`] &&
+            graph.externalNodes[`npm:${packageName}`].data.version === versionRange) {
+            return;
+        }
+        // otherwise we need to find the correct version
+        const node = findNodeMatchingVersion(graph, packageName, versionRange);
+        if (node) {
+            combinedDependencies[packageName] = node.data.version;
+        }
+        else {
+            throw new Error(`Pruned lock file creation failed. The following package was not found in the root lock file: ${packageName}@${versionRange}`);
+        }
+    });
+    return combinedDependencies;
+}
+function findNodeMatchingVersion(graph, packageName, versionExpr) {
+    if (versionExpr === '*') {
+        return graph.externalNodes[`npm:${packageName}`];
+    }
+    const nodes = Object.values(graph.externalNodes)
+        .filter((n) => n.data.packageName === packageName)
+        .sort((a, b) => ((0, semver_1.gte)(b.data.version, a.data.version) ? 1 : -1));
+    if (versionExpr === 'latest') {
+        return nodes.sort((a, b) => +(0, semver_1.gte)(b.data.version, a.data.version))[0];
+    }
+    if (graph.externalNodes[`npm:${packageName}`] &&
+        (0, semver_1.satisfies)(graph.externalNodes[`npm:${packageName}`].data.version, versionExpr)) {
+        return graph.externalNodes[`npm:${packageName}`];
+    }
+    return nodes.find((n) => (0, semver_1.satisfies)(n.data.version, versionExpr));
+}
+function addNodesAndDependencies(graph, packageJsonDeps, builder) {
+    Object.entries(packageJsonDeps).forEach(([name, version]) => {
+        const node = graph.externalNodes[`npm:${name}@${version}`] ||
+            graph.externalNodes[`npm:${name}`];
+        traverseNode(graph, builder, node);
+    });
+}
+function traverseNode(graph, builder, node) {
+    if (builder.graph.externalNodes[node.name]) {
+        return;
+    }
+    builder.addExternalNode(node);
+    graph.dependencies[node.name]?.forEach((dep) => {
+        const depNode = graph.externalNodes[dep.target];
+        traverseNode(graph, builder, depNode);
+        builder.addStaticDependency(node.name, dep.target);
+    });
+}
+function rehoistNodes(graph, packageJsonDeps, builder) {
+    const packagesToRehoist = new Map();
+    // find all packages that need to be rehoisted
+    Object.values(graph.externalNodes).forEach((node) => {
+        if (node.name === `npm:${node.data.packageName}` &&
+            !builder.graph.externalNodes[node.name]) {
+            const nestedNodes = Object.values(builder.graph.externalNodes).filter((n) => n.data.packageName === node.data.packageName);
+            if (nestedNodes.length > 0) {
+                packagesToRehoist.set(node.data.packageName, nestedNodes);
+            }
+        }
+    });
+    // invert dependencies for easier traversal back
+    const invertedGraph = (0, operators_1.reverse)(builder.graph);
+    const invBuilder = new project_graph_builder_1.ProjectGraphBuilder(invertedGraph, {});
+    // find new hoisted version
+    packagesToRehoist.forEach((nestedNodes) => {
+        if (nestedNodes.length === 1) {
+            switchNodeToHoisted(nestedNodes[0], builder, invBuilder);
+        }
+        else {
+            let minDistance = Infinity;
+            let closest;
+            nestedNodes.forEach((node) => {
+                const distance = pathLengthToIncoming(node, packageJsonDeps, builder, invertedGraph);
+                if (distance < minDistance) {
+                    minDistance = distance;
+                    closest = node;
+                }
+            });
+            switchNodeToHoisted(closest, builder, invBuilder);
+        }
+    });
+}
+function switchNodeToHoisted(node, builder, invBuilder) {
+    // make a copy of current name, all the dependencies and dependents
+    const previousName = node.name;
+    const targets = (builder.graph.dependencies[node.name] || []).map((d) => d.target);
+    const sources = Object.keys(builder.graph.dependencies).filter((name) => builder.graph.dependencies[name].some((d) => d.target === previousName));
+    builder.removeNode(node.name);
+    invBuilder.removeNode(node.name);
+    // modify the node and re-add it
+    node.name = `npm:${node.data.packageName}`;
+    builder.addExternalNode(node);
+    invBuilder.addExternalNode(node);
+    targets.forEach((target) => {
+        builder.addStaticDependency(node.name, target);
+        invBuilder.addStaticDependency(target, node.name);
+    });
+    sources.forEach((source) => {
+        builder.addStaticDependency(source, node.name);
+        invBuilder.addStaticDependency(node.name, source);
+    });
+}
+// BFS to find the shortest path to a dependency specified in package.json
+// package version with the shortest path is the one that should be hoisted
+function pathLengthToIncoming(node, packageJsonDeps, builder, invertedGraph) {
+    const visited = new Set([node.name]);
+    const queue = [[node, 0]];
+    while (queue.length > 0) {
+        const [current, distance] = queue.shift();
+        if (packageJsonDeps[current.data.packageName] === current.data.version) {
+            return distance;
+        }
+        for (let { target } of invertedGraph.dependencies[current.name] || []) {
+            if (!visited.has(target)) {
+                visited.add(target);
+                queue.push([builder.graph.externalNodes[target], distance + 1]);
+            }
+        }
+    }
+}
 
 
 /***/ }),
 
-/***/ 7852:
+/***/ 46876:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.toProjectName = exports.Workspaces = void 0;
-const path_1 = __nccwpck_require__(1017);
-const project_graph_1 = __nccwpck_require__(4913);
-const nx_json_1 = __nccwpck_require__(1173);
-// TODO(v19): remove this class
+exports.normalizePackageJson = exports.getHoistedPackageVersion = void 0;
+const fs_1 = __nccwpck_require__(57147);
+const workspace_root_1 = __nccwpck_require__(64393);
 /**
- * @deprecated This will be removed in v19. Use {@link readProjectsConfigurationFromProjectGraph} instead.
+ * Get version of hoisted package if available
  */
-class Workspaces {
-    constructor(root) {
-        this.root = root;
-    }
-    /**
-     * @deprecated Use {@link readProjectsConfigurationFromProjectGraph} instead.
-     */
-    readWorkspaceConfiguration() {
-        const nxJson = (0, nx_json_1.readNxJson)(this.root);
-        return {
-            ...(0, project_graph_1.readProjectsConfigurationFromProjectGraph)((0, project_graph_1.readCachedProjectGraph)()),
-            ...nxJson,
-        };
+function getHoistedPackageVersion(packageName) {
+    const fullPath = `${workspace_root_1.workspaceRoot}/node_modules/${packageName}/package.json`;
+    if ((0, fs_1.existsSync)(fullPath)) {
+        const content = (0, fs_1.readFileSync)(fullPath, 'utf-8');
+        return JSON.parse(content)?.version;
     }
+    return;
 }
-exports.Workspaces = Workspaces;
+exports.getHoistedPackageVersion = getHoistedPackageVersion;
 /**
- * Pulled from toFileName in names from @nx/devkit.
- * Todo: Should refactor, not duplicate.
+ * Strip off non-pruning related fields from package.json
  */
-function toProjectName(fileName) {
-    const parts = (0, path_1.dirname)(fileName).split(/[\/\\]/g);
-    return parts[parts.length - 1].toLowerCase();
+function normalizePackageJson(packageJson) {
+    const { name, version, license, dependencies, devDependencies, peerDependencies, peerDependenciesMeta, optionalDependencies, } = packageJson;
+    return {
+        name,
+        version,
+        license,
+        dependencies,
+        devDependencies,
+        peerDependencies,
+        peerDependenciesMeta,
+        optionalDependencies,
+    };
 }
-exports.toProjectName = toProjectName;
+exports.normalizePackageJson = normalizePackageJson;
 
 
 /***/ }),
 
-/***/ 800:
+/***/ 76637:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
+/**
+ * This file contains the logic to convert pnpm lockfile to a standard format.
+ * It will convert inline specifiers to the separate specifiers format and ensure importers are present.
+ */
 Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.getDaemonProcessIdSync = exports.safelyCleanUpExistingProcess = exports.writeDaemonJsonProcessCache = exports.deleteDaemonJsonProcessCache = exports.readDaemonProcessJsonCache = exports.serverProcessJsonPath = void 0;
-const fs_extra_1 = __nccwpck_require__(2103);
-const path_1 = __nccwpck_require__(1017);
-const tmp_dir_1 = __nccwpck_require__(1524);
-exports.serverProcessJsonPath = (0, path_1.join)(tmp_dir_1.DAEMON_DIR_FOR_CURRENT_WORKSPACE, 'server-process.json');
-async function readDaemonProcessJsonCache() {
-    if (!(0, fs_extra_1.existsSync)(exports.serverProcessJsonPath)) {
-        return null;
+exports.stringifyToPnpmYaml = exports.parseAndNormalizePnpmLockfile = exports.loadPnpmHoistedDepsDefinition = exports.isV6Lockfile = void 0;
+const fs_1 = __nccwpck_require__(57147);
+const workspace_root_1 = __nccwpck_require__(64393);
+const semver_1 = __nccwpck_require__(11383);
+function isV6Lockfile(data) {
+    return data.lockfileVersion.toString().startsWith('6.');
+}
+exports.isV6Lockfile = isV6Lockfile;
+function loadPnpmHoistedDepsDefinition() {
+    const fullPath = `${workspace_root_1.workspaceRoot}/node_modules/.modules.yaml`;
+    if ((0, fs_1.existsSync)(fullPath)) {
+        const content = (0, fs_1.readFileSync)(fullPath, 'utf-8');
+        const { load } = __nccwpck_require__(86541);
+        return load(content)?.hoistedDependencies ?? {};
     }
-    return await (0, fs_extra_1.readJson)(exports.serverProcessJsonPath);
-}
-exports.readDaemonProcessJsonCache = readDaemonProcessJsonCache;
-function deleteDaemonJsonProcessCache() {
-    try {
-        if (getDaemonProcessIdSync() === process.pid) {
-            (0, fs_extra_1.unlinkSync)(exports.serverProcessJsonPath);
-        }
+    else {
+        throw new Error(`Could not find ".modules.yaml" at "${fullPath}"`);
     }
-    catch { }
 }
-exports.deleteDaemonJsonProcessCache = deleteDaemonJsonProcessCache;
-async function writeDaemonJsonProcessCache(daemonJson) {
-    await (0, fs_extra_1.writeJson)(exports.serverProcessJsonPath, daemonJson);
+exports.loadPnpmHoistedDepsDefinition = loadPnpmHoistedDepsDefinition;
+/*************************************************************************
+ * THE FOLLOWING CODE IS COPIED & simplified FROM @pnpm/lockfile-file for convenience
+ *************************************************************************/
+/**
+ * Parsing and mapping logic from pnpm lockfile `read` function
+ * https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/read.ts#L91
+ */
+function parseAndNormalizePnpmLockfile(content) {
+    const { load } = __nccwpck_require__(86541);
+    const lockFileData = load(content);
+    return revertFromInlineSpecifiersFormatIfNecessary(convertFromLockfileFileMutable(lockFileData));
 }
-exports.writeDaemonJsonProcessCache = writeDaemonJsonProcessCache;
-async function safelyCleanUpExistingProcess() {
-    const daemonProcessJson = await readDaemonProcessJsonCache();
-    if (daemonProcessJson && daemonProcessJson.processId) {
-        try {
-            process.kill(daemonProcessJson.processId);
-            // we wait for the process to actually shut down before returning
-            await new Promise((resolve, reject) => {
-                let count = 0;
-                const interval = setInterval(() => {
-                    try {
-                        // sending a signal 0 to a process checks if the process is running instead of actually killing it
-                        process.kill(daemonProcessJson.processId, 0);
-                    }
-                    catch (e) {
-                        clearInterval(interval);
-                        resolve();
-                    }
-                    if ((count += 1) > 200) {
-                        clearInterval(interval);
-                        reject(`Daemon process ${daemonProcessJson.processId} didn't exit after 2 seconds.`);
-                    }
-                }, 10);
-            });
+exports.parseAndNormalizePnpmLockfile = parseAndNormalizePnpmLockfile;
+/**
+ * Reverts changes from the "forceSharedFormat" write option if necessary.
+ * https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/read.ts#L234
+ */
+function convertFromLockfileFileMutable(lockfileFile) {
+    if (typeof lockfileFile?.['importers'] === 'undefined') {
+        lockfileFile.importers = {
+            '.': {
+                specifiers: lockfileFile['specifiers'] ?? {},
+                dependenciesMeta: lockfileFile['dependenciesMeta'],
+                publishDirectory: lockfileFile['publishDirectory'],
+            },
+        };
+        delete lockfileFile.specifiers;
+        for (const depType of DEPENDENCIES_FIELDS) {
+            if (lockfileFile[depType] != null) {
+                lockfileFile.importers['.'][depType] = lockfileFile[depType];
+                delete lockfileFile[depType];
+            }
         }
-        catch { }
-    }
-    deleteDaemonJsonProcessCache();
-}
-exports.safelyCleanUpExistingProcess = safelyCleanUpExistingProcess;
-// Must be sync for the help output use case
-function getDaemonProcessIdSync() {
-    if (!(0, fs_extra_1.existsSync)(exports.serverProcessJsonPath)) {
-        return null;
-    }
-    try {
-        const daemonProcessJson = (0, fs_extra_1.readJsonSync)(exports.serverProcessJsonPath);
-        return daemonProcessJson.processId;
-    }
-    catch {
-        return null;
     }
+    return lockfileFile;
 }
-exports.getDaemonProcessIdSync = getDaemonProcessIdSync;
-
-
-/***/ }),
-
-/***/ 6940:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.daemonClient = exports.DaemonClient = void 0;
-const workspace_root_1 = __nccwpck_require__(4393);
-const child_process_1 = __nccwpck_require__(8493);
-const fs_1 = __nccwpck_require__(7147);
-const promises_1 = __nccwpck_require__(3292);
-const fs_extra_1 = __nccwpck_require__(2103);
-const net_1 = __nccwpck_require__(1808);
-const path_1 = __nccwpck_require__(1017);
-const perf_hooks_1 = __nccwpck_require__(4074);
-const output_1 = __nccwpck_require__(1862);
-const socket_utils_1 = __nccwpck_require__(8935);
-const tmp_dir_1 = __nccwpck_require__(1524);
-const is_ci_1 = __nccwpck_require__(8590);
-const configuration_1 = __nccwpck_require__(4333);
-const promised_based_queue_1 = __nccwpck_require__(5340);
-const nx_json_1 = __nccwpck_require__(1173);
-const daemon_socket_messenger_1 = __nccwpck_require__(1629);
-const cache_1 = __nccwpck_require__(800);
-const error_types_1 = __nccwpck_require__(4403);
-const DAEMON_ENV_SETTINGS = {
-    NX_PROJECT_GLOB_CACHE: 'false',
-    NX_CACHE_PROJECTS_CONFIG: 'false',
+// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/write.ts#L27
+const LOCKFILE_YAML_FORMAT = {
+    blankLines: true,
+    lineWidth: 1000,
+    noCompatMode: true,
+    noRefs: true,
+    sortKeys: false,
 };
-var DaemonStatus;
-(function (DaemonStatus) {
-    DaemonStatus[DaemonStatus["CONNECTING"] = 0] = "CONNECTING";
-    DaemonStatus[DaemonStatus["DISCONNECTED"] = 1] = "DISCONNECTED";
-    DaemonStatus[DaemonStatus["CONNECTED"] = 2] = "CONNECTED";
-})(DaemonStatus || (DaemonStatus = {}));
-class DaemonClient {
-    constructor(nxJson) {
-        this.nxJson = nxJson;
-        this._daemonStatus = DaemonStatus.DISCONNECTED;
-        this._waitForDaemonReady = null;
-        this._daemonReady = null;
-        this._out = null;
-        this._err = null;
-        this.reset();
-    }
-    enabled() {
-        if (this._enabled === undefined) {
-            // TODO(v19): Add migration to move it out of existing configs and remove the ?? here.
-            const useDaemonProcessOption = this.nxJson.useDaemonProcess ??
-                this.nxJson.tasksRunnerOptions?.['default']?.options?.useDaemonProcess;
-            const env = process.env.NX_DAEMON;
-            // env takes precedence
-            // option=true,env=false => no daemon
-            // option=false,env=undefined => no daemon
-            // option=false,env=false => no daemon
-            // option=undefined,env=undefined => daemon
-            // option=true,env=true => daemon
-            // option=false,env=true => daemon
-            // CI=true,env=undefined => no daemon
-            // CI=true,env=false => no daemon
-            // CI=true,env=true => daemon
-            if (((0, is_ci_1.isCI)() && env !== 'true') ||
-                isDocker() ||
-                (0, tmp_dir_1.isDaemonDisabled)() ||
-                nxJsonIsNotPresent() ||
-                (useDaemonProcessOption === undefined && env === 'false') ||
-                (useDaemonProcessOption === true && env === 'false') ||
-                (useDaemonProcessOption === false && env === undefined) ||
-                (useDaemonProcessOption === false && env === 'false')) {
-                this._enabled = false;
-            }
-            else {
-                this._enabled = true;
+/**
+ * Mapping and writing logic from pnpm lockfile `write` function
+ * https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/write.ts#L77
+ */
+function stringifyToPnpmYaml(lockfile) {
+    const isLockfileV6 = isV6Lockfile(lockfile);
+    const adaptedLockfile = isLockfileV6
+        ? convertToInlineSpecifiersFormat(lockfile)
+        : lockfile;
+    const { dump } = __nccwpck_require__(86541);
+    return dump(sortLockfileKeys(normalizeLockfile(adaptedLockfile, isLockfileV6)), LOCKFILE_YAML_FORMAT);
+}
+exports.stringifyToPnpmYaml = stringifyToPnpmYaml;
+// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/write.ts#L106
+function normalizeLockfile(lockfile, isLockfileV6) {
+    let lockfileToSave;
+    if (Object.keys(lockfile.importers).length === 1 && lockfile.importers['.']) {
+        lockfileToSave = {
+            ...lockfile,
+            ...lockfile.importers['.'],
+        };
+        delete lockfileToSave.importers;
+        for (const depType of DEPENDENCIES_FIELDS) {
+            if (isEmpty(lockfileToSave[depType])) {
+                delete lockfileToSave[depType];
             }
         }
-        return this._enabled;
+        if (isEmpty(lockfileToSave.packages) || lockfileToSave.packages == null) {
+            delete lockfileToSave.packages;
+        }
     }
-    reset() {
-        this.socketMessenger?.close();
-        this.socketMessenger = null;
-        this.queue = new promised_based_queue_1.PromisedBasedQueue();
-        this.currentMessage = null;
-        this.currentResolve = null;
-        this.currentReject = null;
-        this._enabled = undefined;
-        this._out?.close();
-        this._err?.close();
-        this._out = null;
-        this._err = null;
-        this._daemonStatus = DaemonStatus.DISCONNECTED;
-        this._waitForDaemonReady = new Promise((resolve) => (this._daemonReady = resolve));
+    else {
+        lockfileToSave = {
+            ...lockfile,
+            importers: mapValues(lockfile.importers, (importer) => {
+                const normalizedImporter = {};
+                if (!isEmpty(importer.specifiers ?? {}) || !isLockfileV6) {
+                    normalizedImporter['specifiers'] = importer.specifiers ?? {};
+                }
+                if (importer.dependenciesMeta != null &&
+                    !isEmpty(importer.dependenciesMeta)) {
+                    normalizedImporter['dependenciesMeta'] = importer.dependenciesMeta;
+                }
+                for (const depType of DEPENDENCIES_FIELDS) {
+                    if (!isEmpty(importer[depType] ?? {})) {
+                        normalizedImporter[depType] = importer[depType];
+                    }
+                }
+                if (importer.publishDirectory) {
+                    normalizedImporter.publishDirectory = importer.publishDirectory;
+                }
+                return normalizedImporter;
+            }),
+        };
+        if (isEmpty(lockfileToSave.packages) || lockfileToSave.packages == null) {
+            delete lockfileToSave.packages;
+        }
     }
-    async requestShutdown() {
-        return this.sendToDaemonViaQueue({ type: 'REQUEST_SHUTDOWN' });
+    if (lockfileToSave.time) {
+        lockfileToSave.time = (isLockfileV6 ? pruneTimeInLockfileV6 : pruneTime)(lockfileToSave.time, lockfile.importers);
     }
-    async getProjectGraphAndSourceMaps() {
-        try {
-            const response = await this.sendToDaemonViaQueue({
-                type: 'REQUEST_PROJECT_GRAPH',
-            });
-            return {
-                projectGraph: response.projectGraph,
-                sourceMaps: response.sourceMaps,
-            };
+    if (lockfileToSave.overrides != null && isEmpty(lockfileToSave.overrides)) {
+        delete lockfileToSave.overrides;
+    }
+    if (lockfileToSave.patchedDependencies != null &&
+        isEmpty(lockfileToSave.patchedDependencies)) {
+        delete lockfileToSave.patchedDependencies;
+    }
+    if (lockfileToSave.neverBuiltDependencies != null) {
+        if (isEmpty(lockfileToSave.neverBuiltDependencies)) {
+            delete lockfileToSave.neverBuiltDependencies;
         }
-        catch (e) {
-            if (e.name === error_types_1.DaemonProjectGraphError.name) {
-                throw error_types_1.ProjectGraphError.fromDaemonProjectGraphError(e);
-            }
-            else {
-                throw e;
-            }
+        else {
+            lockfileToSave.neverBuiltDependencies =
+                lockfileToSave.neverBuiltDependencies.sort();
         }
     }
-    async getAllFileData() {
-        return await this.sendToDaemonViaQueue({ type: 'REQUEST_FILE_DATA' });
+    if (lockfileToSave.onlyBuiltDependencies != null) {
+        lockfileToSave.onlyBuiltDependencies =
+            lockfileToSave.onlyBuiltDependencies.sort();
     }
-    hashTasks(runnerOptions, tasks, taskGraph, env) {
-        return this.sendToDaemonViaQueue({
-            type: 'HASH_TASKS',
-            runnerOptions,
-            env,
-            tasks,
-            taskGraph,
-        });
+    if (!lockfileToSave.packageExtensionsChecksum) {
+        delete lockfileToSave.packageExtensionsChecksum;
     }
-    async registerFileWatcher(config, callback) {
-        await this.getProjectGraphAndSourceMaps();
-        let messenger;
-        await this.queue.sendToQueue(() => {
-            messenger = new daemon_socket_messenger_1.DaemonSocketMessenger((0, net_1.connect)(socket_utils_1.FULL_OS_SOCKET_PATH)).listen((message) => {
-                try {
-                    const parsedMessage = JSON.parse(message);
-                    callback(null, parsedMessage);
+    return lockfileToSave;
+}
+// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/write.ts#L173
+function pruneTimeInLockfileV6(time, importers) {
+    const rootDepPaths = new Set();
+    for (const importer of Object.values(importers)) {
+        for (const depType of DEPENDENCIES_FIELDS) {
+            for (let [depName, ref] of Object.entries(importer[depType] ?? {})) {
+                let version;
+                if (ref['version']) {
+                    version = ref['version'];
                 }
-                catch (e) {
-                    callback(e, null);
+                else {
+                    version = ref;
                 }
-            }, () => {
-                callback('closed', null);
-            }, (err) => callback(err, null));
-            return messenger.sendMessage({ type: 'REGISTER_FILE_WATCHER', config });
-        });
-        return () => {
-            messenger?.close();
-        };
-    }
-    processInBackground(requirePath, data) {
-        return this.sendToDaemonViaQueue({
-            type: 'PROCESS_IN_BACKGROUND',
-            requirePath,
-            data,
-        });
+                const suffixStart = version.indexOf('(');
+                const refWithoutPeerSuffix = suffixStart === -1 ? version : version.slice(0, suffixStart);
+                const depPath = refToRelative(refWithoutPeerSuffix, depName);
+                if (!depPath)
+                    continue;
+                rootDepPaths.add(depPath);
+            }
+        }
     }
-    recordOutputsHash(outputs, hash) {
-        return this.sendToDaemonViaQueue({
-            type: 'RECORD_OUTPUTS_HASH',
-            data: {
-                outputs,
-                hash,
-            },
-        });
+    return pickBy((prop) => rootDepPaths.has(prop), time);
+}
+// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/write.ts#L191
+function refToRelative(reference, pkgName) {
+    if (reference.startsWith('link:')) {
+        return null;
     }
-    outputsHashesMatch(outputs, hash) {
-        return this.sendToDaemonViaQueue({
-            type: 'OUTPUTS_HASHES_MATCH',
-            data: {
-                outputs,
-                hash,
-            },
-        });
+    if (reference.startsWith('file:')) {
+        return reference;
     }
-    async isServerAvailable() {
-        return new Promise((resolve) => {
-            try {
-                const socket = (0, net_1.connect)(socket_utils_1.FULL_OS_SOCKET_PATH, () => {
-                    socket.destroy();
-                    resolve(true);
-                });
-                socket.once('error', () => {
-                    resolve(false);
-                });
-            }
-            catch (err) {
-                resolve(false);
-            }
-        });
+    if (!reference.includes('/') ||
+        !reference.replace(/(\([^)]+\))+$/, '').includes('/')) {
+        return `/${pkgName}@${reference}`;
     }
-    async sendToDaemonViaQueue(messageToDaemon) {
-        return this.queue.sendToQueue(() => this.sendMessageToDaemon(messageToDaemon));
+    return reference;
+}
+// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/write.ts#L207
+function pruneTime(time, importers) {
+    const rootDepPaths = new Set();
+    for (const importer of Object.values(importers)) {
+        for (const depType of DEPENDENCIES_FIELDS) {
+            for (let [depName, ref] of Object.entries(importer[depType] ?? {})) {
+                let version;
+                if (ref['version']) {
+                    version = ref['version'];
+                }
+                else {
+                    version = ref;
+                }
+                const suffixStart = version.indexOf('_');
+                const refWithoutPeerSuffix = suffixStart === -1 ? version : version.slice(0, suffixStart);
+                const depPath = dpRefToRelative(refWithoutPeerSuffix, depName);
+                if (!depPath)
+                    continue;
+                rootDepPaths.add(depPath);
+            }
+        }
+    }
+    return pickBy((depPath) => rootDepPaths.has(depPath), time);
+}
+// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/sortLockfileKeys.ts#L34
+const ROOT_KEYS_ORDER = {
+    lockfileVersion: 1,
+    // only and never are conflict options.
+    neverBuiltDependencies: 2,
+    onlyBuiltDependencies: 2,
+    overrides: 3,
+    packageExtensionsChecksum: 4,
+    patchedDependencies: 5,
+    specifiers: 10,
+    dependencies: 11,
+    optionalDependencies: 12,
+    devDependencies: 13,
+    dependenciesMeta: 14,
+    importers: 15,
+    packages: 16,
+};
+// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/sortLockfileKeys.ts#L60
+function sortLockfileKeys(lockfile) {
+    let sortedLockfile = {};
+    const sortedKeys = Object.keys(lockfile).sort((a, b) => ROOT_KEYS_ORDER[a] - ROOT_KEYS_ORDER[b]);
+    for (const key of sortedKeys) {
+        sortedLockfile[key] = lockfile[key];
     }
-    setUpConnection() {
-        this.socketMessenger = new daemon_socket_messenger_1.DaemonSocketMessenger((0, net_1.connect)(socket_utils_1.FULL_OS_SOCKET_PATH)).listen((message) => this.handleMessage(message), () => {
-            // it's ok for the daemon to terminate if the client doesn't wait on
-            // any messages from the daemon
-            if (this.queue.isEmpty()) {
-                this.reset();
-            }
-            else {
-                output_1.output.error({
-                    title: 'Daemon process terminated and closed the connection',
-                    bodyLines: [
-                        'Please rerun the command, which will restart the daemon.',
-                        `If you get this error again, check for any errors in the daemon process logs found in: ${tmp_dir_1.DAEMON_OUTPUT_LOG_FILE}`,
-                    ],
-                });
-                this._daemonStatus = DaemonStatus.DISCONNECTED;
-                this.currentReject?.(daemonProcessException('Daemon process terminated and closed the connection'));
-                process.exit(1);
+    return sortedLockfile;
+}
+/**
+ * Types from https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/experiments/InlineSpecifiersLockfile.ts
+ */
+const INLINE_SPECIFIERS_FORMAT_LOCKFILE_VERSION_SUFFIX = '-inlineSpecifiers';
+// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts#L10
+function isExperimentalInlineSpecifiersFormat(lockfile) {
+    const { lockfileVersion } = lockfile;
+    return (lockfileVersion.toString().startsWith('6.') ||
+        (typeof lockfileVersion === 'string' &&
+            lockfileVersion.endsWith(INLINE_SPECIFIERS_FORMAT_LOCKFILE_VERSION_SUFFIX)));
+}
+// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts#L17
+function convertToInlineSpecifiersFormat(lockfile) {
+    let importers = lockfile.importers;
+    let packages = lockfile.packages;
+    if (isV6Lockfile(lockfile)) {
+        importers = Object.fromEntries(Object.entries(lockfile.importers ?? {}).map(([importerId, pkgSnapshot]) => {
+            const newSnapshot = { ...pkgSnapshot };
+            if (newSnapshot.dependencies != null) {
+                newSnapshot.dependencies = mapValues(newSnapshot.dependencies, convertOldRefToNewRef);
+            }
+            if (newSnapshot.optionalDependencies != null) {
+                newSnapshot.optionalDependencies = mapValues(newSnapshot.optionalDependencies, convertOldRefToNewRef);
+            }
+            if (newSnapshot.devDependencies != null) {
+                newSnapshot.devDependencies = mapValues(newSnapshot.devDependencies, convertOldRefToNewRef);
+            }
+            return [importerId, newSnapshot];
+        }));
+        packages = Object.fromEntries(Object.entries(lockfile.packages ?? {}).map(([depPath, pkgSnapshot]) => {
+            const newSnapshot = { ...pkgSnapshot };
+            if (newSnapshot.dependencies != null) {
+                newSnapshot.dependencies = mapValues(newSnapshot.dependencies, convertOldRefToNewRef);
             }
-        }, (err) => {
-            if (!err.message) {
-                return this.currentReject(daemonProcessException(err.toString()));
+            if (newSnapshot.optionalDependencies != null) {
+                newSnapshot.optionalDependencies = mapValues(newSnapshot.optionalDependencies, convertOldRefToNewRef);
             }
-            if (err.message.startsWith('LOCK-FILES-CHANGED')) {
-                // retry the current message
-                // we cannot send it via the queue because we are in the middle of processing
-                // a message from the queue
-                return this.sendMessageToDaemon(this.currentMessage).then(this.currentResolve, this.currentReject);
+            return [convertOldDepPathToNewDepPath(depPath), newSnapshot];
+        }));
+    }
+    const newLockfile = {
+        ...lockfile,
+        packages,
+        lockfileVersion: isV6Lockfile(lockfile)
+            ? lockfile.lockfileVersion.toString()
+            : lockfile.lockfileVersion
+                .toString()
+                .endsWith(INLINE_SPECIFIERS_FORMAT_LOCKFILE_VERSION_SUFFIX)
+                ? lockfile.lockfileVersion.toString()
+                : `${lockfile.lockfileVersion}${INLINE_SPECIFIERS_FORMAT_LOCKFILE_VERSION_SUFFIX}`,
+        importers: mapValues(importers, convertProjectSnapshotToInlineSpecifiersFormat),
+    };
+    if (isV6Lockfile(lockfile) && newLockfile.time) {
+        newLockfile.time = Object.fromEntries(Object.entries(newLockfile.time).map(([depPath, time]) => [
+            convertOldDepPathToNewDepPath(depPath),
+            time,
+        ]));
+    }
+    return newLockfile;
+}
+// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts#L72
+function convertOldDepPathToNewDepPath(oldDepPath) {
+    const parsedDepPath = dpParse(oldDepPath);
+    if (!parsedDepPath.name || !parsedDepPath.version)
+        return oldDepPath;
+    let newDepPath = `/${parsedDepPath.name}@${parsedDepPath.version}`;
+    if (parsedDepPath.peersSuffix) {
+        if (parsedDepPath.peersSuffix.startsWith('(')) {
+            newDepPath += parsedDepPath.peersSuffix;
+        }
+        else {
+            newDepPath += `_${parsedDepPath.peersSuffix}`;
+        }
+    }
+    if (parsedDepPath.host) {
+        newDepPath = `${parsedDepPath.host}${newDepPath}`;
+    }
+    return newDepPath;
+}
+// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts#L89
+function convertOldRefToNewRef(oldRef) {
+    if (oldRef.startsWith('link:') || oldRef.startsWith('file:')) {
+        return oldRef;
+    }
+    if (oldRef.includes('/')) {
+        return convertOldDepPathToNewDepPath(oldRef);
+    }
+    return oldRef;
+}
+// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts#L99
+function revertFromInlineSpecifiersFormatIfNecessary(lockfile) {
+    return isExperimentalInlineSpecifiersFormat(lockfile)
+        ? revertFromInlineSpecifiersFormat(lockfile)
+        : lockfile;
+}
+// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts#L105
+function revertFromInlineSpecifiersFormat(lockfile) {
+    const { lockfileVersion, importers, ...rest } = lockfile;
+    const originalVersionStr = lockfileVersion.replace(INLINE_SPECIFIERS_FORMAT_LOCKFILE_VERSION_SUFFIX, '');
+    const originalVersion = Number(originalVersionStr);
+    if (isNaN(originalVersion)) {
+        throw new Error(`Unable to revert lockfile from inline specifiers format. Invalid version parsed: ${originalVersionStr}`);
+    }
+    let revertedImporters = mapValues(importers, revertProjectSnapshot);
+    let packages = lockfile.packages;
+    if (originalVersionStr.startsWith('6.')) {
+        revertedImporters = Object.fromEntries(Object.entries(revertedImporters ?? {}).map(([importerId, pkgSnapshot]) => {
+            const newSnapshot = { ...pkgSnapshot };
+            if (newSnapshot.dependencies != null) {
+                newSnapshot.dependencies = mapValues(newSnapshot.dependencies, convertNewRefToOldRef);
             }
-            let error;
-            if (err.message.startsWith('connect ENOENT')) {
-                error = daemonProcessException('The Daemon Server is not running');
+            if (newSnapshot.optionalDependencies != null) {
+                newSnapshot.optionalDependencies = mapValues(newSnapshot.optionalDependencies, convertNewRefToOldRef);
             }
-            else if (err.message.startsWith('connect ECONNREFUSED')) {
-                error = daemonProcessException(`A server instance had not been fully shut down. Please try running the command again.`);
-                (0, socket_utils_1.killSocketOrPath)();
+            if (newSnapshot.devDependencies != null) {
+                newSnapshot.devDependencies = mapValues(newSnapshot.devDependencies, convertNewRefToOldRef);
             }
-            else if (err.message.startsWith('read ECONNRESET')) {
-                error = daemonProcessException(`Unable to connect to the daemon process.`);
+            return [importerId, newSnapshot];
+        }));
+        packages = Object.fromEntries(Object.entries(lockfile.packages ?? {}).map(([depPath, pkgSnapshot]) => {
+            const newSnapshot = { ...pkgSnapshot };
+            if (newSnapshot.dependencies != null) {
+                newSnapshot.dependencies = mapValues(newSnapshot.dependencies, convertNewRefToOldRef);
             }
-            else {
-                error = daemonProcessException(err.toString());
+            if (newSnapshot.optionalDependencies != null) {
+                newSnapshot.optionalDependencies = mapValues(newSnapshot.optionalDependencies, convertNewRefToOldRef);
             }
-            return this.currentReject(error);
-        });
+            return [convertNewDepPathToOldDepPath(depPath), newSnapshot];
+        }));
     }
-    async sendMessageToDaemon(message) {
-        if (this._daemonStatus == DaemonStatus.DISCONNECTED) {
-            this._daemonStatus = DaemonStatus.CONNECTING;
-            if (!(await this.isServerAvailable())) {
-                await this.startInBackground();
+    const newLockfile = {
+        ...rest,
+        lockfileVersion: lockfileVersion.endsWith(INLINE_SPECIFIERS_FORMAT_LOCKFILE_VERSION_SUFFIX)
+            ? originalVersion
+            : lockfileVersion,
+        packages,
+        importers: revertedImporters,
+    };
+    if (originalVersionStr.startsWith('6.') && newLockfile.time) {
+        newLockfile.time = Object.fromEntries(Object.entries(newLockfile.time).map(([depPath, time]) => [
+            convertNewDepPathToOldDepPath(depPath),
+            time,
+        ]));
+    }
+    return newLockfile;
+}
+// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts#L162
+function convertNewDepPathToOldDepPath(oldDepPath) {
+    if (!oldDepPath.includes('@', 2))
+        return oldDepPath;
+    const index = oldDepPath.indexOf('@', oldDepPath.indexOf('/@') + 2);
+    if (oldDepPath.includes('(') && index > oldDepPath.indexOf('('))
+        return oldDepPath;
+    return `${oldDepPath.substring(0, index)}/${oldDepPath.substring(index + 1)}`;
+}
+// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts#L169
+function convertNewRefToOldRef(oldRef) {
+    if (oldRef.startsWith('link:') || oldRef.startsWith('file:')) {
+        return oldRef;
+    }
+    if (oldRef.includes('@')) {
+        return convertNewDepPathToOldDepPath(oldRef);
+    }
+    return oldRef;
+}
+// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts#L179
+function convertProjectSnapshotToInlineSpecifiersFormat(projectSnapshot) {
+    const { specifiers, ...rest } = projectSnapshot;
+    const convertBlock = (block) => block != null
+        ? convertResolvedDependenciesToInlineSpecifiersFormat(block, {
+            specifiers,
+        })
+        : block;
+    return {
+        ...rest,
+        dependencies: convertBlock(projectSnapshot.dependencies),
+        optionalDependencies: convertBlock(projectSnapshot.optionalDependencies),
+        devDependencies: convertBlock(projectSnapshot.devDependencies),
+    };
+}
+// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts#L195
+function convertResolvedDependenciesToInlineSpecifiersFormat(resolvedDependencies, { specifiers }) {
+    return mapValues(resolvedDependencies, (version, depName) => ({
+        specifier: specifiers[depName],
+        version,
+    }));
+}
+// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts#L205
+function revertProjectSnapshot(from) {
+    const specifiers = {};
+    function moveSpecifiers(from) {
+        const resolvedDependencies = {};
+        for (const [depName, { specifier, version }] of Object.entries(from)) {
+            const existingValue = specifiers[depName];
+            if (existingValue != null && existingValue !== specifier) {
+                throw new Error(`Project snapshot lists the same dependency more than once with conflicting versions: ${depName}`);
             }
-            this.setUpConnection();
-            this._daemonStatus = DaemonStatus.CONNECTED;
-            this._daemonReady();
+            specifiers[depName] = specifier;
+            resolvedDependencies[depName] = version;
         }
-        else if (this._daemonStatus == DaemonStatus.CONNECTING) {
-            await this._waitForDaemonReady;
-        }
-        return new Promise((resolve, reject) => {
-            perf_hooks_1.performance.mark('sendMessageToDaemon-start');
-            this.currentMessage = message;
-            this.currentResolve = resolve;
-            this.currentReject = reject;
-            this.socketMessenger.sendMessage(message);
-        });
+        return resolvedDependencies;
     }
-    handleMessage(serializedResult) {
-        try {
-            perf_hooks_1.performance.mark('json-parse-start');
-            const parsedResult = JSON.parse(serializedResult);
-            perf_hooks_1.performance.mark('json-parse-end');
-            perf_hooks_1.performance.measure('deserialize daemon response', 'json-parse-start', 'json-parse-end');
-            if (parsedResult.error) {
-                this.currentReject(parsedResult.error);
+    const dependencies = from.dependencies
+        ? moveSpecifiers(from.dependencies)
+        : null;
+    const devDependencies = from.devDependencies
+        ? moveSpecifiers(from.devDependencies)
+        : null;
+    const optionalDependencies = from.optionalDependencies
+        ? moveSpecifiers(from.optionalDependencies)
+        : null;
+    return {
+        ...from,
+        specifiers,
+        dependencies,
+        devDependencies,
+        optionalDependencies,
+    };
+}
+// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts#L241
+function mapValues(obj, mapper) {
+    const result = {};
+    for (const [key, value] of Object.entries(obj)) {
+        result[key] = mapper(value, key);
+    }
+    return result;
+}
+/*************************************************************************
+ * THE FOLLOWING CODE IS COPIED FROM @pnpm/types for convenience
+ *************************************************************************/
+// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/packages/types/src/misc.ts#L6
+const DEPENDENCIES_FIELDS = [
+    'optionalDependencies',
+    'dependencies',
+    'devDependencies',
+];
+/*************************************************************************
+ * THE FOLLOWING CODE IS COPIED FROM @pnpm/dependency-path for convenience
+ *************************************************************************/
+// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/packages/dependency-path/src/index.ts#L6
+function isAbsolute(dependencyPath) {
+    return dependencyPath[0] !== '/';
+}
+// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/packages/dependency-path/src/index.ts#L80
+function dpRefToRelative(reference, pkgName) {
+    if (reference.startsWith('link:')) {
+        return null;
+    }
+    if (reference.startsWith('file:')) {
+        return reference;
+    }
+    if (!reference.includes('/') ||
+        (reference.includes('(') &&
+            reference.lastIndexOf('/', reference.indexOf('(')) === -1)) {
+        return `/${pkgName}/${reference}`;
+    }
+    return reference;
+}
+// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/packages/dependency-path/src/index.ts#L96
+function dpParse(dependencyPath) {
+    // eslint-disable-next-line: strict-type-predicates
+    if (typeof dependencyPath !== 'string') {
+        throw new TypeError(`Expected \`dependencyPath\` to be of type \`string\`, got \`${
+        // eslint-disable-next-line: strict-type-predicates
+        dependencyPath === null ? 'null' : typeof dependencyPath}\``);
+    }
+    const _isAbsolute = isAbsolute(dependencyPath);
+    const parts = dependencyPath.split('/');
+    if (!_isAbsolute)
+        parts.shift();
+    const host = _isAbsolute ? parts.shift() : undefined;
+    if (parts.length === 0)
+        return {
+            host,
+            isAbsolute: _isAbsolute,
+        };
+    const name = parts[0].startsWith('@')
+        ? `${parts.shift()}/${parts.shift()}` // eslint-disable-line @typescript-eslint/restrict-template-expressions
+        : parts.shift();
+    let version = parts.join('/');
+    if (version) {
+        let peerSepIndex;
+        let peersSuffix;
+        if (version.includes('(') && version.endsWith(')')) {
+            peerSepIndex = version.indexOf('(');
+            if (peerSepIndex !== -1) {
+                peersSuffix = version.substring(peerSepIndex);
+                version = version.substring(0, peerSepIndex);
             }
-            else {
-                perf_hooks_1.performance.measure('total for sendMessageToDaemon()', 'sendMessageToDaemon-start', 'json-parse-end');
-                return this.currentResolve(parsedResult);
+        }
+        else {
+            peerSepIndex = version.indexOf('_');
+            if (peerSepIndex !== -1) {
+                peersSuffix = version.substring(peerSepIndex + 1);
+                version = version.substring(0, peerSepIndex);
             }
         }
-        catch (e) {
-            const endOfResponse = serializedResult.length > 300
-                ? serializedResult.substring(serializedResult.length - 300)
-                : serializedResult;
-            this.currentReject(daemonProcessException([
-                'Could not deserialize response from Nx daemon.',
-                `Message: ${e.message}`,
-                '\n',
-                `Received:`,
-                endOfResponse,
-                '\n',
-            ].join('\n')));
+        if ((0, semver_1.valid)(version)) {
+            return {
+                host,
+                isAbsolute: _isAbsolute,
+                name,
+                peersSuffix,
+                version,
+            };
         }
     }
-    async startInBackground() {
-        (0, fs_extra_1.ensureDirSync)(tmp_dir_1.DAEMON_DIR_FOR_CURRENT_WORKSPACE);
-        (0, fs_extra_1.ensureFileSync)(tmp_dir_1.DAEMON_OUTPUT_LOG_FILE);
-        this._out = await (0, promises_1.open)(tmp_dir_1.DAEMON_OUTPUT_LOG_FILE, 'a');
-        this._err = await (0, promises_1.open)(tmp_dir_1.DAEMON_OUTPUT_LOG_FILE, 'a');
-        const backgroundProcess = (0, child_process_1.spawn)(process.execPath, [(0, path_1.join)(__dirname, '../server/start.js')], {
-            cwd: workspace_root_1.workspaceRoot,
-            stdio: ['ignore', this._out.fd, this._err.fd],
-            detached: true,
-            windowsHide: true,
-            shell: false,
-            env: { ...process.env, ...DAEMON_ENV_SETTINGS },
-        });
-        backgroundProcess.unref();
-        /**
-         * Ensure the server is actually available to connect to via IPC before resolving
-         */
-        let attempts = 0;
-        return new Promise((resolve, reject) => {
-            const id = setInterval(async () => {
-                if (await this.isServerAvailable()) {
-                    clearInterval(id);
-                    resolve(backgroundProcess.pid);
+    if (!_isAbsolute)
+        throw new Error(`${dependencyPath} is an invalid relative dependency path`);
+    return {
+        host,
+        isAbsolute: _isAbsolute,
+    };
+}
+/********************************************************************************
+ * THE FOLLOWING CODE IS COPIED AND SIMPLIFIED FROM @pnpm/ramda for convenience
+ *******************************************************************************/
+// https://github.com/pnpm/ramda/blob/50c6b57110b2f3631ed8633141f12012b7768d85/source/pickBy.js#L24
+function pickBy(test, obj) {
+    let result = {};
+    for (const prop in obj) {
+        if (test(obj[prop])) {
+            result[prop] = obj[prop];
+        }
+    }
+    return result;
+}
+// https://github.com/pnpm/ramda/blob/50c6b57110b2f3631ed8633141f12012b7768d85/source/isEmpty.js#L28
+function isEmpty(obj) {
+    return obj != null && Object.keys(obj).length === 0;
+}
+
+
+/***/ }),
+
+/***/ 9998:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.stringifyYarnLockfile = exports.getYarnLockfileDependencies = exports.getYarnLockfileNodes = void 0;
+const package_json_1 = __nccwpck_require__(46876);
+const project_graph_builder_1 = __nccwpck_require__(47667);
+const semver_1 = __nccwpck_require__(11383);
+const project_graph_1 = __nccwpck_require__(72733);
+const file_hasher_1 = __nccwpck_require__(19482);
+const object_sort_1 = __nccwpck_require__(74150);
+let currentLockFileHash;
+let cachedParsedLockFile;
+// we use key => node map to avoid duplicate work when parsing keys
+let keyMap = new Map();
+function parseLockFile(lockFileContent, lockFileHash) {
+    if (currentLockFileHash === lockFileHash) {
+        return cachedParsedLockFile;
+    }
+    const { parseSyml } = __nccwpck_require__(22737);
+    keyMap.clear();
+    const result = parseSyml(lockFileContent);
+    cachedParsedLockFile = result;
+    currentLockFileHash = lockFileHash;
+    return result;
+}
+function getYarnLockfileNodes(lockFileContent, lockFileHash, packageJson) {
+    const { __metadata, ...dependencies } = parseLockFile(lockFileContent, lockFileHash);
+    const isBerry = !!__metadata;
+    // yarn classic splits keys when parsing so we need to stich them back together
+    const groupedDependencies = groupDependencies(dependencies, isBerry);
+    return getNodes(groupedDependencies, packageJson, keyMap, isBerry);
+}
+exports.getYarnLockfileNodes = getYarnLockfileNodes;
+function getYarnLockfileDependencies(lockFileContent, lockFileHash, ctx) {
+    const { __metadata, ...dependencies } = parseLockFile(lockFileContent, lockFileHash);
+    const isBerry = !!__metadata;
+    // yarn classic splits keys when parsing so we need to stich them back together
+    const groupedDependencies = groupDependencies(dependencies, isBerry);
+    return getDependencies(groupedDependencies, keyMap, ctx);
+}
+exports.getYarnLockfileDependencies = getYarnLockfileDependencies;
+function getPackageNameKeyPairs(keys) {
+    const result = new Map();
+    keys.split(', ').forEach((key) => {
+        const packageName = key.slice(0, key.indexOf('@', 1));
+        if (result.has(packageName)) {
+            result.get(packageName).add(key);
+        }
+        else {
+            result.set(packageName, new Set([key]));
+        }
+    });
+    return result;
+}
+function getNodes(dependencies, packageJson, keyMap, isBerry) {
+    const nodes = new Map();
+    const combinedDeps = {
+        ...packageJson.dependencies,
+        ...packageJson.devDependencies,
+        ...packageJson.peerDependencies,
+        ...packageJson.optionalDependencies,
+    };
+    Object.entries(dependencies).forEach(([keys, snapshot]) => {
+        // ignore workspace projects & patches
+        if (snapshot.linkType === 'soft' || keys.includes('@patch:')) {
+            return;
+        }
+        const nameKeyPairs = getPackageNameKeyPairs(keys);
+        nameKeyPairs.forEach((keySet, packageName) => {
+            const keysArray = Array.from(keySet);
+            // use key relevant to the package name
+            const version = findVersion(packageName, keysArray[0], snapshot, isBerry);
+            // use keys linked to the extracted package name
+            keysArray.forEach((key) => {
+                // we don't need to keep duplicates, we can just track the keys
+                const existingNode = nodes.get(packageName)?.get(version);
+                if (existingNode) {
+                    keyMap.set(key, existingNode);
+                    return;
                 }
-                else if (attempts > 6000) {
-                    // daemon fails to start, the process probably exited
-                    // we print the logs and exit the client
-                    reject(daemonProcessException('Failed to start or connect to the Nx Daemon process.'));
+                const node = {
+                    type: 'npm',
+                    name: version
+                        ? `npm:${packageName}@${version}`
+                        : `npm:${packageName}`,
+                    data: {
+                        version,
+                        packageName,
+                        hash: snapshot.integrity ||
+                            snapshot.checksum ||
+                            (0, file_hasher_1.hashArray)([packageName, version]),
+                    },
+                };
+                keyMap.set(key, node);
+                // use actual version so we can detect it later based on npm package's version
+                const mapKey = snapshot.version && version !== snapshot.version
+                    ? snapshot.version
+                    : version;
+                if (!nodes.has(packageName)) {
+                    nodes.set(packageName, new Map([[mapKey, node]]));
                 }
                 else {
-                    attempts++;
+                    nodes.get(packageName).set(mapKey, node);
                 }
-            }, 10);
-        });
-    }
-    async stop() {
-        try {
-            await (0, cache_1.safelyCleanUpExistingProcess)();
-        }
-        catch (err) {
-            output_1.output.error({
-                title: err?.message ||
-                    'Something unexpected went wrong when stopping the server',
             });
-        }
-        (0, tmp_dir_1.removeSocketDir)();
+        });
+    });
+    const externalNodes = {};
+    for (const [packageName, versionMap] of nodes.entries()) {
+        const hoistedNode = findHoistedNode(packageName, versionMap, combinedDeps);
+        if (hoistedNode) {
+            hoistedNode.name = `npm:${packageName}`;
+        }
+        versionMap.forEach((node) => {
+            externalNodes[node.name] = node;
+        });
     }
+    return externalNodes;
 }
-exports.DaemonClient = DaemonClient;
-exports.daemonClient = new DaemonClient((0, configuration_1.readNxJson)());
-function isDocker() {
+function findHoistedNode(packageName, versionMap, combinedDeps) {
+    const hoistedVersion = getHoistedVersion(packageName);
+    if (hoistedVersion) {
+        return versionMap.get(hoistedVersion);
+    }
+    const rootVersionSpecifier = combinedDeps[packageName];
+    if (!rootVersionSpecifier) {
+        return;
+    }
+    const versions = Array.from(versionMap.keys()).sort((a, b) => (0, semver_1.gt)(a, b) ? -1 : 1);
+    // take the highest version found
+    if (rootVersionSpecifier === '*') {
+        return versionMap.get(versions[0]);
+    }
+    // take version that satisfies the root version specifier
+    let version = versions.find((v) => (0, semver_1.satisfies)(v, rootVersionSpecifier));
+    if (!version) {
+        // try to find alias version
+        version = versions.find((v) => versionMap.get(v).name === `npm:${packageName}@${rootVersionSpecifier}`);
+    }
+    if (!version) {
+        // try to find tarball package
+        version = versions.find((v) => versionMap.get(v).data.version !== v);
+    }
+    if (version) {
+        return versionMap.get(version);
+    }
+}
+function findVersion(packageName, key, snapshot, isBerry) {
+    const versionRange = key.slice(key.indexOf('@', 1) + 1);
+    // check for alias packages
+    const isAlias = isBerry
+        ? snapshot.resolution && !snapshot.resolution.startsWith(`${packageName}@`)
+        : versionRange.startsWith('npm:');
+    if (isAlias) {
+        return versionRange;
+    }
+    // check for berry tarball packages
+    if (isBerry &&
+        snapshot.resolution &&
+        // different registry would yield suffix following '::' which we don't need
+        snapshot.resolution.split('::')[0] !==
+            `${packageName}@npm:${snapshot.version}`) {
+        return snapshot.resolution.slice(packageName.length + 1);
+    }
+    if (!isBerry && isTarballPackage(versionRange, snapshot)) {
+        return snapshot.resolved;
+    }
+    // otherwise it's a standard version
+    return snapshot.version;
+}
+// check if snapshot represents tarball package
+function isTarballPackage(versionRange, snapshot) {
+    // if resolved is missing it's internal link
+    if (!snapshot.resolved) {
+        return false;
+    }
+    // tarballs have no integrity
+    if (snapshot.integrity) {
+        return false;
+    }
     try {
-        (0, fs_1.statSync)('/.dockerenv');
-        return true;
+        new semver_1.Range(versionRange);
+        // range is a valid semver
+        return false;
     }
     catch {
-        try {
-            return (0, fs_1.readFileSync)('/proc/self/cgroup', 'utf8')?.includes('docker');
+        // range is not a valid semver, it can be an npm tag or url part of a tarball
+        return snapshot.version && !snapshot.resolved.includes(snapshot.version);
+    }
+}
+function getHoistedVersion(packageName) {
+    const version = (0, package_json_1.getHoistedPackageVersion)(packageName);
+    if (version) {
+        return version;
+    }
+}
+function getDependencies(dependencies, keyMap, ctx) {
+    const projectGraphDependencies = [];
+    Object.keys(dependencies).forEach((keys) => {
+        const snapshot = dependencies[keys];
+        keys.split(', ').forEach((key) => {
+            if (keyMap.has(key)) {
+                const node = keyMap.get(key);
+                [snapshot.dependencies, snapshot.optionalDependencies].forEach((section) => {
+                    if (section) {
+                        Object.entries(section).forEach(([name, versionRange]) => {
+                            const target = keyMap.get(`${name}@npm:${versionRange}`) ||
+                                keyMap.get(`${name}@${versionRange}`);
+                            if (target) {
+                                const dep = {
+                                    source: node.name,
+                                    target: target.name,
+                                    type: project_graph_1.DependencyType.static,
+                                };
+                                (0, project_graph_builder_1.validateDependency)(dep, ctx);
+                                projectGraphDependencies.push(dep);
+                            }
+                        });
+                    }
+                });
+            }
+        });
+    });
+    return projectGraphDependencies;
+}
+function stringifyYarnLockfile(graph, rootLockFileContent, packageJson) {
+    const { parseSyml, stringifySyml } = __nccwpck_require__(22737);
+    const { __metadata, ...dependencies } = parseSyml(rootLockFileContent);
+    const isBerry = !!__metadata;
+    const snapshots = mapSnapshots(dependencies, graph.externalNodes, packageJson, isBerry);
+    if (isBerry) {
+        // add root workspace package
+        const workspacePackage = generateRootWorkspacePackage(packageJson);
+        snapshots[workspacePackage.resolution] = workspacePackage;
+        return (BERRY_LOCK_FILE_DISCLAIMER +
+            stringifySyml({
+                __metadata,
+                ...(0, object_sort_1.sortObjectByKeys)(snapshots),
+            }));
+    }
+    else {
+        const { stringify } = __nccwpck_require__(70904);
+        return stringify((0, object_sort_1.sortObjectByKeys)(snapshots));
+    }
+}
+exports.stringifyYarnLockfile = stringifyYarnLockfile;
+function groupDependencies(dependencies, isBerry) {
+    if (isBerry) {
+        return dependencies;
+    }
+    let groupedDependencies;
+    const resolutionMap = new Map();
+    const snapshotMap = new Map();
+    Object.entries(dependencies).forEach(([key, snapshot]) => {
+        const resolutionKey = `${snapshot.resolved}${snapshot.integrity}`;
+        if (resolutionMap.has(resolutionKey)) {
+            const existingSnapshot = resolutionMap.get(resolutionKey);
+            snapshotMap.get(existingSnapshot).add(key);
         }
-        catch { }
-        return false;
+        else {
+            resolutionMap.set(resolutionKey, snapshot);
+            snapshotMap.set(snapshot, new Set([key]));
+        }
+    });
+    groupedDependencies = {};
+    snapshotMap.forEach((keys, snapshot) => {
+        groupedDependencies[Array.from(keys).join(', ')] = snapshot;
+    });
+    return groupedDependencies;
+}
+function addPackageVersion(packageName, version, collection, isBerry) {
+    if (!collection.has(packageName)) {
+        collection.set(packageName, new Set());
+    }
+    collection.get(packageName).add(`${packageName}@${version}`);
+    if (isBerry && !version.startsWith('npm:')) {
+        collection.get(packageName).add(`${packageName}@npm:${version}`);
+    }
+}
+function mapSnapshots(dependencies, nodes, packageJson, isBerry) {
+    // map snapshot to set of keys (e.g. `eslint@^7.0.0, eslint@npm:^7.0.0`)
+    const snapshotMap = new Map();
+    // track all existing dependencies's keys
+    const existingKeys = new Map();
+    const combinedDependencies = {
+        ...packageJson.dependencies,
+        ...packageJson.devDependencies,
+        ...packageJson.optionalDependencies,
+        ...packageJson.peerDependencies,
+    };
+    // yarn classic splits keys when parsing so we need to stich them back together
+    const groupedDependencies = groupDependencies(dependencies, isBerry);
+    // collect snapshots and their matching keys
+    Object.values(nodes).forEach((node) => {
+        const foundOriginalKeys = findOriginalKeys(groupedDependencies, node);
+        if (!foundOriginalKeys) {
+            throw new Error(`Original key(s) not found for "${node.data.packageName}@${node.data.version}" while pruning yarn.lock.`);
+        }
+        const [matchedKeys, snapshot] = foundOriginalKeys;
+        snapshotMap.set(snapshot, new Set(matchedKeys));
+        // separately save keys that still exist
+        [snapshot.dependencies, snapshot.optionalDependencies].forEach((section) => {
+            Object.entries(section || {}).forEach(([name, versionSpec]) => addPackageVersion(name, versionSpec, existingKeys, isBerry));
+        });
+        // add package.json requested version to keys
+        const requestedVersion = getPackageJsonVersion(combinedDependencies, node);
+        if (requestedVersion) {
+            addPackageVersion(node.data.packageName, requestedVersion, existingKeys, isBerry);
+            const requestedKey = isBerry
+                ? reverseMapBerryKey(node, requestedVersion, snapshot)
+                : `${node.data.packageName}@${requestedVersion}`;
+            if (!snapshotMap.get(snapshot).has(requestedKey)) {
+                snapshotMap.get(snapshot).add(requestedKey);
+            }
+        }
+        if (isBerry) {
+            // look for patched versions
+            const patch = findPatchedKeys(groupedDependencies, node);
+            if (patch) {
+                const [matchedKeys, snapshot] = patch;
+                snapshotMap.set(snapshot, new Set(matchedKeys));
+            }
+        }
+    });
+    // remove keys that match version ranges that have been pruned away
+    snapshotMap.forEach((snapshotValue, snapshotKey) => {
+        for (const key of snapshotValue.values()) {
+            const packageName = key.slice(0, key.indexOf('@', 1));
+            let normalizedKey = key;
+            if (isBerry && key.includes('@patch:') && key.includes('#')) {
+                normalizedKey = key
+                    .slice(0, key.indexOf('#'))
+                    .replace(`@patch:${packageName}@`, '@npm:');
+            }
+            if (!existingKeys.get(packageName) ||
+                !existingKeys.get(packageName).has(normalizedKey)) {
+                snapshotValue.delete(key);
+            }
+        }
+    });
+    // join mapped snapshots to lock json file
+    const result = {};
+    snapshotMap.forEach((keysSet, snapshot) => {
+        if (isBerry) {
+            result[Array.from(keysSet).sort().join(', ')] = snapshot;
+        }
+        else {
+            for (const key of keysSet.values()) {
+                result[key] = snapshot;
+            }
+        }
+    });
+    return result;
+}
+function reverseMapBerryKey(node, version, snapshot) {
+    // alias packages already have version
+    if (version.startsWith('npm:')) {
+        `${node.data.packageName}@${version}`;
     }
+    // check for berry tarball packages
+    if (snapshot.resolution &&
+        snapshot.resolution === `${node.data.packageName}@${version}`) {
+        return snapshot.resolution;
+    }
+    return `${node.data.packageName}@npm:${version}`;
 }
-function nxJsonIsNotPresent() {
-    return !(0, nx_json_1.hasNxJson)(workspace_root_1.workspaceRoot);
+function getPackageJsonVersion(combinedDependencies, node) {
+    const { packageName, version } = node.data;
+    if (combinedDependencies[packageName]) {
+        if (combinedDependencies[packageName] === version ||
+            (0, semver_1.satisfies)(version, combinedDependencies[packageName])) {
+            return combinedDependencies[packageName];
+        }
+    }
 }
-function daemonProcessException(message) {
-    try {
-        let log = (0, fs_1.readFileSync)(tmp_dir_1.DAEMON_OUTPUT_LOG_FILE).toString().split('\n');
-        if (log.length > 20) {
-            log = log.slice(log.length - 20);
+function findOriginalKeys(dependencies, node) {
+    for (const keyExpr of Object.keys(dependencies)) {
+        const snapshot = dependencies[keyExpr];
+        const keys = keyExpr.split(', ');
+        if (!keys.some((k) => k.startsWith(`${node.data.packageName}@`))) {
+            continue;
+        }
+        // standard package
+        if (snapshot.version === node.data.version) {
+            return [keys, snapshot];
+        }
+        // berry alias package
+        if (snapshot.resolution &&
+            `npm:${snapshot.resolution}` === node.data.version) {
+            return [keys, snapshot];
+        }
+        // classic alias
+        if (node.data.version.startsWith('npm:') &&
+            keys.some((k) => k === `${node.data.packageName}@${node.data.version}`)) {
+            return [keys, snapshot];
+        }
+        // tarball package
+        if (snapshot.resolved === node.data.version ||
+            snapshot.resolution === `${node.data.packageName}@${node.data.version}`) {
+            return [keys, snapshot];
         }
-        const error = new Error([
-            message,
-            '',
-            'Messages from the log:',
-            ...log,
-            '\n',
-            `More information: ${tmp_dir_1.DAEMON_OUTPUT_LOG_FILE}`,
-        ].join('\n'));
-        error.internalDaemonError = true;
-        return error;
     }
-    catch (e) {
-        return new Error(message);
+}
+function findPatchedKeys(dependencies, node) {
+    for (const keyExpr of Object.keys(dependencies)) {
+        const snapshot = dependencies[keyExpr];
+        const keys = keyExpr.split(', ');
+        if (!keys[0].startsWith(`${node.data.packageName}@patch:`)) {
+            continue;
+        }
+        // local patches are currently not supported
+        if (keys[0].includes('.yarn/patches')) {
+            continue;
+        }
+        if (snapshot.version === node.data.version) {
+            return [keys, snapshot];
+        }
     }
 }
+const BERRY_LOCK_FILE_DISCLAIMER = `# This file is generated by running "yarn install" inside your project.\n# Manual changes might be lost - proceed with caution!\n\n`;
+function generateRootWorkspacePackage(packageJson) {
+    return {
+        version: '0.0.0-use.local',
+        resolution: `${packageJson.name}@workspace:.`,
+        ...(packageJson.dependencies && { dependencies: packageJson.dependencies }),
+        ...(packageJson.peerDependencies && {
+            peerDependencies: packageJson.peerDependencies,
+        }),
+        ...(packageJson.devDependencies && {
+            devDependencies: packageJson.devDependencies,
+        }),
+        ...(packageJson.optionalDependencies && {
+            optionalDependencies: packageJson.optionalDependencies,
+        }),
+        languageName: 'unknown',
+        linkType: 'soft',
+    };
+}
 
 
 /***/ }),
 
-/***/ 1629:
+/***/ 98539:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.DaemonSocketMessenger = void 0;
-const consume_messages_from_socket_1 = __nccwpck_require__(6696);
-class DaemonSocketMessenger {
-    constructor(socket) {
-        this.socket = socket;
-    }
-    async sendMessage(messageToDaemon) {
-        this.socket.write(JSON.stringify(messageToDaemon));
-        // send EOT to indicate that the message has been fully written
-        this.socket.write(String.fromCodePoint(4));
-    }
-    listen(onData, onClose = () => { }, onError = (err) => { }) {
-        this.socket.on('data', (0, consume_messages_from_socket_1.consumeMessagesFromSocket)(async (message) => {
-            onData(message);
-        }));
-        this.socket.on('close', onClose);
-        this.socket.on('error', onError);
-        return this;
+exports.buildExplicitDependencies = void 0;
+const explicit_project_dependencies_1 = __nccwpck_require__(20145);
+const explicit_package_json_dependencies_1 = __nccwpck_require__(73532);
+function buildExplicitDependencies(jsPluginConfig, ctx) {
+    if (totalNumberOfFilesToProcess(ctx) === 0)
+        return [];
+    let dependencies = [];
+    if (jsPluginConfig.analyzeSourceFiles === undefined ||
+        jsPluginConfig.analyzeSourceFiles === true) {
+        let tsExists = false;
+        try {
+            __nccwpck_require__.ab + "typescript.js"
+            tsExists = true;
+        }
+        catch { }
+        if (tsExists) {
+            dependencies = dependencies.concat((0, explicit_project_dependencies_1.buildExplicitTypeScriptDependencies)(ctx));
+        }
     }
-    close() {
-        this.socket.destroy();
+    if (jsPluginConfig.analyzePackageJson === undefined ||
+        jsPluginConfig.analyzePackageJson === true) {
+        dependencies = dependencies.concat((0, explicit_package_json_dependencies_1.buildExplicitPackageJsonDependencies)(ctx));
     }
+    return dependencies;
+}
+exports.buildExplicitDependencies = buildExplicitDependencies;
+function totalNumberOfFilesToProcess(ctx) {
+    let totalNumOfFilesToProcess = 0;
+    Object.values(ctx.filesToProcess.projectFileMap).forEach((t) => (totalNumOfFilesToProcess += t.length));
+    return totalNumOfFilesToProcess;
 }
-exports.DaemonSocketMessenger = DaemonSocketMessenger;
 
 
 /***/ }),
 
-/***/ 8935:
+/***/ 73532:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.serializeResult = exports.killSocketOrPath = exports.FORKED_PROCESS_OS_SOCKET_PATH = exports.FULL_OS_SOCKET_PATH = exports.isWindows = void 0;
-const fs_1 = __nccwpck_require__(7147);
-const os_1 = __nccwpck_require__(2037);
-const path_1 = __nccwpck_require__(1017);
-const tmp_dir_1 = __nccwpck_require__(1524);
-const serializable_error_1 = __nccwpck_require__(9268);
-exports.isWindows = (0, os_1.platform)() === 'win32';
-/**
- * For IPC with the daemon server we use unix sockets or windows named pipes, depending on the user's operating system.
- *
- * See https://nodejs.org/dist/latest-v14.x/docs/api/net.html#net_identifying_paths_for_ipc_connections for a full breakdown
- * of OS differences between Unix domain sockets and named pipes.
- */
-exports.FULL_OS_SOCKET_PATH = exports.isWindows
-    ? '\\\\.\\pipe\\nx\\' + (0, path_1.resolve)(tmp_dir_1.DAEMON_SOCKET_PATH)
-    : (0, path_1.resolve)(tmp_dir_1.DAEMON_SOCKET_PATH);
-const FORKED_PROCESS_OS_SOCKET_PATH = (id) => {
-    let path = (0, path_1.resolve)((0, path_1.join)(tmp_dir_1.socketDir, 'fp' + id + '.sock'));
-    return exports.isWindows ? '\\\\.\\pipe\\nx\\' + (0, path_1.resolve)(path) : (0, path_1.resolve)(path);
-};
-exports.FORKED_PROCESS_OS_SOCKET_PATH = FORKED_PROCESS_OS_SOCKET_PATH;
-function killSocketOrPath() {
+exports.buildExplicitPackageJsonDependencies = void 0;
+const file_utils_1 = __nccwpck_require__(89294);
+const path_1 = __nccwpck_require__(71017);
+const project_graph_1 = __nccwpck_require__(72733);
+const json_1 = __nccwpck_require__(54324);
+const path_2 = __nccwpck_require__(41559);
+const project_graph_builder_1 = __nccwpck_require__(47667);
+function buildExplicitPackageJsonDependencies(ctx) {
+    const res = [];
+    let packageNameMap = undefined;
+    const nodes = Object.values(ctx.projects);
+    Object.keys(ctx.filesToProcess.projectFileMap).forEach((source) => {
+        Object.values(ctx.filesToProcess.projectFileMap[source]).forEach((f) => {
+            if (isPackageJsonAtProjectRoot(nodes, f.file)) {
+                // we only create the package name map once and only if a package.json file changes
+                packageNameMap = packageNameMap || createPackageNameMap(ctx.projects);
+                processPackageJson(source, f.file, ctx, res, packageNameMap);
+            }
+        });
+    });
+    return res;
+}
+exports.buildExplicitPackageJsonDependencies = buildExplicitPackageJsonDependencies;
+function createPackageNameMap(projects) {
+    const res = {};
+    for (let projectName of Object.keys(projects)) {
+        try {
+            const packageJson = (0, json_1.parseJson)((0, file_utils_1.defaultFileRead)((0, path_1.join)(projects[projectName].root, 'package.json')));
+            res[packageJson.name ?? projectName] = projectName;
+        }
+        catch (e) { }
+    }
+    return res;
+}
+function isPackageJsonAtProjectRoot(nodes, fileName) {
+    return (fileName.endsWith('package.json') &&
+        nodes.find((projectNode) => (0, path_2.joinPathFragments)(projectNode.root, 'package.json') === fileName));
+}
+function processPackageJson(sourceProject, fileName, ctx, collectedDeps, packageNameMap) {
     try {
-        (0, fs_1.unlinkSync)(exports.FULL_OS_SOCKET_PATH);
+        const deps = readDeps((0, json_1.parseJson)((0, file_utils_1.defaultFileRead)(fileName)));
+        // the name matches the import path
+        deps.forEach((d) => {
+            // package.json refers to another project in the monorepo
+            if (packageNameMap[d]) {
+                const dependency = {
+                    source: sourceProject,
+                    target: packageNameMap[d],
+                    sourceFile: fileName,
+                    type: project_graph_1.DependencyType.static,
+                };
+                (0, project_graph_builder_1.validateDependency)(dependency, ctx);
+                collectedDeps.push(dependency);
+            }
+            else if (ctx.externalNodes[`npm:${d}`]) {
+                const dependency = {
+                    source: sourceProject,
+                    target: `npm:${d}`,
+                    sourceFile: fileName,
+                    type: project_graph_1.DependencyType.static,
+                };
+                (0, project_graph_builder_1.validateDependency)(dependency, ctx);
+                collectedDeps.push(dependency);
+            }
+        });
+    }
+    catch (e) {
+        if (process.env.NX_VERBOSE_LOGGING === 'true') {
+            console.log(e);
+        }
     }
-    catch { }
 }
-exports.killSocketOrPath = killSocketOrPath;
-// Prepare a serialized project graph result for sending over IPC from the server to the client
-function serializeResult(error, serializedProjectGraph, serializedSourceMaps) {
-    // We do not want to repeat work `JSON.stringify`ing an object containing the potentially large project graph so merge as strings
-    return `{ "error": ${JSON.stringify(error ? (0, serializable_error_1.createSerializableError)(error) : error)}, "projectGraph": ${serializedProjectGraph}, "sourceMaps": ${serializedSourceMaps} }`;
+function readDeps(packageJson) {
+    return [
+        ...Object.keys(packageJson?.dependencies ?? {}),
+        ...Object.keys(packageJson?.devDependencies ?? {}),
+        ...Object.keys(packageJson?.peerDependencies ?? {}),
+        ...Object.keys(packageJson?.optionalDependencies ?? {}),
+    ];
 }
-exports.serializeResult = serializeResult;
 
 
 /***/ }),
 
-/***/ 1524:
+/***/ 20145:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.removeSocketDir = exports.isDaemonDisabled = exports.markDaemonAsDisabled = exports.writeDaemonLogs = exports.DAEMON_SOCKET_PATH = exports.socketDir = exports.DAEMON_OUTPUT_LOG_FILE = exports.DAEMON_DIR_FOR_CURRENT_WORKSPACE = void 0;
-/**
- * Per workspace (to avoid subtle differences and issues), we want to have a deterministic
- * location within the OS's tmp directory where we write log files for background processes
- * and where we create the actual unix socket/named pipe for the daemon.
- */
-const fs_1 = __nccwpck_require__(7147);
-const fs_extra_1 = __nccwpck_require__(2103);
-const path_1 = __nccwpck_require__(1017);
-const cache_directory_1 = __nccwpck_require__(1622);
-const crypto_1 = __nccwpck_require__(6113);
-const tmp_1 = __nccwpck_require__(8517);
-const workspace_root_1 = __nccwpck_require__(4393);
-exports.DAEMON_DIR_FOR_CURRENT_WORKSPACE = (0, path_1.join)(cache_directory_1.projectGraphCacheDirectory, 'd');
-exports.DAEMON_OUTPUT_LOG_FILE = (0, path_1.join)(exports.DAEMON_DIR_FOR_CURRENT_WORKSPACE, 'daemon.log');
-exports.socketDir = process.env.NX_DAEMON_SOCKET_DIR || createSocketDir();
-exports.DAEMON_SOCKET_PATH = (0, path_1.join)(exports.socketDir, 
-// As per notes above on socket/named pipe length limitations, we keep this intentionally short
-'d.sock');
-function writeDaemonLogs(error) {
-    const file = (0, path_1.join)(exports.DAEMON_DIR_FOR_CURRENT_WORKSPACE, 'daemon-error.log');
-    (0, fs_1.writeFileSync)(file, error);
-    return file;
-}
-exports.writeDaemonLogs = writeDaemonLogs;
-function markDaemonAsDisabled() {
-    (0, fs_1.writeFileSync)((0, path_1.join)(exports.DAEMON_DIR_FOR_CURRENT_WORKSPACE, 'disabled'), 'true');
+exports.buildExplicitTypeScriptDependencies = void 0;
+const target_project_locator_1 = __nccwpck_require__(1018);
+const project_graph_1 = __nccwpck_require__(72733);
+const path_1 = __nccwpck_require__(71017);
+const workspace_root_1 = __nccwpck_require__(64393);
+const path_2 = __nccwpck_require__(41559);
+const project_graph_builder_1 = __nccwpck_require__(47667);
+function isRoot(projects, projectName) {
+    return projects[projectName]?.root === '.';
+}
+function convertImportToDependency(importExpr, sourceFile, source, type, targetProjectLocator) {
+    const target = targetProjectLocator.findProjectWithImport(importExpr, sourceFile) ??
+        `npm:${importExpr}`;
+    return {
+        source,
+        target,
+        sourceFile,
+        type,
+    };
 }
-exports.markDaemonAsDisabled = markDaemonAsDisabled;
-function isDaemonDisabled() {
-    try {
-        (0, fs_1.statSync)((0, path_1.join)(exports.DAEMON_DIR_FOR_CURRENT_WORKSPACE, 'disabled'));
-        return true;
-    }
-    catch (e) {
-        return false;
+function buildExplicitTypeScriptDependencies(ctx) {
+    // TODO: TargetProjectLocator is a public API, so we can't change the shape of it
+    // We should eventually let it accept Record s.t. we
+    // don't have to reshape the CreateDependenciesContext here.
+    const nodes = Object.fromEntries(Object.entries(ctx.projects).map(([key, config]) => [
+        key,
+        {
+            name: key,
+            type: null,
+            data: config,
+        },
+    ]));
+    const targetProjectLocator = new target_project_locator_1.TargetProjectLocator(nodes, ctx.externalNodes);
+    const res = [];
+    const filesToProcess = {};
+    const moduleExtensions = [
+        '.ts',
+        '.js',
+        '.tsx',
+        '.jsx',
+        '.mts',
+        '.mjs',
+        '.cjs',
+        '.cts',
+    ];
+    // TODO: This can be removed when vue is stable
+    if (isVuePluginInstalled()) {
+        moduleExtensions.push('.vue');
     }
-}
-exports.isDaemonDisabled = isDaemonDisabled;
-function socketDirName() {
-    const hasher = (0, crypto_1.createHash)('sha256');
-    hasher.update(workspace_root_1.workspaceRoot.toLowerCase());
-    const unique = hasher.digest('hex').substring(0, 20);
-    return (0, path_1.join)(tmp_1.tmpdir, unique);
-}
-/**
- * We try to create a socket file in a tmp dir, but if it doesn't work because
- * for instance we don't have permissions, we create it in DAEMON_DIR_FOR_CURRENT_WORKSPACE
- */
-function createSocketDir() {
-    try {
-        const dir = socketDirName();
-        (0, fs_extra_1.ensureDirSync)(dir);
-        return dir;
+    for (const [project, fileData] of Object.entries(ctx.fileMap.projectFileMap)) {
+        filesToProcess[project] ??= [];
+        for (const { file } of fileData) {
+            if (moduleExtensions.some((ext) => file.endsWith(ext))) {
+                filesToProcess[project].push((0, path_1.join)(workspace_root_1.workspaceRoot, file));
+            }
+        }
     }
-    catch (e) {
-        return exports.DAEMON_DIR_FOR_CURRENT_WORKSPACE;
+    const { findImports } = __nccwpck_require__(71926);
+    const imports = findImports(filesToProcess);
+    for (const { sourceProject, file, staticImportExpressions, dynamicImportExpressions, } of imports) {
+        const normalizedFilePath = (0, path_2.normalizePath)((0, path_1.relative)(workspace_root_1.workspaceRoot, file));
+        for (const importExpr of staticImportExpressions) {
+            const dependency = convertImportToDependency(importExpr, normalizedFilePath, sourceProject, project_graph_1.DependencyType.static, targetProjectLocator);
+            // TODO: These edges technically should be allowed but we need to figure out how to separate config files out from root
+            if (isRoot(ctx.projects, dependency.source) ||
+                !isRoot(ctx.projects, dependency.target)) {
+                res.push(dependency);
+            }
+        }
+        for (const importExpr of dynamicImportExpressions) {
+            const dependency = convertImportToDependency(importExpr, normalizedFilePath, sourceProject, project_graph_1.DependencyType.dynamic, targetProjectLocator);
+            // TODO: These edges technically should be allowed but we need to figure out how to separate config files out from root
+            if (isRoot(ctx.projects, dependency.source) ||
+                !isRoot(ctx.projects, dependency.target)) {
+                (0, project_graph_builder_1.validateDependency)(dependency, ctx);
+                res.push(dependency);
+            }
+        }
     }
+    return res;
 }
-function removeSocketDir() {
+exports.buildExplicitTypeScriptDependencies = buildExplicitTypeScriptDependencies;
+function isVuePluginInstalled() {
     try {
-        (0, fs_extra_1.rmSync)(exports.socketDir, { recursive: true, force: true });
+        // nx-ignore-next-line
+        /*require.resolve*/(10420);
+        return true;
+    }
+    catch {
+        return false;
     }
-    catch (e) { }
 }
-exports.removeSocketDir = removeSocketDir;
 
 
 /***/ }),
 
-/***/ 1926:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+/***/ 1018:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
-const { join, basename } = __nccwpck_require__(1017);
-const { copyFileSync, existsSync, mkdirSync } = __nccwpck_require__(7147);
-const Module = __nccwpck_require__(8188);
-const { nxVersion } = __nccwpck_require__(780);
-const { cacheDir } = __nccwpck_require__(1622);
+"use strict";
 
-const nxPackages = new Set([
-  '@nx/nx-android-arm64',
-  '@nx/nx-android-arm-eabi',
-  '@nx/nx-win32-x64-msvc',
-  '@nx/nx-win32-ia32-msvc',
-  '@nx/nx-win32-arm64-msvc',
-  '@nx/nx-darwin-universal',
-  '@nx/nx-darwin-x64',
-  '@nx/nx-darwin-arm64',
-  '@nx/nx-freebsd-x64',
-  '@nx/nx-linux-x64-musl',
-  '@nx/nx-linux-x64-gnu',
-  '@nx/nx-linux-arm64-musl',
-  '@nx/nx-linux-arm64-gnu',
-  '@nx/nx-linux-arm-gnueabihf',
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.TargetProjectLocator = void 0;
+const typescript_1 = __nccwpck_require__(32602);
+const fileutils_1 = __nccwpck_require__(40910);
+const path_1 = __nccwpck_require__(71017);
+const workspace_root_1 = __nccwpck_require__(64393);
+const module_1 = __nccwpck_require__(98188);
+const find_project_for_path_1 = __nccwpck_require__(69621);
+const builtInModuleSet = new Set([
+    ...module_1.builtinModules,
+    ...module_1.builtinModules.map((x) => `node:${x}`),
 ]);
-
-const localNodeFiles = [
-  'nx.android-arm64.node',
-  'nx.android-arm-eabi.node',
-  'nx.win32-x64-msvc.node',
-  'nx.win32-ia32-msvc.node',
-  'nx.win32-arm64-msvc.node',
-  'nx.darwin-universal.node',
-  'nx.darwin-x64.node',
-  'nx.darwin-arm64.node',
-  'nx.freebsd-x64.node',
-  'nx.linux-x64-musl.node',
-  'nx.linux-x64-gnu.node',
-  'nx.linux-arm64-musl.node',
-  'nx.linux-arm64-gnu.node',
-  'nx.linux-arm-gnueabihf.node',
-];
-
-const originalLoad = Module._load;
-
-// We override the _load function so that when a native file is required,
-// we copy it to a cache directory and require it from there.
-// This prevents the file being loaded from node_modules and causing file locking issues.
-// Will only be called once because the require cache takes over afterwards.
-Module._load = function (request, parent, isMain) {
-  const modulePath = request;
-  if (
-    nxPackages.has(modulePath) ||
-    localNodeFiles.some((f) => modulePath.endsWith(f))
-  ) {
-    const nativeLocation = require.resolve(modulePath);
-    const fileName = basename(nativeLocation);
-    // we copy the file to the cache directory (.nx/cache by default) and prefix with nxVersion to avoid stale files being loaded
-    const tmpFile = join(cacheDir, nxVersion + '-' + fileName);
-    if (existsSync(tmpFile)) {
-      return originalLoad.apply(this, [tmpFile, parent, isMain]);
-    }
-    if (!existsSync(cacheDir)) {
-      mkdirSync(cacheDir, { recursive: true });
-    }
-    copyFileSync(nativeLocation, tmpFile);
-    return originalLoad.apply(this, [tmpFile, parent, isMain]);
-  } else {
-    // call the original _load function for everything else
-    return originalLoad.apply(this, arguments);
-  }
-};
-
-const indexModulePath = __nccwpck_require__.ab + "native-bindings.js";
-delete require.cache[__nccwpck_require__.ab + "native-bindings.js"];
-const indexModule = __nccwpck_require__(5550);
-
-module.exports = indexModule;
-Module._load = originalLoad;
-
-
-/***/ }),
-
-/***/ 5550:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-const { existsSync, readFileSync } = __nccwpck_require__(7147)
-const { join } = __nccwpck_require__(1017)
-
-const { platform, arch } = process
-
-let nativeBinding = null
-let localFileExisted = false
-let loadError = null
-
-function isMusl() {
-  // For Node 10
-  if (!process.report || typeof process.report.getReport !== 'function') {
-    try {
-      const lddPath = (__nccwpck_require__(8493).execSync)('which ldd').toString().trim();
-      return readFileSync(lddPath, 'utf8').includes('musl')
-    } catch (e) {
-      return true
+class TargetProjectLocator {
+    constructor(nodes, externalNodes) {
+        this.nodes = nodes;
+        this.externalNodes = externalNodes;
+        this.projectRootMappings = (0, find_project_for_path_1.createProjectRootMappings)(this.nodes);
+        this.npmProjects = filterRootExternalDependencies(this.externalNodes);
+        this.tsConfig = this.getRootTsConfig();
+        this.paths = this.tsConfig.config?.compilerOptions?.paths;
+        this.typescriptResolutionCache = new Map();
+        this.npmResolutionCache = new Map();
     }
-  } else {
-    const { glibcVersionRuntime } = process.report.getReport().header
-    return !glibcVersionRuntime
-  }
-}
-
-switch (platform) {
-  case 'android':
-    switch (arch) {
-      case 'arm64':
-        localFileExisted = existsSync(join(__dirname, 'nx.android-arm64.node'))
-        try {
-          if (localFileExisted) {
-            nativeBinding = __nccwpck_require__(9706)
-          } else {
-            nativeBinding = __nccwpck_require__(9409)
-          }
-        } catch (e) {
-          loadError = e
+    /**
+     * Find a project based on its import
+     *
+     * @param importExpr
+     * @param filePath
+     */
+    findProjectWithImport(importExpr, filePath) {
+        if ((0, fileutils_1.isRelativePath)(importExpr)) {
+            const resolvedModule = path_1.posix.join((0, path_1.dirname)(filePath), importExpr);
+            return this.findProjectOfResolvedModule(resolvedModule);
+        }
+        // find project using tsconfig paths
+        const results = this.findPaths(importExpr);
+        if (results) {
+            const [path, paths] = results;
+            for (let p of paths) {
+                const r = p.endsWith('/*')
+                    ? (0, path_1.join)((0, path_1.dirname)(p), (0, path_1.relative)(path.replace(/\*$/, ''), importExpr))
+                    : p;
+                const maybeResolvedProject = this.findProjectOfResolvedModule(r);
+                if (maybeResolvedProject) {
+                    return maybeResolvedProject;
+                }
+            }
         }
-        break
-      case 'arm':
-        localFileExisted = existsSync(join(__dirname, 'nx.android-arm-eabi.node'))
-        try {
-          if (localFileExisted) {
-            nativeBinding = __nccwpck_require__(2695)
-          } else {
-            nativeBinding = __nccwpck_require__(952)
-          }
-        } catch (e) {
-          loadError = e
+        if (builtInModuleSet.has(importExpr)) {
+            this.npmResolutionCache.set(importExpr, null);
+            return null;
         }
-        break
-      default:
-        throw new Error(`Unsupported architecture on Android ${arch}`)
-    }
-    break
-  case 'win32':
-    switch (arch) {
-      case 'x64':
-        localFileExisted = existsSync(
-          join(__dirname, 'nx.win32-x64-msvc.node')
-        )
-        try {
-          if (localFileExisted) {
-            nativeBinding = __nccwpck_require__(155)
-          } else {
-            nativeBinding = __nccwpck_require__(2309)
-          }
-        } catch (e) {
-          loadError = e
+        // try to find npm package before using expensive typescript resolution
+        const npmProject = this.findNpmPackage(importExpr);
+        if (npmProject) {
+            return npmProject;
         }
-        break
-      case 'ia32':
-        localFileExisted = existsSync(
-          join(__dirname, 'nx.win32-ia32-msvc.node')
-        )
-        try {
-          if (localFileExisted) {
-            nativeBinding = __nccwpck_require__(7077)
-          } else {
-            nativeBinding = __nccwpck_require__(1934)
-          }
-        } catch (e) {
-          loadError = e
+        if (this.tsConfig.config) {
+            // TODO(meeroslav): this block is probably obsolete
+            // and existed only because of the incomplete `paths` matching
+            // if import cannot be matched using tsconfig `paths` the compilation would fail anyway
+            const resolvedProject = this.resolveImportWithTypescript(importExpr, filePath);
+            if (resolvedProject) {
+                return resolvedProject;
+            }
         }
-        break
-      case 'arm64':
-        localFileExisted = existsSync(
-          join(__dirname, 'nx.win32-arm64-msvc.node')
-        )
         try {
-          if (localFileExisted) {
-            nativeBinding = __nccwpck_require__(1722)
-          } else {
-            nativeBinding = __nccwpck_require__(8468)
-          }
-        } catch (e) {
-          loadError = e
+            const resolvedModule = this.resolveImportWithRequire(importExpr, filePath);
+            return this.findProjectOfResolvedModule(resolvedModule);
         }
-        break
-      default:
-        throw new Error(`Unsupported architecture on Windows: ${arch}`)
+        catch { }
+        // nothing found, cache for later
+        this.npmResolutionCache.set(importExpr, null);
+        return null;
     }
-    break
-  case 'darwin':
-    localFileExisted = existsSync(join(__dirname, 'nx.darwin-universal.node'))
-    try {
-      if (localFileExisted) {
-        nativeBinding = __nccwpck_require__(9697)
-      } else {
-        nativeBinding = __nccwpck_require__(2446)
-      }
-      break
-    } catch {}
-    switch (arch) {
-      case 'x64':
-        localFileExisted = existsSync(join(__dirname, 'nx.darwin-x64.node'))
-        try {
-          if (localFileExisted) {
-            nativeBinding = __nccwpck_require__(1715)
-          } else {
-            nativeBinding = __nccwpck_require__(3629)
-          }
-        } catch (e) {
-          loadError = e
+    /**
+     * Return file paths matching the import relative to the repo root
+     * @param normalizedImportExpr
+     * @returns
+     */
+    findPaths(normalizedImportExpr) {
+        if (!this.paths) {
+            return undefined;
         }
-        break
-      case 'arm64':
-        localFileExisted = existsSync(
-          join(__dirname, 'nx.darwin-arm64.node')
-        )
-        try {
-          if (localFileExisted) {
-            nativeBinding = __nccwpck_require__(3449)
-          } else {
-            nativeBinding = __nccwpck_require__(2353)
-          }
-        } catch (e) {
-          loadError = e
+        if (this.paths[normalizedImportExpr]) {
+            return [normalizedImportExpr, this.paths[normalizedImportExpr]];
         }
-        break
-      default:
-        throw new Error(`Unsupported architecture on macOS: ${arch}`)
+        const wildcardPath = Object.keys(this.paths).find((path) => path.endsWith('/*') &&
+            (normalizedImportExpr.startsWith(path.replace(/\*$/, '')) ||
+                normalizedImportExpr === path.replace(/\/\*$/, '')));
+        if (wildcardPath) {
+            return [wildcardPath, this.paths[wildcardPath]];
+        }
+        return undefined;
     }
-    break
-  case 'freebsd':
-    if (arch !== 'x64') {
-      throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
+    resolveImportWithTypescript(normalizedImportExpr, filePath) {
+        let resolvedModule;
+        if (this.typescriptResolutionCache.has(normalizedImportExpr)) {
+            resolvedModule = this.typescriptResolutionCache.get(normalizedImportExpr);
+        }
+        else {
+            resolvedModule = (0, typescript_1.resolveModuleByImport)(normalizedImportExpr, filePath, this.tsConfig.absolutePath);
+            this.typescriptResolutionCache.set(normalizedImportExpr, resolvedModule ? resolvedModule : null);
+        }
+        // TODO: vsavkin temporary workaround. Remove it once we reworking handling of npm packages.
+        if (resolvedModule && resolvedModule.indexOf('node_modules/') === -1) {
+            const resolvedProject = this.findProjectOfResolvedModule(resolvedModule);
+            if (resolvedProject) {
+                return resolvedProject;
+            }
+        }
+        return;
     }
-    localFileExisted = existsSync(join(__dirname, 'nx.freebsd-x64.node'))
-    try {
-      if (localFileExisted) {
-        nativeBinding = __nccwpck_require__(5319)
-      } else {
-        nativeBinding = __nccwpck_require__(3163)
-      }
-    } catch (e) {
-      loadError = e
+    resolveImportWithRequire(normalizedImportExpr, filePath) {
+        return path_1.posix.relative(workspace_root_1.workspaceRoot, require.resolve(normalizedImportExpr, {
+            paths: [(0, path_1.dirname)(filePath)],
+        }));
     }
-    break
-  case 'linux':
-    switch (arch) {
-      case 'x64':
-        if (isMusl()) {
-          localFileExisted = existsSync(
-            join(__dirname, 'nx.linux-x64-musl.node')
-          )
-          try {
-            if (localFileExisted) {
-              nativeBinding = __nccwpck_require__(497)
-            } else {
-              nativeBinding = __nccwpck_require__(6272)
-            }
-          } catch (e) {
-            loadError = e
-          }
-        } else {
-          localFileExisted = existsSync(
-            join(__dirname, 'nx.linux-x64-gnu.node')
-          )
-          try {
-            if (localFileExisted) {
-              nativeBinding = __nccwpck_require__(4000)
-            } else {
-              nativeBinding = __nccwpck_require__(3471)
-            }
-          } catch (e) {
-            loadError = e
-          }
+    findNpmPackage(npmImport) {
+        if (this.npmResolutionCache.has(npmImport)) {
+            return this.npmResolutionCache.get(npmImport);
         }
-        break
-      case 'arm64':
-        if (isMusl()) {
-          localFileExisted = existsSync(
-            join(__dirname, 'nx.linux-arm64-musl.node')
-          )
-          try {
-            if (localFileExisted) {
-              nativeBinding = __nccwpck_require__(2282)
-            } else {
-              nativeBinding = __nccwpck_require__(7052)
-            }
-          } catch (e) {
-            loadError = e
-          }
-        } else {
-          localFileExisted = existsSync(
-            join(__dirname, 'nx.linux-arm64-gnu.node')
-          )
-          try {
-            if (localFileExisted) {
-              nativeBinding = __nccwpck_require__(8032)
-            } else {
-              nativeBinding = __nccwpck_require__(7652)
+        else {
+            const pkg = this.npmProjects.find((pkg) => npmImport === pkg.data.packageName ||
+                npmImport.startsWith(`${pkg.data.packageName}/`));
+            if (pkg) {
+                this.npmResolutionCache.set(npmImport, pkg.name);
+                return pkg.name;
             }
-          } catch (e) {
-            loadError = e
-          }
         }
-        break
-      case 'arm':
-        localFileExisted = existsSync(
-          join(__dirname, 'nx.linux-arm-gnueabihf.node')
-        )
-        try {
-          if (localFileExisted) {
-            nativeBinding = __nccwpck_require__(7982)
-          } else {
-            nativeBinding = __nccwpck_require__(8834)
-          }
-        } catch (e) {
-          loadError = e
+    }
+    findProjectOfResolvedModule(resolvedModule) {
+        if (resolvedModule.startsWith('node_modules/') ||
+            resolvedModule.includes('/node_modules/')) {
+            return undefined;
         }
-        break
-      default:
-        throw new Error(`Unsupported architecture on Linux: ${arch}`)
+        const normalizedResolvedModule = resolvedModule.startsWith('./')
+            ? resolvedModule.substring(2)
+            : resolvedModule;
+        const importedProject = this.findMatchingProjectFiles(normalizedResolvedModule);
+        return importedProject ? importedProject.name : void 0;
+    }
+    getAbsolutePath(path) {
+        return (0, path_1.join)(workspace_root_1.workspaceRoot, path);
+    }
+    getRootTsConfig() {
+        const path = (0, typescript_1.getRootTsConfigFileName)();
+        if (!path) {
+            return {
+                path: null,
+                absolutePath: null,
+                config: null,
+            };
+        }
+        const absolutePath = this.getAbsolutePath(path);
+        return {
+            absolutePath,
+            path,
+            config: (0, fileutils_1.readJsonFile)(absolutePath),
+        };
+    }
+    findMatchingProjectFiles(file) {
+        const project = (0, find_project_for_path_1.findProjectForPath)(file, this.projectRootMappings);
+        return this.nodes[project];
     }
-    break
-  default:
-    throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`)
 }
-
-if (!nativeBinding) {
-  if (loadError) {
-    throw loadError
-  }
-  throw new Error(`Failed to load native binding`)
+exports.TargetProjectLocator = TargetProjectLocator;
+// matches `npm:@scope/name`, `npm:name` but not `npm:@scope/name@version` and `npm:name@version`
+const ROOT_VERSION_PACKAGE_NAME_REGEX = /^npm:(?!.+@.+)/;
+function filterRootExternalDependencies(externalNodes) {
+    if (!externalNodes) {
+        return [];
+    }
+    const keys = Object.keys(externalNodes);
+    const nodes = [];
+    for (let i = 0; i < keys.length; i++) {
+        if (keys[i].match(ROOT_VERSION_PACKAGE_NAME_REGEX)) {
+            nodes.push(externalNodes[keys[i]]);
+        }
+    }
+    return nodes;
 }
 
-const { expandOutputs, getFilesForOutputs, remove, copy, hashArray, hashFile, ImportResult, findImports, transferProjectGraph, ChildProcess, RustPseudoTerminal, HashPlanner, TaskHasher, EventType, Watcher, WorkspaceContext, WorkspaceErrors, testOnlyTransferFileMap } = nativeBinding
 
-module.exports.expandOutputs = expandOutputs
-module.exports.getFilesForOutputs = getFilesForOutputs
-module.exports.remove = remove
-module.exports.copy = copy
-module.exports.hashArray = hashArray
-module.exports.hashFile = hashFile
-module.exports.ImportResult = ImportResult
-module.exports.findImports = findImports
-module.exports.transferProjectGraph = transferProjectGraph
-module.exports.ChildProcess = ChildProcess
-module.exports.RustPseudoTerminal = RustPseudoTerminal
-module.exports.HashPlanner = HashPlanner
-module.exports.TaskHasher = TaskHasher
-module.exports.EventType = EventType
-module.exports.Watcher = Watcher
-module.exports.WorkspaceContext = WorkspaceContext
-module.exports.WorkspaceErrors = WorkspaceErrors
-module.exports.testOnlyTransferFileMap = testOnlyTransferFileMap
+/***/ }),
+
+/***/ 60244:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.jsPluginConfig = void 0;
+const node_path_1 = __nccwpck_require__(49411);
+const fileutils_1 = __nccwpck_require__(40910);
+const workspace_root_1 = __nccwpck_require__(64393);
+const fs_1 = __nccwpck_require__(57147);
+function jsPluginConfig(nxJson) {
+    const nxJsonConfig = nxJson?.pluginsConfig?.['@nx/js'] ?? nxJson?.pluginsConfig?.['@nrwl/js'];
+    // using lerna _before_ installing deps is causing an issue when parsing lockfile.
+    // See: https://github.com/lerna/lerna/issues/3807
+    // Note that previous attempt to fix this caused issues with Nx itself, thus we're checking
+    // for Lerna explicitly.
+    // See: https://github.com/nrwl/nx/pull/18784/commits/5416138e1ddc1945d5b289672dfb468e8c544e14
+    const analyzeLockfile = !(0, fs_1.existsSync)((0, node_path_1.join)(workspace_root_1.workspaceRoot, 'lerna.json')) ||
+        (0, fs_1.existsSync)((0, node_path_1.join)(workspace_root_1.workspaceRoot, 'nx.json'));
+    if (nxJsonConfig) {
+        return {
+            analyzePackageJson: true,
+            analyzeSourceFiles: true,
+            analyzeLockfile,
+            ...nxJsonConfig,
+        };
+    }
+    if (!(0, fileutils_1.fileExists)((0, node_path_1.join)(workspace_root_1.workspaceRoot, 'package.json'))) {
+        return {
+            analyzeLockfile: false,
+            analyzePackageJson: false,
+            analyzeSourceFiles: false,
+        };
+    }
+    const packageJson = (0, fileutils_1.readJsonFile)((0, node_path_1.join)(workspace_root_1.workspaceRoot, 'package.json'));
+    const packageJsonDeps = {
+        ...packageJson.dependencies,
+        ...packageJson.devDependencies,
+    };
+    if (packageJsonDeps['@nx/workspace'] ||
+        packageJsonDeps['@nx/js'] ||
+        packageJsonDeps['@nx/node'] ||
+        packageJsonDeps['@nx/next'] ||
+        packageJsonDeps['@nx/react'] ||
+        packageJsonDeps['@nx/angular'] ||
+        packageJsonDeps['@nx/web'] ||
+        packageJsonDeps['@nrwl/workspace'] ||
+        packageJsonDeps['@nrwl/js'] ||
+        packageJsonDeps['@nrwl/node'] ||
+        packageJsonDeps['@nrwl/next'] ||
+        packageJsonDeps['@nrwl/react'] ||
+        packageJsonDeps['@nrwl/angular'] ||
+        packageJsonDeps['@nrwl/web']) {
+        return {
+            analyzePackageJson: true,
+            analyzeLockfile,
+            analyzeSourceFiles: true,
+        };
+    }
+    else {
+        return {
+            analyzePackageJson: true,
+            analyzeLockfile,
+            analyzeSourceFiles: false,
+        };
+    }
+}
+exports.jsPluginConfig = jsPluginConfig;
 
 
 /***/ }),
 
-/***/ 6413:
+/***/ 56413:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 exports.getTsNodeCompilerOptions = exports.registerTsConfigPaths = exports.registerTranspiler = exports.getTranspiler = exports.getTsNodeTranspiler = exports.getSwcTranspiler = exports.registerTsProject = void 0;
-const path_1 = __nccwpck_require__(1017);
-const logger_1 = __nccwpck_require__(7270);
+const path_1 = __nccwpck_require__(71017);
+const logger_1 = __nccwpck_require__(37270);
 const swcNodeInstalled = packageIsInstalled('@swc-node/register');
 const tsNodeInstalled = packageIsInstalled('ts-node/register');
 let ts;
@@ -249214,9 +286692,9 @@ function registerTsProject(path, configFilename) {
     //       Based on limited testing, it doesn't seem to matter if we register it multiple times, but just in
     //       case let's keep a flag to prevent it.
     if (!isTsEsmLoaderRegistered) {
-        const module = __nccwpck_require__(2033);
+        const module = __nccwpck_require__(82033);
         if (module.register && packageIsInstalled('ts-node/esm')) {
-            const url = __nccwpck_require__(1041);
+            const url = __nccwpck_require__(41041);
             module.register(url.pathToFileURL(require.resolve('ts-node/esm')));
         }
         isTsEsmLoaderRegistered = true;
@@ -249230,13 +286708,13 @@ function registerTsProject(path, configFilename) {
 exports.registerTsProject = registerTsProject;
 function getSwcTranspiler(compilerOptions) {
     // These are requires to prevent it from registering when it shouldn't
-    const register = (__nccwpck_require__(8495).register);
+    const register = (__nccwpck_require__(78495).register);
     const cleanupFn = register(compilerOptions);
     return typeof cleanupFn === 'function' ? cleanupFn : () => { };
 }
 exports.getSwcTranspiler = getSwcTranspiler;
 function getTsNodeTranspiler(compilerOptions) {
-    const { register } = __nccwpck_require__(2719);
+    const { register } = __nccwpck_require__(72719);
     // ts-node doesn't provide a cleanup method
     const service = register({
         transpileOnly: true,
@@ -249257,7 +286735,7 @@ exports.getTsNodeTranspiler = getTsNodeTranspiler;
 function getTranspiler(compilerOptions) {
     const preferTsNode = process.env.NX_PREFER_TS_NODE === 'true';
     if (!ts) {
-        ts = __nccwpck_require__(7414);
+        ts = __nccwpck_require__(37414);
     }
     compilerOptions.lib = ['es2021'];
     compilerOptions.module = ts.ModuleKind.CommonJS;
@@ -249334,7 +286812,7 @@ function readCompilerOptions(tsConfigPath) {
     }
 }
 function readCompilerOptionsWithSwc(tsConfigPath) {
-    const { readDefaultTsConfig, } = __nccwpck_require__(9545);
+    const { readDefaultTsConfig, } = __nccwpck_require__(89545);
     const compilerOptions = readDefaultTsConfig(tsConfigPath);
     // This is returned in compiler options for some reason, but not part of the typings.
     // @swc-node/register filters the files to transpile based on it, but it can be limiting when processing
@@ -249344,7 +286822,7 @@ function readCompilerOptionsWithSwc(tsConfigPath) {
 }
 function readCompilerOptionsWithTypescript(tsConfigPath) {
     if (!ts) {
-        ts = __nccwpck_require__(7414);
+        ts = __nccwpck_require__(37414);
     }
     const { readConfigFile, parseJsonConfigFileContent, sys } = ts;
     const jsonContent = readConfigFile(tsConfigPath, sys.readFile);
@@ -249356,7 +286834,7 @@ function readCompilerOptionsWithTypescript(tsConfigPath) {
 }
 function loadTsConfigPaths() {
     try {
-        return __nccwpck_require__(6143);
+        return __nccwpck_require__(56143);
     }
     catch {
         warnNoTsconfigPaths();
@@ -249390,7 +286868,7 @@ function packageIsInstalled(m) {
  */
 function getTsNodeCompilerOptions(compilerOptions) {
     if (!ts) {
-        ts = __nccwpck_require__(7414);
+        ts = __nccwpck_require__(37414);
     }
     const flagMap = {
         module: 'ModuleKind',
@@ -249429,21 +286907,21 @@ exports.getTsNodeCompilerOptions = getTsNodeCompilerOptions;
 
 /***/ }),
 
-/***/ 2602:
+/***/ 32602:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 exports.findNodes = exports.getRootTsConfigPath = exports.getRootTsConfigFileName = exports.resolveModuleByImport = exports.readTsConfig = void 0;
-const workspace_root_1 = __nccwpck_require__(4393);
-const fs_1 = __nccwpck_require__(7147);
-const path_1 = __nccwpck_require__(1017);
+const workspace_root_1 = __nccwpck_require__(64393);
+const fs_1 = __nccwpck_require__(57147);
+const path_1 = __nccwpck_require__(71017);
 const normalizedAppRoot = workspace_root_1.workspaceRoot.replace(/\\/g, '/');
 let tsModule;
 function readTsConfig(tsConfigPath) {
     if (!tsModule) {
-        tsModule = __nccwpck_require__(7414);
+        tsModule = __nccwpck_require__(37414);
     }
     const readResult = tsModule.readConfigFile(tsConfigPath, tsModule.sys.readFile);
     return tsModule.parseJsonConfigFileContent(readResult.config, tsModule.sys, (0, path_1.dirname)(tsConfigPath));
@@ -249451,7 +286929,7 @@ function readTsConfig(tsConfigPath) {
 exports.readTsConfig = readTsConfig;
 function readTsConfigOptions(tsConfigPath) {
     if (!tsModule) {
-        tsModule = __nccwpck_require__(7414);
+        tsModule = __nccwpck_require__(37414);
     }
     const readResult = tsModule.readConfigFile(tsConfigPath, tsModule.sys.readFile);
     // we don't need to scan the files, we only care about options
@@ -249535,7 +287013,251 @@ exports.findNodes = findNodes;
 
 /***/ }),
 
-/***/ 2197:
+/***/ 57843:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.getGlobPatternsFromPackageManagerWorkspaces = exports.buildProjectConfigurationFromPackageJson = exports.createNodeFromPackageJson = exports.buildPackageJsonWorkspacesMatcher = exports.createNodes = void 0;
+const minimatch_1 = __nccwpck_require__(20681);
+const node_fs_1 = __nccwpck_require__(87561);
+const node_path_1 = __nccwpck_require__(49411);
+const nx_json_1 = __nccwpck_require__(21173);
+const to_project_name_1 = __nccwpck_require__(10750);
+const fileutils_1 = __nccwpck_require__(40910);
+const globs_1 = __nccwpck_require__(30699);
+const logger_1 = __nccwpck_require__(37270);
+const output_1 = __nccwpck_require__(21862);
+const package_json_1 = __nccwpck_require__(78618);
+const path_1 = __nccwpck_require__(41559);
+exports.createNodes = [
+    (0, globs_1.combineGlobPatterns)('package.json', '**/package.json'),
+    (p, _, { workspaceRoot }) => {
+        const readJson = (f) => (0, fileutils_1.readJsonFile)((0, node_path_1.join)(workspaceRoot, f));
+        const matcher = buildPackageJsonWorkspacesMatcher(workspaceRoot, readJson);
+        if (matcher(p)) {
+            return createNodeFromPackageJson(p, workspaceRoot);
+        }
+        // The given package.json is not part of the workspaces configuration.
+        return {};
+    },
+];
+function buildPackageJsonWorkspacesMatcher(workspaceRoot, readJson) {
+    const patterns = getGlobPatternsFromPackageManagerWorkspaces(workspaceRoot, readJson);
+    const negativePatterns = patterns.filter((p) => p.startsWith('!'));
+    const positivePatterns = patterns.filter((p) => !p.startsWith('!'));
+    if (
+    // There are some negative patterns
+    negativePatterns.length > 0 &&
+        // No positive patterns
+        (positivePatterns.length === 0 ||
+            // Or only a single positive pattern that is the default coming from root package
+            (positivePatterns.length === 1 && positivePatterns[0] === 'package.json'))) {
+        positivePatterns.push('**/package.json');
+    }
+    return (p) => positivePatterns.some((positive) => (0, minimatch_1.minimatch)(p, positive)) &&
+        !negativePatterns.some((negative) => (0, minimatch_1.minimatch)(p, negative));
+}
+exports.buildPackageJsonWorkspacesMatcher = buildPackageJsonWorkspacesMatcher;
+function createNodeFromPackageJson(pkgJsonPath, root) {
+    const json = (0, fileutils_1.readJsonFile)((0, node_path_1.join)(root, pkgJsonPath));
+    const project = buildProjectConfigurationFromPackageJson(json, pkgJsonPath, (0, nx_json_1.readNxJson)(root));
+    return {
+        projects: {
+            [project.root]: project,
+        },
+    };
+}
+exports.createNodeFromPackageJson = createNodeFromPackageJson;
+function buildProjectConfigurationFromPackageJson(packageJson, path, nxJson) {
+    const normalizedPath = path.split('\\').join('/');
+    const directory = (0, node_path_1.dirname)(normalizedPath);
+    if (!packageJson.name && directory === '.') {
+        throw new Error('Nx requires the root package.json to specify a name if it is being used as an Nx project.');
+    }
+    let name = packageJson.name ?? (0, to_project_name_1.toProjectName)(normalizedPath);
+    const projectType = nxJson?.workspaceLayout?.appsDir != nxJson?.workspaceLayout?.libsDir &&
+        nxJson?.workspaceLayout?.appsDir &&
+        directory.startsWith(nxJson.workspaceLayout.appsDir)
+        ? 'application'
+        : 'library';
+    return {
+        root: directory,
+        sourceRoot: directory,
+        name,
+        projectType,
+        ...packageJson.nx,
+        targets: (0, package_json_1.readTargetsFromPackageJson)(packageJson),
+    };
+}
+exports.buildProjectConfigurationFromPackageJson = buildProjectConfigurationFromPackageJson;
+/**
+ * Get the package.json globs from package manager workspaces
+ */
+function getGlobPatternsFromPackageManagerWorkspaces(root, readJson = (path) => (0, fileutils_1.readJsonFile)((0, node_path_1.join)(root, path)) // making this an arg allows us to reuse in devkit
+) {
+    try {
+        const patterns = [];
+        const packageJson = readJson('package.json');
+        patterns.push(...normalizePatterns(Array.isArray(packageJson.workspaces)
+            ? packageJson.workspaces
+            : packageJson.workspaces?.packages ?? []));
+        if ((0, node_fs_1.existsSync)((0, node_path_1.join)(root, 'pnpm-workspace.yaml'))) {
+            try {
+                const { packages } = (0, fileutils_1.readYamlFile)((0, node_path_1.join)(root, 'pnpm-workspace.yaml'));
+                patterns.push(...normalizePatterns(packages || []));
+            }
+            catch (e) {
+                output_1.output.warn({
+                    title: `${logger_1.NX_PREFIX} Unable to parse pnpm-workspace.yaml`,
+                    bodyLines: [e.toString()],
+                });
+            }
+        }
+        if ((0, node_fs_1.existsSync)((0, node_path_1.join)(root, 'lerna.json'))) {
+            try {
+                const { packages } = readJson('lerna.json');
+                patterns.push(...normalizePatterns(packages?.length > 0 ? packages : ['packages/*']));
+            }
+            catch (e) {
+                output_1.output.warn({
+                    title: `${logger_1.NX_PREFIX} Unable to parse lerna.json`,
+                    bodyLines: [e.toString()],
+                });
+            }
+        }
+        // Merge patterns from workspaces definitions
+        // TODO(@AgentEnder): update logic after better way to determine root project inclusion
+        // Include the root project
+        return packageJson.nx ? patterns.concat('package.json') : patterns;
+    }
+    catch {
+        return [];
+    }
+}
+exports.getGlobPatternsFromPackageManagerWorkspaces = getGlobPatternsFromPackageManagerWorkspaces;
+function normalizePatterns(patterns) {
+    return patterns.map((pattern) => removeRelativePath(pattern.endsWith('/package.json')
+        ? pattern
+        : (0, path_1.joinPathFragments)(pattern, 'package.json')));
+}
+function removeRelativePath(pattern) {
+    return pattern.startsWith('./') ? pattern.substring(2) : pattern;
+}
+
+
+/***/ }),
+
+/***/ 6896:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.name = void 0;
+const tslib_1 = __nccwpck_require__(63085);
+tslib_1.__exportStar(__nccwpck_require__(57843), exports);
+exports.name = 'nx/core/package-json-workspaces';
+
+
+/***/ }),
+
+/***/ 86:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.PackageJsonProjectsNextToProjectJsonPlugin = void 0;
+const path_1 = __nccwpck_require__(71017);
+const fs_1 = __nccwpck_require__(57147);
+const fileutils_1 = __nccwpck_require__(40910);
+const package_json_1 = __nccwpck_require__(78618);
+// TODO: Remove this one day, this should not need to be done.
+exports.PackageJsonProjectsNextToProjectJsonPlugin = {
+    // Its not a problem if plugins happen to have same name, and this
+    // will look least confusing in the source map.
+    name: 'nx/core/package-json',
+    createNodes: [
+        '{project.json,**/project.json}',
+        (file, _, { workspaceRoot }) => {
+            const project = createProjectFromPackageJsonNextToProjectJson(file, workspaceRoot);
+            return project
+                ? {
+                    projects: {
+                        [project.name]: project,
+                    },
+                }
+                : {};
+        },
+    ],
+};
+exports["default"] = exports.PackageJsonProjectsNextToProjectJsonPlugin;
+function createProjectFromPackageJsonNextToProjectJson(projectJsonPath, workspaceRoot) {
+    const root = (0, path_1.dirname)(projectJsonPath);
+    const packageJsonPath = (0, path_1.join)(workspaceRoot, root, 'package.json');
+    if (!(0, fs_1.existsSync)(packageJsonPath)) {
+        return null;
+    }
+    try {
+        const packageJson = (0, fileutils_1.readJsonFile)(packageJsonPath);
+        let { nx, name } = packageJson;
+        return {
+            ...nx,
+            name,
+            root,
+            targets: (0, package_json_1.readTargetsFromPackageJson)(packageJson),
+        };
+    }
+    catch (e) {
+        console.log(e);
+        return null;
+    }
+}
+
+
+/***/ }),
+
+/***/ 63239:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.buildProjectFromProjectJson = exports.ProjectJsonProjectsPlugin = void 0;
+const node_path_1 = __nccwpck_require__(49411);
+const to_project_name_1 = __nccwpck_require__(10750);
+const fileutils_1 = __nccwpck_require__(40910);
+exports.ProjectJsonProjectsPlugin = {
+    name: 'nx/core/project-json',
+    createNodes: [
+        '{project.json,**/project.json}',
+        (file, _, { workspaceRoot }) => {
+            const json = (0, fileutils_1.readJsonFile)((0, node_path_1.join)(workspaceRoot, file));
+            const project = buildProjectFromProjectJson(json, file);
+            return {
+                projects: {
+                    [project.root]: project,
+                },
+            };
+        },
+    ],
+};
+exports["default"] = exports.ProjectJsonProjectsPlugin;
+function buildProjectFromProjectJson(json, path) {
+    return {
+        name: (0, to_project_name_1.toProjectName)(path),
+        root: (0, node_path_1.dirname)(path),
+        ...json,
+    };
+}
+exports.buildProjectFromProjectJson = buildProjectFromProjectJson;
+
+
+/***/ }),
+
+/***/ 32197:
 /***/ ((__unused_webpack_module, exports) => {
 
 "use strict";
@@ -249563,27 +287285,204 @@ exports.OVERRIDE_SOURCE_FILE = 'NX_OVERRIDE_SOURCE_FILE';
 
 /***/ }),
 
-/***/ 9254:
+/***/ 98263:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.getTargetInfo = exports.TargetDefaultsPlugin = void 0;
+const minimatch_1 = __nccwpck_require__(20681);
+const node_fs_1 = __nccwpck_require__(87561);
+const node_path_1 = __nccwpck_require__(49411);
+const fileutils_1 = __nccwpck_require__(40910);
+const globs_1 = __nccwpck_require__(30699);
+const package_json_1 = __nccwpck_require__(78618);
+const package_json_workspaces_1 = __nccwpck_require__(6896);
+const symbols_1 = __nccwpck_require__(32197);
+exports.TargetDefaultsPlugin = {
+    name: 'nx/core/target-defaults',
+    createNodes: [
+        '{package.json,**/package.json,project.json,**/project.json}',
+        (configFile, _, ctx) => {
+            const fileName = (0, node_path_1.basename)(configFile);
+            const root = (0, node_path_1.dirname)(configFile);
+            const packageManagerWorkspacesGlob = (0, globs_1.combineGlobPatterns)((0, package_json_workspaces_1.getGlobPatternsFromPackageManagerWorkspaces)(ctx.workspaceRoot));
+            // Only process once if package.json + project.json both exist
+            if (fileName === 'package.json' &&
+                (0, node_fs_1.existsSync)((0, node_path_1.join)(ctx.workspaceRoot, root, 'project.json'))) {
+                return {};
+            }
+            else if (fileName === 'package.json' &&
+                !(0, minimatch_1.minimatch)(configFile, packageManagerWorkspacesGlob)) {
+                return {};
+            }
+            // If no target defaults, this does nothing
+            const targetDefaults = ctx.nxJsonConfiguration?.targetDefaults;
+            if (!targetDefaults) {
+                return {};
+            }
+            const projectJson = readJsonOrNull((0, node_path_1.join)(ctx.workspaceRoot, root, 'project.json'));
+            const packageJson = readJsonOrNull((0, node_path_1.join)(ctx.workspaceRoot, root, 'package.json'));
+            const packageJsonTargets = (0, package_json_1.readTargetsFromPackageJson)(packageJson);
+            const projectDefinedTargets = new Set([
+                ...Object.keys(projectJson?.targets ?? {}),
+                ...(packageJson ? Object.keys(packageJsonTargets) : []),
+            ]);
+            const executorToTargetMap = getExecutorToTargetMap(packageJsonTargets, projectJson?.targets);
+            const modifiedTargets = {};
+            for (const defaultSpecifier in targetDefaults) {
+                const targetNames = executorToTargetMap.get(defaultSpecifier) ?? new Set();
+                targetNames.add(defaultSpecifier);
+                for (const targetName of targetNames) {
+                    // Prevents `build` from overwriting `@nx/js:tsc` if both are present
+                    // and build is specified later in the ordering.
+                    if (!modifiedTargets[targetName] || targetName !== defaultSpecifier) {
+                        const defaults = JSON.parse(JSON.stringify(targetDefaults[defaultSpecifier]));
+                        modifiedTargets[targetName] = {
+                            ...getTargetInfo(targetName, projectJson?.targets, packageJsonTargets),
+                            ...defaults,
+                        };
+                    }
+                    // TODO: Remove this after we figure out a way to define new targets
+                    // in target defaults
+                    if (!projectDefinedTargets.has(targetName)) {
+                        modifiedTargets[targetName][symbols_1.ONLY_MODIFIES_EXISTING_TARGET] = true;
+                    }
+                }
+            }
+            return {
+                projects: {
+                    [root]: {
+                        targets: modifiedTargets,
+                    },
+                },
+                [symbols_1.OVERRIDE_SOURCE_FILE]: 'nx.json',
+            };
+        },
+    ],
+};
+exports["default"] = exports.TargetDefaultsPlugin;
+function getExecutorToTargetMap(packageJsonTargets, projectJsonTargets) {
+    const executorToTargetMap = new Map();
+    const targets = Object.keys({
+        ...projectJsonTargets,
+        ...packageJsonTargets,
+    });
+    for (const target of targets) {
+        const executor = getTargetExecutor(target, projectJsonTargets, packageJsonTargets);
+        const targetsForExecutor = executorToTargetMap.get(executor) ?? new Set();
+        targetsForExecutor.add(target);
+        executorToTargetMap.set(executor, targetsForExecutor);
+    }
+    return executorToTargetMap;
+}
+function readJsonOrNull(path) {
+    if ((0, node_fs_1.existsSync)(path)) {
+        return (0, fileutils_1.readJsonFile)(path);
+    }
+    else {
+        return null;
+    }
+}
+/**
+ * This fn gets target info that would make a target uniquely compatible
+ * with what is described by project.json or package.json. As the merge process
+ * for config happens, without this, the target defaults may be compatible
+ * with a config from a plugin and then that combined target be incompatible
+ * with the project json configuration resulting in the target default values
+ * being scrapped. By adding enough information from the project.json / package.json,
+ * we can make sure that the target after merging is compatible with the defined target.
+ */
+function getTargetInfo(target, projectJsonTargets, packageJsonTargets) {
+    const projectJsonTarget = projectJsonTargets?.[target];
+    const packageJsonTarget = packageJsonTargets?.[target];
+    const executor = getTargetExecutor(target, projectJsonTargets, packageJsonTargets);
+    const targetOptions = {
+        ...packageJsonTarget?.options,
+        ...projectJsonTarget?.options,
+    };
+    if (projectJsonTarget?.command) {
+        return {
+            command: projectJsonTarget?.command,
+        };
+    }
+    if (executor === 'nx:run-commands') {
+        if (targetOptions?.command) {
+            return {
+                executor: 'nx:run-commands',
+                options: {
+                    command: targetOptions?.command,
+                },
+            };
+        }
+        else if (targetOptions?.commands) {
+            return {
+                executor: 'nx:run-commands',
+                options: {
+                    commands: targetOptions.commands,
+                },
+            };
+        }
+        return {
+            executor: 'nx:run-commands',
+        };
+    }
+    if (executor === 'nx:run-script') {
+        return {
+            executor: 'nx:run-script',
+            options: {
+                script: targetOptions?.script ?? target,
+            },
+        };
+    }
+    if (executor) {
+        return { executor };
+    }
+    return {};
+}
+exports.getTargetInfo = getTargetInfo;
+function getTargetExecutor(target, projectJsonTargets, packageJsonTargets) {
+    const projectJsonTargetConfiguration = projectJsonTargets?.[target];
+    const packageJsonTargetConfiguration = packageJsonTargets?.[target];
+    if (!projectJsonTargetConfiguration && packageJsonTargetConfiguration) {
+        return packageJsonTargetConfiguration?.executor;
+    }
+    if (projectJsonTargetConfiguration?.executor) {
+        return projectJsonTargetConfiguration.executor;
+    }
+    if (projectJsonTargetConfiguration?.command) {
+        return 'nx:run-commands';
+    }
+    return null;
+}
+
+
+/***/ }),
+
+/***/ 99254:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.CreateDependenciesError = exports.ProcessProjectGraphError = exports.ProcessDependenciesError = exports.buildProjectGraphUsingProjectFileMap = exports.getFileMap = void 0;
-const workspace_root_1 = __nccwpck_require__(4393);
-const path_1 = __nccwpck_require__(1017);
+exports.applyProjectMetadata = exports.buildProjectGraphUsingProjectFileMap = exports.getFileMap = void 0;
+const workspace_root_1 = __nccwpck_require__(64393);
+const path_1 = __nccwpck_require__(71017);
 const perf_hooks_1 = __nccwpck_require__(4074);
-const assert_workspace_validity_1 = __nccwpck_require__(5341);
-const nx_deps_cache_1 = __nccwpck_require__(3387);
-const implicit_project_dependencies_1 = __nccwpck_require__(6655);
-const normalize_project_nodes_1 = __nccwpck_require__(8009);
-const utils_1 = __nccwpck_require__(852);
-const typescript_1 = __nccwpck_require__(2602);
-const fileutils_1 = __nccwpck_require__(910);
-const project_graph_builder_1 = __nccwpck_require__(7667);
-const configuration_1 = __nccwpck_require__(4333);
-const fs_1 = __nccwpck_require__(7147);
-const output_1 = __nccwpck_require__(1862);
+const assert_workspace_validity_1 = __nccwpck_require__(45341);
+const nx_deps_cache_1 = __nccwpck_require__(53387);
+const implicit_project_dependencies_1 = __nccwpck_require__(26655);
+const normalize_project_nodes_1 = __nccwpck_require__(18009);
+const utils_1 = __nccwpck_require__(10852);
+const typescript_1 = __nccwpck_require__(32602);
+const fileutils_1 = __nccwpck_require__(40910);
+const project_graph_builder_1 = __nccwpck_require__(47667);
+const configuration_1 = __nccwpck_require__(34333);
+const fs_1 = __nccwpck_require__(57147);
+const output_1 = __nccwpck_require__(21862);
+const error_types_1 = __nccwpck_require__(54403);
+const project_configuration_utils_1 = __nccwpck_require__(36818);
 let storedFileMap = null;
 let storedAllWorkspaceFiles = null;
 let storedRustReferences = null;
@@ -249607,13 +287506,26 @@ function getFileMap() {
     }
 }
 exports.getFileMap = getFileMap;
-async function buildProjectGraphUsingProjectFileMap(projects, externalNodes, fileMap, allWorkspaceFiles, rustReferences, fileMapCache, plugins) {
+async function buildProjectGraphUsingProjectFileMap(projectRootMap, externalNodes, fileMap, allWorkspaceFiles, rustReferences, fileMapCache, plugins, sourceMap) {
     storedFileMap = fileMap;
     storedAllWorkspaceFiles = allWorkspaceFiles;
     storedRustReferences = rustReferences;
+    const projects = {};
+    for (const root in projectRootMap) {
+        const project = projectRootMap[root];
+        projects[project.name] = project;
+    }
+    const errors = [];
     const nxJson = (0, configuration_1.readNxJson)();
     const projectGraphVersion = '6.0';
-    (0, assert_workspace_validity_1.assertWorkspaceValidity)(projects, nxJson);
+    try {
+        (0, assert_workspace_validity_1.assertWorkspaceValidity)(projects, nxJson);
+    }
+    catch (e) {
+        if ((0, error_types_1.isWorkspaceValidityError)(e)) {
+            errors.push(e);
+        }
+    }
     const packageJsonDeps = readCombinedDeps();
     const rootTsConfig = readRootTsConfig();
     let filesToProcess;
@@ -249632,9 +287544,26 @@ async function buildProjectGraphUsingProjectFileMap(projects, externalNodes, fil
             projectFileMap: {},
         };
     }
-    const context = createContext(projects, nxJson, externalNodes, fileMap, filesToProcess);
-    let projectGraph = await buildProjectGraphUsingContext(externalNodes, context, cachedFileData, projectGraphVersion, plugins);
-    const projectFileMapCache = (0, nx_deps_cache_1.createProjectFileMapCache)(nxJson, packageJsonDeps, fileMap, rootTsConfig);
+    let projectGraph;
+    let projectFileMapCache;
+    try {
+        const context = createContext(projects, nxJson, externalNodes, fileMap, filesToProcess);
+        projectGraph = await buildProjectGraphUsingContext(externalNodes, context, cachedFileData, projectGraphVersion, plugins, sourceMap);
+        projectFileMapCache = (0, nx_deps_cache_1.createProjectFileMapCache)(nxJson, packageJsonDeps, fileMap, rootTsConfig);
+    }
+    catch (e) {
+        // we need to include the workspace validity errors in the final error
+        if ((0, error_types_1.isAggregateProjectGraphError)(e)) {
+            errors.push(...e.errors);
+            throw new error_types_1.AggregateProjectGraphError(errors, e.partialProjectGraph);
+        }
+        else {
+            throw e;
+        }
+    }
+    if (errors.length > 0) {
+        throw new error_types_1.AggregateProjectGraphError(errors, projectGraph);
+    }
     return {
         projectGraph,
         projectFileMapCache,
@@ -249657,7 +287586,7 @@ function readCombinedDeps() {
         ...installationPackageJson.devDependencies,
     };
 }
-async function buildProjectGraphUsingContext(knownExternalNodes, ctx, cachedFileData, projectGraphVersion, plugins) {
+async function buildProjectGraphUsingContext(knownExternalNodes, ctx, cachedFileData, projectGraphVersion, plugins, sourceMap) {
     perf_hooks_1.performance.mark('build project graph:start');
     const builder = new project_graph_builder_1.ProjectGraphBuilder(null, ctx.fileMap.projectFileMap);
     builder.setVersion(projectGraphVersion);
@@ -249669,10 +287598,10 @@ async function buildProjectGraphUsingContext(knownExternalNodes, ctx, cachedFile
     let updatedGraph;
     let error;
     try {
-        updatedGraph = await updateProjectGraphWithPlugins(ctx, initProjectGraph, plugins);
+        updatedGraph = await updateProjectGraphWithPlugins(ctx, initProjectGraph, plugins, sourceMap);
     }
     catch (e) {
-        if (e instanceof CreateDependenciesError) {
+        if ((0, error_types_1.isAggregateProjectGraphError)(e)) {
             updatedGraph = e.partialProjectGraph;
             error = e;
         }
@@ -249703,26 +287632,20 @@ async function buildProjectGraphUsingContext(knownExternalNodes, ctx, cachedFile
         return finalGraph;
     }
     else {
-        throw new CreateDependenciesError(error.errors, finalGraph);
+        throw new error_types_1.AggregateProjectGraphError(error.errors, finalGraph);
     }
 }
 function createContext(projects, nxJson, externalNodes, fileMap, filesToProcess) {
-    const clonedProjects = Object.keys(projects).reduce((map, projectName) => {
-        map[projectName] = {
-            ...projects[projectName],
-        };
-        return map;
-    }, {});
     return {
         nxJsonConfiguration: nxJson,
-        projects: clonedProjects,
+        projects,
         externalNodes,
         workspaceRoot: workspace_root_1.workspaceRoot,
         fileMap,
         filesToProcess,
     };
 }
-async function updateProjectGraphWithPlugins(context, initProjectGraph, plugins) {
+async function updateProjectGraphWithPlugins(context, initProjectGraph, plugins, sourceMap) {
     let graph = initProjectGraph;
     const errors = [];
     for (const plugin of plugins) {
@@ -249756,7 +287679,7 @@ async function updateProjectGraphWithPlugins(context, initProjectGraph, plugins)
             }
         }
         catch (e) {
-            errors.push(new ProcessProjectGraphError(plugin.name, {
+            errors.push(new error_types_1.ProcessProjectGraphError(plugin.name, {
                 cause: e,
             }));
         }
@@ -249774,52 +287697,24 @@ async function updateProjectGraphWithPlugins(context, initProjectGraph, plugins)
             }
         }
         catch (cause) {
-            errors.push(new ProcessDependenciesError(plugin.name, {
+            errors.push(new error_types_1.ProcessDependenciesError(plugin.name, {
                 cause,
             }));
         }
         perf_hooks_1.performance.mark(`${plugin.name}:createDependencies - end`);
         perf_hooks_1.performance.measure(`${plugin.name}:createDependencies`, `${plugin.name}:createDependencies - start`, `${plugin.name}:createDependencies - end`);
     }));
-    const result = builder.getUpdatedProjectGraph();
-    if (errors.length === 0) {
-        return result;
-    }
-    else {
-        throw new CreateDependenciesError(errors, result);
-    }
-}
-class ProcessDependenciesError extends Error {
-    constructor(pluginName, { cause }) {
-        super(`The "${pluginName}" plugin threw an error while creating dependencies:`, {
-            cause,
-        });
-        this.pluginName = pluginName;
-        this.name = this.constructor.name;
-        this.stack = `${this.message}\n  ${cause.stack.split('\n').join('\n  ')}`;
-    }
-}
-exports.ProcessDependenciesError = ProcessDependenciesError;
-class ProcessProjectGraphError extends Error {
-    constructor(pluginName, { cause }) {
-        super(`The "${pluginName}" plugin threw an error while processing the project graph:`, {
-            cause,
-        });
-        this.pluginName = pluginName;
-        this.name = this.constructor.name;
-        this.stack = `${this.message}\n  ${cause.stack.split('\n').join('\n  ')}`;
-    }
-}
-exports.ProcessProjectGraphError = ProcessProjectGraphError;
-class CreateDependenciesError extends Error {
-    constructor(errors, partialProjectGraph) {
-        super('Failed to create dependencies. See above for errors');
-        this.errors = errors;
-        this.partialProjectGraph = partialProjectGraph;
-        this.name = this.constructor.name;
+    const graphWithDeps = builder.getUpdatedProjectGraph();
+    const { errors: metadataErrors, graph: updatedGraph } = await applyProjectMetadata(graphWithDeps, plugins, {
+        nxJsonConfiguration: context.nxJsonConfiguration,
+        workspaceRoot: workspace_root_1.workspaceRoot,
+    }, sourceMap);
+    errors.push(...metadataErrors);
+    if (errors.length > 0) {
+        throw new error_types_1.AggregateProjectGraphError(errors, updatedGraph);
     }
+    return updatedGraph;
 }
-exports.CreateDependenciesError = CreateDependenciesError;
 function readRootTsConfig() {
     try {
         const tsConfigPath = (0, typescript_1.getRootTsConfigPath)();
@@ -249831,22 +287726,53 @@ function readRootTsConfig() {
         return {};
     }
 }
+async function applyProjectMetadata(graph, plugins, context, sourceMap) {
+    const results = [];
+    const errors = [];
+    const promises = plugins.map(async (plugin) => {
+        if ((0, utils_1.isNxPluginV2)(plugin) && plugin.createMetadata) {
+            perf_hooks_1.performance.mark(`${plugin.name}:createMetadata - start`);
+            try {
+                const metadata = await plugin.createMetadata(graph, undefined, context);
+                results.push({ metadata, pluginName: plugin.name });
+            }
+            catch (e) {
+                errors.push(new error_types_1.CreateMetadataError(e, plugin.name));
+            }
+            finally {
+                perf_hooks_1.performance.mark(`${plugin.name}:createMetadata - end`);
+                perf_hooks_1.performance.measure(`${plugin.name}:createMetadata`, `${plugin.name}:createMetadata - start`, `${plugin.name}:createMetadata - end`);
+            }
+        }
+    });
+    await Promise.all(promises);
+    for (const { metadata: projectsMetadata, pluginName } of results) {
+        for (const project in projectsMetadata) {
+            const projectConfiguration = graph.nodes[project]?.data;
+            if (projectConfiguration) {
+                projectConfiguration.metadata = (0, project_configuration_utils_1.mergeMetadata)(sourceMap[project], [null, pluginName], 'metadata', projectsMetadata[project].metadata, projectConfiguration.metadata);
+            }
+        }
+    }
+    return { errors, graph };
+}
+exports.applyProjectMetadata = applyProjectMetadata;
 
 
 /***/ }),
 
-/***/ 4403:
+/***/ 54403:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 var _ProjectGraphError_errors, _ProjectGraphError_partialProjectGraph, _ProjectGraphError_partialSourceMaps;
 Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.LoadPluginError = exports.DaemonProjectGraphError = exports.isMergeNodesError = exports.isAggregateCreateNodesError = exports.isCreateNodesError = exports.MergeNodesError = exports.AggregateCreateNodesError = exports.CreateNodesError = exports.ProjectConfigurationsError = exports.isProjectsWithNoNameError = exports.ProjectsWithNoNameError = exports.isProjectsWithConflictingNamesError = exports.ProjectsWithConflictingNamesError = exports.ProjectGraphError = void 0;
-const tslib_1 = __nccwpck_require__(3085);
+exports.LoadPluginError = exports.DaemonProjectGraphError = exports.isMergeNodesError = exports.isAggregateCreateNodesError = exports.isCreateNodesError = exports.isCreateMetadataError = exports.isAggregateProjectGraphError = exports.AggregateProjectGraphError = exports.ProcessProjectGraphError = exports.isWorkspaceValidityError = exports.WorkspaceValidityError = exports.ProcessDependenciesError = exports.CreateMetadataError = exports.MergeNodesError = exports.AggregateCreateNodesError = exports.CreateNodesError = exports.isProjectConfigurationsError = exports.ProjectConfigurationsError = exports.isProjectWithNoNameError = exports.ProjectWithNoNameError = exports.isProjectsWithNoNameError = exports.ProjectsWithNoNameError = exports.isMultipleProjectsWithSameNameError = exports.isProjectWithExistingNameError = exports.ProjectWithExistingNameError = exports.MultipleProjectsWithSameNameError = exports.ProjectGraphError = void 0;
+const tslib_1 = __nccwpck_require__(63085);
 class ProjectGraphError extends Error {
     constructor(errors, partialProjectGraph, partialSourceMaps) {
-        super(`Failed to process project graph.`);
+        super(`Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.`);
         _ProjectGraphError_errors.set(this, void 0);
         _ProjectGraphError_partialProjectGraph.set(this, void 0);
         _ProjectGraphError_partialSourceMaps.set(this, void 0);
@@ -249883,7 +287809,7 @@ class ProjectGraphError extends Error {
 }
 exports.ProjectGraphError = ProjectGraphError;
 _ProjectGraphError_errors = new WeakMap(), _ProjectGraphError_partialProjectGraph = new WeakMap(), _ProjectGraphError_partialSourceMaps = new WeakMap();
-class ProjectsWithConflictingNamesError extends Error {
+class MultipleProjectsWithSameNameError extends Error {
     constructor(conflicts, projects) {
         super([
             `The following projects are defined in multiple locations:`,
@@ -249891,21 +287817,39 @@ class ProjectsWithConflictingNamesError extends Error {
             '',
             "To fix this, set a unique name for each project in a project.json inside the project's root. If the project does not currently have a project.json, you can create one that contains only a name.",
         ].join('\n'));
+        this.conflicts = conflicts;
         this.projects = projects;
         this.name = this.constructor.name;
     }
 }
-exports.ProjectsWithConflictingNamesError = ProjectsWithConflictingNamesError;
-function isProjectsWithConflictingNamesError(e) {
-    return (e instanceof ProjectsWithConflictingNamesError ||
+exports.MultipleProjectsWithSameNameError = MultipleProjectsWithSameNameError;
+class ProjectWithExistingNameError extends Error {
+    constructor(projectName, projectRoot) {
+        super(`The project "${projectName}" is defined in multiple locations.`);
+        this.projectName = projectName;
+        this.projectRoot = projectRoot;
+        this.name = this.constructor.name;
+    }
+}
+exports.ProjectWithExistingNameError = ProjectWithExistingNameError;
+function isProjectWithExistingNameError(e) {
+    return (e instanceof ProjectWithExistingNameError ||
         (typeof e === 'object' &&
             'name' in e &&
-            e?.name === ProjectsWithConflictingNamesError.prototype.name));
+            e?.name === ProjectWithExistingNameError.name));
 }
-exports.isProjectsWithConflictingNamesError = isProjectsWithConflictingNamesError;
+exports.isProjectWithExistingNameError = isProjectWithExistingNameError;
+function isMultipleProjectsWithSameNameError(e) {
+    return (e instanceof MultipleProjectsWithSameNameError ||
+        (typeof e === 'object' &&
+            'name' in e &&
+            e?.name === MultipleProjectsWithSameNameError.name));
+}
+exports.isMultipleProjectsWithSameNameError = isMultipleProjectsWithSameNameError;
 class ProjectsWithNoNameError extends Error {
     constructor(projectRoots, projects) {
         super(`The projects in the following directories have no name provided:\n  - ${projectRoots.join('\n  - ')}`);
+        this.projectRoots = projectRoots;
         this.projects = projects;
         this.name = this.constructor.name;
     }
@@ -249915,9 +287859,24 @@ function isProjectsWithNoNameError(e) {
     return (e instanceof ProjectsWithNoNameError ||
         (typeof e === 'object' &&
             'name' in e &&
-            e?.name === ProjectsWithNoNameError.prototype.name));
+            e?.name === ProjectsWithNoNameError.name));
 }
 exports.isProjectsWithNoNameError = isProjectsWithNoNameError;
+class ProjectWithNoNameError extends Error {
+    constructor(projectRoot) {
+        super(`The project in ${projectRoot} has no name provided.`);
+        this.projectRoot = projectRoot;
+        this.name = this.constructor.name;
+    }
+}
+exports.ProjectWithNoNameError = ProjectWithNoNameError;
+function isProjectWithNoNameError(e) {
+    return (e instanceof ProjectWithNoNameError ||
+        (typeof e === 'object' &&
+            'name' in e &&
+            e?.name === ProjectWithNoNameError.name));
+}
+exports.isProjectWithNoNameError = isProjectWithNoNameError;
 class ProjectConfigurationsError extends Error {
     constructor(errors, partialProjectConfigurationsResult) {
         super('Failed to create project configurations');
@@ -249927,6 +287886,13 @@ class ProjectConfigurationsError extends Error {
     }
 }
 exports.ProjectConfigurationsError = ProjectConfigurationsError;
+function isProjectConfigurationsError(e) {
+    return (e instanceof ProjectConfigurationsError ||
+        (typeof e === 'object' &&
+            'name' in e &&
+            e?.name === ProjectConfigurationsError.name));
+}
+exports.isProjectConfigurationsError = isProjectConfigurationsError;
 class CreateNodesError extends Error {
     constructor({ file, pluginName, error, }) {
         const msg = `The "${pluginName}" plugin threw an error while creating nodes from ${file}:`;
@@ -249959,6 +287925,78 @@ class MergeNodesError extends Error {
     }
 }
 exports.MergeNodesError = MergeNodesError;
+class CreateMetadataError extends Error {
+    constructor(error, plugin) {
+        super(`The "${plugin}" plugin threw an error while creating metadata:`, {
+            cause: error,
+        });
+        this.error = error;
+        this.plugin = plugin;
+        this.name = this.constructor.name;
+    }
+}
+exports.CreateMetadataError = CreateMetadataError;
+class ProcessDependenciesError extends Error {
+    constructor(pluginName, { cause }) {
+        super(`The "${pluginName}" plugin threw an error while creating dependencies:`, {
+            cause,
+        });
+        this.pluginName = pluginName;
+        this.name = this.constructor.name;
+        this.stack = `${this.message}\n  ${cause.stack.split('\n').join('\n  ')}`;
+    }
+}
+exports.ProcessDependenciesError = ProcessDependenciesError;
+class WorkspaceValidityError extends Error {
+    constructor(message) {
+        message = `Configuration Error\n${message}`;
+        super(message);
+        this.message = message;
+        this.name = this.constructor.name;
+    }
+}
+exports.WorkspaceValidityError = WorkspaceValidityError;
+function isWorkspaceValidityError(e) {
+    return (e instanceof WorkspaceValidityError ||
+        (typeof e === 'object' &&
+            'name' in e &&
+            e?.name === WorkspaceValidityError.name));
+}
+exports.isWorkspaceValidityError = isWorkspaceValidityError;
+class ProcessProjectGraphError extends Error {
+    constructor(pluginName, { cause }) {
+        super(`The "${pluginName}" plugin threw an error while processing the project graph:`, {
+            cause,
+        });
+        this.pluginName = pluginName;
+        this.name = this.constructor.name;
+        this.stack = `${this.message}\n  ${cause.stack.split('\n').join('\n  ')}`;
+    }
+}
+exports.ProcessProjectGraphError = ProcessProjectGraphError;
+class AggregateProjectGraphError extends Error {
+    constructor(errors, partialProjectGraph) {
+        super('Failed to create project graph. See above for errors');
+        this.errors = errors;
+        this.partialProjectGraph = partialProjectGraph;
+        this.name = this.constructor.name;
+    }
+}
+exports.AggregateProjectGraphError = AggregateProjectGraphError;
+function isAggregateProjectGraphError(e) {
+    return (e instanceof AggregateProjectGraphError ||
+        (typeof e === 'object' &&
+            'name' in e &&
+            e?.name === AggregateProjectGraphError.name));
+}
+exports.isAggregateProjectGraphError = isAggregateProjectGraphError;
+function isCreateMetadataError(e) {
+    return (e instanceof CreateMetadataError ||
+        (typeof e === 'object' &&
+            'name' in e &&
+            e?.name === CreateMetadataError.name));
+}
+exports.isCreateMetadataError = isCreateMetadataError;
 function isCreateNodesError(e) {
     return (e instanceof CreateNodesError ||
         (typeof e === 'object' && 'name' in e && e?.name === CreateNodesError.name));
@@ -250000,20 +288038,207 @@ exports.LoadPluginError = LoadPluginError;
 
 /***/ }),
 
-/***/ 3387:
+/***/ 89294:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.readPackageJson = exports.defaultFileRead = exports.readWorkspaceConfig = exports.TEN_MEGABYTES = exports.calculateFileChanges = exports.isDeletedFileChange = exports.isWholeFileChange = exports.DeletedFileChange = exports.WholeFileChange = void 0;
+const child_process_1 = __nccwpck_require__(32081);
+const fs_1 = __nccwpck_require__(57147);
+const path_1 = __nccwpck_require__(71017);
+const configuration_1 = __nccwpck_require__(34333);
+const workspace_root_1 = __nccwpck_require__(64393);
+const fileutils_1 = __nccwpck_require__(40910);
+const json_diff_1 = __nccwpck_require__(37845);
+const project_graph_1 = __nccwpck_require__(54913);
+const angular_json_1 = __nccwpck_require__(45205);
+const ignore_1 = __nccwpck_require__(22810);
+const retrieve_workspace_files_1 = __nccwpck_require__(25264);
+const project_configuration_utils_1 = __nccwpck_require__(36818);
+const nx_plugin_deprecated_1 = __nccwpck_require__(1995);
+const minimatch_1 = __nccwpck_require__(20681);
+const package_json_next_to_project_json_1 = __nccwpck_require__(86);
+class WholeFileChange {
+    constructor() {
+        this.type = 'WholeFileChange';
+    }
+}
+exports.WholeFileChange = WholeFileChange;
+class DeletedFileChange {
+    constructor() {
+        this.type = 'WholeFileDeleted';
+    }
+}
+exports.DeletedFileChange = DeletedFileChange;
+function isWholeFileChange(change) {
+    return change.type === 'WholeFileChange';
+}
+exports.isWholeFileChange = isWholeFileChange;
+function isDeletedFileChange(change) {
+    return change.type === 'WholeFileDeleted';
+}
+exports.isDeletedFileChange = isDeletedFileChange;
+function calculateFileChanges(files, allWorkspaceFiles, nxArgs, readFileAtRevision = defaultReadFileAtRevision, ignore = (0, ignore_1.getIgnoreObject)()) {
+    files = files.filter((f) => !ignore.ignores(f));
+    return files.map((f) => {
+        const ext = (0, path_1.extname)(f);
+        const file = allWorkspaceFiles.find((fileData) => fileData.file == f);
+        const hash = file?.hash;
+        return {
+            file: f,
+            ext,
+            hash,
+            getChanges: () => {
+                if (!(0, fs_1.existsSync)((0, path_1.join)(workspace_root_1.workspaceRoot, f))) {
+                    return [new DeletedFileChange()];
+                }
+                if (!nxArgs) {
+                    return [new WholeFileChange()];
+                }
+                if (nxArgs.files && nxArgs.files.includes(f)) {
+                    return [new WholeFileChange()];
+                }
+                switch (ext) {
+                    case '.json':
+                        try {
+                            const atBase = readFileAtRevision(f, nxArgs.base);
+                            const atHead = readFileAtRevision(f, nxArgs.head);
+                            return (0, json_diff_1.jsonDiff)(JSON.parse(atBase), JSON.parse(atHead));
+                        }
+                        catch (e) {
+                            return [new WholeFileChange()];
+                        }
+                    default:
+                        return [new WholeFileChange()];
+                }
+            },
+        };
+    });
+}
+exports.calculateFileChanges = calculateFileChanges;
+exports.TEN_MEGABYTES = 1024 * 10000;
+function defaultReadFileAtRevision(file, revision) {
+    try {
+        const fileFullPath = `${workspace_root_1.workspaceRoot}${path_1.sep}${file}`;
+        const gitRepositoryPath = (0, child_process_1.execSync)('git rev-parse --show-toplevel')
+            .toString()
+            .trim();
+        const filePathInGitRepository = (0, path_1.relative)(gitRepositoryPath, fileFullPath)
+            .split(path_1.sep)
+            .join('/');
+        return !revision
+            ? (0, fs_1.readFileSync)(file, 'utf-8')
+            : (0, child_process_1.execSync)(`git show ${revision}:${filePathInGitRepository}`, {
+                maxBuffer: exports.TEN_MEGABYTES,
+                stdio: ['pipe', 'pipe', 'ignore'],
+            })
+                .toString()
+                .trim();
+    }
+    catch {
+        return '';
+    }
+}
+/**
+ * TODO(v20): Remove this function
+ * @deprecated To get projects use {@link retrieveProjectConfigurations} instead. This will be removed in v20.
+ */
+function readWorkspaceConfig(opts) {
+    let configuration = null;
+    const root = opts.path || process.cwd();
+    const nxJson = (0, configuration_1.readNxJson)(root);
+    try {
+        const projectGraph = (0, project_graph_1.readCachedProjectGraph)();
+        configuration = {
+            ...nxJson,
+            ...(0, project_graph_1.readProjectsConfigurationFromProjectGraph)(projectGraph),
+        };
+    }
+    catch {
+        configuration = {
+            version: 2,
+            projects: getProjectsSyncNoInference(root, nxJson).projects,
+        };
+    }
+    if (opts.format === 'angularCli') {
+        return (0, angular_json_1.toOldFormat)(configuration);
+    }
+    else {
+        return configuration;
+    }
+}
+exports.readWorkspaceConfig = readWorkspaceConfig;
+function defaultFileRead(filePath) {
+    return (0, fs_1.readFileSync)((0, path_1.join)(workspace_root_1.workspaceRoot, filePath), 'utf-8');
+}
+exports.defaultFileRead = defaultFileRead;
+function readPackageJson() {
+    try {
+        return (0, fileutils_1.readJsonFile)(`${workspace_root_1.workspaceRoot}/package.json`);
+    }
+    catch {
+        return {}; // if package.json doesn't exist
+    }
+}
+exports.readPackageJson = readPackageJson;
+/**
+ * TODO(v20): Remove this function.
+ */
+function getProjectsSyncNoInference(root, nxJson) {
+    const allConfigFiles = (0, retrieve_workspace_files_1.retrieveProjectConfigurationPaths)(root, (0, nx_plugin_deprecated_1.getDefaultPluginsSync)(root));
+    const plugins = [
+        package_json_next_to_project_json_1.PackageJsonProjectsNextToProjectJsonPlugin,
+        ...(0, nx_plugin_deprecated_1.getDefaultPluginsSync)(root),
+    ];
+    const projectRootMap = {};
+    // We iterate over plugins first - this ensures that plugins specified first take precedence.
+    for (const plugin of plugins) {
+        const [pattern, createNodes] = plugin.createNodes ?? [];
+        if (!pattern) {
+            continue;
+        }
+        const matchingConfigFiles = allConfigFiles.filter((file) => (0, minimatch_1.minimatch)(file, pattern, { dot: true }));
+        for (const file of matchingConfigFiles) {
+            if ((0, minimatch_1.minimatch)(file, pattern, { dot: true })) {
+                let r = createNodes(file, {}, {
+                    nxJsonConfiguration: nxJson,
+                    workspaceRoot: root,
+                    configFiles: matchingConfigFiles,
+                });
+                for (const node in r.projects) {
+                    const project = {
+                        root: node,
+                        ...r.projects[node],
+                    };
+                    (0, project_configuration_utils_1.mergeProjectConfigurationIntoRootMap)(projectRootMap, project);
+                }
+            }
+        }
+    }
+    return {
+        projects: (0, project_configuration_utils_1.readProjectConfigurationsFromRootMap)(projectRootMap),
+    };
+}
+
+
+/***/ }),
+
+/***/ 53387:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 exports.extractCachedFileData = exports.shouldRecomputeWholeGraph = exports.writeCache = exports.createProjectFileMapCache = exports.readProjectGraphCache = exports.readFileMapCache = exports.ensureCacheDirectory = exports.nxFileMap = exports.nxProjectGraph = void 0;
-const fs_1 = __nccwpck_require__(7147);
+const fs_1 = __nccwpck_require__(57147);
 const fs_extra_1 = __nccwpck_require__(2103);
-const path_1 = __nccwpck_require__(1017);
+const path_1 = __nccwpck_require__(71017);
 const perf_hooks_1 = __nccwpck_require__(4074);
-const cache_directory_1 = __nccwpck_require__(1622);
-const fileutils_1 = __nccwpck_require__(910);
-const versions_1 = __nccwpck_require__(780);
+const cache_directory_1 = __nccwpck_require__(11622);
+const fileutils_1 = __nccwpck_require__(40910);
+const versions_1 = __nccwpck_require__(10780);
 exports.nxProjectGraph = (0, path_1.join)(cache_directory_1.projectGraphCacheDirectory, 'project-graph.json');
 exports.nxFileMap = (0, path_1.join)(cache_directory_1.projectGraphCacheDirectory, 'file-map.json');
 function ensureCacheDirectory() {
@@ -250236,7 +288461,145 @@ function getNxJsonPluginsData(nxJson, packageJsonDeps) {
 
 /***/ }),
 
-/***/ 9400:
+/***/ 26311:
+/***/ ((__unused_webpack_module, exports) => {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.withDeps = exports.pruneExternalNodes = exports.isNpmProject = exports.filterNodes = exports.reverse = void 0;
+const reverseMemo = new Map();
+/**
+ * Returns a new project graph where all the edges are reversed.
+ *
+ * For instance, if project A depends on B, in the reversed graph
+ * B will depend on A.
+ */
+function reverse(graph) {
+    const resultFromMemo = reverseMemo.get(graph);
+    if (resultFromMemo) {
+        return resultFromMemo;
+    }
+    const result = {
+        ...graph,
+        nodes: { ...graph.nodes },
+        externalNodes: { ...graph.externalNodes },
+        dependencies: {},
+    };
+    Object.keys(graph.nodes).forEach((n) => (result.dependencies[n] = []));
+    // we need to keep external node's reverse dependencies to trace our route back
+    if (graph.externalNodes) {
+        Object.keys(graph.externalNodes).forEach((n) => (result.dependencies[n] = []));
+    }
+    Object.values(graph.dependencies).forEach((byProject) => {
+        byProject.forEach((dep) => {
+            const dependency = result.dependencies[dep.target];
+            if (dependency) {
+                dependency.push({
+                    type: dep.type,
+                    source: dep.target,
+                    target: dep.source,
+                });
+            }
+        });
+    });
+    reverseMemo.set(graph, result);
+    reverseMemo.set(result, graph);
+    return result;
+}
+exports.reverse = reverse;
+function filterNodes(predicate) {
+    return (original) => {
+        const graph = { nodes: {}, dependencies: {} };
+        const added = new Set();
+        Object.values(original.nodes).forEach((n) => {
+            if (!predicate || predicate(n)) {
+                graph.nodes[n.name] = n;
+                graph.dependencies[n.name] = [];
+                added.add(n.name);
+            }
+        });
+        Object.values(original.dependencies).forEach((ds) => {
+            ds.forEach((d) => {
+                if (added.has(d.source) && added.has(d.target)) {
+                    graph.dependencies[d.source].push(d);
+                }
+            });
+        });
+        return graph;
+    };
+}
+exports.filterNodes = filterNodes;
+function isNpmProject(project) {
+    return project?.type === 'npm';
+}
+exports.isNpmProject = isNpmProject;
+exports.pruneExternalNodes = filterNodes();
+function withDeps(original, subsetNodes) {
+    const res = { nodes: {}, dependencies: {} };
+    const visitedNodes = [];
+    const visitedEdges = [];
+    Object.values(subsetNodes).forEach(recurNodes);
+    Object.values(subsetNodes).forEach(recurEdges);
+    return res;
+    // ---------------------------------------------------------------------------
+    function recurNodes(node) {
+        if (visitedNodes.indexOf(node.name) > -1)
+            return;
+        res.nodes[node.name] = node;
+        if (!res.dependencies[node.name]) {
+            res.dependencies[node.name] = [];
+        }
+        visitedNodes.push(node.name);
+        original.dependencies[node.name].forEach((n) => {
+            if (original.nodes[n.target]) {
+                recurNodes(original.nodes[n.target]);
+            }
+        });
+    }
+    function recurEdges(node) {
+        if (visitedEdges.indexOf(node.name) > -1)
+            return;
+        visitedEdges.push(node.name);
+        const ds = original.dependencies[node.name];
+        ds.forEach((n) => {
+            if (!original.nodes[n.target]) {
+                return;
+            }
+            if (!res.dependencies[n.source]) {
+                res.dependencies[n.source] = [];
+            }
+            res.dependencies[n.source].push(n);
+        });
+        ds.forEach((n) => {
+            if (original.nodes[n.target]) {
+                recurEdges(original.nodes[n.target]);
+            }
+        });
+    }
+}
+exports.withDeps = withDeps;
+
+
+/***/ }),
+
+/***/ 69461:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.registerPluginTSTranspiler = exports.readPluginPackageJson = void 0;
+const tslib_1 = __nccwpck_require__(63085);
+tslib_1.__exportStar(__nccwpck_require__(22145), exports);
+var loader_1 = __nccwpck_require__(82930);
+Object.defineProperty(exports, "readPluginPackageJson", ({ enumerable: true, get: function () { return loader_1.readPluginPackageJson; } }));
+Object.defineProperty(exports, "registerPluginTSTranspiler", ({ enumerable: true, get: function () { return loader_1.registerPluginTSTranspiler; } }));
+
+
+/***/ }),
+
+/***/ 19400:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
@@ -250245,12 +288608,12 @@ function getNxJsonPluginsData(nxJson, packageJsonDeps) {
 // For the public API, used by plugin authors, see `./public-api.ts`.
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 exports.getDefaultPlugins = exports.loadNxPlugins = exports.nxPluginCache = exports.LoadedNxPlugin = void 0;
-const path_1 = __nccwpck_require__(1017);
-const workspace_root_1 = __nccwpck_require__(4393);
-const angular_json_1 = __nccwpck_require__(5205);
-const utils_1 = __nccwpck_require__(852);
+const path_1 = __nccwpck_require__(71017);
+const workspace_root_1 = __nccwpck_require__(64393);
+const angular_json_1 = __nccwpck_require__(45205);
+const utils_1 = __nccwpck_require__(10852);
 const isolation_1 = __nccwpck_require__(9148);
-const loader_1 = __nccwpck_require__(2930);
+const loader_1 = __nccwpck_require__(82930);
 class LoadedNxPlugin {
     constructor(plugin, pluginDefinition) {
         this.name = plugin.name;
@@ -250268,6 +288631,9 @@ class LoadedNxPlugin {
         if (plugin.createDependencies) {
             this.createDependencies = (context) => plugin.createDependencies(this.options, context);
         }
+        if (plugin.createMetadata) {
+            this.createMetadata = (graph, context) => plugin.createMetadata(graph, this.options, context);
+        }
         this.processProjectGraph = plugin.processProjectGraph;
     }
 }
@@ -250277,12 +288643,14 @@ exports.LoadedNxPlugin = LoadedNxPlugin;
 // Allows loaded plugins to not be reloaded when
 // referenced multiple times.
 exports.nxPluginCache = new Map();
-async function loadNxPlugins(plugins, root = workspace_root_1.workspaceRoot) {
+async function loadNxPlugins(plugins, root = workspace_root_1.workspaceRoot, skipDefaultPlugins = false) {
     const result = [];
     const loadingMethod = process.env.NX_ISOLATE_PLUGINS === 'true'
         ? isolation_1.loadNxPluginInIsolation
         : loader_1.loadNxPlugin;
-    plugins = await normalizePlugins(plugins, root);
+    plugins = skipDefaultPlugins
+        ? plugins ?? []
+        : await normalizePlugins(plugins, root);
     const cleanupFunctions = [];
     for (const plugin of plugins) {
         const [loadedPluginPromise, cleanup] = loadingMethod(plugin, root);
@@ -250336,8 +288704,8 @@ exports.getDefaultPlugins = getDefaultPlugins;
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 exports.loadNxPluginInIsolation = void 0;
-const workspace_root_1 = __nccwpck_require__(4393);
-const plugin_pool_1 = __nccwpck_require__(8823);
+const workspace_root_1 = __nccwpck_require__(64393);
+const plugin_pool_1 = __nccwpck_require__(28823);
 /**
  * Used to ensure 1 plugin : 1 worker
  */
@@ -250405,18 +288773,18 @@ exports.consumeMessage = consumeMessage;
 
 /***/ }),
 
-/***/ 8823:
+/***/ 28823:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 exports.loadRemoteNxPlugin = void 0;
-const child_process_1 = __nccwpck_require__(8493);
-const path = __nccwpck_require__(1017);
+const child_process_1 = __nccwpck_require__(32081);
+const path = __nccwpck_require__(71017);
 // TODO (@AgentEnder): After scoped verbose logging is implemented, re-add verbose logs here.
 // import { logger } from '../../utils/logger';
-const internal_api_1 = __nccwpck_require__(9400);
+const internal_api_1 = __nccwpck_require__(19400);
 const messaging_1 = __nccwpck_require__(2053);
 const cleanupFunctions = new Set();
 const pluginNames = new Map();
@@ -250484,11 +288852,13 @@ function createWorkerHandler(worker, pending, onload, onloadError) {
         return (0, messaging_1.consumeMessage)(message, {
             'load-result': (result) => {
                 if (result.success) {
-                    const { name, createNodesPattern } = result;
+                    const { name, createNodesPattern, include, exclude } = result;
                     pluginName = name;
                     pluginNames.set(worker, pluginName);
                     onload({
                         name,
+                        include,
+                        exclude,
                         createNodes: createNodesPattern
                             ? [
                                 createNodesPattern,
@@ -250525,6 +288895,17 @@ function createWorkerHandler(worker, pending, onload, onloadError) {
                                 });
                             }
                             : undefined,
+                        createMetadata: result.hasCreateMetadata
+                            ? (graph, ctx) => {
+                                const tx = pluginName + ':createMetadata:' + performance.now();
+                                return registerPendingPromise(tx, pending, () => {
+                                    worker.send({
+                                        type: 'createMetadata',
+                                        payload: { graph, context: ctx, tx },
+                                    });
+                                });
+                            }
+                            : undefined,
                     });
                 }
                 else if (result.success === false) {
@@ -250558,6 +288939,15 @@ function createWorkerHandler(worker, pending, onload, onloadError) {
                     rejector(result.error);
                 }
             },
+            createMetadataResult: ({ tx, ...result }) => {
+                const { resolver, rejector } = pending.get(tx);
+                if (result.success) {
+                    resolver(result.metadata);
+                }
+                else if (result.success === false) {
+                    rejector(result.error);
+                }
+            },
         });
     };
 }
@@ -250593,7 +288983,7 @@ function registerPendingPromise(tx, pending, callback) {
 
 /***/ }),
 
-/***/ 2930:
+/***/ 82930:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
@@ -250601,23 +288991,23 @@ function registerPendingPromise(tx, pending, callback) {
 // This file contains methods and utilities that should **only** be used by the plugin worker.
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 exports.loadNxPluginAsync = exports.loadNxPlugin = exports.getPluginPathAndName = exports.registerPluginTSTranspiler = exports.unregisterPluginTSTranspiler = exports.resolveLocalNxPlugin = exports.readPluginPackageJson = void 0;
-const posix_1 = __nccwpck_require__(410);
-const installation_directory_1 = __nccwpck_require__(7836);
-const package_json_1 = __nccwpck_require__(8618);
-const fileutils_1 = __nccwpck_require__(910);
-const workspace_root_1 = __nccwpck_require__(4393);
-const node_fs_1 = __nccwpck_require__(7561);
-const typescript_1 = __nccwpck_require__(5313);
-const register_1 = __nccwpck_require__(6413);
-const find_project_for_path_1 = __nccwpck_require__(9621);
-const path_1 = __nccwpck_require__(1559);
-const logger_1 = __nccwpck_require__(7270);
-const node_path_1 = __nccwpck_require__(9411);
-const retrieve_workspace_files_1 = __nccwpck_require__(5264);
-const utils_1 = __nccwpck_require__(852);
-const internal_api_1 = __nccwpck_require__(9400);
-const error_types_1 = __nccwpck_require__(4403);
-const path = __nccwpck_require__(410);
+const posix_1 = __nccwpck_require__(90410);
+const installation_directory_1 = __nccwpck_require__(87836);
+const package_json_1 = __nccwpck_require__(78618);
+const fileutils_1 = __nccwpck_require__(40910);
+const workspace_root_1 = __nccwpck_require__(64393);
+const node_fs_1 = __nccwpck_require__(87561);
+const register_1 = __nccwpck_require__(56413);
+const find_project_for_path_1 = __nccwpck_require__(69621);
+const path_1 = __nccwpck_require__(41559);
+const logger_1 = __nccwpck_require__(37270);
+const node_path_1 = __nccwpck_require__(49411);
+const retrieve_workspace_files_1 = __nccwpck_require__(25264);
+const utils_1 = __nccwpck_require__(10852);
+const internal_api_1 = __nccwpck_require__(19400);
+const error_types_1 = __nccwpck_require__(54403);
+const path = __nccwpck_require__(90410);
+const typescript_1 = __nccwpck_require__(32602);
 function readPluginPackageJson(pluginName, projects, paths = (0, installation_directory_1.getNxRequirePaths)()) {
     try {
         const result = (0, package_json_1.readModulePackageJsonWithoutFallbacks)(pluginName, paths);
@@ -250631,6 +289021,9 @@ function readPluginPackageJson(pluginName, projects, paths = (0, installation_di
             const localPluginPath = resolveLocalNxPlugin(pluginName, projects);
             if (localPluginPath) {
                 const localPluginPackageJson = path.join(localPluginPath.path, 'package.json');
+                if (!exports.unregisterPluginTSTranspiler) {
+                    registerPluginTSTranspiler();
+                }
                 return {
                     path: localPluginPackageJson,
                     json: (0, fileutils_1.readJsonFile)(localPluginPackageJson),
@@ -250676,22 +289069,27 @@ function registerPluginTSTranspiler() {
 }
 exports.registerPluginTSTranspiler = registerPluginTSTranspiler;
 function lookupLocalPlugin(importPath, projects, root = workspace_root_1.workspaceRoot) {
-    const plugin = findNxProjectForImportPath(importPath, projects, root);
-    if (!plugin) {
+    const projectConfig = findNxProjectForImportPath(importPath, projects, root);
+    if (!projectConfig) {
         return null;
     }
-    const projectConfig = projects[plugin];
     return { path: path.join(root, projectConfig.root), projectConfig };
 }
 function findNxProjectForImportPath(importPath, projects, root = workspace_root_1.workspaceRoot) {
     const tsConfigPaths = readTsConfigPaths(root);
     const possiblePaths = tsConfigPaths[importPath]?.map((p) => (0, path_1.normalizePath)(path.relative(root, path.join(root, p))));
     if (possiblePaths?.length) {
-        const projectRootMappings = (0, find_project_for_path_1.createProjectRootMappingsFromProjectConfigurations)(projects);
+        const projectRootMappings = new Map();
+        const projectNameMap = new Map();
+        for (const projectRoot in projects) {
+            const project = projects[projectRoot];
+            projectRootMappings.set(project.root, project.name);
+            projectNameMap.set(project.name, project);
+        }
         for (const tsConfigPath of possiblePaths) {
             const nxProject = (0, find_project_for_path_1.findProjectForPath)(tsConfigPath, projectRootMappings);
             if (nxProject) {
-                return nxProject;
+                return projectNameMap.get(nxProject);
             }
         }
         logger_1.logger.verbose('Unable to find local plugin', possiblePaths, projectRootMappings);
@@ -250729,7 +289127,7 @@ function getPluginPathAndName(moduleName, paths, projects, root) {
     let pluginPath;
     let registerTSTranspiler = false;
     try {
-        pluginPath = __nccwpck_require__(5115).resolve(moduleName, {
+        pluginPath = __nccwpck_require__(35115).resolve(moduleName, {
             paths,
         });
         const extension = path.extname(pluginPath);
@@ -250779,7 +289177,7 @@ async function loadNxPluginAsync(pluginConfiguration, paths, root) {
         : pluginConfiguration.plugin;
     try {
         try {
-            /*require.resolve*/(__nccwpck_require__(5115).resolve(moduleName));
+            /*require.resolve*/(__nccwpck_require__(35115).resolve(moduleName));
         }
         catch {
             // If a plugin cannot be resolved, we will need projects to resolve it
@@ -250800,7 +289198,7 @@ async function loadNxPluginAsync(pluginConfiguration, paths, root) {
 }
 exports.loadNxPluginAsync = loadNxPluginAsync;
 async function importPluginModule(pluginPath) {
-    const m = await Promise.resolve(`${pluginPath}`).then(s => __nccwpck_require__(5115)(s));
+    const m = await Promise.resolve(`${pluginPath}`).then(s => __nccwpck_require__(35115)(s));
     if (m.default &&
         ('createNodes' in m.default || 'createDependencies' in m.default)) {
         return m.default;
@@ -250811,17 +289209,30 @@ async function importPluginModule(pluginPath) {
 
 /***/ }),
 
-/***/ 852:
+/***/ 22145:
+/***/ ((__unused_webpack_module, exports) => {
+
+"use strict";
+
+// This file represents the public API for plugins which live in nx.json's plugins array.
+// For methods to interact with plugins from within Nx, see `./internal-api.ts`.
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+
+
+/***/ }),
+
+/***/ 10852:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 exports.runCreateNodesInParallel = exports.normalizeNxPlugin = exports.isNxPluginV1 = exports.isNxPluginV2 = void 0;
-const node_path_1 = __nccwpck_require__(9411);
-const workspaces_1 = __nccwpck_require__(7852);
-const globs_1 = __nccwpck_require__(699);
-const error_types_1 = __nccwpck_require__(4403);
+const node_path_1 = __nccwpck_require__(49411);
+const to_project_name_1 = __nccwpck_require__(10750);
+const globs_1 = __nccwpck_require__(30699);
+const error_types_1 = __nccwpck_require__(54403);
+const perf_hooks_1 = __nccwpck_require__(4074);
 function isNxPluginV2(plugin) {
     return 'createNodes' in plugin || 'createDependencies' in plugin;
 }
@@ -250844,7 +289255,7 @@ function normalizeNxPlugin(plugin) {
                     return {
                         projects: {
                             [root]: {
-                                name: (0, workspaces_1.toProjectName)(configFilePath),
+                                name: (0, to_project_name_1.toProjectName)(configFilePath),
                                 targets: plugin.registerProjectTargets?.(configFilePath),
                             },
                         },
@@ -250857,37 +289268,31 @@ function normalizeNxPlugin(plugin) {
 }
 exports.normalizeNxPlugin = normalizeNxPlugin;
 async function runCreateNodesInParallel(configFiles, plugin, options, context) {
-    performance.mark(`${plugin.name}:createNodes - start`);
+    perf_hooks_1.performance.mark(`${plugin.name}:createNodes - start`);
     const errors = [];
     const results = [];
-    const promises = configFiles.map((file) => {
-        performance.mark(`${plugin.name}:createNodes:${file} - start`);
-        // Result is either static or a promise, using Promise.resolve lets us
-        // handle both cases with same logic
-        const value = Promise.resolve(plugin.createNodes[1](file, options, context));
-        return value
-            .catch((e) => {
-            performance.mark(`${plugin.name}:createNodes:${file} - end`);
+    const promises = configFiles.map(async (file) => {
+        try {
+            const value = await plugin.createNodes[1](file, options, context);
+            if (value) {
+                results.push({
+                    ...value,
+                    file,
+                    pluginName: plugin.name,
+                });
+            }
+        }
+        catch (e) {
             errors.push(new error_types_1.CreateNodesError({
                 error: e,
                 pluginName: plugin.name,
                 file,
             }));
-            return null;
-        })
-            .then((r) => {
-            performance.mark(`${plugin.name}:createNodes:${file} - end`);
-            performance.measure(`${plugin.name}:createNodes:${file}`, `${plugin.name}:createNodes:${file} - start`, `${plugin.name}:createNodes:${file} - end`);
-            // Existing behavior is to ignore null results of
-            // createNodes function.
-            if (r) {
-                results.push({ ...r, file, pluginName: plugin.name });
-            }
-        });
+        }
     });
     await Promise.all(promises).then(() => {
-        performance.mark(`${plugin.name}:createNodes - end`);
-        performance.measure(`${plugin.name}:createNodes`, `${plugin.name}:createNodes - start`, `${plugin.name}:createNodes - end`);
+        perf_hooks_1.performance.mark(`${plugin.name}:createNodes - end`);
+        perf_hooks_1.performance.measure(`${plugin.name}:createNodes`, `${plugin.name}:createNodes - start`, `${plugin.name}:createNodes - end`);
     });
     if (errors.length > 0) {
         throw new error_types_1.AggregateCreateNodesError(plugin.name, errors, results);
@@ -250899,7 +289304,7 @@ exports.runCreateNodesInParallel = runCreateNodesInParallel;
 
 /***/ }),
 
-/***/ 7667:
+/***/ 47667:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
@@ -250909,11 +289314,11 @@ exports.validateDependency = exports.ProjectGraphBuilder = void 0;
 /**
  * Builder for adding nodes and dependencies to a {@link ProjectGraph}
  */
-const project_graph_1 = __nccwpck_require__(2733);
-const build_project_graph_1 = __nccwpck_require__(9254);
+const project_graph_1 = __nccwpck_require__(72733);
+const build_project_graph_1 = __nccwpck_require__(99254);
 /**
  * A class which builds up a project graph
- * @deprecated The {@link ProjectGraphProcessor} has been deprecated. Use a {@link CreateNodes} and/or a {@link CreateDependencies} instead. This will be removed in Nx 19.
+ * @deprecated The {@link ProjectGraphProcessor} has been deprecated. Use a {@link CreateNodes} and/or a {@link CreateDependencies} instead. This will be removed in Nx 20.
  */
 class ProjectGraphBuilder {
     constructor(graph, projectFileMap, nonProjectFiles) {
@@ -251286,26 +289691,26 @@ function getFileData(source, sourceFile, projects, externalNodes, fileMap, nonPr
 
 /***/ }),
 
-/***/ 4913:
+/***/ 54913:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.createProjectGraphAndSourceMapsAsync = exports.createProjectGraphAsync = exports.buildProjectGraphAndSourceMapsWithoutDaemon = exports.readProjectsConfigurationFromProjectGraph = exports.readCachedProjectConfiguration = exports.readCachedProjectGraph = void 0;
+exports.createProjectGraphAndSourceMapsAsync = exports.createProjectGraphAsync = exports.handleProjectGraphError = exports.buildProjectGraphAndSourceMapsWithoutDaemon = exports.readProjectsConfigurationFromProjectGraph = exports.readCachedProjectConfiguration = exports.readCachedProjectGraph = void 0;
 const perf_hooks_1 = __nccwpck_require__(4074);
-const nx_json_1 = __nccwpck_require__(1173);
-const client_1 = __nccwpck_require__(6940);
-const tmp_dir_1 = __nccwpck_require__(1524);
-const fileutils_1 = __nccwpck_require__(910);
-const output_1 = __nccwpck_require__(1862);
+const nx_json_1 = __nccwpck_require__(21173);
+const client_1 = __nccwpck_require__(76940);
+const tmp_dir_1 = __nccwpck_require__(71524);
+const fileutils_1 = __nccwpck_require__(40910);
+const output_1 = __nccwpck_require__(21862);
 const strip_indents_1 = __nccwpck_require__(5440);
-const workspace_root_1 = __nccwpck_require__(4393);
-const build_project_graph_1 = __nccwpck_require__(9254);
-const nx_deps_cache_1 = __nccwpck_require__(3387);
-const error_types_1 = __nccwpck_require__(4403);
-const internal_api_1 = __nccwpck_require__(9400);
-const retrieve_workspace_files_1 = __nccwpck_require__(5264);
+const workspace_root_1 = __nccwpck_require__(64393);
+const build_project_graph_1 = __nccwpck_require__(99254);
+const error_types_1 = __nccwpck_require__(54403);
+const nx_deps_cache_1 = __nccwpck_require__(53387);
+const internal_api_1 = __nccwpck_require__(19400);
+const retrieve_workspace_files_1 = __nccwpck_require__(25264);
 /**
  * Synchronously reads the latest cached copy of the workspace's ProjectGraph.
  * @throws {Error} if there is no cached ProjectGraph to read from
@@ -251384,18 +289789,18 @@ async function buildProjectGraphAndSourceMapsWithoutDaemon() {
     perf_hooks_1.performance.mark('retrieve-workspace-files:end');
     const cacheEnabled = process.env.NX_CACHE_PROJECT_GRAPH !== 'false';
     perf_hooks_1.performance.mark('build-project-graph-using-project-file-map:start');
-    let createDependenciesError;
+    let projectGraphError;
     let projectGraphResult;
     try {
-        projectGraphResult = await (0, build_project_graph_1.buildProjectGraphUsingProjectFileMap)(projects, externalNodes, fileMap, allWorkspaceFiles, rustReferences, cacheEnabled ? (0, nx_deps_cache_1.readFileMapCache)() : null, plugins);
+        projectGraphResult = await (0, build_project_graph_1.buildProjectGraphUsingProjectFileMap)(projects, externalNodes, fileMap, allWorkspaceFiles, rustReferences, cacheEnabled ? (0, nx_deps_cache_1.readFileMapCache)() : null, plugins, sourceMaps);
     }
     catch (e) {
-        if (e instanceof build_project_graph_1.CreateDependenciesError) {
+        if ((0, error_types_1.isAggregateProjectGraphError)(e)) {
             projectGraphResult = {
                 projectGraph: e.partialProjectGraph,
                 projectFileMapCache: null,
             };
-            createDependenciesError = e;
+            projectGraphError = e;
         }
         else {
             throw e;
@@ -251409,7 +289814,7 @@ async function buildProjectGraphAndSourceMapsWithoutDaemon() {
     delete global.NX_GRAPH_CREATION;
     const errors = [
         ...(projectConfigurationsError?.errors ?? []),
-        ...(createDependenciesError?.errors ?? []),
+        ...(projectGraphError?.errors ?? []),
     ];
     if (errors.length > 0) {
         throw new error_types_1.ProjectGraphError(errors, projectGraph, sourceMaps);
@@ -251454,6 +289859,7 @@ function handleProjectGraphError(opts, e) {
         throw e;
     }
 }
+exports.handleProjectGraphError = handleProjectGraphError;
 /**
  * Computes and returns a ProjectGraph.
  *
@@ -251549,7 +289955,7 @@ exports.createProjectGraphAndSourceMapsAsync = createProjectGraphAndSourceMapsAs
 
 /***/ }),
 
-/***/ 7362:
+/***/ 57362:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
@@ -251572,24 +289978,23 @@ exports.buildAllWorkspaceFiles = buildAllWorkspaceFiles;
 
 /***/ }),
 
-/***/ 9621:
+/***/ 69621:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 exports.normalizeProjectRoot = exports.findProjectForPath = exports.createProjectRootMappings = exports.createProjectRootMappingsFromProjectConfigurations = void 0;
-const path_1 = __nccwpck_require__(1017);
-const path_2 = __nccwpck_require__(1559);
+const path_1 = __nccwpck_require__(71017);
+const path_2 = __nccwpck_require__(41559);
 /**
  * This creates a map of project roots to project names to easily look up the project of a file
  * @param projects This is the map of project configurations commonly found in "workspace.json"
  */
 function createProjectRootMappingsFromProjectConfigurations(projects) {
     const projectRootMappings = new Map();
-    for (const projectName of Object.keys(projects)) {
-        const root = projects[projectName].root;
-        projectRootMappings.set(normalizeProjectRoot(root), projectName);
+    for (const { name, root } of Object.values(projects)) {
+        projectRootMappings.set(normalizeProjectRoot(root), name);
     }
     return projectRootMappings;
 }
@@ -251637,7 +290042,7 @@ exports.normalizeProjectRoot = normalizeProjectRoot;
 
 /***/ }),
 
-/***/ 6655:
+/***/ 26655:
 /***/ ((__unused_webpack_module, exports) => {
 
 "use strict";
@@ -251664,24 +290069,22 @@ exports.applyImplicitDependencies = applyImplicitDependencies;
 
 /***/ }),
 
-/***/ 8009:
+/***/ 18009:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 exports.normalizeImplicitDependencies = exports.normalizeProjectTargets = exports.normalizeProjectNodes = void 0;
-const find_matching_projects_1 = __nccwpck_require__(630);
-const project_configuration_utils_1 = __nccwpck_require__(6818);
-async function normalizeProjectNodes(ctx, builder) {
-    const toAdd = [];
+const find_matching_projects_1 = __nccwpck_require__(50630);
+async function normalizeProjectNodes({ projects }, builder) {
     // Sorting projects by name to make sure that the order of projects in the graph is deterministic.
     // This is important to ensure that expanded properties referencing projects (e.g. implicit dependencies)
     // are also deterministic, and thus don't cause the calculated project configuration hash to shift.
-    const projects = Object.keys(ctx.projects).sort();
+    const sortedProjectNames = Object.keys(projects).sort();
     // Used for expanding implicit dependencies (e.g. `@proj/*` or `tag:foo`)
-    const partialProjectGraphNodes = projects.reduce((graph, project) => {
-        const projectConfiguration = ctx.projects[project];
+    const partialProjectGraphNodes = sortedProjectNames.reduce((graph, project) => {
+        const projectConfiguration = projects[project];
         graph[project] = {
             name: project,
             type: projectConfiguration.projectType === 'library' ? 'lib' : 'app', // missing fallback to `e2e`
@@ -251691,8 +290094,9 @@ async function normalizeProjectNodes(ctx, builder) {
         };
         return graph;
     }, {});
-    for (const key of projects) {
-        const p = ctx.projects[key];
+    const toAdd = [];
+    for (const key of sortedProjectNames) {
+        const p = projects[key];
         p.implicitDependencies = normalizeImplicitDependencies(key, p.implicitDependencies, partialProjectGraphNodes);
         p.targets = normalizeProjectTargets(p, key);
         // TODO: remove in v16
@@ -251701,7 +290105,7 @@ async function normalizeProjectNodes(ctx, builder) {
                 ? 'e2e'
                 : 'app'
             : 'lib';
-        const tags = ctx.projects?.[key]?.tags || [];
+        const tags = p.tags || [];
         toAdd.push({
             name: key,
             type: projectType,
@@ -251739,11 +290143,6 @@ function normalizeProjectTargets(project, projectName) {
             delete targets[target];
             continue;
         }
-        targets[target].options = (0, project_configuration_utils_1.resolveNxTokensInOptions)(targets[target].options, project, `${projectName}:${target}`);
-        targets[target].configurations ??= {};
-        for (const configuration in targets[target].configurations) {
-            targets[target].configurations[configuration] = (0, project_configuration_utils_1.resolveNxTokensInOptions)(targets[target].configurations[configuration], project, `${projectName}:${target}:${configuration}`);
-        }
     }
     return targets;
 }
@@ -251764,35 +290163,35 @@ exports.normalizeImplicitDependencies = normalizeImplicitDependencies;
 
 /***/ }),
 
-/***/ 6818:
+/***/ 36818:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.readTargetDefaultsForTarget = exports.resolveNxTokensInOptions = exports.isCompatibleTarget = exports.mergeTargetConfigurations = exports.readProjectConfigurationsFromRootMap = exports.createProjectConfigurations = exports.mergeProjectConfigurationIntoRootMap = void 0;
-const logger_1 = __nccwpck_require__(7270);
-const fileutils_1 = __nccwpck_require__(910);
-const workspace_root_1 = __nccwpck_require__(4393);
-const symbols_1 = __nccwpck_require__(2197);
-const minimatch_1 = __nccwpck_require__(681);
-const path_1 = __nccwpck_require__(1017);
+exports.normalizeTarget = exports.readTargetDefaultsForTarget = exports.resolveNxTokensInOptions = exports.isCompatibleTarget = exports.mergeTargetConfigurations = exports.validateProject = exports.readProjectConfigurationsFromRootMap = exports.createProjectConfigurations = exports.mergeMetadata = exports.mergeProjectConfigurationIntoRootMap = void 0;
+const logger_1 = __nccwpck_require__(37270);
+const fileutils_1 = __nccwpck_require__(40910);
+const workspace_root_1 = __nccwpck_require__(64393);
+const symbols_1 = __nccwpck_require__(32197);
+const minimatch_1 = __nccwpck_require__(20681);
+const path_1 = __nccwpck_require__(71017);
 const perf_hooks_1 = __nccwpck_require__(4074);
-const error_types_1 = __nccwpck_require__(4403);
+const error_types_1 = __nccwpck_require__(54403);
 function mergeProjectConfigurationIntoRootMap(projectRootMap, project, configurationSourceMaps, sourceInformation, 
 // This function is used when reading project configuration
 // in generators, where we don't want to do this.
-skipCommandNormalization) {
+skipTargetNormalization) {
     if (configurationSourceMaps && !configurationSourceMaps[project.root]) {
         configurationSourceMaps[project.root] = {};
     }
     const sourceMap = configurationSourceMaps?.[project.root];
-    let matchingProject = projectRootMap.get(project.root);
+    let matchingProject = projectRootMap[project.root];
     if (!matchingProject) {
-        projectRootMap.set(project.root, {
+        projectRootMap[project.root] = {
             root: project.root,
-        });
-        matchingProject = projectRootMap.get(project.root);
+        };
+        matchingProject = projectRootMap[project.root];
         if (sourceMap) {
             sourceMap[`root`] = sourceInformation;
         }
@@ -251899,16 +290298,18 @@ skipCommandNormalization) {
                 !matchingProject.targets?.[targetName]) {
                 continue;
             }
-            const mergedTarget = mergeTargetConfigurations(skipCommandNormalization
+            const normalizedTarget = skipTargetNormalization
                 ? target
-                : resolveCommandSyntacticSugar(target, project.root), matchingProject.targets?.[targetName], sourceMap, sourceInformation, `targets.${targetName}`);
+                : resolveCommandSyntacticSugar(target, project.root);
+            const mergedTarget = mergeTargetConfigurations(normalizedTarget, matchingProject.targets?.[targetName], sourceMap, sourceInformation, `targets.${targetName}`);
             // We don't want the symbol to live on past the merge process
             if (mergedTarget?.[symbols_1.ONLY_MODIFIES_EXISTING_TARGET])
                 delete mergedTarget?.[symbols_1.ONLY_MODIFIES_EXISTING_TARGET];
             updatedProjectConfiguration.targets[targetName] = mergedTarget;
         }
     }
-    projectRootMap.set(updatedProjectConfiguration.root, updatedProjectConfiguration);
+    projectRootMap[updatedProjectConfiguration.root] =
+        updatedProjectConfiguration;
 }
 exports.mergeProjectConfigurationIntoRootMap = mergeProjectConfigurationIntoRootMap;
 function mergeMetadata(sourceMap, sourceInformation, baseSourceMapPath, metadata, matchingMetadata) {
@@ -251980,6 +290381,7 @@ function mergeMetadata(sourceMap, sourceInformation, baseSourceMapPath, metadata
     }
     return result;
 }
+exports.mergeMetadata = mergeMetadata;
 /**
  * Transforms a list of project paths into a map of project configurations.
  *
@@ -252034,7 +290436,7 @@ plugins) {
     }
     return Promise.all(results).then((results) => {
         perf_hooks_1.performance.mark('createNodes:merge - start');
-        const projectRootMap = new Map();
+        const projectRootMap = {};
         const externalNodes = {};
         const configurationSourceMaps = {};
         for (const result of results.flat()) {
@@ -252061,14 +290463,12 @@ plugins) {
             }
             Object.assign(externalNodes, pluginExternalNodes);
         }
-        let projects;
         try {
-            projects = readProjectConfigurationsFromRootMap(projectRootMap);
+            validateAndNormalizeProjectRootMap(projectRootMap);
         }
         catch (e) {
             if ((0, error_types_1.isProjectsWithNoNameError)(e) ||
-                (0, error_types_1.isProjectsWithConflictingNamesError)(e)) {
-                projects = e.projects;
+                (0, error_types_1.isMultipleProjectsWithSameNameError)(e)) {
                 errors.push(e);
             }
             else {
@@ -252082,18 +290482,20 @@ plugins) {
         perf_hooks_1.performance.measure('build-project-configs', 'build-project-configs:start', 'build-project-configs:end');
         if (errors.length === 0) {
             return {
-                projects,
+                projects: projectRootMap,
                 externalNodes,
                 projectRootMap: rootMap,
                 sourceMaps: configurationSourceMaps,
+                matchingProjectFiles: projectFiles,
             };
         }
         else {
             throw new error_types_1.ProjectConfigurationsError(errors, {
-                projects,
+                projects: projectRootMap,
                 externalNodes,
                 projectRootMap: rootMap,
                 sourceMaps: configurationSourceMaps,
+                matchingProjectFiles: projectFiles,
             });
         }
     });
@@ -252106,34 +290508,34 @@ function readProjectConfigurationsFromRootMap(projectRootMap) {
     // to provide better error messaging.
     const conflicts = new Map();
     const projectRootsWithNoName = [];
-    for (const [root, configuration] of projectRootMap.entries()) {
+    for (const root in projectRootMap) {
+        const project = projectRootMap[root];
         // We're setting `// targets` as a comment `targets` is empty due to Project Crystal.
         // Strip it before returning configuration for usage.
-        if (configuration['// targets'])
-            delete configuration['// targets'];
-        if (!configuration.name) {
-            try {
-                const { name } = (0, fileutils_1.readJsonFile)((0, path_1.join)(root, 'package.json'));
-                configuration.name = name;
+        if (project['// targets'])
+            delete project['// targets'];
+        try {
+            validateProject(project, projects);
+            projects[project.name] = project;
+        }
+        catch (e) {
+            if ((0, error_types_1.isProjectWithNoNameError)(e)) {
+                projectRootsWithNoName.push(e.projectRoot);
             }
-            catch {
-                projectRootsWithNoName.push(root);
+            else if ((0, error_types_1.isProjectWithExistingNameError)(e)) {
+                const rootErrors = conflicts.get(e.projectName) ?? [
+                    projects[e.projectName].root,
+                ];
+                rootErrors.push(e.projectRoot);
+                conflicts.set(e.projectName, rootErrors);
+            }
+            else {
+                throw e;
             }
-        }
-        if (configuration.name in projects) {
-            let rootErrors = conflicts.get(configuration.name) ?? [
-                projects[configuration.name].root,
-            ];
-            rootErrors.push(root);
-            conflicts.set(configuration.name, rootErrors);
-            projects[configuration.name] = configuration;
-        }
-        else {
-            projects[configuration.name] = configuration;
         }
     }
     if (conflicts.size > 0) {
-        throw new error_types_1.ProjectsWithConflictingNamesError(conflicts, projects);
+        throw new error_types_1.MultipleProjectsWithSameNameError(conflicts, projects);
     }
     if (projectRootsWithNoName.length > 0) {
         throw new error_types_1.ProjectsWithNoNameError(projectRootsWithNoName, projects);
@@ -252141,6 +290543,76 @@ function readProjectConfigurationsFromRootMap(projectRootMap) {
     return projects;
 }
 exports.readProjectConfigurationsFromRootMap = readProjectConfigurationsFromRootMap;
+function validateAndNormalizeProjectRootMap(projectRootMap) {
+    // Name -> Project, used to validate that all projects have unique names
+    const projects = {};
+    // If there are projects that have the same name, that is an error.
+    // This object tracks name -> (all roots of projects with that name)
+    // to provide better error messaging.
+    const conflicts = new Map();
+    const projectRootsWithNoName = [];
+    for (const root in projectRootMap) {
+        const project = projectRootMap[root];
+        // We're setting `// targets` as a comment `targets` is empty due to Project Crystal.
+        // Strip it before returning configuration for usage.
+        if (project['// targets'])
+            delete project['// targets'];
+        try {
+            validateProject(project, projects);
+            projects[project.name] = project;
+        }
+        catch (e) {
+            if ((0, error_types_1.isProjectWithNoNameError)(e)) {
+                projectRootsWithNoName.push(e.projectRoot);
+            }
+            else if ((0, error_types_1.isProjectWithExistingNameError)(e)) {
+                const rootErrors = conflicts.get(e.projectName) ?? [
+                    projects[e.projectName].root,
+                ];
+                rootErrors.push(e.projectRoot);
+                conflicts.set(e.projectName, rootErrors);
+            }
+            else {
+                throw e;
+            }
+        }
+        for (const targetName in project.targets) {
+            project.targets[targetName] = normalizeTarget(project.targets[targetName], project);
+            if (!project.targets[targetName].executor &&
+                !project.targets[targetName].command) {
+                delete project.targets[targetName];
+            }
+        }
+    }
+    if (conflicts.size > 0) {
+        throw new error_types_1.MultipleProjectsWithSameNameError(conflicts, projects);
+    }
+    if (projectRootsWithNoName.length > 0) {
+        throw new error_types_1.ProjectsWithNoNameError(projectRootsWithNoName, projects);
+    }
+    return projectRootMap;
+}
+function validateProject(project, 
+// name -> project
+knownProjects) {
+    if (!project.name) {
+        try {
+            const { name } = (0, fileutils_1.readJsonFile)((0, path_1.join)(project.root, 'package.json'));
+            if (!name) {
+                throw new Error(`Project at ${project.root} has no name provided.`);
+            }
+            project.name = name;
+        }
+        catch {
+            throw new error_types_1.ProjectWithNoNameError(project.root);
+        }
+    }
+    else if (knownProjects[project.name] &&
+        knownProjects[project.name].root !== project.root) {
+        throw new error_types_1.ProjectWithExistingNameError(project.name, project.root);
+    }
+}
+exports.validateProject = validateProject;
 /**
  * Merges two targets.
  *
@@ -252158,7 +290630,7 @@ function mergeTargetConfigurations(target, baseTarget, projectConfigSourceMap, s
     const { configurations: defaultConfigurations, options: defaultOptions, ...baseTargetProperties } = baseTarget ?? {};
     // Target is "compatible", e.g. executor is defined only once or is the same
     // in both places. This means that it is likely safe to merge
-    const isCompatible = isCompatibleTarget(baseTargetProperties, target);
+    const isCompatible = isCompatibleTarget(baseTarget ?? {}, target);
     // If the targets are not compatible, we would normally overwrite the old target
     // with the new one. However, we have a special case for targets that have the
     // ONLY_MODIFIES_EXISTING_TARGET symbol set. This prevents the merged target
@@ -252221,8 +290693,8 @@ function isCompatibleTarget(a, b) {
         return false;
     const isRunCommands = a.executor === 'nx:run-commands';
     if (isRunCommands) {
-        const aCommand = a.options?.command ?? a.options?.commands.join(' && ');
-        const bCommand = b.options?.command ?? b.options?.commands.join(' && ');
+        const aCommand = a.options?.command ?? a.options?.commands?.join(' && ');
+        const bCommand = b.options?.command ?? b.options?.commands?.join(' && ');
         const oneHasNoCommand = !aCommand || !bCommand;
         const hasSameCommand = aCommand === bCommand;
         return oneHasNoCommand || hasSameCommand;
@@ -252314,7 +290786,8 @@ function readTargetDefaultsForTarget(targetName, targetDefaults, executor) {
 exports.readTargetDefaultsForTarget = readTargetDefaultsForTarget;
 function createRootMap(projectRootMap) {
     const map = {};
-    for (const [projectRoot, { name: projectName }] of projectRootMap) {
+    for (const projectRoot in projectRootMap) {
+        const projectName = projectRootMap[projectRoot].name;
         map[projectRoot] = projectName;
     }
     return map;
@@ -252338,11 +290811,21 @@ function resolveCommandSyntacticSugar(target, key) {
         };
     }
 }
+function normalizeTarget(target, project) {
+    target = resolveCommandSyntacticSugar(target, project.root);
+    target.options = resolveNxTokensInOptions(target.options, project, `${project.root}:${target}`);
+    target.configurations ??= {};
+    for (const configuration in target.configurations) {
+        target.configurations[configuration] = resolveNxTokensInOptions(target.configurations[configuration], project, `${project.root}:${target}:${configuration}`);
+    }
+    return target;
+}
+exports.normalizeTarget = normalizeTarget;
 
 
 /***/ }),
 
-/***/ 5264:
+/***/ 25264:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
@@ -252350,13 +290833,13 @@ function resolveCommandSyntacticSugar(target, key) {
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 exports.configurationGlobs = exports.retrieveProjectConfigurationsWithoutPluginInference = exports.retrieveProjectConfigurationPaths = exports.retrieveProjectConfigurationsWithAngularProjects = exports.retrieveProjectConfigurations = exports.retrieveWorkspaceFiles = void 0;
 const perf_hooks_1 = __nccwpck_require__(4074);
-const angular_json_1 = __nccwpck_require__(5205);
-const nx_json_1 = __nccwpck_require__(1173);
-const project_configuration_utils_1 = __nccwpck_require__(6818);
-const internal_api_1 = __nccwpck_require__(9400);
-const workspace_context_1 = __nccwpck_require__(8897);
-const build_all_workspace_files_1 = __nccwpck_require__(7362);
-const path_1 = __nccwpck_require__(1017);
+const angular_json_1 = __nccwpck_require__(45205);
+const nx_json_1 = __nccwpck_require__(21173);
+const project_configuration_utils_1 = __nccwpck_require__(36818);
+const internal_api_1 = __nccwpck_require__(19400);
+const workspace_context_1 = __nccwpck_require__(98897);
+const build_all_workspace_files_1 = __nccwpck_require__(57362);
+const path_1 = __nccwpck_require__(71017);
 /**
  * Walks the workspace directory to create the `projectFileMap`, `ProjectConfigurations` and `allWorkspaceFiles`
  * @throws
@@ -252439,15 +290922,16 @@ exports.configurationGlobs = configurationGlobs;
 
 /***/ }),
 
-/***/ 5341:
+/***/ 45341:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 exports.assertWorkspaceValidity = void 0;
-const find_matching_projects_1 = __nccwpck_require__(630);
-const output_1 = __nccwpck_require__(1862);
+const find_matching_projects_1 = __nccwpck_require__(50630);
+const output_1 = __nccwpck_require__(21862);
+const devkit_internals_1 = __nccwpck_require__(28970);
 function assertWorkspaceValidity(projects, nxJson) {
     const projectNames = Object.keys(projects);
     const projectGraphNodes = projectNames.reduce((graph, project) => {
@@ -252512,7 +290996,7 @@ function assertWorkspaceValidity(projects, nxJson) {
         })
             .join('\n\n');
     }
-    throw new Error(`Configuration Error\n${message}`);
+    throw new devkit_internals_1.WorkspaceValidityError(message);
 }
 exports.assertWorkspaceValidity = assertWorkspaceValidity;
 function detectAndSetInvalidProjectGlobValues(map, sourceName, desiredImplicitDeps, projectConfigurations, projects) {
@@ -252531,17 +291015,17 @@ function detectAndSetInvalidProjectGlobValues(map, sourceName, desiredImplicitDe
 
 /***/ }),
 
-/***/ 1622:
+/***/ 11622:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 exports.projectGraphCacheDirectory = exports.cacheDirectoryForWorkspace = exports.cacheDir = void 0;
-const fs_1 = __nccwpck_require__(7147);
-const path_1 = __nccwpck_require__(1017);
-const fileutils_1 = __nccwpck_require__(910);
-const workspace_root_1 = __nccwpck_require__(4393);
+const fs_1 = __nccwpck_require__(57147);
+const path_1 = __nccwpck_require__(71017);
+const fileutils_1 = __nccwpck_require__(40910);
+const workspace_root_1 = __nccwpck_require__(64393);
 function readCacheDirectoryProperty(root) {
     try {
         const nxJson = (0, fileutils_1.readJsonFile)((0, path_1.join)(root, 'nx.json'));
@@ -252607,7 +291091,7 @@ exports.projectGraphCacheDirectory = absolutePath(workspace_root_1.workspaceRoot
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 exports.codeFrameColumns = void 0;
 // Adapted from https://raw.githubusercontent.com/babel/babel/4108524/packages/babel-code-frame/src/index.js
-const chalk = __nccwpck_require__(8818);
+const chalk = __nccwpck_require__(78818);
 /**
  * Chalk styles for code frame token types.
  */
@@ -252726,7 +291210,7 @@ exports.codeFrameColumns = codeFrameColumns;
 
 /***/ }),
 
-/***/ 6696:
+/***/ 66696:
 /***/ ((__unused_webpack_module, exports) => {
 
 "use strict";
@@ -252756,18 +291240,18 @@ exports.consumeMessagesFromSocket = consumeMessagesFromSocket;
 
 /***/ }),
 
-/***/ 910:
+/***/ 40910:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 exports.readFileIfExisting = exports.extractFileFromTarball = exports.isRelativePath = exports.createDirectory = exports.fileExists = exports.directoryExists = exports.writeJsonFile = exports.readYamlFile = exports.readJsonFile = void 0;
-const json_1 = __nccwpck_require__(4324);
-const fs_1 = __nccwpck_require__(7147);
-const path_1 = __nccwpck_require__(1017);
+const json_1 = __nccwpck_require__(54324);
+const fs_1 = __nccwpck_require__(57147);
+const path_1 = __nccwpck_require__(71017);
 const tar = __nccwpck_require__(2283);
-const zlib_1 = __nccwpck_require__(9796);
+const zlib_1 = __nccwpck_require__(59796);
 /**
  * Reads a JSON file and returns the object the JSON content represents.
  *
@@ -252797,7 +291281,7 @@ exports.readJsonFile = readJsonFile;
  */
 function readYamlFile(path, options) {
     const content = (0, fs_1.readFileSync)(path, 'utf-8');
-    const { load } = __nccwpck_require__(1917);
+    const { load } = __nccwpck_require__(21917);
     return load(content, { ...options, filename: path });
 }
 exports.readYamlFile = readYamlFile;
@@ -252899,14 +291383,14 @@ exports.readFileIfExisting = readFileIfExisting;
 
 /***/ }),
 
-/***/ 630:
+/***/ 50630:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 exports.getMatchingStringsWithCache = exports.findMatchingProjects = void 0;
-const minimatch_1 = __nccwpck_require__(681);
+const minimatch_1 = __nccwpck_require__(20681);
 const validPatternTypes = [
     'name', // Pattern is based on the project's name
     'tag', // Pattern is based on the project's tags
@@ -253105,7 +291589,7 @@ exports.getMatchingStringsWithCache = (() => {
 
 /***/ }),
 
-/***/ 699:
+/***/ 30699:
 /***/ ((__unused_webpack_module, exports) => {
 
 "use strict";
@@ -253121,15 +291605,98 @@ exports.combineGlobPatterns = combineGlobPatterns;
 
 /***/ }),
 
-/***/ 7836:
+/***/ 22810:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.getIgnoreObject = exports.getAlwaysIgnore = exports.getIgnoredGlobs = exports.ALWAYS_IGNORE = void 0;
+const fs_extra_1 = __nccwpck_require__(2103);
+const ignore_1 = __nccwpck_require__(91230);
+const fileutils_1 = __nccwpck_require__(40910);
+const path_1 = __nccwpck_require__(41559);
+const workspace_root_1 = __nccwpck_require__(64393);
+/**
+ * An array of glob patterns that should always be ignored.
+ */
+exports.ALWAYS_IGNORE = getAlwaysIgnore();
+function getIgnoredGlobs(root = workspace_root_1.workspaceRoot, prependRoot = true) {
+    const files = ['.gitignore', '.nxignore'];
+    if (prependRoot) {
+        return [
+            ...getAlwaysIgnore(root),
+            ...files.flatMap((f) => getIgnoredGlobsFromFile((0, path_1.joinPathFragments)(root, f), root)),
+        ];
+    }
+    else {
+        return [
+            ...getAlwaysIgnore(),
+            ...files.flatMap((f) => getIgnoredGlobsFromFile((0, path_1.joinPathFragments)(root, f))),
+        ];
+    }
+}
+exports.getIgnoredGlobs = getIgnoredGlobs;
+function getAlwaysIgnore(root) {
+    const paths = [
+        'node_modules',
+        '**/node_modules',
+        '.git',
+        '.nx',
+        '.vscode',
+        '.yarn/cache',
+    ];
+    return root ? paths.map((x) => (0, path_1.joinPathFragments)(root, x)) : paths;
+}
+exports.getAlwaysIgnore = getAlwaysIgnore;
+function getIgnoreObject(root = workspace_root_1.workspaceRoot) {
+    const ig = (0, ignore_1.default)();
+    ig.add((0, fileutils_1.readFileIfExisting)(`${root}/.gitignore`));
+    ig.add((0, fileutils_1.readFileIfExisting)(`${root}/.nxignore`));
+    return ig;
+}
+exports.getIgnoreObject = getIgnoreObject;
+function getIgnoredGlobsFromFile(file, root) {
+    try {
+        const results = [];
+        const contents = (0, fs_extra_1.readFileSync)(file, 'utf-8');
+        const lines = contents.split('\n');
+        for (const line of lines) {
+            const trimmed = line.trim();
+            if (!trimmed || trimmed.startsWith('#')) {
+                continue;
+            }
+            else if (trimmed.startsWith('/')) {
+                if (root) {
+                    results.push((0, path_1.joinPathFragments)(root, trimmed));
+                }
+                else {
+                    results.push((0, path_1.joinPathFragments)('.', trimmed));
+                }
+            }
+            else {
+                results.push(trimmed);
+            }
+        }
+        return results;
+    }
+    catch (e) {
+        return [];
+    }
+}
+
+
+/***/ }),
+
+/***/ 87836:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 exports.getNxRequirePaths = exports.getNxInstallationPath = void 0;
-const path_1 = __nccwpck_require__(1017);
-const workspace_root_1 = __nccwpck_require__(4393);
+const path_1 = __nccwpck_require__(71017);
+const workspace_root_1 = __nccwpck_require__(64393);
 function getNxInstallationPath(root = workspace_root_1.workspaceRoot) {
     return (0, path_1.join)(root, '.nx', 'installation');
 }
@@ -253142,7 +291709,7 @@ exports.getNxRequirePaths = getNxRequirePaths;
 
 /***/ }),
 
-/***/ 8590:
+/***/ 48590:
 /***/ ((__unused_webpack_module, exports) => {
 
 "use strict";
@@ -253170,16 +291737,136 @@ exports.isCI = isCI;
 
 /***/ }),
 
-/***/ 4324:
+/***/ 37845:
+/***/ ((__unused_webpack_module, exports) => {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.deepEquals = exports.walkJsonTree = exports.jsonDiff = exports.isJsonChange = exports.JsonDiffType = void 0;
+var JsonDiffType;
+(function (JsonDiffType) {
+    JsonDiffType["Deleted"] = "JsonPropertyDeleted";
+    JsonDiffType["Added"] = "JsonPropertyAdded";
+    JsonDiffType["Modified"] = "JsonPropertyModified";
+})(JsonDiffType || (exports.JsonDiffType = JsonDiffType = {}));
+function isJsonChange(change) {
+    return (change.type === JsonDiffType.Added ||
+        change.type === JsonDiffType.Deleted ||
+        change.type === JsonDiffType.Modified);
+}
+exports.isJsonChange = isJsonChange;
+function jsonDiff(lhs, rhs) {
+    const result = [];
+    const seenInLhs = new Set();
+    walkJsonTree(lhs, [], (path, lhsValue) => {
+        seenInLhs.add(hashArray(path));
+        const rhsValue = getJsonValue(path, rhs);
+        if (rhsValue === undefined) {
+            result.push({
+                type: JsonDiffType.Deleted,
+                path,
+                value: {
+                    lhs: lhsValue,
+                    rhs: undefined,
+                },
+            });
+        }
+        else if (!deepEquals(lhsValue, rhsValue)) {
+            result.push({
+                type: JsonDiffType.Modified,
+                path,
+                value: {
+                    lhs: lhsValue,
+                    rhs: rhsValue,
+                },
+            });
+        }
+        return typeof lhsValue === 'object' || Array.isArray(lhsValue);
+    });
+    walkJsonTree(rhs, [], (path, rhsValue) => {
+        const addedInRhs = !seenInLhs.has(hashArray(path));
+        if (addedInRhs) {
+            result.push({
+                type: JsonDiffType.Added,
+                path,
+                value: {
+                    lhs: undefined,
+                    rhs: rhsValue,
+                },
+            });
+        }
+        return typeof rhsValue === 'object' || Array.isArray(rhsValue);
+    });
+    return result;
+}
+exports.jsonDiff = jsonDiff;
+// Depth-first walk down JSON tree.
+function walkJsonTree(json, currPath, visitor) {
+    if (!json || typeof json !== 'object') {
+        return;
+    }
+    Object.keys(json).forEach((key) => {
+        const path = currPath.concat([key]);
+        const shouldContinue = visitor(path, json[key]);
+        if (shouldContinue) {
+            walkJsonTree(json[key], path, visitor);
+        }
+    });
+}
+exports.walkJsonTree = walkJsonTree;
+function hashArray(ary) {
+    return JSON.stringify(ary);
+}
+function getJsonValue(path, json) {
+    let curr = json;
+    for (const k of path) {
+        curr = curr[k];
+        if (curr === undefined) {
+            break;
+        }
+    }
+    return curr;
+}
+function deepEquals(a, b) {
+    if (a === b) {
+        return true;
+    }
+    // Values do not need to be checked for deep equality and the above is false
+    if (
+    // Values are different types
+    typeof a !== typeof b ||
+        // Values are the same type but not an object or array
+        (typeof a !== 'object' && !Array.isArray(a)) ||
+        // Objects are the same type, objects or arrays, but do not have the same number of keys
+        Object.keys(a).length !== Object.keys(b).length) {
+        return false;
+    }
+    // Values need to be checked for deep equality
+    return Object.entries(a).reduce((equal, [key, aValue]) => {
+        // Skip other keys if it is already not equal.
+        if (!equal) {
+            return equal;
+        }
+        // Traverse the object
+        return deepEquals(aValue, b[key]);
+    }, true);
+}
+exports.deepEquals = deepEquals;
+
+
+/***/ }),
+
+/***/ 54324:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 exports.serializeJson = exports.parseJson = exports.stripJsonComments = void 0;
-const jsonc_parser_1 = __nccwpck_require__(245);
+const jsonc_parser_1 = __nccwpck_require__(80245);
 Object.defineProperty(exports, "stripJsonComments", ({ enumerable: true, get: function () { return jsonc_parser_1.stripComments; } }));
-const lines_and_columns_1 = __nccwpck_require__(8308);
+const lines_and_columns_1 = __nccwpck_require__(28308);
 const code_frames_1 = __nccwpck_require__(7142);
 /**
  * Parses the given JSON string and returns the object the JSON content represents.
@@ -253240,14 +291927,14 @@ exports.serializeJson = serializeJson;
 
 /***/ }),
 
-/***/ 7270:
+/***/ 37270:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 exports.stripIndent = exports.logger = exports.NX_ERROR = exports.NX_PREFIX = void 0;
-const chalk = __nccwpck_require__(8818);
+const chalk = __nccwpck_require__(78818);
 exports.NX_PREFIX = chalk.inverse(chalk.bold(chalk.cyan(' NX ')));
 exports.NX_ERROR = chalk.inverse(chalk.bold(chalk.red(' ERROR ')));
 exports.logger = {
@@ -253300,17 +291987,66 @@ exports.stripIndent = stripIndent;
 
 /***/ }),
 
-/***/ 1862:
+/***/ 1995:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.getDefaultPluginsSync = void 0;
+const angular_json_1 = __nccwpck_require__(45205);
+const project_json_1 = __nccwpck_require__(63239);
+const target_defaults_plugin_1 = __nccwpck_require__(98263);
+const PackageJsonWorkspacesPlugin = __nccwpck_require__(6896);
+/**
+ * @todo(@agentender) v20: Remove this fn when we remove readWorkspaceConfig
+ */
+function getDefaultPluginsSync(root) {
+    const plugins = [
+        __nccwpck_require__(43657),
+        ...((0, angular_json_1.shouldMergeAngularProjects)(root, false)
+            ? [(__nccwpck_require__(45205).NxAngularJsonPlugin)]
+            : []),
+        target_defaults_plugin_1.default,
+        PackageJsonWorkspacesPlugin,
+        project_json_1.default,
+    ];
+    return plugins;
+}
+exports.getDefaultPluginsSync = getDefaultPluginsSync;
+
+
+/***/ }),
+
+/***/ 74150:
+/***/ ((__unused_webpack_module, exports) => {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.sortObjectByKeys = void 0;
+function sortObjectByKeys(originalObject) {
+    const keys = Object.keys(originalObject).sort();
+    const sortedObject = {};
+    keys.forEach((key) => (sortedObject[key] = originalObject[key]));
+    return sortedObject;
+}
+exports.sortObjectByKeys = sortObjectByKeys;
+
+
+/***/ }),
+
+/***/ 21862:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 exports.output = void 0;
-const chalk = __nccwpck_require__(8818);
-const os_1 = __nccwpck_require__(2037);
-const readline = __nccwpck_require__(4521);
-const is_ci_1 = __nccwpck_require__(8590);
+const chalk = __nccwpck_require__(78818);
+const os_1 = __nccwpck_require__(22037);
+const readline = __nccwpck_require__(14521);
+const is_ci_1 = __nccwpck_require__(48590);
 const GH_GROUP_PREFIX = '::group::';
 const GH_GROUP_SUFFIX = '::endgroup::';
 /**
@@ -253548,18 +292284,18 @@ exports.output = new CLIOutput();
 
 /***/ }),
 
-/***/ 8618:
+/***/ 78618:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 exports.readModulePackageJson = exports.readModulePackageJsonWithoutFallbacks = exports.readTargetsFromPackageJson = exports.buildTargetFromScript = exports.readNxMigrateConfig = exports.normalizePackageGroup = void 0;
-const fs_1 = __nccwpck_require__(7147);
-const path_1 = __nccwpck_require__(1017);
-const project_configuration_utils_1 = __nccwpck_require__(6818);
-const fileutils_1 = __nccwpck_require__(910);
-const installation_directory_1 = __nccwpck_require__(7836);
+const fs_1 = __nccwpck_require__(57147);
+const path_1 = __nccwpck_require__(71017);
+const project_configuration_utils_1 = __nccwpck_require__(36818);
+const fileutils_1 = __nccwpck_require__(40910);
+const installation_directory_1 = __nccwpck_require__(87836);
 function normalizePackageGroup(packageGroup) {
     return Array.isArray(packageGroup)
         ? packageGroup.map((x) => typeof x === 'string' ? { package: x, version: '*' } : x)
@@ -253691,15 +292427,1060 @@ exports.readModulePackageJson = readModulePackageJson;
 
 /***/ }),
 
-/***/ 1559:
+/***/ 86822:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.packageRegistryPack = exports.packageRegistryView = exports.resolvePackageVersionUsingInstallation = exports.resolvePackageVersionUsingRegistry = exports.createTempNpmDirectory = exports.copyPackageManagerConfigurationFiles = exports.modifyYarnRcToFitNewDirectory = exports.modifyYarnRcYmlToFitNewDirectory = exports.findFileInPackageJsonDirectory = exports.getPackageManagerVersion = exports.getPackageManagerCommand = exports.isWorkspacesEnabled = exports.detectPackageManager = void 0;
+const child_process_1 = __nccwpck_require__(32081);
+const fs_1 = __nccwpck_require__(57147);
+const fs_extra_1 = __nccwpck_require__(2103);
+const path_1 = __nccwpck_require__(71017);
+const semver_1 = __nccwpck_require__(11383);
+const tmp_1 = __nccwpck_require__(8517);
+const util_1 = __nccwpck_require__(73837);
+const configuration_1 = __nccwpck_require__(34333);
+const file_utils_1 = __nccwpck_require__(89294);
+const fileutils_1 = __nccwpck_require__(40910);
+const package_json_1 = __nccwpck_require__(78618);
+const workspace_root_1 = __nccwpck_require__(64393);
+const execAsync = (0, util_1.promisify)(child_process_1.exec);
+/**
+ * Detects which package manager is used in the workspace based on the lock file.
+ */
+function detectPackageManager(dir = '') {
+    const nxJson = (0, configuration_1.readNxJson)();
+    return (nxJson.cli?.packageManager ??
+        ((0, fs_1.existsSync)((0, path_1.join)(dir, 'yarn.lock'))
+            ? 'yarn'
+            : (0, fs_1.existsSync)((0, path_1.join)(dir, 'pnpm-lock.yaml'))
+                ? 'pnpm'
+                : 'npm'));
+}
+exports.detectPackageManager = detectPackageManager;
+/**
+ * Returns true if the workspace is using npm workspaces, yarn workspaces, or pnpm workspaces.
+ * @param packageManager The package manager to use. If not provided, it will be detected based on the lock file.
+ * @param root The directory the commands will be ran inside of. Defaults to the current workspace's root.
+ */
+function isWorkspacesEnabled(packageManager = detectPackageManager(), root = workspace_root_1.workspaceRoot) {
+    if (packageManager === 'pnpm') {
+        return (0, fs_1.existsSync)((0, path_1.join)(root, 'pnpm-workspace.yaml'));
+    }
+    // yarn and pnpm both use the same 'workspaces' property in package.json
+    const packageJson = (0, file_utils_1.readPackageJson)();
+    return !!packageJson?.workspaces;
+}
+exports.isWorkspacesEnabled = isWorkspacesEnabled;
+/**
+ * Returns commands for the package manager used in the workspace.
+ * By default, the package manager is derived based on the lock file,
+ * but it can also be passed in explicitly.
+ *
+ * Example:
+ *
+ * ```javascript
+ * execSync(`${getPackageManagerCommand().addDev} my-dev-package`);
+ * ```
+ *
+ * @param packageManager The package manager to use. If not provided, it will be detected based on the lock file.
+ * @param root The directory the commands will be ran inside of. Defaults to the current workspace's root.
+ */
+function getPackageManagerCommand(packageManager = detectPackageManager(), root = workspace_root_1.workspaceRoot) {
+    const commands = {
+        yarn: () => {
+            const yarnVersion = getPackageManagerVersion('yarn', root);
+            const useBerry = (0, semver_1.gte)(yarnVersion, '2.0.0');
+            return {
+                preInstall: `yarn set version ${yarnVersion}`,
+                install: 'yarn',
+                ciInstall: useBerry
+                    ? 'yarn install --immutable'
+                    : 'yarn install --frozen-lockfile',
+                updateLockFile: useBerry
+                    ? 'yarn install --mode update-lockfile'
+                    : 'yarn install',
+                add: useBerry ? 'yarn add' : 'yarn add -W',
+                addDev: useBerry ? 'yarn add -D' : 'yarn add -D -W',
+                rm: 'yarn remove',
+                exec: 'yarn',
+                dlx: useBerry ? 'yarn dlx' : 'yarn',
+                run: (script, args) => `yarn ${script} ${args}`,
+                list: useBerry ? 'yarn info --name-only' : 'yarn list',
+                getRegistryUrl: useBerry
+                    ? 'yarn config get npmRegistryServer'
+                    : 'yarn config get registry',
+            };
+        },
+        pnpm: () => {
+            const pnpmVersion = getPackageManagerVersion('pnpm', root);
+            const modernPnpm = (0, semver_1.gte)(pnpmVersion, '6.13.0');
+            const includeDoubleDashBeforeArgs = (0, semver_1.lt)(pnpmVersion, '7.0.0');
+            const isPnpmWorkspace = (0, fs_1.existsSync)((0, path_1.join)(root, 'pnpm-workspace.yaml'));
+            return {
+                install: 'pnpm install --no-frozen-lockfile', // explicitly disable in case of CI
+                ciInstall: 'pnpm install --frozen-lockfile',
+                updateLockFile: 'pnpm install --lockfile-only',
+                add: isPnpmWorkspace ? 'pnpm add -w' : 'pnpm add',
+                addDev: isPnpmWorkspace ? 'pnpm add -Dw' : 'pnpm add -D',
+                rm: 'pnpm rm',
+                exec: modernPnpm ? 'pnpm exec' : 'pnpx',
+                dlx: modernPnpm ? 'pnpm dlx' : 'pnpx',
+                run: (script, args) => includeDoubleDashBeforeArgs
+                    ? `pnpm run ${script} -- ${args}`
+                    : `pnpm run ${script} ${args}`,
+                list: 'pnpm ls --depth 100',
+                getRegistryUrl: 'pnpm config get registry',
+            };
+        },
+        npm: () => {
+            // TODO: Remove this
+            process.env.npm_config_legacy_peer_deps ??= 'true';
+            return {
+                install: 'npm install',
+                ciInstall: 'npm ci',
+                updateLockFile: 'npm install --package-lock-only',
+                add: 'npm install',
+                addDev: 'npm install -D',
+                rm: 'npm rm',
+                exec: 'npx',
+                dlx: 'npx',
+                run: (script, args) => `npm run ${script} -- ${args}`,
+                list: 'npm ls',
+                getRegistryUrl: 'npm config get registry',
+            };
+        },
+    };
+    return commands[packageManager]();
+}
+exports.getPackageManagerCommand = getPackageManagerCommand;
+/**
+ * Returns the version of the package manager used in the workspace.
+ * By default, the package manager is derived based on the lock file,
+ * but it can also be passed in explicitly.
+ */
+function getPackageManagerVersion(packageManager = detectPackageManager(), cwd = process.cwd()) {
+    return (0, child_process_1.execSync)(`${packageManager} --version`, {
+        cwd,
+        encoding: 'utf-8',
+    }).trim();
+}
+exports.getPackageManagerVersion = getPackageManagerVersion;
+/**
+ * Checks for a project level npmrc file by crawling up the file tree until
+ * hitting a package.json file, as this is how npm finds them as well.
+ */
+function findFileInPackageJsonDirectory(file, directory = process.cwd()) {
+    while (!(0, fs_1.existsSync)((0, path_1.join)(directory, 'package.json'))) {
+        directory = (0, path_1.dirname)(directory);
+    }
+    const path = (0, path_1.join)(directory, file);
+    return (0, fs_1.existsSync)(path) ? path : null;
+}
+exports.findFileInPackageJsonDirectory = findFileInPackageJsonDirectory;
+/**
+ * We copy yarnrc.yml to the temporary directory to ensure things like the specified
+ * package registry are still used. However, there are a few relative paths that can
+ * cause issues, so we modify them to fit the new directory.
+ *
+ * Exported for testing - not meant to be used outside of this file.
+ *
+ * @param contents The string contents of the yarnrc.yml file
+ * @returns Updated string contents of the yarnrc.yml file
+ */
+function modifyYarnRcYmlToFitNewDirectory(contents) {
+    const { parseSyml, stringifySyml } = __nccwpck_require__(22737);
+    const parsed = parseSyml(contents);
+    if (parsed.yarnPath) {
+        // yarnPath is relative to the workspace root, so we need to make it relative
+        // to the new directory s.t. it still points to the same yarn binary.
+        delete parsed.yarnPath;
+    }
+    if (parsed.plugins) {
+        // Plugins specified by a string are relative paths from workspace root.
+        // ex: https://yarnpkg.com/advanced/plugin-tutorial#writing-our-first-plugin
+        delete parsed.plugins;
+    }
+    return stringifySyml(parsed);
+}
+exports.modifyYarnRcYmlToFitNewDirectory = modifyYarnRcYmlToFitNewDirectory;
+/**
+ * We copy .yarnrc to the temporary directory to ensure things like the specified
+ * package registry are still used. However, there are a few relative paths that can
+ * cause issues, so we modify them to fit the new directory.
+ *
+ * Exported for testing - not meant to be used outside of this file.
+ *
+ * @param contents The string contents of the yarnrc.yml file
+ * @returns Updated string contents of the yarnrc.yml file
+ */
+function modifyYarnRcToFitNewDirectory(contents) {
+    const lines = contents.split('\n');
+    const yarnPathIndex = lines.findIndex((line) => line.startsWith('yarn-path'));
+    if (yarnPathIndex !== -1) {
+        lines.splice(yarnPathIndex, 1);
+    }
+    return lines.join('\n');
+}
+exports.modifyYarnRcToFitNewDirectory = modifyYarnRcToFitNewDirectory;
+function copyPackageManagerConfigurationFiles(root, destination) {
+    for (const packageManagerConfigFile of ['.npmrc', '.yarnrc', '.yarnrc.yml']) {
+        // f is an absolute path, including the {workspaceRoot}.
+        const f = findFileInPackageJsonDirectory(packageManagerConfigFile, root);
+        if (f) {
+            // Destination should be the same relative path from the {workspaceRoot},
+            // but now relative to the destination. `relative` makes `{workspaceRoot}/some/path`
+            // look like `./some/path`, and joining that gets us `{destination}/some/path
+            const destinationPath = (0, path_1.join)(destination, (0, path_1.relative)(root, f));
+            switch (packageManagerConfigFile) {
+                case '.npmrc': {
+                    (0, fs_1.copyFileSync)(f, destinationPath);
+                    break;
+                }
+                case '.yarnrc': {
+                    const updated = modifyYarnRcToFitNewDirectory((0, fileutils_1.readFileIfExisting)(f));
+                    (0, fs_1.writeFileSync)(destinationPath, updated);
+                    break;
+                }
+                case '.yarnrc.yml': {
+                    const updated = modifyYarnRcYmlToFitNewDirectory((0, fileutils_1.readFileIfExisting)(f));
+                    (0, fs_1.writeFileSync)(destinationPath, updated);
+                    break;
+                }
+            }
+        }
+    }
+}
+exports.copyPackageManagerConfigurationFiles = copyPackageManagerConfigurationFiles;
+/**
+ * Creates a temporary directory where you can run package manager commands safely.
+ *
+ * For cases where you'd want to install packages that require an `.npmrc` set up,
+ * this function looks up for the nearest `.npmrc` (if exists) and copies it over to the
+ * temp directory.
+ */
+function createTempNpmDirectory() {
+    const dir = (0, tmp_1.dirSync)().name;
+    // A package.json is needed for pnpm pack and for .npmrc to resolve
+    (0, fileutils_1.writeJsonFile)(`${dir}/package.json`, {});
+    copyPackageManagerConfigurationFiles(workspace_root_1.workspaceRoot, dir);
+    const cleanup = async () => {
+        try {
+            await (0, fs_extra_1.remove)(dir);
+        }
+        catch {
+            // It's okay if this fails, the OS will clean it up eventually
+        }
+    };
+    return { dir, cleanup };
+}
+exports.createTempNpmDirectory = createTempNpmDirectory;
+/**
+ * Returns the resolved version for a given package and version tag using the
+ * NPM registry (when using Yarn it will fall back to NPM to fetch the info).
+ */
+async function resolvePackageVersionUsingRegistry(packageName, version) {
+    try {
+        const result = await packageRegistryView(packageName, version, 'version');
+        if (!result) {
+            throw new Error(`Unable to resolve version ${packageName}@${version}.`);
+        }
+        // get the last line of the output, strip the package version and quotes
+        const resolvedVersion = result
+            .split('\n')
+            .pop()
+            .split(' ')
+            .pop()
+            .replace(/'/g, '');
+        return resolvedVersion;
+    }
+    catch {
+        throw new Error(`Unable to resolve version ${packageName}@${version}.`);
+    }
+}
+exports.resolvePackageVersionUsingRegistry = resolvePackageVersionUsingRegistry;
+/**
+ * Return the resolved version for a given package and version tag using by
+ * installing it in a temporary directory and fetching the version from the
+ * package.json.
+ */
+async function resolvePackageVersionUsingInstallation(packageName, version) {
+    const { dir, cleanup } = createTempNpmDirectory();
+    try {
+        const pmc = getPackageManagerCommand();
+        await execAsync(`${pmc.add} ${packageName}@${version}`, { cwd: dir });
+        const { packageJson } = (0, package_json_1.readModulePackageJson)(packageName, [dir]);
+        return packageJson.version;
+    }
+    finally {
+        await cleanup();
+    }
+}
+exports.resolvePackageVersionUsingInstallation = resolvePackageVersionUsingInstallation;
+async function packageRegistryView(pkg, version, args) {
+    let pm = detectPackageManager();
+    if (pm === 'yarn') {
+        /**
+         * yarn has `yarn info` but it behaves differently than (p)npm,
+         * which makes it's usage unreliable
+         *
+         * @see https://github.com/nrwl/nx/pull/9667#discussion_r842553994
+         */
+        pm = 'npm';
+    }
+    const { stdout } = await execAsync(`${pm} view ${pkg}@${version} ${args}`);
+    return stdout.toString().trim();
+}
+exports.packageRegistryView = packageRegistryView;
+async function packageRegistryPack(cwd, pkg, version) {
+    let pm = detectPackageManager();
+    if (pm === 'yarn') {
+        /**
+         * `(p)npm pack` will download a tarball of the specified version,
+         * whereas `yarn` pack creates a tarball of the active workspace, so it
+         * does not work for getting the content of a library.
+         *
+         * @see https://github.com/nrwl/nx/pull/9667#discussion_r842553994
+         */
+        pm = 'npm';
+    }
+    const { stdout } = await execAsync(`${pm} pack ${pkg}@${version}`, { cwd });
+    const tarballPath = stdout.trim();
+    return { tarballPath };
+}
+exports.packageRegistryPack = packageRegistryPack;
+
+
+/***/ }),
+
+/***/ 55457:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.getPromptsForSchema = exports.convertSmartDefaultsIntoNamedParams = exports.warnDeprecations = exports.combineOptionsForGenerator = exports.combineOptionsForExecutor = exports.applyVerbosity = exports.setDefaults = exports.validateObject = exports.validateOptsAgainstSchema = exports.SchemaError = exports.convertAliases = exports.coerceTypesInOptions = exports.convertToCamelCase = exports.handleErrors = void 0;
+const logger_1 = __nccwpck_require__(37270);
+const output_1 = __nccwpck_require__(21862);
+const client_1 = __nccwpck_require__(76940);
+const LIST_CHOICE_DISPLAY_LIMIT = 10;
+async function handleErrors(isVerbose, fn) {
+    try {
+        return await fn();
+    }
+    catch (err) {
+        err ||= new Error('Unknown error caught');
+        if (err.constructor.name === 'UnsuccessfulWorkflowExecution') {
+            logger_1.logger.error('The generator workflow failed. See above.');
+        }
+        else if (err.name === 'ProjectGraphError') {
+            const projectGraphError = err;
+            let title = projectGraphError.message;
+            if (isVerbose) {
+                title += ' See errors below.';
+            }
+            const bodyLines = isVerbose
+                ? [projectGraphError.stack]
+                : ['Pass --verbose to see the stacktraces.'];
+            output_1.output.error({
+                title,
+                bodyLines: bodyLines,
+            });
+        }
+        else {
+            const lines = (err.message ? err.message : err.toString()).split('\n');
+            const bodyLines = lines.slice(1);
+            if (err.stack && !isVerbose) {
+                bodyLines.push('Pass --verbose to see the stacktrace.');
+            }
+            output_1.output.error({
+                title: lines[0],
+                bodyLines,
+            });
+            if (err.stack && isVerbose) {
+                logger_1.logger.info(err.stack);
+            }
+        }
+        if (client_1.daemonClient.enabled()) {
+            client_1.daemonClient.reset();
+        }
+        return 1;
+    }
+}
+exports.handleErrors = handleErrors;
+function camelCase(input) {
+    if (input.indexOf('-') > 1) {
+        return input
+            .toLowerCase()
+            .replace(/-(.)/g, (match, group1) => group1.toUpperCase());
+    }
+    else {
+        return input;
+    }
+}
+function convertToCamelCase(parsed, schema) {
+    return Object.keys(parsed).reduce((m, c) => {
+        if (schema.properties[camelCase(c)]) {
+            return { ...m, [camelCase(c)]: parsed[c] };
+        }
+        else {
+            return { ...m, [c]: parsed[c] };
+        }
+    }, {});
+}
+exports.convertToCamelCase = convertToCamelCase;
+/**
+ * Coerces (and replaces) options identified as 'boolean' or 'number' in the Schema
+ *
+ * @param opts The options to check
+ * @param schema The schema definition with types to check against
+ *
+ */
+function coerceTypesInOptions(opts, schema) {
+    Object.keys(opts).forEach((k) => {
+        const prop = findSchemaForProperty(k, schema);
+        opts[k] = coerceType(prop?.description, opts[k]);
+    });
+    return opts;
+}
+exports.coerceTypesInOptions = coerceTypesInOptions;
+function coerceType(prop, value) {
+    if (!prop)
+        return value;
+    if (typeof value !== 'string' && value !== undefined)
+        return value;
+    if (prop.oneOf) {
+        for (let i = 0; i < prop.oneOf.length; ++i) {
+            const coerced = coerceType(prop.oneOf[i], value);
+            if (coerced !== value) {
+                return coerced;
+            }
+        }
+        return value;
+    }
+    else if (Array.isArray(prop.type)) {
+        for (let i = 0; i < prop.type.length; ++i) {
+            const coerced = coerceType({ type: prop.type[i] }, value);
+            if (coerced !== value) {
+                return coerced;
+            }
+        }
+        return value;
+    }
+    else if (normalizedPrimitiveType(prop.type) == 'boolean' &&
+        isConvertibleToBoolean(value)) {
+        return value === true || value == 'true';
+    }
+    else if (normalizedPrimitiveType(prop.type) == 'number' &&
+        isConvertibleToNumber(value)) {
+        return Number(value);
+    }
+    else if (prop.type == 'array') {
+        return value.split(',').map((v) => coerceType(prop.items, v));
+    }
+    else {
+        return value;
+    }
+}
+/**
+ * Converts any options passed in with short aliases to their full names if found
+ * Unmatched options are added to opts['--']
+ *
+ * @param opts The options passed in by the user
+ * @param schema The schema definition to check against
+ */
+function convertAliases(opts, schema, excludeUnmatched) {
+    return Object.keys(opts).reduce((acc, k) => {
+        const prop = findSchemaForProperty(k, schema);
+        if (prop) {
+            acc[prop.name] = opts[k];
+        }
+        else if (excludeUnmatched) {
+            if (!acc['--']) {
+                acc['--'] = [];
+            }
+            acc['--'].push({
+                name: k,
+                possible: [],
+            });
+        }
+        else {
+            acc[k] = opts[k];
+        }
+        return acc;
+    }, {});
+}
+exports.convertAliases = convertAliases;
+class SchemaError {
+    constructor(message) {
+        this.message = message;
+    }
+}
+exports.SchemaError = SchemaError;
+function validateOptsAgainstSchema(opts, schema) {
+    validateObject(opts, schema, schema.definitions || {});
+}
+exports.validateOptsAgainstSchema = validateOptsAgainstSchema;
+function validateObject(opts, schema, definitions) {
+    if (schema.anyOf) {
+        const errors = [];
+        for (const s of schema.anyOf) {
+            try {
+                validateObject(opts, s, definitions);
+            }
+            catch (e) {
+                errors.push(e);
+            }
+        }
+        if (errors.length === schema.anyOf.length) {
+            throw new Error(`Options did not match schema. Please fix any of the following errors:\n${errors
+                .map((e) => ' - ' + e.message)
+                .join('\n')}`);
+        }
+    }
+    if (schema.oneOf) {
+        const matches = [];
+        const errors = [];
+        for (const propertyDescription of schema.oneOf) {
+            try {
+                validateObject(opts, propertyDescription, definitions);
+                matches.push(propertyDescription);
+            }
+            catch (error) {
+                errors.push(error);
+            }
+        }
+        // If the options matched none of the oneOf property descriptions
+        if (matches.length === 0) {
+            throw new Error(`Options did not match schema: ${JSON.stringify(opts, null, 2)}.\nPlease fix 1 of the following errors:\n${errors
+                .map((e) => ' - ' + e.message)
+                .join('\n')}`);
+        }
+        // If the options matched none of the oneOf property descriptions
+        if (matches.length > 1) {
+            throw new Error(`Options did not match schema: ${JSON.stringify(opts, null, 2)}.\nShould only match one of \n${matches
+                .map((m) => ' - ' + JSON.stringify(m))
+                .join('\n')}`);
+        }
+    }
+    (schema.required ?? []).forEach((p) => {
+        if (opts[p] === undefined) {
+            throw new SchemaError(`Required property '${p}' is missing`);
+        }
+    });
+    if (schema.additionalProperties !== undefined &&
+        schema.additionalProperties !== true) {
+        Object.keys(opts).find((p) => {
+            if (Object.keys(schema.properties ?? {}).indexOf(p) === -1 &&
+                (!schema.patternProperties ||
+                    !Object.keys(schema.patternProperties).some((pattern) => new RegExp(pattern).test(p)))) {
+                if (p === '_') {
+                    throw new SchemaError(`Schema does not support positional arguments. Argument '${opts[p]}' found`);
+                }
+                else if (schema.additionalProperties === false) {
+                    throw new SchemaError(`'${p}' is not found in schema`);
+                }
+                else if (typeof schema.additionalProperties === 'object') {
+                    validateProperty(p, opts[p], schema.additionalProperties, definitions);
+                }
+            }
+        });
+    }
+    Object.keys(opts).forEach((p) => {
+        validateProperty(p, opts[p], (schema.properties ?? {})[p], definitions);
+        if (schema.patternProperties) {
+            Object.keys(schema.patternProperties).forEach((pattern) => {
+                if (new RegExp(pattern).test(p)) {
+                    validateProperty(p, opts[p], schema.patternProperties[pattern], definitions);
+                }
+            });
+        }
+    });
+}
+exports.validateObject = validateObject;
+function validateProperty(propName, value, schema, definitions) {
+    if (!schema)
+        return;
+    if (schema.$ref) {
+        schema = resolveDefinition(schema.$ref, definitions);
+    }
+    if (schema.oneOf) {
+        if (!Array.isArray(schema.oneOf))
+            throw new Error(`Invalid schema file. oneOf must be an array.`);
+        const passes = schema.oneOf.filter((r) => {
+            try {
+                const rule = { type: schema.type, ...r };
+                validateProperty(propName, value, rule, definitions);
+                return true;
+            }
+            catch (e) {
+                return false;
+            }
+        }).length === 1;
+        if (!passes)
+            throwInvalidSchema(propName, schema);
+        return;
+    }
+    if (schema.anyOf) {
+        if (!Array.isArray(schema.anyOf))
+            throw new Error(`Invalid schema file. anyOf must be an array.`);
+        let passes = false;
+        schema.anyOf.forEach((r) => {
+            try {
+                const rule = { type: schema.type, ...r };
+                validateProperty(propName, value, rule, definitions);
+                passes = true;
+            }
+            catch (e) { }
+        });
+        if (!passes)
+            throwInvalidSchema(propName, schema);
+        return;
+    }
+    if (schema.allOf) {
+        if (!Array.isArray(schema.allOf))
+            throw new Error(`Invalid schema file. allOf must be an array.`);
+        if (!schema.allOf.every((r) => {
+            try {
+                const rule = { type: schema.type, ...r };
+                validateProperty(propName, value, rule, definitions);
+                return true;
+            }
+            catch (e) {
+                return false;
+            }
+        })) {
+            throwInvalidSchema(propName, schema);
+        }
+        return;
+    }
+    const isPrimitive = typeof value !== 'object';
+    if (isPrimitive) {
+        if (schema.const !== undefined && value !== schema.const) {
+            throw new SchemaError(`Property '${propName}' does not match the schema. '${value}' should be '${schema.const}'.`);
+        }
+        if (Array.isArray(schema.type)) {
+            const passes = schema.type.some((t) => {
+                try {
+                    const rule = { type: t };
+                    validateProperty(propName, value, rule, definitions);
+                    return true;
+                }
+                catch (e) {
+                    return false;
+                }
+            });
+            if (!passes) {
+                throw new SchemaError(`Property '${propName}' does not match the schema. '${value}' should be a '${schema.type}'.`);
+            }
+        }
+        else if (schema.type &&
+            typeof value !== normalizedPrimitiveType(schema.type)) {
+            throw new SchemaError(`Property '${propName}' does not match the schema. '${value}' should be a '${schema.type}'.`);
+        }
+        if (schema.enum && !schema.enum.includes(value)) {
+            throw new SchemaError(`Property '${propName}' does not match the schema. '${value}' should be one of ${schema.enum.join(',')}.`);
+        }
+        if (schema.type === 'number') {
+            if (typeof schema.multipleOf === 'number' &&
+                value % schema.multipleOf !== 0) {
+                throw new SchemaError(`Property '${propName}' does not match the schema. ${value} should be a multiple of ${schema.multipleOf}.`);
+            }
+            if (typeof schema.minimum === 'number' && value < schema.minimum) {
+                throw new SchemaError(`Property '${propName}' does not match the schema. ${value} should be at least ${schema.minimum}`);
+            }
+            if (typeof schema.exclusiveMinimum === 'number' &&
+                value <= schema.exclusiveMinimum) {
+                throw new SchemaError(`Property '${propName}' does not match the schema. ${value} should be greater than ${schema.exclusiveMinimum}`);
+            }
+            if (typeof schema.maximum === 'number' && value > schema.maximum) {
+                throw new SchemaError(`Property '${propName}' does not match the schema. ${value} should be at most ${schema.maximum}`);
+            }
+            if (typeof schema.exclusiveMaximum === 'number' &&
+                value >= schema.exclusiveMaximum) {
+                throw new SchemaError(`Property '${propName}' does not match the schema. ${value} should be less than ${schema.exclusiveMaximum}`);
+            }
+        }
+        if (schema.type === 'string') {
+            if (schema.pattern && !new RegExp(schema.pattern).test(value)) {
+                throw new SchemaError(`Property '${propName}' does not match the schema. '${value}' should match the pattern '${schema.pattern}'.`);
+            }
+            if (typeof schema.minLength === 'number' &&
+                value.length < schema.minLength) {
+                throw new SchemaError(`Property '${propName}' does not match the schema. '${value}' (${value.length} character(s)) should have at least ${schema.minLength} character(s).`);
+            }
+            if (typeof schema.maxLength === 'number' &&
+                value.length > schema.maxLength) {
+                throw new SchemaError(`Property '${propName}' does not match the schema. '${value}' (${value.length} character(s)) should have at most ${schema.maxLength} character(s).`);
+            }
+        }
+    }
+    else if (Array.isArray(value)) {
+        if (schema.type !== 'array')
+            throwInvalidSchema(propName, schema);
+        value.forEach((valueInArray) => validateProperty(propName, valueInArray, schema.items || {}, definitions));
+    }
+    else {
+        if (schema.type !== 'object')
+            throwInvalidSchema(propName, schema);
+        validateObject(value, schema, definitions);
+    }
+}
+/**
+ * Unfortunately, due to use supporting Angular Devkit, we have to do the following
+ * conversions.
+ */
+function normalizedPrimitiveType(type) {
+    if (type === 'integer')
+        return 'number';
+    return type;
+}
+function throwInvalidSchema(propName, schema) {
+    throw new SchemaError(`Property '${propName}' does not match the schema.\n${JSON.stringify(schema, null, 2)}'`);
+}
+function setDefaults(opts, schema) {
+    setDefaultsInObject(opts, schema.properties || {}, schema.definitions || {});
+    return opts;
+}
+exports.setDefaults = setDefaults;
+function setDefaultsInObject(opts, properties, definitions) {
+    Object.keys(properties).forEach((p) => {
+        setPropertyDefault(opts, p, properties[p], definitions);
+    });
+}
+function setPropertyDefault(opts, propName, schema, definitions) {
+    if (schema.$ref) {
+        schema = resolveDefinition(schema.$ref, definitions);
+    }
+    if (schema.type !== 'object' && schema.type !== 'array') {
+        if (opts[propName] === undefined && schema.default !== undefined) {
+            opts[propName] = schema.default;
+        }
+    }
+    else if (schema.type === 'array') {
+        const items = schema.items || {};
+        if (opts[propName] &&
+            Array.isArray(opts[propName]) &&
+            items.type === 'object') {
+            opts[propName].forEach((valueInArray) => setDefaultsInObject(valueInArray, items.properties || {}, definitions));
+        }
+        else if (!opts[propName] && schema.default) {
+            opts[propName] = schema.default;
+        }
+    }
+    else {
+        const wasUndefined = opts[propName] === undefined;
+        if (wasUndefined) {
+            // We need an object to set values onto
+            opts[propName] = {};
+        }
+        setDefaultsInObject(opts[propName], schema.properties || {}, definitions);
+        // If the property was initially undefined but no properties were added, we remove it again instead of having an {}
+        if (wasUndefined && Object.keys(opts[propName]).length === 0) {
+            delete opts[propName];
+        }
+    }
+}
+function resolveDefinition(ref, definitions) {
+    if (!ref.startsWith('#/definitions/')) {
+        throw new Error(`$ref should start with "#/definitions/"`);
+    }
+    const definition = ref.split('#/definitions/')[1];
+    if (!definitions[definition]) {
+        throw new Error(`Cannot resolve ${ref}`);
+    }
+    return definitions[definition];
+}
+function applyVerbosity(options, schema, isVerbose) {
+    if ((schema.additionalProperties === true || 'verbose' in schema.properties) &&
+        isVerbose) {
+        options['verbose'] = true;
+    }
+}
+exports.applyVerbosity = applyVerbosity;
+function combineOptionsForExecutor(commandLineOpts, config, target, schema, defaultProjectName, relativeCwd, isVerbose = false) {
+    const r = convertAliases(coerceTypesInOptions(convertToCamelCase(commandLineOpts, schema), schema), schema, false);
+    let combined = target.options || {};
+    if (config && target.configurations && target.configurations[config]) {
+        Object.assign(combined, target.configurations[config]);
+    }
+    combined = convertAliases(combined, schema, false);
+    Object.assign(combined, r);
+    convertSmartDefaultsIntoNamedParams(combined, schema, defaultProjectName, relativeCwd);
+    warnDeprecations(combined, schema);
+    setDefaults(combined, schema);
+    validateOptsAgainstSchema(combined, schema);
+    applyVerbosity(combined, schema, isVerbose);
+    return combined;
+}
+exports.combineOptionsForExecutor = combineOptionsForExecutor;
+async function combineOptionsForGenerator(commandLineOpts, collectionName, generatorName, projectsConfigurations, nxJsonConfiguration, schema, isInteractive, defaultProjectName, relativeCwd, isVerbose = false) {
+    const generatorDefaults = projectsConfigurations
+        ? getGeneratorDefaults(defaultProjectName, projectsConfigurations, nxJsonConfiguration, collectionName, generatorName)
+        : {};
+    let combined = convertAliases(coerceTypesInOptions({ ...generatorDefaults, ...commandLineOpts }, schema), schema, false);
+    warnDeprecations(combined, schema);
+    convertSmartDefaultsIntoNamedParams(combined, schema, defaultProjectName, relativeCwd);
+    if (isInteractive && isTTY()) {
+        combined = await promptForValues(combined, schema, projectsConfigurations);
+    }
+    setDefaults(combined, schema);
+    validateOptsAgainstSchema(combined, schema);
+    applyVerbosity(combined, schema, isVerbose);
+    return combined;
+}
+exports.combineOptionsForGenerator = combineOptionsForGenerator;
+function warnDeprecations(opts, schema) {
+    Object.keys(opts).forEach((option) => {
+        const deprecated = schema.properties[option]?.['x-deprecated'];
+        if (deprecated) {
+            logger_1.logger.warn(`Option "${option}" is deprecated${typeof deprecated == 'string' ? ': ' + deprecated : '.'}`);
+        }
+    });
+}
+exports.warnDeprecations = warnDeprecations;
+function convertSmartDefaultsIntoNamedParams(opts, schema, defaultProjectName, relativeCwd) {
+    const argv = opts['_'] || [];
+    const usedPositionalArgs = {};
+    Object.entries(schema.properties).forEach(([k, v]) => {
+        if (opts[k] === undefined &&
+            v.$default !== undefined &&
+            v.$default.$source === 'argv' &&
+            argv[v.$default.index]) {
+            usedPositionalArgs[v.$default.index] = true;
+            opts[k] = coerceType(v, argv[v.$default.index]);
+        }
+        else if (v.$default !== undefined && v.$default.$source === 'unparsed') {
+            opts[k] = opts['__overrides_unparsed__'] || [];
+        }
+        else if (opts[k] === undefined &&
+            v.$default !== undefined &&
+            v.$default.$source === 'projectName' &&
+            defaultProjectName) {
+            opts[k] = defaultProjectName;
+        }
+        else if (opts[k] === undefined &&
+            v.format === 'path' &&
+            v.visible === false &&
+            relativeCwd) {
+            opts[k] = relativeCwd.replace(/\\/g, '/');
+        }
+        else if (opts[k] === undefined &&
+            v.$default !== undefined &&
+            v.$default.$source === 'workingDirectory' &&
+            relativeCwd) {
+            opts[k] = relativeCwd.replace(/\\/g, '/');
+        }
+    });
+    const leftOverPositionalArgs = [];
+    for (let i = 0; i < argv.length; ++i) {
+        if (!usedPositionalArgs[i]) {
+            leftOverPositionalArgs.push(argv[i]);
+        }
+    }
+    if (leftOverPositionalArgs.length === 0) {
+        delete opts['_'];
+    }
+    else {
+        opts['_'] = leftOverPositionalArgs;
+    }
+    delete opts['__overrides_unparsed__'];
+}
+exports.convertSmartDefaultsIntoNamedParams = convertSmartDefaultsIntoNamedParams;
+function getGeneratorDefaults(projectName, projectsConfigurations, nxJsonConfiguration, collectionName, generatorName) {
+    let defaults = {};
+    if (nxJsonConfiguration?.generators) {
+        if (nxJsonConfiguration.generators[collectionName]?.[generatorName]) {
+            defaults = {
+                ...defaults,
+                ...nxJsonConfiguration.generators[collectionName][generatorName],
+            };
+        }
+        if (nxJsonConfiguration.generators[`${collectionName}:${generatorName}`]) {
+            defaults = {
+                ...defaults,
+                ...nxJsonConfiguration.generators[`${collectionName}:${generatorName}`],
+            };
+        }
+    }
+    if (projectName &&
+        projectsConfigurations?.projects[projectName]?.generators) {
+        const g = projectsConfigurations.projects[projectName].generators;
+        if (g[collectionName] && g[collectionName][generatorName]) {
+            defaults = { ...defaults, ...g[collectionName][generatorName] };
+        }
+        if (g[`${collectionName}:${generatorName}`]) {
+            defaults = {
+                ...defaults,
+                ...g[`${collectionName}:${generatorName}`],
+            };
+        }
+    }
+    return defaults;
+}
+function getPromptsForSchema(opts, schema, projectsConfigurations) {
+    const prompts = [];
+    Object.entries(schema.properties).forEach(([k, v]) => {
+        if (v['x-prompt'] && opts[k] === undefined) {
+            const question = {
+                name: k,
+            };
+            if (v.default) {
+                question.initial = v.default;
+            }
+            // Normalize x-prompt
+            if (typeof v['x-prompt'] === 'string') {
+                const message = v['x-prompt'];
+                if (v.type === 'boolean') {
+                    v['x-prompt'] = {
+                        type: 'confirm',
+                        message,
+                    };
+                }
+                else if (v.type === 'array' && v.items?.enum) {
+                    v['x-prompt'] = {
+                        type: 'multiselect',
+                        items: v.items.enum,
+                        message,
+                    };
+                }
+                else {
+                    v['x-prompt'] = {
+                        type: 'input',
+                        message,
+                    };
+                }
+            }
+            question.message = v['x-prompt'].message;
+            question.validate = (s) => {
+                try {
+                    validateProperty(k, s, v, schema.definitions || {});
+                    return true;
+                }
+                catch (e) {
+                    return e.message;
+                }
+            };
+            if (v.type === 'string' && v.enum && Array.isArray(v.enum)) {
+                question.type = 'autocomplete';
+                question.choices = [...v.enum];
+                question.limit = LIST_CHOICE_DISPLAY_LIMIT;
+            }
+            else if (v.type === 'string' &&
+                (v.$default?.$source === 'projectName' ||
+                    k === 'project' ||
+                    k === 'projectName' ||
+                    v['x-dropdown'] === 'projects') &&
+                projectsConfigurations) {
+                question.type = 'autocomplete';
+                question.choices = Object.keys(projectsConfigurations.projects);
+                question.limit = LIST_CHOICE_DISPLAY_LIMIT;
+            }
+            else if (v.type === 'number' || v['x-prompt'].type == 'number') {
+                question.type = 'numeral';
+            }
+            else if (v['x-prompt'].type == 'confirmation' ||
+                v['x-prompt'].type == 'confirm') {
+                question.type = 'confirm';
+            }
+            else if (v['x-prompt'].items) {
+                question.type =
+                    v['x-prompt'].multiselect || v.type === 'array'
+                        ? 'multiselect'
+                        : 'autocomplete';
+                question.choices =
+                    v['x-prompt'].items &&
+                        v['x-prompt'].items.map((item) => {
+                            if (typeof item == 'string') {
+                                return item;
+                            }
+                            else {
+                                return {
+                                    message: item.label,
+                                    name: item.value,
+                                };
+                            }
+                        });
+                question.limit = LIST_CHOICE_DISPLAY_LIMIT;
+            }
+            else if (v.type === 'boolean') {
+                question.type = 'confirm';
+            }
+            else {
+                question.type = 'input';
+            }
+            prompts.push(question);
+        }
+    });
+    return prompts;
+}
+exports.getPromptsForSchema = getPromptsForSchema;
+async function promptForValues(opts, schema, projectsConfigurations) {
+    return await (await Promise.resolve().then(() => __nccwpck_require__(56587)))
+        .prompt(getPromptsForSchema(opts, schema, projectsConfigurations))
+        .then((values) => ({ ...opts, ...values }))
+        .catch((e) => {
+        console.error(e);
+        process.exit(0);
+    });
+}
+function findSchemaForProperty(propName, schema) {
+    if (propName in schema.properties) {
+        return {
+            name: propName,
+            description: schema.properties[propName],
+        };
+    }
+    const found = Object.entries(schema.properties).find(([_, d]) => d.alias === propName ||
+        (Array.isArray(d.aliases) && d.aliases.includes(propName)));
+    if (found) {
+        const [name, description] = found;
+        return { name, description };
+    }
+    return null;
+}
+function isTTY() {
+    return !!process.stdout.isTTY && process.env['CI'] !== 'true';
+}
+/**
+ * Verifies whether the given value can be converted to a boolean
+ * @param value
+ */
+function isConvertibleToBoolean(value) {
+    if ('boolean' === typeof value) {
+        return true;
+    }
+    if ('string' === typeof value && /true|false/.test(value)) {
+        return true;
+    }
+    return false;
+}
+/**
+ * Verifies whether the given value can be converted to a number
+ * @param value
+ */
+function isConvertibleToNumber(value) {
+    // exclude booleans explicitly
+    if ('boolean' === typeof value) {
+        return false;
+    }
+    return !isNaN(+value);
+}
+
+
+/***/ }),
+
+/***/ 41559:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 exports.getCwd = exports.joinPathFragments = exports.normalizePath = void 0;
-const path = __nccwpck_require__(1017);
-const workspace_root_1 = __nccwpck_require__(4393);
+const path = __nccwpck_require__(71017);
+const workspace_root_1 = __nccwpck_require__(64393);
 function removeWindowsDriveLetter(osSpecificPath) {
     return osSpecificPath.replace(/^[A-Z]:/, '');
 }
@@ -253737,7 +293518,7 @@ exports.getCwd = getCwd;
 
 /***/ }),
 
-/***/ 5340:
+/***/ 25340:
 /***/ ((__unused_webpack_module, exports) => {
 
 "use strict";
@@ -253788,7 +293569,7 @@ exports.PromisedBasedQueue = PromisedBasedQueue;
 
 /***/ }),
 
-/***/ 9268:
+/***/ 39268:
 /***/ ((__unused_webpack_module, exports) => {
 
 "use strict";
@@ -253822,6 +293603,63 @@ function createSerializableError(error) {
 exports.createSerializableError = createSerializableError;
 
 
+/***/ }),
+
+/***/ 2792:
+/***/ ((__unused_webpack_module, exports) => {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.splitByColons = exports.splitTarget = void 0;
+function splitTarget(s, projectGraph) {
+    let [project, ...segments] = splitByColons(s);
+    const validTargets = projectGraph.nodes[project]
+        ? projectGraph.nodes[project].data.targets
+        : {};
+    const validTargetNames = new Set(Object.keys(validTargets ?? {}));
+    return [project, ...groupJointSegments(segments, validTargetNames)];
+}
+exports.splitTarget = splitTarget;
+function groupJointSegments(segments, validTargetNames) {
+    for (let endingSegmentIdx = segments.length; endingSegmentIdx > 0; endingSegmentIdx--) {
+        const potentialTargetName = segments.slice(0, endingSegmentIdx).join(':');
+        if (validTargetNames.has(potentialTargetName)) {
+            const configurationName = endingSegmentIdx < segments.length
+                ? segments.slice(endingSegmentIdx).join(':')
+                : null;
+            return configurationName
+                ? [potentialTargetName, configurationName]
+                : [potentialTargetName];
+        }
+    }
+    // If we can't find a segment match, keep older behaviour
+    return segments;
+}
+function splitByColons(s) {
+    const parts = [];
+    let currentPart = '';
+    for (let i = 0; i < s.length; ++i) {
+        if (s[i] === ':') {
+            parts.push(currentPart);
+            currentPart = '';
+        }
+        else if (s[i] === '"') {
+            i++;
+            for (; i < s.length && s[i] != '"'; ++i) {
+                currentPart += s[i];
+            }
+        }
+        else {
+            currentPart += s[i];
+        }
+    }
+    parts.push(currentPart);
+    return parts;
+}
+exports.splitByColons = splitByColons;
+
+
 /***/ }),
 
 /***/ 5440:
@@ -253856,32 +293694,19 @@ exports.stripIndents = stripIndents;
 
 /***/ }),
 
-/***/ 5313:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-// TODO(v19): Nx Devkit 15 depends on this file. Remove this when we no longer support Nx Devkit 15
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-const tslib_1 = __nccwpck_require__(3085);
-tslib_1.__exportStar(__nccwpck_require__(2602), exports);
-
-
-/***/ }),
-
-/***/ 780:
+/***/ 10780:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 exports.nxVersion = void 0;
-exports.nxVersion = __nccwpck_require__(9617).version;
+exports.nxVersion = __nccwpck_require__(89617).version;
 
 
 /***/ }),
 
-/***/ 8897:
+/***/ 98897:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
@@ -253889,10 +293714,10 @@ exports.nxVersion = __nccwpck_require__(9617).version;
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 exports.resetWorkspaceContext = exports.updateProjectFiles = exports.getFilesInDirectoryUsingContext = exports.getAllFileDataInContext = exports.updateFilesInContext = exports.hashWithWorkspaceContext = exports.globWithWorkspaceContext = exports.getNxWorkspaceFilesFromContext = exports.setupWorkspaceContext = void 0;
 const perf_hooks_1 = __nccwpck_require__(4074);
-const cache_directory_1 = __nccwpck_require__(1622);
+const cache_directory_1 = __nccwpck_require__(11622);
 let workspaceContext;
 function setupWorkspaceContext(workspaceRoot) {
-    const { WorkspaceContext } = __nccwpck_require__(1926);
+    const { WorkspaceContext } = __nccwpck_require__(71926);
     perf_hooks_1.performance.mark('workspace-context');
     workspaceContext = new WorkspaceContext(workspaceRoot, (0, cache_directory_1.cacheDirectoryForWorkspace)(workspaceRoot));
     perf_hooks_1.performance.mark('workspace-context:end');
@@ -253945,15 +293770,15 @@ exports.resetWorkspaceContext = resetWorkspaceContext;
 
 /***/ }),
 
-/***/ 4393:
+/***/ 64393:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 exports.workspaceRootInner = exports.setWorkspaceRoot = exports.workspaceRoot = void 0;
-const path = __nccwpck_require__(1017);
-const fileutils_1 = __nccwpck_require__(910);
+const path = __nccwpck_require__(71017);
+const fileutils_1 = __nccwpck_require__(40910);
 /**
  * The root of the workspace
  */
@@ -253992,7 +293817,7 @@ exports.workspaceRootInner = workspaceRootInner;
 
 /***/ }),
 
-/***/ 3278:
+/***/ 53278:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 "use strict";
@@ -254000,7 +293825,7 @@ exports.workspaceRootInner = workspaceRootInner;
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 
-var tty = __nccwpck_require__(6224);
+var tty = __nccwpck_require__(76224);
 
 function _interopNamespace(e) {
   if (e && e.__esModule) return e;
@@ -254218,7 +294043,7 @@ exports.yellowBright = yellowBright;
 
 /***/ }),
 
-/***/ 8308:
+/***/ 28308:
 /***/ ((__unused_webpack_module, exports) => {
 
 "use strict";
@@ -254287,15 +294112,15 @@ exports.LinesAndColumns = LinesAndColumns;
 
 /***/ }),
 
-/***/ 1841:
+/***/ 21841:
 /***/ ((module) => {
 
 "use strict";
-module.exports = {"version":"1.5.0"};
+module.exports = {"version":"1.5.7"};
 
 /***/ }),
 
-/***/ 8250:
+/***/ 78250:
 /***/ ((module) => {
 
 "use strict";
@@ -254303,7 +294128,7 @@ module.exports = JSON.parse('{"$schema":"https://json.schemastore.org/tsconfig",
 
 /***/ }),
 
-/***/ 6049:
+/***/ 56049:
 /***/ ((module) => {
 
 "use strict";
@@ -254311,7 +294136,7 @@ module.exports = JSON.parse('{"$schema":"https://json.schemastore.org/tsconfig",
 
 /***/ }),
 
-/***/ 3754:
+/***/ 83754:
 /***/ ((module) => {
 
 "use strict";
@@ -254319,7 +294144,7 @@ module.exports = JSON.parse('{"$schema":"https://json.schemastore.org/tsconfig",
 
 /***/ }),
 
-/***/ 9777:
+/***/ 39777:
 /***/ ((module) => {
 
 "use strict";
@@ -254327,15 +294152,15 @@ module.exports = JSON.parse('{"$schema":"https://json.schemastore.org/tsconfig",
 
 /***/ }),
 
-/***/ 9617:
+/***/ 89617:
 /***/ ((module) => {
 
 "use strict";
-module.exports = {"version":"18.3.3"};
+module.exports = {"version":"19.0.3"};
 
 /***/ }),
 
-/***/ 6686:
+/***/ 46686:
 /***/ ((module) => {
 
 "use strict";
@@ -254406,12 +294231,12 @@ var exports = __webpack_exports__;
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 const tslib_1 = __nccwpck_require__(4351);
-const core = tslib_1.__importStar(__nccwpck_require__(2186));
-const project_graph_1 = __nccwpck_require__(4913);
-const path_1 = __nccwpck_require__(1017);
-const build_command_1 = __nccwpck_require__(9444);
-const exec_1 = __nccwpck_require__(4574);
-const has_one_of_required_tags_1 = __nccwpck_require__(6126);
+const core = tslib_1.__importStar(__nccwpck_require__(42186));
+const project_graph_1 = __nccwpck_require__(54913);
+const path_1 = __nccwpck_require__(71017);
+const build_command_1 = __nccwpck_require__(19444);
+const exec_1 = __nccwpck_require__(54574);
+const has_one_of_required_tags_1 = __nccwpck_require__(96126);
 function run() {
     return tslib_1.__awaiter(this, void 0, void 0, function* () {
         try {
diff --git a/actions/plan/dist/nx.linux-x64-gnu.node b/actions/plan/dist/nx.linux-x64-gnu.node
index fbf33d7e..61b4025a 100644
Binary files a/actions/plan/dist/nx.linux-x64-gnu.node and b/actions/plan/dist/nx.linux-x64-gnu.node differ
diff --git a/actions/plan/dist/swc.linux-x64-gnu.node b/actions/plan/dist/swc.linux-x64-gnu.node
index 9e9f8fe6..3f0264a7 100644
Binary files a/actions/plan/dist/swc.linux-x64-gnu.node and b/actions/plan/dist/swc.linux-x64-gnu.node differ
diff --git a/actions/plan/dist/typescript.js b/actions/plan/dist/typescript.js
index 50d4477f..22053b17 100644
--- a/actions/plan/dist/typescript.js
+++ b/actions/plan/dist/typescript.js
@@ -34,8 +34,8 @@ var ts = (() => {
   var init_corePublic = __esm({
     "src/compiler/corePublic.ts"() {
       "use strict";
-      versionMajorMinor = "5.3";
-      version = "5.3.3";
+      versionMajorMinor = "5.4";
+      version = "5.4.5";
       Comparison = /* @__PURE__ */ ((Comparison3) => {
         Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
         Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -1388,9 +1388,9 @@ var ts = (() => {
     const res = previous[s2.length];
     return res > max ? void 0 : res;
   }
-  function endsWith(str, suffix) {
+  function endsWith(str, suffix, ignoreCase) {
     const expectedPos = str.length - suffix.length;
-    return expectedPos >= 0 && str.indexOf(suffix, expectedPos) === expectedPos;
+    return expectedPos >= 0 && (ignoreCase ? equateStringsCaseInsensitive(str.slice(expectedPos), suffix) : str.indexOf(suffix, expectedPos) === expectedPos);
   }
   function removeSuffix(str, suffix) {
     return endsWith(str, suffix) ? str.slice(0, str.length - suffix.length) : str;
@@ -1483,8 +1483,8 @@ var ts = (() => {
     }
     return matchedValue;
   }
-  function startsWith(str, prefix) {
-    return str.lastIndexOf(prefix, 0) === 0;
+  function startsWith(str, prefix, ignoreCase) {
+    return ignoreCase ? equateStringsCaseInsensitive(str.slice(0, prefix.length), prefix) : str.lastIndexOf(prefix, 0) === 0;
   }
   function removePrefix(str, prefix) {
     return startsWith(str, prefix) ? str.substr(prefix.length) : str;
@@ -1636,7 +1636,7 @@ var ts = (() => {
         AssertionLevel2[AssertionLevel2["VeryAggressive"] = 3] = "VeryAggressive";
         return AssertionLevel2;
       })(AssertionLevel || {});
-      createUIStringComparer = (() => {
+      createUIStringComparer = /* @__PURE__ */ (() => {
         return createIntlCollatorStringComparer;
         function compareWithCallback(a, b, comparer) {
           if (a === b)
@@ -3034,7 +3034,7 @@ ${lanes.join("\n")}
   function tryGetNodePerformanceHooks() {
     if (isNodeLikeSystem()) {
       try {
-        const { performance: performance2, PerformanceObserver: PerformanceObserver2 } =   require("perf_hooks");
+        const { performance: performance2, PerformanceObserver: PerformanceObserver2 } = require("perf_hooks");
         if (hasRequiredAPI(performance2, PerformanceObserver2)) {
           return {
             // By default, only write native events when generating a cpu profile or using the v8 profiler.
@@ -3068,7 +3068,7 @@ ${lanes.join("\n")}
       "use strict";
       try {
         const etwModulePath = process.env.TS_ETW_MODULE_PATH ?? "./node_modules/@microsoft/typescript-etw";
-        etwModule =   require(etwModulePath);
+        etwModule = require(etwModulePath);
       } catch (e) {
         etwModule = void 0;
       }
@@ -3233,7 +3233,7 @@ ${lanes.join("\n")}
           Debug.assert(!tracing, "Tracing already started");
           if (fs === void 0) {
             try {
-              fs =   require("fs");
+              fs = require("fs");
             } catch (e) {
               throw new Error(`tracing requires having fs
 (original error: ${e.message || e})`);
@@ -3997,6 +3997,7 @@ ${lanes.join("\n")}
         return JsxFlags2;
       })(JsxFlags || {});
       RelationComparisonResult = /* @__PURE__ */ ((RelationComparisonResult3) => {
+        RelationComparisonResult3[RelationComparisonResult3["None"] = 0] = "None";
         RelationComparisonResult3[RelationComparisonResult3["Succeeded"] = 1] = "Succeeded";
         RelationComparisonResult3[RelationComparisonResult3["Failed"] = 2] = "Failed";
         RelationComparisonResult3[RelationComparisonResult3["Reported"] = 4] = "Reported";
@@ -4165,6 +4166,7 @@ ${lanes.join("\n")}
         TypeFormatFlags2[TypeFormatFlags2["None"] = 0] = "None";
         TypeFormatFlags2[TypeFormatFlags2["NoTruncation"] = 1] = "NoTruncation";
         TypeFormatFlags2[TypeFormatFlags2["WriteArrayAsGenericType"] = 2] = "WriteArrayAsGenericType";
+        TypeFormatFlags2[TypeFormatFlags2["GenerateNamesForShadowedTypeParams"] = 4] = "GenerateNamesForShadowedTypeParams";
         TypeFormatFlags2[TypeFormatFlags2["UseStructuralFallback"] = 8] = "UseStructuralFallback";
         TypeFormatFlags2[TypeFormatFlags2["WriteTypeArgumentsOfSignature"] = 32] = "WriteTypeArgumentsOfSignature";
         TypeFormatFlags2[TypeFormatFlags2["UseFullyQualifiedType"] = 64] = "UseFullyQualifiedType";
@@ -4184,7 +4186,7 @@ ${lanes.join("\n")}
         TypeFormatFlags2[TypeFormatFlags2["InElementType"] = 2097152] = "InElementType";
         TypeFormatFlags2[TypeFormatFlags2["InFirstTypeArgument"] = 4194304] = "InFirstTypeArgument";
         TypeFormatFlags2[TypeFormatFlags2["InTypeAlias"] = 8388608] = "InTypeAlias";
-        TypeFormatFlags2[TypeFormatFlags2["NodeBuilderFlagsMask"] = 848330091] = "NodeBuilderFlagsMask";
+        TypeFormatFlags2[TypeFormatFlags2["NodeBuilderFlagsMask"] = 848330095] = "NodeBuilderFlagsMask";
         return TypeFormatFlags2;
       })(TypeFormatFlags || {});
       SymbolFormatFlags = /* @__PURE__ */ ((SymbolFormatFlags2) => {
@@ -4260,7 +4262,7 @@ ${lanes.join("\n")}
         SymbolFlags3[SymbolFlags3["Transient"] = 33554432] = "Transient";
         SymbolFlags3[SymbolFlags3["Assignment"] = 67108864] = "Assignment";
         SymbolFlags3[SymbolFlags3["ModuleExports"] = 134217728] = "ModuleExports";
-        SymbolFlags3[SymbolFlags3["All"] = 67108863] = "All";
+        SymbolFlags3[SymbolFlags3["All"] = -1] = "All";
         SymbolFlags3[SymbolFlags3["Enum"] = 384] = "Enum";
         SymbolFlags3[SymbolFlags3["Variable"] = 3] = "Variable";
         SymbolFlags3[SymbolFlags3["Value"] = 111551] = "Value";
@@ -4349,6 +4351,8 @@ ${lanes.join("\n")}
         InternalSymbolName2["ExportEquals"] = "export=";
         InternalSymbolName2["Default"] = "default";
         InternalSymbolName2["This"] = "this";
+        InternalSymbolName2["InstantiationExpression"] = "__instantiationExpression";
+        InternalSymbolName2["ImportAttributes"] = "__importAttributes";
         return InternalSymbolName2;
       })(InternalSymbolName || {});
       NodeCheckFlags = /* @__PURE__ */ ((NodeCheckFlags2) => {
@@ -4408,6 +4412,7 @@ ${lanes.join("\n")}
         TypeFlags2[TypeFlags2["NonPrimitive"] = 67108864] = "NonPrimitive";
         TypeFlags2[TypeFlags2["TemplateLiteral"] = 134217728] = "TemplateLiteral";
         TypeFlags2[TypeFlags2["StringMapping"] = 268435456] = "StringMapping";
+        TypeFlags2[TypeFlags2["Reserved1"] = 536870912] = "Reserved1";
         TypeFlags2[TypeFlags2["AnyOrUnknown"] = 3] = "AnyOrUnknown";
         TypeFlags2[TypeFlags2["Nullable"] = 98304] = "Nullable";
         TypeFlags2[TypeFlags2["Literal"] = 2944] = "Literal";
@@ -4445,6 +4450,7 @@ ${lanes.join("\n")}
         TypeFlags2[TypeFlags2["IncludesWildcard"] = 8388608 /* IndexedAccess */] = "IncludesWildcard";
         TypeFlags2[TypeFlags2["IncludesEmptyObject"] = 16777216 /* Conditional */] = "IncludesEmptyObject";
         TypeFlags2[TypeFlags2["IncludesInstantiable"] = 33554432 /* Substitution */] = "IncludesInstantiable";
+        TypeFlags2[TypeFlags2["IncludesConstrainedTypeVariable"] = 536870912 /* Reserved1 */] = "IncludesConstrainedTypeVariable";
         TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323331] = "NotPrimitiveUnion";
         return TypeFlags2;
       })(TypeFlags || {});
@@ -4491,6 +4497,7 @@ ${lanes.join("\n")}
         ObjectFlags3[ObjectFlags3["IsUnknownLikeUnion"] = 67108864] = "IsUnknownLikeUnion";
         ObjectFlags3[ObjectFlags3["IsNeverIntersectionComputed"] = 16777216] = "IsNeverIntersectionComputed";
         ObjectFlags3[ObjectFlags3["IsNeverIntersection"] = 33554432] = "IsNeverIntersection";
+        ObjectFlags3[ObjectFlags3["IsConstrainedTypeVariable"] = 67108864] = "IsConstrainedTypeVariable";
         return ObjectFlags3;
       })(ObjectFlags || {});
       VarianceFlags = /* @__PURE__ */ ((VarianceFlags2) => {
@@ -4678,6 +4685,7 @@ ${lanes.join("\n")}
         ModuleKind3[ModuleKind3["ESNext"] = 99] = "ESNext";
         ModuleKind3[ModuleKind3["Node16"] = 100] = "Node16";
         ModuleKind3[ModuleKind3["NodeNext"] = 199] = "NodeNext";
+        ModuleKind3[ModuleKind3["Preserve"] = 200] = "Preserve";
         return ModuleKind3;
       })(ModuleKind || {});
       JsxEmit = /* @__PURE__ */ ((JsxEmit3) => {
@@ -4763,7 +4771,6 @@ ${lanes.join("\n")}
         CharacterCodes2[CharacterCodes2["ideographicSpace"] = 12288] = "ideographicSpace";
         CharacterCodes2[CharacterCodes2["mathematicalSpace"] = 8287] = "mathematicalSpace";
         CharacterCodes2[CharacterCodes2["ogham"] = 5760] = "ogham";
-        CharacterCodes2[CharacterCodes2["replacementCharacter"] = 65533] = "replacementCharacter";
         CharacterCodes2[CharacterCodes2["_"] = 95] = "_";
         CharacterCodes2[CharacterCodes2["$"] = 36] = "$";
         CharacterCodes2[CharacterCodes2["_0"] = 48] = "_0";
@@ -5042,6 +5049,7 @@ ${lanes.join("\n")}
         EmitHint6[EmitHint6["Unspecified"] = 4] = "Unspecified";
         EmitHint6[EmitHint6["EmbeddedStatement"] = 5] = "EmbeddedStatement";
         EmitHint6[EmitHint6["JsxAttributeValue"] = 6] = "JsxAttributeValue";
+        EmitHint6[EmitHint6["ImportTypeNodeAttributes"] = 7] = "ImportTypeNodeAttributes";
         return EmitHint6;
       })(EmitHint || {});
       OuterExpressionKinds = /* @__PURE__ */ ((OuterExpressionKinds2) => {
@@ -5415,14 +5423,17 @@ ${lanes.join("\n")}
       pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === 250 /* Low */ ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingInterval === 250 /* Low */ ? "pollLowPollingIntervalQueue" : "pollPollingIntervalQueue", pollingIntervalQueue(pollingInterval));
     }
   }
-  function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2) {
+  function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2, getModifiedTime3, fsWatchWithTimestamp) {
     const fileWatcherCallbacks = createMultiMap();
+    const fileTimestamps = fsWatchWithTimestamp ? /* @__PURE__ */ new Map() : void 0;
     const dirWatchers = /* @__PURE__ */ new Map();
     const toCanonicalName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
     return nonPollingWatchFile;
     function nonPollingWatchFile(fileName, callback, _pollingInterval, fallbackOptions) {
       const filePath = toCanonicalName(fileName);
-      fileWatcherCallbacks.add(filePath, callback);
+      if (fileWatcherCallbacks.add(filePath, callback).length === 1 && fileTimestamps) {
+        fileTimestamps.set(filePath, getModifiedTime3(fileName) || missingFileModifiedTime);
+      }
       const dirPath = getDirectoryPath(filePath) || ".";
       const watcher = dirWatchers.get(dirPath) || createDirectoryWatcher(getDirectoryPath(fileName) || ".", dirPath, fallbackOptions);
       watcher.referenceCount++;
@@ -5442,14 +5453,31 @@ ${lanes.join("\n")}
       const watcher = fsWatch(
         dirName,
         1 /* Directory */,
-        (_eventName, relativeFileName, modifiedTime) => {
+        (eventName, relativeFileName) => {
           if (!isString(relativeFileName))
             return;
           const fileName = getNormalizedAbsolutePath(relativeFileName, dirName);
-          const callbacks = fileName && fileWatcherCallbacks.get(toCanonicalName(fileName));
+          const filePath = toCanonicalName(fileName);
+          const callbacks = fileName && fileWatcherCallbacks.get(filePath);
           if (callbacks) {
+            let currentModifiedTime;
+            let eventKind = 1 /* Changed */;
+            if (fileTimestamps) {
+              const existingTime = fileTimestamps.get(filePath);
+              if (eventName === "change") {
+                currentModifiedTime = getModifiedTime3(fileName) || missingFileModifiedTime;
+                if (currentModifiedTime.getTime() === existingTime.getTime())
+                  return;
+              }
+              currentModifiedTime || (currentModifiedTime = getModifiedTime3(fileName) || missingFileModifiedTime);
+              fileTimestamps.set(filePath, currentModifiedTime);
+              if (existingTime === missingFileModifiedTime)
+                eventKind = 0 /* Created */;
+              else if (currentModifiedTime === missingFileModifiedTime)
+                eventKind = 2 /* Deleted */;
+            }
             for (const fileCallback of callbacks) {
-              fileCallback(fileName, 1 /* Changed */, modifiedTime);
+              fileCallback(fileName, eventKind, currentModifiedTime);
             }
           }
         },
@@ -5777,6 +5805,7 @@ ${lanes.join("\n")}
     useNonPollingWatchers,
     tscWatchDirectory,
     inodeWatching,
+    fsWatchWithTimestamp,
     sysLog: sysLog2
   }) {
     const pollingWatches = /* @__PURE__ */ new Map();
@@ -5840,7 +5869,7 @@ ${lanes.join("\n")}
           );
         case 5 /* UseFsEventsOnParentDirectory */:
           if (!nonPollingWatchFile) {
-            nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2);
+            nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2, getModifiedTime3, fsWatchWithTimestamp);
           }
           return nonPollingWatchFile(fileName, callback, pollingInterval, getFallbackOptions(options));
         default:
@@ -6015,7 +6044,7 @@ ${lanes.join("\n")}
           return watchPresentFileSystemEntryWithFsWatchFile();
         }
         try {
-          const presentWatcher = fsWatchWorker(
+          const presentWatcher = (entryKind === 1 /* Directory */ || !fsWatchWithTimestamp ? fsWatchWorker : fsWatchWorkerHandlingTimestamp)(
             fileOrDirectory,
             recursive,
             inodeWatching ? callbackChangingToMissingFileSystemEntry : callback
@@ -6078,6 +6107,18 @@ ${lanes.join("\n")}
         );
       }
     }
+    function fsWatchWorkerHandlingTimestamp(fileOrDirectory, recursive, callback) {
+      let modifiedTime = getModifiedTime3(fileOrDirectory) || missingFileModifiedTime;
+      return fsWatchWorker(fileOrDirectory, recursive, (eventName, relativeFileName, currentModifiedTime) => {
+        if (eventName === "change") {
+          currentModifiedTime || (currentModifiedTime = getModifiedTime3(fileOrDirectory) || missingFileModifiedTime);
+          if (currentModifiedTime.getTime() === modifiedTime.getTime())
+            return;
+        }
+        modifiedTime = currentModifiedTime || getModifiedTime3(fileOrDirectory) || missingFileModifiedTime;
+        callback(eventName, relativeFileName, modifiedTime);
+      });
+    }
   }
   function patchWriteFileEnsuringDirectory(sys2) {
     const originalWriteFile = sys2.writeFile;
@@ -6125,24 +6166,25 @@ ${lanes.join("\n")}
         const byteOrderMarkIndicator = "\uFEFF";
         function getNodeSystem() {
           const nativePattern = /^native |^\([^)]+\)$|^(internal[\\/]|[a-zA-Z0-9_\s]+(\.js)?$)/;
-          const _fs =   require("fs");
-          const _path =   require("path");
-          const _os =   require("os");
+          const _fs = require("fs");
+          const _path = require("path");
+          const _os = require("os");
           let _crypto;
           try {
-            _crypto =   require("crypto");
+            _crypto = require("crypto");
           } catch {
             _crypto = void 0;
           }
           let activeSession;
           let profilePath = "./profile.cpuprofile";
-          const Buffer2 =   require("buffer").Buffer;
-          const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
+          const Buffer2 = require("buffer").Buffer;
+          const isMacOs = process.platform === "darwin";
+          const isLinuxOrMacOs = process.platform === "linux" || isMacOs;
           const platform = _os.platform();
           const useCaseSensitiveFileNames2 = isFileSystemCaseSensitive();
           const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
           const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
-          const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin";
+          const fsSupportsRecursiveFsWatch = process.platform === "win32" || isMacOs;
           const getCurrentDirectory = memoize(() => process.cwd());
           const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({
             pollingWatchFileWorker: fsWatchFileWorker,
@@ -6162,6 +6204,7 @@ ${lanes.join("\n")}
             useNonPollingWatchers: !!process.env.TSC_NONPOLLING_WATCHER,
             tscWatchDirectory: process.env.TSC_WATCHDIRECTORY,
             inodeWatching: isLinuxOrMacOs,
+            fsWatchWithTimestamp: isMacOs,
             sysLog
           });
           const nodeSystem = {
@@ -6184,6 +6227,7 @@ ${lanes.join("\n")}
             resolvePath: (path) => _path.resolve(path),
             fileExists,
             directoryExists,
+            getAccessibleFileSystemEntries,
             createDirectory(directoryName) {
               if (!nodeSystem.directoryExists(directoryName)) {
                 try {
@@ -6235,7 +6279,7 @@ ${lanes.join("\n")}
             debugMode: !!process.env.NODE_INSPECTOR_IPC || !!process.env.VSCODE_INSPECTOR_OPTIONS || some(process.execArgv, (arg) => /^--(inspect|debug)(-brk)?(=\d+)?$/i.test(arg)) || !!process.recordreplay,
             tryEnableSourceMapsForHost() {
               try {
-                  require("source-map-support").install();
+                require("source-map-support").install();
               } catch {
               }
             },
@@ -6257,7 +6301,7 @@ ${lanes.join("\n")}
             require: (baseDir, moduleName) => {
               try {
                 const modulePath = resolveJSModule(moduleName, baseDir, nodeSystem);
-                return { module:   require(modulePath), modulePath, error: void 0 };
+                return { module: require(modulePath), modulePath, error: void 0 };
               } catch (error2) {
                 return { module: void 0, modulePath: void 0, error: error2 };
               }
@@ -6272,7 +6316,7 @@ ${lanes.join("\n")}
               cb();
               return false;
             }
-            const inspector =   require("inspector");
+            const inspector = require("inspector");
             if (!inspector || !inspector.Session) {
               cb();
               return false;
@@ -6346,9 +6390,6 @@ ${lanes.join("\n")}
             return Buffer2.from && Buffer2.from !== Int8Array.from ? Buffer2.from(input, encoding) : new Buffer2(input, encoding);
           }
           function isFileSystemCaseSensitive() {
-            if (typeof process.versions.pnp !== `undefined`) {
-              return true;
-            }
             if (platform === "win32" || platform === "win64") {
               return false;
             }
@@ -6844,6 +6885,13 @@ ${lanes.join("\n")}
     const pathext = extensions !== void 0 && ignoreCase !== void 0 ? getAnyExtensionFromPath(path, extensions, ignoreCase) : getAnyExtensionFromPath(path);
     return pathext ? path.slice(0, path.length - pathext.length) + (startsWith(ext, ".") ? ext : "." + ext) : path;
   }
+  function changeFullExtension(path, newExtension) {
+    const declarationExtension = getDeclarationFileExtension(path);
+    if (declarationExtension) {
+      return path.slice(0, path.length - declarationExtension.length) + (startsWith(newExtension, ".") ? newExtension : "." + newExtension);
+    }
+    return changeAnyExtension(path, newExtension);
+  }
   function comparePathsWorker(a, b, componentComparer) {
     if (a === b)
       return 0 /* EqualTo */;
@@ -7250,6 +7298,10 @@ ${lanes.join("\n")}
         ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1286, 1 /* Error */, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286", "ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled."),
         A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1287, 1 /* Error */, "A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimM_1287", "A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled."),
         An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled: diag(1288, 1 /* Error */, "An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabl_1288", "An import alias cannot resolve to a type or type-only declaration when 'verbatimModuleSyntax' is enabled."),
+        _0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1289, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1289", "'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),
+        _0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1290, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1290", "'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
+        _0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1291, 1 /* Error */, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1291", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),
+        _0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1292, 1 /* Error */, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1292", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
         with_statements_are_not_allowed_in_an_async_function_block: diag(1300, 1 /* Error */, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
         await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, 1 /* Error */, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
         The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, 1 /* Error */, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."),
@@ -7313,7 +7365,7 @@ ${lanes.join("\n")}
         await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1375, 1 /* Error */, "await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375", "'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
         _0_was_imported_here: diag(1376, 3 /* Message */, "_0_was_imported_here_1376", "'{0}' was imported here."),
         _0_was_exported_here: diag(1377, 3 /* Message */, "_0_was_exported_here_1377", "'{0}' was exported here."),
-        Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(1378, 1 /* Error */, "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378", "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
+        Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(1378, 1 /* Error */, "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378", "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),
         An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type: diag(1379, 1 /* Error */, "An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type_1379", "An import alias cannot reference a declaration that was exported using 'export type'."),
         An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: diag(1380, 1 /* Error */, "An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380", "An import alias cannot reference a declaration that was imported using 'import type'."),
         Unexpected_token_Did_you_mean_or_rbrace: diag(1381, 1 /* Error */, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `}`?"),
@@ -7364,7 +7416,7 @@ ${lanes.join("\n")}
         File_redirects_to_file_0: diag(1429, 3 /* Message */, "File_redirects_to_file_0_1429", "File redirects to file '{0}'"),
         The_file_is_in_the_program_because_Colon: diag(1430, 3 /* Message */, "The_file_is_in_the_program_because_Colon_1430", "The file is in the program because:"),
         for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1431, 1 /* Error */, "for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431", "'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
-        Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, 1 /* Error */, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
+        Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, 1 /* Error */, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),
         Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters: diag(1433, 1 /* Error */, "Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters_1433", "Neither decorators nor modifiers may be applied to 'this' parameters."),
         Unexpected_keyword_or_identifier: diag(1434, 1 /* Error */, "Unexpected_keyword_or_identifier_1434", "Unexpected keyword or identifier."),
         Unknown_keyword_or_identifier_Did_you_mean_0: diag(1435, 1 /* Error */, "Unknown_keyword_or_identifier_Did_you_mean_0_1435", "Unknown keyword or identifier. Did you mean '{0}'?"),
@@ -7947,9 +7999,9 @@ ${lanes.join("\n")}
         Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers: diag(2818, 1 /* Error */, "Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializer_2818", "Duplicate identifier '{0}'. Compiler reserves name '{1}' when emitting 'super' references in static initializers."),
         Namespace_name_cannot_be_0: diag(2819, 1 /* Error */, "Namespace_name_cannot_be_0_2819", "Namespace name cannot be '{0}'."),
         Type_0_is_not_assignable_to_type_1_Did_you_mean_2: diag(2820, 1 /* Error */, "Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820", "Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),
-        Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext: diag(2821, 1 /* Error */, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext_2821", "Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'."),
+        Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve: diag(2821, 1 /* Error */, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve_2821", "Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'."),
         Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, 1 /* Error */, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."),
-        Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext: diag(2823, 1 /* Error */, "Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext_2823", "Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'."),
+        Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve: diag(2823, 1 /* Error */, "Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve_2823", "Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'."),
         Cannot_find_namespace_0_Did_you_mean_1: diag(2833, 1 /* Error */, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
         Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path: diag(2834, 1 /* Error */, "Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2834", "Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path."),
         Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0: diag(2835, 1 /* Error */, "Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2835", "Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '{0}'?"),
@@ -7969,7 +8021,7 @@ ${lanes.join("\n")}
         The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_Symbol_dispose_method_or_be_null_or_undefined: diag(2851, 1 /* Error */, "The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_2851", "The initializer of an 'await using' declaration must be either an object with a '[Symbol.asyncDispose]()' or '[Symbol.dispose]()' method, or be 'null' or 'undefined'."),
         await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(2852, 1 /* Error */, "await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_2852", "'await using' statements are only allowed within async functions and at the top levels of modules."),
         await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(2853, 1 /* Error */, "await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853", "'await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
-        Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(2854, 1 /* Error */, "Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854", "Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
+        Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(2854, 1 /* Error */, "Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854", "Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),
         Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super: diag(2855, 1 /* Error */, "Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super_2855", "Class field '{0}' defined by the parent class is not accessible in the child class via super."),
         Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls: diag(2856, 1 /* Error */, "Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856", "Import attributes are not allowed on statements that compile to CommonJS 'require' calls."),
         Import_attributes_cannot_be_used_with_type_only_imports_or_exports: diag(2857, 1 /* Error */, "Import_attributes_cannot_be_used_with_type_only_imports_or_exports_2857", "Import attributes cannot be used with type-only imports or exports."),
@@ -7980,6 +8032,10 @@ ${lanes.join("\n")}
         Type_0_is_generic_and_can_only_be_indexed_for_reading: diag(2862, 1 /* Error */, "Type_0_is_generic_and_can_only_be_indexed_for_reading_2862", "Type '{0}' is generic and can only be indexed for reading."),
         A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values: diag(2863, 1 /* Error */, "A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values_2863", "A class cannot extend a primitive type like '{0}'. Classes can only extend constructable values."),
         A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types: diag(2864, 1 /* Error */, "A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types_2864", "A class cannot implement a primitive type like '{0}'. It can only implement other named object types."),
+        Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled: diag(2865, 1 /* Error */, "Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_2865", "Import '{0}' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled."),
+        Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled: diag(2866, 1 /* Error */, "Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_w_2866", "Import '{0}' conflicts with global value used in this file, so must be declared with a type-only import when 'isolatedModules' is enabled."),
+        Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun: diag(2867, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2867", "Cannot find name '{0}'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun`."),
+        Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_and_then_add_bun_to_the_types_field_in_your_tsconfig: diag(2868, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2868", "Cannot find name '{0}'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun` and then add 'bun' to the types field in your tsconfig."),
         Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
         Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
         Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
@@ -8088,6 +8144,8 @@ ${lanes.join("\n")}
         This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122", "This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),
         This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4123, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123", "This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),
         Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, 1 /* Error */, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
+        Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given: diag(4125, 1 /* Error */, "Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given_4125", "Each declaration of '{0}.{1}' differs in its value, where '{2}' was expected but '{3}' was given."),
+        One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value: diag(4126, 1 /* Error */, "One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value_4126", "One value of '{0}.{1}' is the string '{2}', and the other is assumed to be an unknown numeric value."),
         The_current_host_does_not_support_the_0_option: diag(5001, 1 /* Error */, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
         Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, 1 /* Error */, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
         File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, 1 /* Error */, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
@@ -8119,7 +8177,7 @@ ${lanes.join("\n")}
         Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: diag(5068, 1 /* Error */, "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068", "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig."),
         Option_0_cannot_be_specified_without_specifying_option_1_or_option_2: diag(5069, 1 /* Error */, "Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069", "Option '{0}' cannot be specified without specifying option '{1}' or option '{2}'."),
         Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic: diag(5070, 1 /* Error */, "Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic_5070", "Option '--resolveJsonModule' cannot be specified when 'moduleResolution' is set to 'classic'."),
-        Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext: diag(5071, 1 /* Error */, "Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071", "Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs', 'amd', 'es2015' or 'esNext'."),
+        Option_resolveJsonModule_cannot_be_specified_when_module_is_set_to_none_system_or_umd: diag(5071, 1 /* Error */, "Option_resolveJsonModule_cannot_be_specified_when_module_is_set_to_none_system_or_umd_5071", "Option '--resolveJsonModule' cannot be specified when 'module' is set to 'none', 'system', or 'umd'."),
         Unknown_build_option_0: diag(5072, 1 /* Error */, "Unknown_build_option_0_5072", "Unknown build option '{0}'."),
         Build_option_0_requires_a_value_of_type_1: diag(5073, 1 /* Error */, "Build_option_0_requires_a_value_of_type_1_5073", "Build option '{0}' requires a value of type {1}."),
         Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified: diag(5074, 1 /* Error */, "Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074", "Option '--incremental' can only be specified using tsconfig, emitting to single file or when option '--tsBuildInfoFile' is specified."),
@@ -8142,7 +8200,7 @@ ${lanes.join("\n")}
         The_root_value_of_a_0_file_must_be_an_object: diag(5092, 1 /* Error */, "The_root_value_of_a_0_file_must_be_an_object_5092", "The root value of a '{0}' file must be an object."),
         Compiler_option_0_may_only_be_used_with_build: diag(5093, 1 /* Error */, "Compiler_option_0_may_only_be_used_with_build_5093", "Compiler option '--{0}' may only be used with '--build'."),
         Compiler_option_0_may_not_be_used_with_build: diag(5094, 1 /* Error */, "Compiler_option_0_may_not_be_used_with_build_5094", "Compiler option '--{0}' may not be used with '--build'."),
-        Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later: diag(5095, 1 /* Error */, "Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later_5095", "Option '{0}' can only be used when 'module' is set to 'es2015' or later."),
+        Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later: diag(5095, 1 /* Error */, "Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later_5095", "Option '{0}' can only be used when 'module' is set to 'preserve' or to 'es2015' or later."),
         Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096", "Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."),
         An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled: diag(5097, 1 /* Error */, "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097", "An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."),
         Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: diag(5098, 1 /* Error */, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."),
@@ -8222,7 +8280,6 @@ ${lanes.join("\n")}
         Disallow_inconsistently_cased_references_to_the_same_file: diag(6078, 3 /* Message */, "Disallow_inconsistently_cased_references_to_the_same_file_6078", "Disallow inconsistently-cased references to the same file."),
         Specify_library_files_to_be_included_in_the_compilation: diag(6079, 3 /* Message */, "Specify_library_files_to_be_included_in_the_compilation_6079", "Specify library files to be included in the compilation."),
         Specify_JSX_code_generation: diag(6080, 3 /* Message */, "Specify_JSX_code_generation_6080", "Specify JSX code generation."),
-        File_0_has_an_unsupported_extension_so_skipping_it: diag(6081, 3 /* Message */, "File_0_has_an_unsupported_extension_so_skipping_it_6081", "File '{0}' has an unsupported extension, so skipping it."),
         Only_amd_and_system_modules_are_supported_alongside_0: diag(6082, 1 /* Error */, "Only_amd_and_system_modules_are_supported_alongside_0_6082", "Only 'amd' and 'system' modules are supported alongside --{0}."),
         Base_directory_to_resolve_non_absolute_module_names: diag(6083, 3 /* Message */, "Base_directory_to_resolve_non_absolute_module_names_6083", "Base directory to resolve non-absolute module names."),
         Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit: diag(6084, 3 /* Message */, "Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084", "[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit"),
@@ -8443,6 +8500,8 @@ ${lanes.join("\n")}
         Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6276, 3 /* Message */, "Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6276", "Export specifier '{0}' does not exist in package.json scope at path '{1}'."),
         Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update: diag(6277, 3 /* Message */, "Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_i_6277", "Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update."),
         There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings: diag(6278, 3 /* Message */, "There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278", `There are types at '{0}', but this result could not be resolved when respecting package.json "exports". The '{1}' library may need to update its package.json or typings.`),
+        Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_need_configuration_update: diag(6279, 3 /* Message */, "Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_ne_6279", "Resolution of non-relative name failed; trying with '--moduleResolution bundler' to see if project may need configuration update."),
+        There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setting_Consider_updating_to_node16_nodenext_or_bundler: diag(6280, 3 /* Message */, "There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setti_6280", "There are types at '{0}', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'."),
         Enable_project_compilation: diag(6302, 3 /* Message */, "Enable_project_compilation_6302", "Enable project compilation"),
         Composite_projects_may_not_disable_declaration_emit: diag(6304, 1 /* Error */, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."),
         Output_file_0_has_not_been_built_from_source_file_1: diag(6305, 1 /* Error */, "Output_file_0_has_not_been_built_from_source_file_1_6305", "Output file '{0}' has not been built from source file '{1}'."),
@@ -9060,6 +9119,12 @@ ${lanes.join("\n")}
         Could_not_find_variable_to_inline: diag(95185, 3 /* Message */, "Could_not_find_variable_to_inline_95185", "Could not find variable to inline."),
         Variables_with_multiple_declarations_cannot_be_inlined: diag(95186, 3 /* Message */, "Variables_with_multiple_declarations_cannot_be_inlined_95186", "Variables with multiple declarations cannot be inlined."),
         Add_missing_comma_for_object_member_completion_0: diag(95187, 3 /* Message */, "Add_missing_comma_for_object_member_completion_0_95187", "Add missing comma for object member completion '{0}'."),
+        Add_missing_parameter_to_0: diag(95188, 3 /* Message */, "Add_missing_parameter_to_0_95188", "Add missing parameter to '{0}'"),
+        Add_missing_parameters_to_0: diag(95189, 3 /* Message */, "Add_missing_parameters_to_0_95189", "Add missing parameters to '{0}'"),
+        Add_all_missing_parameters: diag(95190, 3 /* Message */, "Add_all_missing_parameters_95190", "Add all missing parameters"),
+        Add_optional_parameter_to_0: diag(95191, 3 /* Message */, "Add_optional_parameter_to_0_95191", "Add optional parameter to '{0}'"),
+        Add_optional_parameters_to_0: diag(95192, 3 /* Message */, "Add_optional_parameters_to_0_95192", "Add optional parameters to '{0}'"),
+        Add_all_optional_parameters: diag(95193, 3 /* Message */, "Add_all_optional_parameters_95193", "Add all optional parameters"),
         No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, 1 /* Error */, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),
         Classes_may_not_have_a_field_named_constructor: diag(18006, 1 /* Error */, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
         JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, 1 /* Error */, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"),
@@ -10270,7 +10335,7 @@ ${lanes.join("\n")}
         }
         const ch = codePointAt(text, pos);
         if (pos === 0) {
-          if (ch === 65533 /* replacementCharacter */) {
+          if (text.slice(0, 256).includes("\uFFFD")) {
             error2(Diagnostics.File_appears_to_be_binary);
             pos = end;
             return token = 8 /* NonTextFileMarkerTrivia */;
@@ -12871,6 +12936,45 @@ ${lanes.join("\n")}
     const type = isJSDocParameterTag(node) ? node.typeExpression && node.typeExpression.type : node.type;
     return node.dotDotDotToken !== void 0 || !!type && type.kind === 325 /* JSDocVariadicType */;
   }
+  function hasInternalAnnotation(range, sourceFile) {
+    const comment = sourceFile.text.substring(range.pos, range.end);
+    return comment.includes("@internal");
+  }
+  function isInternalDeclaration(node, sourceFile) {
+    sourceFile ?? (sourceFile = getSourceFileOfNode(node));
+    const parseTreeNode = getParseTreeNode(node);
+    if (parseTreeNode && parseTreeNode.kind === 169 /* Parameter */) {
+      const paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode);
+      const previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0;
+      const text = sourceFile.text;
+      const commentRanges = previousSibling ? concatenate(
+        // to handle
+        // ... parameters, /** @internal */
+        // public param: string
+        getTrailingCommentRanges(text, skipTrivia(
+          text,
+          previousSibling.end + 1,
+          /*stopAfterLineBreak*/
+          false,
+          /*stopAtComments*/
+          true
+        )),
+        getLeadingCommentRanges(text, node.pos)
+      ) : getTrailingCommentRanges(text, skipTrivia(
+        text,
+        node.pos,
+        /*stopAfterLineBreak*/
+        false,
+        /*stopAtComments*/
+        true
+      ));
+      return some(commentRanges) && hasInternalAnnotation(last(commentRanges), sourceFile);
+    }
+    const leadingCommentRanges = parseTreeNode && getLeadingCommentRangesOfNode(parseTreeNode, sourceFile);
+    return !!forEach(leadingCommentRanges, (range) => {
+      return hasInternalAnnotation(range, sourceFile);
+    });
+  }
   var unchangedTextChangeRange, supportedLocaleDirectories, MAX_SMI_X86;
   var init_utilitiesPublic = __esm({
     "src/compiler/utilitiesPublic.ts"() {
@@ -13008,17 +13112,20 @@ ${lanes.join("\n")}
     return oldRef.path === newRef.path && !oldRef.prepend === !newRef.prepend && !oldRef.circular === !newRef.circular;
   }
   function moduleResolutionIsEqualTo(oldResolution, newResolution) {
-    return oldResolution === newResolution || oldResolution.resolvedModule === newResolution.resolvedModule || !!oldResolution.resolvedModule && !!newResolution.resolvedModule && oldResolution.resolvedModule.isExternalLibraryImport === newResolution.resolvedModule.isExternalLibraryImport && oldResolution.resolvedModule.extension === newResolution.resolvedModule.extension && oldResolution.resolvedModule.resolvedFileName === newResolution.resolvedModule.resolvedFileName && oldResolution.resolvedModule.originalPath === newResolution.resolvedModule.originalPath && packageIdIsEqual(oldResolution.resolvedModule.packageId, newResolution.resolvedModule.packageId) && oldResolution.node10Result === newResolution.node10Result;
+    return oldResolution === newResolution || oldResolution.resolvedModule === newResolution.resolvedModule || !!oldResolution.resolvedModule && !!newResolution.resolvedModule && oldResolution.resolvedModule.isExternalLibraryImport === newResolution.resolvedModule.isExternalLibraryImport && oldResolution.resolvedModule.extension === newResolution.resolvedModule.extension && oldResolution.resolvedModule.resolvedFileName === newResolution.resolvedModule.resolvedFileName && oldResolution.resolvedModule.originalPath === newResolution.resolvedModule.originalPath && packageIdIsEqual(oldResolution.resolvedModule.packageId, newResolution.resolvedModule.packageId) && oldResolution.alternateResult === newResolution.alternateResult;
   }
   function createModuleNotFoundChain(sourceFile, host, moduleReference, mode, packageName) {
     var _a;
-    const node10Result = (_a = host.getResolvedModule(sourceFile, moduleReference, mode)) == null ? void 0 : _a.node10Result;
-    const result = node10Result ? chainDiagnosticMessages(
+    const alternateResult = (_a = host.getResolvedModule(sourceFile, moduleReference, mode)) == null ? void 0 : _a.alternateResult;
+    const alternateResultMessage = alternateResult && (getEmitModuleResolutionKind(host.getCompilerOptions()) === 2 /* Node10 */ ? [Diagnostics.There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setting_Consider_updating_to_node16_nodenext_or_bundler, [alternateResult]] : [
+      Diagnostics.There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings,
+      [alternateResult, alternateResult.includes(nodeModulesPathPart + "@types/") ? `@types/${mangleScopedPackageName(packageName)}` : packageName]
+    ]);
+    const result = alternateResultMessage ? chainDiagnosticMessages(
       /*details*/
       void 0,
-      Diagnostics.There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings,
-      node10Result,
-      node10Result.includes(nodeModulesPathPart + "@types/") ? `@types/${mangleScopedPackageName(packageName)}` : packageName
+      alternateResultMessage[0],
+      ...alternateResultMessage[1]
     ) : host.typesPackageExists(packageName) ? chainDiagnosticMessages(
       /*details*/
       void 0,
@@ -13054,14 +13161,12 @@ ${lanes.join("\n")}
   function typeDirectiveIsEqualTo(oldResolution, newResolution) {
     return oldResolution === newResolution || oldResolution.resolvedTypeReferenceDirective === newResolution.resolvedTypeReferenceDirective || !!oldResolution.resolvedTypeReferenceDirective && !!newResolution.resolvedTypeReferenceDirective && oldResolution.resolvedTypeReferenceDirective.resolvedFileName === newResolution.resolvedTypeReferenceDirective.resolvedFileName && !!oldResolution.resolvedTypeReferenceDirective.primary === !!newResolution.resolvedTypeReferenceDirective.primary && oldResolution.resolvedTypeReferenceDirective.originalPath === newResolution.resolvedTypeReferenceDirective.originalPath;
   }
-  function hasChangesInResolutions(names, newSourceFile, newResolutions, getOldResolution, comparer, nameAndModeGetter) {
+  function hasChangesInResolutions(names, newResolutions, getOldResolution, comparer) {
     Debug.assert(names.length === newResolutions.length);
     for (let i = 0; i < names.length; i++) {
       const newResolution = newResolutions[i];
       const entry = names[i];
-      const name = nameAndModeGetter.getName(entry);
-      const mode = nameAndModeGetter.getMode(entry, newSourceFile);
-      const oldResolution = getOldResolution(name, mode);
+      const oldResolution = getOldResolution(entry);
       const changed = oldResolution ? !newResolution || !comparer(oldResolution, newResolution) : newResolution;
       if (changed) {
         return true;
@@ -13882,7 +13987,7 @@ ${lanes.join("\n")}
       case 116 /* VoidKeyword */:
         return node.parent.kind !== 222 /* VoidExpression */;
       case 233 /* ExpressionWithTypeArguments */:
-        return isHeritageClause(node.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(node);
+        return isPartOfTypeExpressionWithTypeArguments(node);
       case 168 /* TypeParameter */:
         return node.parent.kind === 200 /* MappedType */ || node.parent.kind === 195 /* InferType */;
       case 80 /* Identifier */:
@@ -13907,7 +14012,7 @@ ${lanes.join("\n")}
         }
         switch (parent2.kind) {
           case 233 /* ExpressionWithTypeArguments */:
-            return isHeritageClause(parent2.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(parent2);
+            return isPartOfTypeExpressionWithTypeArguments(parent2);
           case 168 /* TypeParameter */:
             return node === parent2.constraint;
           case 352 /* JSDocTemplateTag */:
@@ -13941,6 +14046,9 @@ ${lanes.join("\n")}
     }
     return false;
   }
+  function isPartOfTypeExpressionWithTypeArguments(node) {
+    return isJSDocImplementsTag(node.parent) || isJSDocAugmentsTag(node.parent) || isHeritageClause(node.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(node);
+  }
   function isChildOfNodeWithKind(node, kind) {
     while (node) {
       if (node.kind === kind) {
@@ -15114,12 +15222,12 @@ ${lanes.join("\n")}
   function getJSDocCommentsAndTags(hostNode, noCache) {
     let result;
     if (isVariableLike(hostNode) && hasInitializer(hostNode) && hasJSDocNodes(hostNode.initializer)) {
-      result = addRange(result, filterOwnedJSDocTags(hostNode, last(hostNode.initializer.jsDoc)));
+      result = addRange(result, filterOwnedJSDocTags(hostNode, hostNode.initializer.jsDoc));
     }
     let node = hostNode;
     while (node && node.parent) {
       if (hasJSDocNodes(node)) {
-        result = addRange(result, filterOwnedJSDocTags(hostNode, last(node.jsDoc)));
+        result = addRange(result, filterOwnedJSDocTags(hostNode, node.jsDoc));
       }
       if (node.kind === 169 /* Parameter */) {
         result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node));
@@ -15133,12 +15241,16 @@ ${lanes.join("\n")}
     }
     return result || emptyArray;
   }
-  function filterOwnedJSDocTags(hostNode, jsDoc) {
-    if (isJSDoc(jsDoc)) {
-      const ownedTags = filter(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag));
-      return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags;
-    }
-    return ownsJSDocTag(hostNode, jsDoc) ? [jsDoc] : void 0;
+  function filterOwnedJSDocTags(hostNode, comments) {
+    const lastJsDoc = last(comments);
+    return flatMap(comments, (jsDoc) => {
+      if (jsDoc === lastJsDoc) {
+        const ownedTags = filter(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag));
+        return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags;
+      } else {
+        return filter(jsDoc.tags, isJSDocOverloadTag);
+      }
+    });
   }
   function ownsJSDocTag(hostNode, tag) {
     return !(isJSDocTypeTag(tag) || isJSDocSatisfiesTag(tag)) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode;
@@ -15177,6 +15289,9 @@ ${lanes.join("\n")}
     }
     return getHostSignatureFromJSDoc(node);
   }
+  function getJSDocOverloadTags(node) {
+    return getAllJSDocTags(node, isJSDocOverloadTag);
+  }
   function getHostSignatureFromJSDoc(node) {
     const host = getEffectiveJSDocHost(node);
     if (host) {
@@ -17065,6 +17180,13 @@ ${lanes.join("\n")}
   function readJson(path, host) {
     return readJsonOrUndefined(path, host) || {};
   }
+  function tryParseJson(text) {
+    try {
+      return JSON.parse(text);
+    } catch {
+      return void 0;
+    }
+  }
   function directoryProbablyExists(directoryName, host) {
     return !host.directoryExists || host.directoryExists(directoryName);
   }
@@ -17310,19 +17432,19 @@ ${lanes.join("\n")}
   function mutateMapSkippingNewValues(map2, newMap, options) {
     const { onDeleteValue, onExistingValue } = options;
     map2.forEach((existingValue, key) => {
-      const valueInNewMap = newMap.get(key);
-      if (valueInNewMap === void 0) {
+      var _a;
+      if (!(newMap == null ? void 0 : newMap.has(key))) {
         map2.delete(key);
         onDeleteValue(existingValue, key);
       } else if (onExistingValue) {
-        onExistingValue(existingValue, valueInNewMap, key);
+        onExistingValue(existingValue, (_a = newMap.get) == null ? void 0 : _a.call(newMap, key), key);
       }
     });
   }
   function mutateMap(map2, newMap, options) {
     mutateMapSkippingNewValues(map2, newMap, options);
     const { createNewValue } = options;
-    newMap.forEach((valueInNewMap, key) => {
+    newMap == null ? void 0 : newMap.forEach((valueInNewMap, key) => {
       if (!map2.has(key)) {
         map2.set(key, createNewValue(key, valueInNewMap));
       }
@@ -17480,7 +17602,7 @@ ${lanes.join("\n")}
     this.exportSymbol = void 0;
     this.constEnumOnlyModule = void 0;
     this.isReferenced = void 0;
-    this.isAssigned = void 0;
+    this.lastAssignmentPos = void 0;
     this.links = void 0;
   }
   function Type3(checker, flags) {
@@ -17775,55 +17897,20 @@ ${lanes.join("\n")}
         return callback;
     }
   }
-  function getEmitScriptTarget(compilerOptions) {
-    return compilerOptions.target ?? (compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */);
-  }
-  function getEmitModuleKind(compilerOptions) {
-    return typeof compilerOptions.module === "number" ? compilerOptions.module : getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
+  function createComputedCompilerOptions(options) {
+    return options;
   }
   function emitModuleKindIsNonNodeESM(moduleKind) {
     return moduleKind >= 5 /* ES2015 */ && moduleKind <= 99 /* ESNext */;
   }
-  function getEmitModuleResolutionKind(compilerOptions) {
-    let moduleResolution = compilerOptions.moduleResolution;
-    if (moduleResolution === void 0) {
-      switch (getEmitModuleKind(compilerOptions)) {
-        case 1 /* CommonJS */:
-          moduleResolution = 2 /* Node10 */;
-          break;
-        case 100 /* Node16 */:
-          moduleResolution = 3 /* Node16 */;
-          break;
-        case 199 /* NodeNext */:
-          moduleResolution = 99 /* NodeNext */;
-          break;
-        default:
-          moduleResolution = 1 /* Classic */;
-          break;
-      }
-    }
-    return moduleResolution;
-  }
-  function getEmitModuleDetectionKind(options) {
-    return options.moduleDetection || (getEmitModuleKind(options) === 100 /* Node16 */ || getEmitModuleKind(options) === 199 /* NodeNext */ ? 3 /* Force */ : 2 /* Auto */);
-  }
   function hasJsonModuleEmitEnabled(options) {
     switch (getEmitModuleKind(options)) {
-      case 1 /* CommonJS */:
-      case 2 /* AMD */:
-      case 5 /* ES2015 */:
-      case 6 /* ES2020 */:
-      case 7 /* ES2022 */:
-      case 99 /* ESNext */:
-      case 100 /* Node16 */:
-      case 199 /* NodeNext */:
-        return true;
-      default:
+      case 0 /* None */:
+      case 4 /* System */:
+      case 3 /* UMD */:
         return false;
     }
-  }
-  function getIsolatedModules(options) {
-    return !!(options.isolatedModules || options.verbatimModuleSyntax);
+    return true;
   }
   function importNameElisionDisabled(options) {
     return options.verbatimModuleSyntax || options.isolatedModules && options.preserveValueImports;
@@ -17834,88 +17921,12 @@ ${lanes.join("\n")}
   function unusedLabelIsError(options) {
     return options.allowUnusedLabels === false;
   }
-  function getAreDeclarationMapsEnabled(options) {
-    return !!(getEmitDeclarations(options) && options.declarationMap);
-  }
-  function getESModuleInterop(compilerOptions) {
-    if (compilerOptions.esModuleInterop !== void 0) {
-      return compilerOptions.esModuleInterop;
-    }
-    switch (getEmitModuleKind(compilerOptions)) {
-      case 100 /* Node16 */:
-      case 199 /* NodeNext */:
-        return true;
-    }
-    return void 0;
-  }
-  function getAllowSyntheticDefaultImports(compilerOptions) {
-    if (compilerOptions.allowSyntheticDefaultImports !== void 0) {
-      return compilerOptions.allowSyntheticDefaultImports;
-    }
-    return getESModuleInterop(compilerOptions) || getEmitModuleKind(compilerOptions) === 4 /* System */ || getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */;
-  }
   function moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution) {
     return moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */;
   }
-  function shouldResolveJsRequire(compilerOptions) {
-    return !!compilerOptions.noDtsResolution || getEmitModuleResolutionKind(compilerOptions) !== 100 /* Bundler */;
-  }
-  function getResolvePackageJsonExports(compilerOptions) {
-    const moduleResolution = getEmitModuleResolutionKind(compilerOptions);
-    if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
-      return false;
-    }
-    if (compilerOptions.resolvePackageJsonExports !== void 0) {
-      return compilerOptions.resolvePackageJsonExports;
-    }
-    switch (moduleResolution) {
-      case 3 /* Node16 */:
-      case 99 /* NodeNext */:
-      case 100 /* Bundler */:
-        return true;
-    }
-    return false;
-  }
-  function getResolvePackageJsonImports(compilerOptions) {
-    const moduleResolution = getEmitModuleResolutionKind(compilerOptions);
-    if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
-      return false;
-    }
-    if (compilerOptions.resolvePackageJsonExports !== void 0) {
-      return compilerOptions.resolvePackageJsonExports;
-    }
-    switch (moduleResolution) {
-      case 3 /* Node16 */:
-      case 99 /* NodeNext */:
-      case 100 /* Bundler */:
-        return true;
-    }
-    return false;
-  }
-  function getResolveJsonModule(compilerOptions) {
-    if (compilerOptions.resolveJsonModule !== void 0) {
-      return compilerOptions.resolveJsonModule;
-    }
-    return getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */;
-  }
-  function getEmitDeclarations(compilerOptions) {
-    return !!(compilerOptions.declaration || compilerOptions.composite);
-  }
-  function shouldPreserveConstEnums(compilerOptions) {
-    return !!(compilerOptions.preserveConstEnums || getIsolatedModules(compilerOptions));
-  }
-  function isIncrementalCompilation(options) {
-    return !!(options.incremental || options.composite);
-  }
   function getStrictOptionValue(compilerOptions, flag) {
     return compilerOptions[flag] === void 0 ? !!compilerOptions.strict : !!compilerOptions[flag];
   }
-  function getAllowJSCompilerOption(compilerOptions) {
-    return compilerOptions.allowJs === void 0 ? !!compilerOptions.checkJs : compilerOptions.allowJs;
-  }
-  function getUseDefineForClassFields(compilerOptions) {
-    return compilerOptions.useDefineForClassFields === void 0 ? getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */ : compilerOptions.useDefineForClassFields;
-  }
   function getEmitStandardClassFields(compilerOptions) {
     return compilerOptions.useDefineForClassFields !== false && getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */;
   }
@@ -18051,7 +18062,7 @@ ${lanes.join("\n")}
     const pattern = spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]);
     return pattern && `^(${pattern})${usage === "exclude" ? "($|/)" : "$"}`;
   }
-  function getSubPatternFromSpec(spec, basePath, usage, { singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter: replaceWildcardCharacter2 }) {
+  function getSubPatternFromSpec(spec, basePath, usage, { singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter: replaceWildcardCharacter2 } = wildcardMatchers[usage]) {
     let subpattern = "";
     let hasWrittenComponent = false;
     const components = getNormalizedPathComponents(spec, basePath);
@@ -18253,7 +18264,9 @@ ${lanes.join("\n")}
     return firstDefined(imports, ({ text }) => pathIsRelative(text) && !fileExtensionIsOneOf(text, extensionsNotSupportingExtensionlessResolution) ? hasExtension2(text) : void 0) || false;
   }
   function getModuleSpecifierEndingPreference(preference, resolutionMode, compilerOptions, sourceFile) {
-    if (preference === "js" || resolutionMode === 99 /* ESNext */) {
+    const moduleResolution = getEmitModuleResolutionKind(compilerOptions);
+    const moduleResolutionIsNodeNext = 3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */;
+    if (preference === "js" || resolutionMode === 99 /* ESNext */ && moduleResolutionIsNodeNext) {
       if (!shouldAllowImportingTsExtension(compilerOptions)) {
         return 2 /* JsExtension */;
       }
@@ -18271,16 +18284,19 @@ ${lanes.join("\n")}
     return inferPreference();
     function inferPreference() {
       let usesJsExtensions = false;
-      const specifiers = sourceFile.imports.length ? sourceFile.imports.map((i) => i.text) : isSourceFileJS(sourceFile) ? getRequiresAtTopOfFile(sourceFile).map((r) => r.arguments[0].text) : emptyArray;
+      const specifiers = sourceFile.imports.length ? sourceFile.imports : isSourceFileJS(sourceFile) ? getRequiresAtTopOfFile(sourceFile).map((r) => r.arguments[0]) : emptyArray;
       for (const specifier of specifiers) {
-        if (pathIsRelative(specifier)) {
-          if (fileExtensionIsOneOf(specifier, extensionsNotSupportingExtensionlessResolution)) {
+        if (pathIsRelative(specifier.text)) {
+          if (moduleResolutionIsNodeNext && resolutionMode === 1 /* CommonJS */ && getModeForUsageLocation(sourceFile, specifier, compilerOptions) === 99 /* ESNext */) {
+            continue;
+          }
+          if (fileExtensionIsOneOf(specifier.text, extensionsNotSupportingExtensionlessResolution)) {
             continue;
           }
-          if (hasTSFileExtension(specifier)) {
+          if (hasTSFileExtension(specifier.text)) {
             return 3 /* TsExtension */;
           }
-          if (hasJSFileExtension(specifier)) {
+          if (hasJSFileExtension(specifier.text)) {
             usesJsExtensions = true;
           }
         }
@@ -18764,10 +18780,6 @@ ${lanes.join("\n")}
   function isCatchClauseVariableDeclaration(node) {
     return node.kind === 260 /* VariableDeclaration */ && node.parent.kind === 299 /* CatchClause */;
   }
-  function isParameterOrCatchClauseVariable(symbol) {
-    const declaration = symbol.valueDeclaration && getRootDeclaration(symbol.valueDeclaration);
-    return !!declaration && (isParameter(declaration) || isCatchClauseVariableDeclaration(declaration));
-  }
   function isFunctionExpressionOrArrowFunction(node) {
     return node.kind === 218 /* FunctionExpression */ || node.kind === 219 /* ArrowFunction */;
   }
@@ -18948,7 +18960,13 @@ ${lanes.join("\n")}
     }
     return !!getResolutionModeOverride(node.attributes);
   }
-  var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, getScriptTargetFeatures, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashLibReferenceRegEx, fullTripleSlashAMDReferencePathRegEx, fullTripleSlashAMDModuleRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, objectAllocator, objectAllocatorPatchers, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, extensionsNotSupportingExtensionlessResolution, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries;
+  function replaceFirstStar(s, replacement) {
+    return stringReplace.call(s, "*", replacement);
+  }
+  function getNameFromImportAttribute(node) {
+    return isIdentifier(node.name) ? node.name.escapedText : escapeLeadingUnderscores(node.name.text);
+  }
+  var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, getScriptTargetFeatures, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashLibReferenceRegEx, fullTripleSlashAMDReferencePathRegEx, fullTripleSlashAMDModuleRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, objectAllocator, objectAllocatorPatchers, localizedDiagnosticMessages, computedOptions, getEmitScriptTarget, getEmitModuleKind, getEmitModuleResolutionKind, getEmitModuleDetectionKind, getIsolatedModules, getESModuleInterop, getAllowSyntheticDefaultImports, getResolvePackageJsonExports, getResolvePackageJsonImports, getResolveJsonModule, getEmitDeclarations, shouldPreserveConstEnums, isIncrementalCompilation, getAreDeclarationMapsEnabled, getAllowJSCompilerOption, getUseDefineForClassFields, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, extensionsNotSupportingExtensionlessResolution, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries, stringReplace;
   var init_utilities = __esm({
     "src/compiler/utilities.ts"() {
       "use strict";
@@ -19462,6 +19480,229 @@ ${lanes.join("\n")}
         getSourceMapSourceConstructor: () => SourceMapSource
       };
       objectAllocatorPatchers = [];
+      computedOptions = createComputedCompilerOptions({
+        target: {
+          dependencies: ["module"],
+          computeValue: (compilerOptions) => {
+            return compilerOptions.target ?? (compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */);
+          }
+        },
+        module: {
+          dependencies: ["target"],
+          computeValue: (compilerOptions) => {
+            return typeof compilerOptions.module === "number" ? compilerOptions.module : computedOptions.target.computeValue(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
+          }
+        },
+        moduleResolution: {
+          dependencies: ["module", "target"],
+          computeValue: (compilerOptions) => {
+            let moduleResolution = compilerOptions.moduleResolution;
+            if (moduleResolution === void 0) {
+              switch (computedOptions.module.computeValue(compilerOptions)) {
+                case 1 /* CommonJS */:
+                  moduleResolution = 2 /* Node10 */;
+                  break;
+                case 100 /* Node16 */:
+                  moduleResolution = 3 /* Node16 */;
+                  break;
+                case 199 /* NodeNext */:
+                  moduleResolution = 99 /* NodeNext */;
+                  break;
+                case 200 /* Preserve */:
+                  moduleResolution = 100 /* Bundler */;
+                  break;
+                default:
+                  moduleResolution = 1 /* Classic */;
+                  break;
+              }
+            }
+            return moduleResolution;
+          }
+        },
+        moduleDetection: {
+          dependencies: ["module", "target"],
+          computeValue: (compilerOptions) => {
+            return compilerOptions.moduleDetection || (computedOptions.module.computeValue(compilerOptions) === 100 /* Node16 */ || computedOptions.module.computeValue(compilerOptions) === 199 /* NodeNext */ ? 3 /* Force */ : 2 /* Auto */);
+          }
+        },
+        isolatedModules: {
+          dependencies: ["verbatimModuleSyntax"],
+          computeValue: (compilerOptions) => {
+            return !!(compilerOptions.isolatedModules || compilerOptions.verbatimModuleSyntax);
+          }
+        },
+        esModuleInterop: {
+          dependencies: ["module", "target"],
+          computeValue: (compilerOptions) => {
+            if (compilerOptions.esModuleInterop !== void 0) {
+              return compilerOptions.esModuleInterop;
+            }
+            switch (computedOptions.module.computeValue(compilerOptions)) {
+              case 100 /* Node16 */:
+              case 199 /* NodeNext */:
+              case 200 /* Preserve */:
+                return true;
+            }
+            return false;
+          }
+        },
+        allowSyntheticDefaultImports: {
+          dependencies: ["module", "target", "moduleResolution"],
+          computeValue: (compilerOptions) => {
+            if (compilerOptions.allowSyntheticDefaultImports !== void 0) {
+              return compilerOptions.allowSyntheticDefaultImports;
+            }
+            return computedOptions.esModuleInterop.computeValue(compilerOptions) || computedOptions.module.computeValue(compilerOptions) === 4 /* System */ || computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */;
+          }
+        },
+        resolvePackageJsonExports: {
+          dependencies: ["moduleResolution"],
+          computeValue: (compilerOptions) => {
+            const moduleResolution = computedOptions.moduleResolution.computeValue(compilerOptions);
+            if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
+              return false;
+            }
+            if (compilerOptions.resolvePackageJsonExports !== void 0) {
+              return compilerOptions.resolvePackageJsonExports;
+            }
+            switch (moduleResolution) {
+              case 3 /* Node16 */:
+              case 99 /* NodeNext */:
+              case 100 /* Bundler */:
+                return true;
+            }
+            return false;
+          }
+        },
+        resolvePackageJsonImports: {
+          dependencies: ["moduleResolution", "resolvePackageJsonExports"],
+          computeValue: (compilerOptions) => {
+            const moduleResolution = computedOptions.moduleResolution.computeValue(compilerOptions);
+            if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
+              return false;
+            }
+            if (compilerOptions.resolvePackageJsonExports !== void 0) {
+              return compilerOptions.resolvePackageJsonExports;
+            }
+            switch (moduleResolution) {
+              case 3 /* Node16 */:
+              case 99 /* NodeNext */:
+              case 100 /* Bundler */:
+                return true;
+            }
+            return false;
+          }
+        },
+        resolveJsonModule: {
+          dependencies: ["moduleResolution", "module", "target"],
+          computeValue: (compilerOptions) => {
+            if (compilerOptions.resolveJsonModule !== void 0) {
+              return compilerOptions.resolveJsonModule;
+            }
+            return computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */;
+          }
+        },
+        declaration: {
+          dependencies: ["composite"],
+          computeValue: (compilerOptions) => {
+            return !!(compilerOptions.declaration || compilerOptions.composite);
+          }
+        },
+        preserveConstEnums: {
+          dependencies: ["isolatedModules", "verbatimModuleSyntax"],
+          computeValue: (compilerOptions) => {
+            return !!(compilerOptions.preserveConstEnums || computedOptions.isolatedModules.computeValue(compilerOptions));
+          }
+        },
+        incremental: {
+          dependencies: ["composite"],
+          computeValue: (compilerOptions) => {
+            return !!(compilerOptions.incremental || compilerOptions.composite);
+          }
+        },
+        declarationMap: {
+          dependencies: ["declaration", "composite"],
+          computeValue: (compilerOptions) => {
+            return !!(compilerOptions.declarationMap && computedOptions.declaration.computeValue(compilerOptions));
+          }
+        },
+        allowJs: {
+          dependencies: ["checkJs"],
+          computeValue: (compilerOptions) => {
+            return compilerOptions.allowJs === void 0 ? !!compilerOptions.checkJs : compilerOptions.allowJs;
+          }
+        },
+        useDefineForClassFields: {
+          dependencies: ["target", "module"],
+          computeValue: (compilerOptions) => {
+            return compilerOptions.useDefineForClassFields === void 0 ? computedOptions.target.computeValue(compilerOptions) >= 9 /* ES2022 */ : compilerOptions.useDefineForClassFields;
+          }
+        },
+        noImplicitAny: {
+          dependencies: ["strict"],
+          computeValue: (compilerOptions) => {
+            return getStrictOptionValue(compilerOptions, "noImplicitAny");
+          }
+        },
+        noImplicitThis: {
+          dependencies: ["strict"],
+          computeValue: (compilerOptions) => {
+            return getStrictOptionValue(compilerOptions, "noImplicitThis");
+          }
+        },
+        strictNullChecks: {
+          dependencies: ["strict"],
+          computeValue: (compilerOptions) => {
+            return getStrictOptionValue(compilerOptions, "strictNullChecks");
+          }
+        },
+        strictFunctionTypes: {
+          dependencies: ["strict"],
+          computeValue: (compilerOptions) => {
+            return getStrictOptionValue(compilerOptions, "strictFunctionTypes");
+          }
+        },
+        strictBindCallApply: {
+          dependencies: ["strict"],
+          computeValue: (compilerOptions) => {
+            return getStrictOptionValue(compilerOptions, "strictBindCallApply");
+          }
+        },
+        strictPropertyInitialization: {
+          dependencies: ["strict"],
+          computeValue: (compilerOptions) => {
+            return getStrictOptionValue(compilerOptions, "strictPropertyInitialization");
+          }
+        },
+        alwaysStrict: {
+          dependencies: ["strict"],
+          computeValue: (compilerOptions) => {
+            return getStrictOptionValue(compilerOptions, "alwaysStrict");
+          }
+        },
+        useUnknownInCatchVariables: {
+          dependencies: ["strict"],
+          computeValue: (compilerOptions) => {
+            return getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
+          }
+        }
+      });
+      getEmitScriptTarget = computedOptions.target.computeValue;
+      getEmitModuleKind = computedOptions.module.computeValue;
+      getEmitModuleResolutionKind = computedOptions.moduleResolution.computeValue;
+      getEmitModuleDetectionKind = computedOptions.moduleDetection.computeValue;
+      getIsolatedModules = computedOptions.isolatedModules.computeValue;
+      getESModuleInterop = computedOptions.esModuleInterop.computeValue;
+      getAllowSyntheticDefaultImports = computedOptions.allowSyntheticDefaultImports.computeValue;
+      getResolvePackageJsonExports = computedOptions.resolvePackageJsonExports.computeValue;
+      getResolvePackageJsonImports = computedOptions.resolvePackageJsonImports.computeValue;
+      getResolveJsonModule = computedOptions.resolveJsonModule.computeValue;
+      getEmitDeclarations = computedOptions.declaration.computeValue;
+      shouldPreserveConstEnums = computedOptions.preserveConstEnums.computeValue;
+      isIncrementalCompilation = computedOptions.incremental.computeValue;
+      getAreDeclarationMapsEnabled = computedOptions.declarationMap.computeValue;
+      getAllowJSCompilerOption = computedOptions.allowJs.computeValue;
+      getUseDefineForClassFields = computedOptions.useDefineForClassFields.computeValue;
       reservedCharacterPattern = /[^\w\s/]/g;
       wildcardCharCodes = [42 /* asterisk */, 63 /* question */];
       commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"];
@@ -19523,6 +19764,7 @@ ${lanes.join("\n")}
         files: emptyArray,
         directories: emptyArray
       };
+      stringReplace = String.prototype.replace;
     }
   });
 
@@ -20141,7 +20383,7 @@ ${lanes.join("\n")}
     nodeFactoryPatchers.push(fn);
   }
   function createNodeFactory(flags, baseFactory2) {
-    const update = flags & 8 /* NoOriginalNode */ ? updateWithoutOriginal : updateWithOriginal;
+    const setOriginal = flags & 8 /* NoOriginalNode */ ? identity : setOriginalNode;
     const parenthesizerRules = memoize(() => flags & 1 /* NoParenthesizerRules */ ? nullParenthesizerRules : createParenthesizerRules(factory2));
     const converters = memoize(() => flags & 2 /* NoNodeConverters */ ? nullNodeConverters : createNodeConverters(factory2));
     const getBinaryCreateFunction = memoizeOne((operator) => (left, right) => createBinaryExpression(left, operator, right));
@@ -20848,8 +21090,10 @@ ${lanes.join("\n")}
       return update(updated, original);
     }
     function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
+      const text = typeof value === "number" ? value + "" : value;
+      Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
       const node = createBaseDeclaration(9 /* NumericLiteral */);
-      node.text = typeof value === "number" ? value + "" : value;
+      node.text = text;
       node.numericLiteralFlags = numericLiteralFlags;
       if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
         node.transformFlags |= 1024 /* ContainsES2015 */;
@@ -23639,7 +23883,7 @@ ${lanes.join("\n")}
     }
     function cloneSourceFile(source) {
       const node = source.redirectInfo ? cloneRedirectedSourceFile(source) : cloneSourceFileWorker(source);
-      setOriginalNode(node, source);
+      setOriginal(node, source);
       return node;
     }
     function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) {
@@ -23772,7 +24016,7 @@ ${lanes.join("\n")}
       const clone2 = createBaseIdentifier(node.escapedText);
       clone2.flags |= node.flags & ~16 /* Synthesized */;
       clone2.transformFlags = node.transformFlags;
-      setOriginalNode(clone2, node);
+      setOriginal(clone2, node);
       setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate });
       return clone2;
     }
@@ -23783,7 +24027,7 @@ ${lanes.join("\n")}
       clone2.flowNode = node.flowNode;
       clone2.symbol = node.symbol;
       clone2.transformFlags = node.transformFlags;
-      setOriginalNode(clone2, node);
+      setOriginal(clone2, node);
       const typeArguments = getIdentifierTypeArguments(node);
       if (typeArguments)
         setIdentifierTypeArguments(clone2, typeArguments);
@@ -23793,7 +24037,7 @@ ${lanes.join("\n")}
       const clone2 = createBasePrivateIdentifier(node.escapedText);
       clone2.flags |= node.flags & ~16 /* Synthesized */;
       clone2.transformFlags = node.transformFlags;
-      setOriginalNode(clone2, node);
+      setOriginal(clone2, node);
       setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate });
       return clone2;
     }
@@ -23801,7 +24045,7 @@ ${lanes.join("\n")}
       const clone2 = createBasePrivateIdentifier(node.escapedText);
       clone2.flags |= node.flags & ~16 /* Synthesized */;
       clone2.transformFlags = node.transformFlags;
-      setOriginalNode(clone2, node);
+      setOriginal(clone2, node);
       return clone2;
     }
     function cloneNode(node) {
@@ -23826,7 +24070,7 @@ ${lanes.join("\n")}
       const clone2 = !isNodeKind(node.kind) ? baseFactory2.createBaseTokenNode(node.kind) : baseFactory2.createBaseNode(node.kind);
       clone2.flags |= node.flags & ~16 /* Synthesized */;
       clone2.transformFlags = node.transformFlags;
-      setOriginalNode(clone2, node);
+      setOriginal(clone2, node);
       for (const key in node) {
         if (hasProperty(clone2, key) || !hasProperty(node, key)) {
           continue;
@@ -24351,7 +24595,7 @@ ${lanes.join("\n")}
       return typeof value === "number" ? createToken(value) : value;
     }
     function asEmbeddedStatement(statement) {
-      return statement && isNotEmittedStatement(statement) ? setTextRange(setOriginalNode(createEmptyStatement(), statement), statement) : statement;
+      return statement && isNotEmittedStatement(statement) ? setTextRange(setOriginal(createEmptyStatement(), statement), statement) : statement;
     }
     function asVariableDeclaration(variableDeclaration) {
       if (typeof variableDeclaration === "string" || variableDeclaration && !isVariableDeclaration(variableDeclaration)) {
@@ -24367,19 +24611,13 @@ ${lanes.join("\n")}
       }
       return variableDeclaration;
     }
-  }
-  function updateWithoutOriginal(updated, original) {
-    if (updated !== original) {
-      setTextRange(updated, original);
-    }
-    return updated;
-  }
-  function updateWithOriginal(updated, original) {
-    if (updated !== original) {
-      setOriginalNode(updated, original);
-      setTextRange(updated, original);
+    function update(updated, original) {
+      if (updated !== original) {
+        setOriginal(updated, original);
+        setTextRange(updated, original);
+      }
+      return updated;
     }
-    return updated;
   }
   function getDefaultTagNameForKind(kind) {
     switch (kind) {
@@ -25498,7 +25736,7 @@ ${lanes.join("\n")}
         ]
       );
     }
-    function createAwaiterHelper(hasLexicalThis, hasLexicalArguments, promiseConstructor, body) {
+    function createAwaiterHelper(hasLexicalThis, argumentsExpression, promiseConstructor, parameters, body) {
       context.requestEmitHelper(awaiterHelper);
       const generatorFunc = factory2.createFunctionExpression(
         /*modifiers*/
@@ -25508,8 +25746,7 @@ ${lanes.join("\n")}
         void 0,
         /*typeParameters*/
         void 0,
-        /*parameters*/
-        [],
+        parameters ?? [],
         /*type*/
         void 0,
         body
@@ -25521,7 +25758,7 @@ ${lanes.join("\n")}
         void 0,
         [
           hasLexicalThis ? factory2.createThis() : factory2.createVoidZero(),
-          hasLexicalArguments ? factory2.createIdentifier("arguments") : factory2.createVoidZero(),
+          argumentsExpression ?? factory2.createVoidZero(),
           promiseConstructor ? createExpressionFromEntityName(factory2, promiseConstructor) : factory2.createVoidZero(),
           generatorFunc
         ]
@@ -28295,7 +28532,25 @@ ${lanes.join("\n")}
     return Parser.JSDocParser.parseJSDocTypeExpressionForTests(content, start, length2);
   }
   function isDeclarationFileName(fileName) {
-    return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && getBaseFileName(fileName).includes(".d.");
+    return getDeclarationFileExtension(fileName) !== void 0;
+  }
+  function getDeclarationFileExtension(fileName) {
+    const standardExtension = getAnyExtensionFromPath(
+      fileName,
+      supportedDeclarationExtensions,
+      /*ignoreCase*/
+      false
+    );
+    if (standardExtension) {
+      return standardExtension;
+    }
+    if (fileExtensionIs(fileName, ".ts" /* Ts */)) {
+      const index = getBaseFileName(fileName).lastIndexOf(".d.");
+      if (index >= 0) {
+        return fileName.substring(index);
+      }
+    }
+    return void 0;
   }
   function parseResolutionMode(mode, pos, end, reportDiagnostic) {
     if (!mode) {
@@ -29374,8 +29629,10 @@ ${lanes.join("\n")}
           setTextRangePosWidth(sourceFile, 0, sourceText.length);
           setFields(sourceFile);
           if (!isDeclarationFile && isExternalModule(sourceFile) && sourceFile.transformFlags & 67108864 /* ContainsPossibleTopLevelAwait */) {
+            const oldSourceFile = sourceFile;
             sourceFile = reparseTopLevelAwait(sourceFile);
-            setFields(sourceFile);
+            if (oldSourceFile !== sourceFile)
+              setFields(sourceFile);
           }
           return sourceFile;
           function setFields(sourceFile2) {
@@ -30773,8 +31030,7 @@ ${lanes.join("\n")}
         function parseJSDocFunctionType() {
           const pos = getNodePos();
           const hasJSDoc = hasPrecedingJSDocComment();
-          if (lookAhead(nextTokenIsOpenParen)) {
-            nextToken();
+          if (tryParse(nextTokenIsOpenParen)) {
             const parameters = parseParameters(4 /* Type */ | 32 /* JSDoc */);
             const type = parseReturnType(
               59 /* ColonToken */,
@@ -33695,6 +33951,10 @@ ${lanes.join("\n")}
         function nextTokenIsStringLiteral() {
           return nextToken() === 11 /* StringLiteral */;
         }
+        function nextTokenIsFromKeywordOrEqualsToken() {
+          nextToken();
+          return token() === 161 /* FromKeyword */ || token() === 64 /* EqualsToken */;
+        }
         function nextTokenIsIdentifierOrStringLiteralOnSameLine() {
           nextToken();
           return !scanner2.hasPrecedingLineBreak() && (isIdentifier2() || token() === 11 /* StringLiteral */);
@@ -34390,7 +34650,7 @@ ${lanes.join("\n")}
             identifier = parseIdentifier();
           }
           let isTypeOnly = false;
-          if (token() !== 161 /* FromKeyword */ && (identifier == null ? void 0 : identifier.escapedText) === "type" && (isIdentifier2() || tokenAfterImportDefinitelyProducesImportDeclaration())) {
+          if ((identifier == null ? void 0 : identifier.escapedText) === "type" && (token() !== 161 /* FromKeyword */ || isIdentifier2() && lookAhead(nextTokenIsFromKeywordOrEqualsToken)) && (isIdentifier2() || tokenAfterImportDefinitelyProducesImportDeclaration())) {
             isTypeOnly = true;
             identifier = isIdentifier2() ? parseIdentifier() : void 0;
           }
@@ -34769,7 +35029,7 @@ ${lanes.join("\n")}
               if (!jsDocDiagnostics) {
                 jsDocDiagnostics = [];
               }
-              jsDocDiagnostics.push(...parseDiagnostics);
+              addRange(jsDocDiagnostics, parseDiagnostics, saveParseDiagnosticsLength);
             }
             currentToken = saveToken;
             parseDiagnostics.length = saveParseDiagnosticsLength;
@@ -35173,18 +35433,7 @@ ${lanes.join("\n")}
               }
               nextTokenJSDoc();
               skipWhitespace();
-              const p2 = getNodePos();
-              let name = tokenIsIdentifierOrKeyword(token()) ? parseEntityName(
-                /*allowReservedWords*/
-                true
-              ) : void 0;
-              if (name) {
-                while (token() === 81 /* PrivateIdentifier */) {
-                  reScanHashToken();
-                  nextTokenJSDoc();
-                  name = finishNode(factory2.createJSDocMemberName(name, parseIdentifier()), p2);
-                }
-              }
+              const name = parseJSDocLinkName();
               const text = [];
               while (token() !== 20 /* CloseBraceToken */ && token() !== 4 /* NewLineTrivia */ && token() !== 1 /* EndOfFileToken */) {
                 text.push(scanner2.getTokenText());
@@ -35193,6 +35442,26 @@ ${lanes.join("\n")}
               const create = linkType === "link" ? factory2.createJSDocLink : linkType === "linkcode" ? factory2.createJSDocLinkCode : factory2.createJSDocLinkPlain;
               return finishNode(create(name, text.join("")), start2, scanner2.getTokenEnd());
             }
+            function parseJSDocLinkName() {
+              if (tokenIsIdentifierOrKeyword(token())) {
+                const pos = getNodePos();
+                let name = parseIdentifierName();
+                while (parseOptional(25 /* DotToken */)) {
+                  name = finishNode(factory2.createQualifiedName(name, token() === 81 /* PrivateIdentifier */ ? createMissingNode(
+                    80 /* Identifier */,
+                    /*reportAtCurrentPosition*/
+                    false
+                  ) : parseIdentifier()), pos);
+                }
+                while (token() === 81 /* PrivateIdentifier */) {
+                  reScanHashToken();
+                  nextTokenJSDoc();
+                  name = finishNode(factory2.createJSDocMemberName(name, parseIdentifier()), pos);
+                }
+                return name;
+              }
+              return void 0;
+            }
             function parseJSDocLinkPrefix() {
               skipWhitespaceOrAsterisk();
               if (token() === 19 /* OpenBraceToken */ && nextTokenJSDoc() === 60 /* AtToken */ && tokenIsIdentifierOrKeyword(nextTokenJSDoc())) {
@@ -35594,6 +35863,8 @@ ${lanes.join("\n")}
                   break;
                 case "template":
                   return parseTemplateTag(start2, tagName, indent3, indentText);
+                case "this":
+                  return parseThisTag(start2, tagName, indent3, indentText);
                 default:
                   return false;
               }
@@ -35608,6 +35879,12 @@ ${lanes.join("\n")}
               if (isBracketed) {
                 skipWhitespace();
               }
+              const modifiers = parseModifiers(
+                /*allowDecorators*/
+                false,
+                /*permitConstAsModifier*/
+                true
+              );
               const name = parseJSDocIdentifierName(Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces);
               let defaultType;
               if (isBracketed) {
@@ -35620,8 +35897,7 @@ ${lanes.join("\n")}
                 return void 0;
               }
               return finishNode(factory2.createTypeParameterDeclaration(
-                /*modifiers*/
-                void 0,
+                modifiers,
                 name,
                 /*constraint*/
                 void 0,
@@ -36596,7 +36872,8 @@ ${lanes.join("\n")}
       ),
       (f) => getRelativePathFromFile(getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), getNormalizedAbsolutePath(f, host.getCurrentDirectory()), getCanonicalFileName)
     );
-    const optionMap = serializeCompilerOptions(configParseResult.options, { configFilePath: getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), useCaseSensitiveFileNames: host.useCaseSensitiveFileNames });
+    const pathOptions = { configFilePath: getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), useCaseSensitiveFileNames: host.useCaseSensitiveFileNames };
+    const optionMap = serializeCompilerOptions(configParseResult.options, pathOptions);
     const watchOptionMap = configParseResult.watchOptions && serializeWatchOptions(configParseResult.watchOptions);
     const config = {
       compilerOptions: {
@@ -36621,6 +36898,18 @@ ${lanes.join("\n")}
       } : {},
       compileOnSave: !!configParseResult.compileOnSave ? true : void 0
     };
+    const providedKeys = new Set(optionMap.keys());
+    const impliedCompilerOptions = {};
+    for (const option in computedOptions) {
+      if (!providedKeys.has(option) && some(computedOptions[option].dependencies, (dep) => providedKeys.has(dep))) {
+        const implied = computedOptions[option].computeValue(configParseResult.options);
+        const defaultValue = computedOptions[option].computeValue({});
+        if (implied !== defaultValue) {
+          impliedCompilerOptions[option] = computedOptions[option].computeValue(configParseResult.options);
+        }
+      }
+    }
+    assign(config.compilerOptions, optionMapToObject(serializeCompilerOptions(impliedCompilerOptions, pathOptions)));
     return config;
   }
   function optionMapToObject(optionMap) {
@@ -37532,34 +37821,39 @@ ${lanes.join("\n")}
       return [Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec];
     }
   }
-  function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExcludeSpecs: exclude }, path, useCaseSensitiveFileNames2) {
-    const rawExcludeRegex = getRegularExpressionForWildcard(exclude, path, "exclude");
+  function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExcludeSpecs: exclude }, basePath, useCaseSensitiveFileNames2) {
+    const rawExcludeRegex = getRegularExpressionForWildcard(exclude, basePath, "exclude");
     const excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames2 ? "" : "i");
     const wildcardDirectories = {};
+    const wildCardKeyToPath = /* @__PURE__ */ new Map();
     if (include !== void 0) {
       const recursiveKeys = [];
       for (const file of include) {
-        const spec = normalizePath(combinePaths(path, file));
+        const spec = normalizePath(combinePaths(basePath, file));
         if (excludeRegex && excludeRegex.test(spec)) {
           continue;
         }
         const match = getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames2);
         if (match) {
-          const { key, flags } = match;
-          const existingFlags = wildcardDirectories[key];
+          const { key, path, flags } = match;
+          const existingPath = wildCardKeyToPath.get(key);
+          const existingFlags = existingPath !== void 0 ? wildcardDirectories[existingPath] : void 0;
           if (existingFlags === void 0 || existingFlags < flags) {
-            wildcardDirectories[key] = flags;
+            wildcardDirectories[existingPath !== void 0 ? existingPath : path] = flags;
+            if (existingPath === void 0)
+              wildCardKeyToPath.set(key, path);
             if (flags === 1 /* Recursive */) {
               recursiveKeys.push(key);
             }
           }
         }
       }
-      for (const key in wildcardDirectories) {
-        if (hasProperty(wildcardDirectories, key)) {
+      for (const path in wildcardDirectories) {
+        if (hasProperty(wildcardDirectories, path)) {
           for (const recursiveKey of recursiveKeys) {
-            if (key !== recursiveKey && containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames2)) {
-              delete wildcardDirectories[key];
+            const key = toCanonicalKey(path, useCaseSensitiveFileNames2);
+            if (key !== recursiveKey && containsPath(recursiveKey, key, basePath, !useCaseSensitiveFileNames2)) {
+              delete wildcardDirectories[path];
             }
           }
         }
@@ -37567,6 +37861,9 @@ ${lanes.join("\n")}
     }
     return wildcardDirectories;
   }
+  function toCanonicalKey(path, useCaseSensitiveFileNames2) {
+    return useCaseSensitiveFileNames2 ? path : toFileNameLowerCase(path);
+  }
   function getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames2) {
     const match = wildcardDirectoryPattern.exec(spec);
     if (match) {
@@ -37574,13 +37871,16 @@ ${lanes.join("\n")}
       const starWildcardIndex = spec.indexOf("*");
       const lastDirectorySeperatorIndex = spec.lastIndexOf(directorySeparator);
       return {
-        key: useCaseSensitiveFileNames2 ? match[0] : toFileNameLowerCase(match[0]),
+        key: toCanonicalKey(match[0], useCaseSensitiveFileNames2),
+        path: match[0],
         flags: questionWildcardIndex !== -1 && questionWildcardIndex < lastDirectorySeperatorIndex || starWildcardIndex !== -1 && starWildcardIndex < lastDirectorySeperatorIndex ? 1 /* Recursive */ : 0 /* None */
       };
     }
     if (isImplicitGlob(spec.substring(spec.lastIndexOf(directorySeparator) + 1))) {
+      const path = removeTrailingDirectorySeparator(spec);
       return {
-        key: removeTrailingDirectorySeparator(useCaseSensitiveFileNames2 ? spec : toFileNameLowerCase(spec)),
+        key: toCanonicalKey(path, useCaseSensitiveFileNames2),
+        path,
         flags: 1 /* Recursive */
       };
     }
@@ -37715,9 +38015,11 @@ ${lanes.join("\n")}
         // Host only
         ["dom", "lib.dom.d.ts"],
         ["dom.iterable", "lib.dom.iterable.d.ts"],
+        ["dom.asynciterable", "lib.dom.asynciterable.d.ts"],
         ["webworker", "lib.webworker.d.ts"],
         ["webworker.importscripts", "lib.webworker.importscripts.d.ts"],
         ["webworker.iterable", "lib.webworker.iterable.d.ts"],
+        ["webworker.asynciterable", "lib.webworker.asynciterable.d.ts"],
         ["scripthost", "lib.scripthost.d.ts"],
         // ES2015 Or ESNext By-feature options
         ["es2015.core", "lib.es2015.core.d.ts"],
@@ -37730,6 +38032,7 @@ ${lanes.join("\n")}
         ["es2015.symbol", "lib.es2015.symbol.d.ts"],
         ["es2015.symbol.wellknown", "lib.es2015.symbol.wellknown.d.ts"],
         ["es2016.array.include", "lib.es2016.array.include.d.ts"],
+        ["es2016.intl", "lib.es2016.intl.d.ts"],
         ["es2017.date", "lib.es2017.date.d.ts"],
         ["es2017.object", "lib.es2017.object.d.ts"],
         ["es2017.sharedmemory", "lib.es2017.sharedmemory.d.ts"],
@@ -37768,16 +38071,17 @@ ${lanes.join("\n")}
         ["es2023.array", "lib.es2023.array.d.ts"],
         ["es2023.collection", "lib.es2023.collection.d.ts"],
         ["esnext.array", "lib.es2023.array.d.ts"],
-        ["esnext.collection", "lib.es2023.collection.d.ts"],
+        ["esnext.collection", "lib.esnext.collection.d.ts"],
         ["esnext.symbol", "lib.es2019.symbol.d.ts"],
         ["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"],
         ["esnext.intl", "lib.esnext.intl.d.ts"],
         ["esnext.disposable", "lib.esnext.disposable.d.ts"],
         ["esnext.bigint", "lib.es2020.bigint.d.ts"],
         ["esnext.string", "lib.es2022.string.d.ts"],
-        ["esnext.promise", "lib.es2021.promise.d.ts"],
+        ["esnext.promise", "lib.esnext.promise.d.ts"],
         ["esnext.weakref", "lib.es2021.weakref.d.ts"],
         ["esnext.decorators", "lib.esnext.decorators.d.ts"],
+        ["esnext.object", "lib.esnext.object.d.ts"],
         ["decorators", "lib.decorators.d.ts"],
         ["decorators.legacy", "lib.decorators.legacy.d.ts"]
       ];
@@ -38061,6 +38365,7 @@ ${lanes.join("\n")}
         affectsModuleResolution: true,
         affectsEmit: true,
         affectsBuildInfo: true,
+        deprecatedKeys: /* @__PURE__ */ new Set(["es3"]),
         paramType: Diagnostics.VERSION,
         showInSimplifiedHelpView: true,
         category: Diagnostics.Language_and_Environment,
@@ -38082,7 +38387,8 @@ ${lanes.join("\n")}
           es2022: 7 /* ES2022 */,
           esnext: 99 /* ESNext */,
           node16: 100 /* Node16 */,
-          nodenext: 199 /* NodeNext */
+          nodenext: 199 /* NodeNext */,
+          preserve: 200 /* Preserve */
         })),
         affectsSourceFile: true,
         affectsModuleResolution: true,
@@ -39230,73 +39536,6 @@ ${lanes.join("\n")}
     }
   });
 
-  // src/compiler/pnp.ts
-  function getPnpApi(path) {
-    if (typeof process.versions.pnp === "undefined") {
-      return;
-    }
-    const { findPnpApi } =   require("module");
-    if (findPnpApi) {
-      return findPnpApi(`${path}/`);
-    }
-  }
-  function getPnpApiPath(path) {
-    var _a;
-    return (_a = getPnpApi(path)) == null ? void 0 : _a.resolveRequest(
-      "pnpapi",
-      /*issuer*/
-      null
-    );
-  }
-  function getPnpTypeRoots(currentDirectory) {
-    const pnpApi = getPnpApi(currentDirectory);
-    if (!pnpApi) {
-      return [];
-    }
-    currentDirectory = resolvePath(currentDirectory);
-    const currentPackage = pnpApi.findPackageLocator(`${currentDirectory}/`);
-    if (!currentPackage) {
-      return [];
-    }
-    const { packageDependencies } = pnpApi.getPackageInformation(currentPackage);
-    const typeRoots = [];
-    for (const [name, referencish] of Array.from(packageDependencies.entries())) {
-      if (name.startsWith(`@types/`) && referencish !== null) {
-        const dependencyLocator = pnpApi.getLocator(name, referencish);
-        const { packageLocation } = pnpApi.getPackageInformation(dependencyLocator);
-        typeRoots.push(getDirectoryPath(packageLocation));
-      }
-    }
-    return typeRoots;
-  }
-  function isImportablePathPnp(fromPath, toPath3) {
-    const pnpApi = getPnpApi(fromPath);
-    const fromLocator = pnpApi.findPackageLocator(fromPath);
-    const toLocator = pnpApi.findPackageLocator(toPath3);
-    if (toLocator === null) {
-      return false;
-    }
-    const fromInfo = pnpApi.getPackageInformation(fromLocator);
-    const toReference = fromInfo.packageDependencies.get(toLocator.name);
-    if (toReference) {
-      return toReference === toLocator.reference;
-    }
-    for (const reference of fromInfo.packageDependencies.values()) {
-      if (Array.isArray(reference)) {
-        if (reference[0] === toLocator.name && reference[1] === toLocator.reference) {
-          return true;
-        }
-      }
-    }
-    return false;
-  }
-  var init_pnp = __esm({
-    "src/compiler/pnp.ts"() {
-      "use strict";
-      init_path();
-    }
-  });
-
   // src/compiler/moduleNameResolver.ts
   function trace(host, message, ...args) {
     host.trace(formatMessage(message, ...args));
@@ -39362,7 +39601,7 @@ ${lanes.join("\n")}
     Debug.assert(extensionIsTS(resolved.extension));
     return { fileName: resolved.path, packageId: resolved.packageId };
   }
-  function createResolvedModuleWithFailedLookupLocationsHandlingSymlink(moduleName, resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, state, cache, legacyResult) {
+  function createResolvedModuleWithFailedLookupLocationsHandlingSymlink(moduleName, resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, state, cache, alternateResult) {
     if (!state.resultFromCache && !state.compilerOptions.preserveSymlinks && resolved && isExternalLibraryImport && !resolved.originalPath && !isExternalModuleNameRelative(moduleName)) {
       const { resolvedFileName, originalPath } = getOriginalAndResolvedFileName(resolved.path, state.host, state.traceEnabled);
       if (originalPath)
@@ -39376,10 +39615,10 @@ ${lanes.join("\n")}
       diagnostics,
       state.resultFromCache,
       cache,
-      legacyResult
+      alternateResult
     );
   }
-  function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, cache, legacyResult) {
+  function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, cache, alternateResult) {
     if (resultFromCache) {
       if (!(cache == null ? void 0 : cache.isReadonly)) {
         resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations);
@@ -39407,7 +39646,7 @@ ${lanes.join("\n")}
       failedLookupLocations: initializeResolutionField(failedLookupLocations),
       affectingLocations: initializeResolutionField(affectingLocations),
       resolutionDiagnostics: initializeResolutionField(diagnostics),
-      node10Result: legacyResult
+      alternateResult
     };
   }
   function initializeResolutionField(value) {
@@ -39535,7 +39774,7 @@ ${lanes.join("\n")}
       return getDefaultTypeRoots(currentDirectory);
     }
   }
-  function getNodeModulesTypeRoots(currentDirectory) {
+  function getDefaultTypeRoots(currentDirectory) {
     let typeRoots;
     forEachAncestorDirectory(normalizePath(currentDirectory), (directory) => {
       const atTypes = combinePaths(directory, nodeModulesAtTypes);
@@ -39547,15 +39786,6 @@ ${lanes.join("\n")}
     const useCaseSensitiveFileNames2 = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames;
     return comparePaths(path1, path2, !useCaseSensitiveFileNames2) === 0 /* EqualTo */;
   }
-  function getDefaultTypeRoots(currentDirectory) {
-    const nmTypes = getNodeModulesTypeRoots(currentDirectory);
-    const pnpTypes = getPnpTypeRoots(currentDirectory);
-    if (nmTypes == null ? void 0 : nmTypes.length) {
-      return [...nmTypes, ...pnpTypes];
-    } else if (pnpTypes.length) {
-      return pnpTypes;
-    }
-  }
   function getOriginalAndResolvedFileName(fileName, host, traceEnabled) {
     const resolvedFileName = realPath(fileName, host, traceEnabled);
     const pathsAreEqual = arePathsEqual(fileName, resolvedFileName, host);
@@ -39633,7 +39863,8 @@ ${lanes.join("\n")}
       requestContainingDirectory: containingDirectory,
       reportDiagnostic: (diag2) => void diagnostics.push(diag2),
       isConfigLookup: false,
-      candidateIsFromPackageJsonField: false
+      candidateIsFromPackageJsonField: false,
+      resolvedPackageDirectory: false
     };
     let resolved = primaryLookup();
     let primary = true;
@@ -39807,21 +40038,6 @@ ${lanes.join("\n")}
   }
   function resolvePackageNameToPackageJson(packageName, containingDirectory, options, host, cache) {
     const moduleResolutionState = getTemporaryModuleResolutionState(cache == null ? void 0 : cache.getPackageJsonInfoCache(), host, options);
-    const pnpapi = getPnpApi(containingDirectory);
-    if (pnpapi) {
-      try {
-        const resolution = pnpapi.resolveToUnqualified(packageName, `${containingDirectory}/`, { considerBuiltins: false });
-        const candidate = normalizeSlashes(resolution).replace(/\/$/, "");
-        return getPackageJsonInfo(
-          candidate,
-          /*onlyRecordFailures*/
-          false,
-          moduleResolutionState
-        );
-      } catch {
-        return;
-      }
-    }
     return forEachAncestorDirectory(containingDirectory, (ancestorDirectory) => {
       if (getBaseFileName(ancestorDirectory) !== "node_modules") {
         const nodeModulesFolder = combinePaths(ancestorDirectory, "node_modules");
@@ -39862,6 +40078,12 @@ ${lanes.join("\n")}
     }
     return result;
   }
+  function isPackageJsonInfo(entry) {
+    return !!(entry == null ? void 0 : entry.contents);
+  }
+  function isMissingPackageJsonInfo(entry) {
+    return !!entry && !entry.contents;
+  }
   function compilerOptionValueToString(value) {
     var _a;
     if (value === null || typeof value !== "object") {
@@ -39966,7 +40188,7 @@ ${lanes.join("\n")}
   }
   function createPackageJsonInfoCache(currentDirectory, getCanonicalFileName) {
     let cache;
-    return { getPackageJsonInfo: getPackageJsonInfo2, setPackageJsonInfo, clear: clear2, entries, getInternalMap };
+    return { getPackageJsonInfo: getPackageJsonInfo2, setPackageJsonInfo, clear: clear2, getInternalMap };
     function getPackageJsonInfo2(packageJsonPath) {
       return cache == null ? void 0 : cache.get(toPath(packageJsonPath, currentDirectory, getCanonicalFileName));
     }
@@ -39976,10 +40198,6 @@ ${lanes.join("\n")}
     function clear2() {
       cache = void 0;
     }
-    function entries() {
-      const iter = cache == null ? void 0 : cache.entries();
-      return iter ? arrayFrom(iter) : [];
-    }
     function getInternalMap() {
       return cache;
     }
@@ -40229,20 +40447,7 @@ ${lanes.join("\n")}
     } else {
       let moduleResolution = compilerOptions.moduleResolution;
       if (moduleResolution === void 0) {
-        switch (getEmitModuleKind(compilerOptions)) {
-          case 1 /* CommonJS */:
-            moduleResolution = 2 /* Node10 */;
-            break;
-          case 100 /* Node16 */:
-            moduleResolution = 3 /* Node16 */;
-            break;
-          case 199 /* NodeNext */:
-            moduleResolution = 99 /* NodeNext */;
-            break;
-          default:
-            moduleResolution = 1 /* Classic */;
-            break;
-        }
+        moduleResolution = getEmitModuleResolutionKind(compilerOptions);
         if (traceEnabled) {
           trace(host, Diagnostics.Module_resolution_kind_is_not_specified_using_0, ModuleResolutionKind[moduleResolution]);
         }
@@ -40524,7 +40729,7 @@ ${lanes.join("\n")}
     );
   }
   function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference, conditions) {
-    var _a, _b, _c, _d;
+    var _a, _b, _c, _d, _e;
     const traceEnabled = isTraceEnabled(compilerOptions, host);
     const failedLookupLocations = [];
     const affectingLocations = [];
@@ -40546,7 +40751,8 @@ ${lanes.join("\n")}
       requestContainingDirectory: containingDirectory,
       reportDiagnostic: (diag2) => void diagnostics.push(diag2),
       isConfigLookup,
-      candidateIsFromPackageJsonField: false
+      candidateIsFromPackageJsonField: false,
+      resolvedPackageDirectory: false
     };
     if (traceEnabled && moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
       trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", state.conditions.map((c) => `'${c}'`).join(", "));
@@ -40559,29 +40765,46 @@ ${lanes.join("\n")}
     } else {
       result = tryResolve(extensions, state);
     }
-    let legacyResult;
-    if (((_a = result == null ? void 0 : result.value) == null ? void 0 : _a.isExternalLibraryImport) && !isConfigLookup && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && features & 8 /* Exports */ && !isExternalModuleNameRelative(moduleName) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension) && (conditions == null ? void 0 : conditions.includes("import"))) {
-      traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
-      const diagnosticState = {
-        ...state,
-        features: state.features & ~8 /* Exports */,
-        reportDiagnostic: noop
-      };
-      const diagnosticResult = tryResolve(extensions & (1 /* TypeScript */ | 4 /* Declaration */), diagnosticState);
-      if ((_b = diagnosticResult == null ? void 0 : diagnosticResult.value) == null ? void 0 : _b.isExternalLibraryImport) {
-        legacyResult = diagnosticResult.value.resolved.path;
+    let alternateResult;
+    if (state.resolvedPackageDirectory && !isConfigLookup && !isExternalModuleNameRelative(moduleName)) {
+      const wantedTypesButGotJs = (result == null ? void 0 : result.value) && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension);
+      if (((_a = result == null ? void 0 : result.value) == null ? void 0 : _a.isExternalLibraryImport) && wantedTypesButGotJs && features & 8 /* Exports */ && (conditions == null ? void 0 : conditions.includes("import"))) {
+        traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
+        const diagnosticState = {
+          ...state,
+          features: state.features & ~8 /* Exports */,
+          reportDiagnostic: noop
+        };
+        const diagnosticResult = tryResolve(extensions & (1 /* TypeScript */ | 4 /* Declaration */), diagnosticState);
+        if ((_b = diagnosticResult == null ? void 0 : diagnosticResult.value) == null ? void 0 : _b.isExternalLibraryImport) {
+          alternateResult = diagnosticResult.value.resolved.path;
+        }
+      } else if ((!(result == null ? void 0 : result.value) || wantedTypesButGotJs) && moduleResolution === 2 /* Node10 */) {
+        traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_need_configuration_update);
+        const diagnosticsCompilerOptions = { ...state.compilerOptions, moduleResolution: 100 /* Bundler */ };
+        const diagnosticState = {
+          ...state,
+          compilerOptions: diagnosticsCompilerOptions,
+          features: 30 /* BundlerDefault */,
+          conditions: getConditions(diagnosticsCompilerOptions),
+          reportDiagnostic: noop
+        };
+        const diagnosticResult = tryResolve(extensions & (1 /* TypeScript */ | 4 /* Declaration */), diagnosticState);
+        if ((_c = diagnosticResult == null ? void 0 : diagnosticResult.value) == null ? void 0 : _c.isExternalLibraryImport) {
+          alternateResult = diagnosticResult.value.resolved.path;
+        }
       }
     }
     return createResolvedModuleWithFailedLookupLocationsHandlingSymlink(
       moduleName,
-      (_c = result == null ? void 0 : result.value) == null ? void 0 : _c.resolved,
-      (_d = result == null ? void 0 : result.value) == null ? void 0 : _d.isExternalLibraryImport,
+      (_d = result == null ? void 0 : result.value) == null ? void 0 : _d.resolved,
+      (_e = result == null ? void 0 : result.value) == null ? void 0 : _e.isExternalLibraryImport,
       failedLookupLocations,
       affectingLocations,
       diagnostics,
       state,
       cache,
-      legacyResult
+      alternateResult
     );
     function tryResolve(extensions2, state2) {
       const loader = (extensions3, candidate, onlyRecordFailures, state3) => nodeLoadModuleByRelativeName(
@@ -40888,7 +41111,7 @@ ${lanes.join("\n")}
             /*excludes*/
             void 0,
             [
-              isDeclarationFileName(target) ? target.replace("*", "**/*") : changeAnyExtension(target.replace("*", "**/*"), getDeclarationEmitExtensionForPath(target))
+              changeFullExtension(replaceFirstStar(target, "**/*"), ".*")
             ]
           ).forEach((entry) => {
             entrypoints = appendIfUnique(entrypoints, {
@@ -40946,7 +41169,8 @@ ${lanes.join("\n")}
       requestContainingDirectory: void 0,
       reportDiagnostic: noop,
       isConfigLookup: false,
-      candidateIsFromPackageJsonField: false
+      candidateIsFromPackageJsonField: false,
+      resolvedPackageDirectory: false
     };
   }
   function getPackageScopeForPath(fileName, state) {
@@ -40982,13 +41206,13 @@ ${lanes.join("\n")}
     }
     const existing = (_b = state.packageJsonInfoCache) == null ? void 0 : _b.getPackageJsonInfo(packageJsonPath);
     if (existing !== void 0) {
-      if (typeof existing !== "boolean") {
+      if (isPackageJsonInfo(existing)) {
         if (traceEnabled)
           trace(host, Diagnostics.File_0_exists_according_to_earlier_cached_lookups, packageJsonPath);
         (_c = state.affectingLocations) == null ? void 0 : _c.push(packageJsonPath);
         return existing.packageDirectory === packageDirectory ? existing : { packageDirectory, contents: existing.contents };
       } else {
-        if (existing && traceEnabled)
+        if (existing.directoryExists && traceEnabled)
           trace(host, Diagnostics.File_0_does_not_exist_according_to_earlier_cached_lookups, packageJsonPath);
         (_d = state.failedLookupLocations) == null ? void 0 : _d.push(packageJsonPath);
         return void 0;
@@ -41010,7 +41234,7 @@ ${lanes.join("\n")}
         trace(host, Diagnostics.File_0_does_not_exist, packageJsonPath);
       }
       if (state.packageJsonInfoCache && !state.packageJsonInfoCache.isReadonly)
-        state.packageJsonInfoCache.setPackageJsonInfo(packageJsonPath, directoryExists);
+        state.packageJsonInfoCache.setPackageJsonInfo(packageJsonPath, { packageDirectory, directoryExists });
       (_f = state.failedLookupLocations) == null ? void 0 : _f.push(packageJsonPath);
     }
   }
@@ -41024,15 +41248,9 @@ ${lanes.join("\n")}
       }
     }
     const loader = (extensions2, candidate2, onlyRecordFailures2, state2) => {
-      const fromFile = tryFile(candidate2, onlyRecordFailures2, state2);
+      const fromFile = loadFileNameFromPackageJsonField(extensions2, candidate2, onlyRecordFailures2, state2);
       if (fromFile) {
-        const resolved = resolvedIfExtensionMatches(extensions2, fromFile);
-        if (resolved) {
-          return noPackageId(resolved);
-        }
-        if (state2.traceEnabled) {
-          trace(state2.host, Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromFile);
-        }
+        return noPackageId(fromFile);
       }
       const expandedExtensions = extensions2 === 4 /* Declaration */ ? 1 /* TypeScript */ | 4 /* Declaration */ : extensions2;
       const features = state2.features;
@@ -41088,10 +41306,6 @@ ${lanes.join("\n")}
       return loadModuleFromFile(extensions, indexPath, onlyRecordFailuresForIndex, state);
     }
   }
-  function resolvedIfExtensionMatches(extensions, path, resolvedUsingTsExtension) {
-    const ext = tryGetExtensionFromPath2(path);
-    return ext !== void 0 && extensionIsOk(extensions, ext) ? { path, ext, resolvedUsingTsExtension } : void 0;
-  }
   function extensionIsOk(extensions, extension) {
     return extensions & 2 /* JavaScript */ && (extension === ".js" /* Js */ || extension === ".jsx" /* Jsx */ || extension === ".mjs" /* Mjs */ || extension === ".cjs" /* Cjs */) || extensions & 1 /* TypeScript */ && (extension === ".ts" /* Ts */ || extension === ".tsx" /* Tsx */ || extension === ".mts" /* Mts */ || extension === ".cts" /* Cts */) || extensions & 4 /* Declaration */ && (extension === ".d.ts" /* Dts */ || extension === ".d.mts" /* Dmts */ || extension === ".d.cts" /* Dcts */) || extensions & 8 /* Json */ && extension === ".json" /* Json */ || false;
   }
@@ -41598,15 +41812,7 @@ ${lanes.join("\n")}
       return lookup(secondaryExtensions);
     }
     function lookup(extensions2) {
-      const issuer = normalizeSlashes(directory);
-      if (getPnpApi(issuer)) {
-        const resolutionFromCache = tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, issuer, redirectedReference, state);
-        if (resolutionFromCache) {
-          return resolutionFromCache;
-        }
-        return toSearchResult(loadModuleFromImmediateNodeModulesDirectoryPnP(extensions2, moduleName, issuer, state, typesScopeOnly, cache, redirectedReference));
-      }
-      return forEachAncestorDirectory(issuer, (ancestorDirectory) => {
+      return forEachAncestorDirectory(normalizeSlashes(directory), (ancestorDirectory) => {
         if (getBaseFileName(ancestorDirectory) !== "node_modules") {
           const resolutionFromCache = tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, ancestorDirectory, redirectedReference, state);
           if (resolutionFromCache) {
@@ -41641,40 +41847,11 @@ ${lanes.join("\n")}
       return loadModuleFromSpecificNodeModulesDirectory(4 /* Declaration */, mangleScopedPackageNameWithTrace(moduleName, state), nodeModulesAtTypes2, nodeModulesAtTypesExists, state, cache, redirectedReference);
     }
   }
-  function loadModuleFromImmediateNodeModulesDirectoryPnP(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
-    const issuer = normalizeSlashes(directory);
-    if (!typesScopeOnly) {
-      const packageResult = tryLoadModuleUsingPnpResolution(extensions, moduleName, issuer, state, cache, redirectedReference);
-      if (packageResult) {
-        return packageResult;
-      }
-    }
-    if (extensions & 4 /* Declaration */) {
-      return tryLoadModuleUsingPnpResolution(4 /* Declaration */, `@types/${mangleScopedPackageNameWithTrace(moduleName, state)}`, issuer, state, cache, redirectedReference);
-    }
-  }
   function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesDirectory, nodeModulesDirectoryExists, state, cache, redirectedReference) {
+    var _a, _b;
     const candidate = normalizePath(combinePaths(nodeModulesDirectory, moduleName));
     const { packageName, rest } = parsePackageName(moduleName);
     const packageDirectory = combinePaths(nodeModulesDirectory, packageName);
-    return loadModuleFromSpecificNodeModulesDirectoryImpl(extensions, nodeModulesDirectoryExists, state, cache, redirectedReference, candidate, rest, packageDirectory);
-  }
-  function loadModuleFromPnpResolution(extensions, packageDirectory, rest, state, cache, redirectedReference) {
-    const candidate = normalizePath(combinePaths(packageDirectory, rest));
-    return loadModuleFromSpecificNodeModulesDirectoryImpl(
-      extensions,
-      /*nodeModulesDirectoryExists*/
-      true,
-      state,
-      cache,
-      redirectedReference,
-      candidate,
-      rest,
-      packageDirectory
-    );
-  }
-  function loadModuleFromSpecificNodeModulesDirectoryImpl(extensions, nodeModulesDirectoryExists, state, cache, redirectedReference, candidate, rest, packageDirectory) {
-    var _a, _b;
     let rootPackageInfo;
     let packageInfo = getPackageJsonInfo(candidate, !nodeModulesDirectoryExists, state);
     if (rest !== "" && packageInfo && (!(state.features & 8 /* Exports */) || !hasProperty(((_a = rootPackageInfo = getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state)) == null ? void 0 : _a.contents.packageJsonContent) ?? emptyArray, "exports"))) {
@@ -41709,6 +41886,9 @@ ${lanes.join("\n")}
     if (rest !== "") {
       packageInfo = rootPackageInfo ?? getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);
     }
+    if (packageInfo) {
+      state.resolvedPackageDirectory = true;
+    }
     if (packageInfo && packageInfo.contents.packageJsonContent.exports && state.features & 8 /* Exports */) {
       return (_b = loadModuleFromExports(packageInfo, extensions, combinePaths(".", rest), state, cache, redirectedReference)) == null ? void 0 : _b.value;
     }
@@ -41745,7 +41925,7 @@ ${lanes.join("\n")}
         trace(state.host, Diagnostics.Module_name_0_matched_pattern_1, moduleName, matchedPatternText);
       }
       const resolved = forEach(paths[matchedPatternText], (subst) => {
-        const path = matchedStar ? subst.replace("*", matchedStar) : subst;
+        const path = matchedStar ? replaceFirstStar(subst, matchedStar) : subst;
         const candidate = normalizePath(combinePaths(baseDirectory, path));
         if (state.traceEnabled) {
           trace(state.host, Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path);
@@ -41827,7 +42007,8 @@ ${lanes.join("\n")}
       requestContainingDirectory: containingDirectory,
       reportDiagnostic: (diag2) => void diagnostics.push(diag2),
       isConfigLookup: false,
-      candidateIsFromPackageJsonField: false
+      candidateIsFromPackageJsonField: false,
+      resolvedPackageDirectory: false
     };
     const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
     return createResolvedModuleWithFailedLookupLocationsHandlingSymlink(
@@ -41936,7 +42117,8 @@ ${lanes.join("\n")}
       requestContainingDirectory: void 0,
       reportDiagnostic: (diag2) => void diagnostics.push(diag2),
       isConfigLookup: false,
-      candidateIsFromPackageJsonField: false
+      candidateIsFromPackageJsonField: false,
+      resolvedPackageDirectory: false
     };
     const resolved = loadModuleFromImmediateNodeModulesDirectory(
       4 /* Declaration */,
@@ -41973,24 +42155,11 @@ ${lanes.join("\n")}
   function useCaseSensitiveFileNames(state) {
     return !state.host.useCaseSensitiveFileNames ? true : typeof state.host.useCaseSensitiveFileNames === "boolean" ? state.host.useCaseSensitiveFileNames : state.host.useCaseSensitiveFileNames();
   }
-  function loadPnpPackageResolution(packageName, containingDirectory) {
-    try {
-      const resolution = getPnpApi(containingDirectory).resolveToUnqualified(packageName, `${containingDirectory}/`, { considerBuiltins: false });
-      return normalizeSlashes(resolution).replace(/\/$/, "");
-    } catch {
-    }
-  }
-  function tryLoadModuleUsingPnpResolution(extensions, moduleName, containingDirectory, state, cache, redirectedReference) {
-    const { packageName, rest } = parsePackageName(moduleName);
-    const packageResolution = loadPnpPackageResolution(packageName, containingDirectory);
-    return packageResolution ? loadModuleFromPnpResolution(extensions, packageResolution, rest, state, cache, redirectedReference) : void 0;
-  }
   var typeScriptVersion, nodeModulesAtTypes, NodeResolutionFeatures, nodeModulesPathPart, mangledScopedPackageSeparator;
   var init_moduleNameResolver = __esm({
     "src/compiler/moduleNameResolver.ts"() {
       "use strict";
       init_ts2();
-      init_pnp();
       nodeModulesAtTypes = combinePaths("node_modules", "@types");
       NodeResolutionFeatures = /* @__PURE__ */ ((NodeResolutionFeatures2) => {
         NodeResolutionFeatures2[NodeResolutionFeatures2["None"] = 0] = "None";
@@ -42682,6 +42851,9 @@ ${lanes.join("\n")}
         case 213 /* CallExpression */:
           return hasNarrowableArgument(expr);
         case 217 /* ParenthesizedExpression */:
+          if (isJSDocTypeAssertion(expr)) {
+            return false;
+          }
         case 235 /* NonNullExpression */:
           return isNarrowingExpression(expr.expression);
         case 226 /* BinaryExpression */:
@@ -43051,6 +43223,9 @@ ${lanes.join("\n")}
       for (let i = 0; i < clauses.length; i++) {
         const clauseStart = i;
         while (!clauses[i].statements.length && i + 1 < clauses.length) {
+          if (fallthroughFlow === unreachableFlow) {
+            currentFlow = preSwitchCaseFlow;
+          }
           bind(clauses[i]);
           i++;
         }
@@ -44128,7 +44303,7 @@ ${lanes.join("\n")}
       } else if (isJsonSourceFile(file)) {
         bindSourceFileAsExternalModule();
         const originalSymbol = file.symbol;
-        declareSymbol(file.symbol.exports, file.symbol, file, 4 /* Property */, 67108863 /* All */);
+        declareSymbol(file.symbol.exports, file.symbol, file, 4 /* Property */, -1 /* All */);
         file.symbol = originalSymbol;
       }
     }
@@ -44140,7 +44315,7 @@ ${lanes.join("\n")}
         bindAnonymousDeclaration(node, 111551 /* Value */, getDeclarationName(node));
       } else {
         const flags = exportAssignmentIsAlias(node) ? 2097152 /* Alias */ : 4 /* Property */;
-        const symbol = declareSymbol(container.symbol.exports, container.symbol, node, flags, 67108863 /* All */);
+        const symbol = declareSymbol(container.symbol.exports, container.symbol, node, flags, -1 /* All */);
         if (node.isExportEquals) {
           setValueDeclaration(symbol, node);
         }
@@ -44406,7 +44581,7 @@ ${lanes.join("\n")}
     }
     function bindSpecialPropertyAssignment(node) {
       var _a;
-      const parentSymbol = lookupSymbolForPropertyAccess(node.left.expression, container) || lookupSymbolForPropertyAccess(node.left.expression, blockScopeContainer);
+      const parentSymbol = lookupSymbolForPropertyAccess(node.left.expression, blockScopeContainer) || lookupSymbolForPropertyAccess(node.left.expression, container);
       if (!isInJSFile(node) && !isFunctionSymbol(parentSymbol)) {
         return;
       }
@@ -44504,7 +44679,7 @@ ${lanes.join("\n")}
       return isBinaryExpression(propertyAccess.parent) ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 312 /* SourceFile */ : propertyAccess.parent.parent.kind === 312 /* SourceFile */;
     }
     function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) {
-      let namespaceSymbol = lookupSymbolForPropertyAccess(name, container) || lookupSymbolForPropertyAccess(name, blockScopeContainer);
+      let namespaceSymbol = lookupSymbolForPropertyAccess(name, blockScopeContainer) || lookupSymbolForPropertyAccess(name, container);
       const isToplevel = isTopLevelNamespaceAssignment(propertyAccess);
       namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, propertyAccess.expression, isToplevel, isPrototypeProperty, containerIsClass);
       bindPotentiallyNewExpandoMemberToNamespace(propertyAccess, namespaceSymbol, isPrototypeProperty);
@@ -44593,7 +44768,7 @@ ${lanes.join("\n")}
       }
       if (!isBindingPattern(node.name)) {
         const possibleVariableDecl = node.kind === 260 /* VariableDeclaration */ ? node : node.parent.parent;
-        if (isInJSFile(node) && shouldResolveJsRequire(options) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 32 /* Export */)) {
+        if (isInJSFile(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 32 /* Export */)) {
           declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);
         } else if (isBlockOrCatchScoped(node)) {
           bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 111551 /* BlockScopedVariableExcludes */);
@@ -45032,11 +45207,12 @@ ${lanes.join("\n")}
   });
 
   // src/compiler/moduleSpecifiers.ts
-  function getPreferences({ importModuleSpecifierPreference, importModuleSpecifierEnding }, compilerOptions, importingSourceFile, oldImportSpecifier) {
-    const preferredEnding = getPreferredEnding();
+  function getModuleSpecifierPreferences({ importModuleSpecifierPreference, importModuleSpecifierEnding }, compilerOptions, importingSourceFile, oldImportSpecifier) {
+    const filePreferredEnding = getPreferredEnding();
     return {
       relativePreference: oldImportSpecifier !== void 0 ? isExternalModuleNameRelative(oldImportSpecifier) ? 0 /* Relative */ : 1 /* NonRelative */ : importModuleSpecifierPreference === "relative" ? 0 /* Relative */ : importModuleSpecifierPreference === "non-relative" ? 1 /* NonRelative */ : importModuleSpecifierPreference === "project-relative" ? 3 /* ExternalNonRelative */ : 2 /* Shortest */,
       getAllowedEndingsInPreferredOrder: (syntaxImpliedNodeFormat) => {
+        const preferredEnding = syntaxImpliedNodeFormat !== importingSourceFile.impliedNodeFormat ? getPreferredEnding(syntaxImpliedNodeFormat) : filePreferredEnding;
         if ((syntaxImpliedNodeFormat ?? importingSourceFile.impliedNodeFormat) === 99 /* ESNext */) {
           if (shouldAllowImportingTsExtension(compilerOptions, importingSourceFile.fileName)) {
             return [3 /* TsExtension */, 2 /* JsExtension */];
@@ -45061,7 +45237,7 @@ ${lanes.join("\n")}
         }
       }
     };
-    function getPreferredEnding() {
+    function getPreferredEnding(resolutionMode) {
       if (oldImportSpecifier !== void 0) {
         if (hasJSFileExtension(oldImportSpecifier))
           return 2 /* JsExtension */;
@@ -45070,24 +45246,24 @@ ${lanes.join("\n")}
       }
       return getModuleSpecifierEndingPreference(
         importModuleSpecifierEnding,
-        importingSourceFile.impliedNodeFormat,
+        resolutionMode ?? importingSourceFile.impliedNodeFormat,
         compilerOptions,
         importingSourceFile
       );
     }
   }
   function updateModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, oldImportSpecifier, options = {}) {
-    const res = getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, getPreferences({}, compilerOptions, importingSourceFile, oldImportSpecifier), {}, options);
+    const res = getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, getModuleSpecifierPreferences({}, compilerOptions, importingSourceFile, oldImportSpecifier), {}, options);
     if (res === oldImportSpecifier)
       return void 0;
     return res;
   }
   function getModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, options = {}) {
-    return getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, getPreferences({}, compilerOptions, importingSourceFile), {}, options);
+    return getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, getModuleSpecifierPreferences({}, compilerOptions, importingSourceFile), {}, options);
   }
   function getNodeModulesPackageName(compilerOptions, importingSourceFile, nodeModulesFileName, host, preferences, options = {}) {
-    const info = getInfo(importingSourceFile.path, host);
-    const modulePaths = getAllModulePaths(importingSourceFile.path, nodeModulesFileName, host, preferences, options);
+    const info = getInfo(importingSourceFile.fileName, host);
+    const modulePaths = getAllModulePaths(info, nodeModulesFileName, host, preferences, options);
     return firstDefined(modulePaths, (modulePath) => tryGetModuleNameAsNodeModule(
       modulePath,
       info,
@@ -45102,7 +45278,7 @@ ${lanes.join("\n")}
   }
   function getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, preferences, userPreferences, options = {}) {
     const info = getInfo(importingSourceFileName, host);
-    const modulePaths = getAllModulePaths(importingSourceFileName, toFileName2, host, userPreferences, options);
+    const modulePaths = getAllModulePaths(info, toFileName2, host, userPreferences, options);
     return firstDefined(modulePaths, (modulePath) => tryGetModuleNameAsNodeModule(
       modulePath,
       info,
@@ -45164,7 +45340,7 @@ ${lanes.join("\n")}
     if (!moduleSourceFile)
       return { moduleSpecifiers: emptyArray, computedWithoutCache };
     computedWithoutCache = true;
-    modulePaths || (modulePaths = getAllModulePathsWorker(importingSourceFile.path, moduleSourceFile.originalFileName, host));
+    modulePaths || (modulePaths = getAllModulePathsWorker(getInfo(importingSourceFile.fileName, host), moduleSourceFile.originalFileName, host));
     const result = computeModuleSpecifiers(
       modulePaths,
       compilerOptions,
@@ -45178,14 +45354,14 @@ ${lanes.join("\n")}
     return { moduleSpecifiers: result, computedWithoutCache };
   }
   function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences, options = {}, forAutoImport) {
-    const info = getInfo(importingSourceFile.path, host);
-    const preferences = getPreferences(userPreferences, compilerOptions, importingSourceFile);
+    const info = getInfo(importingSourceFile.fileName, host);
+    const preferences = getModuleSpecifierPreferences(userPreferences, compilerOptions, importingSourceFile);
     const existingSpecifier = forEach(modulePaths, (modulePath) => forEach(
       host.getFileIncludeReasons().get(toPath(modulePath.path, host.getCurrentDirectory(), info.getCanonicalFileName)),
       (reason) => {
         if (reason.kind !== 3 /* Import */ || reason.file !== importingSourceFile.path)
           return void 0;
-        if (importingSourceFile.impliedNodeFormat && importingSourceFile.impliedNodeFormat !== getModeForResolutionAtIndex(importingSourceFile, reason.index))
+        if (importingSourceFile.impliedNodeFormat && importingSourceFile.impliedNodeFormat !== getModeForResolutionAtIndex(importingSourceFile, reason.index, compilerOptions))
           return void 0;
         const specifier = getModuleNameStringLiteralAt(importingSourceFile, reason.index).text;
         return preferences.relativePreference !== 1 /* NonRelative */ || !pathIsRelative(specifier) ? specifier : void 0;
@@ -45233,7 +45409,11 @@ ${lanes.join("\n")}
         if (modulePath.isRedirect) {
           redirectPathsSpecifiers = append(redirectPathsSpecifiers, local);
         } else if (pathIsBareSpecifier(local)) {
-          pathsSpecifiers = append(pathsSpecifiers, local);
+          if (pathContainsNodeModules(local)) {
+            relativeSpecifiers = append(relativeSpecifiers, local);
+          } else {
+            pathsSpecifiers = append(pathsSpecifiers, local);
+          }
         } else if (forAutoImport || !importedFileIsInNodeModules || modulePath.isInNodeModules) {
           relativeSpecifiers = append(relativeSpecifiers, local);
         }
@@ -45242,19 +45422,25 @@ ${lanes.join("\n")}
     return (pathsSpecifiers == null ? void 0 : pathsSpecifiers.length) ? pathsSpecifiers : (redirectPathsSpecifiers == null ? void 0 : redirectPathsSpecifiers.length) ? redirectPathsSpecifiers : (nodeModulesSpecifiers == null ? void 0 : nodeModulesSpecifiers.length) ? nodeModulesSpecifiers : Debug.checkDefined(relativeSpecifiers);
   }
   function getInfo(importingSourceFileName, host) {
+    importingSourceFileName = getNormalizedAbsolutePath(importingSourceFileName, host.getCurrentDirectory());
     const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames ? host.useCaseSensitiveFileNames() : true);
     const sourceDirectory = getDirectoryPath(importingSourceFileName);
-    return { getCanonicalFileName, importingSourceFileName, sourceDirectory };
+    return {
+      getCanonicalFileName,
+      importingSourceFileName,
+      sourceDirectory,
+      canonicalSourceDirectory: getCanonicalFileName(sourceDirectory)
+    };
   }
   function getLocalModuleSpecifier(moduleFileName, info, compilerOptions, host, importMode, { getAllowedEndingsInPreferredOrder: getAllowedEndingsInPrefererredOrder, relativePreference }, pathsOnly) {
     const { baseUrl, paths, rootDirs } = compilerOptions;
     if (pathsOnly && !paths) {
       return void 0;
     }
-    const { sourceDirectory, getCanonicalFileName } = info;
+    const { sourceDirectory, canonicalSourceDirectory, getCanonicalFileName } = info;
     const allowedEndings = getAllowedEndingsInPrefererredOrder(importMode);
     const relativePath = rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, allowedEndings, compilerOptions) || processEnding(ensurePathIsNonModuleName(getRelativePathFromDirectory(sourceDirectory, moduleFileName, getCanonicalFileName)), allowedEndings, compilerOptions);
-    if (!baseUrl && !paths || relativePreference === 0 /* Relative */) {
+    if (!baseUrl && !paths && !getResolvePackageJsonImports(compilerOptions) || relativePreference === 0 /* Relative */) {
       return pathsOnly ? void 0 : relativePath;
     }
     const baseDirectory = getNormalizedAbsolutePath(getPathsBasePath(compilerOptions, host) || baseUrl, host.getCurrentDirectory());
@@ -45262,11 +45448,12 @@ ${lanes.join("\n")}
     if (!relativeToBaseUrl) {
       return pathsOnly ? void 0 : relativePath;
     }
-    const fromPaths = paths && tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, host, compilerOptions);
+    const fromPackageJsonImports = pathsOnly ? void 0 : tryGetModuleNameFromPackageJsonImports(moduleFileName, sourceDirectory, compilerOptions, host, importMode);
+    const fromPaths = pathsOnly || fromPackageJsonImports === void 0 ? paths && tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, host, compilerOptions) : void 0;
     if (pathsOnly) {
       return fromPaths;
     }
-    const maybeNonRelative = fromPaths === void 0 && baseUrl !== void 0 ? processEnding(relativeToBaseUrl, allowedEndings, compilerOptions) : fromPaths;
+    const maybeNonRelative = fromPackageJsonImports ?? (fromPaths === void 0 && baseUrl !== void 0 ? processEnding(relativeToBaseUrl, allowedEndings, compilerOptions) : fromPaths);
     if (!maybeNonRelative) {
       return relativePath;
     }
@@ -45276,20 +45463,28 @@ ${lanes.join("\n")}
     if (relativePreference === 3 /* ExternalNonRelative */ && !pathIsRelative(maybeNonRelative)) {
       const projectDirectory = compilerOptions.configFilePath ? toPath(getDirectoryPath(compilerOptions.configFilePath), host.getCurrentDirectory(), info.getCanonicalFileName) : info.getCanonicalFileName(host.getCurrentDirectory());
       const modulePath = toPath(moduleFileName, projectDirectory, getCanonicalFileName);
-      const sourceIsInternal = startsWith(sourceDirectory, projectDirectory);
+      const sourceIsInternal = startsWith(canonicalSourceDirectory, projectDirectory);
       const targetIsInternal = startsWith(modulePath, projectDirectory);
       if (sourceIsInternal && !targetIsInternal || !sourceIsInternal && targetIsInternal) {
         return maybeNonRelative;
       }
       const nearestTargetPackageJson = getNearestAncestorDirectoryWithPackageJson(host, getDirectoryPath(modulePath));
       const nearestSourcePackageJson = getNearestAncestorDirectoryWithPackageJson(host, sourceDirectory);
-      if (nearestSourcePackageJson !== nearestTargetPackageJson) {
+      const ignoreCase = !hostUsesCaseSensitiveFileNames(host);
+      if (!packageJsonPathsAreEqual(nearestTargetPackageJson, nearestSourcePackageJson, ignoreCase)) {
         return maybeNonRelative;
       }
       return relativePath;
     }
     return isPathRelativeToParent(maybeNonRelative) || countPathComponents(relativePath) < countPathComponents(maybeNonRelative) ? relativePath : maybeNonRelative;
   }
+  function packageJsonPathsAreEqual(a, b, ignoreCase) {
+    if (a === b)
+      return true;
+    if (a === void 0 || b === void 0)
+      return false;
+    return comparePaths(a, b, ignoreCase) === 0 /* EqualTo */;
+  }
   function countPathComponents(path) {
     let count = 0;
     for (let i = startsWith(path, "./") ? 2 : 0; i < path.length; i++) {
@@ -45305,8 +45500,8 @@ ${lanes.join("\n")}
     if (host.getNearestAncestorDirectoryWithPackageJson) {
       return host.getNearestAncestorDirectoryWithPackageJson(fileName);
     }
-    return !!forEachAncestorDirectory(fileName, (directory) => {
-      return host.fileExists(combinePaths(directory, "package.json")) ? true : void 0;
+    return forEachAncestorDirectory(fileName, (directory) => {
+      return host.fileExists(combinePaths(directory, "package.json")) ? directory : void 0;
     });
   }
   function forEachFileNameOfModule(importingFileName, importedFileName, host, preferSymlinks, cb) {
@@ -45349,8 +45544,9 @@ ${lanes.join("\n")}
     });
     return result || (preferSymlinks ? forEach(targets, (p) => shouldFilterIgnoredPaths && containsIgnoredPath(p) ? void 0 : cb(p, p === referenceRedirect)) : void 0);
   }
-  function getAllModulePaths(importingFilePath, importedFileName, host, preferences, options = {}) {
+  function getAllModulePaths(info, importedFileName, host, preferences, options = {}) {
     var _a;
+    const importingFilePath = toPath(info.importingSourceFileName, host.getCurrentDirectory(), hostGetCanonicalFileName(host));
     const importedFilePath = toPath(importedFileName, host.getCurrentDirectory(), hostGetCanonicalFileName(host));
     const cache = (_a = host.getModuleSpecifierCache) == null ? void 0 : _a.call(host);
     if (cache) {
@@ -45358,38 +45554,29 @@ ${lanes.join("\n")}
       if (cached == null ? void 0 : cached.modulePaths)
         return cached.modulePaths;
     }
-    const modulePaths = getAllModulePathsWorker(importingFilePath, importedFileName, host);
+    const modulePaths = getAllModulePathsWorker(info, importedFileName, host);
     if (cache) {
       cache.setModulePaths(importingFilePath, importedFilePath, preferences, options, modulePaths);
     }
     return modulePaths;
   }
-  function getAllModulePathsWorker(importingFileName, importedFileName, host) {
-    const getCanonicalFileName = hostGetCanonicalFileName(host);
+  function getAllModulePathsWorker(info, importedFileName, host) {
     const allFileNames = /* @__PURE__ */ new Map();
     let importedFileFromNodeModules = false;
     forEachFileNameOfModule(
-      importingFileName,
+      info.importingSourceFileName,
       importedFileName,
       host,
       /*preferSymlinks*/
       true,
       (path, isRedirect) => {
-        let isInNodeModules = pathContainsNodeModules(path);
-        const pnpapi = getPnpApi(path);
-        if (!isInNodeModules && pnpapi) {
-          const fromLocator = pnpapi.findPackageLocator(importingFileName);
-          const toLocator = pnpapi.findPackageLocator(path);
-          if (fromLocator && toLocator && fromLocator !== toLocator) {
-            isInNodeModules = true;
-          }
-        }
-        allFileNames.set(path, { path: getCanonicalFileName(path), isRedirect, isInNodeModules });
+        const isInNodeModules = pathContainsNodeModules(path);
+        allFileNames.set(path, { path: info.getCanonicalFileName(path), isRedirect, isInNodeModules });
         importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules;
       }
     );
     const sortedPaths = [];
-    for (let directory = getDirectoryPath(importingFileName); allFileNames.size !== 0; ) {
+    for (let directory = info.canonicalSourceDirectory; allFileNames.size !== 0; ) {
       const directoryStart = ensureTrailingDirectorySeparator(directory);
       let pathsInDirectory;
       allFileNames.forEach(({ path, isRedirect, isInNodeModules }, fileName) => {
@@ -45410,7 +45597,10 @@ ${lanes.join("\n")}
       directory = newDirectory;
     }
     if (allFileNames.size) {
-      const remainingPaths = arrayFrom(allFileNames.values());
+      const remainingPaths = arrayFrom(
+        allFileNames.entries(),
+        ([fileName, { isRedirect, isInNodeModules }]) => ({ path: fileName, isRedirect, isInNodeModules })
+      );
       if (remainingPaths.length > 1)
         remainingPaths.sort(comparePathsByRedirectAndNumberOfDirectorySeparators);
       sortedPaths.push(...remainingPaths);
@@ -45472,7 +45662,7 @@ ${lanes.join("\n")}
             if (value.length >= prefix.length + suffix.length && startsWith(value, prefix) && endsWith(value, suffix) && validateEnding({ ending, value })) {
               const matchedStar = value.substring(prefix.length, value.length - suffix.length);
               if (!pathIsRelative(matchedStar)) {
-                return key.replace("*", matchedStar);
+                return replaceFirstStar(key, matchedStar);
               }
             }
           }
@@ -45485,8 +45675,12 @@ ${lanes.join("\n")}
       return ending !== 0 /* Minimal */ || value === processEnding(relativeToBaseUrl, [ending], compilerOptions, host);
     }
   }
-  function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, exports, conditions, mode = 0 /* Exact */) {
+  function tryGetModuleNameFromExportsOrImports(options, host, targetFilePath, packageDirectory, packageName, exports, conditions, mode, isImports) {
     if (typeof exports === "string") {
+      const ignoreCase = !hostUsesCaseSensitiveFileNames(host);
+      const getCommonSourceDirectory2 = () => host.getCommonSourceDirectory();
+      const outputFile = isImports && getOutputJSFileNameWorker(targetFilePath, options, ignoreCase, getCommonSourceDirectory2);
+      const declarationFile = isImports && getOutputDeclarationFileNameWorker(targetFilePath, options, ignoreCase, getCommonSourceDirectory2);
       const pathOrPattern = getNormalizedAbsolutePath(
         combinePaths(packageDirectory, exports),
         /*currentDirectory*/
@@ -45495,12 +45689,25 @@ ${lanes.join("\n")}
       const extensionSwappedTarget = hasTSFileExtension(targetFilePath) ? removeFileExtension(targetFilePath) + tryGetJSExtensionForFile(targetFilePath, options) : void 0;
       switch (mode) {
         case 0 /* Exact */:
-          if (comparePaths(targetFilePath, pathOrPattern) === 0 /* EqualTo */ || extensionSwappedTarget && comparePaths(extensionSwappedTarget, pathOrPattern) === 0 /* EqualTo */) {
+          if (extensionSwappedTarget && comparePaths(extensionSwappedTarget, pathOrPattern, ignoreCase) === 0 /* EqualTo */ || comparePaths(targetFilePath, pathOrPattern, ignoreCase) === 0 /* EqualTo */ || outputFile && comparePaths(outputFile, pathOrPattern, ignoreCase) === 0 /* EqualTo */ || declarationFile && comparePaths(declarationFile, pathOrPattern, ignoreCase) === 0 /* EqualTo */) {
             return { moduleFileToTry: packageName };
           }
           break;
         case 1 /* Directory */:
-          if (containsPath(pathOrPattern, targetFilePath)) {
+          if (extensionSwappedTarget && containsPath(pathOrPattern, extensionSwappedTarget, ignoreCase)) {
+            const fragment = getRelativePathFromDirectory(
+              pathOrPattern,
+              extensionSwappedTarget,
+              /*ignoreCase*/
+              false
+            );
+            return { moduleFileToTry: getNormalizedAbsolutePath(
+              combinePaths(combinePaths(packageName, exports), fragment),
+              /*currentDirectory*/
+              void 0
+            ) };
+          }
+          if (containsPath(pathOrPattern, targetFilePath, ignoreCase)) {
             const fragment = getRelativePathFromDirectory(
               pathOrPattern,
               targetFilePath,
@@ -45513,48 +45720,136 @@ ${lanes.join("\n")}
               void 0
             ) };
           }
+          if (outputFile && containsPath(pathOrPattern, outputFile, ignoreCase)) {
+            const fragment = getRelativePathFromDirectory(
+              pathOrPattern,
+              outputFile,
+              /*ignoreCase*/
+              false
+            );
+            return { moduleFileToTry: combinePaths(packageName, fragment) };
+          }
+          if (declarationFile && containsPath(pathOrPattern, declarationFile, ignoreCase)) {
+            const fragment = getRelativePathFromDirectory(
+              pathOrPattern,
+              declarationFile,
+              /*ignoreCase*/
+              false
+            );
+            return { moduleFileToTry: combinePaths(packageName, fragment) };
+          }
           break;
         case 2 /* Pattern */:
           const starPos = pathOrPattern.indexOf("*");
           const leadingSlice = pathOrPattern.slice(0, starPos);
           const trailingSlice = pathOrPattern.slice(starPos + 1);
-          if (startsWith(targetFilePath, leadingSlice) && endsWith(targetFilePath, trailingSlice)) {
+          if (extensionSwappedTarget && startsWith(extensionSwappedTarget, leadingSlice, ignoreCase) && endsWith(extensionSwappedTarget, trailingSlice, ignoreCase)) {
+            const starReplacement = extensionSwappedTarget.slice(leadingSlice.length, extensionSwappedTarget.length - trailingSlice.length);
+            return { moduleFileToTry: replaceFirstStar(packageName, starReplacement) };
+          }
+          if (startsWith(targetFilePath, leadingSlice, ignoreCase) && endsWith(targetFilePath, trailingSlice, ignoreCase)) {
             const starReplacement = targetFilePath.slice(leadingSlice.length, targetFilePath.length - trailingSlice.length);
-            return { moduleFileToTry: packageName.replace("*", starReplacement) };
+            return { moduleFileToTry: replaceFirstStar(packageName, starReplacement) };
           }
-          if (extensionSwappedTarget && startsWith(extensionSwappedTarget, leadingSlice) && endsWith(extensionSwappedTarget, trailingSlice)) {
-            const starReplacement = extensionSwappedTarget.slice(leadingSlice.length, extensionSwappedTarget.length - trailingSlice.length);
-            return { moduleFileToTry: packageName.replace("*", starReplacement) };
+          if (outputFile && startsWith(outputFile, leadingSlice, ignoreCase) && endsWith(outputFile, trailingSlice, ignoreCase)) {
+            const starReplacement = outputFile.slice(leadingSlice.length, outputFile.length - trailingSlice.length);
+            return { moduleFileToTry: replaceFirstStar(packageName, starReplacement) };
+          }
+          if (declarationFile && startsWith(declarationFile, leadingSlice, ignoreCase) && endsWith(declarationFile, trailingSlice, ignoreCase)) {
+            const starReplacement = declarationFile.slice(leadingSlice.length, declarationFile.length - trailingSlice.length);
+            return { moduleFileToTry: replaceFirstStar(packageName, starReplacement) };
           }
           break;
       }
     } else if (Array.isArray(exports)) {
-      return forEach(exports, (e) => tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, e, conditions));
+      return forEach(exports, (e) => tryGetModuleNameFromExportsOrImports(options, host, targetFilePath, packageDirectory, packageName, e, conditions, mode, isImports));
     } else if (typeof exports === "object" && exports !== null) {
-      if (allKeysStartWithDot(exports)) {
-        return forEach(getOwnKeys(exports), (k) => {
-          const subPackageName = getNormalizedAbsolutePath(
-            combinePaths(packageName, k),
-            /*currentDirectory*/
-            void 0
-          );
-          const mode2 = endsWith(k, "/") ? 1 /* Directory */ : k.includes("*") ? 2 /* Pattern */ : 0 /* Exact */;
-          return tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, subPackageName, exports[k], conditions, mode2);
-        });
-      } else {
-        for (const key of getOwnKeys(exports)) {
-          if (key === "default" || conditions.includes(key) || isApplicableVersionedTypesKey(conditions, key)) {
-            const subTarget = exports[key];
-            const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions, mode);
-            if (result) {
-              return result;
-            }
+      for (const key of getOwnKeys(exports)) {
+        if (key === "default" || conditions.indexOf(key) >= 0 || isApplicableVersionedTypesKey(conditions, key)) {
+          const subTarget = exports[key];
+          const result = tryGetModuleNameFromExportsOrImports(options, host, targetFilePath, packageDirectory, packageName, subTarget, conditions, mode, isImports);
+          if (result) {
+            return result;
           }
         }
       }
     }
     return void 0;
   }
+  function tryGetModuleNameFromExports(options, host, targetFilePath, packageDirectory, packageName, exports, conditions) {
+    if (typeof exports === "object" && exports !== null && !Array.isArray(exports) && allKeysStartWithDot(exports)) {
+      return forEach(getOwnKeys(exports), (k) => {
+        const subPackageName = getNormalizedAbsolutePath(
+          combinePaths(packageName, k),
+          /*currentDirectory*/
+          void 0
+        );
+        const mode = endsWith(k, "/") ? 1 /* Directory */ : k.includes("*") ? 2 /* Pattern */ : 0 /* Exact */;
+        return tryGetModuleNameFromExportsOrImports(
+          options,
+          host,
+          targetFilePath,
+          packageDirectory,
+          subPackageName,
+          exports[k],
+          conditions,
+          mode,
+          /*isImports*/
+          false
+        );
+      });
+    }
+    return tryGetModuleNameFromExportsOrImports(
+      options,
+      host,
+      targetFilePath,
+      packageDirectory,
+      packageName,
+      exports,
+      conditions,
+      0 /* Exact */,
+      /*isImports*/
+      false
+    );
+  }
+  function tryGetModuleNameFromPackageJsonImports(moduleFileName, sourceDirectory, options, host, importMode) {
+    var _a, _b, _c;
+    if (!host.readFile || !getResolvePackageJsonImports(options)) {
+      return void 0;
+    }
+    const ancestorDirectoryWithPackageJson = getNearestAncestorDirectoryWithPackageJson(host, sourceDirectory);
+    if (!ancestorDirectoryWithPackageJson) {
+      return void 0;
+    }
+    const packageJsonPath = combinePaths(ancestorDirectoryWithPackageJson, "package.json");
+    const cachedPackageJson = (_b = (_a = host.getPackageJsonInfoCache) == null ? void 0 : _a.call(host)) == null ? void 0 : _b.getPackageJsonInfo(packageJsonPath);
+    if (isMissingPackageJsonInfo(cachedPackageJson) || !host.fileExists(packageJsonPath)) {
+      return void 0;
+    }
+    const packageJsonContent = (cachedPackageJson == null ? void 0 : cachedPackageJson.contents.packageJsonContent) || tryParseJson(host.readFile(packageJsonPath));
+    const imports = packageJsonContent == null ? void 0 : packageJsonContent.imports;
+    if (!imports) {
+      return void 0;
+    }
+    const conditions = getConditions(options, importMode);
+    return (_c = forEach(getOwnKeys(imports), (k) => {
+      if (!startsWith(k, "#") || k === "#" || startsWith(k, "#/"))
+        return void 0;
+      const mode = endsWith(k, "/") ? 1 /* Directory */ : k.includes("*") ? 2 /* Pattern */ : 0 /* Exact */;
+      return tryGetModuleNameFromExportsOrImports(
+        options,
+        host,
+        moduleFileName,
+        ancestorDirectoryWithPackageJson,
+        k,
+        imports[k],
+        conditions,
+        mode,
+        /*isImports*/
+        true
+      );
+    })) == null ? void 0 : _c.moduleFileToTry;
+  }
   function tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, allowedEndings, compilerOptions) {
     const normalizedTargetPaths = getPathsRelativeToRootDirs(moduleFileName, rootDirs, getCanonicalFileName);
     if (normalizedTargetPaths === void 0) {
@@ -45570,49 +45865,15 @@ ${lanes.join("\n")}
     }
     return processEnding(shortest, allowedEndings, compilerOptions);
   }
-  function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileName, sourceDirectory }, importingSourceFile, host, options, userPreferences, packageNameOnly, overrideMode) {
+  function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileName, canonicalSourceDirectory }, importingSourceFile, host, options, userPreferences, packageNameOnly, overrideMode) {
     if (!host.fileExists || !host.readFile) {
       return void 0;
     }
-    let parts = getNodeModulePathParts(path);
-    let pnpPackageName;
-    const pnpApi = getPnpApi(path);
-    if (pnpApi) {
-      const fromLocator = pnpApi.findPackageLocator(importingSourceFile.fileName);
-      const toLocator = pnpApi.findPackageLocator(path);
-      if (fromLocator === toLocator) {
-        return void 0;
-      }
-      if (fromLocator && toLocator) {
-        const fromInfo = pnpApi.getPackageInformation(fromLocator);
-        if (toLocator.reference === fromInfo.packageDependencies.get(toLocator.name)) {
-          pnpPackageName = toLocator.name;
-        } else {
-          for (const [name, reference] of fromInfo.packageDependencies) {
-            if (Array.isArray(reference)) {
-              if (reference[0] === toLocator.name && reference[1] === toLocator.reference) {
-                pnpPackageName = name;
-                break;
-              }
-            }
-          }
-        }
-        if (!parts) {
-          const toInfo = pnpApi.getPackageInformation(toLocator);
-          parts = {
-            topLevelNodeModulesIndex: void 0,
-            topLevelPackageNameIndex: void 0,
-            // The last character from packageLocation is the trailing "/", we want to point to it
-            packageRootIndex: toInfo.packageLocation.length - 1,
-            fileNameIndex: path.lastIndexOf(`/`)
-          };
-        }
-      }
-    }
+    const parts = getNodeModulePathParts(path);
     if (!parts) {
       return void 0;
     }
-    const preferences = getPreferences(userPreferences, options, importingSourceFile);
+    const preferences = getModuleSpecifierPreferences(userPreferences, options, importingSourceFile);
     const allowedEndings = preferences.getAllowedEndingsInPreferredOrder();
     let moduleSpecifier = path;
     let isPackageRootPath = false;
@@ -45646,16 +45907,14 @@ ${lanes.join("\n")}
     if (isRedirect && !isPackageRootPath) {
       return void 0;
     }
-    if (typeof process.versions.pnp === "undefined") {
-      const globalTypingsCacheLocation = host.getGlobalTypingsCacheLocation && host.getGlobalTypingsCacheLocation();
-      const pathToTopLevelNodeModules = getCanonicalFileName(moduleSpecifier.substring(0, parts.topLevelNodeModulesIndex));
-      if (!(startsWith(sourceDirectory, pathToTopLevelNodeModules) || globalTypingsCacheLocation && startsWith(getCanonicalFileName(globalTypingsCacheLocation), pathToTopLevelNodeModules))) {
-        return void 0;
-      }
+    const globalTypingsCacheLocation = host.getGlobalTypingsCacheLocation && host.getGlobalTypingsCacheLocation();
+    const pathToTopLevelNodeModules = getCanonicalFileName(moduleSpecifier.substring(0, parts.topLevelNodeModulesIndex));
+    if (!(startsWith(canonicalSourceDirectory, pathToTopLevelNodeModules) || globalTypingsCacheLocation && startsWith(getCanonicalFileName(globalTypingsCacheLocation), pathToTopLevelNodeModules))) {
+      return void 0;
     }
-    const nodeModulesDirectoryName = typeof pnpPackageName !== "undefined" ? pnpPackageName + moduleSpecifier.substring(parts.packageRootIndex) : moduleSpecifier.substring(parts.topLevelPackageNameIndex + 1);
-    const packageNameFromPath = getPackageNameFromTypesPackageName(nodeModulesDirectoryName);
-    return getEmitModuleResolutionKind(options) === 1 /* Classic */ && packageNameFromPath === nodeModulesDirectoryName ? void 0 : packageNameFromPath;
+    const nodeModulesDirectoryName = moduleSpecifier.substring(parts.topLevelPackageNameIndex + 1);
+    const packageName = getPackageNameFromTypesPackageName(nodeModulesDirectoryName);
+    return getEmitModuleResolutionKind(options) === 1 /* Classic */ && packageName === nodeModulesDirectoryName ? void 0 : packageName;
     function tryDirectoryWithPackageJson(packageRootIndex) {
       var _a, _b;
       const packageRootPath = path.substring(0, packageRootIndex);
@@ -45663,23 +45922,22 @@ ${lanes.join("\n")}
       let moduleFileToTry = path;
       let maybeBlockedByTypesVersions = false;
       const cachedPackageJson = (_b = (_a = host.getPackageJsonInfoCache) == null ? void 0 : _a.call(host)) == null ? void 0 : _b.getPackageJsonInfo(packageJsonPath);
-      if (typeof cachedPackageJson === "object" || cachedPackageJson === void 0 && host.fileExists(packageJsonPath)) {
-        const packageJsonContent = (cachedPackageJson == null ? void 0 : cachedPackageJson.contents.packageJsonContent) || JSON.parse(host.readFile(packageJsonPath));
+      if (isPackageJsonInfo(cachedPackageJson) || cachedPackageJson === void 0 && host.fileExists(packageJsonPath)) {
+        const packageJsonContent = (cachedPackageJson == null ? void 0 : cachedPackageJson.contents.packageJsonContent) || tryParseJson(host.readFile(packageJsonPath));
         const importMode = overrideMode || importingSourceFile.impliedNodeFormat;
         if (getResolvePackageJsonExports(options)) {
           const nodeModulesDirectoryName2 = packageRootPath.substring(parts.topLevelPackageNameIndex + 1);
-          const packageName = getPackageNameFromTypesPackageName(pnpPackageName ? pnpPackageName : nodeModulesDirectoryName2);
+          const packageName2 = getPackageNameFromTypesPackageName(nodeModulesDirectoryName2);
           const conditions = getConditions(options, importMode);
-          const fromExports = packageJsonContent.exports ? tryGetModuleNameFromExports(options, path, packageRootPath, packageName, packageJsonContent.exports, conditions) : void 0;
+          const fromExports = (packageJsonContent == null ? void 0 : packageJsonContent.exports) ? tryGetModuleNameFromExports(options, host, path, packageRootPath, packageName2, packageJsonContent.exports, conditions) : void 0;
           if (fromExports) {
-            const withJsExtension = !hasTSFileExtension(fromExports.moduleFileToTry) ? fromExports : { moduleFileToTry: removeFileExtension(fromExports.moduleFileToTry) + tryGetJSExtensionForFile(fromExports.moduleFileToTry, options) };
-            return { ...withJsExtension, verbatimFromExports: true };
+            return { ...fromExports, verbatimFromExports: true };
           }
-          if (packageJsonContent.exports) {
+          if (packageJsonContent == null ? void 0 : packageJsonContent.exports) {
             return { moduleFileToTry: path, blockedByExports: true };
           }
         }
-        const versionPaths = packageJsonContent.typesVersions ? getPackageJsonTypesVersionsPaths(packageJsonContent.typesVersions) : void 0;
+        const versionPaths = (packageJsonContent == null ? void 0 : packageJsonContent.typesVersions) ? getPackageJsonTypesVersionsPaths(packageJsonContent.typesVersions) : void 0;
         if (versionPaths) {
           const subModuleName = path.slice(packageRootPath.length + 1);
           const fromPaths = tryGetModuleNameFromPaths(
@@ -45695,13 +45953,13 @@ ${lanes.join("\n")}
             moduleFileToTry = combinePaths(packageRootPath, fromPaths);
           }
         }
-        const mainFileRelative = packageJsonContent.typings || packageJsonContent.types || packageJsonContent.main || "index.js";
+        const mainFileRelative = (packageJsonContent == null ? void 0 : packageJsonContent.typings) || (packageJsonContent == null ? void 0 : packageJsonContent.types) || (packageJsonContent == null ? void 0 : packageJsonContent.main) || "index.js";
         if (isString(mainFileRelative) && !(maybeBlockedByTypesVersions && matchPatternOrExact(tryParsePatterns(versionPaths.paths), mainFileRelative))) {
           const mainExportFile = toPath(mainFileRelative, packageRootPath, getCanonicalFileName);
           const canonicalModuleFileToTry = getCanonicalFileName(moduleFileToTry);
           if (removeFileExtension(mainExportFile) === removeFileExtension(canonicalModuleFileToTry)) {
             return { packageRootPath, moduleFileToTry };
-          } else if (packageJsonContent.type !== "module" && !fileExtensionIsOneOf(canonicalModuleFileToTry, extensionsNotSupportingExtensionlessResolution) && startsWith(canonicalModuleFileToTry, mainExportFile) && getDirectoryPath(canonicalModuleFileToTry) === removeTrailingDirectorySeparator(mainExportFile) && removeFileExtension(getBaseFileName(canonicalModuleFileToTry)) === "index") {
+          } else if ((packageJsonContent == null ? void 0 : packageJsonContent.type) !== "module" && !fileExtensionIsOneOf(canonicalModuleFileToTry, extensionsNotSupportingExtensionlessResolution) && startsWith(canonicalModuleFileToTry, mainExportFile) && getDirectoryPath(canonicalModuleFileToTry) === removeTrailingDirectorySeparator(mainExportFile) && removeFileExtension(getBaseFileName(canonicalModuleFileToTry)) === "index") {
             return { packageRootPath, moduleFileToTry };
           }
         }
@@ -45818,20 +46076,29 @@ ${lanes.join("\n")}
   function isPathRelativeToParent(path) {
     return startsWith(path, "..");
   }
+  var RelativePreference;
   var init_moduleSpecifiers = __esm({
     "src/compiler/moduleSpecifiers.ts"() {
       "use strict";
       init_ts2();
-      init_pnp();
+      RelativePreference = /* @__PURE__ */ ((RelativePreference2) => {
+        RelativePreference2[RelativePreference2["Relative"] = 0] = "Relative";
+        RelativePreference2[RelativePreference2["NonRelative"] = 1] = "NonRelative";
+        RelativePreference2[RelativePreference2["Shortest"] = 2] = "Shortest";
+        RelativePreference2[RelativePreference2["ExternalNonRelative"] = 3] = "ExternalNonRelative";
+        return RelativePreference2;
+      })(RelativePreference || {});
     }
   });
 
   // src/compiler/_namespaces/ts.moduleSpecifiers.ts
   var ts_moduleSpecifiers_exports = {};
   __export(ts_moduleSpecifiers_exports, {
+    RelativePreference: () => RelativePreference,
     countPathComponents: () => countPathComponents,
     forEachFileNameOfModule: () => forEachFileNameOfModule,
     getModuleSpecifier: () => getModuleSpecifier,
+    getModuleSpecifierPreferences: () => getModuleSpecifierPreferences,
     getModuleSpecifiers: () => getModuleSpecifiers,
     getModuleSpecifiersWithCacheInfo: () => getModuleSpecifiersWithCacheInfo,
     getNodeModulesPackageName: () => getNodeModulesPackageName,
@@ -45879,7 +46146,7 @@ ${lanes.join("\n")}
     var requestedExternalEmitHelpers;
     var externalHelpersModule;
     var Symbol47 = objectAllocator.getSymbolConstructor();
-    var Type27 = objectAllocator.getTypeConstructor();
+    var Type28 = objectAllocator.getTypeConstructor();
     var Signature14 = objectAllocator.getSignatureConstructor();
     var typeCount = 0;
     var symbolCount = 0;
@@ -46764,6 +47031,7 @@ ${lanes.join("\n")}
     var deferredGlobalImportMetaType;
     var deferredGlobalImportMetaExpressionType;
     var deferredGlobalImportCallOptionsType;
+    var deferredGlobalImportAttributesType;
     var deferredGlobalDisposableType;
     var deferredGlobalAsyncDisposableType;
     var deferredGlobalExtractSymbol;
@@ -46920,7 +47188,12 @@ ${lanes.join("\n")}
     }
     function markAsSynthetic(node) {
       setTextRangePosEnd(node, -1, -1);
-      return visitEachChild(node, markAsSynthetic, nullTransformationContext);
+      return visitEachChild(
+        node,
+        markAsSynthetic,
+        /*context*/
+        void 0
+      );
     }
     function getEmitResolver(sourceFile, cancellationToken2) {
       getDiagnostics2(sourceFile, cancellationToken2);
@@ -47011,7 +47284,7 @@ ${lanes.join("\n")}
       symbol.links.checkFlags = checkFlags || 0 /* None */;
       return symbol;
     }
-    function createParameter(name, type) {
+    function createParameter2(name, type) {
       const symbol = createSymbol(1 /* FunctionScopedVariable */, name);
       symbol.links.type = type;
       return symbol;
@@ -47327,7 +47600,7 @@ ${lanes.join("\n")}
           return isBlockScopedNameDeclaredBeforeUse(getAncestor(declaration, 260 /* VariableDeclaration */), usage);
         } else if (declaration.kind === 260 /* VariableDeclaration */) {
           return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage);
-        } else if (isClassDeclaration(declaration)) {
+        } else if (isClassLike(declaration)) {
           return !findAncestor(usage, (n) => isComputedPropertyName(n) && n.parent.parent === declaration);
         } else if (isPropertyDeclaration(declaration)) {
           return !isPropertyImmediatelyReferencedWithinDeclaration(
@@ -47805,6 +48078,7 @@ ${lanes.join("\n")}
       }
       if (nameNotFoundMessage) {
         addLazyDiagnostic(() => {
+          var _a2;
           if (errorLocation && (meaning & 2 /* BlockScopedVariable */ || (meaning & 32 /* Class */ || meaning & 384 /* Enum */) && (meaning & 111551 /* Value */) === 111551 /* Value */)) {
             const exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result);
             if (exportOrLocalSymbol.flags & 2 /* BlockScopedVariable */ || exportOrLocalSymbol.flags & 32 /* Class */ || exportOrLocalSymbol.flags & 384 /* Enum */) {
@@ -47838,6 +48112,16 @@ ${lanes.join("\n")}
               );
             }
           }
+          if (compilerOptions.isolatedModules && result && isInExternalModule && (meaning & 111551 /* Value */) === 111551 /* Value */) {
+            const isGlobal = lookup(globals, name, meaning) === result;
+            const nonValueSymbol = isGlobal && isSourceFile(lastLocation) && lastLocation.locals && lookup(lastLocation.locals, name, ~111551 /* Value */);
+            if (nonValueSymbol) {
+              const importDecl = (_a2 = nonValueSymbol.declarations) == null ? void 0 : _a2.find((d) => d.kind === 276 /* ImportSpecifier */ || d.kind === 273 /* ImportClause */ || d.kind === 274 /* NamespaceImport */ || d.kind === 271 /* ImportEqualsDeclaration */);
+              if (importDecl && !isTypeOnlyImportDeclaration(importDecl)) {
+                error2(importDecl, Diagnostics.Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled, unescapeLeadingUnderscores(name));
+              }
+            }
+          }
         });
       }
       return result;
@@ -48152,6 +48436,11 @@ ${lanes.join("\n")}
           diagnosticMessage = error2(errorLocation, Diagnostics.Class_0_used_before_its_declaration, declarationName);
         } else if (result.flags & 256 /* RegularEnum */) {
           diagnosticMessage = error2(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName);
+        } else {
+          Debug.assert(!!(result.flags & 128 /* ConstEnum */));
+          if (getIsolatedModules(compilerOptions)) {
+            diagnosticMessage = error2(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName);
+          }
         }
         if (diagnosticMessage) {
           addRelatedInfo(diagnosticMessage, createDiagnosticForNode(declaration, Diagnostics._0_is_declared_here, declarationName));
@@ -48248,7 +48537,7 @@ ${lanes.join("\n")}
       return isExportAssignment(node) && !node.isExportEquals || hasSyntacticModifier(node, 2048 /* Default */) || isExportSpecifier(node) || isNamespaceExport(node);
     }
     function getUsageModeForExpression(usage) {
-      return isStringLiteralLike(usage) ? getModeForUsageLocation(getSourceFileOfNode(usage), usage) : void 0;
+      return isStringLiteralLike(usage) ? host.getModeForUsageLocation(getSourceFileOfNode(usage), usage) : void 0;
     }
     function isESMFormatImportImportingCommonjsFormatFile(usageMode, targetMode) {
       return usageMode === 99 /* ESNext */ && targetMode === 1 /* CommonJS */;
@@ -48259,7 +48548,7 @@ ${lanes.join("\n")}
     }
     function canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, usage) {
       const usageMode = file && getUsageModeForExpression(usage);
-      if (file && usageMode !== void 0) {
+      if (file && usageMode !== void 0 && 100 /* Node16 */ <= moduleKind && moduleKind <= 199 /* NodeNext */) {
         const result = isESMFormatImportImportingCommonjsFormatFile(usageMode, file.impliedNodeFormat);
         if (usageMode === 99 /* ESNext */ || result) {
           return result;
@@ -48792,7 +49081,7 @@ ${lanes.join("\n")}
           break;
         }
         if (target === unknownSymbol) {
-          return 67108863 /* All */;
+          return -1 /* All */;
         }
         if (target === symbol || (seenSymbols == null ? void 0 : seenSymbols.has(target))) {
           break;
@@ -49138,7 +49427,7 @@ ${lanes.join("\n")}
       return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0;
     }
     function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
-      var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
+      var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
       if (startsWith(moduleReference, "@types/")) {
         const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
         const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
@@ -49153,8 +49442,12 @@ ${lanes.join("\n")}
         return ambientModule;
       }
       const currentSourceFile = getSourceFileOfNode(location);
-      const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = findAncestor(location, isImportCall)) == null ? void 0 : _a.arguments[0]) || ((_b = findAncestor(location, isImportDeclaration)) == null ? void 0 : _b.moduleSpecifier) || ((_c = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _c.moduleReference.expression) || ((_d = findAncestor(location, isExportDeclaration)) == null ? void 0 : _d.moduleSpecifier) || ((_e = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _e.name) || ((_f = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _f.argument.literal);
-      const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
+      const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _a.name) || ((_b = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _b.argument.literal) || (isVariableDeclaration(location) && location.initializer && isRequireCall(
+        location.initializer,
+        /*requireStringLiteralLikeArgument*/
+        true
+      ) ? location.initializer.arguments[0] : void 0) || ((_c = findAncestor(location, isImportCall)) == null ? void 0 : _c.arguments[0]) || ((_d = findAncestor(location, isImportDeclaration)) == null ? void 0 : _d.moduleSpecifier) || ((_e = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _e.moduleReference.expression) || ((_f = findAncestor(location, isExportDeclaration)) == null ? void 0 : _f.moduleSpecifier);
+      const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? host.getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
       const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
       const resolvedModule = (_g = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _g.resolvedModule;
       const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
@@ -49307,7 +49600,17 @@ ${lanes.join("\n")}
               error2(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path);
             }
           } else {
-            error2(errorNode, moduleNotFoundError, moduleReference);
+            if ((_k = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _k.alternateResult) {
+              const errorInfo = createModuleNotFoundChain(currentSourceFile, host, moduleReference, mode, moduleReference);
+              errorOrSuggestion(
+                /*isError*/
+                true,
+                errorNode,
+                chainDiagnosticMessages(errorInfo, moduleNotFoundError, moduleReference)
+              );
+            } else {
+              error2(errorNode, moduleNotFoundError, moduleReference);
+            }
           }
         }
       }
@@ -49596,6 +49899,10 @@ ${lanes.join("\n")}
     function getParentOfSymbol(symbol) {
       return getMergedSymbol(symbol.parent && getLateBoundSymbol(symbol.parent));
     }
+    function getFunctionExpressionParentSymbolOrSymbol(symbol) {
+      var _a, _b;
+      return ((_a = symbol.valueDeclaration) == null ? void 0 : _a.kind) === 219 /* ArrowFunction */ || ((_b = symbol.valueDeclaration) == null ? void 0 : _b.kind) === 218 /* FunctionExpression */ ? getSymbolOfNode(symbol.valueDeclaration.parent) || symbol : symbol;
+    }
     function getAlternativeContainingModules(symbol, enclosingDeclaration) {
       const containingFile = getSourceFileOfNode(enclosingDeclaration);
       const id = getNodeId(containingFile);
@@ -49644,29 +49951,7 @@ ${lanes.join("\n")}
     function getContainersOfSymbol(symbol, enclosingDeclaration, meaning) {
       const container = getParentOfSymbol(symbol);
       if (container && !(symbol.flags & 262144 /* TypeParameter */)) {
-        const additionalContainers = mapDefined(container.declarations, fileSymbolIfFileSymbolExportEqualsContainer);
-        const reexportContainers = enclosingDeclaration && getAlternativeContainingModules(symbol, enclosingDeclaration);
-        const objectLiteralContainer = getVariableDeclarationOfObjectLiteral(container, meaning);
-        if (enclosingDeclaration && container.flags & getQualifiedLeftMeaning(meaning) && getAccessibleSymbolChain(
-          container,
-          enclosingDeclaration,
-          1920 /* Namespace */,
-          /*useOnlyExternalAliasing*/
-          false
-        )) {
-          return append(concatenate(concatenate([container], additionalContainers), reexportContainers), objectLiteralContainer);
-        }
-        const firstVariableMatch = !(container.flags & getQualifiedLeftMeaning(meaning)) && container.flags & 788968 /* Type */ && getDeclaredTypeOfSymbol(container).flags & 524288 /* Object */ && meaning === 111551 /* Value */ ? forEachSymbolTableInScope(enclosingDeclaration, (t) => {
-          return forEachEntry(t, (s) => {
-            if (s.flags & getQualifiedLeftMeaning(meaning) && getTypeOfSymbol(s) === getDeclaredTypeOfSymbol(container)) {
-              return s;
-            }
-          });
-        }) : void 0;
-        let res = firstVariableMatch ? [firstVariableMatch, ...additionalContainers, container] : [...additionalContainers, container];
-        res = append(res, objectLiteralContainer);
-        res = addRange(res, reexportContainers);
-        return res;
+        return getWithAlternativeContainers(container);
       }
       const candidates = mapDefined(symbol.declarations, (d) => {
         if (!isAmbientModule(d) && d.parent) {
@@ -49688,7 +49973,40 @@ ${lanes.join("\n")}
       if (!length(candidates)) {
         return void 0;
       }
-      return mapDefined(candidates, (candidate) => getAliasForSymbolInContainer(candidate, symbol) ? candidate : void 0);
+      const containers = mapDefined(candidates, (candidate) => getAliasForSymbolInContainer(candidate, symbol) ? candidate : void 0);
+      let bestContainers = [];
+      let alternativeContainers = [];
+      for (const container2 of containers) {
+        const [bestMatch, ...rest] = getWithAlternativeContainers(container2);
+        bestContainers = append(bestContainers, bestMatch);
+        alternativeContainers = addRange(alternativeContainers, rest);
+      }
+      return concatenate(bestContainers, alternativeContainers);
+      function getWithAlternativeContainers(container2) {
+        const additionalContainers = mapDefined(container2.declarations, fileSymbolIfFileSymbolExportEqualsContainer);
+        const reexportContainers = enclosingDeclaration && getAlternativeContainingModules(symbol, enclosingDeclaration);
+        const objectLiteralContainer = getVariableDeclarationOfObjectLiteral(container2, meaning);
+        if (enclosingDeclaration && container2.flags & getQualifiedLeftMeaning(meaning) && getAccessibleSymbolChain(
+          container2,
+          enclosingDeclaration,
+          1920 /* Namespace */,
+          /*useOnlyExternalAliasing*/
+          false
+        )) {
+          return append(concatenate(concatenate([container2], additionalContainers), reexportContainers), objectLiteralContainer);
+        }
+        const firstVariableMatch = !(container2.flags & getQualifiedLeftMeaning(meaning)) && container2.flags & 788968 /* Type */ && getDeclaredTypeOfSymbol(container2).flags & 524288 /* Object */ && meaning === 111551 /* Value */ ? forEachSymbolTableInScope(enclosingDeclaration, (t) => {
+          return forEachEntry(t, (s) => {
+            if (s.flags & getQualifiedLeftMeaning(meaning) && getTypeOfSymbol(s) === getDeclaredTypeOfSymbol(container2)) {
+              return s;
+            }
+          });
+        }) : void 0;
+        let res = firstVariableMatch ? [firstVariableMatch, ...additionalContainers, container2] : [...additionalContainers, container2];
+        res = append(res, objectLiteralContainer);
+        res = addRange(res, reexportContainers);
+        return res;
+      }
       function fileSymbolIfFileSymbolExportEqualsContainer(d) {
         return container && getFileSymbolIfFileSymbolExportEqualsContainer(d, container);
       }
@@ -49746,7 +50064,7 @@ ${lanes.join("\n")}
     }
     function createType(flags) {
       var _a;
-      const result = new Type27(checker, flags);
+      const result = new Type28(checker, flags);
       typeCount++;
       result.id = typeCount;
       (_a = tracing) == null ? void 0 : _a.recordType(result);
@@ -49758,7 +50076,7 @@ ${lanes.join("\n")}
       return result;
     }
     function createOriginType(flags) {
-      return new Type27(checker, flags);
+      return new Type28(checker, flags);
     }
     function createIntrinsicType(kind, intrinsicName, objectFlags = 0 /* None */, debugIntrinsicName) {
       checkIntrinsicName(intrinsicName, debugIntrinsicName);
@@ -50205,15 +50523,19 @@ ${lanes.join("\n")}
         return true;
       }
     }
-    function isEntityNameVisible(entityName, enclosingDeclaration) {
+    function getMeaningOfEntityNameReference(entityName) {
       let meaning;
       if (entityName.parent.kind === 186 /* TypeQuery */ || entityName.parent.kind === 233 /* ExpressionWithTypeArguments */ && !isPartOfTypeNode(entityName.parent) || entityName.parent.kind === 167 /* ComputedPropertyName */) {
         meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
-      } else if (entityName.kind === 166 /* QualifiedName */ || entityName.kind === 211 /* PropertyAccessExpression */ || entityName.parent.kind === 271 /* ImportEqualsDeclaration */) {
+      } else if (entityName.kind === 166 /* QualifiedName */ || entityName.kind === 211 /* PropertyAccessExpression */ || entityName.parent.kind === 271 /* ImportEqualsDeclaration */ || entityName.parent.kind === 166 /* QualifiedName */ && entityName.parent.left === entityName || entityName.parent.kind === 211 /* PropertyAccessExpression */ && entityName.parent.expression === entityName || entityName.parent.kind === 212 /* ElementAccessExpression */ && entityName.parent.expression === entityName) {
         meaning = 1920 /* Namespace */;
       } else {
         meaning = 788968 /* Type */;
       }
+      return meaning;
+    }
+    function isEntityNameVisible(entityName, enclosingDeclaration) {
+      const meaning = getMeaningOfEntityNameReference(entityName);
       const firstIdentifier = getFirstIdentifier(entityName);
       const symbol = resolveName(
         enclosingDeclaration,
@@ -50351,7 +50673,7 @@ ${lanes.join("\n")}
       return symbol && !!symbol.valueDeclaration && isExpression(symbol.valueDeclaration) && !isContextSensitive(symbol.valueDeclaration);
     }
     function toNodeBuilderFlags(flags = 0 /* None */) {
-      return flags & 848330091 /* NodeBuilderFlagsMask */;
+      return flags & 848330095 /* NodeBuilderFlagsMask */;
     }
     function isClassInstanceSide(type) {
       return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || !!(type.flags & 524288 /* Object */) && !!(getObjectFlags(type) & 16777216 /* IsClassInstanceClone */));
@@ -50600,7 +50922,7 @@ ${lanes.join("\n")}
             }
             return factory.createInferTypeNode(typeParameterToDeclarationWithConstraint(type, context, constraintNode));
           }
-          if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && type.flags & 262144 /* TypeParameter */ && !isTypeSymbolAccessible(type.symbol, context.enclosingDeclaration)) {
+          if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && type.flags & 262144 /* TypeParameter */) {
             const name2 = typeParameterToName(type, context);
             context.approximateLength += idText(name2).length;
             return factory.createTypeReferenceNode(
@@ -50679,7 +51001,13 @@ ${lanes.join("\n")}
           return visitAndTransformType(type, (type2) => conditionalTypeToTypeNode(type2));
         }
         if (type.flags & 33554432 /* Substitution */) {
-          return typeToTypeNodeHelper(type.baseType, context);
+          const typeNode = typeToTypeNodeHelper(type.baseType, context);
+          const noInferSymbol = isNoInferType(type) && getGlobalTypeSymbol(
+            "NoInfer",
+            /*reportErrors*/
+            false
+          );
+          return noInferSymbol ? symbolToTypeNode(noInferSymbol, context, 788968 /* Type */, [typeNode]) : typeNode;
         }
         return Debug.fail("Should be unreachable.");
         function conditionalTypeToTypeNode(type2) {
@@ -50811,6 +51139,21 @@ ${lanes.join("\n")}
           const typeId = type2.id;
           const symbol = type2.symbol;
           if (symbol) {
+            const isInstantiationExpressionType = !!(getObjectFlags(type2) & 8388608 /* InstantiationExpressionType */);
+            if (isInstantiationExpressionType) {
+              const instantiationExpressionType = type2;
+              const existing = instantiationExpressionType.node;
+              if (isTypeQueryNode(existing) && getTypeFromTypeNode(existing) === type2) {
+                const typeNode = serializeExistingTypeNode(context, existing);
+                if (typeNode) {
+                  return typeNode;
+                }
+              }
+              if ((_a2 = context.visitedTypes) == null ? void 0 : _a2.has(typeId)) {
+                return createElidedInformationPlaceholder(context);
+              }
+              return visitAndTransformType(type2, createTypeNodeFromObjectType);
+            }
             const isInstanceType = isClassInstanceSide(type2) ? 788968 /* Type */ : 111551 /* Value */;
             if (isJSConstructor(symbol.valueDeclaration)) {
               return symbolToTypeNode(symbol, context, isInstanceType);
@@ -50822,7 +51165,7 @@ ${lanes.join("\n")}
               false
             ).accessibility !== 0 /* Accessible */)) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol()) {
               return symbolToTypeNode(symbol, context, isInstanceType);
-            } else if ((_a2 = context.visitedTypes) == null ? void 0 : _a2.has(typeId)) {
+            } else if ((_b2 = context.visitedTypes) == null ? void 0 : _b2.has(typeId)) {
               const typeAlias = getTypeAliasForTypeLiteral(type2);
               if (typeAlias) {
                 return symbolToTypeNode(typeAlias, context, 788968 /* Type */);
@@ -50833,20 +51176,6 @@ ${lanes.join("\n")}
               return visitAndTransformType(type2, createTypeNodeFromObjectType);
             }
           } else {
-            const isInstantiationExpressionType = !!(getObjectFlags(type2) & 8388608 /* InstantiationExpressionType */);
-            if (isInstantiationExpressionType) {
-              const instantiationExpressionType = type2;
-              if (isTypeQueryNode(instantiationExpressionType.node)) {
-                const typeNode = serializeExistingTypeNode(context, instantiationExpressionType.node);
-                if (typeNode) {
-                  return typeNode;
-                }
-              }
-              if ((_b2 = context.visitedTypes) == null ? void 0 : _b2.has(typeId)) {
-                return createElidedInformationPlaceholder(context);
-              }
-              return visitAndTransformType(type2, createTypeNodeFromObjectType);
-            }
             return createTypeNodeFromObjectType(type2);
           }
           function shouldWriteTypeOfFunctionSymbol() {
@@ -50924,7 +51253,13 @@ ${lanes.join("\n")}
             if (!nodeIsSynthesized(node) && getParseTreeNode(node) === node) {
               return node;
             }
-            return setTextRange(factory.cloneNode(visitEachChild(node, deepCloneOrReuseNode, nullTransformationContext, deepCloneOrReuseNodes)), node);
+            return setTextRange(factory.cloneNode(visitEachChild(
+              node,
+              deepCloneOrReuseNode,
+              /*context*/
+              void 0,
+              deepCloneOrReuseNodes
+            )), node);
           }
           function deepCloneOrReuseNodes(nodes, visitor, test, start, count) {
             if (nodes && nodes.length === 0) {
@@ -51403,36 +51738,65 @@ ${lanes.join("\n")}
           true
         )[0];
         let cleanup;
-        if (context.enclosingDeclaration && signature.declaration && signature.declaration !== context.enclosingDeclaration && !isInJSFile(signature.declaration) && some(expandedParams)) {
-          const existingFakeScope = getNodeLinks(context.enclosingDeclaration).fakeScopeForSignatureDeclaration ? context.enclosingDeclaration : void 0;
-          Debug.assertOptionalNode(existingFakeScope, isBlock);
-          const locals = (existingFakeScope == null ? void 0 : existingFakeScope.locals) ?? createSymbolTable();
-          let newLocals;
-          for (const param of expandedParams) {
-            if (!locals.has(param.escapedName)) {
-              newLocals = append(newLocals, param.escapedName);
-              locals.set(param.escapedName, param);
-            }
-          }
-          if (newLocals) {
-            let removeNewLocals2 = function() {
+        if (context.enclosingDeclaration && signature.declaration && signature.declaration !== context.enclosingDeclaration && !isInJSFile(signature.declaration) && (some(expandedParams) || some(signature.typeParameters))) {
+          let pushFakeScope2 = function(kind2, addAll) {
+            Debug.assert(context.enclosingDeclaration);
+            let existingFakeScope;
+            if (getNodeLinks(context.enclosingDeclaration).fakeScopeForSignatureDeclaration === kind2) {
+              existingFakeScope = context.enclosingDeclaration;
+            } else if (context.enclosingDeclaration.parent && getNodeLinks(context.enclosingDeclaration.parent).fakeScopeForSignatureDeclaration === kind2) {
+              existingFakeScope = context.enclosingDeclaration.parent;
+            }
+            Debug.assertOptionalNode(existingFakeScope, isBlock);
+            const locals = (existingFakeScope == null ? void 0 : existingFakeScope.locals) ?? createSymbolTable();
+            let newLocals;
+            addAll((name, symbol) => {
+              if (!locals.has(name)) {
+                newLocals = append(newLocals, name);
+                locals.set(name, symbol);
+              }
+            });
+            if (!newLocals)
+              return;
+            const oldCleanup = cleanup;
+            function undo() {
               forEach(newLocals, (s) => locals.delete(s));
-            };
-            var removeNewLocals = removeNewLocals2;
+              oldCleanup == null ? void 0 : oldCleanup();
+            }
             if (existingFakeScope) {
-              cleanup = removeNewLocals2;
+              cleanup = undo;
             } else {
               const fakeScope = parseNodeFactory.createBlock(emptyArray);
-              getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration = true;
+              getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration = kind2;
               fakeScope.locals = locals;
               const saveEnclosingDeclaration = context.enclosingDeclaration;
               setParent(fakeScope, saveEnclosingDeclaration);
               context.enclosingDeclaration = fakeScope;
               cleanup = () => {
                 context.enclosingDeclaration = saveEnclosingDeclaration;
-                removeNewLocals2();
+                undo();
               };
             }
+          };
+          var pushFakeScope = pushFakeScope2;
+          pushFakeScope2(
+            "params",
+            (add) => {
+              for (const param of expandedParams) {
+                add(param.escapedName, param);
+              }
+            }
+          );
+          if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */) {
+            pushFakeScope2(
+              "typeParams",
+              (add) => {
+                for (const typeParam of signature.typeParameters ?? emptyArray) {
+                  const typeParamName = typeParameterToName(typeParam, context).escapedText;
+                  add(typeParamName, typeParam.symbol);
+                }
+              }
+            );
           }
         }
         const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 176 /* Constructor */, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports));
@@ -51617,7 +51981,8 @@ ${lanes.join("\n")}
             let visited = visitEachChild(
               node2,
               elideInitializerAndSetEmitFlags,
-              nullTransformationContext,
+              /*context*/
+              void 0,
               /*nodesVisitor*/
               void 0,
               elideInitializerAndSetEmitFlags
@@ -51977,7 +52342,7 @@ ${lanes.join("\n")}
           return identifier;
         }
       }
-      function typeParameterShadowsNameInScope(escapedName, context, type) {
+      function typeParameterShadowsOtherTypeParameterInScope(escapedName, context, type) {
         const result = resolveName(
           context.enclosingDeclaration,
           escapedName,
@@ -51988,11 +52353,8 @@ ${lanes.join("\n")}
           /*isUse*/
           false
         );
-        if (result) {
-          if (result.flags & 262144 /* TypeParameter */ && result === type.symbol) {
-            return false;
-          }
-          return true;
+        if (result && result.flags & 262144 /* TypeParameter */) {
+          return result !== type.symbol;
         }
         return false;
       }
@@ -52018,7 +52380,7 @@ ${lanes.join("\n")}
           const rawtext = result.escapedText;
           let i = ((_a = context.typeParameterNamesByTextNextNameCount) == null ? void 0 : _a.get(rawtext)) || 0;
           let text = rawtext;
-          while (((_b = context.typeParameterNamesByText) == null ? void 0 : _b.has(text)) || typeParameterShadowsNameInScope(text, context, type)) {
+          while (((_b = context.typeParameterNamesByText) == null ? void 0 : _b.has(text)) || typeParameterShadowsOtherTypeParameterInScope(text, context, type)) {
             i++;
             text = `${rawtext}_${i}`;
           }
@@ -52029,7 +52391,7 @@ ${lanes.join("\n")}
           }
           (context.typeParameterNamesByTextNextNameCount || (context.typeParameterNamesByTextNextNameCount = /* @__PURE__ */ new Map())).set(rawtext, i);
           (context.typeParameterNames || (context.typeParameterNames = /* @__PURE__ */ new Map())).set(getTypeId(type), result);
-          (context.typeParameterNamesByText || (context.typeParameterNamesByText = /* @__PURE__ */ new Set())).add(rawtext);
+          (context.typeParameterNamesByText || (context.typeParameterNamesByText = /* @__PURE__ */ new Set())).add(text);
         }
         return result;
       }
@@ -52144,7 +52506,7 @@ ${lanes.join("\n")}
               return factory.createStringLiteral(name, !!singleQuote);
             }
             if (isNumericLiteralName(name) && startsWith(name, "-")) {
-              return factory.createComputedPropertyName(factory.createNumericLiteral(+name));
+              return factory.createComputedPropertyName(factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(-name)));
             }
             return createPropertyNameNodeForIdentifierOrLiteral(name, getEmitScriptTarget(compilerOptions), singleQuote, stringNamed, isMethod);
           }
@@ -52174,7 +52536,10 @@ ${lanes.join("\n")}
         return !(getObjectFlags(type) & 4 /* Reference */) || !isTypeReferenceNode(existing) || length(existing.typeArguments) >= getMinTypeArgumentCount(type.target.typeParameters);
       }
       function getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration) {
-        return getNodeLinks(enclosingDeclaration).fakeScopeForSignatureDeclaration ? enclosingDeclaration.parent : enclosingDeclaration;
+        while (getNodeLinks(enclosingDeclaration).fakeScopeForSignatureDeclaration) {
+          enclosingDeclaration = enclosingDeclaration.parent;
+        }
+        return enclosingDeclaration;
       }
       function serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) {
         if (!isErrorType(type) && enclosingDeclaration) {
@@ -52231,9 +52596,10 @@ ${lanes.join("\n")}
           introducesError = true;
           return { introducesError, node };
         }
+        const meaning = getMeaningOfEntityNameReference(node);
         const sym = resolveEntityName(
           leftmost,
-          67108863 /* All */,
+          meaning,
           /*ignoreErrors*/
           true,
           /*dontResolveAlias*/
@@ -52243,18 +52609,18 @@ ${lanes.join("\n")}
           if (isSymbolAccessible(
             sym,
             context.enclosingDeclaration,
-            67108863 /* All */,
+            meaning,
             /*shouldComputeAliasesToMakeVisible*/
             false
           ).accessibility !== 0 /* Accessible */) {
             introducesError = true;
           } else {
-            context.tracker.trackSymbol(sym, context.enclosingDeclaration, 67108863 /* All */);
+            context.tracker.trackSymbol(sym, context.enclosingDeclaration, meaning);
             includePrivateSymbol == null ? void 0 : includePrivateSymbol(sym);
           }
           if (isIdentifier(node)) {
             const type = getDeclaredTypeOfSymbol(sym);
-            const name = sym.flags & 262144 /* TypeParameter */ && !isTypeSymbolAccessible(type.symbol, context.enclosingDeclaration) ? typeParameterToName(type, context) : factory.cloneNode(node);
+            const name = sym.flags & 262144 /* TypeParameter */ ? typeParameterToName(type, context) : factory.cloneNode(node);
             name.symbol = sym;
             return { introducesError, node: setEmitFlags(setOriginalNode(name, node), 16777216 /* NoAsciiEscaping */) };
           }
@@ -52395,7 +52761,12 @@ ${lanes.join("\n")}
           if (file && isTupleTypeNode(node) && getLineAndCharacterOfPosition(file, node.pos).line === getLineAndCharacterOfPosition(file, node.end).line) {
             setEmitFlags(node, 1 /* SingleLine */);
           }
-          return visitEachChild(node, visitExistingNodeTreeSymbols, nullTransformationContext);
+          return visitEachChild(
+            node,
+            visitExistingNodeTreeSymbols,
+            /*context*/
+            void 0
+          );
           function getEffectiveDotDotDotForParameter(p) {
             return p.dotDotDotToken || (p.type && isJSDocVariadicType(p.type) ? factory.createToken(26 /* DotDotDotToken */) : void 0);
           }
@@ -52495,7 +52866,7 @@ ${lanes.join("\n")}
         });
         let addingDeclare = !bundled;
         const exportEquals = symbolTable.get("export=" /* ExportEquals */);
-        if (exportEquals && symbolTable.size > 1 && exportEquals.flags & 2097152 /* Alias */) {
+        if (exportEquals && symbolTable.size > 1 && exportEquals.flags & (2097152 /* Alias */ | 1536 /* Module */)) {
           symbolTable = createSymbolTable();
           symbolTable.set("export=" /* ExportEquals */, exportEquals);
         }
@@ -52952,8 +53323,18 @@ ${lanes.join("\n")}
           );
         }
         function getNamespaceMembersForSerialization(symbol) {
-          const exports = getExportsOfSymbol(symbol);
-          return !exports ? [] : filter(arrayFrom(exports.values()), (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
+          let exports = arrayFrom(getExportsOfSymbol(symbol).values());
+          const merged = getMergedSymbol(symbol);
+          if (merged !== symbol) {
+            const membersSet = new Set(exports);
+            for (const exported of getExportsOfSymbol(merged).values()) {
+              if (!(getSymbolFlags(resolveSymbol(exported)) & 111551 /* Value */)) {
+                membersSet.add(exported);
+              }
+            }
+            exports = arrayFrom(membersSet);
+          }
+          return filter(exports, (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
         }
         function isTypeOnlyNamespace(symbol) {
           return every(getNamespaceMembersForSerialization(symbol), (m) => !(getSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
@@ -53244,7 +53625,7 @@ ${lanes.join("\n")}
           });
         }
         function serializeAsAlias(symbol, localName, modifierFlags) {
-          var _a2, _b, _c, _d, _e;
+          var _a2, _b, _c, _d, _e, _f;
           const node = getDeclarationOfAliasSymbol(symbol);
           if (!node)
             return Debug.fail();
@@ -53346,7 +53727,7 @@ ${lanes.join("\n")}
                   isLocalImport ? symbolToName(
                     target,
                     context,
-                    67108863 /* All */,
+                    -1 /* All */,
                     /*expectsIdentifier*/
                     false
                   ) : factory.createExternalModuleReference(factory.createStringLiteral(getSpecifierForModuleSymbol(target, context)))
@@ -53442,6 +53823,9 @@ ${lanes.join("\n")}
             }
             case 281 /* ExportSpecifier */:
               const specifier = node.parent.parent.moduleSpecifier;
+              if (specifier && ((_f = node.propertyName) == null ? void 0 : _f.escapedText) === "default" /* Default */) {
+                verbatimTargetName = "default" /* Default */;
+              }
               serializeExportSpecifier(
                 unescapeLeadingUnderscores(symbol.escapedName),
                 specifier ? verbatimTargetName : targetName,
@@ -53502,7 +53886,7 @@ ${lanes.join("\n")}
             const first2 = expr && isEntityNameExpression(expr) ? getFirstNonModuleExportsIdentifier(expr) : void 0;
             const referenced = first2 && resolveEntityName(
               first2,
-              67108863 /* All */,
+              -1 /* All */,
               /*ignoreErrors*/
               true,
               /*dontResolveAlias*/
@@ -53519,7 +53903,7 @@ ${lanes.join("\n")}
                 /*modifiers*/
                 void 0,
                 isExportEquals,
-                symbolToExpression(target, context, 67108863 /* All */)
+                symbolToExpression(target, context, -1 /* All */)
               ));
             } else {
               if (first2 === expr && first2) {
@@ -53538,7 +53922,7 @@ ${lanes.join("\n")}
                     symbolToName(
                       target,
                       context,
-                      67108863 /* All */,
+                      -1 /* All */,
                       /*expectsIdentifier*/
                       false
                     )
@@ -54789,11 +55173,14 @@ ${lanes.join("\n")}
         }
       }
       if ((_a = symbol.parent) == null ? void 0 : _a.valueDeclaration) {
-        const typeNode2 = getEffectiveTypeAnnotationNode(symbol.parent.valueDeclaration);
-        if (typeNode2) {
-          const annotationSymbol = getPropertyOfType(getTypeFromTypeNode(typeNode2), symbol.escapedName);
-          if (annotationSymbol) {
-            return getNonMissingTypeOfSymbol(annotationSymbol);
+        const possiblyAnnotatedSymbol = getFunctionExpressionParentSymbolOrSymbol(symbol.parent);
+        if (possiblyAnnotatedSymbol.valueDeclaration) {
+          const typeNode2 = getEffectiveTypeAnnotationNode(possiblyAnnotatedSymbol.valueDeclaration);
+          if (typeNode2) {
+            const annotationSymbol = getPropertyOfType(getTypeFromTypeNode(typeNode2), symbol.escapedName);
+            if (annotationSymbol) {
+              return getNonMissingTypeOfSymbol(annotationSymbol);
+            }
           }
         }
       }
@@ -54928,7 +55315,7 @@ ${lanes.join("\n")}
           /*reportErrors*/
           false
         ) : unknownType;
-        return addOptionality(widenTypeInferredFromInitializer(element, checkDeclarationInitializer(element, 0 /* Normal */, contextualType)));
+        return addOptionality(widenTypeInferredFromInitializer(element, checkDeclarationInitializer(element, reportErrors2 ? 0 /* Normal */ : 1 /* Contextual */, contextualType)));
       }
       if (isBindingPattern(element.name)) {
         return getTypeFromBindingPattern(element.name, includePatternInType, reportErrors2);
@@ -55009,6 +55396,24 @@ ${lanes.join("\n")}
         0 /* Normal */
       ), declaration, reportErrors2);
     }
+    function getTypeFromImportAttributes(node) {
+      const links = getNodeLinks(node);
+      if (!links.resolvedType) {
+        const symbol = createSymbol(4096 /* ObjectLiteral */, "__importAttributes" /* ImportAttributes */);
+        const members = createSymbolTable();
+        forEach(node.elements, (attr) => {
+          const member = createSymbol(4 /* Property */, getNameFromImportAttribute(attr));
+          member.parent = symbol;
+          member.links.type = checkImportAttribute(attr);
+          member.links.target = member;
+          members.set(member.escapedName, member);
+        });
+        const type = createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray);
+        type.objectFlags |= 128 /* ObjectLiteral */ | 262144 /* NonInferrableType */;
+        links.resolvedType = type;
+      }
+      return links.resolvedType;
+    }
     function isGlobalSymbolConstructor(node) {
       const symbol = getSymbolOfNode(node);
       const globalSymbol = getGlobalESSymbolConstructorTypeSymbol(
@@ -55062,18 +55467,18 @@ ${lanes.join("\n")}
       }
       return false;
     }
-    function getTypeOfVariableOrParameterOrProperty(symbol) {
+    function getTypeOfVariableOrParameterOrProperty(symbol, checkMode) {
       const links = getSymbolLinks(symbol);
       if (!links.type) {
-        const type = getTypeOfVariableOrParameterOrPropertyWorker(symbol);
-        if (!links.type && !isParameterOfContextSensitiveSignature(symbol)) {
+        const type = getTypeOfVariableOrParameterOrPropertyWorker(symbol, checkMode);
+        if (!links.type && !isParameterOfContextSensitiveSignature(symbol) && !checkMode) {
           links.type = type;
         }
         return type;
       }
       return links.type;
     }
-    function getTypeOfVariableOrParameterOrPropertyWorker(symbol) {
+    function getTypeOfVariableOrParameterOrPropertyWorker(symbol, checkMode) {
       if (symbol.flags & 4194304 /* Prototype */) {
         return getTypeOfPrototypeProperty(symbol);
       }
@@ -55111,6 +55516,9 @@ ${lanes.join("\n")}
         if (symbol.flags & 512 /* ValueModule */ && !(symbol.flags & 67108864 /* Assignment */)) {
           return getTypeOfFuncClassEnumModule(symbol);
         }
+        if (isBindingElement(declaration) && checkMode === 1 /* Contextual */) {
+          return errorType;
+        }
         return reportCircularityError(symbol);
       }
       let type;
@@ -55148,6 +55556,9 @@ ${lanes.join("\n")}
         if (symbol.flags & 512 /* ValueModule */ && !(symbol.flags & 67108864 /* Assignment */)) {
           return getTypeOfFuncClassEnumModule(symbol);
         }
+        if (isBindingElement(declaration) && checkMode === 1 /* Contextual */) {
+          return type;
+        }
         return reportCircularityError(symbol);
       }
       return type;
@@ -55376,7 +55787,7 @@ ${lanes.join("\n")}
       }
       return getTypeOfSymbol(symbol);
     }
-    function getTypeOfSymbol(symbol) {
+    function getTypeOfSymbol(symbol, checkMode) {
       const checkFlags = getCheckFlags(symbol);
       if (checkFlags & 65536 /* DeferredType */) {
         return getTypeOfSymbolWithDeferredType(symbol);
@@ -55391,7 +55802,7 @@ ${lanes.join("\n")}
         return getTypeOfReverseMappedSymbol(symbol);
       }
       if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) {
-        return getTypeOfVariableOrParameterOrProperty(symbol);
+        return getTypeOfVariableOrParameterOrProperty(symbol, checkMode);
       }
       if (symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) {
         return getTypeOfFuncClassEnumModule(symbol);
@@ -56093,7 +56504,6 @@ ${lanes.join("\n")}
       return links.resolvedSymbol;
     }
     function getResolvedMembersOrExportsOfSymbol(symbol, resolutionKind) {
-      var _a, _b, _c;
       const links = getSymbolLinks(symbol);
       if (!links[resolutionKind]) {
         const isStatic2 = resolutionKind === "resolvedExports" /* resolvedExports */;
@@ -56112,7 +56522,7 @@ ${lanes.join("\n")}
             }
           }
         }
-        const assignments = (((_a = symbol.valueDeclaration) == null ? void 0 : _a.kind) === 219 /* ArrowFunction */ || ((_b = symbol.valueDeclaration) == null ? void 0 : _b.kind) === 218 /* FunctionExpression */) && ((_c = getSymbolOfNode(symbol.valueDeclaration.parent)) == null ? void 0 : _c.assignmentDeclarationMembers) || symbol.assignmentDeclarationMembers;
+        const assignments = getFunctionExpressionParentSymbolOrSymbol(symbol).assignmentDeclarationMembers;
         if (assignments) {
           const decls = arrayFrom(assignments.values());
           for (const member of decls) {
@@ -56205,11 +56615,10 @@ ${lanes.join("\n")}
       const baseTypes = getBaseTypes(source);
       if (baseTypes.length) {
         if (source.symbol && members === getMembersOfSymbol(source.symbol)) {
-          const symbolTable = createSymbolTable();
-          for (const symbol of members.values()) {
-            if (!(symbol.flags & 262144 /* TypeParameter */)) {
-              symbolTable.set(symbol.escapedName, symbol);
-            }
+          const symbolTable = createSymbolTable(source.declaredProperties);
+          const sourceIndex = getIndexSymbol(source.symbol);
+          if (sourceIndex) {
+            symbolTable.set("__index" /* Index */, sourceIndex);
           }
           members = symbolTable;
         }
@@ -56409,6 +56818,15 @@ ${lanes.join("\n")}
       let result;
       for (let i = 0; i < signatureLists.length; i++) {
         const match = i === listIndex ? signature : findMatchingSignature(
+          signatureLists[i],
+          signature,
+          /*partialMatch*/
+          false,
+          /*ignoreThisTypes*/
+          false,
+          /*ignoreReturnTypes*/
+          true
+        ) || findMatchingSignature(
           signatureLists[i],
           signature,
           /*partialMatch*/
@@ -56573,6 +56991,8 @@ ${lanes.join("\n")}
       result.compositeSignatures = concatenate(left.compositeKind !== 2097152 /* Intersection */ && left.compositeSignatures || [left], [right]);
       if (paramMapper) {
         result.mapper = left.compositeKind !== 2097152 /* Intersection */ && left.mapper && left.compositeSignatures ? combineTypeMappers(left.mapper, paramMapper) : paramMapper;
+      } else if (left.compositeKind !== 2097152 /* Intersection */ && left.mapper && left.compositeSignatures) {
+        result.mapper = left.mapper;
       }
       return result;
     }
@@ -56782,6 +57202,18 @@ ${lanes.join("\n")}
     function replaceIndexedAccess(instantiable, type, replacement) {
       return instantiateType(instantiable, createTypeMapper([type.indexType, type.objectType], [getNumberLiteralType(0), createTupleType([replacement])]));
     }
+    function getLimitedConstraint(type) {
+      const constraint = getConstraintTypeFromMappedType(type.mappedType);
+      if (!(constraint.flags & 1048576 /* Union */ || constraint.flags & 2097152 /* Intersection */)) {
+        return;
+      }
+      const origin = constraint.flags & 1048576 /* Union */ ? constraint.origin : constraint;
+      if (!origin || !(origin.flags & 2097152 /* Intersection */)) {
+        return;
+      }
+      const limitedConstraint = getIntersectionType(origin.types.filter((t) => t !== type.constraintType));
+      return limitedConstraint !== neverType ? limitedConstraint : void 0;
+    }
     function resolveReverseMappedTypeMembers(type) {
       const indexInfo = getIndexInfoOfType(type.source, stringType);
       const modifiers = getMappedTypeModifiers(type.mappedType);
@@ -56789,7 +57221,14 @@ ${lanes.join("\n")}
       const optionalMask = modifiers & 4 /* IncludeOptional */ ? 0 : 16777216 /* Optional */;
       const indexInfos = indexInfo ? [createIndexInfo(stringType, inferReverseMappedType(indexInfo.type, type.mappedType, type.constraintType), readonlyMask && indexInfo.isReadonly)] : emptyArray;
       const members = createSymbolTable();
+      const limitedConstraint = getLimitedConstraint(type);
       for (const prop of getPropertiesOfType(type.source)) {
+        if (limitedConstraint) {
+          const propertyNameType = getLiteralTypeFromProperty(prop, 8576 /* StringOrNumberLiteralOrUnique */);
+          if (!isTypeAssignableTo(propertyNameType, limitedConstraint)) {
+            continue;
+          }
+        }
         const checkFlags = 8192 /* ReverseMapped */ | (readonlyMask && isReadonlySymbol(prop) ? 8 /* Readonly */ : 0);
         const inferredProp = createSymbol(4 /* Property */ | prop.flags & optionalMask, prop.escapedName, checkFlags);
         inferredProp.declarations = prop.declarations;
@@ -56818,7 +57257,12 @@ ${lanes.join("\n")}
           const checkType = type.checkType;
           const constraint = getLowerBoundOfKeyType(checkType);
           if (constraint !== checkType) {
-            return getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper));
+            return getConditionalTypeInstantiation(
+              type,
+              prependTypeMapping(type.root.checkType, constraint, type.mapper),
+              /*forConstraint*/
+              false
+            );
           }
         }
         return type;
@@ -56865,7 +57309,7 @@ ${lanes.join("\n")}
       const constraintType = getConstraintTypeFromMappedType(type);
       const mappedType = type.target || type;
       const nameType = getNameTypeFromMappedType(mappedType);
-      const shouldLinkPropDeclarations = !nameType || isFilteringMappedType(mappedType);
+      const shouldLinkPropDeclarations = getMappedTypeNameTypeKind(mappedType) !== 2 /* Remapping */;
       const templateType = getTemplateTypeFromMappedType(mappedType);
       const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
       const templateModifiers = getMappedTypeModifiers(type);
@@ -57007,9 +57451,12 @@ ${lanes.join("\n")}
       }
       return false;
     }
-    function isFilteringMappedType(type) {
+    function getMappedTypeNameTypeKind(type) {
       const nameType = getNameTypeFromMappedType(type);
-      return !!nameType && isTypeAssignableTo(nameType, getTypeParameterFromMappedType(type));
+      if (!nameType) {
+        return 0 /* None */;
+      }
+      return isTypeAssignableTo(nameType, getTypeParameterFromMappedType(type)) ? 1 /* Filtering */ : 2 /* Remapping */;
     }
     function resolveStructuredTypeMembers(type) {
       if (!type.members) {
@@ -57058,7 +57505,12 @@ ${lanes.join("\n")}
         for (const current of type.types) {
           for (const prop of getPropertiesOfType(current)) {
             if (!members.has(prop.escapedName)) {
-              const combinedProp = getPropertyOfUnionOrIntersectionType(type, prop.escapedName);
+              const combinedProp = getPropertyOfUnionOrIntersectionType(
+                type,
+                prop.escapedName,
+                /*skipObjectFunctionPropertyAugment*/
+                !!(type.flags & 2097152 /* Intersection */)
+              );
               if (combinedProp) {
                 members.set(prop.escapedName, combinedProp);
               }
@@ -57118,9 +57570,13 @@ ${lanes.join("\n")}
     function getConstraintOfTypeParameter(typeParameter) {
       return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : void 0;
     }
+    function isConstMappedType(type, depth) {
+      const typeVariable = getHomomorphicTypeVariable(type);
+      return !!typeVariable && isConstTypeVariable(typeVariable, depth);
+    }
     function isConstTypeVariable(type, depth = 0) {
       var _a;
-      return depth < 5 && !!(type && (type.flags & 262144 /* TypeParameter */ && some((_a = type.symbol) == null ? void 0 : _a.declarations, (d) => hasSyntacticModifier(d, 4096 /* Const */)) || type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, (t) => isConstTypeVariable(t, depth)) || type.flags & 8388608 /* IndexedAccess */ && isConstTypeVariable(type.objectType, depth + 1) || type.flags & 16777216 /* Conditional */ && isConstTypeVariable(getConstraintOfConditionalType(type), depth + 1) || type.flags & 33554432 /* Substitution */ && isConstTypeVariable(type.baseType, depth) || isGenericTupleType(type) && findIndex(getElementTypes(type), (t, i) => !!(type.target.elementFlags[i] & 8 /* Variadic */) && isConstTypeVariable(t, depth)) >= 0));
+      return depth < 5 && !!(type && (type.flags & 262144 /* TypeParameter */ && some((_a = type.symbol) == null ? void 0 : _a.declarations, (d) => hasSyntacticModifier(d, 4096 /* Const */)) || type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, (t) => isConstTypeVariable(t, depth)) || type.flags & 8388608 /* IndexedAccess */ && isConstTypeVariable(type.objectType, depth + 1) || type.flags & 16777216 /* Conditional */ && isConstTypeVariable(getConstraintOfConditionalType(type), depth + 1) || type.flags & 33554432 /* Substitution */ && isConstTypeVariable(type.baseType, depth) || getObjectFlags(type) & 32 /* Mapped */ && isConstMappedType(type, depth) || isGenericTupleType(type) && findIndex(getElementTypes(type), (t, i) => !!(type.target.elementFlags[i] & 8 /* Variadic */) && isConstTypeVariable(t, depth)) >= 0));
     }
     function getConstraintOfIndexedAccess(type) {
       return hasNonCircularBaseConstraint(type) ? getConstraintFromIndexedAccess(type) : void 0;
@@ -57134,7 +57590,7 @@ ${lanes.join("\n")}
       return simplified !== type ? simplified : getConstraintOfType(type);
     }
     function getConstraintFromIndexedAccess(type) {
-      if (isMappedTypeGenericIndexedAccess(type) || isGenericMappedType(type.objectType)) {
+      if (isMappedTypeGenericIndexedAccess(type)) {
         return substituteIndexedMappedType(type.objectType, type.indexType);
       }
       const indexConstraint = getSimplifiedTypeOrConstraint(type.indexType);
@@ -57170,7 +57626,12 @@ ${lanes.join("\n")}
         );
         const constraint = simplified === type.checkType ? getConstraintOfType(simplified) : simplified;
         if (constraint && constraint !== type.checkType) {
-          const instantiated = getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper));
+          const instantiated = getConditionalTypeInstantiation(
+            type,
+            prependTypeMapping(type.root.checkType, constraint, type.mapper),
+            /*forConstraint*/
+            true
+          );
           if (!(instantiated.flags & 131072 /* Never */)) {
             type.resolvedConstraintOfDistributive = instantiated;
             return instantiated;
@@ -57379,15 +57840,20 @@ ${lanes.join("\n")}
       return type.resolvedApparentType || (type.resolvedApparentType = getResolvedApparentTypeOfMappedType(type));
     }
     function getResolvedApparentTypeOfMappedType(type) {
-      const typeVariable = getHomomorphicTypeVariable(type);
-      if (typeVariable && !type.declaration.nameType) {
-        const constraint = getConstraintOfTypeParameter(typeVariable);
-        if (constraint && everyType(constraint, isArrayOrTupleType)) {
-          return instantiateType(type, prependTypeMapping(typeVariable, constraint, type.mapper));
+      const target = type.target ?? type;
+      const typeVariable = getHomomorphicTypeVariable(target);
+      if (typeVariable && !target.declaration.nameType) {
+        const modifiersType = getModifiersTypeFromMappedType(type);
+        const baseConstraint = isGenericMappedType(modifiersType) ? getApparentTypeOfMappedType(modifiersType) : getBaseConstraintOfType(modifiersType);
+        if (baseConstraint && everyType(baseConstraint, (t) => isArrayOrTupleType(t) || isArrayOrTupleOrIntersection(t))) {
+          return instantiateType(target, prependTypeMapping(typeVariable, baseConstraint, type.mapper));
         }
       }
       return type;
     }
+    function isArrayOrTupleOrIntersection(type) {
+      return !!(type.flags & 2097152 /* Intersection */) && every(type.types, isArrayOrTupleType);
+    }
     function isMappedTypeGenericIndexedAccess(type) {
       let objectType;
       return !!(type.flags & 8388608 /* IndexedAccess */ && getObjectFlags(objectType = type.objectType) & 32 /* Mapped */ && !isGenericMappedType(objectType) && isGenericIndexType(type.indexType) && !(getMappedTypeModifiers(objectType) & 8 /* ExcludeOptional */) && !objectType.declaration.nameType);
@@ -57474,6 +57940,7 @@ ${lanes.join("\n")}
           clone2.parent = (_c = (_b = singleProp.valueDeclaration) == null ? void 0 : _b.symbol) == null ? void 0 : _c.parent;
           clone2.links.containingType = containingType;
           clone2.links.mapper = links == null ? void 0 : links.mapper;
+          clone2.links.writeType = getWriteTypeOfSymbol(singleProp);
           return clone2;
         } else {
           return singleProp;
@@ -57539,13 +58006,17 @@ ${lanes.join("\n")}
       return result;
     }
     function getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment) {
-      var _a, _b;
-      let property = ((_a = type.propertyCacheWithoutObjectFunctionPropertyAugment) == null ? void 0 : _a.get(name)) || !skipObjectFunctionPropertyAugment ? (_b = type.propertyCache) == null ? void 0 : _b.get(name) : void 0;
+      var _a, _b, _c;
+      let property = skipObjectFunctionPropertyAugment ? (_a = type.propertyCacheWithoutObjectFunctionPropertyAugment) == null ? void 0 : _a.get(name) : (_b = type.propertyCache) == null ? void 0 : _b.get(name);
       if (!property) {
         property = createUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);
         if (property) {
           const properties = skipObjectFunctionPropertyAugment ? type.propertyCacheWithoutObjectFunctionPropertyAugment || (type.propertyCacheWithoutObjectFunctionPropertyAugment = createSymbolTable()) : type.propertyCache || (type.propertyCache = createSymbolTable());
           properties.set(name, property);
+          if (skipObjectFunctionPropertyAugment && !(getCheckFlags(property) & 48 /* Partial */) && !((_c = type.propertyCache) == null ? void 0 : _c.get(name))) {
+            const properties2 = type.propertyCache || (type.propertyCache = createSymbolTable());
+            properties2.set(name, property);
+          }
         }
       }
       return property;
@@ -57637,10 +58108,14 @@ ${lanes.join("\n")}
       return errorInfo;
     }
     function getPropertyOfType(type, name, skipObjectFunctionPropertyAugment, includeTypeOnlyMembers) {
+      var _a, _b;
       type = getReducedApparentType(type);
       if (type.flags & 524288 /* Object */) {
         const resolved = resolveStructuredTypeMembers(type);
         const symbol = resolved.members.get(name);
+        if (symbol && !includeTypeOnlyMembers && ((_a = type.symbol) == null ? void 0 : _a.flags) & 512 /* ValueModule */ && ((_b = getSymbolLinks(type.symbol).typeOnlyExportStarMap) == null ? void 0 : _b.has(name))) {
+          return void 0;
+        }
         if (symbol && symbolIsValue(symbol, includeTypeOnlyMembers)) {
           return symbol;
         }
@@ -57655,7 +58130,22 @@ ${lanes.join("\n")}
         }
         return getPropertyOfObjectType(globalObjectType, name);
       }
-      if (type.flags & 3145728 /* UnionOrIntersection */) {
+      if (type.flags & 2097152 /* Intersection */) {
+        const prop = getPropertyOfUnionOrIntersectionType(
+          type,
+          name,
+          /*skipObjectFunctionPropertyAugment*/
+          true
+        );
+        if (prop) {
+          return prop;
+        }
+        if (!skipObjectFunctionPropertyAugment) {
+          return getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment);
+        }
+        return void 0;
+      }
+      if (type.flags & 1048576 /* Union */) {
         return getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment);
       }
       return void 0;
@@ -57840,6 +58330,7 @@ ${lanes.join("\n")}
         let flags = 0 /* None */;
         let minArgumentCount = 0;
         let thisParameter;
+        let thisTag = isInJSFile(declaration) ? getJSDocThisTag(declaration) : void 0;
         let hasThisParameter2 = false;
         const iife = getImmediatelyInvokedFunctionExpression(declaration);
         const isJSConstructSignature = isJSDocConstructSignature(declaration);
@@ -57849,6 +58340,10 @@ ${lanes.join("\n")}
         }
         for (let i = isJSConstructSignature ? 1 : 0; i < declaration.parameters.length; i++) {
           const param = declaration.parameters[i];
+          if (isInJSFile(param) && isJSDocThisTag(param)) {
+            thisTag = param;
+            continue;
+          }
           let paramSymbol = param.symbol;
           const type = isJSDocParameterTag(param) ? param.typeExpression && param.typeExpression.type : param.type;
           if (paramSymbol && !!(paramSymbol.flags & 4 /* Property */) && !isBindingPattern(param.name)) {
@@ -57886,11 +58381,8 @@ ${lanes.join("\n")}
             thisParameter = getAnnotatedAccessorThisParameter(other);
           }
         }
-        if (isInJSFile(declaration)) {
-          const thisTag = getJSDocThisTag(declaration);
-          if (thisTag && thisTag.typeExpression) {
-            thisParameter = createSymbolWithType(createSymbol(1 /* FunctionScopedVariable */, "this" /* This */), getTypeFromTypeNode(thisTag.typeExpression));
-          }
+        if (thisTag && thisTag.typeExpression) {
+          thisParameter = createSymbolWithType(createSymbol(1 /* FunctionScopedVariable */, "this" /* This */), getTypeFromTypeNode(thisTag.typeExpression));
         }
         const hostDeclaration = isJSDocSignature(declaration) ? getEffectiveJSDocHost(declaration) : declaration;
         const classType = hostDeclaration && isConstructorDeclaration(hostDeclaration) ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(hostDeclaration.parent.symbol)) : void 0;
@@ -58001,22 +58493,15 @@ ${lanes.join("\n")}
           }
         }
         if (isInJSFile(decl) && decl.jsDoc) {
-          let hasJSDocOverloads = false;
-          for (const node of decl.jsDoc) {
-            if (node.tags) {
-              for (const tag of node.tags) {
-                if (isJSDocOverloadTag(tag)) {
-                  const jsDocSignature = tag.typeExpression;
-                  if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) {
-                    reportImplicitAny(jsDocSignature, anyType);
-                  }
-                  result.push(getSignatureFromDeclaration(jsDocSignature));
-                  hasJSDocOverloads = true;
-                }
+          const tags = getJSDocOverloadTags(decl);
+          if (length(tags)) {
+            for (const tag of tags) {
+              const jsDocSignature = tag.typeExpression;
+              if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) {
+                reportImplicitAny(jsDocSignature, anyType);
               }
+              result.push(getSignatureFromDeclaration(jsDocSignature));
             }
-          }
-          if (hasJSDocOverloads) {
             continue;
           }
         }
@@ -58488,8 +58973,11 @@ ${lanes.join("\n")}
     }
     function getTypeAliasInstantiation(symbol, typeArguments, aliasSymbol, aliasTypeArguments) {
       const type = getDeclaredTypeOfSymbol(symbol);
-      if (type === intrinsicMarkerType && intrinsicTypeKinds.has(symbol.escapedName) && typeArguments && typeArguments.length === 1) {
-        return getStringMappingType(symbol, typeArguments[0]);
+      if (type === intrinsicMarkerType) {
+        const typeKind = intrinsicTypeKinds.get(symbol.escapedName);
+        if (typeKind !== void 0 && typeArguments && typeArguments.length === 1) {
+          return typeKind === 4 /* NoInfer */ ? getNoInferType(typeArguments[0]) : getStringMappingType(symbol, typeArguments[0]);
+        }
       }
       const links = getSymbolLinks(symbol);
       const typeParameters = links.typeParameters;
@@ -58643,10 +59131,19 @@ ${lanes.join("\n")}
       }
       return links.resolvedJSDocType;
     }
+    function getNoInferType(type) {
+      return isNoInferTargetType(type) ? getOrCreateSubstitutionType(type, unknownType) : type;
+    }
+    function isNoInferTargetType(type) {
+      return !!(type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, isNoInferTargetType) || type.flags & 33554432 /* Substitution */ && !isNoInferType(type) && isNoInferTargetType(type.baseType) || type.flags & 524288 /* Object */ && !isEmptyAnonymousObjectType(type) || type.flags & (465829888 /* Instantiable */ & ~33554432 /* Substitution */) && !isPatternLiteralType(type));
+    }
+    function isNoInferType(type) {
+      return !!(type.flags & 33554432 /* Substitution */ && type.constraint.flags & 2 /* Unknown */);
+    }
     function getSubstitutionType(baseType, constraint) {
-      if (constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType || baseType.flags & 1 /* Any */) {
-        return baseType;
-      }
+      return constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType || baseType.flags & 1 /* Any */ ? baseType : getOrCreateSubstitutionType(baseType, constraint);
+    }
+    function getOrCreateSubstitutionType(baseType, constraint) {
       const id = `${getTypeId(baseType)}>${getTypeId(constraint)}`;
       const cached = substitutionTypes.get(id);
       if (cached) {
@@ -58659,7 +59156,7 @@ ${lanes.join("\n")}
       return result;
     }
     function getSubstitutionIntersection(substitutionType) {
-      return getIntersectionType([substitutionType.constraint, substitutionType.baseType]);
+      return isNoInferType(substitutionType) ? substitutionType.baseType : getIntersectionType([substitutionType.constraint, substitutionType.baseType]);
     }
     function isUnaryTupleTypeNode(node) {
       return node.kind === 189 /* TupleType */ && node.elements.length === 1;
@@ -58680,7 +59177,7 @@ ${lanes.join("\n")}
           if (constraint) {
             constraints = append(constraints, constraint);
           }
-        } else if (type.flags & 262144 /* TypeParameter */ && parent2.kind === 200 /* MappedType */ && node === parent2.type) {
+        } else if (type.flags & 262144 /* TypeParameter */ && parent2.kind === 200 /* MappedType */ && !parent2.nameType && node === parent2.type) {
           const mappedType = getTypeFromTypeNode(parent2);
           if (getTypeParameterFromMappedType(mappedType) === getActualTypeVariable(type)) {
             const typeParameter = getHomomorphicTypeVariable(mappedType);
@@ -58928,6 +59425,14 @@ ${lanes.join("\n")}
         reportErrors2
       )) || emptyObjectType;
     }
+    function getGlobalImportAttributesType(reportErrors2) {
+      return deferredGlobalImportAttributesType || (deferredGlobalImportAttributesType = getGlobalType(
+        "ImportAttributes",
+        /*arity*/
+        0,
+        reportErrors2
+      )) || emptyObjectType;
+    }
     function getGlobalESSymbolConstructorSymbol(reportErrors2) {
       return deferredGlobalESSymbolConstructorSymbol || (deferredGlobalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol", reportErrors2));
     }
@@ -59383,7 +59888,7 @@ ${lanes.join("\n")}
       return target.objectFlags & 8 /* Tuple */ ? createNormalizedTupleType(target, typeArguments) : createTypeReference(target, typeArguments);
     }
     function createNormalizedTupleType(target, elementTypes) {
-      var _a, _b, _c;
+      var _a, _b, _c, _d;
       if (!(target.combinedFlags & 14 /* NonRequired */)) {
         return createTypeReference(target, elementTypes);
       }
@@ -59403,8 +59908,10 @@ ${lanes.join("\n")}
         const type = elementTypes[i];
         const flags = target.elementFlags[i];
         if (flags & 8 /* Variadic */) {
-          if (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type)) {
-            addElement(type, 8 /* Variadic */, (_a = target.labeledElementDeclarations) == null ? void 0 : _a[i]);
+          if (type.flags & 1 /* Any */) {
+            addElement(type, 4 /* Rest */, (_a = target.labeledElementDeclarations) == null ? void 0 : _a[i]);
+          } else if (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type)) {
+            addElement(type, 8 /* Variadic */, (_b = target.labeledElementDeclarations) == null ? void 0 : _b[i]);
           } else if (isTupleType(type)) {
             const elements = getElementTypes(type);
             if (elements.length + expandedTypes.length >= 1e4) {
@@ -59419,10 +59926,10 @@ ${lanes.join("\n")}
               return addElement(t, type.target.elementFlags[n], (_a2 = type.target.labeledElementDeclarations) == null ? void 0 : _a2[n]);
             });
           } else {
-            addElement(isArrayLikeType(type) && getIndexTypeOfType(type, numberType) || errorType, 4 /* Rest */, (_b = target.labeledElementDeclarations) == null ? void 0 : _b[i]);
+            addElement(isArrayLikeType(type) && getIndexTypeOfType(type, numberType) || errorType, 4 /* Rest */, (_c = target.labeledElementDeclarations) == null ? void 0 : _c[i]);
           }
         } else {
-          addElement(type, flags, (_c = target.labeledElementDeclarations) == null ? void 0 : _c[i]);
+          addElement(type, flags, (_d = target.labeledElementDeclarations) == null ? void 0 : _d[i]);
         }
       }
       for (let i = 0; i < lastRequiredIndex; i++) {
@@ -59512,6 +60019,8 @@ ${lanes.join("\n")}
         includes |= flags & 473694207 /* IncludesMask */;
         if (flags & 465829888 /* Instantiable */)
           includes |= 33554432 /* IncludesInstantiable */;
+        if (flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */)
+          includes |= 536870912 /* IncludesConstrainedTypeVariable */;
         if (type === wildcardType)
           includes |= 8388608 /* IncludesWildcard */;
         if (!strictNullChecks && flags & 98304 /* Nullable */) {
@@ -59604,18 +60113,56 @@ ${lanes.join("\n")}
       }
     }
     function removeStringLiteralsMatchedByTemplateLiterals(types) {
-      const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
+      const templates = filter(types, isPatternLiteralType);
       if (templates.length) {
         let i = types.length;
         while (i > 0) {
           i--;
           const t = types[i];
-          if (t.flags & 128 /* StringLiteral */ && some(templates, (template) => isTypeMatchedByTemplateLiteralType(t, template))) {
+          if (t.flags & 128 /* StringLiteral */ && some(templates, (template) => isTypeMatchedByTemplateLiteralOrStringMapping(t, template))) {
             orderedRemoveItemAt(types, i);
           }
         }
       }
     }
+    function isTypeMatchedByTemplateLiteralOrStringMapping(type, template) {
+      return template.flags & 134217728 /* TemplateLiteral */ ? isTypeMatchedByTemplateLiteralType(type, template) : isMemberOfStringMapping(type, template);
+    }
+    function removeConstrainedTypeVariables(types) {
+      const typeVariables = [];
+      for (const type of types) {
+        if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) {
+          const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
+          pushIfUnique(typeVariables, type.types[index]);
+        }
+      }
+      for (const typeVariable of typeVariables) {
+        const primitives = [];
+        for (const type of types) {
+          if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) {
+            const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
+            if (type.types[index] === typeVariable) {
+              insertType(primitives, type.types[1 - index]);
+            }
+          }
+        }
+        const constraint = getBaseConstraintOfType(typeVariable);
+        if (everyType(constraint, (t) => containsType(primitives, t))) {
+          let i = types.length;
+          while (i > 0) {
+            i--;
+            const type = types[i];
+            if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) {
+              const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
+              if (type.types[index] === typeVariable && containsType(primitives, type.types[1 - index])) {
+                orderedRemoveItemAt(types, i);
+              }
+            }
+          }
+          insertType(types, typeVariable);
+        }
+      }
+    }
     function isNamedUnionType(type) {
       return !!(type.flags & 1048576 /* Union */ && (type.aliasSymbol || type.origin));
     }
@@ -59678,9 +60225,12 @@ ${lanes.join("\n")}
         if (includes & (32 /* Enum */ | 2944 /* Literal */ | 8192 /* UniqueESSymbol */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) {
           removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2 /* Subtype */));
         }
-        if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) {
+        if (includes & 128 /* StringLiteral */ && includes & (134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)) {
           removeStringLiteralsMatchedByTemplateLiterals(typeSet);
         }
+        if (includes & 536870912 /* IncludesConstrainedTypeVariable */) {
+          removeConstrainedTypeVariables(typeSet);
+        }
         if (unionReduction === 2 /* Subtype */) {
           typeSet = removeSubtypes(typeSet, !!(includes & 524288 /* Object */));
           if (!typeSet) {
@@ -59842,7 +60392,7 @@ ${lanes.join("\n")}
       while (i > 0) {
         i--;
         const t = types[i];
-        if (!(t.flags & 134217728 /* TemplateLiteral */))
+        if (!(t.flags & (134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)))
           continue;
         for (const t2 of literals) {
           if (isTypeSubtypeOf(t2, t)) {
@@ -59893,9 +60443,9 @@ ${lanes.join("\n")}
       types[index] = getUnionTypeFromSortedList(result, 32768 /* PrimitiveUnion */);
       return true;
     }
-    function createIntersectionType(types, aliasSymbol, aliasTypeArguments) {
+    function createIntersectionType(types, objectFlags, aliasSymbol, aliasTypeArguments) {
       const result = createType(2097152 /* Intersection */);
-      result.objectFlags = getPropagatingFlagsOfTypes(
+      result.objectFlags = objectFlags | getPropagatingFlagsOfTypes(
         types,
         /*excludeKinds*/
         98304 /* Nullable */
@@ -59909,13 +60459,14 @@ ${lanes.join("\n")}
       const typeMembershipMap = /* @__PURE__ */ new Map();
       const includes = addTypesToIntersection(typeMembershipMap, 0, types);
       const typeSet = arrayFrom(typeMembershipMap.values());
+      let objectFlags = 0 /* None */;
       if (includes & 131072 /* Never */) {
         return contains(typeSet, silentNeverType) ? silentNeverType : neverType;
       }
       if (strictNullChecks && includes & 98304 /* Nullable */ && includes & (524288 /* Object */ | 67108864 /* NonPrimitive */ | 16777216 /* IncludesEmptyObject */) || includes & 67108864 /* NonPrimitive */ && includes & (469892092 /* DisjointDomains */ & ~67108864 /* NonPrimitive */) || includes & 402653316 /* StringLike */ && includes & (469892092 /* DisjointDomains */ & ~402653316 /* StringLike */) || includes & 296 /* NumberLike */ && includes & (469892092 /* DisjointDomains */ & ~296 /* NumberLike */) || includes & 2112 /* BigIntLike */ && includes & (469892092 /* DisjointDomains */ & ~2112 /* BigIntLike */) || includes & 12288 /* ESSymbolLike */ && includes & (469892092 /* DisjointDomains */ & ~12288 /* ESSymbolLike */) || includes & 49152 /* VoidLike */ && includes & (469892092 /* DisjointDomains */ & ~49152 /* VoidLike */)) {
         return neverType;
       }
-      if (includes & 134217728 /* TemplateLiteral */ && includes & 128 /* StringLiteral */ && extractRedundantTemplateLiterals(typeSet)) {
+      if (includes & (134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && includes & 128 /* StringLiteral */ && extractRedundantTemplateLiterals(typeSet)) {
         return neverType;
       }
       if (includes & 1 /* Any */) {
@@ -59937,6 +60488,25 @@ ${lanes.join("\n")}
       if (typeSet.length === 1) {
         return typeSet[0];
       }
+      if (typeSet.length === 2) {
+        const typeVarIndex = typeSet[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
+        const typeVariable = typeSet[typeVarIndex];
+        const primitiveType = typeSet[1 - typeVarIndex];
+        if (typeVariable.flags & 8650752 /* TypeVariable */ && (primitiveType.flags & (402784252 /* Primitive */ | 67108864 /* NonPrimitive */) && !isGenericStringLikeType(primitiveType) || includes & 16777216 /* IncludesEmptyObject */)) {
+          const constraint = getBaseConstraintOfType(typeVariable);
+          if (constraint && everyType(constraint, (t) => !!(t.flags & (402784252 /* Primitive */ | 67108864 /* NonPrimitive */)) || isEmptyAnonymousObjectType(t))) {
+            if (isTypeStrictSubtypeOf(constraint, primitiveType)) {
+              return typeVariable;
+            }
+            if (!(constraint.flags & 1048576 /* Union */ && someType(constraint, (c) => isTypeStrictSubtypeOf(c, primitiveType)))) {
+              if (!isTypeStrictSubtypeOf(primitiveType, constraint)) {
+                return neverType;
+              }
+            }
+            objectFlags = 67108864 /* IsConstrainedTypeVariable */;
+          }
+        }
+      }
       const id = getTypeListId(typeSet) + getAliasId(aliasSymbol, aliasTypeArguments);
       let result = intersectionTypes.get(id);
       if (!result) {
@@ -59950,6 +60520,9 @@ ${lanes.join("\n")}
           } else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && (t.types[0].flags & 65536 /* Null */ || t.types[1].flags & 65536 /* Null */)))) {
             removeFromEach(typeSet, 65536 /* Null */);
             result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
+          } else if (typeSet.length >= 4) {
+            const middle = Math.floor(typeSet.length / 2);
+            result = getIntersectionType([getIntersectionType(typeSet.slice(0, middle)), getIntersectionType(typeSet.slice(middle))], aliasSymbol, aliasTypeArguments);
           } else {
             if (!checkCrossProductUnion(typeSet)) {
               return errorType;
@@ -59959,7 +60532,7 @@ ${lanes.join("\n")}
             result = getUnionType(constituents, 1 /* Literal */, aliasSymbol, aliasTypeArguments, origin);
           }
         } else {
-          result = createIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
+          result = createIntersectionType(typeSet, objectFlags, aliasSymbol, aliasTypeArguments);
         }
         intersectionTypes.set(id, result);
       }
@@ -60038,19 +60611,17 @@ ${lanes.join("\n")}
         return constraintType;
       }
       const keyTypes = [];
-      if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
-        if (!isGenericIndexType(constraintType)) {
-          const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
-          forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576 /* StringOrNumberLiteralOrUnique */, !!(indexFlags & 1 /* StringsOnly */), addMemberForKeyType);
-        } else {
+      if (isGenericIndexType(constraintType)) {
+        if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
           return getIndexTypeForGenericType(type, indexFlags);
         }
+        forEachType(constraintType, addMemberForKeyType);
+      } else if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
+        const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
+        forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576 /* StringOrNumberLiteralOrUnique */, !!(indexFlags & 1 /* StringsOnly */), addMemberForKeyType);
       } else {
         forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType);
       }
-      if (isGenericIndexType(constraintType)) {
-        forEachType(constraintType, addMemberForKeyType);
-      }
       const result = indexFlags & 2 /* NoIndexSignatures */ ? filterType(getUnionType(keyTypes), (t) => !(t.flags & (1 /* Any */ | 4 /* String */))) : getUnionType(keyTypes);
       if (result.flags & 1048576 /* Union */ && constraintType.flags & 1048576 /* Union */ && getTypeListId(result.types) === getTypeListId(constraintType.types)) {
         return constraintType;
@@ -60118,11 +60689,11 @@ ${lanes.join("\n")}
       );
     }
     function shouldDeferIndexType(type, indexFlags = 0 /* None */) {
-      return !!(type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericTupleType(type) || isGenericMappedType(type) && !hasDistributiveNameType(type) || type.flags & 1048576 /* Union */ && !(indexFlags & 4 /* NoReducibleCheck */) && isGenericReducibleType(type) || type.flags & 2097152 /* Intersection */ && maybeTypeOfKind(type, 465829888 /* Instantiable */) && some(type.types, isEmptyAnonymousObjectType));
+      return !!(type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericTupleType(type) || isGenericMappedType(type) && (!hasDistributiveNameType(type) || getMappedTypeNameTypeKind(type) === 2 /* Remapping */) || type.flags & 1048576 /* Union */ && !(indexFlags & 4 /* NoReducibleCheck */) && isGenericReducibleType(type) || type.flags & 2097152 /* Intersection */ && maybeTypeOfKind(type, 465829888 /* Instantiable */) && some(type.types, isEmptyAnonymousObjectType));
     }
     function getIndexType(type, indexFlags = defaultIndexFlags) {
       type = getReducedType(type);
-      return shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, indexFlags))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, indexFlags))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, indexFlags) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? keyofConstraintType : getLiteralTypeFromProperties(type, (indexFlags & 2 /* NoIndexSignatures */ ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (indexFlags & 1 /* StringsOnly */ ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */), indexFlags === defaultIndexFlags);
+      return isNoInferType(type) ? getNoInferType(getIndexType(type.baseType, indexFlags)) : shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, indexFlags))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, indexFlags))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, indexFlags) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? keyofConstraintType : getLiteralTypeFromProperties(type, (indexFlags & 2 /* NoIndexSignatures */ ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (indexFlags & 1 /* StringsOnly */ ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */), indexFlags === defaultIndexFlags);
     }
     function getExtractStringType(type) {
       if (keyofStringsOnly) {
@@ -60532,6 +61103,9 @@ ${lanes.join("\n")}
     function isPatternLiteralType(type) {
       return !!(type.flags & 134217728 /* TemplateLiteral */) && every(type.types, isPatternLiteralPlaceholderType) || !!(type.flags & 268435456 /* StringMapping */) && isPatternLiteralPlaceholderType(type.type);
     }
+    function isGenericStringLikeType(type) {
+      return !!(type.flags & (134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)) && !isPatternLiteralType(type);
+    }
     function isGenericType(type) {
       return !!getGenericObjectFlags(type);
     }
@@ -60554,7 +61128,7 @@ ${lanes.join("\n")}
         }
         return type.objectFlags & 12582912 /* IsGenericType */;
       }
-      return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
+      return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */) || isGenericStringLikeType(type) ? 8388608 /* IsGenericIndexType */ : 0);
     }
     function getSimplifiedType(type, writing) {
       return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
@@ -60602,7 +61176,7 @@ ${lanes.join("\n")}
         }
       }
       if (isGenericMappedType(objectType)) {
-        if (!getNameTypeFromMappedType(objectType) || isFilteringMappedType(objectType)) {
+        if (getMappedTypeNameTypeKind(objectType) !== 2 /* Remapping */) {
           return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), (t) => getSimplifiedType(t, writing));
         }
       }
@@ -60725,17 +61299,13 @@ ${lanes.join("\n")}
       }
       return type;
     }
-    function maybeCloneTypeParameter(p) {
-      const constraint = getConstraintOfTypeParameter(p);
-      return constraint && (isGenericObjectType(constraint) || isGenericIndexType(constraint)) ? cloneTypeParameter(p) : p;
-    }
     function isSimpleTupleType(node) {
       return isTupleTypeNode(node) && length(node.elements) > 0 && !some(node.elements, (e) => isOptionalTypeNode(e) || isRestTypeNode(e) || isNamedTupleMember(e) && !!(e.questionToken || e.dotDotDotToken));
     }
     function isDeferredType(type, checkTuples) {
       return isGenericType(type) || checkTuples && isTupleType(type) && some(getElementTypes(type), isGenericType);
     }
-    function getConditionalType(root, mapper, aliasSymbol, aliasTypeArguments) {
+    function getConditionalType(root, mapper, forConstraint, aliasSymbol, aliasTypeArguments) {
       let result;
       let extraTypes;
       let tailCount = 0;
@@ -60752,36 +61322,30 @@ ${lanes.join("\n")}
         if (checkType === wildcardType || extendsType === wildcardType) {
           return wildcardType;
         }
-        const checkTuples = isSimpleTupleType(root.node.checkType) && isSimpleTupleType(root.node.extendsType) && length(root.node.checkType.elements) === length(root.node.extendsType.elements);
+        const checkTypeNode = skipTypeParentheses(root.node.checkType);
+        const extendsTypeNode = skipTypeParentheses(root.node.extendsType);
+        const checkTuples = isSimpleTupleType(checkTypeNode) && isSimpleTupleType(extendsTypeNode) && length(checkTypeNode.elements) === length(extendsTypeNode.elements);
         const checkTypeDeferred = isDeferredType(checkType, checkTuples);
         let combinedMapper;
         if (root.inferTypeParameters) {
-          const freshParams = sameMap(root.inferTypeParameters, maybeCloneTypeParameter);
-          const freshMapper = freshParams !== root.inferTypeParameters ? createTypeMapper(root.inferTypeParameters, freshParams) : void 0;
           const context = createInferenceContext(
-            freshParams,
+            root.inferTypeParameters,
             /*signature*/
             void 0,
             0 /* None */
           );
-          if (freshMapper) {
-            const freshCombinedMapper = combineTypeMappers(mapper, freshMapper);
-            for (let i = 0; i < freshParams.length; i++) {
-              if (freshParams[i] !== root.inferTypeParameters[i]) {
-                freshParams[i].mapper = freshCombinedMapper;
-              }
-            }
+          if (mapper) {
+            context.nonFixingMapper = combineTypeMappers(context.nonFixingMapper, mapper);
           }
           if (!checkTypeDeferred) {
-            inferTypes(context.inferences, checkType, instantiateType(extendsType, freshMapper), 512 /* NoConstraints */ | 1024 /* AlwaysStrict */);
+            inferTypes(context.inferences, checkType, extendsType, 512 /* NoConstraints */ | 1024 /* AlwaysStrict */);
           }
-          const innerMapper = combineTypeMappers(freshMapper, context.mapper);
-          combinedMapper = mapper ? combineTypeMappers(innerMapper, mapper) : innerMapper;
+          combinedMapper = mapper ? combineTypeMappers(context.mapper, mapper) : context.mapper;
         }
         const inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType;
         if (!checkTypeDeferred && !isDeferredType(inferredExtendsType, checkTuples)) {
           if (!(inferredExtendsType.flags & 3 /* AnyOrUnknown */) && (checkType.flags & 1 /* Any */ || !isTypeAssignableTo(getPermissiveInstantiation(checkType), getPermissiveInstantiation(inferredExtendsType)))) {
-            if (checkType.flags & 1 /* Any */) {
+            if (checkType.flags & 1 /* Any */ || forConstraint && !(inferredExtendsType.flags & 131072 /* Never */) && someType(getPermissiveInstantiation(inferredExtendsType), (t) => isTypeAssignableTo(t, getPermissiveInstantiation(checkType)))) {
               (extraTypes || (extraTypes = [])).push(instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper));
             }
             const falseType2 = getTypeFromTypeNode(root.node.falseType);
@@ -60891,7 +61455,9 @@ ${lanes.join("\n")}
         links.resolvedType = getConditionalType(
           root,
           /*mapper*/
-          void 0
+          void 0,
+          /*forConstraint*/
+          false
         );
         if (outerTypeParameters) {
           root.instantiations = /* @__PURE__ */ new Map();
@@ -61211,6 +61777,12 @@ ${lanes.join("\n")}
       return type;
     }
     function getESSymbolLikeTypeForNode(node) {
+      if (isInJSFile(node) && isJSDocTypeExpression(node)) {
+        const host2 = getJSDocHost(node);
+        if (host2) {
+          node = getSingleVariableOfVariableStatement(host2) || host2;
+        }
+      }
       if (isValidESSymbolDeclaration(node)) {
         const symbol = isCommonJsExportPropertyAssignment(node) ? getSymbolOfNode(node.left) : getSymbolOfNode(node);
         if (symbol) {
@@ -61655,47 +62227,44 @@ ${lanes.join("\n")}
       if (typeVariable) {
         const mappedTypeVariable = instantiateType(typeVariable, mapper);
         if (typeVariable !== mappedTypeVariable) {
-          return mapTypeWithAlias(
-            getReducedType(mappedTypeVariable),
-            (t) => {
-              if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && !isErrorType(t)) {
-                if (!type.declaration.nameType) {
-                  let constraint;
-                  if (isArrayType(t) || t.flags & 1 /* Any */ && findResolutionCycleStartIndex(typeVariable, 4 /* ImmediateBaseConstraint */) < 0 && (constraint = getConstraintOfTypeParameter(typeVariable)) && everyType(constraint, isArrayOrTupleType)) {
-                    return instantiateMappedArrayType(t, type, prependTypeMapping(typeVariable, t, mapper));
-                  }
-                  if (isGenericTupleType(t)) {
-                    return instantiateMappedGenericTupleType(t, type, typeVariable, mapper);
-                  }
-                  if (isTupleType(t)) {
-                    return instantiateMappedTupleType(t, type, prependTypeMapping(typeVariable, t, mapper));
-                  }
-                }
-                return instantiateAnonymousType(type, prependTypeMapping(typeVariable, t, mapper));
-              }
-              return t;
-            },
-            aliasSymbol,
-            aliasTypeArguments
-          );
+          return mapTypeWithAlias(getReducedType(mappedTypeVariable), instantiateConstituent, aliasSymbol, aliasTypeArguments);
         }
       }
       return instantiateType(getConstraintTypeFromMappedType(type), mapper) === wildcardType ? wildcardType : instantiateAnonymousType(type, mapper, aliasSymbol, aliasTypeArguments);
+      function instantiateConstituent(t) {
+        if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && !isErrorType(t)) {
+          if (!type.declaration.nameType) {
+            let constraint;
+            if (isArrayType(t) || t.flags & 1 /* Any */ && findResolutionCycleStartIndex(typeVariable, 4 /* ImmediateBaseConstraint */) < 0 && (constraint = getConstraintOfTypeParameter(typeVariable)) && everyType(constraint, isArrayOrTupleType)) {
+              return instantiateMappedArrayType(t, type, prependTypeMapping(typeVariable, t, mapper));
+            }
+            if (isTupleType(t)) {
+              return instantiateMappedTupleType(t, type, typeVariable, mapper);
+            }
+            if (isArrayOrTupleOrIntersection(t)) {
+              return getIntersectionType(map(t.types, instantiateConstituent));
+            }
+          }
+          return instantiateAnonymousType(type, prependTypeMapping(typeVariable, t, mapper));
+        }
+        return t;
+      }
     }
     function getModifiedReadonlyState(state, modifiers) {
       return modifiers & 1 /* IncludeReadonly */ ? true : modifiers & 2 /* ExcludeReadonly */ ? false : state;
     }
-    function instantiateMappedGenericTupleType(tupleType, mappedType, typeVariable, mapper) {
+    function instantiateMappedTupleType(tupleType, mappedType, typeVariable, mapper) {
       const elementFlags = tupleType.target.elementFlags;
-      const elementTypes = map(getElementTypes(tupleType), (t, i) => {
-        const singleton = elementFlags[i] & 8 /* Variadic */ ? t : elementFlags[i] & 4 /* Rest */ ? createArrayType(t) : createTupleType([t], [elementFlags[i]]);
-        if (singleton === typeVariable) {
-          return mappedType;
-        }
-        return instantiateMappedType(mappedType, prependTypeMapping(typeVariable, singleton, mapper));
+      const fixedLength = tupleType.target.fixedLength;
+      const fixedMapper = fixedLength ? prependTypeMapping(typeVariable, tupleType, mapper) : mapper;
+      const newElementTypes = map(getElementTypes(tupleType), (type, i) => {
+        const flags = elementFlags[i];
+        return i < fixedLength ? instantiateMappedTypeTemplate(mappedType, getStringLiteralType("" + i), !!(flags & 2 /* Optional */), fixedMapper) : flags & 8 /* Variadic */ ? instantiateType(mappedType, prependTypeMapping(typeVariable, type, mapper)) : getElementTypeOfArrayType(instantiateType(mappedType, prependTypeMapping(typeVariable, createArrayType(type), mapper))) ?? unknownType;
       });
+      const modifiers = getMappedTypeModifiers(mappedType);
+      const newElementFlags = modifiers & 4 /* IncludeOptional */ ? map(elementFlags, (f) => f & 1 /* Required */ ? 2 /* Optional */ : f) : modifiers & 8 /* ExcludeOptional */ ? map(elementFlags, (f) => f & 2 /* Optional */ ? 1 /* Required */ : f) : elementFlags;
       const newReadonly = getModifiedReadonlyState(tupleType.target.readonly, getMappedTypeModifiers(mappedType));
-      return createTupleType(elementTypes, map(elementTypes, (_) => 8 /* Variadic */), newReadonly);
+      return contains(newElementTypes, errorType) ? errorType : createTupleType(newElementTypes, newElementFlags, newReadonly, tupleType.target.labeledElementDeclarations);
     }
     function instantiateMappedArrayType(arrayType, mappedType, mapper) {
       const elementType = instantiateMappedTypeTemplate(
@@ -61707,14 +62276,6 @@ ${lanes.join("\n")}
       );
       return isErrorType(elementType) ? errorType : createArrayType(elementType, getModifiedReadonlyState(isReadonlyArrayType(arrayType), getMappedTypeModifiers(mappedType)));
     }
-    function instantiateMappedTupleType(tupleType, mappedType, mapper) {
-      const elementFlags = tupleType.target.elementFlags;
-      const elementTypes = map(getElementTypes(tupleType), (_, i) => instantiateMappedTypeTemplate(mappedType, getStringLiteralType("" + i), !!(elementFlags[i] & 2 /* Optional */), mapper));
-      const modifiers = getMappedTypeModifiers(mappedType);
-      const newTupleModifiers = modifiers & 4 /* IncludeOptional */ ? map(elementFlags, (f) => f & 1 /* Required */ ? 2 /* Optional */ : f) : modifiers & 8 /* ExcludeOptional */ ? map(elementFlags, (f) => f & 2 /* Optional */ ? 1 /* Required */ : f) : elementFlags;
-      const newReadonly = getModifiedReadonlyState(tupleType.target.readonly, modifiers);
-      return contains(elementTypes, errorType) ? errorType : createTupleType(elementTypes, newTupleModifiers, newReadonly, tupleType.target.labeledElementDeclarations);
-    }
     function instantiateMappedTypeTemplate(type, key, isOptional, mapper) {
       const templateMapper = appendTypeMapping(mapper, getTypeParameterFromMappedType(type), key);
       const propType = instantiateType(getTemplateTypeFromMappedType(type.target || type), templateMapper);
@@ -61726,6 +62287,7 @@ ${lanes.join("\n")}
       ) : strictNullChecks && modifiers & 8 /* ExcludeOptional */ && isOptional ? getTypeWithFacts(propType, 524288 /* NEUndefined */) : propType;
     }
     function instantiateAnonymousType(type, mapper, aliasSymbol, aliasTypeArguments) {
+      Debug.assert(type.symbol, "anonymous type must have symbol to be instantiated");
       const result = createObjectType(type.objectFlags & ~(524288 /* CouldContainTypeVariablesComputed */ | 1048576 /* CouldContainTypeVariables */) | 64 /* Instantiated */, type.symbol);
       if (type.objectFlags & 32 /* Mapped */) {
         result.declaration = type.declaration;
@@ -61745,17 +62307,17 @@ ${lanes.join("\n")}
       result.objectFlags |= result.aliasTypeArguments ? getPropagatingFlagsOfTypes(result.aliasTypeArguments) : 0;
       return result;
     }
-    function getConditionalTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {
+    function getConditionalTypeInstantiation(type, mapper, forConstraint, aliasSymbol, aliasTypeArguments) {
       const root = type.root;
       if (root.outerTypeParameters) {
         const typeArguments = map(root.outerTypeParameters, (t) => getMappedType(t, mapper));
-        const id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
+        const id = (forConstraint ? "C" : "") + getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
         let result = root.instantiations.get(id);
         if (!result) {
           const newMapper = createTypeMapper(root.outerTypeParameters, typeArguments);
           const checkType = root.checkType;
-          const distributionType = root.isDistributive ? getMappedType(checkType, newMapper) : void 0;
-          result = distributionType && checkType !== distributionType && distributionType.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapTypeWithAlias(getReducedType(distributionType), (t) => getConditionalType(root, prependTypeMapping(checkType, t, newMapper)), aliasSymbol, aliasTypeArguments) : getConditionalType(root, newMapper, aliasSymbol, aliasTypeArguments);
+          const distributionType = root.isDistributive ? getReducedType(getMappedType(checkType, newMapper)) : void 0;
+          result = distributionType && checkType !== distributionType && distributionType.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapTypeWithAlias(distributionType, (t) => getConditionalType(root, prependTypeMapping(checkType, t, newMapper), forConstraint), aliasSymbol, aliasTypeArguments) : getConditionalType(root, newMapper, forConstraint, aliasSymbol, aliasTypeArguments);
           root.instantiations.set(id, result);
         }
         return result;
@@ -61843,10 +62405,20 @@ ${lanes.join("\n")}
         );
       }
       if (flags & 16777216 /* Conditional */) {
-        return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper), aliasSymbol, aliasTypeArguments);
+        return getConditionalTypeInstantiation(
+          type,
+          combineTypeMappers(type.mapper, mapper),
+          /*forConstraint*/
+          false,
+          aliasSymbol,
+          aliasTypeArguments
+        );
       }
       if (flags & 33554432 /* Substitution */) {
         const newBaseType = instantiateType(type.baseType, mapper);
+        if (isNoInferType(type)) {
+          return getNoInferType(newBaseType);
+        }
         const newConstraint = instantiateType(type.constraint, mapper);
         if (newBaseType.flags & 8650752 /* TypeVariable */ && isGenericType(newConstraint)) {
           return getSubstitutionType(newBaseType, newConstraint);
@@ -62475,7 +63047,8 @@ ${lanes.join("\n")}
         if (isOmittedExpression(elem))
           continue;
         const nameType = getNumberLiteralType(i);
-        yield { errorNode: elem, innerExpression: elem, nameType };
+        const checkNode = getEffectiveCheckNode(elem);
+        yield { errorNode: checkNode, innerExpression: checkNode, nameType };
       }
     }
     function elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer) {
@@ -62618,11 +63191,11 @@ ${lanes.join("\n")}
       const paramCount = sourceRestType || targetRestType ? Math.min(sourceCount, targetCount) : Math.max(sourceCount, targetCount);
       const restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1;
       for (let i = 0; i < paramCount; i++) {
-        const sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i);
-        const targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
+        const sourceType = i === restIndex ? getRestOrAnyTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i);
+        const targetType = i === restIndex ? getRestOrAnyTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
         if (sourceType && targetType) {
-          const sourceSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
-          const targetSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(targetType));
+          const sourceSig = checkMode & 3 /* Callback */ || isInstantiatedGenericParameter(source, i) ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
+          const targetSig = checkMode & 3 /* Callback */ || isInstantiatedGenericParameter(target, i) ? void 0 : getSingleCallSignature(getNonNullableType(targetType));
           const callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) && getTypeFacts(sourceType, 50331648 /* IsUndefinedOrNull */) === getTypeFacts(targetType, 50331648 /* IsUndefinedOrNull */);
           let related = callbacks ? compareSignaturesRelated(targetSig, sourceSig, checkMode & 8 /* StrictArity */ | (strictVariance ? 2 /* StrictCallback */ : 1 /* BivariantCallback */), reportErrors2, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) : !(checkMode & 3 /* Callback */) && !strictVariance && compareTypes(
             sourceType,
@@ -62756,12 +63329,12 @@ ${lanes.join("\n")}
         return !!(entry & 1 /* Succeeded */);
       }
       const targetEnumType = getTypeOfSymbol(targetSymbol);
-      for (const property of getPropertiesOfType(getTypeOfSymbol(sourceSymbol))) {
-        if (property.flags & 8 /* EnumMember */) {
-          const targetProperty = getPropertyOfType(targetEnumType, property.escapedName);
+      for (const sourceProperty of getPropertiesOfType(getTypeOfSymbol(sourceSymbol))) {
+        if (sourceProperty.flags & 8 /* EnumMember */) {
+          const targetProperty = getPropertyOfType(targetEnumType, sourceProperty.escapedName);
           if (!targetProperty || !(targetProperty.flags & 8 /* EnumMember */)) {
             if (errorReporter) {
-              errorReporter(Diagnostics.Property_0_is_missing_in_type_1, symbolName(property), typeToString(
+              errorReporter(Diagnostics.Property_0_is_missing_in_type_1, symbolName(sourceProperty), typeToString(
                 getDeclaredTypeOfSymbol(targetSymbol),
                 /*enclosingDeclaration*/
                 void 0,
@@ -62773,6 +63346,35 @@ ${lanes.join("\n")}
             }
             return false;
           }
+          const sourceValue = getEnumMemberValue(getDeclarationOfKind(sourceProperty, 306 /* EnumMember */));
+          const targetValue = getEnumMemberValue(getDeclarationOfKind(targetProperty, 306 /* EnumMember */));
+          if (sourceValue !== targetValue) {
+            const sourceIsString = typeof sourceValue === "string";
+            const targetIsString = typeof targetValue === "string";
+            if (sourceValue !== void 0 && targetValue !== void 0) {
+              if (!errorReporter) {
+                enumRelation.set(id, 2 /* Failed */);
+              } else {
+                const escapedSource = sourceIsString ? `"${escapeString(sourceValue)}"` : sourceValue;
+                const escapedTarget = targetIsString ? `"${escapeString(targetValue)}"` : targetValue;
+                errorReporter(Diagnostics.Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given, symbolName(targetSymbol), symbolName(targetProperty), escapedTarget, escapedSource);
+                enumRelation.set(id, 2 /* Failed */ | 4 /* Reported */);
+              }
+              return false;
+            }
+            if (sourceIsString || targetIsString) {
+              if (!errorReporter) {
+                enumRelation.set(id, 2 /* Failed */);
+              } else {
+                const knownStringValue = sourceValue ?? targetValue;
+                Debug.assert(typeof knownStringValue === "string");
+                const escapedValue = `"${escapeString(knownStringValue)}"`;
+                errorReporter(Diagnostics.One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value, symbolName(targetSymbol), symbolName(targetProperty), escapedValue);
+                enumRelation.set(id, 2 /* Failed */ | 4 /* Reported */);
+              }
+              return false;
+            }
+          }
         }
       }
       enumRelation.set(id, 1 /* Succeeded */);
@@ -63487,7 +64089,7 @@ ${lanes.join("\n")}
           return relation === comparableRelation ? someTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 402784252 /* Primitive */), intersectionState) : eachTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 402784252 /* Primitive */), intersectionState);
         }
         if (target2.flags & 1048576 /* Union */) {
-          return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source2), target2, reportErrors2 && !(source2.flags & 402784252 /* Primitive */) && !(target2.flags & 402784252 /* Primitive */));
+          return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source2), target2, reportErrors2 && !(source2.flags & 402784252 /* Primitive */) && !(target2.flags & 402784252 /* Primitive */), intersectionState);
         }
         if (target2.flags & 2097152 /* Intersection */) {
           return typeRelatedToEachType(source2, target2, reportErrors2, 2 /* Target */);
@@ -63532,7 +64134,8 @@ ${lanes.join("\n")}
             sourceType,
             target2,
             /*reportErrors*/
-            false
+            false,
+            0 /* None */
           );
           if (!related) {
             return 0 /* False */;
@@ -63541,7 +64144,7 @@ ${lanes.join("\n")}
         }
         return result2;
       }
-      function typeRelatedToSomeType(source2, target2, reportErrors2) {
+      function typeRelatedToSomeType(source2, target2, reportErrors2, intersectionState) {
         const targetTypes = target2.types;
         if (target2.flags & 1048576 /* Union */) {
           if (containsType(targetTypes, source2)) {
@@ -63559,7 +64162,10 @@ ${lanes.join("\n")}
               match,
               2 /* Target */,
               /*reportErrors*/
-              false
+              false,
+              /*headMessage*/
+              void 0,
+              intersectionState
             );
             if (related) {
               return related;
@@ -63572,7 +64178,10 @@ ${lanes.join("\n")}
             type,
             2 /* Target */,
             /*reportErrors*/
-            false
+            false,
+            /*headMessage*/
+            void 0,
+            intersectionState
           );
           if (related) {
             return related;
@@ -63586,7 +64195,10 @@ ${lanes.join("\n")}
               bestMatchingType,
               2 /* Target */,
               /*reportErrors*/
-              true
+              true,
+              /*headMessage*/
+              void 0,
+              intersectionState
             );
           }
         }
@@ -63970,6 +64582,18 @@ ${lanes.join("\n")}
         }
         return result2;
       }
+      function getApparentMappedTypeKeys(nameType, targetType) {
+        const modifiersType = getApparentType(getModifiersTypeFromMappedType(targetType));
+        const mappedKeys = [];
+        forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(
+          modifiersType,
+          8576 /* StringOrNumberLiteralOrUnique */,
+          /*stringsOnly*/
+          false,
+          (t) => void mappedKeys.push(instantiateType(nameType, appendTypeMapping(targetType.mapper, getTypeParameterFromMappedType(targetType), t)))
+        );
+        return getUnionType(mappedKeys);
+      }
       function structuredTypeRelatedToWorker(source2, target2, reportErrors2, intersectionState, saveErrorInfo) {
         let result2;
         let originalErrorInfo;
@@ -64108,7 +64732,7 @@ ${lanes.join("\n")}
           }
           if (relation === comparableRelation && sourceFlags & 262144 /* TypeParameter */) {
             let constraint = getConstraintOfTypeParameter(source2);
-            if (constraint && hasNonCircularBaseConstraint(source2)) {
+            if (constraint) {
               while (constraint && someType(constraint, (c) => !!(c.flags & 262144 /* TypeParameter */))) {
                 if (result2 = isRelatedTo(
                   constraint,
@@ -64152,16 +64776,8 @@ ${lanes.join("\n")}
               const constraintType = getConstraintTypeFromMappedType(targetType);
               let targetKeys;
               if (nameType && isMappedTypeWithKeyofConstraintDeclaration(targetType)) {
-                const modifiersType = getApparentType(getModifiersTypeFromMappedType(targetType));
-                const mappedKeys = [];
-                forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(
-                  modifiersType,
-                  8576 /* StringOrNumberLiteralOrUnique */,
-                  /*stringsOnly*/
-                  false,
-                  (t) => void mappedKeys.push(instantiateType(nameType, appendTypeMapping(targetType.mapper, getTypeParameterFromMappedType(targetType), t)))
-                );
-                targetKeys = getUnionType([...mappedKeys, nameType]);
+                const mappedKeys = getApparentMappedTypeKeys(nameType, targetType);
+                targetKeys = getUnionType([mappedKeys, nameType]);
               } else {
                 targetKeys = nameType || constraintType;
               }
@@ -64332,9 +64948,18 @@ ${lanes.join("\n")}
             }
           }
         } else if (sourceFlags & 4194304 /* Index */) {
-          if (result2 = isRelatedTo(keyofConstraintType, target2, 1 /* Source */, reportErrors2)) {
+          const isDeferredMappedIndex = shouldDeferIndexType(source2.type, source2.indexFlags) && getObjectFlags(source2.type) & 32 /* Mapped */;
+          if (result2 = isRelatedTo(keyofConstraintType, target2, 1 /* Source */, reportErrors2 && !isDeferredMappedIndex)) {
             return result2;
           }
+          if (isDeferredMappedIndex) {
+            const mappedType = source2.type;
+            const nameType = getNameTypeFromMappedType(mappedType);
+            const sourceMappedKeys = nameType && isMappedTypeWithKeyofConstraintDeclaration(mappedType) ? getApparentMappedTypeKeys(nameType, mappedType) : nameType || getConstraintTypeFromMappedType(mappedType);
+            if (result2 = isRelatedTo(sourceMappedKeys, target2, 1 /* Source */, reportErrors2)) {
+              return result2;
+            }
+          }
         } else if (sourceFlags & 134217728 /* TemplateLiteral */ && !(targetFlags & 524288 /* Object */)) {
           if (!(targetFlags & 134217728 /* TemplateLiteral */)) {
             const constraint = getBaseConstraintOfType(source2);
@@ -64384,13 +65009,6 @@ ${lanes.join("\n")}
                 return result2;
               }
             }
-          } else {
-            const distributiveConstraint = hasNonCircularBaseConstraint(source2) ? getConstraintOfDistributiveConditionalType(source2) : void 0;
-            if (distributiveConstraint) {
-              if (result2 = isRelatedTo(distributiveConstraint, target2, 1 /* Source */, reportErrors2)) {
-                return result2;
-              }
-            }
           }
           const defaultConstraint = getDefaultConstraintOfConditionalType(source2);
           if (defaultConstraint) {
@@ -64398,6 +65016,13 @@ ${lanes.join("\n")}
               return result2;
             }
           }
+          const distributiveConstraint = !(targetFlags & 16777216 /* Conditional */) && hasNonCircularBaseConstraint(source2) ? getConstraintOfDistributiveConditionalType(source2) : void 0;
+          if (distributiveConstraint) {
+            resetErrorInfo(saveErrorInfo);
+            if (result2 = isRelatedTo(distributiveConstraint, target2, 1 /* Source */, reportErrors2)) {
+              return result2;
+            }
+          }
         } else {
           if (relation !== subtypeRelation && relation !== strictSubtypeRelation && isPartialMappedType(target2) && isEmptyObjectType(source2)) {
             return -1 /* True */;
@@ -64973,6 +65598,7 @@ ${lanes.join("\n")}
         const sourceObjectFlags = getObjectFlags(source2);
         const targetObjectFlags = getObjectFlags(target2);
         if (sourceObjectFlags & 64 /* Instantiated */ && targetObjectFlags & 64 /* Instantiated */ && source2.symbol === target2.symbol || sourceObjectFlags & 4 /* Reference */ && targetObjectFlags & 4 /* Reference */ && source2.target === target2.target) {
+          Debug.assertEqual(sourceSignatures.length, targetSignatures.length);
           for (let i = 0; i < targetSignatures.length; i++) {
             const related = signatureRelatedTo(
               sourceSignatures[i],
@@ -66489,12 +67115,12 @@ ${lanes.join("\n")}
       return false;
     }
     function isValidTypeForTemplateLiteralPlaceholder(source, target) {
-      if (source === target || target.flags & (1 /* Any */ | 4 /* String */)) {
-        return true;
-      }
       if (target.flags & 2097152 /* Intersection */) {
         return every(target.types, (t) => t === emptyTypeLiteralType || isValidTypeForTemplateLiteralPlaceholder(source, t));
       }
+      if (target.flags & 4 /* String */ || isTypeAssignableTo(source, target)) {
+        return true;
+      }
       if (source.flags & 128 /* StringLiteral */) {
         const value = source.value;
         return !!(target.flags & 8 /* Number */ && isValidNumberString(
@@ -66511,7 +67137,7 @@ ${lanes.join("\n")}
         const texts = source.texts;
         return texts.length === 2 && texts[0] === "" && texts[1] === "" && isTypeAssignableTo(source.types[0], target);
       }
-      return isTypeAssignableTo(source, target);
+      return false;
     }
     function inferTypesFromTemplateLiteralType(source, target) {
       return source.flags & 128 /* StringLiteral */ ? inferFromLiteralPartsToTemplateLiteral([source.value], emptyArray, target) : source.flags & 134217728 /* TemplateLiteral */ ? arraysEqual(source.texts, target.texts) ? map(source.types, getStringLikeTypeForType) : inferFromLiteralPartsToTemplateLiteral(source.texts, source.types, target) : void 0;
@@ -66586,7 +67212,7 @@ ${lanes.join("\n")}
       let expandingFlags = 0 /* None */;
       inferFromTypes(originalSource, originalTarget);
       function inferFromTypes(source, target) {
-        if (!couldContainTypeVariables(target)) {
+        if (!couldContainTypeVariables(target) || isNoInferType(target)) {
           return;
         }
         if (source === wildcardType || source === blockedStringType) {
@@ -66633,7 +67259,11 @@ ${lanes.join("\n")}
             source = getIntersectionType(sources);
             target = getIntersectionType(targets);
           }
-        } else if (target.flags & (8388608 /* IndexedAccess */ | 33554432 /* Substitution */)) {
+        }
+        if (target.flags & (8388608 /* IndexedAccess */ | 33554432 /* Substitution */)) {
+          if (isNoInferType(target)) {
+            return;
+          }
           target = getActualTypeVariable(target);
         }
         if (target.flags & 8650752 /* TypeVariable */) {
@@ -66735,6 +67365,9 @@ ${lanes.join("\n")}
           inferToTemplateLiteralType(source, target);
         } else {
           source = getReducedType(source);
+          if (isGenericMappedType(source) && isGenericMappedType(target)) {
+            invokeOnce(source, target, inferFromGenericMappedTypes);
+          }
           if (!(priority & 512 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) {
             const apparentSource = getApparentType(source);
             if (apparentSource !== source && !(apparentSource.flags & (524288 /* Object */ | 2097152 /* Intersection */))) {
@@ -66908,7 +67541,7 @@ ${lanes.join("\n")}
         }
       }
       function inferToMappedType(source, target, constraintType) {
-        if (constraintType.flags & 1048576 /* Union */) {
+        if (constraintType.flags & 1048576 /* Union */ || constraintType.flags & 2097152 /* Intersection */) {
           let result = false;
           for (const type of constraintType.types) {
             result = inferToMappedType(source, target, type) || result;
@@ -66998,6 +67631,14 @@ ${lanes.join("\n")}
           }
         }
       }
+      function inferFromGenericMappedTypes(source, target) {
+        inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target));
+        inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target));
+        const sourceNameType = getNameTypeFromMappedType(source);
+        const targetNameType = getNameTypeFromMappedType(target);
+        if (sourceNameType && targetNameType)
+          inferFromTypes(sourceNameType, targetNameType);
+      }
       function inferFromObjectTypes(source, target) {
         var _a, _b;
         if (getObjectFlags(source) & 4 /* Reference */ && getObjectFlags(target) & 4 /* Reference */ && (source.target === target.target || isArrayType(source) && isArrayType(target))) {
@@ -67005,12 +67646,7 @@ ${lanes.join("\n")}
           return;
         }
         if (isGenericMappedType(source) && isGenericMappedType(target)) {
-          inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target));
-          inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target));
-          const sourceNameType = getNameTypeFromMappedType(source);
-          const targetNameType = getNameTypeFromMappedType(target);
-          if (sourceNameType && targetNameType)
-            inferFromTypes(sourceNameType, targetNameType);
+          inferFromGenericMappedTypes(source, target);
         }
         if (getObjectFlags(target) & 32 /* Mapped */ && !target.declaration.nameType) {
           const constraintType = getConstraintTypeFromMappedType(target);
@@ -67262,6 +67898,8 @@ ${lanes.join("\n")}
         case "Buffer":
         case "module":
           return compilerOptions.types ? Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig : Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode;
+        case "Bun":
+          return compilerOptions.types ? Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_and_then_add_bun_to_the_types_field_in_your_tsconfig : Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun;
         case "Map":
         case "Set":
         case "Promise":
@@ -67422,7 +68060,8 @@ ${lanes.join("\n")}
       if (hasOnlyExpressionInitializer(declaration) && isBlockScopedNameDeclaredBeforeUse(declaration, node)) {
         const initializer = getEffectiveInitializer(declaration);
         if (initializer) {
-          return tryGetNameFromType(getTypeOfExpression(initializer));
+          const initializerType = isBindingPattern(declaration.parent) ? getTypeForBindingElement(declaration) : getTypeOfExpression(initializer);
+          return initializerType && tryGetNameFromType(initializerType);
         }
         if (isEnumMember(declaration)) {
           return getTextOfPropertyName(declaration.name);
@@ -68260,12 +68899,16 @@ ${lanes.join("\n")}
         case 80 /* Identifier */:
           if (!isThisInTypeQuery(node)) {
             const symbol = getResolvedSymbol(node);
-            return isConstantVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
+            return isConstantVariable(symbol) || isParameterOrMutableLocalVariable(symbol) && !isSymbolAssigned(symbol);
           }
           break;
         case 211 /* PropertyAccessExpression */:
         case 212 /* ElementAccessExpression */:
           return isConstantReference(node.expression) && isReadonlySymbol(getNodeLinks(node).resolvedSymbol || unknownSymbol);
+        case 206 /* ObjectBindingPattern */:
+        case 207 /* ArrayBindingPattern */:
+          const rootDeclaration = getRootDeclaration(node.parent);
+          return isParameter(rootDeclaration) || isCatchClauseVariableDeclaration(rootDeclaration) ? !isSomeSymbolAssigned(rootDeclaration) : isVariableDeclaration(rootDeclaration) && isVarConstLike(rootDeclaration);
       }
       return false;
     }
@@ -69183,6 +69826,9 @@ ${lanes.join("\n")}
       }
       function getNarrowedTypeWorker(type, candidate, assumeTrue, checkDerived) {
         if (!assumeTrue) {
+          if (type === candidate) {
+            return neverType;
+          }
           if (checkDerived) {
             return filterType(type, (t) => !isTypeDerivedFrom(t, candidate));
           }
@@ -69199,6 +69845,9 @@ ${lanes.join("\n")}
         if (type.flags & 3 /* AnyOrUnknown */) {
           return candidate;
         }
+        if (type === candidate) {
+          return candidate;
+        }
         const isRelated = checkDerived ? isTypeDerivedFrom : isTypeSubtypeOf;
         const keyPropertyName = type.flags & 1048576 /* Union */ ? getKeyPropertyName(type) : void 0;
         const narrowedType = mapType(candidate, (c) => {
@@ -69340,10 +69989,17 @@ ${lanes.join("\n")}
       return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 268 /* ModuleBlock */ || node2.kind === 312 /* SourceFile */ || node2.kind === 172 /* PropertyDeclaration */);
     }
     function isSymbolAssigned(symbol) {
-      if (!symbol.valueDeclaration) {
+      return !isPastLastAssignment(
+        symbol,
+        /*location*/
+        void 0
+      );
+    }
+    function isPastLastAssignment(symbol, location) {
+      const parent2 = findAncestor(symbol.valueDeclaration, isFunctionOrSourceFile);
+      if (!parent2) {
         return false;
       }
-      const parent2 = getRootDeclaration(symbol.valueDeclaration).parent;
       const links = getNodeLinks(parent2);
       if (!(links.flags & 131072 /* AssignmentsMarked */)) {
         links.flags |= 131072 /* AssignmentsMarked */;
@@ -69351,26 +70007,94 @@ ${lanes.join("\n")}
           markNodeAssignments(parent2);
         }
       }
-      return symbol.isAssigned || false;
+      return !symbol.lastAssignmentPos || location && symbol.lastAssignmentPos < location.pos;
+    }
+    function isSomeSymbolAssigned(rootDeclaration) {
+      Debug.assert(isVariableDeclaration(rootDeclaration) || isParameter(rootDeclaration));
+      return isSomeSymbolAssignedWorker(rootDeclaration.name);
+    }
+    function isSomeSymbolAssignedWorker(node) {
+      if (node.kind === 80 /* Identifier */) {
+        return isSymbolAssigned(getSymbolOfDeclaration(node.parent));
+      }
+      return some(node.elements, (e) => e.kind !== 232 /* OmittedExpression */ && isSomeSymbolAssignedWorker(e.name));
     }
     function hasParentWithAssignmentsMarked(node) {
-      return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags & 131072 /* AssignmentsMarked */));
+      return !!findAncestor(node.parent, (node2) => isFunctionOrSourceFile(node2) && !!(getNodeLinks(node2).flags & 131072 /* AssignmentsMarked */));
+    }
+    function isFunctionOrSourceFile(node) {
+      return isFunctionLikeDeclaration(node) || isSourceFile(node);
     }
     function markNodeAssignments(node) {
-      if (node.kind === 80 /* Identifier */) {
-        if (isAssignmentTarget(node)) {
-          const symbol = getResolvedSymbol(node);
-          if (isParameterOrCatchClauseVariable(symbol)) {
-            symbol.isAssigned = true;
+      switch (node.kind) {
+        case 80 /* Identifier */:
+          if (isAssignmentTarget(node)) {
+            const symbol = getResolvedSymbol(node);
+            if (isParameterOrMutableLocalVariable(symbol) && symbol.lastAssignmentPos !== Number.MAX_VALUE) {
+              const referencingFunction = findAncestor(node, isFunctionOrSourceFile);
+              const declaringFunction = findAncestor(symbol.valueDeclaration, isFunctionOrSourceFile);
+              symbol.lastAssignmentPos = referencingFunction === declaringFunction ? extendAssignmentPosition(node, symbol.valueDeclaration) : Number.MAX_VALUE;
+            }
+          }
+          return;
+        case 281 /* ExportSpecifier */:
+          const exportDeclaration = node.parent.parent;
+          if (!node.isTypeOnly && !exportDeclaration.isTypeOnly && !exportDeclaration.moduleSpecifier) {
+            const symbol = resolveEntityName(
+              node.propertyName || node.name,
+              111551 /* Value */,
+              /*ignoreErrors*/
+              true,
+              /*dontResolveAlias*/
+              true
+            );
+            if (symbol && isParameterOrMutableLocalVariable(symbol)) {
+              symbol.lastAssignmentPos = Number.MAX_VALUE;
+            }
           }
+          return;
+        case 264 /* InterfaceDeclaration */:
+        case 265 /* TypeAliasDeclaration */:
+        case 266 /* EnumDeclaration */:
+          return;
+      }
+      if (isTypeNode(node)) {
+        return;
+      }
+      forEachChild(node, markNodeAssignments);
+    }
+    function extendAssignmentPosition(node, declaration) {
+      let pos = node.pos;
+      while (node && node.pos > declaration.pos) {
+        switch (node.kind) {
+          case 243 /* VariableStatement */:
+          case 244 /* ExpressionStatement */:
+          case 245 /* IfStatement */:
+          case 246 /* DoStatement */:
+          case 247 /* WhileStatement */:
+          case 248 /* ForStatement */:
+          case 249 /* ForInStatement */:
+          case 250 /* ForOfStatement */:
+          case 254 /* WithStatement */:
+          case 255 /* SwitchStatement */:
+          case 258 /* TryStatement */:
+          case 263 /* ClassDeclaration */:
+            pos = node.end;
         }
-      } else {
-        forEachChild(node, markNodeAssignments);
+        node = node.parent;
       }
+      return pos;
     }
     function isConstantVariable(symbol) {
       return symbol.flags & 3 /* Variable */ && (getDeclarationNodeFlagsFromSymbol(symbol) & 6 /* Constant */) !== 0;
     }
+    function isParameterOrMutableLocalVariable(symbol) {
+      const declaration = symbol.valueDeclaration && getRootDeclaration(symbol.valueDeclaration);
+      return !!declaration && (isParameter(declaration) || isVariableDeclaration(declaration) && (isCatchClause(declaration.parent) || isMutableLocalVariableDeclaration(declaration)));
+    }
+    function isMutableLocalVariableDeclaration(declaration) {
+      return !!(declaration.parent.flags & 1 /* Let */) && !(getCombinedModifierFlags(declaration) & 32 /* Export */ || declaration.parent.parent.kind === 243 /* VariableStatement */ && isGlobalSourceFile(declaration.parent.parent.parent));
+    }
     function parameterInitializerContainsUndefined(declaration) {
       const links = getNodeLinks(declaration);
       if (links.parameterInitializerContainsUndefined === void 0) {
@@ -69451,21 +70175,22 @@ ${lanes.join("\n")}
         }
       }
     }
-    function getNarrowedTypeOfSymbol(symbol, location) {
+    function getNarrowedTypeOfSymbol(symbol, location, checkMode) {
       var _a;
-      const type = getTypeOfSymbol(symbol);
+      const type = getTypeOfSymbol(symbol, checkMode);
       const declaration = symbol.valueDeclaration;
       if (declaration) {
         if (isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
           const parent2 = declaration.parent.parent;
-          if (parent2.kind === 260 /* VariableDeclaration */ && getCombinedNodeFlagsCached(declaration) & 6 /* Constant */ || parent2.kind === 169 /* Parameter */) {
+          const rootDeclaration = getRootDeclaration(parent2);
+          if (rootDeclaration.kind === 260 /* VariableDeclaration */ && getCombinedNodeFlagsCached(rootDeclaration) & 6 /* Constant */ || rootDeclaration.kind === 169 /* Parameter */) {
             const links = getNodeLinks(parent2);
             if (!(links.flags & 4194304 /* InCheckIdentifier */)) {
               links.flags |= 4194304 /* InCheckIdentifier */;
               const parentType = getTypeForBindingElementParent(parent2, 0 /* Normal */);
               const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
               links.flags &= ~4194304 /* InCheckIdentifier */;
-              if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(parent2.kind === 169 /* Parameter */ && isSymbolAssigned(symbol))) {
+              if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 169 /* Parameter */ && isSomeSymbolAssigned(rootDeclaration))) {
                 const pattern = declaration.parent;
                 const narrowedType = getFlowTypeOfReference(
                   pattern,
@@ -69494,7 +70219,7 @@ ${lanes.join("\n")}
             const contextualSignature = getContextualSignature(func);
             if (contextualSignature && contextualSignature.parameters.length === 1 && signatureHasRestParameter(contextualSignature)) {
               const restType = getReducedApparentType(instantiateType(getTypeOfSymbol(contextualSignature.parameters[0]), (_a = getInferenceContext(func)) == null ? void 0 : _a.nonFixingMapper));
-              if (restType.flags & 1048576 /* Union */ && everyType(restType, isTupleType) && !isSymbolAssigned(symbol)) {
+              if (restType.flags & 1048576 /* Union */ && everyType(restType, isTupleType) && !some(func.parameters, isSomeSymbolAssigned)) {
                 const narrowedType = getFlowTypeOfReference(
                   func,
                   restType,
@@ -69525,15 +70250,23 @@ ${lanes.join("\n")}
           error2(node, Diagnostics.arguments_cannot_be_referenced_in_property_initializers);
           return errorType;
         }
-        const container = getContainingFunction(node);
-        if (languageVersion < 2 /* ES2015 */) {
-          if (container.kind === 219 /* ArrowFunction */) {
-            error2(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression);
-          } else if (hasSyntacticModifier(container, 1024 /* Async */)) {
-            error2(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method);
+        let container = getContainingFunction(node);
+        if (container) {
+          if (languageVersion < 2 /* ES2015 */) {
+            if (container.kind === 219 /* ArrowFunction */) {
+              error2(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression);
+            } else if (hasSyntacticModifier(container, 1024 /* Async */)) {
+              error2(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method);
+            }
+          }
+          getNodeLinks(container).flags |= 512 /* CaptureArguments */;
+          while (container && isArrowFunction(container)) {
+            container = getContainingFunction(container);
+            if (container) {
+              getNodeLinks(container).flags |= 512 /* CaptureArguments */;
+            }
           }
         }
-        getNodeLinks(container).flags |= 512 /* CaptureArguments */;
         return getTypeOfSymbol(symbol);
       }
       if (shouldMarkIdentifierAliasReferenced(node)) {
@@ -69571,7 +70304,7 @@ ${lanes.join("\n")}
         }
       }
       checkNestedBlockScopedBinding(node, symbol);
-      let type = getNarrowedTypeOfSymbol(localOrExportSymbol, node);
+      let type = getNarrowedTypeOfSymbol(localOrExportSymbol, node, checkMode);
       const assignmentKind = getAssignmentTargetKind(node);
       if (assignmentKind) {
         if (!(localOrExportSymbol.flags & 3 /* Variable */) && !(isInJSFile(node) && localOrExportSymbol.flags & 512 /* ValueModule */)) {
@@ -69610,7 +70343,7 @@ ${lanes.join("\n")}
       const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
       const typeIsAutomatic = type === autoType || type === autoArrayType;
       const isAutomaticTypeInNonNull = typeIsAutomatic && node.parent.kind === 235 /* NonNullExpression */;
-      while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
+      while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameterOrMutableLocalVariable(localOrExportSymbol) && isPastLastAssignment(localOrExportSymbol, node))) {
         flowContainer = getControlFlowContainer(flowContainer);
       }
       const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 281 /* ExportSpecifier */) || node.parent.kind === 235 /* NonNullExpression */ || declaration.kind === 260 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 33554432 /* Ambient */;
@@ -70881,6 +71614,8 @@ ${lanes.join("\n")}
         case 286 /* JsxOpeningElement */:
         case 285 /* JsxSelfClosingElement */:
           return getContextualJsxElementAttributesType(parent2, contextFlags);
+        case 301 /* ImportAttribute */:
+          return getContextualImportAttributeType(parent2);
       }
       return void 0;
     }
@@ -70928,6 +71663,12 @@ ${lanes.join("\n")}
         }
       }
     }
+    function getContextualImportAttributeType(node) {
+      return getTypeOfPropertyOfContextualType(getGlobalImportAttributesType(
+        /*reportErrors*/
+        false
+      ), getNameFromImportAttribute(node));
+    }
     function getContextualJsxElementAttributesType(node, contextFlags) {
       if (isJsxOpeningElement(node) && contextFlags !== 4 /* Completions */) {
         const index = findContextualNode(
@@ -71209,7 +71950,7 @@ ${lanes.join("\n")}
         /*contextFlags*/
         void 0
       );
-      const inTupleContext = isSpreadIntoCallOrNew(node) || !!contextualType && someType(contextualType, isTupleLikeType);
+      const inTupleContext = isSpreadIntoCallOrNew(node) || !!contextualType && someType(contextualType, (t) => isTupleLikeType(t) || isGenericMappedType(t) && !t.nameType && !!getHomomorphicTypeVariable(t.target || t));
       let hasOmittedExpression = false;
       for (let i = 0; i < elementCount; i++) {
         const e = elements[i];
@@ -71813,7 +72554,12 @@ ${lanes.join("\n")}
       }
       const isClassic = getEmitModuleResolutionKind(compilerOptions) === 1 /* Classic */;
       const errorMessage = isClassic ? Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option : Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations;
-      const mod = resolveExternalModule(location, runtimeImportSpecifier, errorMessage, location);
+      const jsxImportIndex = compilerOptions.importHelpers ? 1 : 0;
+      const specifier = file == null ? void 0 : file.imports[jsxImportIndex];
+      if (specifier) {
+        Debug.assert(nodeIsSynthesized(specifier) && specifier.text === runtimeImportSpecifier, `Expected sourceFile.imports[${jsxImportIndex}] to be the synthesized JSX runtime import`);
+      }
+      const mod = resolveExternalModule(specifier || location, runtimeImportSpecifier, errorMessage, location);
       const result = mod && mod !== unknownSymbol ? getMergedSymbol(resolveSymbol(mod)) : void 0;
       if (links) {
         links.jsxImplicitImportContainer = result || false;
@@ -72056,7 +72802,7 @@ ${lanes.join("\n")}
           );
         }
         if (jsxFactorySym) {
-          jsxFactorySym.isReferenced = 67108863 /* All */;
+          jsxFactorySym.isReferenced = -1 /* All */;
           if (canCollectSymbolAliasAccessabilityData && jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) {
             markAliasSymbolAsReferenced(jsxFactorySym);
           }
@@ -72896,7 +73642,7 @@ ${lanes.join("\n")}
           return;
         }
       }
-      (getCheckFlags(prop) & 1 /* Instantiated */ ? getSymbolLinks(prop).target : prop).isReferenced = 67108863 /* All */;
+      (getCheckFlags(prop) & 1 /* Instantiated */ ? getSymbolLinks(prop).target : prop).isReferenced = -1 /* All */;
     }
     function isSelfTypeAccess(name, parent2) {
       return name.kind === 110 /* ThisKeyword */ || !!parent2 && isEntityNameExpression(name) && parent2 === getResolvedSymbol(getFirstIdentifier(name));
@@ -73140,6 +73886,10 @@ ${lanes.join("\n")}
       const minTypeArgumentCount = getMinTypeArgumentCount(signature.typeParameters);
       return !some(typeArguments) || typeArguments.length >= minTypeArgumentCount && typeArguments.length <= numTypeParameters;
     }
+    function isInstantiatedGenericParameter(signature, pos) {
+      let type;
+      return !!(signature.target && (type = tryGetTypeAtPosition(signature.target, pos)) && isGenericType(type));
+    }
     function getSingleCallSignature(type) {
       return getSingleSignature(
         type,
@@ -73455,6 +74205,10 @@ ${lanes.join("\n")}
         return false;
       }
     }
+    function getEffectiveCheckNode(argument) {
+      argument = skipParentheses(argument);
+      return isSatisfiesExpression(argument) ? skipParentheses(argument.expression) : argument;
+    }
     function getSignatureApplicabilityError(node, args, signature, relation, checkMode, reportErrors2, containingMessageChain) {
       const errorOutputContainer = { errors: void 0, skipLogging: true };
       if (isJsxOpeningLikeElement(node)) {
@@ -73490,7 +74244,8 @@ ${lanes.join("\n")}
             checkMode
           );
           const checkArgType = checkMode & 4 /* SkipContextSensitive */ ? getRegularTypeOfObjectLiteral(argType) : argType;
-          if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors2 ? arg : void 0, arg, headMessage, containingMessageChain, errorOutputContainer)) {
+          const effectiveCheckArgumentNode = getEffectiveCheckNode(arg);
+          if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors2 ? effectiveCheckArgumentNode : void 0, effectiveCheckArgumentNode, headMessage, containingMessageChain, errorOutputContainer)) {
             Debug.assert(!reportErrors2 || !!errorOutputContainer.errors, "parameter should have errors when reporting errors");
             maybeAddMissingAwaitInfo(arg, checkArgType, paramType);
             return errorOutputContainer.errors || emptyArray;
@@ -73508,7 +74263,7 @@ ${lanes.join("\n")}
           checkMode
         );
         const restArgCount = args.length - argCount;
-        const errorNode = !reportErrors2 ? void 0 : restArgCount === 0 ? node : restArgCount === 1 ? args[argCount] : setTextRangePosEnd(createSyntheticExpression(node, spreadType), args[argCount].pos, args[args.length - 1].end);
+        const errorNode = !reportErrors2 ? void 0 : restArgCount === 0 ? node : restArgCount === 1 ? getEffectiveCheckNode(args[argCount]) : setTextRangePosEnd(createSyntheticExpression(node, spreadType), args[argCount].pos, args[args.length - 1].end);
         if (!checkTypeRelatedTo(
           spreadType,
           restType,
@@ -73630,19 +74385,9 @@ ${lanes.join("\n")}
           return Debug.fail();
       }
     }
-    function getDiagnosticSpanForCallNode(node, doNotIncludeArguments) {
-      let start;
-      let length2;
+    function getDiagnosticSpanForCallNode(node) {
       const sourceFile = getSourceFileOfNode(node);
-      if (isPropertyAccessExpression(node.expression)) {
-        const nameSpan = getErrorSpanForNode(sourceFile, node.expression.name);
-        start = nameSpan.start;
-        length2 = doNotIncludeArguments ? nameSpan.length : node.end - start;
-      } else {
-        const expressionSpan = getErrorSpanForNode(sourceFile, node.expression);
-        start = expressionSpan.start;
-        length2 = doNotIncludeArguments ? expressionSpan.length : node.end - start;
-      }
+      const { start, length: length2 } = getErrorSpanForNode(sourceFile, isPropertyAccessExpression(node.expression) ? node.expression.name : node.expression);
       return { start, length: length2, sourceFile };
     }
     function getDiagnosticForCallNode(node, message, ...args) {
@@ -73659,6 +74404,18 @@ ${lanes.join("\n")}
         return createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node), node, message);
       }
     }
+    function getErrorNodeForCallNode(callLike) {
+      if (isCallOrNewExpression(callLike)) {
+        return isPropertyAccessExpression(callLike.expression) ? callLike.expression.name : callLike.expression;
+      }
+      if (isTaggedTemplateExpression(callLike)) {
+        return isPropertyAccessExpression(callLike.tag) ? callLike.tag.name : callLike.tag;
+      }
+      if (isJsxOpeningLikeElement(callLike)) {
+        return callLike.tagName;
+      }
+      return callLike;
+    }
     function isPromiseResolveArityError(node) {
       if (!isCallExpression(node) || !isIdentifier(node.expression))
         return false;
@@ -73960,7 +74717,7 @@ ${lanes.join("\n")}
               const { file, start, length: length2 } = diags[0];
               diag2 = { file, start, length: length2, code: chain.code, category: chain.category, messageText: chain, relatedInformation: related };
             } else {
-              diag2 = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node), node, chain, related);
+              diag2 = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node), getErrorNodeForCallNode(node), chain, related);
             }
             addImplementationSuccessElaboration(candidatesForArgumentError[0], diag2);
             diagnostics.add(diag2);
@@ -73991,8 +74748,8 @@ ${lanes.join("\n")}
         const oldCandidateForArgumentArityError = candidateForArgumentArityError;
         const oldCandidateForTypeArgumentError = candidateForTypeArgumentError;
         const failedSignatureDeclarations = ((_b = (_a = failed.declaration) == null ? void 0 : _a.symbol) == null ? void 0 : _b.declarations) || emptyArray;
-        const isOverload = failedSignatureDeclarations.length > 1;
-        const implDecl = isOverload ? find(failedSignatureDeclarations, (d) => isFunctionLikeDeclaration(d) && nodeIsPresent(d.body)) : void 0;
+        const isOverload2 = failedSignatureDeclarations.length > 1;
+        const implDecl = isOverload2 ? find(failedSignatureDeclarations, (d) => isFunctionLikeDeclaration(d) && nodeIsPresent(d.body)) : void 0;
         if (implDecl) {
           const candidate = getSignatureFromDeclaration(implDecl);
           const isSingleNonGenericCandidate2 = !candidate.typeParameters;
@@ -74488,11 +75245,7 @@ ${lanes.join("\n")}
         addRelatedInfo(diagnostic, createDiagnosticForNode(errorTarget, relatedInfo));
       }
       if (isCallExpression(errorTarget.parent)) {
-        const { start, length: length2 } = getDiagnosticSpanForCallNode(
-          errorTarget.parent,
-          /*doNotIncludeArguments*/
-          true
-        );
+        const { start, length: length2 } = getDiagnosticSpanForCallNode(errorTarget.parent);
         diagnostic.start = start;
         diagnostic.length = length2;
       }
@@ -74848,7 +75601,7 @@ ${lanes.join("\n")}
           return anyType;
         }
       }
-      if (isInJSFile(node) && shouldResolveJsRequire(compilerOptions) && isCommonJsRequire(node)) {
+      if (isInJSFile(node) && isCommonJsRequire(node)) {
         return resolveExternalModuleTypeByLiteral(node.arguments[0]);
       }
       const returnType = getReturnTypeOfSignature(signature);
@@ -75216,14 +75969,7 @@ ${lanes.join("\n")}
             hasSignatures || (hasSignatures = resolved.callSignatures.length !== 0 || resolved.constructSignatures.length !== 0);
             hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0);
             if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) {
-              const result3 = createAnonymousType(
-                /*symbol*/
-                void 0,
-                resolved.members,
-                callSignatures,
-                constructSignatures,
-                resolved.indexInfos
-              );
+              const result3 = createAnonymousType(createSymbol(0 /* None */, "__instantiationExpression" /* InstantiationExpression */), resolved.members, callSignatures, constructSignatures, resolved.indexInfos);
               result3.objectFlags |= 8388608 /* InstantiationExpressionType */;
               result3.node = node;
               return result3;
@@ -75445,6 +76191,11 @@ ${lanes.join("\n")}
       }
       return createTupleType(types, flags, readonly, names);
     }
+    function getRestOrAnyTypeAtPosition(source, pos) {
+      const restType = getRestTypeAtPosition(source, pos);
+      const elementType = restType && getElementTypeOfArrayType(restType);
+      return elementType && isTypeAny(elementType) ? anyType : restType;
+    }
     function getParameterCount(signature) {
       const length2 = signature.parameters.length;
       if (signatureHasRestParameter(signature)) {
@@ -75501,7 +76252,7 @@ ${lanes.join("\n")}
       if (signatureHasRestParameter(signature)) {
         const restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]);
         if (!isTupleType(restType)) {
-          return restType;
+          return isTypeAny(restType) ? anyArrayType : restType;
         }
         if (restType.target.hasRestElement) {
           return sliceTupleType(restType, restType.target.fixedLength);
@@ -75560,9 +76311,16 @@ ${lanes.join("\n")}
       const len = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
       for (let i = 0; i < len; i++) {
         const parameter = signature.parameters[i];
-        if (!getEffectiveTypeAnnotationNode(parameter.valueDeclaration)) {
-          const contextualParameterType = tryGetTypeAtPosition(context, i);
-          assignParameterType(parameter, contextualParameterType);
+        const declaration = parameter.valueDeclaration;
+        if (!getEffectiveTypeAnnotationNode(declaration)) {
+          let type = tryGetTypeAtPosition(context, i);
+          if (type && declaration.initializer) {
+            let initializerType = checkDeclarationInitializer(declaration, 0 /* Normal */);
+            if (!isTypeAssignableTo(initializerType, type) && isTypeAssignableTo(type, initializerType = widenTypeInferredFromInitializer(declaration, initializerType))) {
+              type = initializerType;
+            }
+          }
+          assignParameterType(parameter, type);
         }
       }
       if (signatureHasRestParameter(signature)) {
@@ -75700,8 +76458,8 @@ ${lanes.join("\n")}
       ), [thisType, valueType]);
     }
     function createClassFieldDecoratorInitializerMutatorType(thisType, valueType) {
-      const thisParam = createParameter("this", thisType);
-      const valueParam = createParameter("value", valueType);
+      const thisParam = createParameter2("this", thisType);
+      const valueParam = createParameter2("value", valueType);
       return createFunctionType(
         /*typeParameters*/
         void 0,
@@ -75714,8 +76472,8 @@ ${lanes.join("\n")}
       );
     }
     function createESDecoratorCallSignature(targetType, contextType, nonOptionalReturnType) {
-      const targetParam = createParameter("target", targetType);
-      const contextParam = createParameter("context", contextType);
+      const targetParam = createParameter2("target", targetType);
+      const contextParam = createParameter2("context", contextType);
       const returnType = getUnionType([nonOptionalReturnType, voidType]);
       return createCallSignature(
         /*typeParameters*/
@@ -75780,7 +76538,7 @@ ${lanes.join("\n")}
           case 231 /* ClassExpression */: {
             const node = parent2;
             const targetType = getTypeOfSymbol(getSymbolOfDeclaration(node));
-            const targetParam = createParameter("target", targetType);
+            const targetParam = createParameter2("target", targetType);
             links.decoratorSignature = createCallSignature(
               /*typeParameters*/
               void 0,
@@ -75804,9 +76562,9 @@ ${lanes.join("\n")}
             const targetType = isConstructorDeclaration(node.parent) ? getTypeOfSymbol(getSymbolOfDeclaration(node.parent.parent)) : getParentTypeOfClassElement(node.parent);
             const keyType = isConstructorDeclaration(node.parent) ? undefinedType : getClassElementPropertyKeyType(node.parent);
             const indexType = getNumberLiteralType(index);
-            const targetParam = createParameter("target", targetType);
-            const keyParam = createParameter("propertyKey", keyType);
-            const indexParam = createParameter("parameterIndex", indexType);
+            const targetParam = createParameter2("target", targetType);
+            const keyParam = createParameter2("propertyKey", keyType);
+            const indexParam = createParameter2("parameterIndex", indexType);
             links.decoratorSignature = createCallSignature(
               /*typeParameters*/
               void 0,
@@ -75825,14 +76583,14 @@ ${lanes.join("\n")}
             if (!isClassLike(node.parent))
               break;
             const targetType = getParentTypeOfClassElement(node);
-            const targetParam = createParameter("target", targetType);
+            const targetParam = createParameter2("target", targetType);
             const keyType = getClassElementPropertyKeyType(node);
-            const keyParam = createParameter("propertyKey", keyType);
+            const keyParam = createParameter2("propertyKey", keyType);
             const returnType = isPropertyDeclaration(node) ? voidType : createTypedPropertyDescriptorType(getTypeOfNode(node));
             const hasPropDesc = languageVersion !== 0 /* ES3 */ && (!isPropertyDeclaration(parent2) || hasAccessorModifier(parent2));
             if (hasPropDesc) {
               const descriptorType = createTypedPropertyDescriptorType(getTypeOfNode(node));
-              const descriptorParam = createParameter("descriptor", descriptorType);
+              const descriptorParam = createParameter2("descriptor", descriptorType);
               links.decoratorSignature = createCallSignature(
                 /*typeParameters*/
                 void 0,
@@ -76328,17 +77086,18 @@ ${lanes.join("\n")}
           const exprType = checkExpression(node.body);
           const returnOrPromisedType = returnType && unwrapReturnType(returnType, functionFlags);
           if (returnOrPromisedType) {
+            const effectiveCheckNode = getEffectiveCheckNode(node.body);
             if ((functionFlags & 3 /* AsyncGenerator */) === 2 /* Async */) {
               const awaitedType = checkAwaitedType(
                 exprType,
                 /*withAlias*/
                 false,
-                node.body,
+                effectiveCheckNode,
                 Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member
               );
-              checkTypeAssignableToAndOptionallyElaborate(awaitedType, returnOrPromisedType, node.body, node.body);
+              checkTypeAssignableToAndOptionallyElaborate(awaitedType, returnOrPromisedType, effectiveCheckNode, effectiveCheckNode);
             } else {
-              checkTypeAssignableToAndOptionallyElaborate(exprType, returnOrPromisedType, node.body, node.body);
+              checkTypeAssignableToAndOptionallyElaborate(exprType, returnOrPromisedType, effectiveCheckNode, effectiveCheckNode);
             }
           }
         }
@@ -76500,13 +77259,14 @@ ${lanes.join("\n")}
                 }
               case 7 /* ES2022 */:
               case 99 /* ESNext */:
+              case 200 /* Preserve */:
               case 4 /* System */:
                 if (languageVersion >= 4 /* ES2017 */) {
                   break;
                 }
               default:
                 span ?? (span = getSpanOfTokenAtPosition(sourceFile, node.pos));
-                const message = isAwaitExpression(node) ? Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher : Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher;
+                const message = isAwaitExpression(node) ? Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher : Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher;
                 diagnostics.add(createFileDiagnostic(sourceFile, span.start, span.length, message));
                 hasError = true;
                 break;
@@ -78128,7 +78888,7 @@ ${lanes.join("\n")}
         const modifiers = getTypeParameterModifiers(typeParameter) & (8192 /* In */ | 16384 /* Out */);
         if (modifiers) {
           const symbol = getSymbolOfDeclaration(node.parent);
-          if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (16 /* Anonymous */ | 32 /* Mapped */))) {
+          if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */))) {
             error2(node, Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types);
           } else if (modifiers === 8192 /* In */ || modifiers === 16384 /* Out */) {
             (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.CheckTypes, "checkTypeParameterDeferred", { parent: getTypeId(getDeclaredTypeOfSymbol(symbol)), id: getTypeId(typeParameter) });
@@ -78751,11 +79511,10 @@ ${lanes.join("\n")}
       checkSourceElement(node.elementType);
     }
     function checkTupleType(node) {
-      const elementTypes = node.elements;
       let seenOptionalElement = false;
       let seenRestElement = false;
-      for (const e of elementTypes) {
-        const flags = getTupleElementFlags(e);
+      for (const e of node.elements) {
+        let flags = getTupleElementFlags(e);
         if (flags & 8 /* Variadic */) {
           const type = getTypeFromTypeNode(e.type);
           if (!isArrayLikeType(type)) {
@@ -78763,9 +79522,10 @@ ${lanes.join("\n")}
             break;
           }
           if (isArrayType(type) || isTupleType(type) && type.target.combinedFlags & 4 /* Rest */) {
-            seenRestElement = true;
+            flags |= 4 /* Rest */;
           }
-        } else if (flags & 4 /* Rest */) {
+        }
+        if (flags & 4 /* Rest */) {
           if (seenRestElement) {
             grammarErrorOnNode(e, Diagnostics.A_rest_element_cannot_follow_another_rest_element);
             break;
@@ -78777,7 +79537,7 @@ ${lanes.join("\n")}
             break;
           }
           seenOptionalElement = true;
-        } else if (seenOptionalElement) {
+        } else if (flags & 1 /* Required */ && seenOptionalElement) {
           grammarErrorOnNode(e, Diagnostics.A_required_element_cannot_follow_an_optional_element);
           break;
         }
@@ -78795,20 +79555,18 @@ ${lanes.join("\n")}
       }
       const objectType = type.objectType;
       const indexType = type.indexType;
-      if (isTypeAssignableTo(indexType, getIndexType(objectType, 0 /* None */))) {
+      const objectIndexType = isGenericMappedType(objectType) && getMappedTypeNameTypeKind(objectType) === 2 /* Remapping */ ? getIndexTypeForMappedType(objectType, 0 /* None */) : getIndexType(objectType, 0 /* None */);
+      const hasNumberIndexInfo = !!getIndexInfoOfType(objectType, numberType);
+      if (everyType(indexType, (t) => isTypeAssignableTo(t, objectIndexType) || hasNumberIndexInfo && isApplicableIndexType(t, numberType))) {
         if (accessNode.kind === 212 /* ElementAccessExpression */ && isAssignmentTarget(accessNode) && getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) {
           error2(accessNode, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));
         }
         return type;
       }
-      const apparentObjectType = getApparentType(objectType);
-      if (getIndexInfoOfType(apparentObjectType, numberType) && isTypeAssignableToKind(indexType, 296 /* NumberLike */)) {
-        return type;
-      }
       if (isGenericObjectType(objectType)) {
         const propertyName = getPropertyNameFromIndex(indexType, accessNode);
         if (propertyName) {
-          const propertySymbol = forEachType(apparentObjectType, (t) => getPropertyOfType(t, propertyName));
+          const propertySymbol = forEachType(getApparentType(objectType), (t) => getPropertyOfType(t, propertyName));
           if (propertySymbol && getDeclarationModifierFlagsFromSymbol(propertySymbol) & 6 /* NonPublicAccessibilityModifier */) {
             error2(accessNode, Diagnostics.Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter, unescapeLeadingUnderscores(propertyName));
             return errorType;
@@ -79057,15 +79815,7 @@ ${lanes.join("\n")}
             }
           }
           if (isInJSFile(current) && isFunctionLike(current) && current.jsDoc) {
-            for (const node2 of current.jsDoc) {
-              if (node2.tags) {
-                for (const tag of node2.tags) {
-                  if (isJSDocOverloadTag(tag)) {
-                    hasOverloads = true;
-                  }
-                }
-              }
-            }
+            hasOverloads = length(getJSDocOverloadTags(current)) > 0;
           }
         }
       }
@@ -79537,7 +80287,7 @@ ${lanes.join("\n")}
       );
     }
     function createSetterFunctionType(type) {
-      const valueParam = createParameter("value", type);
+      const valueParam = createParameter2("value", type);
       return createFunctionType(
         /*typeParameters*/
         void 0,
@@ -82916,6 +83666,16 @@ ${lanes.join("\n")}
         if (targetFlags & excludedMeanings) {
           const message = node.kind === 281 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
           error2(node, message, symbolToString(symbol));
+        } else if (node.kind !== 281 /* ExportSpecifier */) {
+          const appearsValueyToTranspiler = compilerOptions.isolatedModules && !findAncestor(node, isTypeOnlyImportOrExportDeclaration);
+          if (appearsValueyToTranspiler && symbol.flags & (111551 /* Value */ | 1048576 /* ExportValue */)) {
+            error2(
+              node,
+              Diagnostics.Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled,
+              symbolToString(symbol),
+              isolatedModulesLikeFlagName
+            );
+          }
         }
         if (getIsolatedModules(compilerOptions) && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 33554432 /* Ambient */)) {
           const typeOnlyAlias = getTypeOnlyAliasDeclaration(symbol);
@@ -83001,6 +83761,13 @@ ${lanes.join("\n")}
       var _a;
       const node = declaration.attributes;
       if (node) {
+        const importAttributesType = getGlobalImportAttributesType(
+          /*reportErrors*/
+          true
+        );
+        if (importAttributesType !== emptyObjectType) {
+          checkTypeAssignableTo(getTypeFromImportAttributes(node), getNullableType(importAttributesType, 32768 /* Undefined */), node);
+        }
         const validForTypeAttributes = isExclusivelyTypeOnlyImportOrExport(declaration);
         const override = getResolutionModeOverride(node, validForTypeAttributes ? grammarErrorOnNode : void 0);
         const isImportAttributes2 = declaration.attributes.token === 118 /* WithKeyword */;
@@ -83008,8 +83775,8 @@ ${lanes.join("\n")}
           return;
         }
         const mode = moduleKind === 199 /* NodeNext */ && declaration.moduleSpecifier && getUsageModeForExpression(declaration.moduleSpecifier);
-        if (mode !== 99 /* ESNext */ && moduleKind !== 99 /* ESNext */) {
-          const message = isImportAttributes2 ? moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext : moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext;
+        if (mode !== 99 /* ESNext */ && moduleKind !== 99 /* ESNext */ && moduleKind !== 200 /* Preserve */) {
+          const message = isImportAttributes2 ? moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve : moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve;
           return grammarErrorOnNode(node, message);
         }
         if (isImportDeclaration(declaration) ? (_a = declaration.importClause) == null ? void 0 : _a.isTypeOnly : declaration.isTypeOnly) {
@@ -83020,6 +83787,9 @@ ${lanes.join("\n")}
         }
       }
     }
+    function checkImportAttribute(node) {
+      return getRegularTypeOfLiteralType(checkExpressionCached(node.value));
+    }
     function checkImportDeclaration(node) {
       if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) {
         return;
@@ -83078,7 +83848,7 @@ ${lanes.join("\n")}
             grammarErrorOnNode(node, Diagnostics.An_import_alias_cannot_use_import_type);
           }
         } else {
-          if (moduleKind >= 5 /* ES2015 */ && getSourceFileOfNode(node).impliedNodeFormat === void 0 && !node.isTypeOnly && !(node.flags & 33554432 /* Ambient */)) {
+          if (moduleKind >= 5 /* ES2015 */ && moduleKind !== 200 /* Preserve */ && getSourceFileOfNode(node).impliedNodeFormat === void 0 && !node.isTypeOnly && !(node.flags & 33554432 /* Ambient */)) {
             grammarErrorOnNode(node, Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);
           }
         }
@@ -83239,7 +84009,7 @@ ${lanes.join("\n")}
         const id = node.expression;
         const sym = getExportSymbolOfValueSymbolIfExported(resolveEntityName(
           id,
-          67108863 /* All */,
+          -1 /* All */,
           /*ignoreErrors*/
           true,
           /*dontResolveAlias*/
@@ -83247,10 +84017,11 @@ ${lanes.join("\n")}
           node
         ));
         if (sym) {
+          const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(sym, 111551 /* Value */);
           markAliasReferenced(sym, id);
           if (getSymbolFlags(sym) & 111551 /* Value */) {
             checkExpressionCached(id);
-            if (!isIllegalExportDefaultInCJS && !(node.flags & 33554432 /* Ambient */) && compilerOptions.verbatimModuleSyntax && getTypeOnlyAliasDeclaration(sym, 111551 /* Value */)) {
+            if (!isIllegalExportDefaultInCJS && !(node.flags & 33554432 /* Ambient */) && compilerOptions.verbatimModuleSyntax && typeOnlyDeclaration) {
               error2(
                 id,
                 node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration : Diagnostics.An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration,
@@ -83264,6 +84035,34 @@ ${lanes.join("\n")}
               idText(id)
             );
           }
+          if (!isIllegalExportDefaultInCJS && !(node.flags & 33554432 /* Ambient */) && getIsolatedModules(compilerOptions) && !(sym.flags & 111551 /* Value */)) {
+            const nonLocalMeanings = getSymbolFlags(
+              sym,
+              /*excludeTypeOnlyMeanings*/
+              false,
+              /*excludeLocalMeanings*/
+              true
+            );
+            if (sym.flags & 2097152 /* Alias */ && nonLocalMeanings & 788968 /* Type */ && !(nonLocalMeanings & 111551 /* Value */) && (!typeOnlyDeclaration || getSourceFileOfNode(typeOnlyDeclaration) !== getSourceFileOfNode(node))) {
+              error2(
+                id,
+                node.isExportEquals ? Diagnostics._0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported : Diagnostics._0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default,
+                idText(id),
+                isolatedModulesLikeFlagName
+              );
+            } else if (typeOnlyDeclaration && getSourceFileOfNode(typeOnlyDeclaration) !== getSourceFileOfNode(node)) {
+              addTypeOnlyDeclarationRelatedInfo(
+                error2(
+                  id,
+                  node.isExportEquals ? Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default,
+                  idText(id),
+                  isolatedModulesLikeFlagName
+                ),
+                typeOnlyDeclaration,
+                idText(id)
+              );
+            }
+          }
         } else {
           checkExpressionCached(id);
         }
@@ -83285,7 +84084,7 @@ ${lanes.join("\n")}
         grammarErrorOnNode(node.expression, Diagnostics.The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context);
       }
       if (node.isExportEquals) {
-        if (moduleKind >= 5 /* ES2015 */ && (node.flags & 33554432 /* Ambient */ && getSourceFileOfNode(node).impliedNodeFormat === 99 /* ESNext */ || !(node.flags & 33554432 /* Ambient */) && getSourceFileOfNode(node).impliedNodeFormat !== 1 /* CommonJS */)) {
+        if (moduleKind >= 5 /* ES2015 */ && moduleKind !== 200 /* Preserve */ && (node.flags & 33554432 /* Ambient */ && getSourceFileOfNode(node).impliedNodeFormat === 99 /* ESNext */ || !(node.flags & 33554432 /* Ambient */) && getSourceFileOfNode(node).impliedNodeFormat !== 1 /* CommonJS */)) {
           grammarErrorOnNode(node, Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead);
         } else if (moduleKind === 4 /* System */ && !(node.flags & 33554432 /* Ambient */)) {
           grammarErrorOnNode(node, Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system);
@@ -83951,9 +84750,12 @@ ${lanes.join("\n")}
         case 1 /* ExportsProperty */:
         case 3 /* PrototypeProperty */:
           return getSymbolOfNode(entityName.parent);
+        case 5 /* Property */:
+          if (isPropertyAccessExpression(entityName.parent) && getLeftmostAccessExpression(entityName.parent) === entityName) {
+            return void 0;
+          }
         case 4 /* ThisProperty */:
         case 2 /* ModuleExports */:
-        case 5 /* Property */:
           return getSymbolOfDeclaration(entityName.parent.parent);
       }
     }
@@ -84274,7 +85076,7 @@ ${lanes.join("\n")}
           return void 0;
         case 11 /* StringLiteral */:
         case 15 /* NoSubstitutionTemplateLiteral */:
-          if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 272 /* ImportDeclaration */ || node.parent.kind === 278 /* ExportDeclaration */) && node.parent.moduleSpecifier === node || (isInJSFile(node) && getEmitModuleResolutionKind(compilerOptions) !== 100 /* Bundler */ && isRequireCall(
+          if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 272 /* ImportDeclaration */ || node.parent.kind === 278 /* ExportDeclaration */) && node.parent.moduleSpecifier === node || (isInJSFile(node) && isRequireCall(
             node.parent,
             /*requireStringLiteralLikeArgument*/
             false
@@ -84404,6 +85206,12 @@ ${lanes.join("\n")}
       if (isMetaProperty(node.parent) && node.parent.keywordToken === node.kind) {
         return checkMetaPropertyKeyword(node.parent);
       }
+      if (isImportAttributes(node)) {
+        return getGlobalImportAttributesType(
+          /*reportErrors*/
+          false
+        );
+      }
       return errorType;
     }
     function getTypeOfAssignmentPattern(expr) {
@@ -84658,7 +85466,11 @@ ${lanes.join("\n")}
           const exportClause = node.exportClause;
           return !!exportClause && (isNamespaceExport(exportClause) || some(exportClause.elements, isValueAliasDeclaration));
         case 277 /* ExportAssignment */:
-          return node.expression && node.expression.kind === 80 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfDeclaration(node)) : true;
+          return node.expression && node.expression.kind === 80 /* Identifier */ ? isAliasResolvedToValue(
+            getSymbolOfDeclaration(node),
+            /*excludeTypeOnlyValues*/
+            true
+          ) : true;
       }
       return false;
     }
@@ -84814,7 +85626,7 @@ ${lanes.join("\n")}
         true,
         location
       );
-      const resolvedSymbol = valueSymbol && valueSymbol.flags & 2097152 /* Alias */ ? resolveAlias(valueSymbol) : valueSymbol;
+      const resolvedValueSymbol = valueSymbol && valueSymbol.flags & 2097152 /* Alias */ ? resolveAlias(valueSymbol) : valueSymbol;
       isTypeOnly || (isTypeOnly = !!(valueSymbol && getTypeOnlyAliasDeclaration(valueSymbol, 111551 /* Value */)));
       const typeSymbol = resolveEntityName(
         typeName,
@@ -84822,26 +85634,30 @@ ${lanes.join("\n")}
         /*ignoreErrors*/
         true,
         /*dontResolveAlias*/
-        false,
+        true,
         location
       );
-      if (resolvedSymbol && resolvedSymbol === typeSymbol) {
+      const resolvedTypeSymbol = typeSymbol && typeSymbol.flags & 2097152 /* Alias */ ? resolveAlias(typeSymbol) : typeSymbol;
+      if (!valueSymbol) {
+        isTypeOnly || (isTypeOnly = !!(typeSymbol && getTypeOnlyAliasDeclaration(typeSymbol, 788968 /* Type */)));
+      }
+      if (resolvedValueSymbol && resolvedValueSymbol === resolvedTypeSymbol) {
         const globalPromiseSymbol = getGlobalPromiseConstructorSymbol(
           /*reportErrors*/
           false
         );
-        if (globalPromiseSymbol && resolvedSymbol === globalPromiseSymbol) {
+        if (globalPromiseSymbol && resolvedValueSymbol === globalPromiseSymbol) {
           return 9 /* Promise */;
         }
-        const constructorType = getTypeOfSymbol(resolvedSymbol);
+        const constructorType = getTypeOfSymbol(resolvedValueSymbol);
         if (constructorType && isConstructorType(constructorType)) {
           return isTypeOnly ? 10 /* TypeWithCallSignature */ : 1 /* TypeWithConstructSignatureAndValue */;
         }
       }
-      if (!typeSymbol) {
+      if (!resolvedTypeSymbol) {
         return isTypeOnly ? 11 /* ObjectType */ : 0 /* Unknown */;
       }
-      const type = getDeclaredTypeOfSymbol(typeSymbol);
+      const type = getDeclaredTypeOfSymbol(resolvedTypeSymbol);
       if (isErrorType(type)) {
         return isTypeOnly ? 11 /* ObjectType */ : 0 /* Unknown */;
       } else if (type.flags & 3 /* AnyOrUnknown */) {
@@ -85012,7 +85828,7 @@ ${lanes.join("\n")}
       if (enumResult)
         return enumResult;
       const literalValue = type.value;
-      return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "number" ? factory.createNumericLiteral(literalValue) : factory.createStringLiteral(literalValue);
+      return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "string" ? factory.createStringLiteral(literalValue) : literalValue < 0 ? factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(-literalValue)) : factory.createNumericLiteral(literalValue);
     }
     function createLiteralConstValue(node, tracker) {
       const type = getTypeOfSymbol(getSymbolOfDeclaration(node));
@@ -85553,6 +86369,7 @@ ${lanes.join("\n")}
       return externalHelpersModule;
     }
     function checkGrammarModifiers(node) {
+      var _a;
       const quickResult = reportObviousDecoratorErrors(node) || reportObviousModifierErrors(node);
       if (quickResult !== void 0) {
         return quickResult;
@@ -85616,15 +86433,16 @@ ${lanes.join("\n")}
             }
           }
           switch (modifier.kind) {
-            case 87 /* ConstKeyword */:
+            case 87 /* ConstKeyword */: {
               if (node.kind !== 266 /* EnumDeclaration */ && node.kind !== 168 /* TypeParameter */) {
                 return grammarErrorOnNode(node, Diagnostics.A_class_member_cannot_have_the_0_keyword, tokenToString(87 /* ConstKeyword */));
               }
-              const parent2 = node.parent;
+              const parent2 = isJSDocTemplateTag(node.parent) && getEffectiveJSDocHost(node.parent) || node.parent;
               if (node.kind === 168 /* TypeParameter */ && !(isFunctionLikeDeclaration(parent2) || isClassLike(parent2) || isFunctionTypeNode(parent2) || isConstructorTypeNode(parent2) || isCallSignatureDeclaration(parent2) || isConstructSignatureDeclaration(parent2) || isMethodSignature(parent2))) {
                 return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class, tokenToString(modifier.kind));
               }
               break;
+            }
             case 164 /* OverrideKeyword */:
               if (flags & 16 /* Override */) {
                 return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "override");
@@ -85824,10 +86642,11 @@ ${lanes.join("\n")}
               lastAsync = modifier;
               break;
             case 103 /* InKeyword */:
-            case 147 /* OutKeyword */:
+            case 147 /* OutKeyword */: {
               const inOutFlag = modifier.kind === 103 /* InKeyword */ ? 8192 /* In */ : 16384 /* Out */;
               const inOutText = modifier.kind === 103 /* InKeyword */ ? "in" : "out";
-              if (node.kind !== 168 /* TypeParameter */ || !(isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent))) {
+              const parent2 = isJSDocTemplateTag(node.parent) && (getEffectiveJSDocHost(node.parent) || find((_a = getJSDocRoot(node.parent)) == null ? void 0 : _a.tags, isJSDocTypedefTag)) || node.parent;
+              if (node.kind !== 168 /* TypeParameter */ || parent2 && !(isInterfaceDeclaration(parent2) || isClassLike(parent2) || isTypeAliasDeclaration(parent2) || isJSDocTypedefTag(parent2))) {
                 return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText);
               }
               if (flags & inOutFlag) {
@@ -85838,6 +86657,7 @@ ${lanes.join("\n")}
               }
               flags |= inOutFlag;
               break;
+            }
           }
         }
       }
@@ -86322,7 +87142,7 @@ ${lanes.join("\n")}
                   }
                 default:
                   diagnostics.add(
-                    createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher)
+                    createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher)
                   );
                   break;
               }
@@ -87231,7 +88051,8 @@ ${lanes.join("\n")}
         Uppercase: 0 /* Uppercase */,
         Lowercase: 1 /* Lowercase */,
         Capitalize: 2 /* Capitalize */,
-        Uncapitalize: 3 /* Uncapitalize */
+        Uncapitalize: 3 /* Uncapitalize */,
+        NoInfer: 4 /* NoInfer */
       }));
       SymbolLinks = class {
       };
@@ -87600,7 +88421,7 @@ ${lanes.join("\n")}
       return discarded ? discardVisitor(node) : visitor(node);
     }, isExpression);
   }
-  function visitEachChild(node, visitor, context, nodesVisitor = visitNodes2, tokenVisitor, nodeVisitor = visitNode) {
+  function visitEachChild(node, visitor, context = nullTransformationContext, nodesVisitor = visitNodes2, tokenVisitor, nodeVisitor = visitNode) {
     if (node === void 0) {
       return void 0;
     }
@@ -89625,6 +90446,12 @@ ${lanes.join("\n")}
   function accessPrivateIdentifier(env, name) {
     return walkUpLexicalEnvironments(env, (env2) => getPrivateIdentifier(env2.privateEnv, name));
   }
+  function isSimpleParameter(node) {
+    return !node.initializer && isIdentifier(node.name);
+  }
+  function isSimpleParameterList(nodes) {
+    return every(nodes, isSimpleParameter);
+  }
   var IdentifierNameMap, IdentifierNameMultiMap;
   var init_utilities3 = __esm({
     "src/compiler/transformers/utilities.ts"() {
@@ -90652,9 +91479,50 @@ ${lanes.join("\n")}
           return visitorWorker(node);
       }
     }
-    function visitElidableStatement(node) {
+    function isElisionBlocked(node) {
       const parsed = getParseTreeNode(node);
-      if (parsed !== node) {
+      if (parsed === node || isExportAssignment(node)) {
+        return false;
+      }
+      if (!parsed || parsed.kind !== node.kind) {
+        return true;
+      }
+      switch (node.kind) {
+        case 272 /* ImportDeclaration */:
+          Debug.assertNode(parsed, isImportDeclaration);
+          if (node.importClause !== parsed.importClause) {
+            return true;
+          }
+          if (node.attributes !== parsed.attributes) {
+            return true;
+          }
+          break;
+        case 271 /* ImportEqualsDeclaration */:
+          Debug.assertNode(parsed, isImportEqualsDeclaration);
+          if (node.name !== parsed.name) {
+            return true;
+          }
+          if (node.isTypeOnly !== parsed.isTypeOnly) {
+            return true;
+          }
+          if (node.moduleReference !== parsed.moduleReference && (isEntityName(node.moduleReference) || isEntityName(parsed.moduleReference))) {
+            return true;
+          }
+          break;
+        case 278 /* ExportDeclaration */:
+          Debug.assertNode(parsed, isExportDeclaration);
+          if (node.exportClause !== parsed.exportClause) {
+            return true;
+          }
+          if (node.attributes !== parsed.attributes) {
+            return true;
+          }
+          break;
+      }
+      return false;
+    }
+    function visitElidableStatement(node) {
+      if (isElisionBlocked(node)) {
         if (node.transformFlags & 1 /* ContainsTypeScript */) {
           return visitEachChild(node, visitor, context);
         }
@@ -91786,7 +92654,7 @@ ${lanes.join("\n")}
     function transformEnumMemberDeclarationValue(member) {
       const value = resolver.getConstantValue(member);
       if (value !== void 0) {
-        return typeof value === "string" ? factory2.createStringLiteral(value) : factory2.createNumericLiteral(value);
+        return typeof value === "string" ? factory2.createStringLiteral(value) : value < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-value)) : factory2.createNumericLiteral(value);
       } else {
         enableSubstitutionForNonQualifiedEnumMembers();
         if (member.initializer) {
@@ -92316,7 +93184,7 @@ ${lanes.join("\n")}
       const constantValue = tryGetConstEnumValue(node);
       if (constantValue !== void 0) {
         setConstantValue(node, constantValue);
-        const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : constantValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(Math.abs(constantValue))) : factory2.createNumericLiteral(constantValue);
+        const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : constantValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-constantValue)) : factory2.createNumericLiteral(constantValue);
         if (!compilerOptions.removeComments) {
           const originalNode = getOriginalNode(node, isAccessExpression);
           addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, ` ${safeMultiLineComment(getTextOfNode(originalNode))} `);
@@ -95765,22 +96633,49 @@ ${lanes.join("\n")}
     }
     function createClassInfo(node) {
       const metadataReference = factory2.createUniqueName("_metadata", 16 /* Optimistic */ | 32 /* FileLevel */);
-      let instanceExtraInitializersName;
-      let staticExtraInitializersName;
+      let instanceMethodExtraInitializersName;
+      let staticMethodExtraInitializersName;
       let hasStaticInitializers = false;
       let hasNonAmbientInstanceFields = false;
       let hasStaticPrivateClassElements = false;
+      let classThis2;
+      let pendingStaticInitializers;
+      let pendingInstanceInitializers;
+      if (nodeIsDecorated(
+        /*useLegacyDecorators*/
+        false,
+        node
+      )) {
+        const needsUniqueClassThis = some(node.members, (member) => (isPrivateIdentifierClassElementDeclaration(member) || isAutoAccessorPropertyDeclaration(member)) && hasStaticModifier(member));
+        classThis2 = factory2.createUniqueName(
+          "_classThis",
+          needsUniqueClassThis ? 16 /* Optimistic */ | 8 /* ReservedInNestedScopes */ : 16 /* Optimistic */ | 32 /* FileLevel */
+        );
+      }
       for (const member of node.members) {
-        if (isNamedClassElement(member) && nodeOrChildIsDecorated(
+        if (isMethodOrAccessor(member) && nodeOrChildIsDecorated(
           /*useLegacyDecorators*/
           false,
           member,
           node
         )) {
           if (hasStaticModifier(member)) {
-            staticExtraInitializersName ?? (staticExtraInitializersName = factory2.createUniqueName("_staticExtraInitializers", 16 /* Optimistic */ | 32 /* FileLevel */));
+            if (!staticMethodExtraInitializersName) {
+              staticMethodExtraInitializersName = factory2.createUniqueName("_staticExtraInitializers", 16 /* Optimistic */ | 32 /* FileLevel */);
+              const initializer = emitHelpers().createRunInitializersHelper(classThis2 ?? factory2.createThis(), staticMethodExtraInitializersName);
+              setSourceMapRange(initializer, node.name ?? moveRangePastDecorators(node));
+              pendingStaticInitializers ?? (pendingStaticInitializers = []);
+              pendingStaticInitializers.push(initializer);
+            }
           } else {
-            instanceExtraInitializersName ?? (instanceExtraInitializersName = factory2.createUniqueName("_instanceExtraInitializers", 16 /* Optimistic */ | 32 /* FileLevel */));
+            if (!instanceMethodExtraInitializersName) {
+              instanceMethodExtraInitializersName = factory2.createUniqueName("_instanceExtraInitializers", 16 /* Optimistic */ | 32 /* FileLevel */);
+              const initializer = emitHelpers().createRunInitializersHelper(factory2.createThis(), instanceMethodExtraInitializersName);
+              setSourceMapRange(initializer, node.name ?? moveRangePastDecorators(node));
+              pendingInstanceInitializers ?? (pendingInstanceInitializers = []);
+              pendingInstanceInitializers.push(initializer);
+            }
+            instanceMethodExtraInitializersName ?? (instanceMethodExtraInitializersName = factory2.createUniqueName("_instanceExtraInitializers", 16 /* Optimistic */ | 32 /* FileLevel */));
           }
         }
         if (isClassStaticBlockDeclaration(member)) {
@@ -95797,18 +96692,21 @@ ${lanes.join("\n")}
         if ((isPrivateIdentifierClassElementDeclaration(member) || isAutoAccessorPropertyDeclaration(member)) && hasStaticModifier(member)) {
           hasStaticPrivateClassElements = true;
         }
-        if (staticExtraInitializersName && instanceExtraInitializersName && hasStaticInitializers && hasNonAmbientInstanceFields && hasStaticPrivateClassElements) {
+        if (staticMethodExtraInitializersName && instanceMethodExtraInitializersName && hasStaticInitializers && hasNonAmbientInstanceFields && hasStaticPrivateClassElements) {
           break;
         }
       }
       return {
         class: node,
+        classThis: classThis2,
         metadataReference,
-        instanceExtraInitializersName,
-        staticExtraInitializersName,
+        instanceMethodExtraInitializersName,
+        staticMethodExtraInitializersName,
         hasStaticInitializers,
         hasNonAmbientInstanceFields,
-        hasStaticPrivateClassElements
+        hasStaticPrivateClassElements,
+        pendingStaticInitializers,
+        pendingInstanceInitializers
       };
     }
     function transformClassLike(node) {
@@ -95841,11 +96739,7 @@ ${lanes.join("\n")}
         classInfo2.classDecoratorsName = factory2.createUniqueName("_classDecorators", 16 /* Optimistic */ | 32 /* FileLevel */);
         classInfo2.classDescriptorName = factory2.createUniqueName("_classDescriptor", 16 /* Optimistic */ | 32 /* FileLevel */);
         classInfo2.classExtraInitializersName = factory2.createUniqueName("_classExtraInitializers", 16 /* Optimistic */ | 32 /* FileLevel */);
-        const needsUniqueClassThis = some(node.members, (member) => (isPrivateIdentifierClassElementDeclaration(member) || isAutoAccessorPropertyDeclaration(member)) && hasStaticModifier(member));
-        classInfo2.classThis = factory2.createUniqueName(
-          "_classThis",
-          needsUniqueClassThis ? 16 /* Optimistic */ | 8 /* ReservedInNestedScopes */ : 16 /* Optimistic */ | 32 /* FileLevel */
-        );
+        Debug.assertIsDefined(classInfo2.classThis);
         classDefinitionStatements.push(
           createLet(classInfo2.classDecoratorsName, factory2.createArrayLiteralExpression(classDecorators)),
           createLet(classInfo2.classDescriptorName),
@@ -95877,7 +96771,9 @@ ${lanes.join("\n")}
       const renamedClassThis = classInfo2.classThis ?? factory2.createThis();
       enterClass(classInfo2);
       leadingBlockStatements = append(leadingBlockStatements, createMetadata(classInfo2.metadataReference, classInfo2.classSuper));
-      let members = visitNodes2(node.members, classElementVisitor, isClassElement);
+      let members = node.members;
+      members = visitNodes2(members, (node2) => isConstructorDeclaration(node2) ? node2 : classElementVisitor(node2), isClassElement);
+      members = visitNodes2(members, (node2) => isConstructorDeclaration(node2) ? classElementVisitor(node2) : node2, isClassElement);
       if (pendingExpressions) {
         let outerThis;
         for (let expression of pendingExpressions) {
@@ -95902,7 +96798,7 @@ ${lanes.join("\n")}
         pendingExpressions = void 0;
       }
       exitClass();
-      if (classInfo2.instanceExtraInitializersName && !getFirstConstructorWithBody(node)) {
+      if (some(classInfo2.pendingInstanceInitializers) && !getFirstConstructorWithBody(node)) {
         const initializerStatements = prepareConstructor(node, classInfo2);
         if (initializerStatements) {
           const extendsClauseElement = getEffectiveBaseTypeNode(node);
@@ -95932,14 +96828,14 @@ ${lanes.join("\n")}
           );
         }
       }
-      if (classInfo2.staticExtraInitializersName) {
+      if (classInfo2.staticMethodExtraInitializersName) {
         classDefinitionStatements.push(
-          createLet(classInfo2.staticExtraInitializersName, factory2.createArrayLiteralExpression())
+          createLet(classInfo2.staticMethodExtraInitializersName, factory2.createArrayLiteralExpression())
         );
       }
-      if (classInfo2.instanceExtraInitializersName) {
+      if (classInfo2.instanceMethodExtraInitializersName) {
         classDefinitionStatements.push(
-          createLet(classInfo2.instanceExtraInitializersName, factory2.createArrayLiteralExpression())
+          createLet(classInfo2.instanceMethodExtraInitializersName, factory2.createArrayLiteralExpression())
         );
       }
       if (classInfo2.memberInfos) {
@@ -95949,6 +96845,9 @@ ${lanes.join("\n")}
             if (memberInfo.memberInitializersName) {
               classDefinitionStatements.push(createLet(memberInfo.memberInitializersName, factory2.createArrayLiteralExpression()));
             }
+            if (memberInfo.memberExtraInitializersName) {
+              classDefinitionStatements.push(createLet(memberInfo.memberExtraInitializersName, factory2.createArrayLiteralExpression()));
+            }
             if (memberInfo.memberDescriptorName) {
               classDefinitionStatements.push(createLet(memberInfo.memberDescriptorName));
             }
@@ -95962,6 +96861,9 @@ ${lanes.join("\n")}
             if (memberInfo.memberInitializersName) {
               classDefinitionStatements.push(createLet(memberInfo.memberInitializersName, factory2.createArrayLiteralExpression()));
             }
+            if (memberInfo.memberExtraInitializersName) {
+              classDefinitionStatements.push(createLet(memberInfo.memberExtraInitializersName, factory2.createArrayLiteralExpression()));
+            }
             if (memberInfo.memberDescriptorName) {
               classDefinitionStatements.push(createLet(memberInfo.memberDescriptorName));
             }
@@ -95995,11 +96897,13 @@ ${lanes.join("\n")}
         leadingBlockStatements.push(factory2.createExpressionStatement(classReferenceAssignment));
       }
       leadingBlockStatements.push(createSymbolMetadata(renamedClassThis, classInfo2.metadataReference));
-      if (classInfo2.staticExtraInitializersName) {
-        const runStaticInitializersHelper = emitHelpers().createRunInitializersHelper(renamedClassThis, classInfo2.staticExtraInitializersName);
-        const runStaticInitializersStatement = factory2.createExpressionStatement(runStaticInitializersHelper);
-        setSourceMapRange(runStaticInitializersStatement, node.name ?? moveRangePastDecorators(node));
-        leadingBlockStatements = append(leadingBlockStatements, runStaticInitializersStatement);
+      if (some(classInfo2.pendingStaticInitializers)) {
+        for (const initializer of classInfo2.pendingStaticInitializers) {
+          const initializerStatement = factory2.createExpressionStatement(initializer);
+          setSourceMapRange(initializerStatement, getSourceMapRange(initializer));
+          trailingBlockStatements = append(trailingBlockStatements, initializerStatement);
+        }
+        classInfo2.pendingStaticInitializers = void 0;
       }
       if (classInfo2.classExtraInitializersName) {
         const runClassInitializersHelper = emitHelpers().createRunInitializersHelper(renamedClassThis, classInfo2.classExtraInitializersName);
@@ -96230,16 +97134,14 @@ ${lanes.join("\n")}
       }
     }
     function prepareConstructor(_parent, classInfo2) {
-      if (classInfo2.instanceExtraInitializersName && !classInfo2.hasNonAmbientInstanceFields) {
+      if (some(classInfo2.pendingInstanceInitializers)) {
         const statements = [];
         statements.push(
           factory2.createExpressionStatement(
-            emitHelpers().createRunInitializersHelper(
-              factory2.createThis(),
-              classInfo2.instanceExtraInitializersName
-            )
+            factory2.inlineExpressions(classInfo2.pendingInstanceInitializers)
           )
         );
+        classInfo2.pendingInstanceInitializers = void 0;
         return statements;
       }
     }
@@ -96319,6 +97221,7 @@ ${lanes.join("\n")}
       let referencedName;
       let name;
       let initializersName;
+      let extraInitializersName;
       let thisArg;
       let descriptorName;
       if (!classInfo2) {
@@ -96376,20 +97279,22 @@ ${lanes.join("\n")}
           },
           metadata: classInfo2.metadataReference
         };
-        const extraInitializers = isStatic(member) ? classInfo2.staticExtraInitializersName ?? (classInfo2.staticExtraInitializersName = factory2.createUniqueName("_staticExtraInitializers", 16 /* Optimistic */ | 32 /* FileLevel */)) : classInfo2.instanceExtraInitializersName ?? (classInfo2.instanceExtraInitializersName = factory2.createUniqueName("_instanceExtraInitializers", 16 /* Optimistic */ | 32 /* FileLevel */));
         if (isMethodOrAccessor(member)) {
+          const methodExtraInitializersName = isStatic(member) ? classInfo2.staticMethodExtraInitializersName : classInfo2.instanceMethodExtraInitializersName;
+          Debug.assertIsDefined(methodExtraInitializersName);
           let descriptor;
           if (isPrivateIdentifierClassElementDeclaration(member) && createDescriptor) {
             descriptor = createDescriptor(member, visitNodes2(modifiers, (node) => tryCast(node, isAsyncModifier), isModifier));
             memberInfo.memberDescriptorName = descriptorName = createHelperVariable(member, "descriptor");
             descriptor = factory2.createAssignment(descriptorName, descriptor);
           }
-          const esDecorateExpression = emitHelpers().createESDecorateHelper(factory2.createThis(), descriptor ?? factory2.createNull(), memberDecoratorsName, context2, factory2.createNull(), extraInitializers);
+          const esDecorateExpression = emitHelpers().createESDecorateHelper(factory2.createThis(), descriptor ?? factory2.createNull(), memberDecoratorsName, context2, factory2.createNull(), methodExtraInitializersName);
           const esDecorateStatement = factory2.createExpressionStatement(esDecorateExpression);
           setSourceMapRange(esDecorateStatement, moveRangePastDecorators(member));
           statements.push(esDecorateStatement);
         } else if (isPropertyDeclaration(member)) {
           initializersName = memberInfo.memberInitializersName ?? (memberInfo.memberInitializersName = createHelperVariable(member, "initializers"));
+          extraInitializersName = memberInfo.memberExtraInitializersName ?? (memberInfo.memberExtraInitializersName = createHelperVariable(member, "extraInitializers"));
           if (isStatic(member)) {
             thisArg = classInfo2.classThis;
           }
@@ -96409,7 +97314,7 @@ ${lanes.join("\n")}
             memberDecoratorsName,
             context2,
             initializersName,
-            extraInitializers
+            extraInitializersName
           );
           const esDecorateStatement = factory2.createExpressionStatement(esDecorateExpression);
           setSourceMapRange(esDecorateStatement, moveRangePastDecorators(member));
@@ -96424,7 +97329,7 @@ ${lanes.join("\n")}
       if (!some(modifiers) && (isMethodDeclaration(member) || isPropertyDeclaration(member))) {
         setEmitFlags(name, 1024 /* NoLeadingComments */);
       }
-      return { modifiers, referencedName, name, initializersName, descriptorName, thisArg };
+      return { modifiers, referencedName, name, initializersName, extraInitializersName, descriptorName, thisArg };
     }
     function visitMethodDeclaration(node) {
       enterClassElement(node);
@@ -96497,9 +97402,27 @@ ${lanes.join("\n")}
         result = visitEachChild(node, visitor, context);
         classThis = savedClassThis;
       } else {
-        if (classInfo)
+        node = visitEachChild(node, visitor, context);
+        result = node;
+        if (classInfo) {
           classInfo.hasStaticInitializers = true;
-        result = visitEachChild(node, visitor, context);
+          if (some(classInfo.pendingStaticInitializers)) {
+            const statements = [];
+            for (const initializer of classInfo.pendingStaticInitializers) {
+              const initializerStatement = factory2.createExpressionStatement(initializer);
+              setSourceMapRange(initializerStatement, getSourceMapRange(initializer));
+              statements.push(initializerStatement);
+            }
+            const body = factory2.createBlock(
+              statements,
+              /*multiLine*/
+              true
+            );
+            const staticBlock = factory2.createClassStaticBlockDeclaration(body);
+            result = [staticBlock, result];
+            classInfo.pendingStaticInitializers = void 0;
+          }
+        }
       }
       exitClassElement();
       return result;
@@ -96510,7 +97433,7 @@ ${lanes.join("\n")}
       }
       enterClassElement(node);
       Debug.assert(!isAmbientPropertyDeclaration(node), "Not yet implemented.");
-      const { modifiers, name, initializersName, descriptorName, thisArg } = partialTransformClassElement(node, classInfo, hasAccessorModifier(node) ? createAccessorPropertyDescriptorObject : void 0);
+      const { modifiers, name, initializersName, extraInitializersName, descriptorName, thisArg } = partialTransformClassElement(node, classInfo, hasAccessorModifier(node) ? createAccessorPropertyDescriptorObject : void 0);
       startLexicalEnvironment();
       let initializer = visitNode(node.initializer, visitor, isExpression);
       if (initializersName) {
@@ -96520,17 +97443,6 @@ ${lanes.join("\n")}
           initializer ?? factory2.createVoidZero()
         );
       }
-      if (!isStatic(node) && (classInfo == null ? void 0 : classInfo.instanceExtraInitializersName) && !(classInfo == null ? void 0 : classInfo.hasInjectedInstanceInitializers)) {
-        classInfo.hasInjectedInstanceInitializers = true;
-        initializer ?? (initializer = factory2.createVoidZero());
-        initializer = factory2.createParenthesizedExpression(factory2.createComma(
-          emitHelpers().createRunInitializersHelper(
-            factory2.createThis(),
-            classInfo.instanceExtraInitializersName
-          ),
-          initializer
-        ));
-      }
       if (isStatic(node) && classInfo && initializer) {
         classInfo.hasStaticInitializers = true;
       }
@@ -96541,6 +97453,41 @@ ${lanes.join("\n")}
           factory2.createReturnStatement(initializer)
         ]);
       }
+      if (classInfo) {
+        if (isStatic(node)) {
+          initializer = injectPendingInitializers(
+            classInfo,
+            /*isStatic*/
+            true,
+            initializer
+          );
+          if (extraInitializersName) {
+            classInfo.pendingStaticInitializers ?? (classInfo.pendingStaticInitializers = []);
+            classInfo.pendingStaticInitializers.push(
+              emitHelpers().createRunInitializersHelper(
+                classInfo.classThis ?? factory2.createThis(),
+                extraInitializersName
+              )
+            );
+          }
+        } else {
+          initializer = injectPendingInitializers(
+            classInfo,
+            /*isStatic*/
+            false,
+            initializer
+          );
+          if (extraInitializersName) {
+            classInfo.pendingInstanceInitializers ?? (classInfo.pendingInstanceInitializers = []);
+            classInfo.pendingInstanceInitializers.push(
+              emitHelpers().createRunInitializersHelper(
+                factory2.createThis(),
+                extraInitializersName
+              )
+            );
+          }
+        }
+      }
       exitClassElement();
       if (hasAccessorModifier(node) && descriptorName) {
         const commentRange = getCommentRange(node);
@@ -96955,19 +97902,41 @@ ${lanes.join("\n")}
       const expression = visitNode(node.expression, visitorFunc, isExpression);
       return factory2.updatePartiallyEmittedExpression(node, expression);
     }
-    function injectPendingExpressions(expression) {
-      if (some(pendingExpressions)) {
-        if (isParenthesizedExpression(expression)) {
-          pendingExpressions.push(expression.expression);
-          expression = factory2.updateParenthesizedExpression(expression, factory2.inlineExpressions(pendingExpressions));
+    function injectPendingExpressionsCommon(pendingExpressions2, expression) {
+      if (some(pendingExpressions2)) {
+        if (expression) {
+          if (isParenthesizedExpression(expression)) {
+            pendingExpressions2.push(expression.expression);
+            expression = factory2.updateParenthesizedExpression(expression, factory2.inlineExpressions(pendingExpressions2));
+          } else {
+            pendingExpressions2.push(expression);
+            expression = factory2.inlineExpressions(pendingExpressions2);
+          }
         } else {
-          pendingExpressions.push(expression);
-          expression = factory2.inlineExpressions(pendingExpressions);
+          expression = factory2.inlineExpressions(pendingExpressions2);
         }
-        pendingExpressions = void 0;
       }
       return expression;
     }
+    function injectPendingExpressions(expression) {
+      const result = injectPendingExpressionsCommon(pendingExpressions, expression);
+      Debug.assertIsDefined(result);
+      if (result !== expression) {
+        pendingExpressions = void 0;
+      }
+      return result;
+    }
+    function injectPendingInitializers(classInfo2, isStatic2, expression) {
+      const result = injectPendingExpressionsCommon(isStatic2 ? classInfo2.pendingStaticInitializers : classInfo2.pendingInstanceInitializers, expression);
+      if (result !== expression) {
+        if (isStatic2) {
+          classInfo2.pendingStaticInitializers = void 0;
+        } else {
+          classInfo2.pendingInstanceInitializers = void 0;
+        }
+      }
+      return result;
+    }
     function transformAllDecoratorsOfDeclaration(allDecorators) {
       if (!allDecorators) {
         return void 0;
@@ -97254,6 +98223,7 @@ ${lanes.join("\n")}
     let enclosingFunctionParameterNames;
     let capturedSuperProperties;
     let hasSuperElementAccess;
+    let lexicalArgumentsBinding;
     const substitutedSuperAccessors = [];
     let contextFlags = 0 /* None */;
     const previousOnEmitNode = context.onEmitNode;
@@ -97304,9 +98274,30 @@ ${lanes.join("\n")}
     function visitDefault(node) {
       return visitEachChild(node, visitor, context);
     }
+    function argumentsVisitor(node) {
+      switch (node.kind) {
+        case 218 /* FunctionExpression */:
+        case 262 /* FunctionDeclaration */:
+        case 174 /* MethodDeclaration */:
+        case 177 /* GetAccessor */:
+        case 178 /* SetAccessor */:
+        case 176 /* Constructor */:
+          return node;
+        case 169 /* Parameter */:
+        case 208 /* BindingElement */:
+        case 260 /* VariableDeclaration */:
+          break;
+        case 80 /* Identifier */:
+          if (lexicalArgumentsBinding && resolver.isArgumentsLocalBinding(node)) {
+            return lexicalArgumentsBinding;
+          }
+          break;
+      }
+      return visitEachChild(node, argumentsVisitor, context);
+    }
     function visitor(node) {
       if ((node.transformFlags & 256 /* ContainsES2017 */) === 0) {
-        return node;
+        return lexicalArgumentsBinding ? argumentsVisitor(node) : node;
       }
       switch (node.kind) {
         case 134 /* AsyncKeyword */:
@@ -97464,15 +98455,23 @@ ${lanes.join("\n")}
       );
     }
     function visitConstructorDeclaration(node) {
-      return factory2.updateConstructorDeclaration(
+      const savedLexicalArgumentsBinding = lexicalArgumentsBinding;
+      lexicalArgumentsBinding = void 0;
+      const updated = factory2.updateConstructorDeclaration(
         node,
         visitNodes2(node.modifiers, visitor, isModifier),
         visitParameterList(node.parameters, visitor, context),
         transformMethodBody(node)
       );
+      lexicalArgumentsBinding = savedLexicalArgumentsBinding;
+      return updated;
     }
     function visitMethodDeclaration(node) {
-      return factory2.updateMethodDeclaration(
+      let parameters;
+      const functionFlags = getFunctionFlags(node);
+      const savedLexicalArgumentsBinding = lexicalArgumentsBinding;
+      lexicalArgumentsBinding = void 0;
+      const updated = factory2.updateMethodDeclaration(
         node,
         visitNodes2(node.modifiers, visitor, isModifierLike),
         node.asteriskToken,
@@ -97481,14 +98480,18 @@ ${lanes.join("\n")}
         void 0,
         /*typeParameters*/
         void 0,
-        visitParameterList(node.parameters, visitor, context),
+        parameters = functionFlags & 2 /* Async */ ? transformAsyncFunctionParameterList(node) : visitParameterList(node.parameters, visitor, context),
         /*type*/
         void 0,
-        getFunctionFlags(node) & 2 /* Async */ ? transformAsyncFunctionBody(node) : transformMethodBody(node)
+        functionFlags & 2 /* Async */ ? transformAsyncFunctionBody(node, parameters) : transformMethodBody(node)
       );
+      lexicalArgumentsBinding = savedLexicalArgumentsBinding;
+      return updated;
     }
     function visitGetAccessorDeclaration(node) {
-      return factory2.updateGetAccessorDeclaration(
+      const savedLexicalArgumentsBinding = lexicalArgumentsBinding;
+      lexicalArgumentsBinding = void 0;
+      const updated = factory2.updateGetAccessorDeclaration(
         node,
         visitNodes2(node.modifiers, visitor, isModifierLike),
         node.name,
@@ -97497,55 +98500,75 @@ ${lanes.join("\n")}
         void 0,
         transformMethodBody(node)
       );
+      lexicalArgumentsBinding = savedLexicalArgumentsBinding;
+      return updated;
     }
     function visitSetAccessorDeclaration(node) {
-      return factory2.updateSetAccessorDeclaration(
+      const savedLexicalArgumentsBinding = lexicalArgumentsBinding;
+      lexicalArgumentsBinding = void 0;
+      const updated = factory2.updateSetAccessorDeclaration(
         node,
         visitNodes2(node.modifiers, visitor, isModifierLike),
         node.name,
         visitParameterList(node.parameters, visitor, context),
         transformMethodBody(node)
       );
+      lexicalArgumentsBinding = savedLexicalArgumentsBinding;
+      return updated;
     }
     function visitFunctionDeclaration(node) {
-      return factory2.updateFunctionDeclaration(
+      let parameters;
+      const savedLexicalArgumentsBinding = lexicalArgumentsBinding;
+      lexicalArgumentsBinding = void 0;
+      const functionFlags = getFunctionFlags(node);
+      const updated = factory2.updateFunctionDeclaration(
         node,
         visitNodes2(node.modifiers, visitor, isModifierLike),
         node.asteriskToken,
         node.name,
         /*typeParameters*/
         void 0,
-        visitParameterList(node.parameters, visitor, context),
+        parameters = functionFlags & 2 /* Async */ ? transformAsyncFunctionParameterList(node) : visitParameterList(node.parameters, visitor, context),
         /*type*/
         void 0,
-        getFunctionFlags(node) & 2 /* Async */ ? transformAsyncFunctionBody(node) : visitFunctionBody(node.body, visitor, context)
+        functionFlags & 2 /* Async */ ? transformAsyncFunctionBody(node, parameters) : visitFunctionBody(node.body, visitor, context)
       );
+      lexicalArgumentsBinding = savedLexicalArgumentsBinding;
+      return updated;
     }
     function visitFunctionExpression(node) {
-      return factory2.updateFunctionExpression(
+      let parameters;
+      const savedLexicalArgumentsBinding = lexicalArgumentsBinding;
+      lexicalArgumentsBinding = void 0;
+      const functionFlags = getFunctionFlags(node);
+      const updated = factory2.updateFunctionExpression(
         node,
         visitNodes2(node.modifiers, visitor, isModifier),
         node.asteriskToken,
         node.name,
         /*typeParameters*/
         void 0,
-        visitParameterList(node.parameters, visitor, context),
+        parameters = functionFlags & 2 /* Async */ ? transformAsyncFunctionParameterList(node) : visitParameterList(node.parameters, visitor, context),
         /*type*/
         void 0,
-        getFunctionFlags(node) & 2 /* Async */ ? transformAsyncFunctionBody(node) : visitFunctionBody(node.body, visitor, context)
+        functionFlags & 2 /* Async */ ? transformAsyncFunctionBody(node, parameters) : visitFunctionBody(node.body, visitor, context)
       );
+      lexicalArgumentsBinding = savedLexicalArgumentsBinding;
+      return updated;
     }
     function visitArrowFunction(node) {
+      let parameters;
+      const functionFlags = getFunctionFlags(node);
       return factory2.updateArrowFunction(
         node,
         visitNodes2(node.modifiers, visitor, isModifier),
         /*typeParameters*/
         void 0,
-        visitParameterList(node.parameters, visitor, context),
+        parameters = functionFlags & 2 /* Async */ ? transformAsyncFunctionParameterList(node) : visitParameterList(node.parameters, visitor, context),
         /*type*/
         void 0,
         node.equalsGreaterThanToken,
-        getFunctionFlags(node) & 2 /* Async */ ? transformAsyncFunctionBody(node) : visitFunctionBody(node.body, visitor, context)
+        functionFlags & 2 /* Async */ ? transformAsyncFunctionBody(node, parameters) : visitFunctionBody(node.body, visitor, context)
       );
     }
     function recordDeclarationName({ name }, names) {
@@ -97639,13 +98662,91 @@ ${lanes.join("\n")}
       hasSuperElementAccess = savedHasSuperElementAccess;
       return updated;
     }
-    function transformAsyncFunctionBody(node) {
+    function createCaptureArgumentsStatement() {
+      Debug.assert(lexicalArgumentsBinding);
+      const variable = factory2.createVariableDeclaration(
+        lexicalArgumentsBinding,
+        /*exclamationToken*/
+        void 0,
+        /*type*/
+        void 0,
+        factory2.createIdentifier("arguments")
+      );
+      const statement = factory2.createVariableStatement(
+        /*modifiers*/
+        void 0,
+        [variable]
+      );
+      startOnNewLine(statement);
+      addEmitFlags(statement, 2097152 /* CustomPrologue */);
+      return statement;
+    }
+    function transformAsyncFunctionParameterList(node) {
+      if (isSimpleParameterList(node.parameters)) {
+        return visitParameterList(node.parameters, visitor, context);
+      }
+      const newParameters = [];
+      for (const parameter of node.parameters) {
+        if (parameter.initializer || parameter.dotDotDotToken) {
+          if (node.kind === 219 /* ArrowFunction */) {
+            const restParameter = factory2.createParameterDeclaration(
+              /*modifiers*/
+              void 0,
+              factory2.createToken(26 /* DotDotDotToken */),
+              factory2.createUniqueName("args", 8 /* ReservedInNestedScopes */)
+            );
+            newParameters.push(restParameter);
+          }
+          break;
+        }
+        const newParameter = factory2.createParameterDeclaration(
+          /*modifiers*/
+          void 0,
+          /*dotDotDotToken*/
+          void 0,
+          factory2.getGeneratedNameForNode(parameter.name, 8 /* ReservedInNestedScopes */)
+        );
+        newParameters.push(newParameter);
+      }
+      const newParametersArray = factory2.createNodeArray(newParameters);
+      setTextRange(newParametersArray, node.parameters);
+      return newParametersArray;
+    }
+    function transformAsyncFunctionBody(node, outerParameters) {
+      const innerParameters = !isSimpleParameterList(node.parameters) ? visitParameterList(node.parameters, visitor, context) : void 0;
       resumeLexicalEnvironment();
       const original = getOriginalNode(node, isFunctionLike);
       const nodeType = original.type;
       const promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : void 0;
       const isArrowFunction2 = node.kind === 219 /* ArrowFunction */;
+      const savedLexicalArgumentsBinding = lexicalArgumentsBinding;
       const hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 512 /* CaptureArguments */) !== 0;
+      const captureLexicalArguments = hasLexicalArguments && !lexicalArgumentsBinding;
+      if (captureLexicalArguments) {
+        lexicalArgumentsBinding = factory2.createUniqueName("arguments");
+      }
+      let argumentsExpression;
+      if (innerParameters) {
+        if (isArrowFunction2) {
+          const parameterBindings = [];
+          Debug.assert(outerParameters.length <= node.parameters.length);
+          for (let i = 0; i < node.parameters.length; i++) {
+            Debug.assert(i < outerParameters.length);
+            const originalParameter = node.parameters[i];
+            const outerParameter = outerParameters[i];
+            Debug.assertNode(outerParameter.name, isIdentifier);
+            if (originalParameter.initializer || originalParameter.dotDotDotToken) {
+              Debug.assert(i === outerParameters.length - 1);
+              parameterBindings.push(factory2.createSpreadElement(outerParameter.name));
+              break;
+            }
+            parameterBindings.push(outerParameter.name);
+          }
+          argumentsExpression = factory2.createArrayLiteralExpression(parameterBindings);
+        } else {
+          argumentsExpression = factory2.createIdentifier("arguments");
+        }
+      }
       const savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames;
       enclosingFunctionParameterNames = /* @__PURE__ */ new Set();
       for (const parameter of node.parameters) {
@@ -97657,27 +98758,23 @@ ${lanes.join("\n")}
         capturedSuperProperties = /* @__PURE__ */ new Set();
         hasSuperElementAccess = false;
       }
+      const hasLexicalThis = inHasLexicalThisContext();
+      let asyncBody = transformAsyncFunctionBodyWorker(node.body);
+      asyncBody = factory2.updateBlock(asyncBody, factory2.mergeLexicalEnvironment(asyncBody.statements, endLexicalEnvironment()));
       let result;
       if (!isArrowFunction2) {
         const statements = [];
-        const statementOffset = factory2.copyPrologue(
-          node.body.statements,
-          statements,
-          /*ensureUseStrict*/
-          false,
-          visitor
-        );
         statements.push(
           factory2.createReturnStatement(
             emitHelpers().createAwaiterHelper(
-              inHasLexicalThisContext(),
-              hasLexicalArguments,
+              hasLexicalThis,
+              argumentsExpression,
               promiseConstructor,
-              transformAsyncFunctionBodyWorker(node.body, statementOffset)
+              innerParameters,
+              asyncBody
             )
           )
         );
-        insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
         const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (256 /* MethodWithSuperPropertyAssignmentInAsync */ | 128 /* MethodWithSuperPropertyAccessInAsync */);
         if (emitSuperHelpers) {
           enableSubstitutionForAsyncMethodsWithSuper();
@@ -97687,6 +98784,9 @@ ${lanes.join("\n")}
             insertStatementsAfterStandardPrologue(statements, [variableStatement]);
           }
         }
+        if (captureLexicalArguments) {
+          insertStatementsAfterStandardPrologue(statements, [createCaptureArgumentsStatement()]);
+        }
         const block = factory2.createBlock(
           statements,
           /*multiLine*/
@@ -97702,24 +98802,23 @@ ${lanes.join("\n")}
         }
         result = block;
       } else {
-        const expression = emitHelpers().createAwaiterHelper(
-          inHasLexicalThisContext(),
-          hasLexicalArguments,
+        result = emitHelpers().createAwaiterHelper(
+          hasLexicalThis,
+          argumentsExpression,
           promiseConstructor,
-          transformAsyncFunctionBodyWorker(node.body)
+          innerParameters,
+          asyncBody
         );
-        const declarations = endLexicalEnvironment();
-        if (some(declarations)) {
-          const block = factory2.converters.convertToFunctionBlock(expression);
-          result = factory2.updateBlock(block, setTextRange(factory2.createNodeArray(concatenate(declarations, block.statements)), block.statements));
-        } else {
-          result = expression;
+        if (captureLexicalArguments) {
+          const block = factory2.converters.convertToFunctionBlock(result);
+          result = factory2.updateBlock(block, factory2.mergeLexicalEnvironment(block.statements, [createCaptureArgumentsStatement()]));
         }
       }
       enclosingFunctionParameterNames = savedEnclosingFunctionParameterNames;
       if (!isArrowFunction2) {
         capturedSuperProperties = savedCapturedSuperProperties;
         hasSuperElementAccess = savedHasSuperElementAccess;
+        lexicalArgumentsBinding = savedLexicalArgumentsBinding;
       }
       return result;
     }
@@ -98841,7 +99940,7 @@ ${lanes.join("\n")}
         ),
         /*typeParameters*/
         void 0,
-        visitParameterList(node.parameters, parameterVisitor, context),
+        enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ ? transformAsyncGeneratorFunctionParameterList(node) : visitParameterList(node.parameters, parameterVisitor, context),
         /*type*/
         void 0,
         enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ ? transformAsyncGeneratorFunctionBody(node) : transformFunctionBody2(node)
@@ -98862,7 +99961,7 @@ ${lanes.join("\n")}
         node.name,
         /*typeParameters*/
         void 0,
-        visitParameterList(node.parameters, parameterVisitor, context),
+        enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ ? transformAsyncGeneratorFunctionParameterList(node) : visitParameterList(node.parameters, parameterVisitor, context),
         /*type*/
         void 0,
         enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ ? transformAsyncGeneratorFunctionBody(node) : transformFunctionBody2(node)
@@ -98903,7 +100002,7 @@ ${lanes.join("\n")}
         node.name,
         /*typeParameters*/
         void 0,
-        visitParameterList(node.parameters, parameterVisitor, context),
+        enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ ? transformAsyncGeneratorFunctionParameterList(node) : visitParameterList(node.parameters, parameterVisitor, context),
         /*type*/
         void 0,
         enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ ? transformAsyncGeneratorFunctionBody(node) : transformFunctionBody2(node)
@@ -98912,21 +100011,38 @@ ${lanes.join("\n")}
       parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
       return updated;
     }
+    function transformAsyncGeneratorFunctionParameterList(node) {
+      if (isSimpleParameterList(node.parameters)) {
+        return visitParameterList(node.parameters, visitor, context);
+      }
+      const newParameters = [];
+      for (const parameter of node.parameters) {
+        if (parameter.initializer || parameter.dotDotDotToken) {
+          break;
+        }
+        const newParameter = factory2.createParameterDeclaration(
+          /*modifiers*/
+          void 0,
+          /*dotDotDotToken*/
+          void 0,
+          factory2.getGeneratedNameForNode(parameter.name, 8 /* ReservedInNestedScopes */)
+        );
+        newParameters.push(newParameter);
+      }
+      const newParametersArray = factory2.createNodeArray(newParameters);
+      setTextRange(newParametersArray, node.parameters);
+      return newParametersArray;
+    }
     function transformAsyncGeneratorFunctionBody(node) {
+      const innerParameters = !isSimpleParameterList(node.parameters) ? visitParameterList(node.parameters, visitor, context) : void 0;
       resumeLexicalEnvironment();
-      const statements = [];
-      const statementOffset = factory2.copyPrologue(
-        node.body.statements,
-        statements,
-        /*ensureUseStrict*/
-        false,
-        visitor
-      );
-      appendObjectRestAssignmentsIfNeeded(statements, node);
       const savedCapturedSuperProperties = capturedSuperProperties;
       const savedHasSuperElementAccess = hasSuperElementAccess;
       capturedSuperProperties = /* @__PURE__ */ new Set();
       hasSuperElementAccess = false;
+      const outerStatements = [];
+      let asyncBody = factory2.updateBlock(node.body, visitNodes2(node.body.statements, visitor, isStatement));
+      asyncBody = factory2.updateBlock(asyncBody, factory2.mergeLexicalEnvironment(asyncBody.statements, appendObjectRestAssignmentsIfNeeded(endLexicalEnvironment(), node)));
       const returnStatement = factory2.createReturnStatement(
         emitHelpers().createAsyncGeneratorHelper(
           factory2.createFunctionExpression(
@@ -98936,14 +100052,10 @@ ${lanes.join("\n")}
             node.name && factory2.getGeneratedNameForNode(node.name),
             /*typeParameters*/
             void 0,
-            /*parameters*/
-            [],
+            innerParameters ?? [],
             /*type*/
             void 0,
-            factory2.updateBlock(
-              node.body,
-              visitLexicalEnvironment(node.body.statements, visitor, context, statementOffset)
-            )
+            asyncBody
           ),
           !!(hierarchyFacts & 1 /* HasLexicalThis */)
         )
@@ -98953,11 +100065,10 @@ ${lanes.join("\n")}
         enableSubstitutionForAsyncMethodsWithSuper();
         const variableStatement = createSuperAccessVariableStatement(factory2, resolver, node, capturedSuperProperties);
         substitutedSuperAccessors[getNodeId(variableStatement)] = true;
-        insertStatementsAfterStandardPrologue(statements, [variableStatement]);
+        insertStatementsAfterStandardPrologue(outerStatements, [variableStatement]);
       }
-      statements.push(returnStatement);
-      insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
-      const block = factory2.updateBlock(node.body, statements);
+      outerStatements.push(returnStatement);
+      const block = factory2.updateBlock(node.body, outerStatements);
       if (emitSuperHelpers && hasSuperElementAccess) {
         if (resolver.getNodeCheckFlags(node) & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
           addEmitHelper(block, advancedAsyncSuperHelper);
@@ -101953,12 +103064,22 @@ ${lanes.join("\n")}
         case 172 /* PropertyDeclaration */: {
           const named = node;
           if (isComputedPropertyName(named.name)) {
-            return factory2.replacePropertyName(named, visitEachChild(named.name, elideUnusedThisCaptureWorker, nullTransformationContext));
+            return factory2.replacePropertyName(named, visitEachChild(
+              named.name,
+              elideUnusedThisCaptureWorker,
+              /*context*/
+              void 0
+            ));
           }
           return node;
         }
       }
-      return visitEachChild(node, elideUnusedThisCaptureWorker, nullTransformationContext);
+      return visitEachChild(
+        node,
+        elideUnusedThisCaptureWorker,
+        /*context*/
+        void 0
+      );
     }
     function simplifyConstructorElideUnusedThisCapture(body, original) {
       if (original.transformFlags & 16384 /* ContainsLexicalThis */ || hierarchyFacts & 65536 /* LexicalThis */ || hierarchyFacts & 131072 /* CapturedLexicalThis */) {
@@ -101994,12 +103115,22 @@ ${lanes.join("\n")}
         case 172 /* PropertyDeclaration */: {
           const named = node;
           if (isComputedPropertyName(named.name)) {
-            return factory2.replacePropertyName(named, visitEachChild(named.name, injectSuperPresenceCheckWorker, nullTransformationContext));
+            return factory2.replacePropertyName(named, visitEachChild(
+              named.name,
+              injectSuperPresenceCheckWorker,
+              /*context*/
+              void 0
+            ));
           }
           return node;
         }
       }
-      return visitEachChild(node, injectSuperPresenceCheckWorker, nullTransformationContext);
+      return visitEachChild(
+        node,
+        injectSuperPresenceCheckWorker,
+        /*context*/
+        void 0
+      );
     }
     function complicateConstructorInjectSuperPresenceCheck(body) {
       return factory2.updateBlock(body, visitNodes2(body.statements, injectSuperPresenceCheckWorker, isStatement));
@@ -106057,7 +107188,7 @@ ${lanes.join("\n")}
         if (labelExpressions === void 0) {
           labelExpressions = [];
         }
-        const expression = factory2.createNumericLiteral(-1);
+        const expression = factory2.createNumericLiteral(Number.MAX_SAFE_INTEGER);
         if (labelExpressions[label] === void 0) {
           labelExpressions[label] = [expression];
         } else {
@@ -109861,7 +110992,7 @@ ${lanes.join("\n")}
             setTextRange(factory2.createNodeArray(insertStatementsAfterCustomPrologue(result.statements.slice(), importRequireStatements)), result.statements)
           );
         }
-        if (!isExternalModule(node) || some(result.statements, isExternalModuleIndicator)) {
+        if (!isExternalModule(node) || getEmitModuleKind(compilerOptions) === 200 /* Preserve */ || some(result.statements, isExternalModuleIndicator)) {
           return result;
         }
         return factory2.updateSourceFile(
@@ -109904,6 +111035,14 @@ ${lanes.join("\n")}
       if (moduleName) {
         args.push(moduleName);
       }
+      if (getEmitModuleKind(compilerOptions) === 200 /* Preserve */) {
+        return factory2.createCallExpression(
+          factory2.createIdentifier("require"),
+          /*typeArguments*/
+          void 0,
+          args
+        );
+      }
       if (!importRequireStatements) {
         const createRequireName = factory2.createUniqueName("_createRequire", 16 /* Optimistic */ | 32 /* FileLevel */);
         const importStatement = factory2.createImportDeclaration(
@@ -110018,7 +111157,25 @@ ${lanes.join("\n")}
       return statements;
     }
     function visitExportAssignment(node) {
-      return node.isExportEquals ? void 0 : node;
+      if (node.isExportEquals) {
+        if (getEmitModuleKind(compilerOptions) === 200 /* Preserve */) {
+          const statement = setOriginalNode(
+            factory2.createExpressionStatement(
+              factory2.createAssignment(
+                factory2.createPropertyAccessExpression(
+                  factory2.createIdentifier("module"),
+                  "exports"
+                ),
+                node.expression
+              )
+            ),
+            node
+          );
+          return statement;
+        }
+        return void 0;
+      }
+      return node;
     }
     function visitExportDeclaration(node) {
       if (compilerOptions.module !== void 0 && compilerOptions.module > 5 /* ES2015 */) {
@@ -110446,44 +111603,6 @@ ${lanes.join("\n")}
     );
     return result.diagnostics;
   }
-  function hasInternalAnnotation(range, currentSourceFile) {
-    const comment = currentSourceFile.text.substring(range.pos, range.end);
-    return comment.includes("@internal");
-  }
-  function isInternalDeclaration(node, currentSourceFile) {
-    const parseTreeNode = getParseTreeNode(node);
-    if (parseTreeNode && parseTreeNode.kind === 169 /* Parameter */) {
-      const paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode);
-      const previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0;
-      const text = currentSourceFile.text;
-      const commentRanges = previousSibling ? concatenate(
-        // to handle
-        // ... parameters, /** @internal */
-        // public param: string
-        getTrailingCommentRanges(text, skipTrivia(
-          text,
-          previousSibling.end + 1,
-          /*stopAfterLineBreak*/
-          false,
-          /*stopAtComments*/
-          true
-        )),
-        getLeadingCommentRanges(text, node.pos)
-      ) : getTrailingCommentRanges(text, skipTrivia(
-        text,
-        node.pos,
-        /*stopAfterLineBreak*/
-        false,
-        /*stopAtComments*/
-        true
-      ));
-      return commentRanges && commentRanges.length && hasInternalAnnotation(last(commentRanges), currentSourceFile);
-    }
-    const leadingCommentRanges = parseTreeNode && getLeadingCommentRangesOfNode(parseTreeNode, currentSourceFile);
-    return !!forEach(leadingCommentRanges, (range) => {
-      return hasInternalAnnotation(range, currentSourceFile);
-    });
-  }
   function transformDeclarations(context) {
     const throwDiagnostic = () => Debug.fail("Diagnostic emitted without context");
     let getSymbolAccessibilityDiagnostic = throwDiagnostic;
@@ -110534,7 +111653,7 @@ ${lanes.join("\n")}
       }
     }
     function trackReferencedAmbientModule(node, symbol) {
-      const directives = resolver.getTypeReferenceDirectivesForSymbol(symbol, 67108863 /* All */);
+      const directives = resolver.getTypeReferenceDirectivesForSymbol(symbol, -1 /* All */);
       if (length(directives)) {
         return recordTypeReferenceDirectivesIfNecessary(directives);
       }
@@ -110554,7 +111673,7 @@ ${lanes.join("\n")}
     }
     function handleSymbolAccessibilityError(symbolAccessibilityResult) {
       if (symbolAccessibilityResult.accessibility === 0 /* Accessible */) {
-        if (symbolAccessibilityResult && symbolAccessibilityResult.aliasesToMakeVisible) {
+        if (symbolAccessibilityResult.aliasesToMakeVisible) {
           if (!lateMarkedStatements) {
             lateMarkedStatements = symbolAccessibilityResult.aliasesToMakeVisible;
           } else {
@@ -110823,6 +111942,9 @@ ${lanes.join("\n")}
       }
       function mapReferencesIntoArray(references2, outputFilePath2) {
         return (file) => {
+          if (exportedModulesFromDeclarationEmit == null ? void 0 : exportedModulesFromDeclarationEmit.includes(file.symbol)) {
+            return;
+          }
           let declFileName;
           if (file.isDeclarationFile) {
             declFileName = file.fileName;
@@ -110841,8 +111963,8 @@ ${lanes.join("\n")}
             const specifier = getModuleSpecifier(
               options,
               currentSourceFile,
-              toPath(outputFilePath2, host.getCurrentDirectory(), host.getCanonicalFileName),
-              toPath(declFileName, host.getCurrentDirectory(), host.getCanonicalFileName),
+              getNormalizedAbsolutePath(outputFilePath2, host.getCurrentDirectory()),
+              getNormalizedAbsolutePath(declFileName, host.getCurrentDirectory()),
               host
             );
             if (!pathIsRelative(specifier)) {
@@ -110892,7 +112014,7 @@ ${lanes.join("\n")}
       });
       return ret;
     }
-    function filterBindingPatternInitializersAndRenamings(name) {
+    function filterBindingPatternInitializers(name) {
       if (name.kind === 80 /* Identifier */) {
         return name;
       } else {
@@ -110909,21 +112031,11 @@ ${lanes.join("\n")}
         if (elem.propertyName && isComputedPropertyName(elem.propertyName) && isEntityNameExpression(elem.propertyName.expression)) {
           checkEntityNameVisibility(elem.propertyName.expression, enclosingDeclaration);
         }
-        if (elem.propertyName && isIdentifier(elem.propertyName) && isIdentifier(elem.name) && !elem.symbol.isReferenced && !isIdentifierANonContextualKeyword(elem.propertyName)) {
-          return factory2.updateBindingElement(
-            elem,
-            elem.dotDotDotToken,
-            /*propertyName*/
-            void 0,
-            elem.propertyName,
-            shouldPrintWithInitializer(elem) ? elem.initializer : void 0
-          );
-        }
         return factory2.updateBindingElement(
           elem,
           elem.dotDotDotToken,
           elem.propertyName,
-          filterBindingPatternInitializersAndRenamings(elem.name),
+          filterBindingPatternInitializers(elem.name),
           shouldPrintWithInitializer(elem) ? elem.initializer : void 0
         );
       }
@@ -110938,7 +112050,7 @@ ${lanes.join("\n")}
         p,
         maskModifiers(factory2, p, modifierMask),
         p.dotDotDotToken,
-        filterBindingPatternInitializersAndRenamings(p.name),
+        filterBindingPatternInitializers(p.name),
         resolver.isOptionalParameter(p) ? p.questionToken || factory2.createToken(58 /* QuestionToken */) : void 0,
         ensureType(
           p,
@@ -111432,12 +112544,14 @@ ${lanes.join("\n")}
             ));
           }
           case 179 /* CallSignature */: {
-            return cleanup(factory2.updateCallSignature(
-              input,
-              ensureTypeParams(input, input.typeParameters),
-              updateParamsList(input, input.parameters),
-              ensureType(input, input.type)
-            ));
+            return cleanup(
+              factory2.updateCallSignature(
+                input,
+                ensureTypeParams(input, input.typeParameters),
+                updateParamsList(input, input.parameters),
+                ensureType(input, input.type)
+              )
+            );
           }
           case 181 /* IndexSignature */: {
             return cleanup(factory2.updateIndexSignature(
@@ -111491,10 +112605,21 @@ ${lanes.join("\n")}
             return cleanup(factory2.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType));
           }
           case 184 /* FunctionType */: {
-            return cleanup(factory2.updateFunctionTypeNode(input, visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration), updateParamsList(input, input.parameters), Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode))));
+            return cleanup(factory2.updateFunctionTypeNode(
+              input,
+              visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration),
+              updateParamsList(input, input.parameters),
+              Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode))
+            ));
           }
           case 185 /* ConstructorType */: {
-            return cleanup(factory2.updateConstructorTypeNode(input, ensureModifiers(input), visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration), updateParamsList(input, input.parameters), Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode))));
+            return cleanup(factory2.updateConstructorTypeNode(
+              input,
+              ensureModifiers(input),
+              visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration),
+              updateParamsList(input, input.parameters),
+              Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode))
+            ));
           }
           case 205 /* ImportType */: {
             if (!isLiteralImportTypeNode(input))
@@ -111968,7 +113093,8 @@ ${lanes.join("\n")}
               if (shouldStripInternal(m))
                 return;
               const constValue = resolver.getConstantValue(m);
-              return preserveJsDoc(factory2.updateEnumMember(m, m.name, constValue !== void 0 ? typeof constValue === "string" ? factory2.createStringLiteral(constValue) : factory2.createNumericLiteral(constValue) : void 0), m);
+              const newInitializer = constValue === void 0 ? void 0 : typeof constValue === "string" ? factory2.createStringLiteral(constValue) : constValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-constValue)) : factory2.createNumericLiteral(constValue);
+              return preserveJsDoc(factory2.updateEnumMember(m, m.name, newInitializer), m);
             }))
           ));
         }
@@ -112202,6 +113328,7 @@ ${lanes.join("\n")}
       case 7 /* ES2022 */:
       case 6 /* ES2020 */:
       case 5 /* ES2015 */:
+      case 200 /* Preserve */:
         return transformECMAScriptModule;
       case 4 /* System */:
         return transformSystemModule;
@@ -112724,28 +113851,34 @@ ${lanes.join("\n")}
   function getOutputExtension(fileName, options) {
     return fileExtensionIs(fileName, ".json" /* Json */) ? ".json" /* Json */ : options.jsx === 1 /* Preserve */ && fileExtensionIsOneOf(fileName, [".jsx" /* Jsx */, ".tsx" /* Tsx */]) ? ".jsx" /* Jsx */ : fileExtensionIsOneOf(fileName, [".mts" /* Mts */, ".mjs" /* Mjs */]) ? ".mjs" /* Mjs */ : fileExtensionIsOneOf(fileName, [".cts" /* Cts */, ".cjs" /* Cjs */]) ? ".cjs" /* Cjs */ : ".js" /* Js */;
   }
-  function getOutputPathWithoutChangingExt(inputFileName, configFile, ignoreCase, outputDir, getCommonSourceDirectory2) {
+  function getOutputPathWithoutChangingExt(inputFileName, ignoreCase, outputDir, getCommonSourceDirectory2) {
     return outputDir ? resolvePath(
       outputDir,
-      getRelativePathFromDirectory(getCommonSourceDirectory2 ? getCommonSourceDirectory2() : getCommonSourceDirectoryOfConfig(configFile, ignoreCase), inputFileName, ignoreCase)
+      getRelativePathFromDirectory(getCommonSourceDirectory2(), inputFileName, ignoreCase)
     ) : inputFileName;
   }
-  function getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory2) {
+  function getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory2 = () => getCommonSourceDirectoryOfConfig(configFile, ignoreCase)) {
+    return getOutputDeclarationFileNameWorker(inputFileName, configFile.options, ignoreCase, getCommonSourceDirectory2);
+  }
+  function getOutputDeclarationFileNameWorker(inputFileName, options, ignoreCase, getCommonSourceDirectory2) {
     return changeExtension(
-      getOutputPathWithoutChangingExt(inputFileName, configFile, ignoreCase, configFile.options.declarationDir || configFile.options.outDir, getCommonSourceDirectory2),
+      getOutputPathWithoutChangingExt(inputFileName, ignoreCase, options.declarationDir || options.outDir, getCommonSourceDirectory2),
       getDeclarationEmitExtensionForPath(inputFileName)
     );
   }
-  function getOutputJSFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory2) {
+  function getOutputJSFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory2 = () => getCommonSourceDirectoryOfConfig(configFile, ignoreCase)) {
     if (configFile.options.emitDeclarationOnly)
       return void 0;
     const isJsonFile = fileExtensionIs(inputFileName, ".json" /* Json */);
-    const outputFileName = changeExtension(
-      getOutputPathWithoutChangingExt(inputFileName, configFile, ignoreCase, configFile.options.outDir, getCommonSourceDirectory2),
-      getOutputExtension(inputFileName, configFile.options)
-    );
+    const outputFileName = getOutputJSFileNameWorker(inputFileName, configFile.options, ignoreCase, getCommonSourceDirectory2);
     return !isJsonFile || comparePaths(inputFileName, outputFileName, Debug.checkDefined(configFile.options.configFilePath), ignoreCase) !== 0 /* EqualTo */ ? outputFileName : void 0;
   }
+  function getOutputJSFileNameWorker(inputFileName, options, ignoreCase, getCommonSourceDirectory2) {
+    return changeExtension(
+      getOutputPathWithoutChangingExt(inputFileName, ignoreCase, options.outDir, getCommonSourceDirectory2),
+      getOutputExtension(inputFileName, options)
+    );
+  }
   function createAddOutput() {
     let outputs;
     return { addOutput, getOutputs };
@@ -112908,27 +114041,6 @@ ${lanes.join("\n")}
       (_e = tracing) == null ? void 0 : _e.push(tracing.Phase.Emit, "emitBuildInfo", { buildInfoPath });
       emitBuildInfo(bundleBuildInfo, buildInfoPath);
       (_f = tracing) == null ? void 0 : _f.pop();
-      if (!emitSkipped && emittedFilesList) {
-        if (!emitOnly) {
-          if (jsFilePath) {
-            emittedFilesList.push(jsFilePath);
-          }
-          if (sourceMapFilePath) {
-            emittedFilesList.push(sourceMapFilePath);
-          }
-          if (buildInfoPath) {
-            emittedFilesList.push(buildInfoPath);
-          }
-        }
-        if (emitOnly !== 0 /* Js */) {
-          if (declarationFilePath) {
-            emittedFilesList.push(declarationFilePath);
-          }
-          if (declarationMapPath) {
-            emittedFilesList.push(declarationMapPath);
-          }
-        }
-      }
       function relativeToBuildInfo(path) {
         return ensurePathIsNonModuleName(getRelativePathFromDirectory(buildInfoDirectory, path, host.getCanonicalFileName));
       }
@@ -112956,6 +114068,7 @@ ${lanes.join("\n")}
         void 0,
         { buildInfo }
       );
+      emittedFilesList == null ? void 0 : emittedFilesList.push(buildInfoPath);
     }
     function emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath, relativeToBuildInfo) {
       if (!sourceFileOrBundle || emitOnly || !jsFilePath) {
@@ -113001,6 +114114,12 @@ ${lanes.join("\n")}
       transform2.dispose();
       if (bundleBuildInfo)
         bundleBuildInfo.js = printer.bundleFileInfo;
+      if (emittedFilesList) {
+        emittedFilesList.push(jsFilePath);
+        if (sourceMapFilePath) {
+          emittedFilesList.push(sourceMapFilePath);
+        }
+      }
     }
     function emitDeclarationFileOrBundle(sourceFileOrBundle, declarationFilePath, declarationMapPath, relativeToBuildInfo) {
       if (!sourceFileOrBundle || emitOnly === 0 /* Js */)
@@ -113031,33 +114150,33 @@ ${lanes.join("\n")}
           emitterDiagnostics.add(diagnostic);
         }
       }
-      const printerOptions = {
-        removeComments: compilerOptions.removeComments,
-        newLine: compilerOptions.newLine,
-        noEmitHelpers: true,
-        module: compilerOptions.module,
-        target: compilerOptions.target,
-        sourceMap: !forceDtsEmit && compilerOptions.declarationMap,
-        inlineSourceMap: compilerOptions.inlineSourceMap,
-        extendedDiagnostics: compilerOptions.extendedDiagnostics,
-        onlyPrintJsDocStyle: true,
-        omitBraceSourceMapPositions: true,
-        writeBundleFileInfo: !!bundleBuildInfo,
-        recordInternalSection: !!bundleBuildInfo,
-        relativeToBuildInfo
-      };
-      const declarationPrinter = createPrinter(printerOptions, {
-        // resolver hooks
-        hasGlobalName: resolver.hasGlobalName,
-        // transform hooks
-        onEmitNode: declarationTransform.emitNodeWithNotification,
-        isEmitNotificationEnabled: declarationTransform.isEmitNotificationEnabled,
-        substituteNode: declarationTransform.substituteNode
-      });
       const declBlocked = !!declarationTransform.diagnostics && !!declarationTransform.diagnostics.length || !!host.isEmitBlocked(declarationFilePath) || !!compilerOptions.noEmit;
       emitSkipped = emitSkipped || declBlocked;
       if (!declBlocked || forceDtsEmit) {
         Debug.assert(declarationTransform.transformed.length === 1, "Should only see one output from the decl transform");
+        const printerOptions = {
+          removeComments: compilerOptions.removeComments,
+          newLine: compilerOptions.newLine,
+          noEmitHelpers: true,
+          module: compilerOptions.module,
+          target: compilerOptions.target,
+          sourceMap: !forceDtsEmit && compilerOptions.declarationMap,
+          inlineSourceMap: compilerOptions.inlineSourceMap,
+          extendedDiagnostics: compilerOptions.extendedDiagnostics,
+          onlyPrintJsDocStyle: true,
+          omitBraceSourceMapPositions: true,
+          writeBundleFileInfo: !!bundleBuildInfo,
+          recordInternalSection: !!bundleBuildInfo,
+          relativeToBuildInfo
+        };
+        const declarationPrinter = createPrinter(printerOptions, {
+          // resolver hooks
+          hasGlobalName: resolver.hasGlobalName,
+          // transform hooks
+          onEmitNode: declarationTransform.emitNodeWithNotification,
+          isEmitNotificationEnabled: declarationTransform.isEmitNotificationEnabled,
+          substituteNode: declarationTransform.substituteNode
+        });
         printSourceFileOrBundle(
           declarationFilePath,
           declarationMapPath,
@@ -113071,10 +114190,16 @@ ${lanes.join("\n")}
             // Explicitly do not passthru either `inline` option
           }
         );
+        if (emittedFilesList) {
+          emittedFilesList.push(declarationFilePath);
+          if (declarationMapPath) {
+            emittedFilesList.push(declarationMapPath);
+          }
+        }
+        if (bundleBuildInfo)
+          bundleBuildInfo.dts = declarationPrinter.bundleFileInfo;
       }
       declarationTransform.dispose();
-      if (bundleBuildInfo)
-        bundleBuildInfo.dts = declarationPrinter.bundleFileInfo;
     }
     function collectLinkedAliases(node) {
       if (isExportAssignment(node)) {
@@ -113844,6 +114969,8 @@ ${lanes.join("\n")}
         );
       if (hint === 3 /* MappedTypeParameter */)
         return emitMappedTypeParameter(cast(node, isTypeParameterDeclaration));
+      if (hint === 7 /* ImportTypeNodeAttributes */)
+        return emitImportTypeNodeAttributes(cast(node, isImportAttributes));
       if (hint === 5 /* EmbeddedStatement */) {
         Debug.assertNode(node, isEmptyStatement);
         return emitEmptyStatement(
@@ -114820,15 +115947,7 @@ ${lanes.join("\n")}
       if (node.attributes) {
         writePunctuation(",");
         writeSpace();
-        writePunctuation("{");
-        writeSpace();
-        writeKeyword(node.attributes.token === 132 /* AssertKeyword */ ? "assert" : "with");
-        writePunctuation(":");
-        writeSpace();
-        const elements = node.attributes.elements;
-        emitList(node.attributes, elements, 526226 /* ImportAttributes */);
-        writeSpace();
-        writePunctuation("}");
+        pipelineEmit(7 /* ImportTypeNodeAttributes */, node.attributes);
       }
       writePunctuation(")");
       if (node.qualifier) {
@@ -115423,7 +116542,14 @@ ${lanes.join("\n")}
     function willEmitLeadingNewLine(node) {
       if (!currentSourceFile)
         return false;
-      if (some(getLeadingCommentRanges(currentSourceFile.text, node.pos), commentWillEmitNewLine))
+      const leadingCommentRanges = getLeadingCommentRanges(currentSourceFile.text, node.pos);
+      if (leadingCommentRanges) {
+        const parseNode = getParseTreeNode(node);
+        if (parseNode && isParenthesizedExpression(parseNode.parent)) {
+          return true;
+        }
+      }
+      if (some(leadingCommentRanges, commentWillEmitNewLine))
         return true;
       if (some(getSyntheticLeadingComments(node), commentWillEmitNewLine))
         return true;
@@ -115890,6 +117016,17 @@ ${lanes.join("\n")}
       }
       writeTrailingSemicolon();
     }
+    function emitImportTypeNodeAttributes(node) {
+      writePunctuation("{");
+      writeSpace();
+      writeKeyword(node.token === 132 /* AssertKeyword */ ? "assert" : "with");
+      writePunctuation(":");
+      writeSpace();
+      const elements = node.elements;
+      emitList(node, elements, 526226 /* ImportAttributes */);
+      writeSpace();
+      writePunctuation("}");
+    }
     function emitImportAttributes(node) {
       emitTokenWithComment(node.token, node.pos, writeKeyword, node);
       writeSpace();
@@ -117131,7 +118268,7 @@ ${lanes.join("\n")}
           return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape);
         }
       }
-      const flags = (neverAsciiEscape ? 1 /* NeverAsciiEscape */ : 0) | (jsxAttributeEscape ? 2 /* JsxAttributeEscape */ : 0) | (printerOptions.terminateUnterminatedLiterals ? 4 /* TerminateUnterminatedLiterals */ : 0) | (printerOptions.target && printerOptions.target === 99 /* ESNext */ ? 8 /* AllowNumericSeparator */ : 0);
+      const flags = (neverAsciiEscape ? 1 /* NeverAsciiEscape */ : 0) | (jsxAttributeEscape ? 2 /* JsxAttributeEscape */ : 0) | (printerOptions.terminateUnterminatedLiterals ? 4 /* TerminateUnterminatedLiterals */ : 0) | (printerOptions.target && printerOptions.target >= 8 /* ES2021 */ ? 8 /* AllowNumericSeparator */ : 0);
       return getLiteralText(node, currentSourceFile, flags);
     }
     function pushNameGenerationScope(node) {
@@ -118313,8 +119450,8 @@ ${lanes.join("\n")}
       }
       const baseName = getBaseNameOfFileName(fileOrDirectory);
       const fsQueryResult = {
-        fileExists: host.fileExists(fileOrDirectoryPath),
-        directoryExists: host.directoryExists(fileOrDirectoryPath)
+        fileExists: host.fileExists(fileOrDirectory),
+        directoryExists: host.directoryExists(fileOrDirectory)
       };
       if (fsQueryResult.directoryExists || hasEntry(parentResult.sortedAndCanonicalizedDirectories, getCanonicalFileName(baseName))) {
         clearCache();
@@ -118396,23 +119533,10 @@ ${lanes.join("\n")}
       }
     });
   }
-  function updatePackageJsonWatch(lookups, packageJsonWatches, createPackageJsonWatch) {
-    const newMap = new Map(lookups);
-    mutateMap(
-      packageJsonWatches,
-      newMap,
-      {
-        createNewValue: createPackageJsonWatch,
-        onDeleteValue: closeFileWatcher
-      }
-    );
-  }
   function updateMissingFilePathsWatch(program, missingFileWatches, createMissingFileWatch) {
-    const missingFilePaths = program.getMissingFilePaths();
-    const newMissingFilePathMap = arrayToMap(missingFilePaths, identity, returnTrue);
     mutateMap(
       missingFileWatches,
-      newMissingFilePathMap,
+      program.getMissingFilePaths(),
       {
         // Watch the missing files
         createNewValue: createMissingFileWatch,
@@ -118423,18 +119547,22 @@ ${lanes.join("\n")}
     );
   }
   function updateWatchingWildcardDirectories(existingWatchedForWildcards, wildcardDirectories, watchDirectory) {
-    mutateMap(
-      existingWatchedForWildcards,
-      wildcardDirectories,
-      {
-        // Create new watch and recursive info
-        createNewValue: createWildcardDirectoryWatcher,
-        // Close existing watch thats not needed any more
-        onDeleteValue: closeFileWatcherOf,
-        // Close existing watch that doesnt match in the flags
-        onExistingValue: updateWildcardDirectoryWatcher
-      }
-    );
+    if (wildcardDirectories) {
+      mutateMap(
+        existingWatchedForWildcards,
+        new Map(Object.entries(wildcardDirectories)),
+        {
+          // Create new watch and recursive info
+          createNewValue: createWildcardDirectoryWatcher,
+          // Close existing watch thats not needed any more
+          onDeleteValue: closeFileWatcherOf,
+          // Close existing watch that doesnt match in the flags
+          onExistingValue: updateWildcardDirectoryWatcher
+        }
+      );
+    } else {
+      clearMap(existingWatchedForWildcards, closeFileWatcherOf);
+    }
     function createWildcardDirectoryWatcher(directory, flags) {
       return {
         watcher: watchDirectory(directory, flags),
@@ -118645,7 +119773,6 @@ ${lanes.join("\n")}
         ProgramUpdateLevel2[ProgramUpdateLevel2["Update"] = 0] = "Update";
         ProgramUpdateLevel2[ProgramUpdateLevel2["RootNamesAndUpdate"] = 1] = "RootNamesAndUpdate";
         ProgramUpdateLevel2[ProgramUpdateLevel2["Full"] = 2] = "Full";
-        ProgramUpdateLevel2[ProgramUpdateLevel2["Resolutions"] = 3] = "Resolutions";
         return ProgramUpdateLevel2;
       })(ProgramUpdateLevel || {});
       WatchLogLevel = /* @__PURE__ */ ((WatchLogLevel2) => {
@@ -119035,8 +120162,8 @@ ${lanes.join("\n")}
   function getModeForFileReference(ref, containingFileMode) {
     return (isString(ref) ? containingFileMode : ref.resolutionMode) || containingFileMode;
   }
-  function getModeForResolutionAtIndex(file, index) {
-    return getModeForUsageLocation(file, getModuleNameStringLiteralAt(file, index));
+  function getModeForResolutionAtIndex(file, index, compilerOptions) {
+    return getModeForUsageLocationWorker(file, getModuleNameStringLiteralAt(file, index), compilerOptions);
   }
   function isExclusivelyTypeOnlyImportOrExport(decl) {
     var _a;
@@ -119048,7 +120175,10 @@ ${lanes.join("\n")}
     }
     return false;
   }
-  function getModeForUsageLocation(file, usage) {
+  function getModeForUsageLocation(file, usage, compilerOptions) {
+    return getModeForUsageLocationWorker(file, usage, compilerOptions);
+  }
+  function getModeForUsageLocationWorker(file, usage, compilerOptions) {
     var _a;
     if (isImportDeclaration(usage.parent) || isExportDeclaration(usage.parent)) {
       const isTypeOnly = isExclusivelyTypeOnlyImportOrExport(usage.parent);
@@ -119065,6 +120195,13 @@ ${lanes.join("\n")}
         return override;
       }
     }
+    if (compilerOptions && getEmitModuleKind(compilerOptions) === 200 /* Preserve */) {
+      return usage.parent.parent && isImportEqualsDeclaration(usage.parent.parent) || isRequireCall(
+        usage.parent,
+        /*requireStringLiteralLikeArgument*/
+        false
+      ) ? 1 /* CommonJS */ : 99 /* ESNext */;
+    }
     if (file.impliedNodeFormat === void 0)
       return void 0;
     if (file.impliedNodeFormat !== 99 /* ESNext */) {
@@ -119143,7 +120280,7 @@ ${lanes.join("\n")}
     const loader = createLoader(containingFile, redirectedReference, options, host, resolutionCache);
     for (const entry of entries) {
       const name = loader.nameAndMode.getName(entry);
-      const mode = loader.nameAndMode.getMode(entry, containingSourceFile);
+      const mode = loader.nameAndMode.getMode(entry, containingSourceFile, (redirectedReference == null ? void 0 : redirectedReference.commandLine.options) || options);
       const key = createModeAwareCacheKey(name, mode);
       let result = cache.get(key);
       if (!result) {
@@ -119228,7 +120365,7 @@ ${lanes.join("\n")}
     switch (kind) {
       case 3 /* Import */:
         const importLiteral = getModuleNameStringLiteralAt(file, index);
-        packageId = (_b = (_a = program.getResolvedModule(file, importLiteral.text, getModeForResolutionAtIndex(file, index))) == null ? void 0 : _a.resolvedModule) == null ? void 0 : _b.packageId;
+        packageId = (_b = (_a = program.getResolvedModule(file, importLiteral.text, program.getModeForUsageLocation(file, importLiteral))) == null ? void 0 : _a.resolvedModule) == null ? void 0 : _b.packageId;
         if (importLiteral.pos === -1)
           return { file, packageId, text: importLiteral.text };
         pos = skipTrivia(file.text, importLiteral.pos);
@@ -119259,7 +120396,8 @@ ${lanes.join("\n")}
       return false;
     if (program.getSourceFiles().some(sourceFileNotUptoDate))
       return false;
-    if (program.getMissingFilePaths().some(fileExists))
+    const missingPaths = program.getMissingFilePaths();
+    if (missingPaths && forEachEntry(missingPaths, fileExists))
       return false;
     const currentOptions = program.getCompilerOptions();
     if (!compareDataObjects(currentOptions, newOptions))
@@ -119466,7 +120604,7 @@ ${lanes.join("\n")}
     let redirectTargetsMap = createMultiMap();
     let usesUriStyleNodeCoreModules = false;
     const filesByName = /* @__PURE__ */ new Map();
-    let missingFilePaths;
+    let missingFileNames = /* @__PURE__ */ new Map();
     const filesByNameIgnoreCase = host.useCaseSensitiveFileNames() ? /* @__PURE__ */ new Map() : void 0;
     let resolvedProjectReferences;
     let projectReferenceRedirects;
@@ -119585,12 +120723,10 @@ ${lanes.join("\n")}
           });
         }
       }
-      missingFilePaths = arrayFrom(mapDefinedIterator(filesByName.entries(), ([path, file]) => file === void 0 ? path : void 0));
       files = stableSort(processingDefaultLibFiles, compareDefaultLibFiles).concat(processingOtherFiles);
       processingDefaultLibFiles = void 0;
       processingOtherFiles = void 0;
     }
-    Debug.assert(!!missingFilePaths);
     if (oldProgram && host.onReleaseOldSourceFile) {
       const oldSourceFiles = oldProgram.getSourceFiles();
       for (const oldSourceFile of oldSourceFiles) {
@@ -119635,8 +120771,7 @@ ${lanes.join("\n")}
       getSourceFile,
       getSourceFileByPath,
       getSourceFiles: () => files,
-      getMissingFilePaths: () => missingFilePaths,
-      // TODO: GH#18217
+      getMissingFilePaths: () => missingFileNames,
       getModuleResolutionCache: () => moduleResolutionCache,
       getFilesByNameMap: () => filesByName,
       getCompilerOptions: () => options,
@@ -119666,6 +120801,8 @@ ${lanes.join("\n")}
       getAutomaticTypeDirectiveResolutions: () => automaticTypeDirectiveResolutions,
       isSourceFileFromExternalLibrary,
       isSourceFileDefaultLibrary,
+      getModeForUsageLocation: getModeForUsageLocation2,
+      getModeForResolutionAtIndex: getModeForResolutionAtIndex2,
       getSourceFileFromReference,
       getLibFileFromReference,
       sourceFileToPackageName,
@@ -119675,6 +120812,7 @@ ${lanes.join("\n")}
       resolvedTypeReferenceDirectiveNames,
       resolvedLibReferences,
       getResolvedModule,
+      getResolvedModuleFromModuleSpecifier,
       getResolvedTypeReferenceDirective,
       forEachResolvedModule,
       forEachResolvedTypeReferenceDirective,
@@ -119725,6 +120863,11 @@ ${lanes.join("\n")}
       var _a2;
       return (_a2 = resolvedModules == null ? void 0 : resolvedModules.get(file.path)) == null ? void 0 : _a2.get(moduleName, mode);
     }
+    function getResolvedModuleFromModuleSpecifier(moduleSpecifier) {
+      const sourceFile = getSourceFileOfNode(moduleSpecifier);
+      Debug.assertIsDefined(sourceFile, "`moduleSpecifier` must have a `SourceFile` ancestor. Use `program.getResolvedModule` instead to provide the containing file and resolution mode.");
+      return getResolvedModule(sourceFile, moduleSpecifier.text, getModeForUsageLocation2(sourceFile, moduleSpecifier));
+    }
     function getResolvedTypeReferenceDirective(file, typeDirectiveName, mode) {
       var _a2;
       return (_a2 = resolvedTypeReferenceDirectiveNames == null ? void 0 : resolvedTypeReferenceDirectiveNames.get(file.path)) == null ? void 0 : _a2.get(typeDirectiveName, mode);
@@ -119897,8 +121040,7 @@ ${lanes.join("\n")}
       for (let i = 0; i < moduleNames.length; i++) {
         const moduleName = moduleNames[i];
         if (file === oldSourceFile && !hasInvalidatedResolutions(file.path)) {
-          const mode = getModeForUsageLocation(file, moduleName);
-          const oldResolution = oldProgram == null ? void 0 : oldProgram.getResolvedModule(file, moduleName.text, mode);
+          const oldResolution = oldProgram == null ? void 0 : oldProgram.getResolvedModule(file, moduleName.text, getModeForUsageLocation2(file, moduleName));
           if (oldResolution == null ? void 0 : oldResolution.resolvedModule) {
             if (isTraceEnabled(options, host)) {
               trace(
@@ -119946,7 +121088,7 @@ ${lanes.join("\n")}
       return result;
       function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName) {
         var _a2;
-        const resolutionToFile = (_a2 = oldProgram == null ? void 0 : oldProgram.getResolvedModule(file, moduleName.text, getModeForUsageLocation(file, moduleName))) == null ? void 0 : _a2.resolvedModule;
+        const resolutionToFile = (_a2 = oldProgram == null ? void 0 : oldProgram.getResolvedModule(file, moduleName.text, getModeForUsageLocation2(file, moduleName))) == null ? void 0 : _a2.resolvedModule;
         const resolvedFile = resolutionToFile && oldProgram.getSourceFile(resolutionToFile.resolvedFileName);
         if (resolutionToFile && resolvedFile) {
           return false;
@@ -120063,7 +121205,7 @@ ${lanes.join("\n")}
       const newSourceFiles = [];
       const modifiedSourceFiles = [];
       structureIsReused = 2 /* Completely */;
-      if (oldProgram.getMissingFilePaths().some((missingFilePath) => host.fileExists(missingFilePath))) {
+      if (forEachEntry(oldProgram.getMissingFilePaths(), (missingFileName) => host.fileExists(missingFileName))) {
         return 0 /* Not */;
       }
       const oldSourceFiles = oldProgram.getSourceFiles();
@@ -120164,11 +121306,9 @@ ${lanes.join("\n")}
         (resolvedModulesProcessing ?? (resolvedModulesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, resolutions);
         const resolutionsChanged = hasChangesInResolutions(
           moduleNames,
-          newSourceFile,
           resolutions,
-          (name, mode) => oldProgram.getResolvedModule(newSourceFile, name, mode),
-          moduleResolutionIsEqualTo,
-          moduleResolutionNameAndModeGetter
+          (name) => oldProgram.getResolvedModule(newSourceFile, name.text, getModeForUsageLocation2(newSourceFile, name)),
+          moduleResolutionIsEqualTo
         );
         if (resolutionsChanged)
           structureIsReused = 1 /* SafeModules */;
@@ -120177,11 +121317,9 @@ ${lanes.join("\n")}
         (resolvedTypeReferenceDirectiveNamesProcessing ?? (resolvedTypeReferenceDirectiveNamesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, typeReferenceResolutions);
         const typeReferenceResolutionsChanged = hasChangesInResolutions(
           typesReferenceDirectives,
-          newSourceFile,
           typeReferenceResolutions,
-          (name, mode) => oldProgram == null ? void 0 : oldProgram.getResolvedTypeReferenceDirective(newSourceFile, name, mode),
-          typeDirectiveIsEqualTo,
-          typeReferenceResolutionNameAndModeGetter
+          (name) => oldProgram.getResolvedTypeReferenceDirective(newSourceFile, getTypeReferenceResolutionName(name), getModeForFileReference(name, newSourceFile.impliedNodeFormat)),
+          typeDirectiveIsEqualTo
         );
         if (typeReferenceResolutionsChanged)
           structureIsReused = 1 /* SafeModules */;
@@ -120203,7 +121341,7 @@ ${lanes.join("\n")}
         if (!arrayIsEqualTo(oldProgram.getAutomaticTypeDirectiveNames(), automaticTypeDirectiveNames))
           return 1 /* SafeModules */;
       }
-      missingFilePaths = oldProgram.getMissingFilePaths();
+      missingFileNames = oldProgram.getMissingFilePaths();
       Debug.assert(newSourceFiles.length === oldProgram.getSourceFiles().length);
       for (const newSourceFile of newSourceFiles) {
         filesByName.set(newSourceFile.path, newSourceFile);
@@ -120260,7 +121398,7 @@ ${lanes.join("\n")}
           const path = toPath3(f);
           if (getSourceFileByPath(path))
             return true;
-          if (contains(missingFilePaths, path))
+          if (missingFileNames.has(path))
             return false;
           return host.fileExists(f);
         },
@@ -120848,8 +121986,7 @@ ${lanes.join("\n")}
           false
         );
       }
-      const shouldProcessRequires = isJavaScriptFile && shouldResolveJsRequire(options);
-      if (file.flags & 4194304 /* PossiblyContainsDynamicImport */ || shouldProcessRequires) {
+      if (file.flags & 4194304 /* PossiblyContainsDynamicImport */ || isJavaScriptFile) {
         collectDynamicImportOrRequireCalls(file);
       }
       file.imports = imports || emptyArray;
@@ -120898,7 +122035,7 @@ ${lanes.join("\n")}
         const r = /import|require/g;
         while (r.exec(file2.text) !== null) {
           const node = getNodeAtPosition(file2, r.lastIndex);
-          if (shouldProcessRequires && isRequireCall(
+          if (isJavaScriptFile && isRequireCall(
             node,
             /*requireStringLiteralLikeArgument*/
             true
@@ -121072,6 +122209,7 @@ ${lanes.join("\n")}
             addFileToFilesByName(
               file2,
               path,
+              fileName,
               /*redirectedPath*/
               void 0
             );
@@ -121144,7 +122282,7 @@ ${lanes.join("\n")}
         if (fileFromPackageId) {
           const dupFile = createRedirectedSourceFile(fileFromPackageId, file, fileName, path, toPath3(fileName), originalFileName, sourceFileOptions);
           redirectTargetsMap.add(fileFromPackageId.path, fileName);
-          addFileToFilesByName(dupFile, path, redirectedPath);
+          addFileToFilesByName(dupFile, path, fileName, redirectedPath);
           addFileIncludeReason(dupFile, reason);
           sourceFileToPackageName.set(path, packageIdToPackageName(packageId));
           processingOtherFiles.push(dupFile);
@@ -121154,7 +122292,7 @@ ${lanes.join("\n")}
           sourceFileToPackageName.set(path, packageIdToPackageName(packageId));
         }
       }
-      addFileToFilesByName(file, path, redirectedPath);
+      addFileToFilesByName(file, path, fileName, redirectedPath);
       if (file) {
         sourceFilesFoundSearchingNodeModules.set(path, currentNodeModulesDepth > 0);
         file.fileName = fileName;
@@ -121194,14 +122332,21 @@ ${lanes.join("\n")}
       if (file)
         fileReasons.add(file.path, reason);
     }
-    function addFileToFilesByName(file, path, redirectedPath) {
+    function addFileToFilesByName(file, path, fileName, redirectedPath) {
       if (redirectedPath) {
-        filesByName.set(redirectedPath, file);
-        filesByName.set(path, file || false);
+        updateFilesByNameMap(fileName, redirectedPath, file);
+        updateFilesByNameMap(fileName, path, file || false);
       } else {
-        filesByName.set(path, file);
+        updateFilesByNameMap(fileName, path, file);
       }
     }
+    function updateFilesByNameMap(fileName, path, file) {
+      filesByName.set(path, file);
+      if (file !== void 0)
+        missingFileNames.delete(path);
+      else
+        missingFileNames.set(path, fileName);
+    }
     function getProjectReferenceRedirect(fileName) {
       const referencedProject = getProjectReferenceRedirectProject(fileName);
       return referencedProject && getProjectReferenceOutputName(referencedProject, fileName);
@@ -121445,13 +122590,13 @@ ${lanes.join("\n")}
         const moduleNames = getModuleNames(file);
         const resolutions = (resolvedModulesProcessing == null ? void 0 : resolvedModulesProcessing.get(file.path)) || resolveModuleNamesReusingOldState(moduleNames, file);
         Debug.assert(resolutions.length === moduleNames.length);
-        const optionsForFile = (useSourceOfProjectReferenceRedirect ? (_a2 = getRedirectReferenceForResolution(file)) == null ? void 0 : _a2.commandLine.options : void 0) || options;
+        const optionsForFile = ((_a2 = getRedirectReferenceForResolution(file)) == null ? void 0 : _a2.commandLine.options) || options;
         const resolutionsInFile = createModeAwareCache();
         (resolvedModules ?? (resolvedModules = /* @__PURE__ */ new Map())).set(file.path, resolutionsInFile);
         for (let index = 0; index < moduleNames.length; index++) {
           const resolution = resolutions[index].resolvedModule;
           const moduleName = moduleNames[index].text;
-          const mode = getModeForUsageLocation(file, moduleNames[index]);
+          const mode = getModeForUsageLocationWorker(file, moduleNames[index], optionsForFile);
           resolutionsInFile.set(moduleName, mode, resolutions[index]);
           addResolutionDiagnosticsFromResolutionOrCache(file, moduleName, resolutions[index], mode);
           if (!resolution) {
@@ -121459,7 +122604,7 @@ ${lanes.join("\n")}
           }
           const isFromNodeModulesSearch = resolution.isExternalLibraryImport;
           const isJsFile = !resolutionExtensionIsTSOrJson(resolution.extension);
-          const isJsFileFromNodeModules = isFromNodeModulesSearch && isJsFile;
+          const isJsFileFromNodeModules = isFromNodeModulesSearch && isJsFile && (!resolution.originalPath || pathContainsNodeModules(resolution.resolvedFileName));
           const resolvedFileName = resolution.resolvedFileName;
           if (isFromNodeModulesSearch) {
             currentNodeModulesDepth++;
@@ -121522,6 +122667,7 @@ ${lanes.join("\n")}
             /*file*/
             void 0,
             sourceFilePath,
+            refPath,
             /*redirectedPath*/
             void 0
           );
@@ -121533,6 +122679,7 @@ ${lanes.join("\n")}
         addFileToFilesByName(
           sourceFile,
           sourceFilePath,
+          refPath,
           /*redirectedPath*/
           void 0
         );
@@ -121542,6 +122689,7 @@ ${lanes.join("\n")}
         addFileToFilesByName(
           sourceFile,
           sourceFilePath,
+          refPath,
           /*redirectedPath*/
           void 0
         );
@@ -121728,7 +122876,7 @@ ${lanes.join("\n")}
         if (getEmitModuleResolutionKind(options) === 1 /* Classic */) {
           createDiagnosticForOptionName(Diagnostics.Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic, "resolveJsonModule");
         } else if (!hasJsonModuleEmitEnabled(options)) {
-          createDiagnosticForOptionName(Diagnostics.Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext, "resolveJsonModule", "module");
+          createDiagnosticForOptionName(Diagnostics.Option_resolveJsonModule_cannot_be_specified_when_module_is_set_to_none_system_or_umd, "resolveJsonModule", "module");
         }
       }
       if (options.outDir || // there is --outDir specified
@@ -121792,7 +122940,7 @@ ${lanes.join("\n")}
         }
       }
       if (options.preserveValueImports && getEmitModuleKind(options) < 5 /* ES2015 */) {
-        createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later, "preserveValueImports");
+        createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later, "preserveValueImports");
       }
       const moduleKind = getEmitModuleKind(options);
       if (options.verbatimModuleSyntax) {
@@ -121819,8 +122967,8 @@ ${lanes.join("\n")}
       if (options.customConditions && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
         createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "customConditions");
       }
-      if (moduleResolution === 100 /* Bundler */ && !emitModuleKindIsNonNodeESM(moduleKind)) {
-        createOptionValueDiagnostic("moduleResolution", Diagnostics.Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later, "bundler");
+      if (moduleResolution === 100 /* Bundler */ && !emitModuleKindIsNonNodeESM(moduleKind) && moduleKind !== 200 /* Preserve */) {
+        createOptionValueDiagnostic("moduleResolution", Diagnostics.Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later, "bundler");
       }
       if (ModuleKind[moduleKind] && (100 /* Node16 */ <= moduleKind && moduleKind <= 199 /* NodeNext */) && !(3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */)) {
         const moduleKindName = ModuleKind[moduleKind];
@@ -122327,6 +123475,14 @@ ${lanes.join("\n")}
       }
       return symlinks;
     }
+    function getModeForUsageLocation2(file, usage) {
+      var _a2;
+      const optionsForFile = ((_a2 = getRedirectReferenceForResolution(file)) == null ? void 0 : _a2.commandLine.options) || options;
+      return getModeForUsageLocationWorker(file, usage, optionsForFile);
+    }
+    function getModeForResolutionAtIndex2(file, index) {
+      return getModeForUsageLocation2(file, getModuleNameStringLiteralAt(file, index));
+    }
   }
   function updateHostForUseSourceOfProjectReferenceRedirect(host) {
     let setOfDeclarationDirectories;
@@ -122623,7 +123779,7 @@ ${lanes.join("\n")}
       };
       moduleResolutionNameAndModeGetter = {
         getName: getModuleResolutionName,
-        getMode: (entry, file) => getModeForUsageLocation(file, entry)
+        getMode: (entry, file, compilerOptions) => getModeForUsageLocation(file, entry, compilerOptions)
       };
       typeReferenceResolutionNameAndModeGetter = {
         getName: getTypeReferenceResolutionName,
@@ -123225,6 +124381,7 @@ ${lanes.join("\n")}
     const copyDeclarationFileDiagnostics = canCopySemanticDiagnostics && !compilerOptions.skipLibCheck === !oldCompilerOptions.skipLibCheck;
     const copyLibFileDiagnostics = copyDeclarationFileDiagnostics && !compilerOptions.skipDefaultLibCheck === !oldCompilerOptions.skipDefaultLibCheck;
     state.fileInfos.forEach((info, sourceFilePath) => {
+      var _a2;
       let oldInfo;
       let newReferences;
       if (!useOldState || // File wasn't present in old state
@@ -123234,22 +124391,28 @@ ${lanes.join("\n")}
       !hasSameKeys(newReferences = referencedMap && referencedMap.getValues(sourceFilePath), oldReferencedMap && oldReferencedMap.getValues(sourceFilePath)) || // Referenced file was deleted in the new program
       newReferences && forEachKey(newReferences, (path) => !state.fileInfos.has(path) && oldState.fileInfos.has(path))) {
         addFileToChangeSet(state, sourceFilePath);
-      } else if (canCopySemanticDiagnostics) {
+      } else {
         const sourceFile = newProgram.getSourceFileByPath(sourceFilePath);
-        if (sourceFile.isDeclarationFile && !copyDeclarationFileDiagnostics)
-          return;
-        if (sourceFile.hasNoDefaultLib && !copyLibFileDiagnostics)
-          return;
-        const diagnostics = oldState.semanticDiagnosticsPerFile.get(sourceFilePath);
-        if (diagnostics) {
-          state.semanticDiagnosticsPerFile.set(
+        const emitDiagnostics = (_a2 = oldState.emitDiagnosticsPerFile) == null ? void 0 : _a2.get(sourceFilePath);
+        if (emitDiagnostics) {
+          (state.emitDiagnosticsPerFile ?? (state.emitDiagnosticsPerFile = /* @__PURE__ */ new Map())).set(
             sourceFilePath,
-            oldState.hasReusableDiagnostic ? convertToDiagnostics(diagnostics, newProgram) : repopulateDiagnostics(diagnostics, newProgram)
+            oldState.hasReusableDiagnostic ? convertToDiagnostics(emitDiagnostics, newProgram) : repopulateDiagnostics(emitDiagnostics, newProgram)
           );
-          if (!state.semanticDiagnosticsFromOldState) {
-            state.semanticDiagnosticsFromOldState = /* @__PURE__ */ new Set();
+        }
+        if (canCopySemanticDiagnostics) {
+          if (sourceFile.isDeclarationFile && !copyDeclarationFileDiagnostics)
+            return;
+          if (sourceFile.hasNoDefaultLib && !copyLibFileDiagnostics)
+            return;
+          const diagnostics = oldState.semanticDiagnosticsPerFile.get(sourceFilePath);
+          if (diagnostics) {
+            state.semanticDiagnosticsPerFile.set(
+              sourceFilePath,
+              oldState.hasReusableDiagnostic ? convertToDiagnostics(diagnostics, newProgram) : repopulateDiagnostics(diagnostics, newProgram)
+            );
+            (state.semanticDiagnosticsFromOldState ?? (state.semanticDiagnosticsFromOldState = /* @__PURE__ */ new Set())).add(sourceFilePath);
           }
-          state.semanticDiagnosticsFromOldState.add(sourceFilePath);
         }
       }
       if (canCopyEmitSignatures) {
@@ -123386,7 +124549,9 @@ ${lanes.join("\n")}
       outSignature: state.outSignature,
       latestChangedDtsFile: state.latestChangedDtsFile,
       hasChangedEmitSignature: state.hasChangedEmitSignature,
-      changedFilesSet: outFilePath ? new Set(state.changedFilesSet) : void 0
+      changedFilesSet: outFilePath ? new Set(state.changedFilesSet) : void 0,
+      buildInfoEmitPending: state.buildInfoEmitPending,
+      emitDiagnosticsPerFile: state.emitDiagnosticsPerFile && new Map(state.emitDiagnosticsPerFile)
     };
   }
   function restoreBuilderProgramEmitState(state, savedEmitState) {
@@ -123397,6 +124562,8 @@ ${lanes.join("\n")}
     state.outSignature = savedEmitState.outSignature;
     state.latestChangedDtsFile = savedEmitState.latestChangedDtsFile;
     state.hasChangedEmitSignature = savedEmitState.hasChangedEmitSignature;
+    state.buildInfoEmitPending = savedEmitState.buildInfoEmitPending;
+    state.emitDiagnosticsPerFile = savedEmitState.emitDiagnosticsPerFile;
     if (savedEmitState.changedFilesSet)
       state.changedFilesSet = savedEmitState.changedFilesSet;
   }
@@ -123487,6 +124654,22 @@ ${lanes.join("\n")}
         return { affectedFile, emitKind: pendingKind };
     });
   }
+  function getNextPendingEmitDiagnosticsFile(state) {
+    var _a;
+    if (!((_a = state.emitDiagnosticsPerFile) == null ? void 0 : _a.size))
+      return void 0;
+    return forEachEntry(state.emitDiagnosticsPerFile, (diagnostics, path) => {
+      var _a2;
+      const affectedFile = state.program.getSourceFileByPath(path);
+      if (!affectedFile || !sourceFileMayBeEmitted(affectedFile, state.program)) {
+        state.emitDiagnosticsPerFile.delete(path);
+        return void 0;
+      }
+      const seenKind = ((_a2 = state.seenEmittedFiles) == null ? void 0 : _a2.get(affectedFile.resolvedPath)) || 0 /* None */;
+      if (!(seenKind & 24 /* AllDts */))
+        return { affectedFile, diagnostics, seenKind };
+    });
+  }
   function removeDiagnosticsOfLibraryFiles(state) {
     if (!state.cleanedDiagnosticsOfLibFiles) {
       state.cleanedDiagnosticsOfLibFiles = true;
@@ -123763,18 +124946,7 @@ ${lanes.join("\n")}
         return void 0;
       });
     }
-    let semanticDiagnosticsPerFile;
-    if (state.semanticDiagnosticsPerFile) {
-      for (const key of arrayFrom(state.semanticDiagnosticsPerFile.keys()).sort(compareStringsCaseSensitive)) {
-        const value = state.semanticDiagnosticsPerFile.get(key);
-        (semanticDiagnosticsPerFile || (semanticDiagnosticsPerFile = [])).push(
-          value.length ? [
-            toFileId(key),
-            convertToReusableDiagnostics(value, relativeToBuildInfo)
-          ] : toFileId(key)
-        );
-      }
-    }
+    const semanticDiagnosticsPerFile = convertToProgramBuildInfoDiagnostics(state.semanticDiagnosticsPerFile);
     let affectedFilesPendingEmit;
     if ((_c = state.affectedFilesPendingEmit) == null ? void 0 : _c.size) {
       const fullEmitForOptions = getBuilderFileEmit(state.compilerOptions);
@@ -123804,6 +124976,7 @@ ${lanes.join("\n")}
         (changeFileSet || (changeFileSet = [])).push(toFileId(path));
       }
     }
+    const emitDiagnosticsPerFile = convertToProgramBuildInfoDiagnostics(state.emitDiagnosticsPerFile);
     const program = {
       fileNames,
       fileInfos,
@@ -123813,6 +124986,7 @@ ${lanes.join("\n")}
       referencedMap,
       exportedModulesMap,
       semanticDiagnosticsPerFile,
+      emitDiagnosticsPerFile,
       affectedFilesPendingEmit,
       changeFileSet,
       emitSignatures,
@@ -123869,73 +125043,87 @@ ${lanes.join("\n")}
         if (optionInfo == null ? void 0 : optionInfo.affectsBuildInfo) {
           (result || (result = {}))[name] = convertToReusableCompilerOptionValue(
             optionInfo,
-            options[name],
-            relativeToBuildInfoEnsuringAbsolutePath
+            options[name]
           );
         }
       }
       return result;
     }
-  }
-  function convertToReusableCompilerOptionValue(option, value, relativeToBuildInfo) {
-    if (option) {
-      Debug.assert(option.type !== "listOrElement");
-      if (option.type === "list") {
-        const values = value;
-        if (option.element.isFilePath && values.length) {
-          return values.map(relativeToBuildInfo);
+    function convertToReusableCompilerOptionValue(option, value) {
+      if (option) {
+        Debug.assert(option.type !== "listOrElement");
+        if (option.type === "list") {
+          const values = value;
+          if (option.element.isFilePath && values.length) {
+            return values.map(relativeToBuildInfoEnsuringAbsolutePath);
+          }
+        } else if (option.isFilePath) {
+          return relativeToBuildInfoEnsuringAbsolutePath(value);
         }
-      } else if (option.isFilePath) {
-        return relativeToBuildInfo(value);
       }
+      return value;
     }
-    return value;
-  }
-  function convertToReusableDiagnostics(diagnostics, relativeToBuildInfo) {
-    Debug.assert(!!diagnostics.length);
-    return diagnostics.map((diagnostic) => {
-      const result = convertToReusableDiagnosticRelatedInformation(diagnostic, relativeToBuildInfo);
-      result.reportsUnnecessary = diagnostic.reportsUnnecessary;
-      result.reportDeprecated = diagnostic.reportsDeprecated;
-      result.source = diagnostic.source;
-      result.skippedOn = diagnostic.skippedOn;
-      const { relatedInformation } = diagnostic;
-      result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map((r) => convertToReusableDiagnosticRelatedInformation(r, relativeToBuildInfo)) : [] : void 0;
+    function convertToProgramBuildInfoDiagnostics(diagnostics) {
+      let result;
+      if (diagnostics) {
+        for (const key of arrayFrom(diagnostics.keys()).sort(compareStringsCaseSensitive)) {
+          const value = diagnostics.get(key);
+          (result || (result = [])).push(
+            value.length ? [
+              toFileId(key),
+              convertToReusableDiagnostics(value)
+            ] : toFileId(key)
+          );
+        }
+      }
       return result;
-    });
-  }
-  function convertToReusableDiagnosticRelatedInformation(diagnostic, relativeToBuildInfo) {
-    const { file } = diagnostic;
-    return {
-      ...diagnostic,
-      file: file ? relativeToBuildInfo(file.resolvedPath) : void 0,
-      messageText: isString(diagnostic.messageText) ? diagnostic.messageText : convertToReusableDiagnosticMessageChain(diagnostic.messageText)
-    };
-  }
-  function convertToReusableDiagnosticMessageChain(chain) {
-    if (chain.repopulateInfo) {
+    }
+    function convertToReusableDiagnostics(diagnostics) {
+      Debug.assert(!!diagnostics.length);
+      return diagnostics.map((diagnostic) => {
+        const result = convertToReusableDiagnosticRelatedInformation(diagnostic);
+        result.reportsUnnecessary = diagnostic.reportsUnnecessary;
+        result.reportDeprecated = diagnostic.reportsDeprecated;
+        result.source = diagnostic.source;
+        result.skippedOn = diagnostic.skippedOn;
+        const { relatedInformation } = diagnostic;
+        result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map((r) => convertToReusableDiagnosticRelatedInformation(r)) : [] : void 0;
+        return result;
+      });
+    }
+    function convertToReusableDiagnosticRelatedInformation(diagnostic) {
+      const { file } = diagnostic;
       return {
-        info: chain.repopulateInfo(),
-        next: convertToReusableDiagnosticMessageChainArray(chain.next)
+        ...diagnostic,
+        file: file ? relativeToBuildInfo(file.resolvedPath) : void 0,
+        messageText: isString(diagnostic.messageText) ? diagnostic.messageText : convertToReusableDiagnosticMessageChain(diagnostic.messageText)
       };
     }
-    const next = convertToReusableDiagnosticMessageChainArray(chain.next);
-    return next === chain.next ? chain : { ...chain, next };
-  }
-  function convertToReusableDiagnosticMessageChainArray(array) {
-    if (!array)
-      return array;
-    return forEach(array, (chain, index) => {
-      const reusable = convertToReusableDiagnosticMessageChain(chain);
-      if (chain === reusable)
-        return void 0;
-      const result = index > 0 ? array.slice(0, index - 1) : [];
-      result.push(reusable);
-      for (let i = index + 1; i < array.length; i++) {
-        result.push(convertToReusableDiagnosticMessageChain(array[i]));
+    function convertToReusableDiagnosticMessageChain(chain) {
+      if (chain.repopulateInfo) {
+        return {
+          info: chain.repopulateInfo(),
+          next: convertToReusableDiagnosticMessageChainArray(chain.next)
+        };
       }
-      return result;
-    }) || array;
+      const next = convertToReusableDiagnosticMessageChainArray(chain.next);
+      return next === chain.next ? chain : { ...chain, next };
+    }
+    function convertToReusableDiagnosticMessageChainArray(array) {
+      if (!array)
+        return array;
+      return forEach(array, (chain, index) => {
+        const reusable = convertToReusableDiagnosticMessageChain(chain);
+        if (chain === reusable)
+          return void 0;
+        const result = index > 0 ? array.slice(0, index - 1) : [];
+        result.push(reusable);
+        for (let i = index + 1; i < array.length; i++) {
+          result.push(convertToReusableDiagnosticMessageChain(array[i]));
+        }
+        return result;
+      }) || array;
+    }
   }
   function getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) {
     let host;
@@ -124044,6 +125232,14 @@ ${lanes.join("\n")}
         if (!outFile(state.compilerOptions)) {
           const pendingAffectedFile = getNextAffectedFilePendingEmit(state, emitOnlyDtsFiles);
           if (!pendingAffectedFile) {
+            const pendingForDiagnostics = getNextPendingEmitDiagnosticsFile(state);
+            if (pendingForDiagnostics) {
+              (state.seenEmittedFiles ?? (state.seenEmittedFiles = /* @__PURE__ */ new Map())).set(pendingForDiagnostics.affectedFile.resolvedPath, pendingForDiagnostics.seenKind | 24 /* AllDts */);
+              return {
+                result: { emitSkipped: true, diagnostics: pendingForDiagnostics.diagnostics },
+                affected: pendingForDiagnostics.affectedFile
+              };
+            }
             if (!state.buildInfoEmitPending)
               return void 0;
             const affected2 = state.program;
@@ -124092,6 +125288,8 @@ ${lanes.join("\n")}
           (state.affectedFilesPendingEmit ?? (state.affectedFilesPendingEmit = /* @__PURE__ */ new Map())).set(affectedSourceFile.resolvedPath, pendingKind);
         else
           (_c = state.affectedFilesPendingEmit) == null ? void 0 : _c.delete(affectedSourceFile.resolvedPath);
+        if (result.diagnostics.length)
+          (state.emitDiagnosticsPerFile ?? (state.emitDiagnosticsPerFile = /* @__PURE__ */ new Map())).set(affectedSourceFile.resolvedPath, result.diagnostics);
       } else {
         state.changedFilesSet.clear();
       }
@@ -124264,9 +125462,10 @@ ${lanes.join("\n")}
     }
   }
   function addToAffectedFilesPendingEmit(state, affectedFilePendingEmit, kind) {
-    var _a;
+    var _a, _b;
     const existingKind = ((_a = state.affectedFilesPendingEmit) == null ? void 0 : _a.get(affectedFilePendingEmit)) || 0 /* None */;
     (state.affectedFilesPendingEmit ?? (state.affectedFilesPendingEmit = /* @__PURE__ */ new Map())).set(affectedFilePendingEmit, existingKind | kind);
+    (_b = state.emitDiagnosticsPerFile) == null ? void 0 : _b.delete(affectedFilePendingEmit);
   }
   function toBuilderStateFileInfoForMultiEmit(fileInfo) {
     return isString(fileInfo) ? { version: fileInfo, signature: fileInfo, affectsGlobalScope: void 0, impliedFormat: void 0 } : isString(fileInfo.signature) ? fileInfo : { version: fileInfo.version, signature: fileInfo.signature === false ? void 0 : fileInfo.version, affectsGlobalScope: fileInfo.affectsGlobalScope, impliedFormat: fileInfo.impliedFormat };
@@ -124331,7 +125530,8 @@ ${lanes.join("\n")}
         compilerOptions: program.options ? convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {},
         referencedMap: toManyToManyPathMap(program.referencedMap),
         exportedModulesMap: toManyToManyPathMap(program.exportedModulesMap),
-        semanticDiagnosticsPerFile: program.semanticDiagnosticsPerFile && arrayToMap(program.semanticDiagnosticsPerFile, (value) => toFilePath(isNumber(value) ? value : value[0]), (value) => isNumber(value) ? emptyArray : value[1]),
+        semanticDiagnosticsPerFile: toPerFileDiagnostics(program.semanticDiagnosticsPerFile),
+        emitDiagnosticsPerFile: toPerFileDiagnostics(program.emitDiagnosticsPerFile),
         hasReusableDiagnostic: true,
         affectedFilesPendingEmit: program.affectedFilesPendingEmit && arrayToMap(program.affectedFilesPendingEmit, (value) => toFilePath(isNumber(value) ? value : value[0]), (value) => toBuilderFileEmit(value, fullEmitForOptions)),
         changedFilesSet: new Set(map(program.changeFileSet, toFilePath)),
@@ -124384,6 +125584,9 @@ ${lanes.join("\n")}
       referenceMap.forEach(([fileId, fileIdListId]) => map2.set(toFilePath(fileId), toFilePathsSet(fileIdListId)));
       return map2;
     }
+    function toPerFileDiagnostics(diagnostics) {
+      return diagnostics && arrayToMap(diagnostics, (value) => toFilePath(isNumber(value) ? value : value[0]), (value) => isNumber(value) ? emptyArray : value[1]);
+    }
   }
   function getBuildInfoFileVersionMap(program, buildInfoPath, host) {
     const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
@@ -124903,7 +126106,7 @@ ${lanes.join("\n")}
       const seenNamesInFile = createModeAwareCache();
       for (const entry of entries) {
         const name = loader.nameAndMode.getName(entry);
-        const mode = loader.nameAndMode.getMode(entry, containingSourceFile);
+        const mode = loader.nameAndMode.getMode(entry, containingSourceFile, (redirectedReference == null ? void 0 : redirectedReference.commandLine.options) || options);
         let resolution = resolutionsInFile.get(name, mode);
         if (!seenNamesInFile.has(name, mode) && (allModuleAndTypeResolutionsAreInvalidated || unmatchedRedirects || !resolution || resolution.isInvalidated || // If the name is unresolved import that was invalidated, recalculate
         hasInvalidatedNonRelativeUnresolvedImport && !isExternalModuleNameRelative(name) && shouldRetryResolution(resolution))) {
@@ -124944,7 +126147,7 @@ ${lanes.join("\n")}
       reusedNames == null ? void 0 : reusedNames.forEach(
         (entry) => seenNamesInFile.set(
           loader.nameAndMode.getName(entry),
-          loader.nameAndMode.getMode(entry, containingSourceFile),
+          loader.nameAndMode.getMode(entry, containingSourceFile, (redirectedReference == null ? void 0 : redirectedReference.commandLine.options) || options),
           true
         )
       );
@@ -125126,10 +126329,10 @@ ${lanes.join("\n")}
     }
     function watchFailedLookupLocationOfResolution(resolution) {
       Debug.assert(!!resolution.refCount);
-      const { failedLookupLocations, affectingLocations, node10Result } = resolution;
-      if (!(failedLookupLocations == null ? void 0 : failedLookupLocations.length) && !(affectingLocations == null ? void 0 : affectingLocations.length) && !node10Result)
+      const { failedLookupLocations, affectingLocations, alternateResult } = resolution;
+      if (!(failedLookupLocations == null ? void 0 : failedLookupLocations.length) && !(affectingLocations == null ? void 0 : affectingLocations.length) && !alternateResult)
         return;
-      if ((failedLookupLocations == null ? void 0 : failedLookupLocations.length) || node10Result)
+      if ((failedLookupLocations == null ? void 0 : failedLookupLocations.length) || alternateResult)
         resolutionsWithFailedLookups.add(resolution);
       let setAtRoot = false;
       if (failedLookupLocations) {
@@ -125137,8 +126340,8 @@ ${lanes.join("\n")}
           setAtRoot = watchFailedLookupLocation(failedLookupLocation, setAtRoot);
         }
       }
-      if (node10Result)
-        setAtRoot = watchFailedLookupLocation(node10Result, setAtRoot);
+      if (alternateResult)
+        setAtRoot = watchFailedLookupLocation(alternateResult, setAtRoot);
       if (setAtRoot) {
         setDirectoryWatcher(
           rootDir,
@@ -125147,7 +126350,7 @@ ${lanes.join("\n")}
           true
         );
       }
-      watchAffectingLocationsOfResolution(resolution, !(failedLookupLocations == null ? void 0 : failedLookupLocations.length) && !node10Result);
+      watchAffectingLocationsOfResolution(resolution, !(failedLookupLocations == null ? void 0 : failedLookupLocations.length) && !alternateResult);
     }
     function watchAffectingLocationsOfResolution(resolution, addToResolutionsWithOnlyAffectingLocations) {
       Debug.assert(!!resolution.refCount);
@@ -125285,7 +126488,7 @@ ${lanes.join("\n")}
         if ((resolutions == null ? void 0 : resolutions.delete(resolution)) && !resolutions.size)
           resolvedFileToResolution.delete(key);
       }
-      const { failedLookupLocations, affectingLocations, node10Result } = resolution;
+      const { failedLookupLocations, affectingLocations, alternateResult } = resolution;
       if (resolutionsWithFailedLookups.delete(resolution)) {
         let removeAtRoot = false;
         if (failedLookupLocations) {
@@ -125293,8 +126496,8 @@ ${lanes.join("\n")}
             removeAtRoot = stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot, syncDirWatcherRemove);
           }
         }
-        if (node10Result)
-          removeAtRoot = stopWatchFailedLookupLocation(node10Result, removeAtRoot, syncDirWatcherRemove);
+        if (alternateResult)
+          removeAtRoot = stopWatchFailedLookupLocation(alternateResult, removeAtRoot, syncDirWatcherRemove);
         if (removeAtRoot)
           removeDirectoryWatcher(rootPath, syncDirWatcherRemove);
       } else if (affectingLocations == null ? void 0 : affectingLocations.length) {
@@ -125461,7 +126664,7 @@ ${lanes.join("\n")}
         return true;
       if (!failedLookupChecks && !startsWithPathChecks && !isInDirectoryChecks)
         return false;
-      return ((_a = resolution.failedLookupLocations) == null ? void 0 : _a.some((location) => isInvalidatedFailedLookup(resolutionHost.toPath(location)))) || !!resolution.node10Result && isInvalidatedFailedLookup(resolutionHost.toPath(resolution.node10Result));
+      return ((_a = resolution.failedLookupLocations) == null ? void 0 : _a.some((location) => isInvalidatedFailedLookup(resolutionHost.toPath(location)))) || !!resolution.alternateResult && isInvalidatedFailedLookup(resolutionHost.toPath(resolution.alternateResult));
     }
     function isInvalidatedFailedLookup(locationPath) {
       return (failedLookupChecks == null ? void 0 : failedLookupChecks.has(locationPath)) || firstDefinedIterator((startsWithPathChecks == null ? void 0 : startsWithPathChecks.keys()) || [], (fileOrDirectoryPath) => startsWith(locationPath, fileOrDirectoryPath) ? true : void 0) || firstDefinedIterator((isInDirectoryChecks == null ? void 0 : isInDirectoryChecks.keys()) || [], (dirPath) => locationPath.length > dirPath.length && startsWith(locationPath, dirPath) && (isDiskPathRoot(dirPath) || locationPath[dirPath.length] === directorySeparator) ? true : void 0);
@@ -125473,8 +126676,8 @@ ${lanes.join("\n")}
     function closeTypeRootsWatch() {
       clearMap(typeRootsWatches, closeFileWatcher);
     }
-    function createTypeRootsWatch(typeRootPath, typeRoot) {
-      return canWatchTypeRootPath(typeRootPath) ? resolutionHost.watchTypeRootsDirectory(typeRoot, (fileOrDirectory) => {
+    function createTypeRootsWatch(typeRoot) {
+      return canWatchTypeRootPath(typeRoot) ? resolutionHost.watchTypeRootsDirectory(typeRoot, (fileOrDirectory) => {
         const fileOrDirectoryPath = resolutionHost.toPath(fileOrDirectory);
         if (cachedDirectoryStructureHost) {
           cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
@@ -125483,7 +126686,7 @@ ${lanes.join("\n")}
         resolutionHost.onChangedAutomaticTypeDirectiveNames();
         const dirPath = getDirectoryToWatchFailedLookupLocationFromTypeRoot(
           typeRoot,
-          typeRootPath,
+          resolutionHost.toPath(typeRoot),
           rootPath,
           rootPathComponents,
           getCurrentDirectory,
@@ -125504,7 +126707,7 @@ ${lanes.join("\n")}
       if (typeRoots) {
         mutateMap(
           typeRootsWatches,
-          arrayToMap(typeRoots, (tr) => resolutionHost.toPath(tr)),
+          new Set(typeRoots),
           {
             createNewValue: createTypeRootsWatch,
             onDeleteValue: closeFileWatcher
@@ -126302,11 +127505,6 @@ ${lanes.join("\n")}
     if (configFileName) {
       configFileWatcher = watchFile2(configFileName, scheduleProgramReload, 2e3 /* High */, watchOptions, WatchType.ConfigFile);
     }
-    let pnpFileWatcher;
-    const pnpApiPath = getPnpApiPath(__filename);
-    if (pnpApiPath) {
-      pnpFileWatcher = watchFile2(pnpApiPath, scheduleResolutionReload, 2e3 /* High */, watchOptions, WatchType.ConfigFile);
-    }
     const compilerHost = createCompilerHostFromProgramHost(host, () => compilerOptions, directoryStructureHost);
     setGetSourceFileAsHashVersioned(compilerHost);
     const getNewSourceFile = compilerHost.getSourceFile;
@@ -126370,10 +127568,6 @@ ${lanes.join("\n")}
         configFileWatcher.close();
         configFileWatcher = void 0;
       }
-      if (pnpFileWatcher) {
-        pnpFileWatcher.close();
-        pnpFileWatcher = void 0;
-      }
       extendedConfigCache == null ? void 0 : extendedConfigCache.clear();
       extendedConfigCache = void 0;
       if (sharedExtendedConfigFileWatchers) {
@@ -126409,7 +127603,7 @@ ${lanes.join("\n")}
     function getCurrentProgram() {
       return builderProgram && builderProgram.getProgramOrUndefined();
     }
-    function synchronizeProgram(forceAllFilesAsInvalidated = false) {
+    function synchronizeProgram() {
       writeLog(`Synchronizing program`);
       Debug.assert(compilerOptions);
       Debug.assert(rootFileNames);
@@ -126421,7 +127615,7 @@ ${lanes.join("\n")}
           resolutionCache.onChangesAffectModuleResolution();
         }
       }
-      const { hasInvalidatedResolutions, hasInvalidatedLibResolutions } = resolutionCache.createHasInvalidatedResolutions(forceAllFilesAsInvalidated ? returnTrue : customHasInvalidatedResolutions, customHasInvalidLibResolutions);
+      const { hasInvalidatedResolutions, hasInvalidatedLibResolutions } = resolutionCache.createHasInvalidatedResolutions(customHasInvalidatedResolutions, customHasInvalidLibResolutions);
       const {
         originalReadFile,
         originalFileExists,
@@ -126480,7 +127674,11 @@ ${lanes.join("\n")}
       const oldProgram = getCurrentProgram();
       builderProgram = createProgram2(rootFileNames, compilerOptions, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences);
       resolutionCache.finishCachingPerDirectoryResolution(builderProgram.getProgram(), oldProgram);
-      updateMissingFilePathsWatch(builderProgram.getProgram(), missingFilesMap || (missingFilesMap = /* @__PURE__ */ new Map()), watchMissingFilePath);
+      updateMissingFilePathsWatch(
+        builderProgram.getProgram(),
+        missingFilesMap || (missingFilesMap = /* @__PURE__ */ new Map()),
+        watchMissingFilePath
+      );
       if (needsUpdateInTypeRootWatch) {
         resolutionCache.updateTypeRootsWatch();
       }
@@ -126629,19 +127827,13 @@ ${lanes.join("\n")}
       updateLevel = 2 /* Full */;
       scheduleProgramUpdate();
     }
-    function scheduleResolutionReload() {
-      writeLog("Clearing resolutions");
-      resolutionCache.clear();
-      updateLevel = 3 /* Resolutions */;
-      scheduleProgramUpdate();
-    }
     function updateProgramWithWatchStatus() {
       timerToUpdateProgram = void 0;
       reportFileChangeDetectedOnCreateProgram = true;
       updateProgram();
     }
     function updateProgram() {
-      var _a, _b, _c, _d, _e;
+      var _a, _b, _c, _d;
       switch (updateLevel) {
         case 1 /* RootNamesAndUpdate */:
           (_a = perfLogger) == null ? void 0 : _a.logStartUpdateProgram("PartialConfigReload");
@@ -126651,19 +127843,12 @@ ${lanes.join("\n")}
           (_b = perfLogger) == null ? void 0 : _b.logStartUpdateProgram("FullConfigReload");
           reloadConfigFile();
           break;
-        case 3 /* Resolutions */:
-          (_c = perfLogger) == null ? void 0 : _c.logStartUpdateProgram("SynchronizeProgramWithResolutions");
-          synchronizeProgram(
-            /*forceAllFilesAsInvalidated*/
-            true
-          );
-          break;
         default:
-          (_d = perfLogger) == null ? void 0 : _d.logStartUpdateProgram("SynchronizeProgram");
+          (_c = perfLogger) == null ? void 0 : _c.logStartUpdateProgram("SynchronizeProgram");
           synchronizeProgram();
           break;
       }
-      (_e = perfLogger) == null ? void 0 : _e.logStopUpdateProgram("Done");
+      (_d = perfLogger) == null ? void 0 : _d.logStopUpdateProgram("Done");
       return getCurrentBuilderProgram();
     }
     function reloadFileNamesFromConfigFile() {
@@ -126786,8 +127971,15 @@ ${lanes.join("\n")}
         cachedDirectoryStructureHost.addOrDeleteFile(fileName, path, eventKind);
       }
     }
-    function watchMissingFilePath(missingFilePath) {
-      return (parsedConfigs == null ? void 0 : parsedConfigs.has(missingFilePath)) ? noopFileWatcher : watchFilePath(missingFilePath, missingFilePath, onMissingFileChange, 500 /* Medium */, watchOptions, WatchType.MissingFile);
+    function watchMissingFilePath(missingFilePath, missingFileName) {
+      return (parsedConfigs == null ? void 0 : parsedConfigs.has(missingFilePath)) ? noopFileWatcher : watchFilePath(
+        missingFilePath,
+        missingFileName,
+        onMissingFileChange,
+        500 /* Medium */,
+        watchOptions,
+        WatchType.MissingFile
+      );
     }
     function onMissingFileChange(fileName, eventKind, missingFilePath) {
       updateCachedSystemWithFile(fileName, missingFilePath, eventKind);
@@ -126799,15 +127991,11 @@ ${lanes.join("\n")}
       }
     }
     function watchConfigFileWildCardDirectories() {
-      if (wildcardDirectories) {
-        updateWatchingWildcardDirectories(
-          watchedWildcardDirectories || (watchedWildcardDirectories = /* @__PURE__ */ new Map()),
-          new Map(Object.entries(wildcardDirectories)),
-          watchWildcardDirectory
-        );
-      } else if (watchedWildcardDirectories) {
-        clearMap(watchedWildcardDirectories, closeFileWatcherOf);
-      }
+      updateWatchingWildcardDirectories(
+        watchedWildcardDirectories || (watchedWildcardDirectories = /* @__PURE__ */ new Map()),
+        wildcardDirectories,
+        watchWildcardDirectory
+      );
     }
     function watchWildcardDirectory(directory, flags) {
       return watchDirectory(
@@ -126879,7 +128067,7 @@ ${lanes.join("\n")}
       );
     }
     function watchReferencedProject(configFileName2, configPath, commandLine) {
-      var _a, _b, _c, _d, _e;
+      var _a, _b, _c, _d;
       commandLine.watcher || (commandLine.watcher = watchFile2(
         configFileName2,
         (_fileName, eventKind) => {
@@ -126894,55 +128082,50 @@ ${lanes.join("\n")}
         ((_a = commandLine.parsedCommandLine) == null ? void 0 : _a.watchOptions) || watchOptions,
         WatchType.ConfigFileOfReferencedProject
       ));
-      if ((_b = commandLine.parsedCommandLine) == null ? void 0 : _b.wildcardDirectories) {
-        updateWatchingWildcardDirectories(
-          commandLine.watchedDirectories || (commandLine.watchedDirectories = /* @__PURE__ */ new Map()),
-          new Map(Object.entries((_c = commandLine.parsedCommandLine) == null ? void 0 : _c.wildcardDirectories)),
-          (directory, flags) => {
-            var _a2;
-            return watchDirectory(
-              directory,
-              (fileOrDirectory) => {
-                const fileOrDirectoryPath = toPath3(fileOrDirectory);
-                if (cachedDirectoryStructureHost) {
-                  cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
-                }
-                nextSourceFileVersion(fileOrDirectoryPath);
-                const config = parsedConfigs == null ? void 0 : parsedConfigs.get(configPath);
-                if (!(config == null ? void 0 : config.parsedCommandLine))
-                  return;
-                if (isIgnoredFileFromWildCardWatching({
-                  watchedDirPath: toPath3(directory),
-                  fileOrDirectory,
-                  fileOrDirectoryPath,
-                  configFileName: configFileName2,
-                  options: config.parsedCommandLine.options,
-                  program: config.parsedCommandLine.fileNames,
-                  currentDirectory,
-                  useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
-                  writeLog,
-                  toPath: toPath3
-                }))
-                  return;
-                if (config.updateLevel !== 2 /* Full */) {
-                  config.updateLevel = 1 /* RootNamesAndUpdate */;
-                  scheduleProgramUpdate();
-                }
-              },
-              flags,
-              ((_a2 = commandLine.parsedCommandLine) == null ? void 0 : _a2.watchOptions) || watchOptions,
-              WatchType.WildcardDirectoryOfReferencedProject
-            );
-          }
-        );
-      } else if (commandLine.watchedDirectories) {
-        clearMap(commandLine.watchedDirectories, closeFileWatcherOf);
-        commandLine.watchedDirectories = void 0;
-      }
+      updateWatchingWildcardDirectories(
+        commandLine.watchedDirectories || (commandLine.watchedDirectories = /* @__PURE__ */ new Map()),
+        (_b = commandLine.parsedCommandLine) == null ? void 0 : _b.wildcardDirectories,
+        (directory, flags) => {
+          var _a2;
+          return watchDirectory(
+            directory,
+            (fileOrDirectory) => {
+              const fileOrDirectoryPath = toPath3(fileOrDirectory);
+              if (cachedDirectoryStructureHost) {
+                cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
+              }
+              nextSourceFileVersion(fileOrDirectoryPath);
+              const config = parsedConfigs == null ? void 0 : parsedConfigs.get(configPath);
+              if (!(config == null ? void 0 : config.parsedCommandLine))
+                return;
+              if (isIgnoredFileFromWildCardWatching({
+                watchedDirPath: toPath3(directory),
+                fileOrDirectory,
+                fileOrDirectoryPath,
+                configFileName: configFileName2,
+                options: config.parsedCommandLine.options,
+                program: config.parsedCommandLine.fileNames,
+                currentDirectory,
+                useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
+                writeLog,
+                toPath: toPath3
+              }))
+                return;
+              if (config.updateLevel !== 2 /* Full */) {
+                config.updateLevel = 1 /* RootNamesAndUpdate */;
+                scheduleProgramUpdate();
+              }
+            },
+            flags,
+            ((_a2 = commandLine.parsedCommandLine) == null ? void 0 : _a2.watchOptions) || watchOptions,
+            WatchType.WildcardDirectoryOfReferencedProject
+          );
+        }
+      );
       updateExtendedConfigFilesWatches(
         configPath,
-        (_d = commandLine.parsedCommandLine) == null ? void 0 : _d.options,
-        ((_e = commandLine.parsedCommandLine) == null ? void 0 : _e.watchOptions) || watchOptions,
+        (_c = commandLine.parsedCommandLine) == null ? void 0 : _c.options,
+        ((_d = commandLine.parsedCommandLine) == null ? void 0 : _d.watchOptions) || watchOptions,
         WatchType.ExtendedConfigOfReferencedProject
       );
     }
@@ -126951,7 +128134,6 @@ ${lanes.join("\n")}
     "src/compiler/watchPublic.ts"() {
       "use strict";
       init_ts2();
-      init_pnp();
     }
   });
 
@@ -127281,9 +128463,9 @@ ${lanes.join("\n")}
   function createStateBuildOrder(state) {
     const buildOrder = createBuildOrder(state, state.rootNames.map((f) => resolveProjectName(state, f)));
     state.resolvedConfigFilePaths.clear();
-    const currentProjects = new Map(
+    const currentProjects = new Set(
       getBuildOrderFromAnyBuildOrder(buildOrder).map(
-        (resolved) => [toResolvedConfigFilePath(state, resolved), true]
+        (resolved) => toResolvedConfigFilePath(state, resolved)
       )
     );
     const noopOnDelete = { onDeleteValue: noop };
@@ -127295,6 +128477,7 @@ ${lanes.join("\n")}
     mutateMapSkippingNewValues(state.projectErrorsReported, currentProjects, noopOnDelete);
     mutateMapSkippingNewValues(state.buildInfoCache, currentProjects, noopOnDelete);
     mutateMapSkippingNewValues(state.outputTimeStamps, currentProjects, noopOnDelete);
+    mutateMapSkippingNewValues(state.lastCachedPackageJsonLookups, currentProjects, noopOnDelete);
     if (state.watch) {
       mutateMapSkippingNewValues(
         state.allWatchedConfigFiles,
@@ -127543,7 +128726,7 @@ ${lanes.join("\n")}
       return withProgramOrUndefined(action) || emptyArray;
     }
     function createProgram2() {
-      var _a, _b;
+      var _a, _b, _c;
       Debug.assert(program === void 0);
       if (state.options.dry) {
         reportStatus(state, Diagnostics.A_non_dry_build_would_build_project_0, project);
@@ -127572,12 +128755,13 @@ ${lanes.join("\n")}
         config.projectReferences
       );
       if (state.watch) {
+        const internalMap = (_c = state.moduleResolutionCache) == null ? void 0 : _c.getPackageJsonInfoCache().getInternalMap();
         state.lastCachedPackageJsonLookups.set(
           projectPath,
-          state.moduleResolutionCache && map(
-            state.moduleResolutionCache.getPackageJsonInfoCache().entries(),
-            ([path, data]) => [state.host.realpath && data ? toPath2(state, state.host.realpath(path)) : path, data]
-          )
+          internalMap && new Set(arrayFrom(
+            internalMap.values(),
+            (data) => state.host.realpath && (isPackageJsonInfo(data) || data.directoryExists) ? state.host.realpath(combinePaths(data.packageDirectory, "package.json")) : combinePaths(data.packageDirectory, "package.json")
+          ))
         );
         state.builderPrograms.set(projectPath, program);
       }
@@ -128101,7 +129285,7 @@ ${lanes.join("\n")}
     }
   }
   function getUpToDateStatusWorker(state, project, resolvedPath) {
-    var _a, _b;
+    var _a, _b, _c;
     if (!project.fileNames.length && !canJsonReportNoInputFiles(project.raw)) {
       return {
         type: 16 /* ContainerOnly */
@@ -128175,7 +129359,7 @@ ${lanes.join("\n")}
         };
       }
       if (buildInfo.program) {
-        if (((_a = buildInfo.program.changeFileSet) == null ? void 0 : _a.length) || (!project.options.noEmit ? (_b = buildInfo.program.affectedFilesPendingEmit) == null ? void 0 : _b.length : some(buildInfo.program.semanticDiagnosticsPerFile, isArray))) {
+        if (((_a = buildInfo.program.changeFileSet) == null ? void 0 : _a.length) || (!project.options.noEmit ? ((_b = buildInfo.program.affectedFilesPendingEmit) == null ? void 0 : _b.length) || ((_c = buildInfo.program.emitDiagnosticsPerFile) == null ? void 0 : _c.length) : some(buildInfo.program.semanticDiagnosticsPerFile, isArray))) {
           return {
             type: 8 /* OutOfDateBuildInfo */,
             buildInfoFile: buildInfoPath
@@ -128310,9 +129494,10 @@ ${lanes.join("\n")}
     const extendedConfigStatus = forEach(project.options.configFile.extendedSourceFiles || emptyArray, (configFile) => checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName));
     if (extendedConfigStatus)
       return extendedConfigStatus;
-    const dependentPackageFileStatus = forEach(
-      state.lastCachedPackageJsonLookups.get(resolvedPath) || emptyArray,
-      ([path]) => checkConfigFileUpToDateStatus(state, path, oldestOutputFileTime, oldestOutputFileName)
+    const packageJsonLookups = state.lastCachedPackageJsonLookups.get(resolvedPath);
+    const dependentPackageFileStatus = packageJsonLookups && forEachKey(
+      packageJsonLookups,
+      (path) => checkConfigFileUpToDateStatus(state, path, oldestOutputFileTime, oldestOutputFileName)
     );
     if (dependentPackageFileStatus)
       return dependentPackageFileStatus;
@@ -128669,7 +129854,7 @@ ${lanes.join("\n")}
       return;
     updateWatchingWildcardDirectories(
       getOrCreateValueMapFromConfigFileMap(state.allWatchedWildcardDirectories, resolvedPath),
-      new Map(Object.entries(parsed.wildcardDirectories)),
+      parsed.wildcardDirectories,
       (dir, flags) => state.watchDirectory(
         dir,
         (fileOrDirectory) => {
@@ -128701,9 +129886,9 @@ ${lanes.join("\n")}
       return;
     mutateMap(
       getOrCreateValueMapFromConfigFileMap(state.allWatchedInputFiles, resolvedPath),
-      arrayToMap(parsed.fileNames, (fileName) => toPath2(state, fileName)),
+      new Set(parsed.fileNames),
       {
-        createNewValue: (_path, input) => watchFile(
+        createNewValue: (input) => watchFile(
           state,
           input,
           () => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /* Update */),
@@ -128721,11 +129906,11 @@ ${lanes.join("\n")}
       return;
     mutateMap(
       getOrCreateValueMapFromConfigFileMap(state.allWatchedPackageJsonFiles, resolvedPath),
-      new Map(state.lastCachedPackageJsonLookups.get(resolvedPath)),
+      state.lastCachedPackageJsonLookups.get(resolvedPath),
       {
-        createNewValue: (path, _input) => watchFile(
+        createNewValue: (input) => watchFile(
           state,
-          path,
+          input,
           () => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /* Update */),
           2e3 /* High */,
           parsed == null ? void 0 : parsed.watchOptions,
@@ -131244,7 +132429,8 @@ ${lanes.join("\n")}
       getProjectReferenceRedirect: (fileName) => program.getProjectReferenceRedirect(fileName),
       isSourceOfProjectReferenceRedirect: (fileName) => program.isSourceOfProjectReferenceRedirect(fileName),
       getNearestAncestorDirectoryWithPackageJson: maybeBind(host, host.getNearestAncestorDirectoryWithPackageJson),
-      getFileIncludeReasons: () => program.getFileIncludeReasons()
+      getFileIncludeReasons: () => program.getFileIncludeReasons(),
+      getCommonSourceDirectory: () => program.getCommonSourceDirectory()
     };
   }
   function getModuleSpecifierResolverHost(program, host) {
@@ -131380,8 +132566,11 @@ ${lanes.join("\n")}
   function textSpansEqual(a, b) {
     return !!a && !!b && a.start === b.start && a.length === b.length;
   }
-  function documentSpansEqual(a, b) {
-    return a.fileName === b.fileName && textSpansEqual(a.textSpan, b.textSpan);
+  function documentSpansEqual(a, b, useCaseSensitiveFileNames2) {
+    return (useCaseSensitiveFileNames2 ? equateStringsCaseSensitive : equateStringsCaseInsensitive)(a.fileName, b.fileName) && textSpansEqual(a.textSpan, b.textSpan);
+  }
+  function getDocumentSpansEqualityComparer(useCaseSensitiveFileNames2) {
+    return (a, b) => documentSpansEqual(a, b, useCaseSensitiveFileNames2);
   }
   function forEachUnique(array, callback) {
     if (array) {
@@ -131629,16 +132818,18 @@ ${lanes.join("\n")}
       }
     } else {
       const symbol = checker == null ? void 0 : checker.getSymbolAtLocation(link.name);
+      const targetSymbol = symbol && checker ? getSymbolTarget(symbol, checker) : void 0;
       const suffix = findLinkNameEnd(link.text);
       const name = getTextOfNode(link.name) + link.text.slice(0, suffix);
       const text = skipSeparatorFromLinkText(link.text.slice(suffix));
-      const decl = (symbol == null ? void 0 : symbol.valueDeclaration) || ((_a = symbol == null ? void 0 : symbol.declarations) == null ? void 0 : _a[0]);
+      const decl = (targetSymbol == null ? void 0 : targetSymbol.valueDeclaration) || ((_a = targetSymbol == null ? void 0 : targetSymbol.declarations) == null ? void 0 : _a[0]);
       if (decl) {
         parts.push(linkNamePart(name, decl));
         if (text)
           parts.push(linkTextPart(text));
       } else {
-        parts.push(linkTextPart(name + (suffix ? "" : " ") + text));
+        const separator = suffix === 0 || link.text.charCodeAt(suffix) === 124 /* bar */ && name.charCodeAt(name.length - 1) !== 32 /* space */ ? " " : "";
+        parts.push(linkTextPart(name + separator + text));
       }
     }
     parts.push(linkPart("}"));
@@ -131787,7 +132978,14 @@ ${lanes.join("\n")}
       true,
       replaceNode
     ) : (ns) => ns && getSynthesizedDeepClones(ns);
-    const visited = visitEachChild(node, nodeClone, nullTransformationContext, nodesClone, nodeClone);
+    const visited = visitEachChild(
+      node,
+      nodeClone,
+      /*context*/
+      void 0,
+      nodesClone,
+      nodeClone
+    );
     if (visited === node) {
       const clone2 = isStringLiteral(node) ? setOriginalNode(factory.createStringLiteralFromNode(node), node) : isNumericLiteral(node) ? setOriginalNode(factory.createNumericLiteral(node.text, node.numericLiteralFlags), node) : factory.cloneNode(node);
       return setTextRange(clone2, node);
@@ -131923,7 +133121,7 @@ ${lanes.join("\n")}
   function quote(sourceFile, preferences, text) {
     const quotePreference = getQuotePreference(sourceFile, preferences);
     const quoted = JSON.stringify(text);
-    return quotePreference === 0 /* Single */ ? `'${stripQuotes(quoted).replace(/'/g, "\\'").replace(/\\"/g, '"')}'` : quoted;
+    return quotePreference === 0 /* Single */ ? `'${stripQuotes(quoted).replace(/'/g, () => "\\'").replace(/\\"/g, '"')}'` : quoted;
   }
   function isEqualityOperatorKind(kind) {
     switch (kind) {
@@ -132262,14 +133460,7 @@ ${lanes.join("\n")}
       return false;
     }
     function getNodeModulesPackageNameFromFileName(importedFileName, moduleSpecifierResolutionHost) {
-      const pnpapi = getPnpApi(importedFileName);
-      if (pnpapi) {
-        const fromLocator = pnpapi.findPackageLocator(fromFile.fileName);
-        const toLocator = pnpapi.findPackageLocator(importedFileName);
-        if (!(fromLocator && toLocator)) {
-          return void 0;
-        }
-      } else if (!importedFileName.includes("node_modules")) {
+      if (!importedFileName.includes("node_modules")) {
         return void 0;
       }
       const specifier = ts_moduleSpecifiers_exports.getNodeModulesPackageName(
@@ -132294,13 +133485,6 @@ ${lanes.join("\n")}
       return components[0];
     }
   }
-  function tryParseJson(text) {
-    try {
-      return JSON.parse(text);
-    } catch {
-      return void 0;
-    }
-  }
   function consumesNodeCoreModules(sourceFile) {
     return some(sourceFile.imports, ({ text }) => ts_JsTyping_exports.nodeCoreModules.has(text));
   }
@@ -132565,7 +133749,6 @@ ${lanes.join("\n")}
   var init_utilities4 = __esm({
     "src/services/utilities.ts"() {
       "use strict";
-      init_pnp();
       init_ts4();
       scanner = createScanner(
         99 /* Latest */,
@@ -132844,9 +134027,6 @@ ${lanes.join("\n")}
     return hasImportablePath;
   }
   function isImportablePath(fromPath, toPath3, getCanonicalFileName, globalCachePath) {
-    if (getPnpApi(fromPath)) {
-      return isImportablePathPnp(fromPath, toPath3);
-    }
     const toNodeModules = forEachAncestorDirectory(toPath3, (ancestor) => getBaseFileName(ancestor) === "node_modules" ? ancestor : void 0);
     const toNodeModulesParent = toNodeModules && getDirectoryPath(getCanonicalFileName(toNodeModules));
     return toNodeModulesParent === void 0 || startsWith(getCanonicalFileName(fromPath), toNodeModulesParent) || !!globalCachePath && startsWith(getCanonicalFileName(globalCachePath), toNodeModulesParent);
@@ -132855,10 +134035,10 @@ ${lanes.join("\n")}
     var _a, _b;
     const useCaseSensitiveFileNames2 = hostUsesCaseSensitiveFileNames(host);
     const excludePatterns = preferences.autoImportFileExcludePatterns && mapDefined(preferences.autoImportFileExcludePatterns, (spec) => {
-      const pattern = getPatternFromSpec(spec, "", "exclude");
+      const pattern = getSubPatternFromSpec(spec, "", "exclude");
       return pattern ? getRegexFromPattern(pattern, useCaseSensitiveFileNames2) : void 0;
     });
-    forEachExternalModule(program.getTypeChecker(), program.getSourceFiles(), excludePatterns, (module2, file) => cb(
+    forEachExternalModule(program.getTypeChecker(), program.getSourceFiles(), excludePatterns, host, (module2, file) => cb(
       module2,
       file,
       program,
@@ -132869,7 +134049,7 @@ ${lanes.join("\n")}
     if (autoImportProvider) {
       const start = timestamp();
       const checker = program.getTypeChecker();
-      forEachExternalModule(autoImportProvider.getTypeChecker(), autoImportProvider.getSourceFiles(), excludePatterns, (module2, file) => {
+      forEachExternalModule(autoImportProvider.getTypeChecker(), autoImportProvider.getSourceFiles(), excludePatterns, host, (module2, file) => {
         if (file && !program.getSourceFile(file.fileName) || !file && !checker.resolveName(
           module2.name,
           /*location*/
@@ -132890,11 +134070,26 @@ ${lanes.join("\n")}
       (_b = host.log) == null ? void 0 : _b.call(host, `forEachExternalModuleToImportFrom autoImportProvider: ${timestamp() - start}`);
     }
   }
-  function forEachExternalModule(checker, allSourceFiles, excludePatterns, cb) {
-    var _a;
-    const isExcluded = excludePatterns && ((fileName) => excludePatterns.some((p) => p.test(fileName)));
+  function forEachExternalModule(checker, allSourceFiles, excludePatterns, host, cb) {
+    var _a, _b;
+    const realpathsWithSymlinks = (_a = host.getSymlinkCache) == null ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
+    const isExcluded = excludePatterns && (({ fileName, path }) => {
+      if (excludePatterns.some((p) => p.test(fileName)))
+        return true;
+      if ((realpathsWithSymlinks == null ? void 0 : realpathsWithSymlinks.size) && pathContainsNodeModules(fileName)) {
+        let dir = getDirectoryPath(fileName);
+        return forEachAncestorDirectory(getDirectoryPath(path), (dirPath) => {
+          const symlinks = realpathsWithSymlinks.get(ensureTrailingDirectorySeparator(dirPath));
+          if (symlinks) {
+            return symlinks.some((s) => excludePatterns.some((p) => p.test(fileName.replace(dir, s))));
+          }
+          dir = getDirectoryPath(dir);
+        }) ?? false;
+      }
+      return false;
+    });
     for (const ambient of checker.getAmbientModules()) {
-      if (!ambient.name.includes("*") && !(excludePatterns && ((_a = ambient.declarations) == null ? void 0 : _a.every((d) => isExcluded(d.getSourceFile().fileName))))) {
+      if (!ambient.name.includes("*") && !(excludePatterns && ((_b = ambient.declarations) == null ? void 0 : _b.every((d) => isExcluded(d.getSourceFile()))))) {
         cb(
           ambient,
           /*sourceFile*/
@@ -132903,7 +134098,7 @@ ${lanes.join("\n")}
       }
     }
     for (const sourceFile of allSourceFiles) {
-      if (isExternalOrCommonJsModule(sourceFile) && !(isExcluded == null ? void 0 : isExcluded(sourceFile.fileName))) {
+      if (isExternalOrCommonJsModule(sourceFile) && !(isExcluded == null ? void 0 : isExcluded(sourceFile))) {
         cb(checker.getMergedSymbol(sourceFile.symbol), sourceFile);
       }
     }
@@ -133030,7 +134225,6 @@ ${lanes.join("\n")}
   var init_exportInfoMap = __esm({
     "src/services/exportInfoMap.ts"() {
       "use strict";
-      init_pnp();
       init_ts4();
       ImportKind = /* @__PURE__ */ ((ImportKind2) => {
         ImportKind2[ImportKind2["Named"] = 0] = "Named";
@@ -134043,6 +135237,7 @@ ${lanes.join("\n")}
             case 127 /* YieldKeyword */:
               return highlightSpans(getYieldOccurrences(node));
             case 103 /* InKeyword */:
+            case 147 /* OutKeyword */:
               return void 0;
             default:
               return isModifierKind(node.kind) && (isDeclaration(node.parent) || isVariableStatement(node.parent)) ? highlightSpans(getModifierOccurrences(node.kind, node.parent)) : void 0;
@@ -134695,7 +135890,7 @@ ${lanes.join("\n")}
         if ((importedModuleSymbol == null ? void 0 : importedModuleSymbol.declarations) && importedModuleSymbol.declarations.some((d) => isAmbientModule(d)))
           return void 0;
         const toImport = oldFromNew !== void 0 ? getSourceFileToImportFromResolved(importLiteral, resolveModuleName(importLiteral.text, oldImportFromPath, program.getCompilerOptions(), host), oldToNew, allFiles) : getSourceFileToImport(importedModuleSymbol, importLiteral, sourceFile, program, host, oldToNew);
-        return toImport !== void 0 && (toImport.updated || importingSourceFileMoved && pathIsRelative(importLiteral.text)) ? ts_moduleSpecifiers_exports.updateModuleSpecifier(program.getCompilerOptions(), sourceFile, getCanonicalFileName(newImportFromPath), toImport.newFileName, createModuleSpecifierResolutionHost(program, host), importLiteral.text) : void 0;
+        return toImport !== void 0 && (toImport.updated || importingSourceFileMoved && pathIsRelative(importLiteral.text)) ? ts_moduleSpecifiers_exports.updateModuleSpecifier(program.getCompilerOptions(), sourceFile, newImportFromPath, toImport.newFileName, createModuleSpecifierResolutionHost(program, host), importLiteral.text) : void 0;
       });
     }
   }
@@ -134711,8 +135906,8 @@ ${lanes.join("\n")}
       const newFileName = oldToNew(oldFileName);
       return newFileName === void 0 ? { newFileName: oldFileName, updated: false } : { newFileName, updated: true };
     } else {
-      const mode = getModeForUsageLocation(importingSourceFile, importLiteral);
-      const resolved = host.resolveModuleNameLiterals || !host.resolveModuleNames ? program.getResolvedModule(importingSourceFile, importLiteral.text, mode) : host.getResolvedModuleWithFailedLookupLocationsFromCache && host.getResolvedModuleWithFailedLookupLocationsFromCache(importLiteral.text, importingSourceFile.fileName, mode);
+      const mode = program.getModeForUsageLocation(importingSourceFile, importLiteral);
+      const resolved = host.resolveModuleNameLiterals || !host.resolveModuleNames ? program.getResolvedModuleFromModuleSpecifier(importLiteral) : host.getResolvedModuleWithFailedLookupLocationsFromCache && host.getResolvedModuleWithFailedLookupLocationsFromCache(importLiteral.text, importingSourceFile.fileName, mode);
       return getSourceFileToImportFromResolved(importLiteral, resolved, oldToNew, program.getSourceFiles());
     }
   }
@@ -135552,11 +136747,11 @@ ${lanes.join("\n")}
       const fileFromCache = sourceFileLike.get(path);
       if (fileFromCache !== void 0)
         return fileFromCache ? fileFromCache : void 0;
-      if (!host.readFile || host.fileExists && !host.fileExists(path)) {
+      if (!host.readFile || host.fileExists && !host.fileExists(fileName)) {
         sourceFileLike.set(path, false);
         return void 0;
       }
-      const text = host.readFile(path);
+      const text = host.readFile(fileName);
       const file = text ? createSourceFileLike(text) : false;
       sourceFileLike.set(path, file);
       return file ? file : void 0;
@@ -135649,7 +136844,7 @@ ${lanes.join("\n")}
         const name = importNameForConvertToDefaultImport(importNode);
         if (!name)
           continue;
-        const module2 = (_a = program.getResolvedModule(sourceFile, moduleSpecifier.text, getModeForUsageLocation(sourceFile, moduleSpecifier))) == null ? void 0 : _a.resolvedModule;
+        const module2 = (_a = program.getResolvedModuleFromModuleSpecifier(moduleSpecifier)) == null ? void 0 : _a.resolvedModule;
         const resolvedFile = module2 && program.getSourceFile(module2.resolvedFileName);
         if (resolvedFile && resolvedFile.externalModuleIndicator && resolvedFile.externalModuleIndicator !== true && isExportAssignment(resolvedFile.externalModuleIndicator) && resolvedFile.externalModuleIndicator.isExportEquals) {
           diags.push(createDiagnosticForNode(name, Diagnostics.Import_may_be_converted_to_a_default_import));
@@ -136805,7 +138000,7 @@ ${lanes.join("\n")}
         if (name.length > maxLength) {
           return `${name} callback`;
         }
-        const args = cleanText(mapDefined(parent2.arguments, (a) => isStringLiteralLike(a) ? a.getText(curSourceFile) : void 0).join(", "));
+        const args = cleanText(mapDefined(parent2.arguments, (a) => isStringLiteralLike(a) || isTemplateLiteral(a) ? a.getText(curSourceFile) : void 0).join(", "));
         return `${name}(${args}) callback`;
       }
     }
@@ -137203,7 +138398,7 @@ ${lanes.join("\n")}
         if (checker.resolveName(
           exportName,
           id,
-          67108863 /* All */,
+          -1 /* All */,
           /*excludeGlobals*/
           true
         )) {
@@ -137266,7 +138461,7 @@ ${lanes.join("\n")}
         const symbol = checker.resolveName(
           preferredName,
           id,
-          67108863 /* All */,
+          -1 /* All */,
           /*excludeGlobals*/
           true
         );
@@ -137390,11 +138585,9 @@ ${lanes.join("\n")}
   function getRangeToExtract(context, considerEmptySpans = true) {
     const { file, startPosition } = context;
     const isJS = isSourceFileJS(file);
-    const current = getTokenAtPosition(file, startPosition);
     const range = createTextRangeFromSpan(getRefactorContextSpan(context));
-    const cursorRequest = range.pos === range.end && considerEmptySpans;
-    const overlappingRange = nodeOverlapsWithStartEnd(current, file, range.pos, range.end);
-    const firstType = findAncestor(current, (node) => node.parent && isTypeNode(node) && !rangeContainsSkipTrivia(range, node.parent, file) && (cursorRequest || overlappingRange));
+    const isCursorRequest = range.pos === range.end && considerEmptySpans;
+    const firstType = getFirstTypeAt(file, startPosition, range, isCursorRequest);
     if (!firstType || !isTypeNode(firstType))
       return { error: getLocaleSpecificMessage(Diagnostics.Selection_is_not_a_valid_type_node) };
     const checker = context.program.getTypeChecker();
@@ -137420,6 +138613,21 @@ ${lanes.join("\n")}
     const typeElements = flattenTypeLiteralNodeReference(checker, selection);
     return { isJS, selection, enclosingNode, typeParameters, typeElements };
   }
+  function getFirstTypeAt(file, startPosition, range, isCursorRequest) {
+    const currentNodes = [
+      () => getTokenAtPosition(file, startPosition),
+      () => getTouchingToken(file, startPosition, () => true)
+    ];
+    for (const f of currentNodes) {
+      const current = f();
+      const overlappingRange = nodeOverlapsWithStartEnd(current, file, range.pos, range.end);
+      const firstType = findAncestor(current, (node) => node.parent && isTypeNode(node) && !rangeContainsSkipTrivia(range, node.parent, file) && (isCursorRequest || overlappingRange));
+      if (firstType) {
+        return firstType;
+      }
+    }
+    return void 0;
+  }
   function flattenTypeLiteralNodeReference(checker, selection) {
     if (!selection)
       return void 0;
@@ -137808,7 +139016,7 @@ ${lanes.join("\n")}
   function getReferenceNodes(declaration, checker, file) {
     const references = [];
     const cannotInline = ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(declaration.name, checker, file, (ref) => {
-      if (ts_FindAllReferences_exports.isWriteAccessForReference(ref)) {
+      if (ts_FindAllReferences_exports.isWriteAccessForReference(ref) && !isShorthandPropertyAssignment(ref.parent)) {
         return true;
       }
       if (isExportSpecifier(ref.parent) || isExportAssignment(ref.parent)) {
@@ -137836,6 +139044,9 @@ ${lanes.join("\n")}
     if (isPropertyAccessExpression(parent2) && (isNumericLiteral(replacement) || isObjectLiteralExpression(replacement))) {
       return factory.createParenthesizedExpression(replacement);
     }
+    if (isIdentifier(reference) && isShorthandPropertyAssignment(parent2)) {
+      return factory.createPropertyAssignment(reference, replacement);
+    }
     return replacement;
   }
   var refactorName4, refactorDescription, inlineVariableAction;
@@ -137911,10 +139122,10 @@ ${lanes.join("\n")}
   });
 
   // src/services/refactors/moveToNewFile.ts
-  function doChange3(oldFile, program, toMove, changes, host, preferences, context) {
+  function doChange3(oldFile, program, toMove, changes, host, preferences) {
     const checker = program.getTypeChecker();
     const usage = getUsageInfo(oldFile, toMove.all, checker);
-    const newFilename = createNewFileName(oldFile, program, context, host);
+    const newFilename = createNewFileName(oldFile, program, host, toMove);
     changes.createNewFile(oldFile, newFilename, getNewStatementsAndRemoveFromOldFile(oldFile, usage, changes, toMove, program, host, newFilename, preferences));
     addNewFileToTsconfig(program, changes, oldFile.fileName, newFilename, hostGetCanonicalFileName(host));
   }
@@ -138019,7 +139230,7 @@ ${lanes.join("\n")}
         getEditsForAction: function getRefactorEditsToMoveToNewFile(context, actionName2) {
           Debug.assert(actionName2 === refactorName5, "Wrong refactor invoked");
           const statements = Debug.checkDefined(getStatementsToMove(context));
-          const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange3(context.file, context.program, statements, t, context.host, context.preferences, context));
+          const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange3(context.file, context.program, statements, t, context.host, context.preferences));
           return { edits, renameFilename: void 0, renameLocation: void 0 };
         }
       });
@@ -138038,7 +139249,7 @@ ${lanes.join("\n")}
     } else {
       const targetSourceFile = Debug.checkDefined(program.getSourceFile(targetFile));
       const importAdder = ts_codefix_exports.createImportAdder(targetSourceFile, context.program, context.preferences, context.host);
-      getNewStatementsAndRemoveFromOldFile2(oldFile, targetSourceFile, getUsageInfo(oldFile, toMove.all, checker, getExistingImports(targetSourceFile, checker)), changes, toMove, program, host, preferences, importAdder);
+      getNewStatementsAndRemoveFromOldFile2(oldFile, targetSourceFile, getUsageInfo(oldFile, toMove.all, checker, getExistingLocals(targetSourceFile, toMove.all, checker)), changes, toMove, program, host, preferences, importAdder);
     }
   }
   function getNewStatementsAndRemoveFromOldFile2(oldFile, targetFile, usage, changes, toMove, program, host, preferences, importAdder) {
@@ -138126,10 +139337,11 @@ ${lanes.join("\n")}
         forEachImportInStatement(oldStatement, (i) => {
           var _a;
           const moduleSpecifier = moduleSpecifierFromImport(i);
-          const resolved = program.getResolvedModule(oldFile, moduleSpecifier.text, getModeForUsageLocation(oldFile, moduleSpecifier));
+          const compilerOptions = program.getCompilerOptions();
+          const resolved = program.getResolvedModuleFromModuleSpecifier(moduleSpecifier);
           const fileName = (_a = resolved == null ? void 0 : resolved.resolvedModule) == null ? void 0 : _a.resolvedFileName;
           if (fileName && targetSourceFile) {
-            const newModuleSpecifier = getModuleSpecifier(program.getCompilerOptions(), targetSourceFile, targetSourceFile.path, fileName, createModuleSpecifierResolutionHost(program, host));
+            const newModuleSpecifier = getModuleSpecifier(compilerOptions, targetSourceFile, targetSourceFile.fileName, fileName, createModuleSpecifierResolutionHost(program, host));
             append(copiedOldImports, filterImport(i, makeStringLiteral(newModuleSpecifier, quotePreference), (name) => importsToCopy.has(checker.getSymbolAtLocation(name))));
           } else {
             append(copiedOldImports, filterImport(i, factory.createStringLiteral(moduleSpecifierFromImport(i).text), (name) => importsToCopy.has(checker.getSymbolAtLocation(name))));
@@ -138207,7 +139419,7 @@ ${lanes.join("\n")}
           };
           deleteUnusedImports(sourceFile, importNode, changes, shouldMove);
           const pathToTargetFileWithExtension = resolvePath(getDirectoryPath(oldFile.path), targetFileName);
-          const newModuleSpecifier = getModuleSpecifier(program.getCompilerOptions(), sourceFile, sourceFile.path, pathToTargetFileWithExtension, createModuleSpecifierResolutionHost(program, host));
+          const newModuleSpecifier = getModuleSpecifier(program.getCompilerOptions(), sourceFile, sourceFile.fileName, pathToTargetFileWithExtension, createModuleSpecifierResolutionHost(program, host));
           const newImportDeclaration = filterImport(importNode, makeStringLiteral(newModuleSpecifier, quotePreference), shouldMove);
           if (newImportDeclaration)
             changes.insertNodeAfter(sourceFile, statement, newImportDeclaration);
@@ -138240,7 +139452,7 @@ ${lanes.join("\n")}
       needUniqueName = needUniqueName || !!checker.resolveName(
         preferredNewNamespaceName,
         ref,
-        67108863 /* All */,
+        -1 /* All */,
         /*excludeGlobals*/
         true
       );
@@ -138342,7 +139554,7 @@ ${lanes.join("\n")}
   }
   function makeImportOrRequire(sourceFile, defaultImport, imports, targetFileNameWithExtension, program, host, useEs6Imports, quotePreference) {
     const pathToTargetFile = resolvePath(getDirectoryPath(sourceFile.path), targetFileNameWithExtension);
-    const pathToTargetFileWithCorrectExtension = getModuleSpecifier(program.getCompilerOptions(), sourceFile, sourceFile.path, pathToTargetFile, createModuleSpecifierResolutionHost(program, host));
+    const pathToTargetFileWithCorrectExtension = getModuleSpecifier(program.getCompilerOptions(), sourceFile, sourceFile.fileName, pathToTargetFile, createModuleSpecifierResolutionHost(program, host));
     if (useEs6Imports) {
       const specifiers = imports.map((i) => factory.createImportSpecifier(
         /*isTypeOnly*/
@@ -138622,12 +139834,10 @@ ${lanes.join("\n")}
         changes.insertNodesAfter(sourceFile, decl, names.map(createExportAssignment));
     }
   }
-  function createNewFileName(oldFile, program, context, host) {
+  function createNewFileName(oldFile, program, host, toMove) {
     const checker = program.getTypeChecker();
-    const toMove = getStatementsToMove(context);
-    let usage;
     if (toMove) {
-      usage = getUsageInfo(oldFile, toMove.all, checker);
+      const usage = getUsageInfo(oldFile, toMove.all, checker);
       const currentDirectory = getDirectoryPath(oldFile.fileName);
       const extension = extensionFromPath(oldFile.fileName);
       const newFileName = combinePaths(
@@ -138685,6 +139895,9 @@ ${lanes.join("\n")}
     });
     return all.length === 0 ? void 0 : { all, ranges };
   }
+  function containsJsx(statements) {
+    return find(statements, (statement) => !!(statement.transformFlags & 2 /* ContainsJsx */));
+  }
   function isAllowedStatementToMove(statement) {
     return !isPureImport(statement) && !isPrologueDirective(statement);
   }
@@ -138704,12 +139917,11 @@ ${lanes.join("\n")}
         return false;
     }
   }
-  function getUsageInfo(oldFile, toMove, checker, existingTargetImports = /* @__PURE__ */ new Set()) {
+  function getUsageInfo(oldFile, toMove, checker, existingTargetLocals = /* @__PURE__ */ new Set()) {
     const movedSymbols = /* @__PURE__ */ new Set();
     const oldImportsNeededByTargetFile = /* @__PURE__ */ new Map();
     const targetFileImportsFromOldFile = /* @__PURE__ */ new Set();
-    const containsJsx = find(toMove, (statement) => !!(statement.transformFlags & 2 /* ContainsJsx */));
-    const jsxNamespaceSymbol = getJsxNamespaceSymbol(containsJsx);
+    const jsxNamespaceSymbol = getJsxNamespaceSymbol(containsJsx(toMove));
     if (jsxNamespaceSymbol) {
       oldImportsNeededByTargetFile.set(jsxNamespaceSymbol, false);
     }
@@ -138724,7 +139936,7 @@ ${lanes.join("\n")}
         if (!symbol.declarations) {
           return;
         }
-        if (existingTargetImports.has(skipAlias(symbol, checker))) {
+        if (existingTargetLocals.has(skipAlias(symbol, checker))) {
           unusedImportsFromOldFile.add(symbol);
           return;
         }
@@ -138926,15 +140138,15 @@ ${lanes.join("\n")}
     }
     return void 0;
   }
-  function getExistingImports(sourceFile, checker) {
-    const imports = /* @__PURE__ */ new Set();
+  function getExistingLocals(sourceFile, statements, checker) {
+    const existingLocals = /* @__PURE__ */ new Set();
     for (const moduleSpecifier of sourceFile.imports) {
       const declaration = importFromModuleSpecifier(moduleSpecifier);
       if (isImportDeclaration(declaration) && declaration.importClause && declaration.importClause.namedBindings && isNamedImports(declaration.importClause.namedBindings)) {
         for (const e of declaration.importClause.namedBindings.elements) {
           const symbol = checker.getSymbolAtLocation(e.propertyName || e.name);
           if (symbol) {
-            imports.add(skipAlias(symbol, checker));
+            existingLocals.add(skipAlias(symbol, checker));
           }
         }
       }
@@ -138942,12 +140154,20 @@ ${lanes.join("\n")}
         for (const e of declaration.parent.name.elements) {
           const symbol = checker.getSymbolAtLocation(e.propertyName || e.name);
           if (symbol) {
-            imports.add(skipAlias(symbol, checker));
+            existingLocals.add(skipAlias(symbol, checker));
           }
         }
       }
     }
-    return imports;
+    for (const statement of statements) {
+      forEachReference(statement, checker, (s) => {
+        const symbol = skipAlias(s, checker);
+        if (symbol.valueDeclaration && getSourceFileOfNode(symbol.valueDeclaration) === sourceFile) {
+          existingLocals.add(symbol);
+        }
+      });
+    }
+    return existingLocals;
   }
   var refactorNameForMoveToFile, description2, moveToFileAction;
   var init_moveToFile = __esm({
@@ -141741,7 +142961,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         const oldIgnoreReturns = ignoreReturns;
         ignoreReturns = ignoreReturns || isFunctionLikeDeclaration(node) || isClassLike(node);
         const substitution = substitutions.get(getNodeId(node).toString());
-        const result = substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(node, visitor, nullTransformationContext);
+        const result = substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(
+          node,
+          visitor,
+          /*context*/
+          void 0
+        );
         ignoreReturns = oldIgnoreReturns;
         return result;
       }
@@ -141751,7 +142976,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     return substitutions.size ? visitor(initializer) : initializer;
     function visitor(node) {
       const substitution = substitutions.get(getNodeId(node).toString());
-      return substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(node, visitor, nullTransformationContext);
+      return substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(
+        node,
+        visitor,
+        /*context*/
+        void 0
+      );
     }
   }
   function getStatementsOrClassElements(scope) {
@@ -142408,6 +143638,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     addExports: () => addExports,
     addNewFileToTsconfig: () => addNewFileToTsconfig,
     addOrRemoveBracesToArrowFunction: () => ts_refactor_addOrRemoveBracesToArrowFunction_exports,
+    containsJsx: () => containsJsx,
     convertArrowFunctionOrFunctionExpression: () => ts_refactor_convertArrowFunctionOrFunctionExpression_exports,
     convertParamsToDestructuredObject: () => ts_refactor_convertParamsToDestructuredObject_exports,
     convertStringOrTemplateLiteral: () => ts_refactor_convertStringOrTemplateLiteral_exports,
@@ -142969,6 +144200,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       return sourceFile;
     }
     function synchronizeHostData() {
+      if (host.updateFromProject && !host.updateFromProjectInProgress) {
+        host.updateFromProject();
+      } else {
+        synchronizeHostDataWorker();
+      }
+    }
+    function synchronizeHostDataWorker() {
       var _a2, _b, _c;
       Debug.assert(languageServiceMode !== 2 /* Syntactic */);
       if (host.getProjectVersion) {
@@ -143543,12 +144781,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       }
       return [];
     }
-    function getCodeFixesAtPosition(fileName, start, end, errorCodes64, formatOptions, preferences = emptyOptions) {
+    function getCodeFixesAtPosition(fileName, start, end, errorCodes65, formatOptions, preferences = emptyOptions) {
       synchronizeHostData();
       const sourceFile = getValidSourceFile(fileName);
       const span = createTextSpanFromBounds(start, end);
       const formatContext = ts_formatting_exports.getFormatContext(formatOptions, host);
-      return flatMap(deduplicate(errorCodes64, equateValues, compareValues), (errorCode) => {
+      return flatMap(deduplicate(errorCodes65, equateValues, compareValues), (errorCode) => {
         cancellationToken.throwIfCancellationRequested();
         return ts_codefix_exports.getFixes({ errorCode, sourceFile, span, program, host, cancellationToken, formatContext, preferences });
       });
@@ -143651,17 +144889,19 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         Debug.assert(isJsxOpeningElement(tag) || isJsxClosingElement(tag), "tag should be opening or closing element");
         const openTag = tag.parent.openingElement;
         const closeTag = tag.parent.closingElement;
-        const openTagStart = openTag.tagName.getStart(sourceFile);
-        const openTagEnd = openTag.tagName.end;
-        const closeTagStart = closeTag.tagName.getStart(sourceFile);
-        const closeTagEnd = closeTag.tagName.end;
-        if (!(openTagStart <= position && position <= openTagEnd || closeTagStart <= position && position <= closeTagEnd))
+        const openTagNameStart = openTag.tagName.getStart(sourceFile);
+        const openTagNameEnd = openTag.tagName.end;
+        const closeTagNameStart = closeTag.tagName.getStart(sourceFile);
+        const closeTagNameEnd = closeTag.tagName.end;
+        if (openTagNameStart === openTag.getStart(sourceFile) || closeTagNameStart === closeTag.getStart(sourceFile) || openTagNameEnd === openTag.getEnd() || closeTagNameEnd === closeTag.getEnd())
+          return void 0;
+        if (!(openTagNameStart <= position && position <= openTagNameEnd || closeTagNameStart <= position && position <= closeTagNameEnd))
           return void 0;
         const openingTagText = openTag.tagName.getText(sourceFile);
         if (openingTagText !== closeTag.tagName.getText(sourceFile))
           return void 0;
         return {
-          ranges: [{ start: openTagStart, length: openTagEnd - openTagStart }, { start: closeTagStart, length: closeTagEnd - closeTagStart }],
+          ranges: [{ start: openTagNameStart, length: openTagNameEnd - openTagNameStart }, { start: closeTagNameStart, length: closeTagNameEnd - closeTagNameStart }],
           wordPattern: jsxTagWordPattern
         };
       }
@@ -143974,9 +145214,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       const sourceFile = getValidSourceFile(fileName);
       const allFiles = Debug.checkDefined(program.getSourceFiles());
       const extension = extensionFromPath(fileName);
-      const files = mapDefined(allFiles, (file) => !(program == null ? void 0 : program.isSourceFileFromExternalLibrary(sourceFile)) && !(sourceFile === getValidSourceFile(file.fileName) || extension === ".ts" /* Ts */ && extensionFromPath(file.fileName) === ".d.ts" /* Dts */ || extension === ".d.ts" /* Dts */ && startsWith(getBaseFileName(file.fileName), "lib.") && extensionFromPath(file.fileName) === ".d.ts" /* Dts */) && extension === extensionFromPath(file.fileName) ? file.fileName : void 0);
-      const newFileName = createNewFileName(sourceFile, program, getRefactorContext(sourceFile, positionOrRange, preferences, emptyOptions), host);
-      return { newFileName, files };
+      const toMove = getStatementsToMove(getRefactorContext(sourceFile, positionOrRange, preferences, emptyOptions));
+      const toMoveContainsJsx = containsJsx(toMove == null ? void 0 : toMove.all);
+      const files = mapDefined(allFiles, (file) => {
+        const fileNameExtension = extensionFromPath(file.fileName);
+        const isValidSourceFile = !(program == null ? void 0 : program.isSourceFileFromExternalLibrary(sourceFile)) && !(sourceFile === getValidSourceFile(file.fileName) || extension === ".ts" /* Ts */ && fileNameExtension === ".d.ts" /* Dts */ || extension === ".d.ts" /* Dts */ && startsWith(getBaseFileName(file.fileName), "lib.") && fileNameExtension === ".d.ts" /* Dts */);
+        return isValidSourceFile && (extension === fileNameExtension || (extension === ".tsx" /* Tsx */ && fileNameExtension === ".ts" /* Ts */ || extension === ".jsx" /* Jsx */ && fileNameExtension === ".js" /* Js */) && !toMoveContainsJsx) ? file.fileName : void 0;
+      });
+      return { newFileName: createNewFileName(sourceFile, program, host, toMove), files };
     }
     function getEditsForRefactor2(fileName, formatOptions, positionOrRange, refactorName14, actionName2, preferences = emptyOptions, interactiveRefactorArguments) {
       synchronizeHostData();
@@ -144173,16 +145418,17 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       const symbol = contextualType.getProperty(name);
       return symbol ? [symbol] : emptyArray;
     }
-    const discriminatedPropertySymbols = mapDefined(contextualType.types, (t) => (isObjectLiteralExpression(node.parent) || isJsxAttributes(node.parent)) && checker.isTypeInvalidDueToUnionDiscriminant(t, node.parent) ? void 0 : t.getProperty(name));
+    const filteredTypes = isObjectLiteralExpression(node.parent) || isJsxAttributes(node.parent) ? filter(contextualType.types, (t) => !checker.isTypeInvalidDueToUnionDiscriminant(t, node.parent)) : contextualType.types;
+    const discriminatedPropertySymbols = mapDefined(filteredTypes, (t) => t.getProperty(name));
     if (unionSymbolOk && (discriminatedPropertySymbols.length === 0 || discriminatedPropertySymbols.length === contextualType.types.length)) {
       const symbol = contextualType.getProperty(name);
       if (symbol)
         return [symbol];
     }
-    if (discriminatedPropertySymbols.length === 0) {
+    if (!filteredTypes.length && !discriminatedPropertySymbols.length) {
       return mapDefined(contextualType.types, (t) => t.getProperty(name));
     }
-    return discriminatedPropertySymbols;
+    return deduplicate(discriminatedPropertySymbols, equateValues);
   }
   function isArgumentOfElementAccessExpression(node) {
     return node && node.parent && node.parent.kind === 212 /* ElementAccessExpression */ && node.parent.argumentExpression === node;
@@ -145403,21 +146649,24 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
   function isNamedExpression(node) {
     return (isFunctionExpression(node) || isClassExpression(node)) && isNamedDeclaration(node);
   }
-  function isConstNamedExpression(node) {
-    return (isFunctionExpression(node) || isArrowFunction(node) || isClassExpression(node)) && isVariableDeclaration(node.parent) && node === node.parent.initializer && isIdentifier(node.parent.name) && !!(getCombinedNodeFlags(node.parent) & 2 /* Const */);
+  function isVariableLike2(node) {
+    return isPropertyDeclaration(node) || isVariableDeclaration(node);
+  }
+  function isAssignedExpression(node) {
+    return (isFunctionExpression(node) || isArrowFunction(node) || isClassExpression(node)) && isVariableLike2(node.parent) && node === node.parent.initializer && isIdentifier(node.parent.name) && (!!(getCombinedNodeFlags(node.parent) & 2 /* Const */) || isPropertyDeclaration(node.parent));
   }
   function isPossibleCallHierarchyDeclaration(node) {
     return isSourceFile(node) || isModuleDeclaration(node) || isFunctionDeclaration(node) || isFunctionExpression(node) || isClassDeclaration(node) || isClassExpression(node) || isClassStaticBlockDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isGetAccessorDeclaration(node) || isSetAccessorDeclaration(node);
   }
   function isValidCallHierarchyDeclaration(node) {
-    return isSourceFile(node) || isModuleDeclaration(node) && isIdentifier(node.name) || isFunctionDeclaration(node) || isClassDeclaration(node) || isClassStaticBlockDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isGetAccessorDeclaration(node) || isSetAccessorDeclaration(node) || isNamedExpression(node) || isConstNamedExpression(node);
+    return isSourceFile(node) || isModuleDeclaration(node) && isIdentifier(node.name) || isFunctionDeclaration(node) || isClassDeclaration(node) || isClassStaticBlockDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isGetAccessorDeclaration(node) || isSetAccessorDeclaration(node) || isNamedExpression(node) || isAssignedExpression(node);
   }
   function getCallHierarchyDeclarationReferenceNode(node) {
     if (isSourceFile(node))
       return node;
     if (isNamedDeclaration(node))
       return node.name;
-    if (isConstNamedExpression(node))
+    if (isAssignedExpression(node))
       return node.parent.name;
     return Debug.checkDefined(node.modifiers && find(node.modifiers, isDefaultModifier3));
   }
@@ -145447,7 +146696,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       const prefix = symbol ? `${typeChecker.symbolToString(symbol, node.parent)} ` : "";
       return { text: `${prefix}static {}`, pos, end };
     }
-    const declName = isConstNamedExpression(node) ? node.parent.name : Debug.checkDefined(getNameOfDeclaration(node), "Expected call hierarchy item to have a name");
+    const declName = isAssignedExpression(node) ? node.parent.name : Debug.checkDefined(getNameOfDeclaration(node), "Expected call hierarchy item to have a name");
     let text = isIdentifier(declName) ? idText(declName) : isStringOrNumericLiteralLike(declName) ? declName.text : isComputedPropertyName(declName) ? isStringOrNumericLiteralLike(declName.expression) ? declName.expression.text : void 0 : void 0;
     if (text === void 0) {
       const typeChecker = program.getTypeChecker();
@@ -145463,8 +146712,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     return { text, pos: declName.getStart(), end: declName.getEnd() };
   }
   function getCallHierarchItemContainerName(node) {
-    var _a, _b;
-    if (isConstNamedExpression(node)) {
+    var _a, _b, _c, _d;
+    if (isAssignedExpression(node)) {
+      if (isPropertyDeclaration(node.parent) && isClassLike(node.parent.parent)) {
+        return isClassExpression(node.parent.parent) ? (_a = getAssignedName(node.parent.parent)) == null ? void 0 : _a.getText() : (_b = node.parent.parent.name) == null ? void 0 : _b.getText();
+      }
       if (isModuleBlock(node.parent.parent.parent.parent) && isIdentifier(node.parent.parent.parent.parent.parent.name)) {
         return node.parent.parent.parent.parent.parent.name.getText();
       }
@@ -145475,9 +146727,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       case 178 /* SetAccessor */:
       case 174 /* MethodDeclaration */:
         if (node.parent.kind === 210 /* ObjectLiteralExpression */) {
-          return (_a = getAssignedName(node.parent)) == null ? void 0 : _a.getText();
+          return (_c = getAssignedName(node.parent)) == null ? void 0 : _c.getText();
         }
-        return (_b = getNameOfDeclaration(node.parent)) == null ? void 0 : _b.getText();
+        return (_d = getNameOfDeclaration(node.parent)) == null ? void 0 : _d.getText();
       case 262 /* FunctionDeclaration */:
       case 263 /* ClassDeclaration */:
       case 267 /* ModuleDeclaration */:
@@ -145550,7 +146802,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
           const ancestor = findAncestor(location.parent, isValidCallHierarchyDeclaration);
           return ancestor && findImplementationOrAllInitialDeclarations(typeChecker, ancestor);
         }
-        if (isVariableDeclaration(location.parent) && location.parent.initializer && isConstNamedExpression(location.parent.initializer)) {
+        if (isVariableLike2(location.parent) && location.parent.initializer && isAssignedExpression(location.parent.initializer)) {
           return location.parent.initializer;
         }
         return void 0;
@@ -145565,7 +146817,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         location = location.parent;
         continue;
       }
-      if (isVariableDeclaration(location) && location.initializer && isConstNamedExpression(location.initializer)) {
+      if (isVariableDeclaration(location) && location.initializer && isAssignedExpression(location.initializer)) {
         return location.initializer;
       }
       if (!followingSymbol) {
@@ -145923,10 +147175,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     return errorCodeToFixesArray ?? (errorCodeToFixesArray = arrayFrom(errorCodeToFixes.keys()));
   }
   function removeFixIdIfFixAllUnavailable(registration, diagnostics) {
-    const { errorCodes: errorCodes64 } = registration;
+    const { errorCodes: errorCodes65 } = registration;
     let maybeFixableDiagnostics = 0;
     for (const diag2 of diagnostics) {
-      if (contains(errorCodes64, diag2.code))
+      if (contains(errorCodes65, diag2.code))
         maybeFixableDiagnostics++;
       if (maybeFixableDiagnostics > 1)
         break;
@@ -145950,14 +147202,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
   function createFileTextChanges(fileName, textChanges2) {
     return { fileName, textChanges: textChanges2 };
   }
-  function codeFixAll(context, errorCodes64, use) {
+  function codeFixAll(context, errorCodes65, use) {
     const commands = [];
-    const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => eachDiagnostic(context, errorCodes64, (diag2) => use(t, diag2, commands)));
+    const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => eachDiagnostic(context, errorCodes65, (diag2) => use(t, diag2, commands)));
     return createCombinedCodeActions(changes, commands.length === 0 ? void 0 : commands);
   }
-  function eachDiagnostic(context, errorCodes64, cb) {
+  function eachDiagnostic(context, errorCodes65, cb) {
     for (const diag2 of getDiagnostics(context)) {
-      if (contains(errorCodes64, diag2.code)) {
+      if (contains(errorCodes65, diag2.code)) {
         cb(diag2);
       }
     }
@@ -146748,7 +148000,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       case 329 /* JSDocTypeLiteral */:
         return transformJSDocTypeLiteral(node);
       default:
-        const visited = visitEachChild(node, transformJSDocType, nullTransformationContext);
+        const visited = visitEachChild(
+          node,
+          transformJSDocType,
+          /*context*/
+          void 0
+        );
         setEmitFlags(visited, 1 /* SingleLine */);
         return visited;
     }
@@ -147865,7 +149122,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
   function fixImportOfModuleExports(importingFile, exportingFile, program, changes, quotePreference) {
     var _a;
     for (const moduleSpecifier of importingFile.imports) {
-      const imported = (_a = program.getResolvedModule(importingFile, moduleSpecifier.text, getModeForUsageLocation(importingFile, moduleSpecifier))) == null ? void 0 : _a.resolvedModule;
+      const imported = (_a = program.getResolvedModuleFromModuleSpecifier(moduleSpecifier)) == null ? void 0 : _a.resolvedModule;
       if (!imported || imported.resolvedFileName !== exportingFile.fileName) {
         continue;
       }
@@ -148660,7 +149917,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       init_ts_codefix();
       errorCodes14 = [
         Diagnostics.This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error.code,
-        Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled.code
+        Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled.code,
+        Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled.code
       ];
       fixId13 = "convertToTypeOnlyImport";
       registerCodeFix({
@@ -149685,7 +150943,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
   }
   function isFixPossiblyReExportingImportingFile(fix, importingFile, compilerOptions, toPath3) {
     var _a;
-    if (fix.isReExport && ((_a = fix.exportInfo) == null ? void 0 : _a.moduleFileName) && getEmitModuleResolutionKind(compilerOptions) === 2 /* Node10 */ && isIndexFileName(fix.exportInfo.moduleFileName)) {
+    if (fix.isReExport && ((_a = fix.exportInfo) == null ? void 0 : _a.moduleFileName) && isIndexFileName(fix.exportInfo.moduleFileName)) {
       const reExportDir = toPath3(getDirectoryPath(fix.exportInfo.moduleFileName));
       return startsWith(importingFile.path, reExportDir);
     }
@@ -149787,6 +151045,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       case 7 /* ES2022 */:
       case 99 /* ESNext */:
       case 0 /* None */:
+      case 200 /* Preserve */:
         return 2 /* Namespace */;
       case 100 /* Node16 */:
       case 199 /* NodeNext */:
@@ -149987,14 +151246,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
               aliasDeclaration.name
             );
             const comparer = ts_OrganizeImports_exports.getOrganizeImportsComparer(preferences, sortKind === 2 /* CaseInsensitive */);
-            const insertionIndex = ts_OrganizeImports_exports.getImportSpecifierInsertionIndex(aliasDeclaration.parent.elements, newSpecifier, comparer);
-            if (aliasDeclaration.parent.elements.indexOf(aliasDeclaration) !== insertionIndex) {
+            const insertionIndex = ts_OrganizeImports_exports.getImportSpecifierInsertionIndex(aliasDeclaration.parent.elements, newSpecifier, comparer, preferences);
+            if (insertionIndex !== aliasDeclaration.parent.elements.indexOf(aliasDeclaration)) {
               changes.delete(sourceFile, aliasDeclaration);
               changes.insertImportSpecifierAtIndex(sourceFile, newSpecifier, aliasDeclaration.parent, insertionIndex);
               return aliasDeclaration;
             }
           }
-          changes.deleteRange(sourceFile, aliasDeclaration.getFirstToken());
+          changes.deleteRange(sourceFile, { pos: getTokenPosOfNode(aliasDeclaration.getFirstToken()), end: getTokenPosOfNode(aliasDeclaration.propertyName ?? aliasDeclaration.name) });
           return aliasDeclaration;
         } else {
           Debug.assert(aliasDeclaration.parent.parent.isTypeOnly);
@@ -150018,7 +151277,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       changes.delete(sourceFile, getTypeKeywordOfTypeOnlyImport(importClause, sourceFile));
       if (!compilerOptions.allowImportingTsExtensions) {
         const moduleSpecifier = tryGetModuleSpecifierFromDeclaration(importClause.parent);
-        const resolvedModule = moduleSpecifier && ((_a = program.getResolvedModule(sourceFile, moduleSpecifier.text, getModeForUsageLocation(sourceFile, moduleSpecifier))) == null ? void 0 : _a.resolvedModule);
+        const resolvedModule = moduleSpecifier && ((_a = program.getResolvedModuleFromModuleSpecifier(moduleSpecifier)) == null ? void 0 : _a.resolvedModule);
         if (resolvedModule == null ? void 0 : resolvedModule.resolvedUsingTsExtension) {
           const changedExtension = changeAnyExtension(moduleSpecifier.text, getOutputExtension(moduleSpecifier.text, compilerOptions));
           changes.replaceNode(sourceFile, moduleSpecifier, factory.createStringLiteral(changedExtension));
@@ -150090,7 +151349,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       const specifierSort = (existingSpecifiers == null ? void 0 : existingSpecifiers.length) && ts_OrganizeImports_exports.detectImportSpecifierSorting(existingSpecifiers, preferences);
       if (specifierSort && !(ignoreCaseForSorting && specifierSort === 1 /* CaseSensitive */)) {
         for (const spec of newSpecifiers) {
-          const insertionIndex = promoteFromTypeOnly2 && !spec.isTypeOnly ? 0 : ts_OrganizeImports_exports.getImportSpecifierInsertionIndex(existingSpecifiers, spec, comparer);
+          const insertionIndex = promoteFromTypeOnly2 && !spec.isTypeOnly ? 0 : ts_OrganizeImports_exports.getImportSpecifierInsertionIndex(existingSpecifiers, spec, comparer, preferences);
           changes.insertImportSpecifierAtIndex(sourceFile, spec, clause.namedBindings, insertionIndex);
         }
       } else if (existingSpecifiers == null ? void 0 : existingSpecifiers.length) {
@@ -150292,7 +151551,17 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code,
         Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here.code,
         Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code,
-        Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type.code
+        Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type.code,
+        Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery.code,
+        Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later.code,
+        Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom.code,
+        Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig.code,
+        Diagnostics.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function.code,
+        Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig.code,
+        Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha.code,
+        Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode.code,
+        Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig.code,
+        Diagnostics.Cannot_find_namespace_0_Did_you_mean_1.code
       ];
       registerCodeFix({
         errorCodes: errorCodes18,
@@ -150397,7 +151666,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     }
   }
   function tryGetConstraintFromDiagnosticMessage(messageText) {
-    const [_, constraint] = flattenDiagnosticMessageText(messageText, "\n", 0).match(/`extends (.*)`/) || [];
+    const [, constraint] = flattenDiagnosticMessageText(messageText, "\n", 0).match(/`extends (.*)`/) || [];
     return constraint;
   }
   function tryGetConstraintType(checker, node) {
@@ -150734,15 +152003,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       const importDeclaration = findAncestor(token, isImportDeclaration);
       if (importDeclaration === void 0)
         return void 0;
-      const moduleSpecifier = isStringLiteral(importDeclaration.moduleSpecifier) ? importDeclaration.moduleSpecifier.text : void 0;
+      const moduleSpecifier = isStringLiteral(importDeclaration.moduleSpecifier) ? importDeclaration.moduleSpecifier : void 0;
       if (moduleSpecifier === void 0)
         return void 0;
-      const resolvedModule = (_a = program.getResolvedModule(
-        sourceFile,
-        moduleSpecifier,
-        /*mode*/
-        void 0
-      )) == null ? void 0 : _a.resolvedModule;
+      const resolvedModule = (_a = program.getResolvedModuleFromModuleSpecifier(moduleSpecifier)) == null ? void 0 : _a.resolvedModule;
       if (resolvedModule === void 0)
         return void 0;
       const moduleSourceFile = program.getSourceFile(resolvedModule.resolvedFileName);
@@ -150759,7 +152023,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       if (node === void 0)
         return void 0;
       const exportName = { node: token, isTypeOnly: isTypeDeclaration(node) };
-      return { exportName, node, moduleSourceFile, moduleSpecifier };
+      return { exportName, node, moduleSourceFile, moduleSpecifier: moduleSpecifier.text };
     }
     return void 0;
   }
@@ -150988,7 +152252,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     } else if (isImportSpecifier(parent2) && parent2.name === node) {
       Debug.assertNode(node, isIdentifier, "Expected an identifier for spelling (import)");
       const importDeclaration = findAncestor(node, isImportDeclaration);
-      const resolvedSourceFile = getResolvedSourceFileFromImportDeclaration(sourceFile, context, importDeclaration);
+      const resolvedSourceFile = getResolvedSourceFileFromImportDeclaration(context, importDeclaration);
       if (resolvedSourceFile && resolvedSourceFile.symbol) {
         suggestedSymbol = checker.getSuggestedSymbolForNonexistentModule(node, resolvedSourceFile.symbol);
       }
@@ -151038,11 +152302,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     }
     return flags;
   }
-  function getResolvedSourceFileFromImportDeclaration(sourceFile, context, importDeclaration) {
+  function getResolvedSourceFileFromImportDeclaration(context, importDeclaration) {
     var _a;
     if (!importDeclaration || !isStringLiteralLike(importDeclaration.moduleSpecifier))
       return void 0;
-    const resolvedModule = (_a = context.program.getResolvedModule(sourceFile, importDeclaration.moduleSpecifier.text, getModeForUsageLocation(sourceFile, importDeclaration.moduleSpecifier))) == null ? void 0 : _a.resolvedModule;
+    const resolvedModule = (_a = context.program.getResolvedModuleFromModuleSpecifier(importDeclaration.moduleSpecifier)) == null ? void 0 : _a.resolvedModule;
     if (!resolvedModule)
       return void 0;
     return context.program.getSourceFile(resolvedModule.resolvedFileName);
@@ -151384,7 +152648,22 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       ));
       if (!length(properties))
         return void 0;
-      return { kind: 3 /* ObjectLiteral */, token: param.name, properties, parentDeclaration: parent2 };
+      return { kind: 3 /* ObjectLiteral */, token: param.name, identifier: param.name.text, properties, parentDeclaration: parent2 };
+    }
+    if (token.kind === 19 /* OpenBraceToken */ && isObjectLiteralExpression(parent2)) {
+      const targetType = checker.getContextualType(parent2) || checker.getTypeAtLocation(parent2);
+      const properties = arrayFrom(checker.getUnmatchedProperties(
+        checker.getTypeAtLocation(parent2),
+        targetType,
+        /*requireOptionalProperties*/
+        false,
+        /*matchDiscriminantProperties*/
+        false
+      ));
+      if (!length(properties))
+        return void 0;
+      const identifier = "";
+      return { kind: 3 /* ObjectLiteral */, token: parent2, identifier, properties, parentDeclaration: parent2 };
     }
     if (!isMemberName(token))
       return void 0;
@@ -151400,7 +152679,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       ));
       if (!length(properties))
         return void 0;
-      return { kind: 3 /* ObjectLiteral */, token, properties, parentDeclaration: parent2.initializer };
+      return { kind: 3 /* ObjectLiteral */, token, identifier: token.text, properties, parentDeclaration: parent2.initializer };
     }
     if (isIdentifier(token) && isJsxOpeningLikeElement(token.parent)) {
       const target = getEmitScriptTarget(program.getCompilerOptions());
@@ -151633,21 +152912,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       const type = checker.getTypeAtLocation(member);
       return !!(type && type.flags & 402653316 /* StringLike */);
     });
+    const sourceFile = parentDeclaration.getSourceFile();
     const enumMember = factory.createEnumMember(token, hasStringInitializer ? factory.createStringLiteral(token.text) : void 0);
-    changes.replaceNode(
-      parentDeclaration.getSourceFile(),
-      parentDeclaration,
-      factory.updateEnumDeclaration(
-        parentDeclaration,
-        parentDeclaration.modifiers,
-        parentDeclaration.name,
-        concatenate(parentDeclaration.members, singleElementArray(enumMember))
-      ),
-      {
-        leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.IncludeAll,
-        trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Exclude
-      }
-    );
+    const last2 = lastOrUndefined(parentDeclaration.members);
+    if (last2) {
+      changes.insertNodeInListAfter(sourceFile, last2, enumMember, parentDeclaration.members);
+    } else {
+      changes.insertMemberAtStart(sourceFile, parentDeclaration, enumMember);
+    }
   }
   function addFunctionDeclaration(changes, context, info) {
     const quotePreference = getQuotePreference(context.sourceFile, context.preferences);
@@ -151750,7 +153022,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         /*enclosingDeclaration*/
         void 0,
         /*flags*/
-        void 0
+        64 /* UseFullyQualifiedType */
       );
       return enumMember === void 0 || name === void 0 ? factory.createNumericLiteral(0) : factory.createPropertyAccessExpression(name, checker.symbolToString(enumMember));
     }
@@ -151954,7 +153226,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
           return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => {
             eachDiagnostic(context, errorCodes27, (diag2) => {
               const info = getInfo10(diag2.file, diag2.start, diag2.code, checker, context.program);
-              if (!info || !addToSeen(seen, getNodeId(info.parentDeclaration) + "#" + info.token.text)) {
+              if (!info || !addToSeen(seen, getNodeId(info.parentDeclaration) + "#" + (info.kind === 3 /* ObjectLiteral */ ? info.identifier : info.token.text))) {
                 return;
               }
               if (fixId52 === fixMissingFunctionDeclaration && (info.kind === 2 /* Function */ || info.kind === 5 /* Signature */)) {
@@ -152038,6 +153310,240 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     }
   });
 
+  // src/services/codefixes/fixAddMissingParam.ts
+  function getInfo11(sourceFile, program, pos) {
+    const token = getTokenAtPosition(sourceFile, pos);
+    const callExpression = findAncestor(token, isCallExpression);
+    if (callExpression === void 0 || length(callExpression.arguments) === 0) {
+      return void 0;
+    }
+    const checker = program.getTypeChecker();
+    const type = checker.getTypeAtLocation(callExpression.expression);
+    const convertibleSignatureDeclarations = filter(type.symbol.declarations, isConvertibleSignatureDeclaration);
+    if (convertibleSignatureDeclarations === void 0) {
+      return void 0;
+    }
+    const nonOverloadDeclaration = lastOrUndefined(convertibleSignatureDeclarations);
+    if (nonOverloadDeclaration === void 0 || nonOverloadDeclaration.body === void 0 || isSourceFileFromLibrary(program, nonOverloadDeclaration.getSourceFile())) {
+      return void 0;
+    }
+    const name = tryGetName2(nonOverloadDeclaration);
+    if (name === void 0) {
+      return void 0;
+    }
+    const newParameters = [];
+    const newOptionalParameters = [];
+    const parametersLength = length(nonOverloadDeclaration.parameters);
+    const argumentsLength = length(callExpression.arguments);
+    if (parametersLength > argumentsLength) {
+      return void 0;
+    }
+    const declarations = [nonOverloadDeclaration, ...getOverloads(nonOverloadDeclaration, convertibleSignatureDeclarations)];
+    for (let i = 0, pos2 = 0, paramIndex = 0; i < argumentsLength; i++) {
+      const arg = callExpression.arguments[i];
+      const expr = isAccessExpression(arg) ? getNameOfAccessExpression(arg) : arg;
+      const type2 = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(arg)));
+      const parameter = pos2 < parametersLength ? nonOverloadDeclaration.parameters[pos2] : void 0;
+      if (parameter && checker.isTypeAssignableTo(type2, checker.getTypeAtLocation(parameter))) {
+        pos2++;
+        continue;
+      }
+      const name2 = expr && isIdentifier(expr) ? expr.text : `p${paramIndex++}`;
+      const typeNode = typeToTypeNode(checker, type2, nonOverloadDeclaration);
+      append(newParameters, {
+        pos: i,
+        declaration: createParameter(
+          name2,
+          typeNode,
+          /*questionToken*/
+          void 0
+        )
+      });
+      if (isOptionalPos(declarations, pos2)) {
+        continue;
+      }
+      append(newOptionalParameters, {
+        pos: i,
+        declaration: createParameter(name2, typeNode, factory.createToken(58 /* QuestionToken */))
+      });
+    }
+    return {
+      newParameters,
+      newOptionalParameters,
+      name: declarationNameToString(name),
+      declarations
+    };
+  }
+  function tryGetName2(node) {
+    const name = getNameOfDeclaration(node);
+    if (name) {
+      return name;
+    }
+    if (isVariableDeclaration(node.parent) && isIdentifier(node.parent.name) || isPropertyDeclaration(node.parent) || isParameter(node.parent)) {
+      return node.parent.name;
+    }
+  }
+  function typeToTypeNode(checker, type, enclosingDeclaration) {
+    return checker.typeToTypeNode(checker.getWidenedType(type), enclosingDeclaration, 1 /* NoTruncation */) ?? factory.createKeywordTypeNode(159 /* UnknownKeyword */);
+  }
+  function doChange19(changes, sourceFile, declarations, newParameters) {
+    forEach(declarations, (declaration) => {
+      if (length(declaration.parameters)) {
+        changes.replaceNodeRangeWithNodes(
+          sourceFile,
+          first(declaration.parameters),
+          last(declaration.parameters),
+          updateParameters(declaration, newParameters),
+          {
+            joiner: ", ",
+            indentation: 0,
+            leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.IncludeAll,
+            trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Include
+          }
+        );
+      } else {
+        forEach(updateParameters(declaration, newParameters), (parameter, index) => {
+          if (length(declaration.parameters) === 0 && index === 0) {
+            changes.insertNodeAt(sourceFile, declaration.parameters.end, parameter);
+          } else {
+            changes.insertNodeAtEndOfList(sourceFile, declaration.parameters, parameter);
+          }
+        });
+      }
+    });
+  }
+  function isConvertibleSignatureDeclaration(node) {
+    switch (node.kind) {
+      case 262 /* FunctionDeclaration */:
+      case 218 /* FunctionExpression */:
+      case 174 /* MethodDeclaration */:
+      case 219 /* ArrowFunction */:
+        return true;
+      default:
+        return false;
+    }
+  }
+  function updateParameters(node, newParameters) {
+    const parameters = map(node.parameters, (p) => factory.createParameterDeclaration(
+      p.modifiers,
+      p.dotDotDotToken,
+      p.name,
+      p.questionToken,
+      p.type,
+      p.initializer
+    ));
+    for (const { pos, declaration } of newParameters) {
+      const prev = pos > 0 ? parameters[pos - 1] : void 0;
+      parameters.splice(
+        pos,
+        0,
+        factory.updateParameterDeclaration(
+          declaration,
+          declaration.modifiers,
+          declaration.dotDotDotToken,
+          declaration.name,
+          prev && prev.questionToken ? factory.createToken(58 /* QuestionToken */) : declaration.questionToken,
+          declaration.type,
+          declaration.initializer
+        )
+      );
+    }
+    return parameters;
+  }
+  function getOverloads(implementation, declarations) {
+    const overloads = [];
+    for (const declaration of declarations) {
+      if (isOverload(declaration)) {
+        if (length(declaration.parameters) === length(implementation.parameters)) {
+          overloads.push(declaration);
+          continue;
+        }
+        if (length(declaration.parameters) > length(implementation.parameters)) {
+          return [];
+        }
+      }
+    }
+    return overloads;
+  }
+  function isOverload(declaration) {
+    return isConvertibleSignatureDeclaration(declaration) && declaration.body === void 0;
+  }
+  function createParameter(name, type, questionToken) {
+    return factory.createParameterDeclaration(
+      /*modifiers*/
+      void 0,
+      /*dotDotDotToken*/
+      void 0,
+      name,
+      questionToken,
+      type,
+      /*initializer*/
+      void 0
+    );
+  }
+  function isOptionalPos(declarations, pos) {
+    return length(declarations) && some(declarations, (d) => pos < length(d.parameters) && !!d.parameters[pos] && d.parameters[pos].questionToken === void 0);
+  }
+  var addMissingParamFixId, addOptionalParamFixId, errorCodes29;
+  var init_fixAddMissingParam = __esm({
+    "src/services/codefixes/fixAddMissingParam.ts"() {
+      "use strict";
+      init_ts4();
+      init_ts_codefix();
+      addMissingParamFixId = "addMissingParam";
+      addOptionalParamFixId = "addOptionalParam";
+      errorCodes29 = [Diagnostics.Expected_0_arguments_but_got_1.code];
+      registerCodeFix({
+        errorCodes: errorCodes29,
+        fixIds: [addMissingParamFixId, addOptionalParamFixId],
+        getCodeActions(context) {
+          const info = getInfo11(context.sourceFile, context.program, context.span.start);
+          if (info === void 0)
+            return void 0;
+          const { name, declarations, newParameters, newOptionalParameters } = info;
+          const actions2 = [];
+          if (length(newParameters)) {
+            append(
+              actions2,
+              createCodeFixAction(
+                addMissingParamFixId,
+                ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange19(t, context.sourceFile, declarations, newParameters)),
+                [length(newParameters) > 1 ? Diagnostics.Add_missing_parameters_to_0 : Diagnostics.Add_missing_parameter_to_0, name],
+                addMissingParamFixId,
+                Diagnostics.Add_all_missing_parameters
+              )
+            );
+          }
+          if (length(newOptionalParameters)) {
+            append(
+              actions2,
+              createCodeFixAction(
+                addOptionalParamFixId,
+                ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange19(t, context.sourceFile, declarations, newOptionalParameters)),
+                [length(newOptionalParameters) > 1 ? Diagnostics.Add_optional_parameters_to_0 : Diagnostics.Add_optional_parameter_to_0, name],
+                addOptionalParamFixId,
+                Diagnostics.Add_all_optional_parameters
+              )
+            );
+          }
+          return actions2;
+        },
+        getAllCodeActions: (context) => codeFixAll(context, errorCodes29, (changes, diag2) => {
+          const info = getInfo11(context.sourceFile, context.program, diag2.start);
+          if (info) {
+            const { declarations, newParameters, newOptionalParameters } = info;
+            if (context.fixId === addMissingParamFixId) {
+              doChange19(changes, context.sourceFile, declarations, newParameters);
+            }
+            if (context.fixId === addOptionalParamFixId) {
+              doChange19(changes, context.sourceFile, declarations, newOptionalParameters);
+            }
+          }
+        })
+      });
+    }
+  });
+
   // src/services/codefixes/fixCannotFindModule.ts
   function getInstallCommand(fileName, packageName) {
     return { type: "install package", file: fileName, packageName };
@@ -152054,7 +153560,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     var _a;
     return diagCode === errorCodeCannotFindModule ? ts_JsTyping_exports.nodeCoreModules.has(packageName) ? "@types/node" : void 0 : ((_a = host.isKnownTypesPackageName) == null ? void 0 : _a.call(host, packageName)) ? getTypesPackageName(packageName) : void 0;
   }
-  var fixName2, fixIdInstallTypesPackage, errorCodeCannotFindModule, errorCodes29;
+  var fixName2, fixIdInstallTypesPackage, errorCodeCannotFindModule, errorCodes30;
   var init_fixCannotFindModule = __esm({
     "src/services/codefixes/fixCannotFindModule.ts"() {
       "use strict";
@@ -152063,12 +153569,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       fixName2 = "fixCannotFindModule";
       fixIdInstallTypesPackage = "installTypesPackage";
       errorCodeCannotFindModule = Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations.code;
-      errorCodes29 = [
+      errorCodes30 = [
         errorCodeCannotFindModule,
         Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code
       ];
       registerCodeFix({
-        errorCodes: errorCodes29,
+        errorCodes: errorCodes30,
         getCodeActions: function getCodeActionsToFixNotFoundModule(context) {
           const { host, sourceFile, span: { start } } = context;
           const packageName = tryGetImportedPackageName(sourceFile, start);
@@ -152087,7 +153593,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         },
         fixIds: [fixIdInstallTypesPackage],
         getAllCodeActions: (context) => {
-          return codeFixAll(context, errorCodes29, (_changes, diag2, commands) => {
+          return codeFixAll(context, errorCodes30, (_changes, diag2, commands) => {
             const packageName = tryGetImportedPackageName(diag2.file, diag2.start);
             if (packageName === void 0)
               return void 0;
@@ -152126,18 +153632,18 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     const flags = getSyntacticModifierFlags(first(symbol.getDeclarations()));
     return !(flags & 2 /* Private */) && !!(flags & 64 /* Abstract */);
   }
-  var errorCodes30, fixId25;
+  var errorCodes31, fixId25;
   var init_fixClassDoesntImplementInheritedAbstractMember = __esm({
     "src/services/codefixes/fixClassDoesntImplementInheritedAbstractMember.ts"() {
       "use strict";
       init_ts4();
       init_ts_codefix();
-      errorCodes30 = [
+      errorCodes31 = [
         Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1.code
       ];
       fixId25 = "fixClassDoesntImplementInheritedAbstractMember";
       registerCodeFix({
-        errorCodes: errorCodes30,
+        errorCodes: errorCodes31,
         getCodeActions: function getCodeActionsToFixClassNotImplementingInheritedMembers(context) {
           const { sourceFile, span } = context;
           const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => addMissingMembers(getClass2(sourceFile, span.start), sourceFile, context, t, context.preferences));
@@ -152146,7 +153652,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         fixIds: [fixId25],
         getAllCodeActions: function getAllCodeActionsToFixClassDoesntImplementInheritedAbstractMember(context) {
           const seenClassDeclarations = /* @__PURE__ */ new Map();
-          return codeFixAll(context, errorCodes30, (changes, diag2) => {
+          return codeFixAll(context, errorCodes31, (changes, diag2) => {
             const classDeclaration = getClass2(diag2.file, diag2.start);
             if (addToSeen(seenClassDeclarations, getNodeId(classDeclaration))) {
               addMissingMembers(classDeclaration, context.sourceFile, context, changes, context.preferences);
@@ -152158,7 +153664,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
   });
 
   // src/services/codefixes/fixClassSuperMustPrecedeThisAccess.ts
-  function doChange19(changes, sourceFile, constructor, superCall) {
+  function doChange20(changes, sourceFile, constructor, superCall) {
     changes.insertNodeAtConstructorStart(sourceFile, constructor, superCall);
     changes.delete(sourceFile, superCall);
   }
@@ -152173,36 +153679,36 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
   function findSuperCall(n) {
     return isExpressionStatement(n) && isSuperCall(n.expression) ? n : isFunctionLike(n) ? void 0 : forEachChild(n, findSuperCall);
   }
-  var fixId26, errorCodes31;
+  var fixId26, errorCodes32;
   var init_fixClassSuperMustPrecedeThisAccess = __esm({
     "src/services/codefixes/fixClassSuperMustPrecedeThisAccess.ts"() {
       "use strict";
       init_ts4();
       init_ts_codefix();
       fixId26 = "classSuperMustPrecedeThisAccess";
-      errorCodes31 = [Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code];
+      errorCodes32 = [Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code];
       registerCodeFix({
-        errorCodes: errorCodes31,
+        errorCodes: errorCodes32,
         getCodeActions(context) {
           const { sourceFile, span } = context;
           const nodes = getNodes(sourceFile, span.start);
           if (!nodes)
             return void 0;
           const { constructor, superCall } = nodes;
-          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange19(t, sourceFile, constructor, superCall));
+          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange20(t, sourceFile, constructor, superCall));
           return [createCodeFixAction(fixId26, changes, Diagnostics.Make_super_call_the_first_statement_in_the_constructor, fixId26, Diagnostics.Make_all_super_calls_the_first_statement_in_their_constructor)];
         },
         fixIds: [fixId26],
         getAllCodeActions(context) {
           const { sourceFile } = context;
           const seenClasses = /* @__PURE__ */ new Map();
-          return codeFixAll(context, errorCodes31, (changes, diag2) => {
+          return codeFixAll(context, errorCodes32, (changes, diag2) => {
             const nodes = getNodes(diag2.file, diag2.start);
             if (!nodes)
               return;
             const { constructor, superCall } = nodes;
             if (addToSeen(seenClasses, getNodeId(constructor.parent))) {
-              doChange19(changes, sourceFile, constructor, superCall);
+              doChange20(changes, sourceFile, constructor, superCall);
             }
           });
         }
@@ -152216,7 +153722,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     Debug.assert(isConstructorDeclaration(token.parent), "token should be at the constructor declaration");
     return token.parent;
   }
-  function doChange20(changes, sourceFile, ctr) {
+  function doChange21(changes, sourceFile, ctr) {
     const superCall = factory.createExpressionStatement(factory.createCallExpression(
       factory.createSuper(),
       /*typeArguments*/
@@ -152226,66 +153732,66 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     ));
     changes.insertNodeAtConstructorStart(sourceFile, ctr, superCall);
   }
-  var fixId27, errorCodes32;
+  var fixId27, errorCodes33;
   var init_fixConstructorForDerivedNeedSuperCall = __esm({
     "src/services/codefixes/fixConstructorForDerivedNeedSuperCall.ts"() {
       "use strict";
       init_ts4();
       init_ts_codefix();
       fixId27 = "constructorForDerivedNeedSuperCall";
-      errorCodes32 = [Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code];
+      errorCodes33 = [Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code];
       registerCodeFix({
-        errorCodes: errorCodes32,
+        errorCodes: errorCodes33,
         getCodeActions(context) {
           const { sourceFile, span } = context;
           const ctr = getNode(sourceFile, span.start);
-          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange20(t, sourceFile, ctr));
+          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange21(t, sourceFile, ctr));
           return [createCodeFixAction(fixId27, changes, Diagnostics.Add_missing_super_call, fixId27, Diagnostics.Add_all_missing_super_calls)];
         },
         fixIds: [fixId27],
-        getAllCodeActions: (context) => codeFixAll(context, errorCodes32, (changes, diag2) => doChange20(changes, context.sourceFile, getNode(diag2.file, diag2.start)))
+        getAllCodeActions: (context) => codeFixAll(context, errorCodes33, (changes, diag2) => doChange21(changes, context.sourceFile, getNode(diag2.file, diag2.start)))
       });
     }
   });
 
   // src/services/codefixes/fixEnableJsxFlag.ts
-  function doChange21(changeTracker, configFile) {
+  function doChange22(changeTracker, configFile) {
     setJsonCompilerOptionValue(changeTracker, configFile, "jsx", factory.createStringLiteral("react"));
   }
-  var fixID, errorCodes33;
+  var fixID, errorCodes34;
   var init_fixEnableJsxFlag = __esm({
     "src/services/codefixes/fixEnableJsxFlag.ts"() {
       "use strict";
       init_ts4();
       init_ts_codefix();
       fixID = "fixEnableJsxFlag";
-      errorCodes33 = [Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided.code];
+      errorCodes34 = [Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided.code];
       registerCodeFix({
-        errorCodes: errorCodes33,
+        errorCodes: errorCodes34,
         getCodeActions: function getCodeActionsToFixEnableJsxFlag(context) {
           const { configFile } = context.program.getCompilerOptions();
           if (configFile === void 0) {
             return void 0;
           }
-          const changes = ts_textChanges_exports.ChangeTracker.with(context, (changeTracker) => doChange21(changeTracker, configFile));
+          const changes = ts_textChanges_exports.ChangeTracker.with(context, (changeTracker) => doChange22(changeTracker, configFile));
           return [
             createCodeFixActionWithoutFixAll(fixID, changes, Diagnostics.Enable_the_jsx_flag_in_your_configuration_file)
           ];
         },
         fixIds: [fixID],
-        getAllCodeActions: (context) => codeFixAll(context, errorCodes33, (changes) => {
+        getAllCodeActions: (context) => codeFixAll(context, errorCodes34, (changes) => {
           const { configFile } = context.program.getCompilerOptions();
           if (configFile === void 0) {
             return void 0;
           }
-          doChange21(changes, configFile);
+          doChange22(changes, configFile);
         })
       });
     }
   });
 
   // src/services/codefixes/fixNaNEquality.ts
-  function getInfo11(program, sourceFile, span) {
+  function getInfo12(program, sourceFile, span) {
     const diag2 = find(program.getSemanticDiagnostics(sourceFile), (diag3) => diag3.start === span.start && diag3.length === span.length);
     if (diag2 === void 0 || diag2.relatedInformation === void 0)
       return;
@@ -152300,7 +153806,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     }
     return void 0;
   }
-  function doChange22(changes, sourceFile, arg, expression) {
+  function doChange23(changes, sourceFile, arg, expression) {
     const callExpression = factory.createCallExpression(
       factory.createPropertyAccessExpression(factory.createIdentifier("Number"), factory.createIdentifier("isNaN")),
       /*typeArguments*/
@@ -152315,36 +153821,36 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     );
   }
   function getSuggestion(messageText) {
-    const [_, suggestion] = flattenDiagnosticMessageText(messageText, "\n", 0).match(/'(.*)'/) || [];
+    const [, suggestion] = flattenDiagnosticMessageText(messageText, "\n", 0).match(/'(.*)'/) || [];
     return suggestion;
   }
-  var fixId28, errorCodes34;
+  var fixId28, errorCodes35;
   var init_fixNaNEquality = __esm({
     "src/services/codefixes/fixNaNEquality.ts"() {
       "use strict";
       init_ts4();
       init_ts_codefix();
       fixId28 = "fixNaNEquality";
-      errorCodes34 = [
+      errorCodes35 = [
         Diagnostics.This_condition_will_always_return_0.code
       ];
       registerCodeFix({
-        errorCodes: errorCodes34,
+        errorCodes: errorCodes35,
         getCodeActions(context) {
           const { sourceFile, span, program } = context;
-          const info = getInfo11(program, sourceFile, span);
+          const info = getInfo12(program, sourceFile, span);
           if (info === void 0)
             return;
           const { suggestion, expression, arg } = info;
-          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange22(t, sourceFile, arg, expression));
+          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange23(t, sourceFile, arg, expression));
           return [createCodeFixAction(fixId28, changes, [Diagnostics.Use_0, suggestion], fixId28, Diagnostics.Use_Number_isNaN_in_all_conditions)];
         },
         fixIds: [fixId28],
         getAllCodeActions: (context) => {
-          return codeFixAll(context, errorCodes34, (changes, diag2) => {
-            const info = getInfo11(context.program, diag2.file, createTextSpan(diag2.start, diag2.length));
+          return codeFixAll(context, errorCodes35, (changes, diag2) => {
+            const info = getInfo12(context.program, diag2.file, createTextSpan(diag2.start, diag2.length));
             if (info) {
-              doChange22(changes, diag2.file, info.arg, info.expression);
+              doChange23(changes, diag2.file, info.arg, info.expression);
             }
           });
         }
@@ -152360,9 +153866,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       init_ts_codefix();
       registerCodeFix({
         errorCodes: [
-          Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher.code,
-          Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher.code,
-          Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher.code
+          Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code,
+          Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code,
+          Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code
         ],
         getCodeActions: function getCodeActionsToFixModuleAndTarget(context) {
           const compilerOptions = context.program.getCompilerOptions();
@@ -152401,32 +153907,32 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
   });
 
   // src/services/codefixes/fixPropertyAssignment.ts
-  function doChange23(changes, sourceFile, node) {
+  function doChange24(changes, sourceFile, node) {
     changes.replaceNode(sourceFile, node, factory.createPropertyAssignment(node.name, node.objectAssignmentInitializer));
   }
   function getProperty2(sourceFile, pos) {
     return cast(getTokenAtPosition(sourceFile, pos).parent, isShorthandPropertyAssignment);
   }
-  var fixId29, errorCodes35;
+  var fixId29, errorCodes36;
   var init_fixPropertyAssignment = __esm({
     "src/services/codefixes/fixPropertyAssignment.ts"() {
       "use strict";
       init_ts4();
       init_ts_codefix();
       fixId29 = "fixPropertyAssignment";
-      errorCodes35 = [
+      errorCodes36 = [
         Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code
       ];
       registerCodeFix({
-        errorCodes: errorCodes35,
+        errorCodes: errorCodes36,
         fixIds: [fixId29],
         getCodeActions(context) {
           const { sourceFile, span } = context;
           const property = getProperty2(sourceFile, span.start);
-          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange23(t, context.sourceFile, property));
+          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange24(t, context.sourceFile, property));
           return [createCodeFixAction(fixId29, changes, [Diagnostics.Change_0_to_1, "=", ":"], fixId29, [Diagnostics.Switch_each_misused_0_to_1, "=", ":"])];
         },
-        getAllCodeActions: (context) => codeFixAll(context, errorCodes35, (changes, diag2) => doChange23(changes, diag2.file, getProperty2(diag2.file, diag2.start)))
+        getAllCodeActions: (context) => codeFixAll(context, errorCodes36, (changes, diag2) => doChange24(changes, diag2.file, getProperty2(diag2.file, diag2.start)))
       });
     }
   });
@@ -152452,16 +153958,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       changes.deleteRange(sourceFile, { pos: implementsToken.getStart(), end });
     }
   }
-  var fixId30, errorCodes36;
+  var fixId30, errorCodes37;
   var init_fixExtendsInterfaceBecomesImplements = __esm({
     "src/services/codefixes/fixExtendsInterfaceBecomesImplements.ts"() {
       "use strict";
       init_ts4();
       init_ts_codefix();
       fixId30 = "extendsInterfaceBecomesImplements";
-      errorCodes36 = [Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code];
+      errorCodes37 = [Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code];
       registerCodeFix({
-        errorCodes: errorCodes36,
+        errorCodes: errorCodes37,
         getCodeActions(context) {
           const { sourceFile } = context;
           const nodes = getNodes2(sourceFile, context.span.start);
@@ -152472,7 +153978,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
           return [createCodeFixAction(fixId30, changes, Diagnostics.Change_extends_to_implements, fixId30, Diagnostics.Change_all_extended_interfaces_to_implements)];
         },
         fixIds: [fixId30],
-        getAllCodeActions: (context) => codeFixAll(context, errorCodes36, (changes, diag2) => {
+        getAllCodeActions: (context) => codeFixAll(context, errorCodes37, (changes, diag2) => {
           const nodes = getNodes2(diag2.file, diag2.start);
           if (nodes)
             doChanges2(changes, diag2.file, nodes.extendsToken, nodes.heritageClauses);
@@ -152482,17 +153988,17 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
   });
 
   // src/services/codefixes/fixForgottenThisPropertyAccess.ts
-  function getInfo12(sourceFile, pos, diagCode) {
+  function getInfo13(sourceFile, pos, diagCode) {
     const node = getTokenAtPosition(sourceFile, pos);
     if (isIdentifier(node) || isPrivateIdentifier(node)) {
       return { node, className: diagCode === didYouMeanStaticMemberCode ? getContainingClass(node).name.text : void 0 };
     }
   }
-  function doChange24(changes, sourceFile, { node, className }) {
+  function doChange25(changes, sourceFile, { node, className }) {
     suppressLeadingAndTrailingTrivia(node);
     changes.replaceNode(sourceFile, node, factory.createPropertyAccessExpression(className ? factory.createIdentifier(className) : factory.createThis(), node));
   }
-  var fixId31, didYouMeanStaticMemberCode, errorCodes37;
+  var fixId31, didYouMeanStaticMemberCode, errorCodes38;
   var init_fixForgottenThisPropertyAccess = __esm({
     "src/services/codefixes/fixForgottenThisPropertyAccess.ts"() {
       "use strict";
@@ -152500,27 +154006,27 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       init_ts_codefix();
       fixId31 = "forgottenThisPropertyAccess";
       didYouMeanStaticMemberCode = Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code;
-      errorCodes37 = [
+      errorCodes38 = [
         Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,
         Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression.code,
         didYouMeanStaticMemberCode
       ];
       registerCodeFix({
-        errorCodes: errorCodes37,
+        errorCodes: errorCodes38,
         getCodeActions(context) {
           const { sourceFile } = context;
-          const info = getInfo12(sourceFile, context.span.start, context.errorCode);
+          const info = getInfo13(sourceFile, context.span.start, context.errorCode);
           if (!info) {
             return void 0;
           }
-          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange24(t, sourceFile, info));
+          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange25(t, sourceFile, info));
           return [createCodeFixAction(fixId31, changes, [Diagnostics.Add_0_to_unresolved_variable, info.className || "this"], fixId31, Diagnostics.Add_qualifier_to_all_unresolved_variables_matching_a_member_name)];
         },
         fixIds: [fixId31],
-        getAllCodeActions: (context) => codeFixAll(context, errorCodes37, (changes, diag2) => {
-          const info = getInfo12(diag2.file, diag2.start, diag2.code);
+        getAllCodeActions: (context) => codeFixAll(context, errorCodes38, (changes, diag2) => {
+          const info = getInfo13(diag2.file, diag2.start, diag2.code);
           if (info)
-            doChange24(changes, context.sourceFile, info);
+            doChange25(changes, context.sourceFile, info);
         })
       });
     }
@@ -152530,7 +154036,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
   function isValidCharacter(character) {
     return hasProperty(htmlEntity, character);
   }
-  function doChange25(changes, preferences, sourceFile, start, useHtmlEntity) {
+  function doChange26(changes, preferences, sourceFile, start, useHtmlEntity) {
     const character = sourceFile.getText()[start];
     if (!isValidCharacter(character)) {
       return;
@@ -152538,7 +154044,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     const replacement = useHtmlEntity ? htmlEntity[character] : `{${quote(sourceFile, preferences, character)}}`;
     changes.replaceRangeWithText(sourceFile, { pos: start, end: start + 1 }, replacement);
   }
-  var fixIdExpression, fixIdHtmlEntity, errorCodes38, htmlEntity;
+  var fixIdExpression, fixIdHtmlEntity, errorCodes39, htmlEntity;
   var init_fixInvalidJsxCharacters = __esm({
     "src/services/codefixes/fixInvalidJsxCharacters.ts"() {
       "use strict";
@@ -152546,16 +154052,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       init_ts_codefix();
       fixIdExpression = "fixInvalidJsxCharacters_expression";
       fixIdHtmlEntity = "fixInvalidJsxCharacters_htmlEntity";
-      errorCodes38 = [
+      errorCodes39 = [
         Diagnostics.Unexpected_token_Did_you_mean_or_gt.code,
         Diagnostics.Unexpected_token_Did_you_mean_or_rbrace.code
       ];
       registerCodeFix({
-        errorCodes: errorCodes38,
+        errorCodes: errorCodes39,
         fixIds: [fixIdExpression, fixIdHtmlEntity],
         getCodeActions(context) {
           const { sourceFile, preferences, span } = context;
-          const changeToExpression = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange25(
+          const changeToExpression = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange26(
             t,
             preferences,
             sourceFile,
@@ -152563,7 +154069,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
             /*useHtmlEntity*/
             false
           ));
-          const changeToHtmlEntity = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange25(
+          const changeToHtmlEntity = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange26(
             t,
             preferences,
             sourceFile,
@@ -152577,7 +154083,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
           ];
         },
         getAllCodeActions(context) {
-          return codeFixAll(context, errorCodes38, (changes, diagnostic) => doChange25(changes, context.preferences, diagnostic.file, diagnostic.start, context.fixId === fixIdHtmlEntity));
+          return codeFixAll(context, errorCodes39, (changes, diagnostic) => doChange26(changes, context.preferences, diagnostic.file, diagnostic.start, context.fixId === fixIdHtmlEntity));
         }
       });
       htmlEntity = {
@@ -152624,7 +154130,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     const changes = ts_textChanges_exports.ChangeTracker.with(context, (changeTracker) => changeTracker.replaceJSDocComment(sourceFile, jsDocHost, map(tags, (t) => t === jsDocParameterTag ? newJSDocParameterTag : t)));
     return createCodeFixActionWithoutFixAll(renameUnmatchedParameter, changes, [Diagnostics.Rename_param_tag_name_0_to_1, name.getText(sourceFile), parameterName]);
   }
-  function getInfo13(sourceFile, pos) {
+  function getInfo14(sourceFile, pos) {
     const token = getTokenAtPosition(sourceFile, pos);
     if (token.parent && isJSDocParameterTag(token.parent) && isIdentifier(token.parent.name)) {
       const jsDocParameterTag = token.parent;
@@ -152636,7 +154142,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     }
     return void 0;
   }
-  var deleteUnmatchedParameter, renameUnmatchedParameter, errorCodes39;
+  var deleteUnmatchedParameter, renameUnmatchedParameter, errorCodes40;
   var init_fixUnmatchedParameter = __esm({
     "src/services/codefixes/fixUnmatchedParameter.ts"() {
       "use strict";
@@ -152644,16 +154150,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       init_ts_codefix();
       deleteUnmatchedParameter = "deleteUnmatchedParameter";
       renameUnmatchedParameter = "renameUnmatchedParameter";
-      errorCodes39 = [
+      errorCodes40 = [
         Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name.code
       ];
       registerCodeFix({
         fixIds: [deleteUnmatchedParameter, renameUnmatchedParameter],
-        errorCodes: errorCodes39,
+        errorCodes: errorCodes40,
         getCodeActions: function getCodeActionsToFixUnmatchedParameter(context) {
           const { sourceFile, span } = context;
           const actions2 = [];
-          const info = getInfo13(sourceFile, span.start);
+          const info = getInfo14(sourceFile, span.start);
           if (info) {
             append(actions2, getDeleteAction(context, info));
             append(actions2, getRenameAction(context, info));
@@ -152664,8 +154170,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         getAllCodeActions: function getAllCodeActionsToFixUnmatchedParameter(context) {
           const tagsToSignature = /* @__PURE__ */ new Map();
           return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => {
-            eachDiagnostic(context, errorCodes39, ({ file, start }) => {
-              const info = getInfo13(file, start);
+            eachDiagnostic(context, errorCodes40, ({ file, start }) => {
+              const info = getInfo14(file, start);
               if (info) {
                 tagsToSignature.set(info.signature, append(tagsToSignature.get(info.signature), info.jsDocParameterTag));
               }
@@ -152713,16 +154219,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
   function doNamespaceImportChange(changes, sourceFile, importDeclaration, program) {
     ts_refactor_exports.doChangeNamedToNamespaceOrDefault(sourceFile, program, changes, importDeclaration.parent);
   }
-  var fixId32, errorCodes40;
+  var fixId32, errorCodes41;
   var init_fixUnreferenceableDecoratorMetadata = __esm({
     "src/services/codefixes/fixUnreferenceableDecoratorMetadata.ts"() {
       "use strict";
       init_ts4();
       init_ts_codefix();
       fixId32 = "fixUnreferenceableDecoratorMetadata";
-      errorCodes40 = [Diagnostics.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled.code];
+      errorCodes41 = [Diagnostics.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled.code];
       registerCodeFix({
-        errorCodes: errorCodes40,
+        errorCodes: errorCodes41,
         getCodeActions: (context) => {
           const importDeclaration = getImportDeclaration(context.sourceFile, context.program, context.span.start);
           if (!importDeclaration)
@@ -152909,7 +154415,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
   function mayDeleteExpression(node) {
     return (isBinaryExpression(node.parent) && node.parent.left === node || (isPostfixUnaryExpression(node.parent) || isPrefixUnaryExpression(node.parent)) && node.parent.operand === node) && isExpressionStatement(node.parent.parent);
   }
-  var fixName3, fixIdPrefix, fixIdDelete, fixIdDeleteImports, fixIdInfer, errorCodes41;
+  var fixName3, fixIdPrefix, fixIdDelete, fixIdDeleteImports, fixIdInfer, errorCodes42;
   var init_fixUnusedIdentifier = __esm({
     "src/services/codefixes/fixUnusedIdentifier.ts"() {
       "use strict";
@@ -152920,7 +154426,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       fixIdDelete = "unusedIdentifier_delete";
       fixIdDeleteImports = "unusedIdentifier_deleteImports";
       fixIdInfer = "unusedIdentifier_infer";
-      errorCodes41 = [
+      errorCodes42 = [
         Diagnostics._0_is_declared_but_its_value_is_never_read.code,
         Diagnostics._0_is_declared_but_never_used.code,
         Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code,
@@ -152930,7 +154436,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         Diagnostics.All_type_parameters_are_unused.code
       ];
       registerCodeFix({
-        errorCodes: errorCodes41,
+        errorCodes: errorCodes42,
         getCodeActions(context) {
           const { errorCode, sourceFile, program, cancellationToken } = context;
           const checker = program.getTypeChecker();
@@ -153016,7 +154522,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
           const { sourceFile, program, cancellationToken } = context;
           const checker = program.getTypeChecker();
           const sourceFiles = program.getSourceFiles();
-          return codeFixAll(context, errorCodes41, (changes, diag2) => {
+          return codeFixAll(context, errorCodes42, (changes, diag2) => {
             const token = getTokenAtPosition(sourceFile, diag2.start);
             switch (context.fixId) {
               case fixIdPrefix:
@@ -153088,7 +154594,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
   });
 
   // src/services/codefixes/fixUnreachableCode.ts
-  function doChange26(changes, sourceFile, start, length2, errorCode) {
+  function doChange27(changes, sourceFile, start, length2, errorCode) {
     const token = getTokenAtPosition(sourceFile, start);
     const statement = findAncestor(token, isStatement);
     if (statement.getStart(sourceFile) !== token.getStart(sourceFile)) {
@@ -153136,31 +154642,31 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     }
     return last2;
   }
-  var fixId33, errorCodes42;
+  var fixId33, errorCodes43;
   var init_fixUnreachableCode = __esm({
     "src/services/codefixes/fixUnreachableCode.ts"() {
       "use strict";
       init_ts4();
       init_ts_codefix();
       fixId33 = "fixUnreachableCode";
-      errorCodes42 = [Diagnostics.Unreachable_code_detected.code];
+      errorCodes43 = [Diagnostics.Unreachable_code_detected.code];
       registerCodeFix({
-        errorCodes: errorCodes42,
+        errorCodes: errorCodes43,
         getCodeActions(context) {
           const syntacticDiagnostics = context.program.getSyntacticDiagnostics(context.sourceFile, context.cancellationToken);
           if (syntacticDiagnostics.length)
             return;
-          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange26(t, context.sourceFile, context.span.start, context.span.length, context.errorCode));
+          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange27(t, context.sourceFile, context.span.start, context.span.length, context.errorCode));
           return [createCodeFixAction(fixId33, changes, Diagnostics.Remove_unreachable_code, fixId33, Diagnostics.Remove_all_unreachable_code)];
         },
         fixIds: [fixId33],
-        getAllCodeActions: (context) => codeFixAll(context, errorCodes42, (changes, diag2) => doChange26(changes, diag2.file, diag2.start, diag2.length, diag2.code))
+        getAllCodeActions: (context) => codeFixAll(context, errorCodes43, (changes, diag2) => doChange27(changes, diag2.file, diag2.start, diag2.length, diag2.code))
       });
     }
   });
 
   // src/services/codefixes/fixUnusedLabel.ts
-  function doChange27(changes, sourceFile, start) {
+  function doChange28(changes, sourceFile, start) {
     const token = getTokenAtPosition(sourceFile, start);
     const labeledStatement = cast(token.parent, isLabeledStatement);
     const pos = token.getStart(sourceFile);
@@ -153173,28 +154679,28 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     );
     changes.deleteRange(sourceFile, { pos, end });
   }
-  var fixId34, errorCodes43;
+  var fixId34, errorCodes44;
   var init_fixUnusedLabel = __esm({
     "src/services/codefixes/fixUnusedLabel.ts"() {
       "use strict";
       init_ts4();
       init_ts_codefix();
       fixId34 = "fixUnusedLabel";
-      errorCodes43 = [Diagnostics.Unused_label.code];
+      errorCodes44 = [Diagnostics.Unused_label.code];
       registerCodeFix({
-        errorCodes: errorCodes43,
+        errorCodes: errorCodes44,
         getCodeActions(context) {
-          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange27(t, context.sourceFile, context.span.start));
+          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange28(t, context.sourceFile, context.span.start));
           return [createCodeFixAction(fixId34, changes, Diagnostics.Remove_unused_label, fixId34, Diagnostics.Remove_all_unused_labels)];
         },
         fixIds: [fixId34],
-        getAllCodeActions: (context) => codeFixAll(context, errorCodes43, (changes, diag2) => doChange27(changes, diag2.file, diag2.start))
+        getAllCodeActions: (context) => codeFixAll(context, errorCodes44, (changes, diag2) => doChange28(changes, diag2.file, diag2.start))
       });
     }
   });
 
   // src/services/codefixes/fixJSDocTypes.ts
-  function doChange28(changes, sourceFile, oldTypeNode, newType, checker) {
+  function doChange29(changes, sourceFile, oldTypeNode, newType, checker) {
     changes.replaceNode(sourceFile, oldTypeNode, checker.typeToTypeNode(
       newType,
       /*enclosingDeclaration*/
@@ -153203,7 +154709,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       void 0
     ));
   }
-  function getInfo14(sourceFile, pos, checker) {
+  function getInfo15(sourceFile, pos, checker) {
     const decl = findAncestor(getTokenAtPosition(sourceFile, pos), isTypeContainer);
     const typeNode = decl && decl.type;
     return typeNode && { typeNode, type: getType(checker, typeNode) };
@@ -153243,7 +154749,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     }
     return checker.getTypeFromTypeNode(node);
   }
-  var fixIdPlain, fixIdNullable, errorCodes44;
+  var fixIdPlain, fixIdNullable, errorCodes45;
   var init_fixJSDocTypes = __esm({
     "src/services/codefixes/fixJSDocTypes.ts"() {
       "use strict";
@@ -153251,17 +154757,17 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       init_ts_codefix();
       fixIdPlain = "fixJSDocTypes_plain";
       fixIdNullable = "fixJSDocTypes_nullable";
-      errorCodes44 = [
+      errorCodes45 = [
         Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments.code,
         Diagnostics._0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1.code,
         Diagnostics._0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1.code
       ];
       registerCodeFix({
-        errorCodes: errorCodes44,
+        errorCodes: errorCodes45,
         getCodeActions(context) {
           const { sourceFile } = context;
           const checker = context.program.getTypeChecker();
-          const info = getInfo14(sourceFile, context.span.start, checker);
+          const info = getInfo15(sourceFile, context.span.start, checker);
           if (!info)
             return void 0;
           const { typeNode, type } = info;
@@ -153272,7 +154778,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
           }
           return actions2;
           function fix(type2, fixId52, fixAllDescription) {
-            const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange28(t, sourceFile, typeNode, type2, checker));
+            const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange29(t, sourceFile, typeNode, type2, checker));
             return createCodeFixAction("jdocTypes", changes, [Diagnostics.Change_0_to_1, original, checker.typeToString(type2)], fixId52, fixAllDescription);
           }
         },
@@ -153280,13 +154786,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         getAllCodeActions(context) {
           const { fixId: fixId52, program, sourceFile } = context;
           const checker = program.getTypeChecker();
-          return codeFixAll(context, errorCodes44, (changes, err) => {
-            const info = getInfo14(err.file, err.start, checker);
+          return codeFixAll(context, errorCodes45, (changes, err) => {
+            const info = getInfo15(err.file, err.start, checker);
             if (!info)
               return;
             const { typeNode, type } = info;
             const fixedType = typeNode.kind === 321 /* JSDocNullableType */ && fixId52 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type;
-            doChange28(changes, sourceFile, typeNode, fixedType, checker);
+            doChange29(changes, sourceFile, typeNode, fixedType, checker);
           });
         }
       });
@@ -153294,7 +154800,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
   });
 
   // src/services/codefixes/fixMissingCallParentheses.ts
-  function doChange29(changes, sourceFile, name) {
+  function doChange30(changes, sourceFile, name) {
     changes.replaceNodeWithText(sourceFile, name, `${name.text}()`);
   }
   function getCallName(sourceFile, start) {
@@ -153311,31 +154817,31 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     }
     return void 0;
   }
-  var fixId35, errorCodes45;
+  var fixId35, errorCodes46;
   var init_fixMissingCallParentheses = __esm({
     "src/services/codefixes/fixMissingCallParentheses.ts"() {
       "use strict";
       init_ts4();
       init_ts_codefix();
       fixId35 = "fixMissingCallParentheses";
-      errorCodes45 = [
+      errorCodes46 = [
         Diagnostics.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead.code
       ];
       registerCodeFix({
-        errorCodes: errorCodes45,
+        errorCodes: errorCodes46,
         fixIds: [fixId35],
         getCodeActions(context) {
           const { sourceFile, span } = context;
           const callName = getCallName(sourceFile, span.start);
           if (!callName)
             return;
-          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange29(t, context.sourceFile, callName));
+          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange30(t, context.sourceFile, callName));
           return [createCodeFixAction(fixId35, changes, Diagnostics.Add_missing_call_parentheses, fixId35, Diagnostics.Add_all_missing_call_parentheses)];
         },
-        getAllCodeActions: (context) => codeFixAll(context, errorCodes45, (changes, diag2) => {
+        getAllCodeActions: (context) => codeFixAll(context, errorCodes46, (changes, diag2) => {
           const callName = getCallName(diag2.file, diag2.start);
           if (callName)
-            doChange29(changes, diag2.file, callName);
+            doChange30(changes, diag2.file, callName);
         })
       });
     }
@@ -153377,7 +154883,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       returnType: getReturnType(containingFunction)
     };
   }
-  function doChange30(changes, sourceFile, { insertBefore, returnType }) {
+  function doChange31(changes, sourceFile, { insertBefore, returnType }) {
     if (returnType) {
       const entityName = getEntityNameFromTypeNode(returnType);
       if (!entityName || entityName.kind !== 80 /* Identifier */ || entityName.text !== "Promise") {
@@ -153386,37 +154892,37 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     }
     changes.insertModifierBefore(sourceFile, 134 /* AsyncKeyword */, insertBefore);
   }
-  var fixId36, errorCodes46;
+  var fixId36, errorCodes47;
   var init_fixAwaitInSyncFunction = __esm({
     "src/services/codefixes/fixAwaitInSyncFunction.ts"() {
       "use strict";
       init_ts4();
       init_ts_codefix();
       fixId36 = "fixAwaitInSyncFunction";
-      errorCodes46 = [
+      errorCodes47 = [
         Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,
         Diagnostics.await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,
         Diagnostics.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,
         Diagnostics.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function.code
       ];
       registerCodeFix({
-        errorCodes: errorCodes46,
+        errorCodes: errorCodes47,
         getCodeActions(context) {
           const { sourceFile, span } = context;
           const nodes = getNodes3(sourceFile, span.start);
           if (!nodes)
             return void 0;
-          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange30(t, sourceFile, nodes));
+          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange31(t, sourceFile, nodes));
           return [createCodeFixAction(fixId36, changes, Diagnostics.Add_async_modifier_to_containing_function, fixId36, Diagnostics.Add_all_missing_async_modifiers)];
         },
         fixIds: [fixId36],
         getAllCodeActions: function getAllCodeActionsToFixAwaitInSyncFunction(context) {
           const seen = /* @__PURE__ */ new Map();
-          return codeFixAll(context, errorCodes46, (changes, diag2) => {
+          return codeFixAll(context, errorCodes47, (changes, diag2) => {
             const nodes = getNodes3(diag2.file, diag2.start);
             if (!nodes || !addToSeen(seen, getNodeId(nodes.insertBefore)))
               return;
-            doChange30(changes, context.sourceFile, nodes);
+            doChange31(changes, context.sourceFile, nodes);
           });
         }
       });
@@ -153424,7 +154930,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
   });
 
   // src/services/codefixes/fixPropertyOverrideAccessor.ts
-  function doChange31(file, start, length2, code, context) {
+  function doChange32(file, start, length2, code, context) {
     let startPosition;
     let endPosition;
     if (code === Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code) {
@@ -153451,28 +154957,28 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     }
     return generateAccessorFromProperty(file, context.program, startPosition, endPosition, context, Diagnostics.Generate_get_and_set_accessors.message);
   }
-  var errorCodes47, fixId37;
+  var errorCodes48, fixId37;
   var init_fixPropertyOverrideAccessor = __esm({
     "src/services/codefixes/fixPropertyOverrideAccessor.ts"() {
       "use strict";
       init_ts4();
       init_ts_codefix();
-      errorCodes47 = [
+      errorCodes48 = [
         Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code,
         Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code
       ];
       fixId37 = "fixPropertyOverrideAccessor";
       registerCodeFix({
-        errorCodes: errorCodes47,
+        errorCodes: errorCodes48,
         getCodeActions(context) {
-          const edits = doChange31(context.sourceFile, context.span.start, context.span.length, context.errorCode, context);
+          const edits = doChange32(context.sourceFile, context.span.start, context.span.length, context.errorCode, context);
           if (edits) {
             return [createCodeFixAction(fixId37, edits, Diagnostics.Generate_get_and_set_accessors, fixId37, Diagnostics.Generate_get_and_set_accessors_for_all_overriding_properties)];
           }
         },
         fixIds: [fixId37],
-        getAllCodeActions: (context) => codeFixAll(context, errorCodes47, (changes, diag2) => {
-          const edits = doChange31(diag2.file, diag2.start, diag2.length, diag2.code, context);
+        getAllCodeActions: (context) => codeFixAll(context, errorCodes48, (changes, diag2) => {
+          const edits = doChange32(diag2.file, diag2.start, diag2.length, diag2.code, context);
           if (edits) {
             for (const edit of edits) {
               changes.pushRaw(context.sourceFile, edit);
@@ -153519,7 +155025,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     }
     return errorCode;
   }
-  function doChange32(changes, sourceFile, token, errorCode, program, cancellationToken, markSeen, host, preferences) {
+  function doChange33(changes, sourceFile, token, errorCode, program, cancellationToken, markSeen, host, preferences) {
     if (!isParameterPropertyModifier(token.kind) && token.kind !== 80 /* Identifier */ && token.kind !== 26 /* DotDotDotToken */ && token.kind !== 110 /* ThisKeyword */) {
       return void 0;
     }
@@ -154416,14 +155922,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       }
     }
   }
-  var fixId38, errorCodes48;
+  var fixId38, errorCodes49;
   var init_inferFromUsage = __esm({
     "src/services/codefixes/inferFromUsage.ts"() {
       "use strict";
       init_ts4();
       init_ts_codefix();
       fixId38 = "inferFromUsage";
-      errorCodes48 = [
+      errorCodes49 = [
         // Variable declarations
         Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code,
         // Variable uses
@@ -154457,13 +155963,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code
       ];
       registerCodeFix({
-        errorCodes: errorCodes48,
+        errorCodes: errorCodes49,
         getCodeActions(context) {
           const { sourceFile, program, span: { start }, errorCode, cancellationToken, host, preferences } = context;
           const token = getTokenAtPosition(sourceFile, start);
           let declaration;
           const changes = ts_textChanges_exports.ChangeTracker.with(context, (changes2) => {
-            declaration = doChange32(
+            declaration = doChange33(
               changes2,
               sourceFile,
               token,
@@ -154483,8 +155989,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         getAllCodeActions(context) {
           const { sourceFile, program, cancellationToken, host, preferences } = context;
           const markSeen = nodeSeenTracker();
-          return codeFixAll(context, errorCodes48, (changes, err) => {
-            doChange32(changes, sourceFile, getTokenAtPosition(err.file, err.start), err.code, program, cancellationToken, markSeen, host, preferences);
+          return codeFixAll(context, errorCodes49, (changes, err) => {
+            doChange33(changes, sourceFile, getTokenAtPosition(err.file, err.start), err.code, program, cancellationToken, markSeen, host, preferences);
           });
         }
       });
@@ -154492,7 +155998,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
   });
 
   // src/services/codefixes/fixReturnTypeInAsyncFunction.ts
-  function getInfo15(sourceFile, checker, pos) {
+  function getInfo16(sourceFile, checker, pos) {
     if (isInJSFile(sourceFile)) {
       return void 0;
     }
@@ -154515,31 +156021,31 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       return { returnTypeNode, returnType, promisedTypeNode, promisedType };
     }
   }
-  function doChange33(changes, sourceFile, returnTypeNode, promisedTypeNode) {
+  function doChange34(changes, sourceFile, returnTypeNode, promisedTypeNode) {
     changes.replaceNode(sourceFile, returnTypeNode, factory.createTypeReferenceNode("Promise", [promisedTypeNode]));
   }
-  var fixId39, errorCodes49;
+  var fixId39, errorCodes50;
   var init_fixReturnTypeInAsyncFunction = __esm({
     "src/services/codefixes/fixReturnTypeInAsyncFunction.ts"() {
       "use strict";
       init_ts4();
       init_ts_codefix();
       fixId39 = "fixReturnTypeInAsyncFunction";
-      errorCodes49 = [
+      errorCodes50 = [
         Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0.code
       ];
       registerCodeFix({
-        errorCodes: errorCodes49,
+        errorCodes: errorCodes50,
         fixIds: [fixId39],
         getCodeActions: function getCodeActionsToFixReturnTypeInAsyncFunction(context) {
           const { sourceFile, program, span } = context;
           const checker = program.getTypeChecker();
-          const info = getInfo15(sourceFile, program.getTypeChecker(), span.start);
+          const info = getInfo16(sourceFile, program.getTypeChecker(), span.start);
           if (!info) {
             return void 0;
           }
           const { returnTypeNode, returnType, promisedTypeNode, promisedType } = info;
-          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange33(t, sourceFile, returnTypeNode, promisedTypeNode));
+          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange34(t, sourceFile, returnTypeNode, promisedTypeNode));
           return [createCodeFixAction(
             fixId39,
             changes,
@@ -154548,10 +156054,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
             Diagnostics.Fix_all_incorrect_return_type_of_an_async_functions
           )];
         },
-        getAllCodeActions: (context) => codeFixAll(context, errorCodes49, (changes, diag2) => {
-          const info = getInfo15(diag2.file, context.program.getTypeChecker(), diag2.start);
+        getAllCodeActions: (context) => codeFixAll(context, errorCodes50, (changes, diag2) => {
+          const info = getInfo16(diag2.file, context.program.getTypeChecker(), diag2.start);
           if (info) {
-            doChange33(changes, diag2.file, info.returnTypeNode, info.promisedTypeNode);
+            doChange34(changes, diag2.file, info.returnTypeNode, info.promisedTypeNode);
           }
         })
       });
@@ -154565,7 +156071,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       changes.insertCommentBeforeLine(sourceFile, lineNumber, position, " @ts-ignore");
     }
   }
-  var fixName4, fixId40, errorCodes50;
+  var fixName4, fixId40, errorCodes51;
   var init_disableJsDiagnostics = __esm({
     "src/services/codefixes/disableJsDiagnostics.ts"() {
       "use strict";
@@ -154573,12 +156079,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       init_ts_codefix();
       fixName4 = "disableJsDiagnostics";
       fixId40 = "disableJsDiagnostics";
-      errorCodes50 = mapDefined(Object.keys(Diagnostics), (key) => {
+      errorCodes51 = mapDefined(Object.keys(Diagnostics), (key) => {
         const diag2 = Diagnostics[key];
         return diag2.category === 1 /* Error */ ? diag2.code : void 0;
       });
       registerCodeFix({
-        errorCodes: errorCodes50,
+        errorCodes: errorCodes51,
         getCodeActions: function getCodeActionsToDisableJsDiagnostics(context) {
           const { sourceFile, program, span, host, formatContext } = context;
           if (!isInJSFile(sourceFile) || !isCheckJsEnabledForFile(sourceFile, program.getCompilerOptions())) {
@@ -154606,7 +156112,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         fixIds: [fixId40],
         getAllCodeActions: (context) => {
           const seenLines = /* @__PURE__ */ new Set();
-          return codeFixAll(context, errorCodes50, (changes, diag2) => {
+          return codeFixAll(context, errorCodes51, (changes, diag2) => {
             if (ts_textChanges_exports.isValidLocationToAddComment(diag2.file, diag2.start)) {
               makeChange8(changes, diag2.file, diag2.start, seenLines);
             }
@@ -155236,7 +156742,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         const typeArguments = visitNodes2(node.typeArguments, visit, isTypeNode);
         return factory.createTypeReferenceNode(qualifier, typeArguments);
       }
-      return visitEachChild(node, visit, nullTransformationContext);
+      return visitEachChild(
+        node,
+        visit,
+        /*context*/
+        void 0
+      );
     }
   }
   function replaceFirstIdentifierOfEntityName(name, newIdentifier) {
@@ -155613,7 +157124,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
   });
 
   // src/services/codefixes/fixStrictClassInitialization.ts
-  function getInfo16(sourceFile, pos) {
+  function getInfo17(sourceFile, pos) {
     const token = getTokenAtPosition(sourceFile, pos);
     if (isIdentifier(token) && isPropertyDeclaration(token.parent)) {
       const type = getEffectiveTypeAnnotationNode(token.parent);
@@ -155717,7 +157228,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     }
     return void 0;
   }
-  var fixName6, fixIdAddDefiniteAssignmentAssertions, fixIdAddUndefinedType, fixIdAddInitializer, errorCodes51;
+  var fixName6, fixIdAddDefiniteAssignmentAssertions, fixIdAddUndefinedType, fixIdAddInitializer, errorCodes52;
   var init_fixStrictClassInitialization = __esm({
     "src/services/codefixes/fixStrictClassInitialization.ts"() {
       "use strict";
@@ -155727,11 +157238,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       fixIdAddDefiniteAssignmentAssertions = "addMissingPropertyDefiniteAssignmentAssertions";
       fixIdAddUndefinedType = "addMissingPropertyUndefinedType";
       fixIdAddInitializer = "addMissingPropertyInitializer";
-      errorCodes51 = [Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor.code];
+      errorCodes52 = [Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor.code];
       registerCodeFix({
-        errorCodes: errorCodes51,
+        errorCodes: errorCodes52,
         getCodeActions: function getCodeActionsForStrictClassInitializationErrors(context) {
-          const info = getInfo16(context.sourceFile, context.span.start);
+          const info = getInfo17(context.sourceFile, context.span.start);
           if (!info)
             return;
           const result = [];
@@ -155742,8 +157253,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         },
         fixIds: [fixIdAddDefiniteAssignmentAssertions, fixIdAddUndefinedType, fixIdAddInitializer],
         getAllCodeActions: (context) => {
-          return codeFixAll(context, errorCodes51, (changes, diag2) => {
-            const info = getInfo16(diag2.file, diag2.start);
+          return codeFixAll(context, errorCodes52, (changes, diag2) => {
+            const info = getInfo17(diag2.file, diag2.start);
             if (!info)
               return;
             switch (context.fixId) {
@@ -155770,7 +157281,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
   });
 
   // src/services/codefixes/requireInTs.ts
-  function doChange34(changes, sourceFile, info) {
+  function doChange35(changes, sourceFile, info) {
     const { allowSyntheticDefaults, defaultImportName, namedImports, statement, required } = info;
     changes.replaceNode(
       sourceFile,
@@ -155797,7 +157308,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       )
     );
   }
-  function getInfo17(sourceFile, program, pos) {
+  function getInfo18(sourceFile, program, pos) {
     const { parent: parent2 } = getTokenAtPosition(sourceFile, pos);
     if (!isRequireCall(
       parent2,
@@ -155836,29 +157347,29 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       return factory.createNamedImports(importSpecifiers);
     }
   }
-  var fixId41, errorCodes52;
+  var fixId41, errorCodes53;
   var init_requireInTs = __esm({
     "src/services/codefixes/requireInTs.ts"() {
       "use strict";
       init_ts4();
       init_ts_codefix();
       fixId41 = "requireInTs";
-      errorCodes52 = [Diagnostics.require_call_may_be_converted_to_an_import.code];
+      errorCodes53 = [Diagnostics.require_call_may_be_converted_to_an_import.code];
       registerCodeFix({
-        errorCodes: errorCodes52,
+        errorCodes: errorCodes53,
         getCodeActions(context) {
-          const info = getInfo17(context.sourceFile, context.program, context.span.start);
+          const info = getInfo18(context.sourceFile, context.program, context.span.start);
           if (!info) {
             return void 0;
           }
-          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange34(t, context.sourceFile, info));
+          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange35(t, context.sourceFile, info));
           return [createCodeFixAction(fixId41, changes, Diagnostics.Convert_require_to_import, fixId41, Diagnostics.Convert_all_require_to_import)];
         },
         fixIds: [fixId41],
-        getAllCodeActions: (context) => codeFixAll(context, errorCodes52, (changes, diag2) => {
-          const info = getInfo17(diag2.file, context.program, diag2.start);
+        getAllCodeActions: (context) => codeFixAll(context, errorCodes53, (changes, diag2) => {
+          const info = getInfo18(diag2.file, context.program, diag2.start);
           if (info) {
-            doChange34(changes, context.sourceFile, info);
+            doChange35(changes, context.sourceFile, info);
           }
         })
       });
@@ -155866,7 +157377,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
   });
 
   // src/services/codefixes/useDefaultImport.ts
-  function getInfo18(sourceFile, pos) {
+  function getInfo19(sourceFile, pos) {
     const name = getTokenAtPosition(sourceFile, pos);
     if (!isIdentifier(name))
       return void 0;
@@ -155878,7 +157389,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       return { importNode, name, moduleSpecifier: importNode.moduleSpecifier };
     }
   }
-  function doChange35(changes, sourceFile, info, preferences) {
+  function doChange36(changes, sourceFile, info, preferences) {
     changes.replaceNode(sourceFile, info.importNode, makeImport(
       info.name,
       /*namedImports*/
@@ -155887,29 +157398,29 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       getQuotePreference(sourceFile, preferences)
     ));
   }
-  var fixId42, errorCodes53;
+  var fixId42, errorCodes54;
   var init_useDefaultImport = __esm({
     "src/services/codefixes/useDefaultImport.ts"() {
       "use strict";
       init_ts4();
       init_ts_codefix();
       fixId42 = "useDefaultImport";
-      errorCodes53 = [Diagnostics.Import_may_be_converted_to_a_default_import.code];
+      errorCodes54 = [Diagnostics.Import_may_be_converted_to_a_default_import.code];
       registerCodeFix({
-        errorCodes: errorCodes53,
+        errorCodes: errorCodes54,
         getCodeActions(context) {
           const { sourceFile, span: { start } } = context;
-          const info = getInfo18(sourceFile, start);
+          const info = getInfo19(sourceFile, start);
           if (!info)
             return void 0;
-          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange35(t, sourceFile, info, context.preferences));
+          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange36(t, sourceFile, info, context.preferences));
           return [createCodeFixAction(fixId42, changes, Diagnostics.Convert_to_default_import, fixId42, Diagnostics.Convert_all_to_default_imports)];
         },
         fixIds: [fixId42],
-        getAllCodeActions: (context) => codeFixAll(context, errorCodes53, (changes, diag2) => {
-          const info = getInfo18(diag2.file, diag2.start);
+        getAllCodeActions: (context) => codeFixAll(context, errorCodes54, (changes, diag2) => {
+          const info = getInfo19(diag2.file, diag2.start);
           if (info)
-            doChange35(changes, diag2.file, info, context.preferences);
+            doChange36(changes, diag2.file, info, context.preferences);
         })
       });
     }
@@ -155924,18 +157435,18 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     const newText = numericLiteral.getText(sourceFile) + "n";
     changeTracker.replaceNode(sourceFile, numericLiteral, factory.createBigIntLiteral(newText));
   }
-  var fixId43, errorCodes54;
+  var fixId43, errorCodes55;
   var init_useBigintLiteral = __esm({
     "src/services/codefixes/useBigintLiteral.ts"() {
       "use strict";
       init_ts4();
       init_ts_codefix();
       fixId43 = "useBigintLiteral";
-      errorCodes54 = [
+      errorCodes55 = [
         Diagnostics.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers.code
       ];
       registerCodeFix({
-        errorCodes: errorCodes54,
+        errorCodes: errorCodes55,
         getCodeActions: function getCodeActionsToUseBigintLiteral(context) {
           const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange9(t, context.sourceFile, context.span));
           if (changes.length > 0) {
@@ -155944,7 +157455,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         },
         fixIds: [fixId43],
         getAllCodeActions: (context) => {
-          return codeFixAll(context, errorCodes54, (changes, diag2) => makeChange9(changes, diag2.file, diag2));
+          return codeFixAll(context, errorCodes55, (changes, diag2) => makeChange9(changes, diag2.file, diag2));
         }
       });
     }
@@ -155957,7 +157468,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     Debug.assert(token.parent.kind === 205 /* ImportType */, "Token parent should be an ImportType");
     return token.parent;
   }
-  function doChange36(changes, sourceFile, importType) {
+  function doChange37(changes, sourceFile, importType) {
     const newTypeNode = factory.updateImportTypeNode(
       importType,
       importType.argument,
@@ -155969,7 +157480,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     );
     changes.replaceNode(sourceFile, importType, newTypeNode);
   }
-  var fixIdAddMissingTypeof, fixId44, errorCodes55;
+  var fixIdAddMissingTypeof, fixId44, errorCodes56;
   var init_fixAddModuleReferTypeMissingTypeof = __esm({
     "src/services/codefixes/fixAddModuleReferTypeMissingTypeof.ts"() {
       "use strict";
@@ -155977,17 +157488,17 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       init_ts_codefix();
       fixIdAddMissingTypeof = "fixAddModuleReferTypeMissingTypeof";
       fixId44 = fixIdAddMissingTypeof;
-      errorCodes55 = [Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0.code];
+      errorCodes56 = [Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0.code];
       registerCodeFix({
-        errorCodes: errorCodes55,
+        errorCodes: errorCodes56,
         getCodeActions: function getCodeActionsToAddMissingTypeof(context) {
           const { sourceFile, span } = context;
           const importType = getImportTypeNode(sourceFile, span.start);
-          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange36(t, sourceFile, importType));
+          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange37(t, sourceFile, importType));
           return [createCodeFixAction(fixId44, changes, Diagnostics.Add_missing_typeof, fixId44, Diagnostics.Add_missing_typeof)];
         },
         fixIds: [fixId44],
-        getAllCodeActions: (context) => codeFixAll(context, errorCodes55, (changes, diag2) => doChange36(changes, context.sourceFile, getImportTypeNode(diag2.file, diag2.start)))
+        getAllCodeActions: (context) => codeFixAll(context, errorCodes56, (changes, diag2) => doChange37(changes, context.sourceFile, getImportTypeNode(diag2.file, diag2.start)))
       });
     }
   });
@@ -156006,7 +157517,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       return void 0;
     return binaryExpr;
   }
-  function doChange37(changeTracker, sf, node) {
+  function doChange38(changeTracker, sf, node) {
     const jsx = flattenInvalidBinaryExpr(node);
     if (jsx)
       changeTracker.replaceNode(sf, node, factory.createJsxFragment(factory.createJsxOpeningFragment(), jsx, factory.createJsxJsxClosingFragment()));
@@ -156029,37 +157540,37 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         return void 0;
     }
   }
-  var fixID2, errorCodes56;
+  var fixID2, errorCodes57;
   var init_wrapJsxInFragment = __esm({
     "src/services/codefixes/wrapJsxInFragment.ts"() {
       "use strict";
       init_ts4();
       init_ts_codefix();
       fixID2 = "wrapJsxInFragment";
-      errorCodes56 = [Diagnostics.JSX_expressions_must_have_one_parent_element.code];
+      errorCodes57 = [Diagnostics.JSX_expressions_must_have_one_parent_element.code];
       registerCodeFix({
-        errorCodes: errorCodes56,
+        errorCodes: errorCodes57,
         getCodeActions: function getCodeActionsToWrapJsxInFragment(context) {
           const { sourceFile, span } = context;
           const node = findNodeToFix(sourceFile, span.start);
           if (!node)
             return void 0;
-          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange37(t, sourceFile, node));
+          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange38(t, sourceFile, node));
           return [createCodeFixAction(fixID2, changes, Diagnostics.Wrap_in_JSX_fragment, fixID2, Diagnostics.Wrap_all_unparented_JSX_in_JSX_fragment)];
         },
         fixIds: [fixID2],
-        getAllCodeActions: (context) => codeFixAll(context, errorCodes56, (changes, diag2) => {
+        getAllCodeActions: (context) => codeFixAll(context, errorCodes57, (changes, diag2) => {
           const node = findNodeToFix(context.sourceFile, diag2.start);
           if (!node)
             return void 0;
-          doChange37(changes, context.sourceFile, node);
+          doChange38(changes, context.sourceFile, node);
         })
       });
     }
   });
 
   // src/services/codefixes/convertToMappedObjectType.ts
-  function getInfo19(sourceFile, pos) {
+  function getInfo20(sourceFile, pos) {
     const token = getTokenAtPosition(sourceFile, pos);
     const indexSignature = tryCast(token.parent.parent, isIndexSignatureDeclaration);
     if (!indexSignature)
@@ -156072,7 +157583,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
   function createTypeAliasFromInterface(declaration, type) {
     return factory.createTypeAliasDeclaration(declaration.modifiers, declaration.name, declaration.typeParameters, type);
   }
-  function doChange38(changes, sourceFile, { indexSignature, container }) {
+  function doChange39(changes, sourceFile, { indexSignature, container }) {
     const members = isInterfaceDeclaration(container) ? container.members : container.type.members;
     const otherMembers = members.filter((member) => !isIndexSignatureDeclaration(member));
     const parameter = first(indexSignature.parameters);
@@ -156099,48 +157610,48 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     ]);
     changes.replaceNode(sourceFile, container, createTypeAliasFromInterface(container, intersectionType));
   }
-  var fixId45, errorCodes57;
+  var fixId45, errorCodes58;
   var init_convertToMappedObjectType = __esm({
     "src/services/codefixes/convertToMappedObjectType.ts"() {
       "use strict";
       init_ts4();
       init_ts_codefix();
       fixId45 = "fixConvertToMappedObjectType";
-      errorCodes57 = [Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code];
+      errorCodes58 = [Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code];
       registerCodeFix({
-        errorCodes: errorCodes57,
+        errorCodes: errorCodes58,
         getCodeActions: function getCodeActionsToConvertToMappedTypeObject(context) {
           const { sourceFile, span } = context;
-          const info = getInfo19(sourceFile, span.start);
+          const info = getInfo20(sourceFile, span.start);
           if (!info)
             return void 0;
-          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange38(t, sourceFile, info));
+          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange39(t, sourceFile, info));
           const name = idText(info.container.name);
           return [createCodeFixAction(fixId45, changes, [Diagnostics.Convert_0_to_mapped_object_type, name], fixId45, [Diagnostics.Convert_0_to_mapped_object_type, name])];
         },
         fixIds: [fixId45],
-        getAllCodeActions: (context) => codeFixAll(context, errorCodes57, (changes, diag2) => {
-          const info = getInfo19(diag2.file, diag2.start);
+        getAllCodeActions: (context) => codeFixAll(context, errorCodes58, (changes, diag2) => {
+          const info = getInfo20(diag2.file, diag2.start);
           if (info)
-            doChange38(changes, diag2.file, info);
+            doChange39(changes, diag2.file, info);
         })
       });
     }
   });
 
   // src/services/codefixes/removeAccidentalCallParentheses.ts
-  var fixId46, errorCodes58;
+  var fixId46, errorCodes59;
   var init_removeAccidentalCallParentheses = __esm({
     "src/services/codefixes/removeAccidentalCallParentheses.ts"() {
       "use strict";
       init_ts4();
       init_ts_codefix();
       fixId46 = "removeAccidentalCallParentheses";
-      errorCodes58 = [
+      errorCodes59 = [
         Diagnostics.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without.code
       ];
       registerCodeFix({
-        errorCodes: errorCodes58,
+        errorCodes: errorCodes59,
         getCodeActions(context) {
           const callExpression = findAncestor(getTokenAtPosition(context.sourceFile, context.span.start), isCallExpression);
           if (!callExpression) {
@@ -156180,18 +157691,18 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     }
     changeTracker.replaceNode(sourceFile, expressionToReplace, awaitExpression.expression);
   }
-  var fixId47, errorCodes59;
+  var fixId47, errorCodes60;
   var init_removeUnnecessaryAwait = __esm({
     "src/services/codefixes/removeUnnecessaryAwait.ts"() {
       "use strict";
       init_ts4();
       init_ts_codefix();
       fixId47 = "removeUnnecessaryAwait";
-      errorCodes59 = [
+      errorCodes60 = [
         Diagnostics.await_has_no_effect_on_the_type_of_this_expression.code
       ];
       registerCodeFix({
-        errorCodes: errorCodes59,
+        errorCodes: errorCodes60,
         getCodeActions: function getCodeActionsToRemoveUnnecessaryAwait(context) {
           const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange10(t, context.sourceFile, context.span));
           if (changes.length > 0) {
@@ -156200,7 +157711,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         },
         fixIds: [fixId47],
         getAllCodeActions: (context) => {
-          return codeFixAll(context, errorCodes59, (changes, diag2) => makeChange10(changes, diag2.file, diag2));
+          return codeFixAll(context, errorCodes60, (changes, diag2) => makeChange10(changes, diag2.file, diag2));
         }
       });
     }
@@ -156250,16 +157761,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       )
     );
   }
-  var errorCodes60, fixId48;
+  var errorCodes61, fixId48;
   var init_splitTypeOnlyImport = __esm({
     "src/services/codefixes/splitTypeOnlyImport.ts"() {
       "use strict";
       init_ts4();
       init_ts_codefix();
-      errorCodes60 = [Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code];
+      errorCodes61 = [Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code];
       fixId48 = "splitTypeOnlyImport";
       registerCodeFix({
-        errorCodes: errorCodes60,
+        errorCodes: errorCodes61,
         fixIds: [fixId48],
         getCodeActions: function getCodeActionsToSplitTypeOnlyImport(context) {
           const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => {
@@ -156269,7 +157780,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
             return [createCodeFixAction(fixId48, changes, Diagnostics.Split_into_two_separate_import_declarations, fixId48, Diagnostics.Split_all_invalid_type_only_imports)];
           }
         },
-        getAllCodeActions: (context) => codeFixAll(context, errorCodes60, (changes, error2) => {
+        getAllCodeActions: (context) => codeFixAll(context, errorCodes61, (changes, error2) => {
           splitTypeOnlyImport(changes, getImportDeclaration2(context.sourceFile, error2), context);
         })
       });
@@ -156277,7 +157788,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
   });
 
   // src/services/codefixes/convertConstToLet.ts
-  function getInfo20(sourceFile, pos, program) {
+  function getInfo21(sourceFile, pos, program) {
     var _a;
     const checker = program.getTypeChecker();
     const symbol = checker.getSymbolAtLocation(getTokenAtPosition(sourceFile, pos));
@@ -156291,36 +157802,36 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       return;
     return { symbol, token: constToken };
   }
-  function doChange39(changes, sourceFile, token) {
+  function doChange40(changes, sourceFile, token) {
     changes.replaceNode(sourceFile, token, factory.createToken(121 /* LetKeyword */));
   }
-  var fixId49, errorCodes61;
+  var fixId49, errorCodes62;
   var init_convertConstToLet = __esm({
     "src/services/codefixes/convertConstToLet.ts"() {
       "use strict";
       init_ts4();
       init_ts_codefix();
       fixId49 = "fixConvertConstToLet";
-      errorCodes61 = [Diagnostics.Cannot_assign_to_0_because_it_is_a_constant.code];
+      errorCodes62 = [Diagnostics.Cannot_assign_to_0_because_it_is_a_constant.code];
       registerCodeFix({
-        errorCodes: errorCodes61,
+        errorCodes: errorCodes62,
         getCodeActions: function getCodeActionsToConvertConstToLet(context) {
           const { sourceFile, span, program } = context;
-          const info = getInfo20(sourceFile, span.start, program);
+          const info = getInfo21(sourceFile, span.start, program);
           if (info === void 0)
             return;
-          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange39(t, sourceFile, info.token));
+          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange40(t, sourceFile, info.token));
           return [createCodeFixActionMaybeFixAll(fixId49, changes, Diagnostics.Convert_const_to_let, fixId49, Diagnostics.Convert_all_const_to_let)];
         },
         getAllCodeActions: (context) => {
           const { program } = context;
           const seen = /* @__PURE__ */ new Map();
           return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => {
-            eachDiagnostic(context, errorCodes61, (diag2) => {
-              const info = getInfo20(diag2.file, diag2.start, program);
+            eachDiagnostic(context, errorCodes62, (diag2) => {
+              const info = getInfo21(diag2.file, diag2.start, program);
               if (info) {
                 if (addToSeen(seen, getSymbolId(info.symbol))) {
-                  return doChange39(changes, diag2.file, info.token);
+                  return doChange40(changes, diag2.file, info.token);
                 }
               }
               return void 0;
@@ -156333,15 +157844,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
   });
 
   // src/services/codefixes/fixExpectedComma.ts
-  function getInfo21(sourceFile, pos, _) {
+  function getInfo22(sourceFile, pos, _) {
     const node = getTokenAtPosition(sourceFile, pos);
     return node.kind === 27 /* SemicolonToken */ && node.parent && (isObjectLiteralExpression(node.parent) || isArrayLiteralExpression(node.parent)) ? { node } : void 0;
   }
-  function doChange40(changes, sourceFile, { node }) {
+  function doChange41(changes, sourceFile, { node }) {
     const newNode = factory.createToken(28 /* CommaToken */);
     changes.replaceNode(sourceFile, node, newNode);
   }
-  var fixId50, expectedErrorCode, errorCodes62;
+  var fixId50, expectedErrorCode, errorCodes63;
   var init_fixExpectedComma = __esm({
     "src/services/codefixes/fixExpectedComma.ts"() {
       "use strict";
@@ -156349,15 +157860,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       init_ts_codefix();
       fixId50 = "fixExpectedComma";
       expectedErrorCode = Diagnostics._0_expected.code;
-      errorCodes62 = [expectedErrorCode];
+      errorCodes63 = [expectedErrorCode];
       registerCodeFix({
-        errorCodes: errorCodes62,
+        errorCodes: errorCodes63,
         getCodeActions(context) {
           const { sourceFile } = context;
-          const info = getInfo21(sourceFile, context.span.start, context.errorCode);
+          const info = getInfo22(sourceFile, context.span.start, context.errorCode);
           if (!info)
             return void 0;
-          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange40(t, sourceFile, info));
+          const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange41(t, sourceFile, info));
           return [createCodeFixAction(
             fixId50,
             changes,
@@ -156367,10 +157878,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
           )];
         },
         fixIds: [fixId50],
-        getAllCodeActions: (context) => codeFixAll(context, errorCodes62, (changes, diag2) => {
-          const info = getInfo21(diag2.file, diag2.start, diag2.code);
+        getAllCodeActions: (context) => codeFixAll(context, errorCodes63, (changes, diag2) => {
+          const info = getInfo22(diag2.file, diag2.start, diag2.code);
           if (info)
-            doChange40(changes, context.sourceFile, info);
+            doChange41(changes, context.sourceFile, info);
         })
       });
     }
@@ -156426,7 +157937,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       return node.typeArguments;
     }
   }
-  var fixName7, fixId51, errorCodes63;
+  var fixName7, fixId51, errorCodes64;
   var init_fixAddVoidToPromise = __esm({
     "src/services/codefixes/fixAddVoidToPromise.ts"() {
       "use strict";
@@ -156434,12 +157945,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       init_ts_codefix();
       fixName7 = "addVoidToPromise";
       fixId51 = "addVoidToPromise";
-      errorCodes63 = [
+      errorCodes64 = [
         Diagnostics.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments.code,
         Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise.code
       ];
       registerCodeFix({
-        errorCodes: errorCodes63,
+        errorCodes: errorCodes64,
         fixIds: [fixId51],
         getCodeActions(context) {
           const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange11(t, context.sourceFile, context.span, context.program));
@@ -156448,7 +157959,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
           }
         },
         getAllCodeActions(context) {
-          return codeFixAll(context, errorCodes63, (changes, diag2) => makeChange11(changes, diag2.file, diag2, context.program, /* @__PURE__ */ new Set()));
+          return codeFixAll(context, errorCodes64, (changes, diag2) => makeChange11(changes, diag2.file, diag2, context.program, /* @__PURE__ */ new Set()));
         }
       });
     }
@@ -156532,6 +158043,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       init_returnValueCorrect();
       init_fixAddMissingMember();
       init_fixAddMissingNewOperator();
+      init_fixAddMissingParam();
       init_fixCannotFindModule();
       init_fixClassDoesntImplementInheritedAbstractMember();
       init_fixClassSuperMustPrecedeThisAccess();
@@ -158084,6 +159596,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       if (!info || uniques.get(info.name) && (!origin || !originIsObjectLiteralMethod(origin)) || kind === 1 /* Global */ && symbolToSortTextMap && !shouldIncludeSymbol(symbol, symbolToSortTextMap)) {
         continue;
       }
+      if (!isTypeOnlyLocation && isInJSFile(sourceFile) && symbolAppearsToBeTypeOnly(symbol)) {
+        continue;
+      }
       const { name, needsConvertPropertyAccess } = info;
       const originalSortText = (symbolToSortTextMap == null ? void 0 : symbolToSortTextMap[getSymbolId(symbol)]) ?? SortText.LocationPriority;
       const sortText = isDeprecated(symbol, typeChecker) ? SortText.Deprecated(originalSortText) : originalSortText;
@@ -158163,6 +159678,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       }
       return !!(allFlags & 111551 /* Value */);
     }
+    function symbolAppearsToBeTypeOnly(symbol) {
+      var _a;
+      const flags = getCombinedLocalAndExportSymbolFlags(skipAlias(symbol, typeChecker));
+      return !(flags & 111551 /* Value */) && (!isInJSFile((_a = symbol.declarations) == null ? void 0 : _a[0]) || !!(flags & 788968 /* Type */));
+    }
   }
   function getLabelCompletionAtPosition(node) {
     const entries = getLabelStatementCompletions(node);
@@ -158249,7 +159769,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     const { name, source, data } = entryId;
     const { previousToken, contextToken } = getRelevantTokens(position, sourceFile);
     if (isInString(sourceFile, position, previousToken)) {
-      return ts_Completions_StringCompletions_exports.getStringLiteralCompletionDetails(name, sourceFile, position, previousToken, typeChecker, compilerOptions, host, cancellationToken, preferences);
+      return ts_Completions_StringCompletions_exports.getStringLiteralCompletionDetails(name, sourceFile, position, previousToken, program, host, cancellationToken, preferences);
     }
     const symbolCompletion = getSymbolCompletionFromEntryId(program, log, sourceFile, position, entryId, host, preferences);
     switch (symbolCompletion.type) {
@@ -158456,11 +159976,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       case 19 /* OpenBraceToken */:
         return isJsxExpression(parent2) && !isJsxElement(parent2.parent) && !isJsxFragment(parent2.parent) ? checker.getContextualTypeForJsxAttribute(parent2.parent) : void 0;
       default:
-        const argInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(previousToken, position, sourceFile);
-        return argInfo ? (
-          // At `,`, treat this as the next argument after the comma.
-          checker.getContextualTypeForArgumentAtIndex(argInfo.invocation, argInfo.argumentIndex + (previousToken.kind === 28 /* CommaToken */ ? 1 : 0))
-        ) : isEqualityOperatorKind(previousToken.kind) && isBinaryExpression(parent2) && isEqualityOperatorKind(parent2.operatorToken.kind) ? (
+        const argInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(previousToken, position, sourceFile, checker);
+        return argInfo ? checker.getContextualTypeForArgumentAtIndex(argInfo.invocation, argInfo.argumentIndex) : isEqualityOperatorKind(previousToken.kind) && isBinaryExpression(parent2) && isEqualityOperatorKind(parent2.operatorToken.kind) ? (
           // completion at `x ===/**/` should be for the right side
           checker.getTypeAtLocation(parent2.left)
         ) : checker.getContextualType(previousToken, 4 /* Completions */) || checker.getContextualType(previousToken);
@@ -158471,7 +159988,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       symbol,
       enclosingDeclaration,
       /*meaning*/
-      67108863 /* All */,
+      -1 /* All */,
       /*useOnlyExternalAliasing*/
       false
     );
@@ -158661,7 +160178,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     }
     const semanticStart = timestamp();
     let completionKind = 5 /* None */;
-    let isNonContextualObjectLiteral = false;
     let hasUnresolvedAutoImports = false;
     let symbols = [];
     let importSpecifierResolver;
@@ -158941,7 +160457,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       return isIdentifier(e) ? e : isPropertyAccessExpression(e) ? getLeftMostName(e.expression) : void 0;
     }
     function tryGetGlobalSymbols() {
-      const result = tryGetObjectTypeLiteralInTypeArgumentCompletionSymbols() || tryGetObjectLikeCompletionSymbols() || tryGetImportCompletionSymbols() || tryGetImportOrExportClauseCompletionSymbols() || tryGetLocalNamedExportCompletionSymbols() || tryGetConstructorCompletion() || tryGetClassLikeCompletionSymbols() || tryGetJsxCompletionSymbols() || (getGlobalCompletions(), 1 /* Success */);
+      const result = tryGetObjectTypeLiteralInTypeArgumentCompletionSymbols() || tryGetObjectLikeCompletionSymbols() || tryGetImportCompletionSymbols() || tryGetImportOrExportClauseCompletionSymbols() || tryGetImportAttributesCompletionSymbols() || tryGetLocalNamedExportCompletionSymbols() || tryGetConstructorCompletion() || tryGetClassLikeCompletionSymbols() || tryGetJsxCompletionSymbols() || (getGlobalCompletions(), 1 /* Success */);
       return result === 1 /* Success */;
     }
     function tryGetConstructorCompletion() {
@@ -159021,8 +160537,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     function shouldOfferImportCompletions() {
       if (importStatementCompletion)
         return true;
-      if (isNonContextualObjectLiteral)
-        return false;
       if (!preferences.includeCompletionsForModuleExports)
         return false;
       if (sourceFile.externalModuleIndicator || sourceFile.commonJsModuleIndicator)
@@ -159055,7 +160569,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
           case 59 /* ColonToken */:
             return parentKind === 172 /* PropertyDeclaration */ || parentKind === 171 /* PropertySignature */ || parentKind === 169 /* Parameter */ || parentKind === 260 /* VariableDeclaration */ || isFunctionLikeKind(parentKind);
           case 64 /* EqualsToken */:
-            return parentKind === 265 /* TypeAliasDeclaration */;
+            return parentKind === 265 /* TypeAliasDeclaration */ || parentKind === 168 /* TypeParameter */;
           case 130 /* AsKeyword */:
             return parentKind === 234 /* AsExpression */;
           case 30 /* LessThanToken */:
@@ -159325,7 +160839,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
           if (objectLikeContainer.flags & 67108864 /* InWithStatement */) {
             return 2 /* Fail */;
           }
-          isNonContextualObjectLiteral = true;
           return 0 /* Continue */;
         }
         const completionsType = typeChecker.getContextualType(objectLikeContainer, 4 /* Completions */);
@@ -159336,7 +160849,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         existingMembers = objectLikeContainer.properties;
         if (typeMembers.length === 0) {
           if (!hasNumberIndextype) {
-            isNonContextualObjectLiteral = true;
             return 0 /* Continue */;
           }
         }
@@ -159413,6 +160925,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       }
       return 1 /* Success */;
     }
+    function tryGetImportAttributesCompletionSymbols() {
+      if (contextToken === void 0)
+        return 0 /* Continue */;
+      const importAttributes = contextToken.kind === 19 /* OpenBraceToken */ || contextToken.kind === 28 /* CommaToken */ ? tryCast(contextToken.parent, isImportAttributes) : contextToken.kind === 59 /* ColonToken */ ? tryCast(contextToken.parent.parent, isImportAttributes) : void 0;
+      if (importAttributes === void 0)
+        return 0 /* Continue */;
+      const existing = new Set(importAttributes.elements.map(getNameFromImportAttribute));
+      symbols = filter(typeChecker.getTypeAtLocation(importAttributes).getApparentProperties(), (attr) => !existing.has(attr.escapedName));
+      return 1 /* Success */;
+    }
     function tryGetLocalNamedExportCompletionSymbols() {
       var _a;
       const namedExports = contextToken && (contextToken.kind === 19 /* OpenBraceToken */ || contextToken.kind === 28 /* CommaToken */) ? tryCast(contextToken.parent, isNamedExports) : void 0;
@@ -159557,6 +161079,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       }
       return void 0;
     }
+    function isInDifferentLineThanContextToken(contextToken2, position2) {
+      return sourceFile.getLineEndOfPosition(contextToken2.getEnd()) < position2;
+    }
     function isSolelyIdentifierDefinitionLocation(contextToken2) {
       const parent2 = contextToken2.parent;
       const containingNodeKind = parent2.kind;
@@ -159598,11 +161123,19 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         case 139 /* GetKeyword */:
         case 153 /* SetKeyword */:
           return !isFromObjectTypeDeclaration(contextToken2);
-        case 80 /* Identifier */:
+        case 80 /* Identifier */: {
           if (containingNodeKind === 276 /* ImportSpecifier */ && contextToken2 === parent2.name && contextToken2.text === "type") {
             return false;
           }
+          const ancestorVariableDeclaration = findAncestor(
+            contextToken2.parent,
+            isVariableDeclaration
+          );
+          if (ancestorVariableDeclaration && isInDifferentLineThanContextToken(contextToken2, position)) {
+            return false;
+          }
           break;
+        }
         case 86 /* ClassKeyword */:
         case 94 /* EnumKeyword */:
         case 120 /* InterfaceKeyword */:
@@ -159983,7 +161516,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     }
   }
   function isFunctionLikeBodyKeyword(kind) {
-    return kind === 134 /* AsyncKeyword */ || kind === 135 /* AwaitKeyword */ || kind === 130 /* AsKeyword */ || kind === 152 /* SatisfiesKeyword */ || kind === 156 /* TypeKeyword */ || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind);
+    return kind === 134 /* AsyncKeyword */ || kind === 135 /* AwaitKeyword */ || kind === 160 /* UsingKeyword */ || kind === 130 /* AsKeyword */ || kind === 152 /* SatisfiesKeyword */ || kind === 156 /* TypeKeyword */ || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind);
   }
   function keywordForNode(node) {
     return isIdentifier(node) ? identifierToKeywordKind(node) ?? 0 /* Unknown */ : node.kind;
@@ -160244,6 +161777,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         }
         return void 0;
       }
+      if (isExportDeclaration(parent2) && contextToken.kind === 42 /* AsteriskToken */ || isNamedExports(parent2) && contextToken.kind === 20 /* CloseBraceToken */) {
+        isKeywordOnlyCompletion = true;
+        keywordCompletion = 161 /* FromKeyword */;
+        return void 0;
+      }
       if (isImportKeyword(contextToken) && isSourceFile(parent2)) {
         keywordCompletion = 156 /* TypeKeyword */;
         return contextToken;
@@ -160462,7 +162000,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     if (isInString(sourceFile, position, contextToken)) {
       if (!contextToken || !isStringLiteralLike(contextToken))
         return void 0;
-      const entries = getStringLiteralCompletionEntries(sourceFile, contextToken, position, program.getTypeChecker(), options, host, preferences);
+      const entries = getStringLiteralCompletionEntries(sourceFile, contextToken, position, program, host, preferences);
       return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log, options, preferences, position, includeSymbol);
     }
   }
@@ -160532,11 +162070,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         return Debug.assertNever(completion);
     }
   }
-  function getStringLiteralCompletionDetails(name, sourceFile, position, contextToken, checker, options, host, cancellationToken, preferences) {
+  function getStringLiteralCompletionDetails(name, sourceFile, position, contextToken, program, host, cancellationToken, preferences) {
     if (!contextToken || !isStringLiteralLike(contextToken))
       return void 0;
-    const completions = getStringLiteralCompletionEntries(sourceFile, contextToken, position, checker, options, host, preferences);
-    return completions && stringLiteralCompletionDetails(name, contextToken, completions, sourceFile, checker, cancellationToken);
+    const completions = getStringLiteralCompletionEntries(sourceFile, contextToken, position, program, host, preferences);
+    return completions && stringLiteralCompletionDetails(name, contextToken, completions, sourceFile, program.getTypeChecker(), cancellationToken);
   }
   function stringLiteralCompletionDetails(name, location, completion, sourceFile, checker, cancellationToken) {
     switch (completion.kind) {
@@ -160594,13 +162132,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         return Debug.assertNever(extension);
     }
   }
-  function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker, compilerOptions, host, preferences) {
+  function getStringLiteralCompletionEntries(sourceFile, node, position, program, host, preferences) {
+    const typeChecker = program.getTypeChecker();
     const parent2 = walkUpParentheses(node.parent);
     switch (parent2.kind) {
       case 201 /* LiteralType */: {
         const grandParent = walkUpParentheses(parent2.parent);
         if (grandParent.kind === 205 /* ImportType */) {
-          return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker, preferences) };
+          return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, program, host, preferences) };
         }
         return fromUnionableLiteralType(grandParent);
       }
@@ -160620,13 +162159,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       case 214 /* NewExpression */:
       case 291 /* JsxAttribute */:
         if (!isRequireCallArgument(node) && !isImportCall(parent2)) {
-          const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 291 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile);
+          const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 291 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile, typeChecker);
           return argumentInfo && getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || fromContextualType(0 /* None */);
         }
       case 272 /* ImportDeclaration */:
       case 278 /* ExportDeclaration */:
       case 283 /* ExternalModuleReference */:
-        return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker, preferences) };
+        return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, program, host, preferences) };
       case 296 /* CaseClause */:
         const tracker = newCaseClauseTracker(typeChecker, parent2.parent.clauses);
         const contextualTypes = fromContextualType();
@@ -160756,14 +162295,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     const wholeSpan = text.length === 0 ? void 0 : createTextSpan(textStart, text.length);
     return names.map(({ name, kind, extension }) => name.includes(directorySeparator) || name.includes(altDirectorySeparator) ? { name, kind, extension, span: wholeSpan } : { name, kind, extension, span });
   }
-  function getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker, preferences) {
-    return addReplacementSpans(node.text, node.getStart(sourceFile) + 1, getStringLiteralCompletionsFromModuleNamesWorker(sourceFile, node, compilerOptions, host, typeChecker, preferences));
+  function getStringLiteralCompletionsFromModuleNames(sourceFile, node, program, host, preferences) {
+    return addReplacementSpans(node.text, node.getStart(sourceFile) + 1, getStringLiteralCompletionsFromModuleNamesWorker(sourceFile, node, program, host, preferences));
   }
-  function getStringLiteralCompletionsFromModuleNamesWorker(sourceFile, node, compilerOptions, host, typeChecker, preferences) {
+  function getStringLiteralCompletionsFromModuleNamesWorker(sourceFile, node, program, host, preferences) {
     const literalValue = normalizeSlashes(node.text);
-    const mode = isStringLiteralLike(node) ? getModeForUsageLocation(sourceFile, node) : void 0;
+    const mode = isStringLiteralLike(node) ? program.getModeForUsageLocation(sourceFile, node) : void 0;
     const scriptPath = sourceFile.path;
     const scriptDirectory = getDirectoryPath(scriptPath);
+    const compilerOptions = program.getCompilerOptions();
+    const typeChecker = program.getTypeChecker();
     const extensionOptions = getExtensionOptions(compilerOptions, 1 /* ModuleSpecifier */, sourceFile, typeChecker, preferences, mode);
     return isPathRelativeToScript(literalValue) || !compilerOptions.baseUrl && !compilerOptions.paths && (isRootedDiskPath(literalValue) || isUrl(literalValue)) ? getCompletionEntriesForRelativeModules(literalValue, scriptDirectory, compilerOptions, host, scriptPath, extensionOptions) : getCompletionEntriesForNonRelativeModules(literalValue, scriptDirectory, mode, compilerOptions, host, extensionOptions, typeChecker);
   }
@@ -160823,15 +162364,18 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     const basePath = compilerOptions.project || host.getCurrentDirectory();
     const ignoreCase = !(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames());
     const baseDirectories = getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptDirectory, ignoreCase);
-    return flatMap(baseDirectories, (baseDirectory) => arrayFrom(getCompletionEntriesForDirectoryFragment(
-      fragment,
-      baseDirectory,
-      extensionOptions,
-      host,
-      /*moduleSpecifierIsRelative*/
-      true,
-      exclude
-    ).values()));
+    return deduplicate(
+      flatMap(baseDirectories, (baseDirectory) => arrayFrom(getCompletionEntriesForDirectoryFragment(
+        fragment,
+        baseDirectory,
+        extensionOptions,
+        host,
+        /*moduleSpecifierIsRelative*/
+        true,
+        exclude
+      ).values())),
+      (itemA, itemB) => itemA.name === itemB.name && itemA.kind === itemB.kind && itemA.extension === itemB.extension
+    );
   }
   function getCompletionEntriesForDirectoryFragment(fragment, scriptDirectory, extensionOptions, host, moduleSpecifierIsRelative, exclude, result = createNameAndKindSet()) {
     var _a;
@@ -160883,7 +162427,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         if (exclude && comparePaths(filePath, exclude, scriptDirectory, ignoreCase) === 0 /* EqualTo */) {
           continue;
         }
-        const { name, extension } = getFilenameWithExtensionOption(getBaseFileName(filePath), host.getCompilationSettings(), extensionOptions);
+        const { name, extension } = getFilenameWithExtensionOption(
+          getBaseFileName(filePath),
+          host.getCompilationSettings(),
+          extensionOptions,
+          /*isExportsWildcard*/
+          false
+        );
         result.add(nameAndKind(name, "script" /* scriptElement */, extension));
       }
     }
@@ -160898,7 +162448,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     }
     return result;
   }
-  function getFilenameWithExtensionOption(name, compilerOptions, extensionOptions) {
+  function getFilenameWithExtensionOption(name, compilerOptions, extensionOptions, isExportsWildcard) {
     const nonJsResult = ts_moduleSpecifiers_exports.tryGetRealFileNameForNonJsDeclarationFileName(name);
     if (nonJsResult) {
       return { name: nonJsResult, extension: tryGetExtensionFromPath2(nonJsResult) };
@@ -160906,15 +162456,22 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     if (extensionOptions.referenceKind === 0 /* Filename */) {
       return { name, extension: tryGetExtensionFromPath2(name) };
     }
-    const endingPreference = getModuleSpecifierEndingPreference(extensionOptions.endingPreference, extensionOptions.resolutionMode, compilerOptions, extensionOptions.importingSourceFile);
-    if (endingPreference === 3 /* TsExtension */) {
+    let allowedEndings = getModuleSpecifierPreferences(
+      { importModuleSpecifierEnding: extensionOptions.endingPreference },
+      compilerOptions,
+      extensionOptions.importingSourceFile
+    ).getAllowedEndingsInPreferredOrder(extensionOptions.resolutionMode);
+    if (isExportsWildcard) {
+      allowedEndings = allowedEndings.filter((e) => e !== 0 /* Minimal */ && e !== 1 /* Index */);
+    }
+    if (allowedEndings[0] === 3 /* TsExtension */) {
       if (fileExtensionIsOneOf(name, supportedTSImplementationExtensions)) {
         return { name, extension: tryGetExtensionFromPath2(name) };
       }
       const outputExtension2 = ts_moduleSpecifiers_exports.tryGetJSExtensionForFile(name, compilerOptions);
       return outputExtension2 ? { name: changeExtension(name, outputExtension2), extension: outputExtension2 } : { name, extension: tryGetExtensionFromPath2(name) };
     }
-    if ((endingPreference === 0 /* Minimal */ || endingPreference === 1 /* Index */) && fileExtensionIsOneOf(name, [".js" /* Js */, ".jsx" /* Jsx */, ".ts" /* Ts */, ".tsx" /* Tsx */, ".d.ts" /* Dts */])) {
+    if (!isExportsWildcard && (allowedEndings[0] === 0 /* Minimal */ || allowedEndings[0] === 1 /* Index */) && fileExtensionIsOneOf(name, [".js" /* Js */, ".jsx" /* Jsx */, ".ts" /* Ts */, ".tsx" /* Tsx */, ".d.ts" /* Dts */])) {
       return { name: removeFileExtension(name), extension: tryGetExtensionFromPath2(name) };
     }
     const outputExtension = ts_moduleSpecifiers_exports.tryGetJSExtensionForFile(name, compilerOptions);
@@ -160929,9 +162486,20 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       const lengthB = typeof patternB === "object" ? patternB.prefix.length : b.length;
       return compareValues(lengthB, lengthA);
     };
-    return addCompletionEntriesFromPathsOrExports(result, fragment, baseDirectory, extensionOptions, host, getOwnKeys(paths), getPatternsForKey, comparePaths2);
+    return addCompletionEntriesFromPathsOrExports(
+      result,
+      /*isExports*/
+      false,
+      fragment,
+      baseDirectory,
+      extensionOptions,
+      host,
+      getOwnKeys(paths),
+      getPatternsForKey,
+      comparePaths2
+    );
   }
-  function addCompletionEntriesFromPathsOrExports(result, fragment, baseDirectory, extensionOptions, host, keys, getPatternsForKey, comparePaths2) {
+  function addCompletionEntriesFromPathsOrExports(result, isExports, fragment, baseDirectory, extensionOptions, host, keys, getPatternsForKey, comparePaths2) {
     let pathResults = [];
     let matchedPath;
     for (const key of keys) {
@@ -160952,7 +162520,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         if (typeof pathPattern === "string" || matchedPath === void 0 || comparePaths2(key, matchedPath) !== 1 /* GreaterThan */) {
           pathResults.push({
             matchedPattern: isMatch,
-            results: getCompletionsForPathMapping(keyWithoutLeadingDotSlash, patterns, fragment, baseDirectory, extensionOptions, host).map(({ name, kind, extension }) => nameAndKind(name, kind, extension))
+            results: getCompletionsForPathMapping(keyWithoutLeadingDotSlash, patterns, fragment, baseDirectory, extensionOptions, isExports && isMatch, host).map(({ name, kind, extension }) => nameAndKind(name, kind, extension))
           });
         }
       }
@@ -161025,31 +162593,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
             );
           }
         };
-        const checkExports = (packageFile, packageDirectory, fragmentSubpath) => {
-          const packageJson = readJson(packageFile, host);
-          const exports = packageJson.exports;
-          if (exports) {
-            if (typeof exports !== "object" || exports === null) {
-              return true;
-            }
-            const keys = getOwnKeys(exports);
-            const conditions = getConditions(compilerOptions, mode);
-            addCompletionEntriesFromPathsOrExports(
-              result,
-              fragmentSubpath,
-              packageDirectory,
-              extensionOptions,
-              host,
-              keys,
-              (key) => singleElementArray(getPatternFromFirstMatchingCondition(exports[key], conditions)),
-              comparePatternKeys
-            );
-            return true;
-          }
-          return false;
-        };
-        const shouldCheckExports = fragmentDirectory && getResolvePackageJsonExports(compilerOptions);
-        if (shouldCheckExports) {
+        if (fragmentDirectory && getResolvePackageJsonExports(compilerOptions)) {
           const nodeModulesDirectoryLookup = ancestorLookup;
           ancestorLookup = (ancestor) => {
             const components = getPathComponents(fragment);
@@ -161068,52 +162612,34 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
             const packageDirectory = combinePaths(ancestor, "node_modules", packagePath);
             const packageFile = combinePaths(packageDirectory, "package.json");
             if (tryFileExists(host, packageFile)) {
-              const fragmentSubpath = components.join("/") + (components.length && hasTrailingDirectorySeparator(fragment) ? "/" : "");
-              if (checkExports(packageFile, packageDirectory, fragmentSubpath)) {
-                return;
-              }
-            }
-            return nodeModulesDirectoryLookup(ancestor);
-          };
-        }
-        const pnpApi = getPnpApi(scriptPath);
-        if (pnpApi) {
-          const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:@[^/]+\/)?[^/]+)\/*(.*|)$/;
-          const dependencyNameMatch = fragment.match(pathRegExp);
-          if (dependencyNameMatch) {
-            const [, dependencyName, subPath] = dependencyNameMatch;
-            let unqualified;
-            try {
-              unqualified = pnpApi.resolveToUnqualified(dependencyName, scriptPath, { considerBuiltins: false });
-            } catch {
-            }
-            if (unqualified) {
-              const packageDirectory = normalizePath(unqualified);
-              let shouldGetCompletions = true;
-              if (shouldCheckExports) {
-                const packageFile = combinePaths(packageDirectory, "package.json");
-                if (tryFileExists(host, packageFile) && checkExports(packageFile, packageDirectory, subPath)) {
-                  shouldGetCompletions = false;
+              const packageJson = readJson(packageFile, host);
+              const exports = packageJson.exports;
+              if (exports) {
+                if (typeof exports !== "object" || exports === null) {
+                  return;
                 }
-              }
-              if (shouldGetCompletions) {
-                getCompletionEntriesForDirectoryFragment(
-                  subPath,
+                const keys = getOwnKeys(exports);
+                const fragmentSubpath = components.join("/") + (components.length && hasTrailingDirectorySeparator(fragment) ? "/" : "");
+                const conditions = getConditions(compilerOptions, mode);
+                addCompletionEntriesFromPathsOrExports(
+                  result,
+                  /*isExports*/
+                  true,
+                  fragmentSubpath,
                   packageDirectory,
                   extensionOptions,
                   host,
-                  /*moduleSpecifierIsRelative*/
-                  false,
-                  /*exclude*/
-                  void 0,
-                  result
+                  keys,
+                  (key) => singleElementArray(getPatternFromFirstMatchingCondition(exports[key], conditions)),
+                  comparePatternKeys
                 );
+                return;
               }
             }
-          }
-        } else {
-          forEachAncestorDirectory(scriptPath, ancestorLookup);
+            return nodeModulesDirectoryLookup(ancestor);
+          };
         }
+        forEachAncestorDirectory(scriptPath, ancestorLookup);
       }
     }
     return arrayFrom(result.values());
@@ -161134,7 +162660,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
   function getFragmentDirectory(fragment) {
     return containsSlash(fragment) ? hasTrailingDirectorySeparator(fragment) ? fragment : getDirectoryPath(fragment) : void 0;
   }
-  function getCompletionsForPathMapping(path, patterns, fragment, packageDirectory, extensionOptions, host) {
+  function getCompletionsForPathMapping(path, patterns, fragment, packageDirectory, extensionOptions, isExportsWildcard, host) {
     if (!endsWith(path, "*")) {
       return !path.includes("*") ? justPathMappingName(path, "script" /* scriptElement */) : emptyArray;
     }
@@ -161144,15 +162670,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       const starIsFullPathComponent = path[path.length - 2] === "/";
       return starIsFullPathComponent ? justPathMappingName(pathPrefix, "directory" /* directory */) : flatMap(patterns, (pattern) => {
         var _a;
-        return (_a = getModulesForPathsPattern("", packageDirectory, pattern, extensionOptions, host)) == null ? void 0 : _a.map(({ name, ...rest }) => ({ name: pathPrefix + name, ...rest }));
+        return (_a = getModulesForPathsPattern("", packageDirectory, pattern, extensionOptions, isExportsWildcard, host)) == null ? void 0 : _a.map(({ name, ...rest }) => ({ name: pathPrefix + name, ...rest }));
       });
     }
-    return flatMap(patterns, (pattern) => getModulesForPathsPattern(remainingFragment, packageDirectory, pattern, extensionOptions, host));
+    return flatMap(patterns, (pattern) => getModulesForPathsPattern(remainingFragment, packageDirectory, pattern, extensionOptions, isExportsWildcard, host));
     function justPathMappingName(name, kind) {
       return startsWith(name, fragment) ? [{ name: removeTrailingDirectorySeparator(name), kind, extension: void 0 }] : emptyArray;
     }
   }
-  function getModulesForPathsPattern(fragment, packageDirectory, pattern, extensionOptions, host) {
+  function getModulesForPathsPattern(fragment, packageDirectory, pattern, extensionOptions, isExportsWildcard, host) {
     if (!host.readDirectory) {
       return void 0;
     }
@@ -161185,7 +162711,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         if (containsSlash(trimmedWithPattern)) {
           return directoryResult(getPathComponents(removeLeadingDirectorySeparator(trimmedWithPattern))[1]);
         }
-        const { name, extension } = getFilenameWithExtensionOption(trimmedWithPattern, host.getCompilationSettings(), extensionOptions);
+        const { name, extension } = getFilenameWithExtensionOption(trimmedWithPattern, host.getCompilationSettings(), extensionOptions, isExportsWildcard);
         return nameAndKind(name, "script" /* scriptElement */, extension);
       }
     });
@@ -161244,15 +162770,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     for (const root of typeRoots) {
       getCompletionEntriesFromDirectories(root);
     }
-    if (getPnpApi(scriptPath)) {
-      for (const root of getPnpTypeRoots(scriptPath)) {
-        getCompletionEntriesFromDirectories(root);
-      }
-    } else {
-      for (const packageJson of findPackageJsons(scriptPath, host)) {
-        const typesDir = combinePaths(getDirectoryPath(packageJson), "node_modules/@types");
-        getCompletionEntriesFromDirectories(typesDir);
-      }
+    for (const packageJson of findPackageJsons(scriptPath, host)) {
+      const typesDir = combinePaths(getDirectoryPath(packageJson), "node_modules/@types");
+      getCompletionEntriesFromDirectories(typesDir);
     }
     return result;
     function getCompletionEntriesFromDirectories(directory) {
@@ -161335,7 +162855,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
   var init_stringCompletions = __esm({
     "src/services/stringCompletions.ts"() {
       "use strict";
-      init_pnp();
+      init_moduleSpecifiers();
       init_ts4();
       init_ts_Completions();
       kindPrecedence = {
@@ -162018,6 +163538,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         return isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode(
           findAncestor(node.parent, (node2) => isBinaryExpression(node2) || isForInOrOfStatement(node2))
         ) : node;
+      case 255 /* SwitchStatement */:
+        return {
+          start: find(node.getChildren(node.getSourceFile()), (node2) => node2.kind === 109 /* SwitchKeyword */),
+          end: node.caseBlock
+        };
       default:
         return node;
     }
@@ -162312,6 +163837,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       start += 1;
       end -= 1;
     }
+    if ((endNode2 == null ? void 0 : endNode2.kind) === 269 /* CaseBlock */) {
+      end = endNode2.getFullStart();
+    }
     return createTextSpanFromBounds(start, end);
   }
   function getTextSpanOfEntry(entry) {
@@ -162448,7 +163976,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
             if (!options.implementations && isStringLiteralLike(node)) {
               if (isModuleSpecifierLike(node)) {
                 const fileIncludeReasons = program.getFileIncludeReasons();
-                const referencedFileName = (_b = (_a = program.getResolvedModule(node.getSourceFile(), node.text, getModeForUsageLocation(node.getSourceFile(), node))) == null ? void 0 : _a.resolvedModule) == null ? void 0 : _b.resolvedFileName;
+                const referencedFileName = (_b = (_a = program.getResolvedModuleFromModuleSpecifier(node)) == null ? void 0 : _a.resolvedModule) == null ? void 0 : _b.resolvedFileName;
                 const referencedFile = referencedFileName ? program.getSourceFile(referencedFileName) : void 0;
                 if (referencedFile) {
                   return [{ definition: { type: 4 /* String */, node }, references: getReferencesForNonModule(referencedFile, fileIncludeReasons, program) || emptyArray }];
@@ -163180,6 +164708,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
             getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, parent2, search, state, addReferencesHere);
             return;
           }
+          if (isJSDocPropertyLikeTag(parent2) && parent2.isNameFirst && parent2.typeExpression && isJSDocTypeLiteral(parent2.typeExpression.type) && parent2.typeExpression.type.jsDocPropertyTags && length(parent2.typeExpression.type.jsDocPropertyTags)) {
+            getReferencesAtJSDocTypeLiteral(parent2.typeExpression.type.jsDocPropertyTags, referenceLocation, search, state);
+            return;
+          }
           const relatedSymbol = getRelatedSymbol(search, referenceSymbol, referenceLocation, state);
           if (!relatedSymbol) {
             getReferenceForShorthandProperty(referenceSymbol, search, state);
@@ -163206,6 +164738,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
           }
           getImportOrExportReferences(referenceLocation, referenceSymbol, search, state);
         }
+        function getReferencesAtJSDocTypeLiteral(jsDocPropertyTags, referenceLocation, search, state) {
+          const addRef = state.referenceAdder(search.symbol);
+          addReference(referenceLocation, search.symbol, state);
+          forEach(jsDocPropertyTags, (propTag) => {
+            if (isQualifiedName(propTag.name)) {
+              addRef(propTag.name.left);
+            }
+          });
+        }
         function getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, search, state, addReferencesHere, alwaysGetReferences) {
           Debug.assert(!alwaysGetReferences || !!state.options.providePrefixAndSuffixTextForRename, "If alwaysGetReferences is true, then prefix/suffix text must be enabled");
           const { parent: parent2, propertyName, name } = exportSpecifier;
@@ -163589,7 +165130,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
               if (isStringLiteralLike(ref) && ref.text === node.text) {
                 if (type) {
                   const refType = getContextualTypeFromParentOrAncestorTypeNode(ref, checker);
-                  if (type !== checker.getStringType() && type === refType) {
+                  if (type !== checker.getStringType() && (type === refType || isStringLiteralPropertyReference(ref, checker))) {
                     return nodeEntry(ref, 2 /* StringLiteral */);
                   }
                 } else {
@@ -163603,6 +165144,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
             references
           }];
         }
+        function isStringLiteralPropertyReference(node, checker) {
+          if (isPropertySignature(node.parent)) {
+            return checker.getPropertyOfType(checker.getTypeAtLocation(node.parent.parent), node.text);
+          }
+        }
         function populateSearchSymbolSet(symbol, location, checker, isForRename, providePrefixAndSuffixText, implementations) {
           const result = [];
           forEachRelatedSymbol(
@@ -163904,9 +165450,20 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         void 0
       )] : void 0;
     }
-    if (node.kind === 107 /* ReturnKeyword */) {
-      const functionDeclaration = findAncestor(node.parent, (n) => isClassStaticBlockDeclaration(n) ? "quit" : isFunctionLikeDeclaration(n));
-      return functionDeclaration ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
+    switch (node.kind) {
+      case 107 /* ReturnKeyword */:
+        const functionDeclaration = findAncestor(node.parent, (n) => isClassStaticBlockDeclaration(n) ? "quit" : isFunctionLikeDeclaration(n));
+        return functionDeclaration ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
+      case 90 /* DefaultKeyword */:
+        if (!isDefaultClause(node.parent)) {
+          break;
+        }
+      case 84 /* CaseKeyword */:
+        const switchStatement = findAncestor(node.parent, isSwitchStatement);
+        if (switchStatement) {
+          return [createDefinitionInfoFromSwitch(switchStatement, sourceFile)];
+        }
+        break;
     }
     if (node.kind === 135 /* AwaitKeyword */) {
       const functionDeclaration = findAncestor(node, (n) => isFunctionLikeDeclaration(n));
@@ -163951,7 +165508,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       }
     }
     if (!symbol && isModuleSpecifierLike(fallbackNode)) {
-      const ref = (_a = program.getResolvedModule(sourceFile, fallbackNode.text, getModeForUsageLocation(sourceFile, fallbackNode))) == null ? void 0 : _a.resolvedModule;
+      const ref = (_a = program.getResolvedModuleFromModuleSpecifier(fallbackNode)) == null ? void 0 : _a.resolvedModule;
       if (ref) {
         return [{
           name: fallbackNode.text,
@@ -164066,7 +165623,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     if (sourceFile.imports.length || sourceFile.moduleAugmentations.length) {
       const node = getTouchingToken(sourceFile, position);
       let resolution;
-      if (isModuleSpecifierLike(node) && isExternalModuleNameRelative(node.text) && (resolution = program.getResolvedModule(sourceFile, node.text, getModeForUsageLocation(sourceFile, node)))) {
+      if (isModuleSpecifierLike(node) && isExternalModuleNameRelative(node.text) && (resolution = program.getResolvedModuleFromModuleSpecifier(node))) {
         const verifiedFileName = (_b = resolution.resolvedModule) == null ? void 0 : _b.resolvedFileName;
         const fileName = verifiedFileName || resolvePath(getDirectoryPath(sourceFile.fileName), node.text);
         return {
@@ -164303,6 +165860,23 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       failedAliasResolution
     };
   }
+  function createDefinitionInfoFromSwitch(statement, sourceFile) {
+    const keyword = ts_FindAllReferences_exports.getContextNode(statement);
+    const textSpan = createTextSpanFromNode(isContextWithStartAndEndNode(keyword) ? keyword.start : keyword, sourceFile);
+    return {
+      fileName: sourceFile.fileName,
+      textSpan,
+      kind: "keyword" /* keyword */,
+      name: "switch",
+      containerKind: void 0,
+      containerName: "",
+      ...ts_FindAllReferences_exports.toContextSpan(textSpan, sourceFile, keyword),
+      isLocal: true,
+      isAmbient: false,
+      unverified: false,
+      failedAliasResolution: void 0
+    };
+  }
   function isDefinitionVisible(checker, declaration) {
     if (checker.isDeclarationVisible(declaration))
       return true;
@@ -164380,6 +165954,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     "src/services/goToDefinition.ts"() {
       "use strict";
       init_ts4();
+      init_ts_FindAllReferences();
       typesWithUnwrappedTypeArguments = /* @__PURE__ */ new Set([
         "Array",
         "ArrayLike",
@@ -164735,6 +166310,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       visitForDisplayParts(typeNode);
       return parts;
       function visitForDisplayParts(node) {
+        var _a, _b;
         if (!node) {
           return;
         }
@@ -164749,9 +166325,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         }
         switch (node.kind) {
           case 80 /* Identifier */:
-            const identifier = node;
-            const identifierText = idText(identifier);
-            const name = identifier.symbol && identifier.symbol.declarations && identifier.symbol.declarations.length && getNameOfDeclaration(identifier.symbol.declarations[0]);
+            Debug.assertNode(node, isIdentifier);
+            const identifierText = idText(node);
+            const name = node.symbol && node.symbol.declarations && node.symbol.declarations.length && getNameOfDeclaration(node.symbol.declarations[0]);
             if (name) {
               parts.push(getNodeDisplayPart(identifierText, name));
             } else {
@@ -164759,252 +166335,343 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
             }
             break;
           case 166 /* QualifiedName */:
-            const qualifiedName = node;
-            visitForDisplayParts(qualifiedName.left);
+            Debug.assertNode(node, isQualifiedName);
+            visitForDisplayParts(node.left);
             parts.push({ text: "." });
-            visitForDisplayParts(qualifiedName.right);
+            visitForDisplayParts(node.right);
             break;
           case 182 /* TypePredicate */:
-            const predicate = node;
-            if (predicate.assertsModifier) {
+            Debug.assertNode(node, isTypePredicateNode);
+            if (node.assertsModifier) {
               parts.push({ text: "asserts " });
             }
-            visitForDisplayParts(predicate.parameterName);
-            if (predicate.type) {
+            visitForDisplayParts(node.parameterName);
+            if (node.type) {
               parts.push({ text: " is " });
-              visitForDisplayParts(predicate.type);
+              visitForDisplayParts(node.type);
             }
             break;
           case 183 /* TypeReference */:
-            const typeReference = node;
-            visitForDisplayParts(typeReference.typeName);
-            if (typeReference.typeArguments) {
+            Debug.assertNode(node, isTypeReferenceNode);
+            visitForDisplayParts(node.typeName);
+            if (node.typeArguments) {
               parts.push({ text: "<" });
-              visitDisplayPartList(typeReference.typeArguments, ", ");
+              visitDisplayPartList(node.typeArguments, ", ");
               parts.push({ text: ">" });
             }
             break;
           case 168 /* TypeParameter */:
-            const typeParameter = node;
-            if (typeParameter.modifiers) {
-              visitDisplayPartList(typeParameter.modifiers, " ");
+            Debug.assertNode(node, isTypeParameterDeclaration);
+            if (node.modifiers) {
+              visitDisplayPartList(node.modifiers, " ");
             }
-            visitForDisplayParts(typeParameter.name);
-            if (typeParameter.constraint) {
+            visitForDisplayParts(node.name);
+            if (node.constraint) {
               parts.push({ text: " extends " });
-              visitForDisplayParts(typeParameter.constraint);
+              visitForDisplayParts(node.constraint);
             }
-            if (typeParameter.default) {
+            if (node.default) {
               parts.push({ text: " = " });
-              visitForDisplayParts(typeParameter.default);
+              visitForDisplayParts(node.default);
             }
             break;
           case 169 /* Parameter */:
-            const parameter = node;
-            if (parameter.modifiers) {
-              visitDisplayPartList(parameter.modifiers, " ");
+            Debug.assertNode(node, isParameter);
+            if (node.modifiers) {
+              visitDisplayPartList(node.modifiers, " ");
             }
-            if (parameter.dotDotDotToken) {
+            if (node.dotDotDotToken) {
               parts.push({ text: "..." });
             }
-            visitForDisplayParts(parameter.name);
-            if (parameter.questionToken) {
+            visitForDisplayParts(node.name);
+            if (node.questionToken) {
               parts.push({ text: "?" });
             }
-            if (parameter.type) {
+            if (node.type) {
               parts.push({ text: ": " });
-              visitForDisplayParts(parameter.type);
+              visitForDisplayParts(node.type);
             }
             break;
           case 185 /* ConstructorType */:
-            const constructorType = node;
+            Debug.assertNode(node, isConstructorTypeNode);
             parts.push({ text: "new " });
-            if (constructorType.typeParameters) {
-              parts.push({ text: "<" });
-              visitDisplayPartList(constructorType.typeParameters, ", ");
-              parts.push({ text: ">" });
-            }
-            parts.push({ text: "(" });
-            visitDisplayPartList(constructorType.parameters, ", ");
-            parts.push({ text: ")" });
+            visitParametersAndTypeParameters(node);
             parts.push({ text: " => " });
-            visitForDisplayParts(constructorType.type);
+            visitForDisplayParts(node.type);
             break;
           case 186 /* TypeQuery */:
-            const typeQuery = node;
+            Debug.assertNode(node, isTypeQueryNode);
             parts.push({ text: "typeof " });
-            visitForDisplayParts(typeQuery.exprName);
-            if (typeQuery.typeArguments) {
+            visitForDisplayParts(node.exprName);
+            if (node.typeArguments) {
               parts.push({ text: "<" });
-              visitDisplayPartList(typeQuery.typeArguments, ", ");
+              visitDisplayPartList(node.typeArguments, ", ");
               parts.push({ text: ">" });
             }
             break;
           case 187 /* TypeLiteral */:
-            const typeLiteral = node;
+            Debug.assertNode(node, isTypeLiteralNode);
             parts.push({ text: "{" });
-            if (typeLiteral.members.length) {
+            if (node.members.length) {
               parts.push({ text: " " });
-              visitDisplayPartList(typeLiteral.members, "; ");
+              visitDisplayPartList(node.members, "; ");
               parts.push({ text: " " });
             }
             parts.push({ text: "}" });
             break;
           case 188 /* ArrayType */:
+            Debug.assertNode(node, isArrayTypeNode);
             visitForDisplayParts(node.elementType);
             parts.push({ text: "[]" });
             break;
           case 189 /* TupleType */:
+            Debug.assertNode(node, isTupleTypeNode);
             parts.push({ text: "[" });
             visitDisplayPartList(node.elements, ", ");
             parts.push({ text: "]" });
             break;
           case 202 /* NamedTupleMember */:
-            const member = node;
-            if (member.dotDotDotToken) {
+            Debug.assertNode(node, isNamedTupleMember);
+            if (node.dotDotDotToken) {
               parts.push({ text: "..." });
             }
-            visitForDisplayParts(member.name);
-            if (member.questionToken) {
+            visitForDisplayParts(node.name);
+            if (node.questionToken) {
               parts.push({ text: "?" });
             }
             parts.push({ text: ": " });
-            visitForDisplayParts(member.type);
+            visitForDisplayParts(node.type);
             break;
           case 190 /* OptionalType */:
+            Debug.assertNode(node, isOptionalTypeNode);
             visitForDisplayParts(node.type);
             parts.push({ text: "?" });
             break;
           case 191 /* RestType */:
+            Debug.assertNode(node, isRestTypeNode);
             parts.push({ text: "..." });
             visitForDisplayParts(node.type);
             break;
           case 192 /* UnionType */:
+            Debug.assertNode(node, isUnionTypeNode);
             visitDisplayPartList(node.types, " | ");
             break;
           case 193 /* IntersectionType */:
+            Debug.assertNode(node, isIntersectionTypeNode);
             visitDisplayPartList(node.types, " & ");
             break;
           case 194 /* ConditionalType */:
-            const conditionalType = node;
-            visitForDisplayParts(conditionalType.checkType);
+            Debug.assertNode(node, isConditionalTypeNode);
+            visitForDisplayParts(node.checkType);
             parts.push({ text: " extends " });
-            visitForDisplayParts(conditionalType.extendsType);
+            visitForDisplayParts(node.extendsType);
             parts.push({ text: " ? " });
-            visitForDisplayParts(conditionalType.trueType);
+            visitForDisplayParts(node.trueType);
             parts.push({ text: " : " });
-            visitForDisplayParts(conditionalType.falseType);
+            visitForDisplayParts(node.falseType);
             break;
           case 195 /* InferType */:
+            Debug.assertNode(node, isInferTypeNode);
             parts.push({ text: "infer " });
             visitForDisplayParts(node.typeParameter);
             break;
           case 196 /* ParenthesizedType */:
+            Debug.assertNode(node, isParenthesizedTypeNode);
             parts.push({ text: "(" });
             visitForDisplayParts(node.type);
             parts.push({ text: ")" });
             break;
           case 198 /* TypeOperator */:
-            const typeOperator = node;
-            parts.push({ text: `${tokenToString(typeOperator.operator)} ` });
-            visitForDisplayParts(typeOperator.type);
+            Debug.assertNode(node, isTypeOperatorNode);
+            parts.push({ text: `${tokenToString(node.operator)} ` });
+            visitForDisplayParts(node.type);
             break;
           case 199 /* IndexedAccessType */:
-            const indexedAccess = node;
-            visitForDisplayParts(indexedAccess.objectType);
+            Debug.assertNode(node, isIndexedAccessTypeNode);
+            visitForDisplayParts(node.objectType);
             parts.push({ text: "[" });
-            visitForDisplayParts(indexedAccess.indexType);
+            visitForDisplayParts(node.indexType);
             parts.push({ text: "]" });
             break;
           case 200 /* MappedType */:
-            const mappedType = node;
+            Debug.assertNode(node, isMappedTypeNode);
             parts.push({ text: "{ " });
-            if (mappedType.readonlyToken) {
-              if (mappedType.readonlyToken.kind === 40 /* PlusToken */) {
+            if (node.readonlyToken) {
+              if (node.readonlyToken.kind === 40 /* PlusToken */) {
                 parts.push({ text: "+" });
-              } else if (mappedType.readonlyToken.kind === 41 /* MinusToken */) {
+              } else if (node.readonlyToken.kind === 41 /* MinusToken */) {
                 parts.push({ text: "-" });
               }
               parts.push({ text: "readonly " });
             }
             parts.push({ text: "[" });
-            visitForDisplayParts(mappedType.typeParameter);
-            if (mappedType.nameType) {
+            visitForDisplayParts(node.typeParameter);
+            if (node.nameType) {
               parts.push({ text: " as " });
-              visitForDisplayParts(mappedType.nameType);
+              visitForDisplayParts(node.nameType);
             }
             parts.push({ text: "]" });
-            if (mappedType.questionToken) {
-              if (mappedType.questionToken.kind === 40 /* PlusToken */) {
+            if (node.questionToken) {
+              if (node.questionToken.kind === 40 /* PlusToken */) {
                 parts.push({ text: "+" });
-              } else if (mappedType.questionToken.kind === 41 /* MinusToken */) {
+              } else if (node.questionToken.kind === 41 /* MinusToken */) {
                 parts.push({ text: "-" });
               }
               parts.push({ text: "?" });
             }
             parts.push({ text: ": " });
-            if (mappedType.type) {
-              visitForDisplayParts(mappedType.type);
+            if (node.type) {
+              visitForDisplayParts(node.type);
             }
             parts.push({ text: "; }" });
             break;
           case 201 /* LiteralType */:
+            Debug.assertNode(node, isLiteralTypeNode);
             visitForDisplayParts(node.literal);
             break;
           case 184 /* FunctionType */:
-            const functionType = node;
-            if (functionType.typeParameters) {
-              parts.push({ text: "<" });
-              visitDisplayPartList(functionType.typeParameters, ", ");
-              parts.push({ text: ">" });
-            }
-            parts.push({ text: "(" });
-            visitDisplayPartList(functionType.parameters, ", ");
-            parts.push({ text: ")" });
+            Debug.assertNode(node, isFunctionTypeNode);
+            visitParametersAndTypeParameters(node);
             parts.push({ text: " => " });
-            visitForDisplayParts(functionType.type);
+            visitForDisplayParts(node.type);
             break;
           case 205 /* ImportType */:
-            const importType = node;
-            if (importType.isTypeOf) {
+            Debug.assertNode(node, isImportTypeNode);
+            if (node.isTypeOf) {
               parts.push({ text: "typeof " });
             }
             parts.push({ text: "import(" });
-            visitForDisplayParts(importType.argument);
-            if (importType.assertions) {
+            visitForDisplayParts(node.argument);
+            if (node.assertions) {
               parts.push({ text: ", { assert: " });
-              visitDisplayPartList(importType.assertions.assertClause.elements, ", ");
+              visitDisplayPartList(node.assertions.assertClause.elements, ", ");
               parts.push({ text: " }" });
             }
             parts.push({ text: ")" });
-            if (importType.qualifier) {
+            if (node.qualifier) {
               parts.push({ text: "." });
-              visitForDisplayParts(importType.qualifier);
+              visitForDisplayParts(node.qualifier);
             }
-            if (importType.typeArguments) {
+            if (node.typeArguments) {
               parts.push({ text: "<" });
-              visitDisplayPartList(importType.typeArguments, ", ");
+              visitDisplayPartList(node.typeArguments, ", ");
               parts.push({ text: ">" });
             }
             break;
           case 171 /* PropertySignature */:
-            const propertySignature = node;
-            if (propertySignature.modifiers) {
-              visitDisplayPartList(propertySignature.modifiers, " ");
+            Debug.assertNode(node, isPropertySignature);
+            if ((_a = node.modifiers) == null ? void 0 : _a.length) {
+              visitDisplayPartList(node.modifiers, " ");
+              parts.push({ text: " " });
+            }
+            visitForDisplayParts(node.name);
+            if (node.questionToken) {
+              parts.push({ text: "?" });
+            }
+            if (node.type) {
+              parts.push({ text: ": " });
+              visitForDisplayParts(node.type);
+            }
+            break;
+          case 181 /* IndexSignature */:
+            Debug.assertNode(node, isIndexSignatureDeclaration);
+            parts.push({ text: "[" });
+            visitDisplayPartList(node.parameters, ", ");
+            parts.push({ text: "]" });
+            if (node.type) {
+              parts.push({ text: ": " });
+              visitForDisplayParts(node.type);
             }
-            visitForDisplayParts(propertySignature.name);
-            if (propertySignature.questionToken) {
+            break;
+          case 173 /* MethodSignature */:
+            Debug.assertNode(node, isMethodSignature);
+            if ((_b = node.modifiers) == null ? void 0 : _b.length) {
+              visitDisplayPartList(node.modifiers, " ");
+              parts.push({ text: " " });
+            }
+            visitForDisplayParts(node.name);
+            if (node.questionToken) {
               parts.push({ text: "?" });
             }
-            if (propertySignature.type) {
+            visitParametersAndTypeParameters(node);
+            if (node.type) {
               parts.push({ text: ": " });
-              visitForDisplayParts(propertySignature.type);
+              visitForDisplayParts(node.type);
             }
             break;
+          case 179 /* CallSignature */:
+            Debug.assertNode(node, isCallSignatureDeclaration);
+            visitParametersAndTypeParameters(node);
+            if (node.type) {
+              parts.push({ text: ": " });
+              visitForDisplayParts(node.type);
+            }
+            break;
+          case 207 /* ArrayBindingPattern */:
+            Debug.assertNode(node, isArrayBindingPattern);
+            parts.push({ text: "[" });
+            visitDisplayPartList(node.elements, ", ");
+            parts.push({ text: "]" });
+            break;
+          case 206 /* ObjectBindingPattern */:
+            Debug.assertNode(node, isObjectBindingPattern);
+            parts.push({ text: "{" });
+            if (node.elements.length) {
+              parts.push({ text: " " });
+              visitDisplayPartList(node.elements, ", ");
+              parts.push({ text: " " });
+            }
+            parts.push({ text: "}" });
+            break;
+          case 208 /* BindingElement */:
+            Debug.assertNode(node, isBindingElement);
+            visitForDisplayParts(node.name);
+            break;
+          case 224 /* PrefixUnaryExpression */:
+            Debug.assertNode(node, isPrefixUnaryExpression);
+            parts.push({ text: tokenToString(node.operator) });
+            visitForDisplayParts(node.operand);
+            break;
+          case 203 /* TemplateLiteralType */:
+            Debug.assertNode(node, isTemplateLiteralTypeNode);
+            visitForDisplayParts(node.head);
+            node.templateSpans.forEach(visitForDisplayParts);
+            break;
+          case 16 /* TemplateHead */:
+            Debug.assertNode(node, isTemplateHead);
+            parts.push({ text: getLiteralText2(node) });
+            break;
+          case 204 /* TemplateLiteralTypeSpan */:
+            Debug.assertNode(node, isTemplateLiteralTypeSpan);
+            visitForDisplayParts(node.type);
+            visitForDisplayParts(node.literal);
+            break;
+          case 17 /* TemplateMiddle */:
+            Debug.assertNode(node, isTemplateMiddle);
+            parts.push({ text: getLiteralText2(node) });
+            break;
+          case 18 /* TemplateTail */:
+            Debug.assertNode(node, isTemplateTail);
+            parts.push({ text: getLiteralText2(node) });
+            break;
+          case 197 /* ThisType */:
+            Debug.assertNode(node, isThisTypeNode);
+            parts.push({ text: "this" });
+            break;
           default:
             Debug.failBadSyntaxKind(node);
         }
       }
+      function visitParametersAndTypeParameters(signatureDeclaration) {
+        if (signatureDeclaration.typeParameters) {
+          parts.push({ text: "<" });
+          visitDisplayPartList(signatureDeclaration.typeParameters, ", ");
+          parts.push({ text: ">" });
+        }
+        parts.push({ text: "(" });
+        visitDisplayPartList(signatureDeclaration.parameters, ", ");
+        parts.push({ text: ")" });
+      }
       function visitDisplayPartList(nodes, separator) {
         nodes.forEach((node, index) => {
           if (index > 0) {
@@ -165014,8 +166681,22 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         });
       }
       function getLiteralText2(node) {
-        if (isStringLiteral(node)) {
-          return quotePreference === 0 /* Single */ ? `'${escapeString(node.text, 39 /* singleQuote */)}'` : `"${escapeString(node.text, 34 /* doubleQuote */)}"`;
+        switch (node.kind) {
+          case 11 /* StringLiteral */:
+            return quotePreference === 0 /* Single */ ? `'${escapeString(node.text, 39 /* singleQuote */)}'` : `"${escapeString(node.text, 34 /* doubleQuote */)}"`;
+          case 16 /* TemplateHead */:
+          case 17 /* TemplateMiddle */:
+          case 18 /* TemplateTail */: {
+            const rawText = node.rawText ?? escapeTemplateSubstitution(escapeString(node.text, 96 /* backtick */));
+            switch (node.kind) {
+              case 16 /* TemplateHead */:
+                return "`" + rawText + "${";
+              case 17 /* TemplateMiddle */:
+                return "}" + rawText + "${";
+              case 18 /* TemplateTail */:
+                return "}" + rawText + "`";
+            }
+          }
         }
         return node.text;
       }
@@ -165110,15 +166791,17 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       }
       for (const tag of tags) {
         infos.push({ name: tag.tagName.text, text: getCommentDisplayParts(tag, checker) });
-        if (isJSDocPropertyLikeTag(tag) && tag.isNameFirst && tag.typeExpression && isJSDocTypeLiteral(tag.typeExpression.type)) {
-          forEach(tag.typeExpression.type.jsDocPropertyTags, (propTag) => {
-            infos.push({ name: propTag.tagName.text, text: getCommentDisplayParts(propTag, checker) });
-          });
-        }
+        infos.push(...getJSDocPropertyTagsInfo(tryGetJSDocPropertyTags(tag), checker));
       }
     });
     return infos;
   }
+  function getJSDocPropertyTagsInfo(nodes, checker) {
+    return flatMap(nodes, (propTag) => concatenate([{ name: propTag.tagName.text, text: getCommentDisplayParts(propTag, checker) }], getJSDocPropertyTagsInfo(tryGetJSDocPropertyTags(propTag), checker)));
+  }
+  function tryGetJSDocPropertyTags(node) {
+    return isJSDocPropertyLikeTag(node) && node.isNameFirst && node.typeExpression && isJSDocTypeLiteral(node.typeExpression.type) ? node.typeExpression.type.jsDocPropertyTags : void 0;
+  }
   function getDisplayPartsFromComment(comment, checker) {
     if (typeof comment === "string") {
       return [textPart(comment)];
@@ -165510,14 +167193,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       if (shouldRemove)
         importGroup = removeUnusedImports(importGroup, sourceFile, program);
       if (shouldCombine)
-        importGroup = coalesceImportsWorker(importGroup, comparer, sourceFile);
+        importGroup = coalesceImportsWorker(importGroup, comparer, sourceFile, preferences);
       if (shouldSort)
         importGroup = stableSort(importGroup, (s1, s2) => compareImportsOrRequireStatements(s1, s2, comparer));
       return importGroup;
     };
     topLevelImportGroupDecls.forEach((importGroupDecl) => organizeImportsWorker(importGroupDecl, processImportsOfSameModuleSpecifier));
     if (mode !== "RemoveUnused" /* RemoveUnused */) {
-      getTopLevelExportGroups(sourceFile).forEach((exportGroupDecl) => organizeImportsWorker(exportGroupDecl, (group2) => coalesceExportsWorker(group2, comparer)));
+      getTopLevelExportGroups(sourceFile).forEach((exportGroupDecl) => organizeImportsWorker(exportGroupDecl, (group2) => coalesceExportsWorker(group2, comparer, preferences)));
     }
     for (const ambientModule of sourceFile.statements.filter(isAmbientModule)) {
       if (!ambientModule.body)
@@ -165526,7 +167209,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       ambientModuleImportGroupDecls.forEach((importGroupDecl) => organizeImportsWorker(importGroupDecl, processImportsOfSameModuleSpecifier));
       if (mode !== "RemoveUnused" /* RemoveUnused */) {
         const ambientModuleExportDecls = ambientModule.body.statements.filter(isExportDeclaration);
-        organizeImportsWorker(ambientModuleExportDecls, (group2) => coalesceExportsWorker(group2, comparer));
+        organizeImportsWorker(ambientModuleExportDecls, (group2) => coalesceExportsWorker(group2, comparer, preferences));
       }
     }
     return changeTracker.getChanges();
@@ -165658,92 +167341,106 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
   function getExternalModuleName2(specifier) {
     return specifier !== void 0 && isStringLiteralLike(specifier) ? specifier.text : void 0;
   }
-  function coalesceImports(importGroup, ignoreCase, sourceFile) {
+  function coalesceImports(importGroup, ignoreCase, sourceFile, preferences) {
     const comparer = getOrganizeImportsOrdinalStringComparer(ignoreCase);
-    return coalesceImportsWorker(importGroup, comparer, sourceFile);
+    return coalesceImportsWorker(importGroup, comparer, sourceFile, preferences);
   }
-  function coalesceImportsWorker(importGroup, comparer, sourceFile) {
+  function coalesceImportsWorker(importGroup, comparer, sourceFile, preferences) {
     if (importGroup.length === 0) {
       return importGroup;
     }
-    const { importWithoutClause, typeOnlyImports, regularImports } = getCategorizedImports(importGroup);
-    const coalescedImports = [];
-    if (importWithoutClause) {
-      coalescedImports.push(importWithoutClause);
-    }
-    for (const group2 of [regularImports, typeOnlyImports]) {
-      const isTypeOnly = group2 === typeOnlyImports;
-      const { defaultImports, namespaceImports, namedImports } = group2;
-      if (!isTypeOnly && defaultImports.length === 1 && namespaceImports.length === 1 && namedImports.length === 0) {
-        const defaultImport = defaultImports[0];
-        coalescedImports.push(
-          updateImportDeclarationAndClause(defaultImport, defaultImport.importClause.name, namespaceImports[0].importClause.namedBindings)
-        );
-        continue;
-      }
-      const sortedNamespaceImports = stableSort(namespaceImports, (i1, i2) => comparer(i1.importClause.namedBindings.name.text, i2.importClause.namedBindings.name.text));
-      for (const namespaceImport of sortedNamespaceImports) {
-        coalescedImports.push(
-          updateImportDeclarationAndClause(
-            namespaceImport,
-            /*name*/
-            void 0,
-            namespaceImport.importClause.namedBindings
-          )
-        );
-      }
-      const firstDefaultImport = firstOrUndefined(defaultImports);
-      const firstNamedImport = firstOrUndefined(namedImports);
-      const importDecl = firstDefaultImport ?? firstNamedImport;
-      if (!importDecl) {
-        continue;
+    const importGroupsByAttributes = groupBy(importGroup, (decl) => {
+      if (decl.attributes) {
+        let attrs = decl.attributes.token + " ";
+        for (const x of sort(decl.attributes.elements, (x2, y) => compareStringsCaseSensitive(x2.name.text, y.name.text))) {
+          attrs += x.name.text + ":";
+          attrs += isStringLiteralLike(x.value) ? `"${x.value.text}"` : x.value.getText() + " ";
+        }
+        return attrs;
       }
-      let newDefaultImport;
-      const newImportSpecifiers = [];
-      if (defaultImports.length === 1) {
-        newDefaultImport = defaultImports[0].importClause.name;
-      } else {
-        for (const defaultImport of defaultImports) {
-          newImportSpecifiers.push(
-            factory.createImportSpecifier(
-              /*isTypeOnly*/
-              false,
-              factory.createIdentifier("default"),
-              defaultImport.importClause.name
+      return "";
+    });
+    const coalescedImports = [];
+    for (const attribute in importGroupsByAttributes) {
+      const importGroupSameAttrs = importGroupsByAttributes[attribute];
+      const { importWithoutClause, typeOnlyImports, regularImports } = getCategorizedImports(importGroupSameAttrs);
+      if (importWithoutClause) {
+        coalescedImports.push(importWithoutClause);
+      }
+      for (const group2 of [regularImports, typeOnlyImports]) {
+        const isTypeOnly = group2 === typeOnlyImports;
+        const { defaultImports, namespaceImports, namedImports } = group2;
+        if (!isTypeOnly && defaultImports.length === 1 && namespaceImports.length === 1 && namedImports.length === 0) {
+          const defaultImport = defaultImports[0];
+          coalescedImports.push(
+            updateImportDeclarationAndClause(defaultImport, defaultImport.importClause.name, namespaceImports[0].importClause.namedBindings)
+          );
+          continue;
+        }
+        const sortedNamespaceImports = stableSort(namespaceImports, (i1, i2) => comparer(i1.importClause.namedBindings.name.text, i2.importClause.namedBindings.name.text));
+        for (const namespaceImport of sortedNamespaceImports) {
+          coalescedImports.push(
+            updateImportDeclarationAndClause(
+              namespaceImport,
+              /*name*/
+              void 0,
+              namespaceImport.importClause.namedBindings
             )
           );
         }
-      }
-      newImportSpecifiers.push(...getNewImportSpecifiers(namedImports));
-      const sortedImportSpecifiers = factory.createNodeArray(
-        sortSpecifiers(newImportSpecifiers, comparer),
-        firstNamedImport == null ? void 0 : firstNamedImport.importClause.namedBindings.elements.hasTrailingComma
-      );
-      const newNamedImports = sortedImportSpecifiers.length === 0 ? newDefaultImport ? void 0 : factory.createNamedImports(emptyArray) : firstNamedImport ? factory.updateNamedImports(firstNamedImport.importClause.namedBindings, sortedImportSpecifiers) : factory.createNamedImports(sortedImportSpecifiers);
-      if (sourceFile && newNamedImports && (firstNamedImport == null ? void 0 : firstNamedImport.importClause.namedBindings) && !rangeIsOnSingleLine(firstNamedImport.importClause.namedBindings, sourceFile)) {
-        setEmitFlags(newNamedImports, 2 /* MultiLine */);
-      }
-      if (isTypeOnly && newDefaultImport && newNamedImports) {
-        coalescedImports.push(
-          updateImportDeclarationAndClause(
-            importDecl,
-            newDefaultImport,
-            /*namedBindings*/
-            void 0
-          )
-        );
-        coalescedImports.push(
-          updateImportDeclarationAndClause(
-            firstNamedImport ?? importDecl,
-            /*name*/
-            void 0,
-            newNamedImports
-          )
-        );
-      } else {
-        coalescedImports.push(
-          updateImportDeclarationAndClause(importDecl, newDefaultImport, newNamedImports)
+        const firstDefaultImport = firstOrUndefined(defaultImports);
+        const firstNamedImport = firstOrUndefined(namedImports);
+        const importDecl = firstDefaultImport ?? firstNamedImport;
+        if (!importDecl) {
+          continue;
+        }
+        let newDefaultImport;
+        const newImportSpecifiers = [];
+        if (defaultImports.length === 1) {
+          newDefaultImport = defaultImports[0].importClause.name;
+        } else {
+          for (const defaultImport of defaultImports) {
+            newImportSpecifiers.push(
+              factory.createImportSpecifier(
+                /*isTypeOnly*/
+                false,
+                factory.createIdentifier("default"),
+                defaultImport.importClause.name
+              )
+            );
+          }
+        }
+        newImportSpecifiers.push(...getNewImportSpecifiers(namedImports));
+        const sortedImportSpecifiers = factory.createNodeArray(
+          sortSpecifiers(newImportSpecifiers, comparer, preferences),
+          firstNamedImport == null ? void 0 : firstNamedImport.importClause.namedBindings.elements.hasTrailingComma
         );
+        const newNamedImports = sortedImportSpecifiers.length === 0 ? newDefaultImport ? void 0 : factory.createNamedImports(emptyArray) : firstNamedImport ? factory.updateNamedImports(firstNamedImport.importClause.namedBindings, sortedImportSpecifiers) : factory.createNamedImports(sortedImportSpecifiers);
+        if (sourceFile && newNamedImports && (firstNamedImport == null ? void 0 : firstNamedImport.importClause.namedBindings) && !rangeIsOnSingleLine(firstNamedImport.importClause.namedBindings, sourceFile)) {
+          setEmitFlags(newNamedImports, 2 /* MultiLine */);
+        }
+        if (isTypeOnly && newDefaultImport && newNamedImports) {
+          coalescedImports.push(
+            updateImportDeclarationAndClause(
+              importDecl,
+              newDefaultImport,
+              /*namedBindings*/
+              void 0
+            )
+          );
+          coalescedImports.push(
+            updateImportDeclarationAndClause(
+              firstNamedImport ?? importDecl,
+              /*name*/
+              void 0,
+              newNamedImports
+            )
+          );
+        } else {
+          coalescedImports.push(
+            updateImportDeclarationAndClause(importDecl, newDefaultImport, newNamedImports)
+          );
+        }
       }
     }
     return coalescedImports;
@@ -165776,11 +167473,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       regularImports
     };
   }
-  function coalesceExports(exportGroup, ignoreCase) {
+  function coalesceExports(exportGroup, ignoreCase, preferences) {
     const comparer = getOrganizeImportsOrdinalStringComparer(ignoreCase);
-    return coalesceExportsWorker(exportGroup, comparer);
+    return coalesceExportsWorker(exportGroup, comparer, preferences);
   }
-  function coalesceExportsWorker(exportGroup, comparer) {
+  function coalesceExportsWorker(exportGroup, comparer, preferences) {
     if (exportGroup.length === 0) {
       return exportGroup;
     }
@@ -165795,7 +167492,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       }
       const newExportSpecifiers = [];
       newExportSpecifiers.push(...flatMap(exportGroup2, (i) => i.exportClause && isNamedExports(i.exportClause) ? i.exportClause.elements : emptyArray));
-      const sortedExportSpecifiers = sortSpecifiers(newExportSpecifiers, comparer);
+      const sortedExportSpecifiers = sortSpecifiers(newExportSpecifiers, comparer, preferences);
       const exportDecl = exportGroup2[0];
       coalescedExports.push(
         factory.updateExportDeclaration(
@@ -165839,11 +167536,18 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       importDeclaration.attributes
     );
   }
-  function sortSpecifiers(specifiers, comparer) {
-    return stableSort(specifiers, (s1, s2) => compareImportOrExportSpecifiers(s1, s2, comparer));
+  function sortSpecifiers(specifiers, comparer, preferences) {
+    return stableSort(specifiers, (s1, s2) => compareImportOrExportSpecifiers(s1, s2, comparer, preferences));
   }
-  function compareImportOrExportSpecifiers(s1, s2, comparer) {
-    return compareBooleans(s1.isTypeOnly, s2.isTypeOnly) || comparer(s1.name.text, s2.name.text);
+  function compareImportOrExportSpecifiers(s1, s2, comparer, preferences) {
+    switch (preferences == null ? void 0 : preferences.organizeImportsTypeOrder) {
+      case "first":
+        return compareBooleans(s2.isTypeOnly, s1.isTypeOnly) || comparer(s1.name.text, s2.name.text);
+      case "inline":
+        return comparer(s1.name.text, s2.name.text);
+      default:
+        return compareBooleans(s1.isTypeOnly, s2.isTypeOnly) || comparer(s1.name.text, s2.name.text);
+    }
   }
   function compareModuleSpecifiers2(m1, m2, ignoreCase) {
     const comparer = getOrganizeImportsOrdinalStringComparer(!!ignoreCase);
@@ -165948,8 +167652,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     const index = binarySearch(sortedImports, newImport, identity, (a, b) => compareImportsOrRequireStatements(a, b, comparer));
     return index < 0 ? ~index : index;
   }
-  function getImportSpecifierInsertionIndex(sortedImports, newImport, comparer) {
-    const index = binarySearch(sortedImports, newImport, identity, (s1, s2) => compareImportOrExportSpecifiers(s1, s2, comparer));
+  function getImportSpecifierInsertionIndex(sortedImports, newImport, comparer, preferences) {
+    const index = binarySearch(sortedImports, newImport, identity, (s1, s2) => compareImportOrExportSpecifiers(s1, s2, comparer, preferences));
     return index < 0 ? ~index : index;
   }
   function compareImportsOrRequireStatements(s1, s2, comparer) {
@@ -166078,8 +167782,26 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
         }
       };
       detectImportSpecifierSorting = memoizeCached((specifiers, preferences) => {
-        if (!arrayIsSorted(specifiers, (s1, s2) => compareBooleans(s1.isTypeOnly, s2.isTypeOnly))) {
-          return 0 /* None */;
+        switch (preferences.organizeImportsTypeOrder) {
+          case "first":
+            if (!arrayIsSorted(specifiers, (s1, s2) => compareBooleans(s2.isTypeOnly, s1.isTypeOnly)))
+              return 0 /* None */;
+            break;
+          case "inline":
+            if (!arrayIsSorted(specifiers, (s1, s2) => {
+              const comparer = getStringComparer(
+                /*ignoreCase*/
+                true
+              );
+              return comparer(s1.name.text, s2.name.text);
+            })) {
+              return 0 /* None */;
+            }
+            break;
+          default:
+            if (!arrayIsSorted(specifiers, (s1, s2) => compareBooleans(s1.isTypeOnly, s2.isTypeOnly)))
+              return 0 /* None */;
+            break;
         }
         const collateCaseSensitive = getOrganizeImportsComparer(
           preferences,
@@ -166091,6 +167813,21 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
           /*ignoreCase*/
           true
         );
+        if (preferences.organizeImportsTypeOrder !== "inline") {
+          const { type: regularImports, regular: typeImports } = groupBy(specifiers, (s) => s.isTypeOnly ? "type" : "regular");
+          const regularCaseSensitivity = (regularImports == null ? void 0 : regularImports.length) ? detectSortCaseSensitivity(regularImports, (specifier) => specifier.name.text, collateCaseSensitive, collateCaseInsensitive) : void 0;
+          const typeCaseSensitivity = (typeImports == null ? void 0 : typeImports.length) ? detectSortCaseSensitivity(typeImports, (specifier) => specifier.name.text ?? "", collateCaseSensitive, collateCaseInsensitive) : void 0;
+          if (regularCaseSensitivity === void 0) {
+            return typeCaseSensitivity ?? 0 /* None */;
+          }
+          if (typeCaseSensitivity === void 0) {
+            return regularCaseSensitivity;
+          }
+          if (regularCaseSensitivity === 0 /* None */ || typeCaseSensitivity === 0 /* None */) {
+            return 0 /* None */;
+          }
+          return typeCaseSensitivity & regularCaseSensitivity;
+        }
         return detectSortCaseSensitivity(specifiers, (specifier) => specifier.name.text, collateCaseSensitive, collateCaseInsensitive);
       }, new ImportSpecifierSortingCache());
     }
@@ -166614,16 +168351,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     if (!moduleSourceFile)
       return void 0;
     const withoutIndex = endsWith(node.text, "/index") || endsWith(node.text, "/index.js") ? void 0 : tryRemoveSuffix(removeFileExtension(moduleSourceFile.fileName), "/index");
-    const name = withoutIndex === void 0 ? moduleSourceFile.fileName : withoutIndex;
+    const fileName = withoutIndex === void 0 ? moduleSourceFile.fileName : withoutIndex;
     const kind = withoutIndex === void 0 ? "module" /* moduleElement */ : "directory" /* directory */;
     const indexAfterLastSlash = node.text.lastIndexOf("/") + 1;
     const triggerSpan = createTextSpan(node.getStart(sourceFile) + 1 + indexAfterLastSlash, node.text.length - indexAfterLastSlash);
     return {
       canRename: true,
-      fileToRename: name,
+      fileToRename: fileName,
       kind,
-      displayName: name,
-      fullDisplayName: name,
+      displayName: fileName,
+      fullDisplayName: node.text,
       kindModifiers: "" /* none */,
       triggerSpan
     };
@@ -166795,39 +168532,35 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     }
     return Debug.fail("Could not find preceding token");
   }
-  function getArgumentInfoForCompletions(node, position, sourceFile) {
-    const info = getImmediatelyContainingArgumentInfo(node, position, sourceFile);
+  function getArgumentInfoForCompletions(node, position, sourceFile, checker) {
+    const info = getImmediatelyContainingArgumentInfo(node, position, sourceFile, checker);
     return !info || info.isTypeParameterList || info.invocation.kind !== 0 /* Call */ ? void 0 : { invocation: info.invocation.node, argumentCount: info.argumentCount, argumentIndex: info.argumentIndex };
   }
-  function getArgumentOrParameterListInfo(node, position, sourceFile) {
-    const info = getArgumentOrParameterListAndIndex(node, sourceFile);
+  function getArgumentOrParameterListInfo(node, position, sourceFile, checker) {
+    const info = getArgumentOrParameterListAndIndex(node, sourceFile, checker);
     if (!info)
       return void 0;
     const { list, argumentIndex } = info;
-    const argumentCount = getArgumentCount(
-      list,
-      /*ignoreTrailingComma*/
-      isInString(sourceFile, position, node)
-    );
+    const argumentCount = getArgumentCount(checker, list);
     if (argumentIndex !== 0) {
       Debug.assertLessThan(argumentIndex, argumentCount);
     }
     const argumentsSpan = getApplicableSpanForArguments(list, sourceFile);
     return { list, argumentIndex, argumentCount, argumentsSpan };
   }
-  function getArgumentOrParameterListAndIndex(node, sourceFile) {
+  function getArgumentOrParameterListAndIndex(node, sourceFile, checker) {
     if (node.kind === 30 /* LessThanToken */ || node.kind === 21 /* OpenParenToken */) {
       return { list: getChildListThatStartsWithOpenerToken(node.parent, node, sourceFile), argumentIndex: 0 };
     } else {
       const list = findContainingList(node);
-      return list && { list, argumentIndex: getArgumentIndex(list, node) };
+      return list && { list, argumentIndex: getArgumentIndex(checker, list, node) };
     }
   }
-  function getImmediatelyContainingArgumentInfo(node, position, sourceFile) {
+  function getImmediatelyContainingArgumentInfo(node, position, sourceFile, checker) {
     const { parent: parent2 } = node;
     if (isCallOrNewExpression(parent2)) {
       const invocation = parent2;
-      const info = getArgumentOrParameterListInfo(node, position, sourceFile);
+      const info = getArgumentOrParameterListInfo(node, position, sourceFile, checker);
       if (!info)
         return void 0;
       const { list, argumentIndex, argumentCount, argumentsSpan } = info;
@@ -166885,7 +168618,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
     }
   }
   function getImmediatelyContainingArgumentOrContextualParameterInfo(node, position, sourceFile, checker) {
-    return tryGetParameterInfo(node, position, sourceFile, checker) || getImmediatelyContainingArgumentInfo(node, position, sourceFile);
+    return tryGetParameterInfo(node, position, sourceFile, checker) || getImmediatelyContainingArgumentInfo(node, position, sourceFile, checker);
   }
   function getHighestBinary(b) {
     return isBinaryExpression(b.parent) ? getHighestBinary(b.parent) : b;
@@ -166927,7 +168660,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       case 174 /* MethodDeclaration */:
       case 218 /* FunctionExpression */:
       case 219 /* ArrowFunction */:
-        const info = getArgumentOrParameterListInfo(node, position, sourceFile);
+        const info = getArgumentOrParameterListInfo(node, position, sourceFile, checker);
         if (!info)
           return void 0;
         const { argumentIndex, argumentCount, argumentsSpan } = info;
@@ -166950,25 +168683,60 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
       return isFunctionTypeNode(d) ? (_a = tryCast(d.parent, canHaveSymbol)) == null ? void 0 : _a.symbol : void 0;
     }) || s : s;
   }
-  function getArgumentIndex(argumentsList, node) {
+  function getSpreadElementCount(node, checker) {
+    const spreadType = checker.getTypeAtLocation(node.expression);
+    if (checker.isTupleType(spreadType)) {
+      const { elementFlags, fixedLength } = spreadType.target;
+      if (fixedLength === 0) {
+        return 0;
+      }
+      const firstOptionalIndex = findIndex(elementFlags, (f) => !(f & 1 /* Required */));
+      return firstOptionalIndex < 0 ? fixedLength : firstOptionalIndex;
+    }
+    return 0;
+  }
+  function getArgumentIndex(checker, argumentsList, node) {
+    return getArgumentIndexOrCount(checker, argumentsList, node);
+  }
+  function getArgumentCount(checker, argumentsList) {
+    return getArgumentIndexOrCount(
+      checker,
+      argumentsList,
+      /*node*/
+      void 0
+    );
+  }
+  function getArgumentIndexOrCount(checker, argumentsList, node) {
+    const args = argumentsList.getChildren();
     let argumentIndex = 0;
-    for (const child of argumentsList.getChildren()) {
-      if (child === node) {
-        break;
+    let skipComma = false;
+    for (const child of args) {
+      if (node && child === node) {
+        if (!skipComma && child.kind === 28 /* CommaToken */) {
+          argumentIndex++;
+        }
+        return argumentIndex;
+      }
+      if (isSpreadElement(child)) {
+        argumentIndex += getSpreadElementCount(child, checker);
+        skipComma = true;
+        continue;
       }
       if (child.kind !== 28 /* CommaToken */) {
         argumentIndex++;
+        skipComma = true;
+        continue;
+      }
+      if (skipComma) {
+        skipComma = false;
+        continue;
       }
+      argumentIndex++;
     }
-    return argumentIndex;
-  }
-  function getArgumentCount(argumentsList, ignoreTrailingComma) {
-    const listChildren = argumentsList.getChildren();
-    let argumentCount = countWhere(listChildren, (arg) => arg.kind !== 28 /* CommaToken */);
-    if (!ignoreTrailingComma && listChildren.length > 0 && last(listChildren).kind === 28 /* CommaToken */) {
-      argumentCount++;
+    if (node) {
+      return argumentIndex;
     }
-    return argumentCount;
+    return args.length && last(args).kind === 28 /* CommaToken */ ? argumentIndex + 1 : argumentIndex;
   }
   function getArgumentIndexForTemplatePiece(spanIndex, node, position, sourceFile) {
     Debug.assert(position >= node.getStart(), "Assumed 'position' could not occur before node.");
@@ -169167,7 +170935,7 @@ ${options.prefix}` : "\n" : options.prefix
               const afterMinusOneStartLinePosition = getLineStartPositionForPosition(containingList[index - 1].getStart(sourceFile), sourceFile);
               multilineList = afterMinusOneStartLinePosition !== afterStartLinePosition;
             }
-            if (hasCommentsBeforeLineBreak(sourceFile.text, after.end)) {
+            if (hasCommentsBeforeLineBreak(sourceFile.text, after.end) || !positionsAreOnSameLine(containingList.pos, containingList.end, sourceFile)) {
               multilineList = true;
             }
             if (multilineList) {
@@ -169886,8 +171654,8 @@ ${options.prefix}` : "\n" : options.prefix
     const comments = [2 /* SingleLineCommentTrivia */, 3 /* MultiLineCommentTrivia */];
     const typeNames = [80 /* Identifier */, ...typeKeywords];
     const functionOpenBraceLeftTokenRange = anyTokenIncludingMultilineComments;
-    const typeScriptOpenBraceLeftTokenRange = tokenRangeFrom([80 /* Identifier */, 3 /* MultiLineCommentTrivia */, 86 /* ClassKeyword */, 95 /* ExportKeyword */, 102 /* ImportKeyword */]);
-    const controlOpenBraceLeftTokenRange = tokenRangeFrom([22 /* CloseParenToken */, 3 /* MultiLineCommentTrivia */, 92 /* DoKeyword */, 113 /* TryKeyword */, 98 /* FinallyKeyword */, 93 /* ElseKeyword */]);
+    const typeScriptOpenBraceLeftTokenRange = tokenRangeFrom([80 /* Identifier */, 32 /* GreaterThanToken */, 3 /* MultiLineCommentTrivia */, 86 /* ClassKeyword */, 95 /* ExportKeyword */, 102 /* ImportKeyword */]);
+    const controlOpenBraceLeftTokenRange = tokenRangeFrom([22 /* CloseParenToken */, 3 /* MultiLineCommentTrivia */, 92 /* DoKeyword */, 113 /* TryKeyword */, 98 /* FinallyKeyword */, 93 /* ElseKeyword */, 85 /* CatchKeyword */]);
     const highPriorityCommonRules = [
       // Leave comments alone
       rule("IgnoreBeforeComment", anyToken, comments, anyContext, 1 /* StopProcessingSpaceActions */),
@@ -172420,9 +174188,9 @@ ${options.prefix}` : "\n" : options.prefix
       init_ts5();
       init_deprecate();
       addObjectAllocatorPatcher((objectAllocator2) => {
-        const Identifier78 = objectAllocator2.getIdentifierConstructor();
-        if (!hasProperty(Identifier78.prototype, "originalKeywordKind")) {
-          Object.defineProperty(Identifier78.prototype, "originalKeywordKind", {
+        const Identifier79 = objectAllocator2.getIdentifierConstructor();
+        if (!hasProperty(Identifier79.prototype, "originalKeywordKind")) {
+          Object.defineProperty(Identifier79.prototype, "originalKeywordKind", {
             get: deprecate(function() {
               return identifierToKeywordKind(this);
             }, {
@@ -172434,8 +174202,8 @@ ${options.prefix}` : "\n" : options.prefix
             })
           });
         }
-        if (!hasProperty(Identifier78.prototype, "isInJSDocNamespace")) {
-          Object.defineProperty(Identifier78.prototype, "isInJSDocNamespace", {
+        if (!hasProperty(Identifier79.prototype, "isInJSDocNamespace")) {
+          Object.defineProperty(Identifier79.prototype, "isInJSDocNamespace", {
             get: deprecate(function() {
               return this.flags & 4096 /* IdentifierIsInJSDocNamespace */ ? true : void 0;
             }, {
@@ -172540,6 +174308,32 @@ ${options.prefix}` : "\n" : options.prefix
           }
           this.processCacheLocation(this.globalCachePath);
         }
+        /** @internal */
+        handleRequest(req) {
+          switch (req.kind) {
+            case "discover":
+              this.install(req);
+              break;
+            case "closeProject":
+              this.closeProject(req);
+              break;
+            case "typesRegistry": {
+              const typesRegistry = {};
+              this.typesRegistry.forEach((value, key) => {
+                typesRegistry[key] = value;
+              });
+              const response = { kind: EventTypesRegistry, typesRegistry };
+              this.sendResponse(response);
+              break;
+            }
+            case "installPackage": {
+              this.installPackage(req);
+              break;
+            }
+            default:
+              Debug.assertNever(req);
+          }
+        }
         closeProject(req) {
           this.closeWatchers(req.projectName);
         }
@@ -172595,6 +174389,37 @@ ${options.prefix}` : "\n" : options.prefix
             }
           }
         }
+        /** @internal */
+        installPackage(req) {
+          const { fileName, packageName, projectName, projectRootPath, id } = req;
+          const cwd = forEachAncestorDirectory(getDirectoryPath(fileName), (directory) => {
+            if (this.installTypingHost.fileExists(combinePaths(directory, "package.json"))) {
+              return directory;
+            }
+          }) || projectRootPath;
+          if (cwd) {
+            this.installWorker(-1, [packageName], cwd, (success) => {
+              const message = success ? `Package ${packageName} installed.` : `There was an error installing ${packageName}.`;
+              const response = {
+                kind: ActionPackageInstalled,
+                projectName,
+                id,
+                success,
+                message
+              };
+              this.sendResponse(response);
+            });
+          } else {
+            const response = {
+              kind: ActionPackageInstalled,
+              projectName,
+              id,
+              success: false,
+              message: "Could not determine a project root path."
+            };
+            this.sendResponse(response);
+          }
+        }
         initializeSafeList() {
           if (this.typesMapLocation) {
             const safeListFromMap = ts_JsTyping_exports.loadTypesMap(this.installTypingHost, this.typesMapLocation);
@@ -173230,11 +175055,18 @@ ${options.prefix}` : "\n" : options.prefix
         ModuleKind3["ES6"] = "ES6";
         ModuleKind3["ES2015"] = "ES2015";
         ModuleKind3["ESNext"] = "ESNext";
+        ModuleKind3["Node16"] = "Node16";
+        ModuleKind3["NodeNext"] = "NodeNext";
+        ModuleKind3["Preserve"] = "Preserve";
         return ModuleKind3;
       })(ModuleKind2 || {});
       ModuleResolutionKind2 = /* @__PURE__ */ ((ModuleResolutionKind3) => {
         ModuleResolutionKind3["Classic"] = "Classic";
         ModuleResolutionKind3["Node"] = "Node";
+        ModuleResolutionKind3["Node10"] = "Node10";
+        ModuleResolutionKind3["Node16"] = "Node16";
+        ModuleResolutionKind3["NodeNext"] = "NodeNext";
+        ModuleResolutionKind3["Bundler"] = "Bundler";
         return ModuleResolutionKind3;
       })(ModuleResolutionKind2 || {});
       NewLineKind2 = /* @__PURE__ */ ((NewLineKind3) => {
@@ -173660,7 +175492,7 @@ ${options.prefix}` : "\n" : options.prefix
               }
               break;
             default:
-              if (unorderedRemoveItem(this.containingProjects, project)) {
+              if (orderedRemoveItem(this.containingProjects, project)) {
                 project.onFileAddedOrRemoved(this.isSymlink());
               }
               break;
@@ -173909,8 +175741,9 @@ ${options.prefix}` : "\n" : options.prefix
           return !typeAcquisition || !typeAcquisition.enable ? emptyArray2 : typings;
         }
         onProjectClosed(project) {
-          this.perProjectCache.delete(project.getProjectName());
-          this.installer.onProjectClosed(project);
+          if (this.perProjectCache.delete(project.getProjectName())) {
+            this.installer.onProjectClosed(project);
+          }
         }
       };
     }
@@ -174023,7 +175856,6 @@ ${options.prefix}` : "\n" : options.prefix
   var init_project = __esm({
     "src/server/project.ts"() {
       "use strict";
-      init_pnp();
       init_ts7();
       init_ts7();
       init_ts_server3();
@@ -174067,6 +175899,7 @@ ${options.prefix}` : "\n" : options.prefix
           /**
            * Current project's program version. (incremented everytime new program is created that is not complete reuse from the old one)
            * This property is changed in 'updateGraph' based on the set of files in program
+           * @internal
            */
           this.projectProgramVersion = 0;
           /**
@@ -174074,6 +175907,7 @@ ${options.prefix}` : "\n" : options.prefix
            * - new root file was added/removed
            * - edit happen in some file that is currently included in the project.
            * This property is different from projectStructureVersion since in most cases edits don't affect set of files in the project
+           * @internal
            */
           this.projectStateVersion = 0;
           this.isInitialLoadPending = returnFalse;
@@ -174087,6 +175921,8 @@ ${options.prefix}` : "\n" : options.prefix
           this.createHash = maybeBind(this.projectService.host, this.projectService.host.createHash);
           /** @internal */
           this.globalCacheResolutionModuleName = ts_JsTyping_exports.nonRelativeModuleNameForTypingCache;
+          /** @internal */
+          this.updateFromProjectInProgress = false;
           this.projectName = projectName;
           this.directoryStructureHost = directoryStructureHost;
           this.currentDirectory = this.projectService.getNormalizedAbsolutePath(currentDirectory);
@@ -174601,6 +176437,7 @@ ${options.prefix}` : "\n" : options.prefix
           return path === options.configFilePath ? options.configFile : this.getSourceFile(path);
         }
         close() {
+          var _a;
           this.projectService.typingsCache.onProjectClosed(this);
           this.closeWatchingTypingLocations();
           this.cleanupProgram();
@@ -174617,6 +176454,12 @@ ${options.prefix}` : "\n" : options.prefix
           this.resolutionCache.clear();
           this.resolutionCache = void 0;
           this.cachedUnresolvedImportsPerFile = void 0;
+          (_a = this.packageJsonWatches) == null ? void 0 : _a.forEach((watcher) => {
+            watcher.projects.delete(this);
+            watcher.close();
+          });
+          this.packageJsonWatches = void 0;
+          this.moduleSpecifierCache.clear();
           this.moduleSpecifierCache = void 0;
           this.directoryStructureHost = void 0;
           this.exportMapCache = void 0;
@@ -174811,13 +176654,10 @@ ${options.prefix}` : "\n" : options.prefix
           }
         }
         /** @internal */
-        onPackageJsonChange(packageJsonPath) {
-          var _a;
-          if ((_a = this.packageJsonsForAutoImport) == null ? void 0 : _a.has(packageJsonPath)) {
-            this.moduleSpecifierCache.clear();
-            if (this.autoImportProviderHost) {
-              this.autoImportProviderHost.markAsDirty();
-            }
+        onPackageJsonChange() {
+          this.moduleSpecifierCache.clear();
+          if (this.autoImportProviderHost) {
+            this.autoImportProviderHost.markAsDirty();
           }
         }
         /** @internal */
@@ -174831,6 +176671,10 @@ ${options.prefix}` : "\n" : options.prefix
         onDiscoveredSymlink() {
           this.hasAddedOrRemovedSymlinks = true;
         }
+        /** @internal */
+        updateFromProject() {
+          updateProjectIfDirty(this);
+        }
         /**
          * Updates set of files that contribute to this project
          * @returns: true if set of files in the project stays the same and false - otherwise.
@@ -174848,7 +176692,7 @@ ${options.prefix}` : "\n" : options.prefix
           for (const file of changedFiles) {
             this.cachedUnresolvedImportsPerFile.delete(file);
           }
-          if (this.languageServiceEnabled && this.projectService.serverMode === 0 /* Semantic */) {
+          if (this.languageServiceEnabled && this.projectService.serverMode === 0 /* Semantic */ && !this.isOrphan()) {
             if (hasNewProgram || changedFiles.length) {
               this.lastCachedUnresolvedImportsList = getUnresolvedImports(this.program, this.cachedUnresolvedImportsPerFile);
             }
@@ -174989,8 +176833,10 @@ ${options.prefix}` : "\n" : options.prefix
           this.hasInvalidatedResolutions = hasInvalidatedResolutions;
           this.hasInvalidatedLibResolutions = hasInvalidatedLibResolutions;
           this.resolutionCache.startCachingPerDirectoryResolution();
-          this.program = this.languageService.getProgram();
           this.dirty = false;
+          this.updateFromProjectInProgress = true;
+          this.program = this.languageService.getProgram();
+          this.updateFromProjectInProgress = false;
           (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "finishCachingPerDirectoryResolution");
           this.resolutionCache.finishCachingPerDirectoryResolution(this.program, oldProgram);
           (_b = tracing) == null ? void 0 : _b.pop();
@@ -175026,7 +176872,7 @@ ${options.prefix}` : "\n" : options.prefix
               this.program,
               this.missingFilesMap || (this.missingFilesMap = /* @__PURE__ */ new Map()),
               // Watch the missing files
-              (missingFilePath) => this.addMissingFileWatcher(missingFilePath)
+              (missingFilePath, missingFileName) => this.addMissingFileWatcher(missingFilePath, missingFileName)
             );
             if (this.generatedFilesMap) {
               const outPath = outFile(this.compilerOptions);
@@ -175099,7 +176945,7 @@ ${options.prefix}` : "\n" : options.prefix
           );
           const elapsed = timestamp() - start;
           this.sendPerformanceEvent("UpdateGraph", elapsed);
-          this.writeLog(`Finishing updateGraphWorker: Project: ${this.getProjectName()} Version: ${this.getProjectVersion()} structureChanged: ${hasNewProgram}${this.program ? ` structureIsReused:: ${StructureIsReused[this.program.structureIsReused]}` : ""} Elapsed: ${elapsed}ms`);
+          this.writeLog(`Finishing updateGraphWorker: Project: ${this.getProjectName()} projectStateVersion: ${this.projectStateVersion} projectProgramVersion: ${this.projectProgramVersion} structureChanged: ${hasNewProgram}${this.program ? ` structureIsReused:: ${StructureIsReused[this.program.structureIsReused]}` : ""} Elapsed: ${elapsed}ms`);
           if (this.projectService.logger.isTestLogger) {
             if (this.program !== oldProgram) {
               this.print(
@@ -175140,7 +176986,7 @@ ${options.prefix}` : "\n" : options.prefix
             }
           }
         }
-        addMissingFileWatcher(missingFilePath) {
+        addMissingFileWatcher(missingFilePath, missingFileName) {
           var _a;
           if (isConfiguredProject(this)) {
             const configFileExistenceInfo = this.projectService.configFileExistenceInfoCache.get(missingFilePath);
@@ -175148,7 +176994,7 @@ ${options.prefix}` : "\n" : options.prefix
               return noopFileWatcher;
           }
           const fileWatcher = this.projectService.watchFactory.watchFile(
-            missingFilePath,
+            getNormalizedAbsolutePath(missingFileName, this.currentDirectory),
             (fileName, eventKind) => {
               if (isConfiguredProject(this)) {
                 this.getCachedDirectoryStructureHost().addOrDeleteFile(fileName, missingFilePath, eventKind);
@@ -175262,6 +177108,7 @@ ${options.prefix}` : "\n" : options.prefix
         }
         /** @internal */
         print(writeProjectFileNames, writeFileExplaination, writeFileVersionAndText) {
+          var _a;
           this.writeLog(`Project '${this.projectName}' (${ProjectKind[this.projectKind]})`);
           this.writeLog(this.filesToStringWorker(
             writeProjectFileNames && this.projectService.logger.hasLevel(3 /* verbose */),
@@ -175279,6 +177126,14 @@ ${options.prefix}` : "\n" : options.prefix
               false
             );
           }
+          (_a = this.noDtsResolutionProject) == null ? void 0 : _a.print(
+            /*writeProjectFileNames*/
+            false,
+            /*writeFileExplaination*/
+            false,
+            /*writeFileVersionAndText*/
+            false
+          );
         }
         setCompilerOptions(compilerOptions) {
           var _a;
@@ -175485,7 +177340,7 @@ ${options.prefix}` : "\n" : options.prefix
         getPackageJsonsVisibleToFile(fileName, rootDir) {
           if (this.projectService.serverMode !== 0 /* Semantic */)
             return emptyArray2;
-          return this.projectService.getPackageJsonsVisibleToFile(fileName, rootDir);
+          return this.projectService.getPackageJsonsVisibleToFile(fileName, this, rootDir);
         }
         /** @internal */
         getNearestAncestorDirectoryWithPackageJson(fileName) {
@@ -175493,9 +177348,7 @@ ${options.prefix}` : "\n" : options.prefix
         }
         /** @internal */
         getPackageJsonsForAutoImport(rootDir) {
-          const packageJsons = this.getPackageJsonsVisibleToFile(combinePaths(this.currentDirectory, inferredTypesContainingFile), rootDir);
-          this.packageJsonsForAutoImport = new Set(packageJsons.map((p) => p.fileName));
-          return packageJsons;
+          return this.getPackageJsonsVisibleToFile(combinePaths(this.currentDirectory, inferredTypesContainingFile), rootDir);
         }
         /** @internal */
         getPackageJsonCache() {
@@ -175581,7 +177434,7 @@ ${options.prefix}` : "\n" : options.prefix
         }
         /** @internal */
         watchNodeModulesForPackageJsonChanges(directoryPath) {
-          return this.projectService.watchPackageJsonsInNodeModules(this.toPath(directoryPath), this);
+          return this.projectService.watchPackageJsonsInNodeModules(directoryPath, this);
         }
         /** @internal */
         getIncompleteCompletionsCache() {
@@ -176085,29 +177938,6 @@ ${options.prefix}` : "\n" : options.prefix
           return this.projectReferences;
         }
         updateReferences(refs) {
-          if (typeof process.versions.pnp !== `undefined`) {
-            const basePath = this.getCurrentDirectory();
-            const getPnpPath = (path) => {
-              try {
-                const pnpApi = getPnpApi(`${path}/`);
-                if (!pnpApi) {
-                  return path;
-                }
-                const targetLocator = pnpApi.findPackageLocator(`${path}/`);
-                const { packageLocation } = pnpApi.getPackageInformation(targetLocator);
-                const request = combinePaths(targetLocator.name, getRelativePathFromDirectory(
-                  packageLocation,
-                  path,
-                  /*ignoreCase*/
-                  false
-                ));
-                return pnpApi.resolveToUnqualified(request, `${basePath}/`);
-              } catch {
-                return path;
-              }
-            };
-            refs = refs == null ? void 0 : refs.map((r) => ({ ...r, path: getPnpPath(r.path) }));
-          }
           this.projectReferences = refs;
           this.potentialProjectReferences = void 0;
         }
@@ -176343,7 +178173,7 @@ ${options.prefix}` : "\n" : options.prefix
     }
   }
   function convertUserPreferences(preferences) {
-    const { lazyConfiguredProjectsFromExternalProject, ...userPreferences } = preferences;
+    const { lazyConfiguredProjectsFromExternalProject: _, ...userPreferences } = preferences;
     return userPreferences;
   }
   function findProjectByName(projectName, projects) {
@@ -176494,7 +178324,16 @@ ${options.prefix}` : "\n" : options.prefix
         recursive ? watchedDirectoriesRecursive : watchedDirectories,
         path,
         callback,
-        (id) => ({ eventName: CreateDirectoryWatcherEvent, data: { id, path, recursive: !!recursive } })
+        (id) => ({
+          eventName: CreateDirectoryWatcherEvent,
+          data: {
+            id,
+            path,
+            recursive: !!recursive,
+            // Special case node_modules as we watch it for changes to closed script infos as well
+            ignoreUpdate: !path.endsWith("/node_modules") ? true : void 0
+          }
+        })
       );
     }
     function getOrCreateFileWatcher({ pathToId, idToCallbacks }, path, callback, event) {
@@ -176521,24 +178360,28 @@ ${options.prefix}` : "\n" : options.prefix
         }
       };
     }
-    function onWatchChange({ id, path, eventType }) {
-      onFileWatcherCallback(id, path, eventType);
-      onDirectoryWatcherCallback(watchedDirectories, id, path, eventType);
-      onDirectoryWatcherCallback(watchedDirectoriesRecursive, id, path, eventType);
+    function onWatchChange(args) {
+      if (isArray(args))
+        args.forEach(onWatchChangeRequestArgs);
+      else
+        onWatchChangeRequestArgs(args);
     }
-    function onFileWatcherCallback(id, eventPath, eventType) {
-      var _a;
-      (_a = watchedFiles.idToCallbacks.get(id)) == null ? void 0 : _a.forEach((callback) => {
-        const eventKind = eventType === "create" ? 0 /* Created */ : eventType === "delete" ? 2 /* Deleted */ : 1 /* Changed */;
-        callback(eventPath, eventKind);
-      });
+    function onWatchChangeRequestArgs({ id, created, deleted, updated }) {
+      onWatchEventType(id, created, 0 /* Created */);
+      onWatchEventType(id, deleted, 2 /* Deleted */);
+      onWatchEventType(id, updated, 1 /* Changed */);
     }
-    function onDirectoryWatcherCallback({ idToCallbacks }, id, eventPath, eventType) {
-      var _a;
-      if (eventType === "update")
+    function onWatchEventType(id, paths, eventKind) {
+      if (!(paths == null ? void 0 : paths.length))
         return;
-      (_a = idToCallbacks.get(id)) == null ? void 0 : _a.forEach((callback) => {
-        callback(eventPath);
+      forEachCallback(watchedFiles, id, paths, (callback, eventPath) => callback(eventPath, eventKind));
+      forEachCallback(watchedDirectories, id, paths, (callback, eventPath) => callback(eventPath));
+      forEachCallback(watchedDirectoriesRecursive, id, paths, (callback, eventPath) => callback(eventPath));
+    }
+    function forEachCallback(hostWatcherMap, id, eventPaths, cb) {
+      var _a;
+      (_a = hostWatcherMap.idToCallbacks.get(id)) == null ? void 0 : _a.forEach((callback) => {
+        eventPaths.forEach((eventPath) => cb(callback, normalizeSlashes(eventPath)));
       });
     }
   }
@@ -176573,7 +178416,6 @@ ${options.prefix}` : "\n" : options.prefix
   var init_editorServices = __esm({
     "src/server/editorServices.ts"() {
       "use strict";
-      init_pnp();
       init_ts7();
       init_ts_server3();
       init_protocol();
@@ -176744,6 +178586,8 @@ ${options.prefix}` : "\n" : options.prefix
           /** @internal */
           this.extendedConfigCache = /* @__PURE__ */ new Map();
           /** @internal */
+          this.baseline = noop;
+          /** @internal */
           this.verifyDocumentRegistry = noop;
           /** @internal */
           this.verifyProgram = noop;
@@ -176803,7 +178647,6 @@ ${options.prefix}` : "\n" : options.prefix
             log,
             getDetailWatchInfo
           );
-          this.pnpWatcher = this.watchPnpFile();
           (_a = opts.incrementalVerifier) == null ? void 0 : _a.call(opts, this);
         }
         toPath(fileName) {
@@ -177181,18 +179024,20 @@ ${options.prefix}` : "\n" : options.prefix
          * @internal
          */
         watchWildcardDirectory(directory, flags, configFileName, config) {
-          return this.watchFactory.watchDirectory(
+          let watcher = this.watchFactory.watchDirectory(
             directory,
             (fileOrDirectory) => {
               const fileOrDirectoryPath = this.toPath(fileOrDirectory);
               const fsResult = config.cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
-              if (getBaseFileName(fileOrDirectoryPath) === "package.json" && !isInsideNodeModules(fileOrDirectoryPath) && (fsResult && fsResult.fileExists || !fsResult && this.host.fileExists(fileOrDirectoryPath))) {
-                this.logger.info(`Config: ${configFileName} Detected new package.json: ${fileOrDirectory}`);
-                this.onAddPackageJson(fileOrDirectoryPath);
+              if (getBaseFileName(fileOrDirectoryPath) === "package.json" && !isInsideNodeModules(fileOrDirectoryPath) && (fsResult && fsResult.fileExists || !fsResult && this.host.fileExists(fileOrDirectory))) {
+                const file = this.getNormalizedAbsolutePath(fileOrDirectory);
+                this.logger.info(`Config: ${configFileName} Detected new package.json: ${file}`);
+                this.packageJsonCache.addOrUpdate(file, fileOrDirectoryPath);
+                this.watchPackageJsonFile(file, fileOrDirectoryPath, result);
               }
               const configuredProjectForConfig = this.findConfiguredProjectByProjectName(configFileName);
               if (isIgnoredFileFromWildCardWatching({
-                watchedDirPath: directory,
+                watchedDirPath: this.toPath(directory),
                 fileOrDirectory,
                 fileOrDirectoryPath,
                 configFileName,
@@ -177237,6 +179082,22 @@ ${options.prefix}` : "\n" : options.prefix
             WatchType.WildcardDirectory,
             configFileName
           );
+          const result = {
+            packageJsonWatches: void 0,
+            close() {
+              var _a;
+              if (watcher) {
+                watcher.close();
+                watcher = void 0;
+                (_a = result.packageJsonWatches) == null ? void 0 : _a.forEach((watcher2) => {
+                  watcher2.projects.delete(result);
+                  watcher2.close();
+                });
+                result.packageJsonWatches = void 0;
+              }
+            }
+          };
+          return result;
         }
         /** @internal */
         delayUpdateProjectsFromParsedConfigOnConfigFileChange(canonicalConfigFilePath, loadReason) {
@@ -177353,7 +179214,7 @@ ${options.prefix}` : "\n" : options.prefix
           );
           project.addRoot(info);
           if (info.containingProjects[0] !== project) {
-            info.detachFromProject(project);
+            orderedRemoveItem(info.containingProjects, project);
             info.containingProjects.unshift(project);
           }
           project.updateGraph();
@@ -177648,8 +179509,7 @@ ${options.prefix}` : "\n" : options.prefix
          * otherwise just file name
          */
         getConfigFileNameForFile(info) {
-          if (isOpenScriptInfo(info)) {
-            Debug.assert(info.isScriptOpen());
+          if (!isAncestorConfigFileInfo(info)) {
             const result = this.configFileForOpenFiles.get(info.path);
             if (result !== void 0)
               return result || void 0;
@@ -177981,7 +179841,7 @@ ${options.prefix}` : "\n" : options.prefix
             config.watchedDirectoriesStale = false;
             updateWatchingWildcardDirectories(
               config.watchedDirectories || (config.watchedDirectories = /* @__PURE__ */ new Map()),
-              new Map(Object.entries(config.parsedCommandLine.wildcardDirectories)),
+              config.parsedCommandLine.wildcardDirectories,
               // Create new directory watcher
               (directory, flags) => this.watchWildcardDirectory(directory, flags, configFileName, config)
             );
@@ -178063,7 +179923,7 @@ ${options.prefix}` : "\n" : options.prefix
                 if (value.info) {
                   project.removeFile(
                     value.info,
-                    project.fileExists(path),
+                    project.fileExists(value.info.fileName),
                     /*detachFromProject*/
                     true
                   );
@@ -178295,7 +180155,7 @@ All files are: ${JSON.stringify(names)}`, "Err" /* Err */);
         watchClosedScriptInfo(info) {
           Debug.assert(!info.fileWatcher);
           if (!info.isDynamicOrHasMixedContent() && (!this.globalCacheLocationDirectoryPath || !startsWith(info.path, this.globalCacheLocationDirectoryPath))) {
-            const indexOfNodeModules = info.path.indexOf("/node_modules/");
+            const indexOfNodeModules = info.fileName.indexOf("/node_modules/");
             if (!this.host.getModifiedTime || indexOfNodeModules === -1) {
               info.fileWatcher = this.watchFactory.watchFile(
                 info.fileName,
@@ -178306,12 +180166,12 @@ All files are: ${JSON.stringify(names)}`, "Err" /* Err */);
               );
             } else {
               info.mTime = this.getModifiedTime(info);
-              info.fileWatcher = this.watchClosedScriptInfoInNodeModules(info.path.substr(0, indexOfNodeModules));
+              info.fileWatcher = this.watchClosedScriptInfoInNodeModules(info.fileName.substring(0, indexOfNodeModules));
             }
           }
         }
-        createNodeModulesWatcher(dir) {
-          const watcher = this.watchFactory.watchDirectory(
+        createNodeModulesWatcher(dir, dirPath) {
+          let watcher = this.watchFactory.watchDirectory(
             dir,
             (fileOrDirectory) => {
               var _a;
@@ -178320,14 +180180,14 @@ All files are: ${JSON.stringify(names)}`, "Err" /* Err */);
                 return;
               const basename = getBaseFileName(fileOrDirectoryPath);
               if (((_a = result.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a.size) && (basename === "package.json" || basename === "node_modules")) {
-                result.affectedModuleSpecifierCacheProjects.forEach((projectName) => {
-                  var _a2, _b;
-                  (_b = (_a2 = this.findProject(projectName)) == null ? void 0 : _a2.getModuleSpecifierCache()) == null ? void 0 : _b.clear();
+                result.affectedModuleSpecifierCacheProjects.forEach((project) => {
+                  var _a2;
+                  (_a2 = project.getModuleSpecifierCache()) == null ? void 0 : _a2.clear();
                 });
               }
               if (result.refreshScriptInfoRefCount) {
-                if (dir === fileOrDirectoryPath) {
-                  this.refreshScriptInfosInDirectory(dir);
+                if (dirPath === fileOrDirectoryPath) {
+                  this.refreshScriptInfosInDirectory(dirPath);
                 } else {
                   const info = this.getScriptInfoForPath(fileOrDirectoryPath);
                   if (info) {
@@ -178349,30 +180209,35 @@ All files are: ${JSON.stringify(names)}`, "Err" /* Err */);
             affectedModuleSpecifierCacheProjects: void 0,
             close: () => {
               var _a;
-              if (!result.refreshScriptInfoRefCount && !((_a = result.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a.size)) {
+              if (watcher && !result.refreshScriptInfoRefCount && !((_a = result.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a.size)) {
                 watcher.close();
-                this.nodeModulesWatchers.delete(dir);
+                watcher = void 0;
+                this.nodeModulesWatchers.delete(dirPath);
               }
             }
           };
-          this.nodeModulesWatchers.set(dir, result);
+          this.nodeModulesWatchers.set(dirPath, result);
           return result;
         }
         /** @internal */
         watchPackageJsonsInNodeModules(dir, project) {
-          const watcher = this.nodeModulesWatchers.get(dir) || this.createNodeModulesWatcher(dir);
-          (watcher.affectedModuleSpecifierCacheProjects || (watcher.affectedModuleSpecifierCacheProjects = /* @__PURE__ */ new Set())).add(project.getProjectName());
+          var _a;
+          const dirPath = this.toPath(dir);
+          const watcher = this.nodeModulesWatchers.get(dirPath) || this.createNodeModulesWatcher(dir, dirPath);
+          Debug.assert(!((_a = watcher.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a.has(project)));
+          (watcher.affectedModuleSpecifierCacheProjects || (watcher.affectedModuleSpecifierCacheProjects = /* @__PURE__ */ new Set())).add(project);
           return {
             close: () => {
-              var _a;
-              (_a = watcher.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a.delete(project.getProjectName());
+              var _a2;
+              (_a2 = watcher.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a2.delete(project);
               watcher.close();
             }
           };
         }
         watchClosedScriptInfoInNodeModules(dir) {
           const watchDir = dir + "/node_modules";
-          const watcher = this.nodeModulesWatchers.get(watchDir) || this.createNodeModulesWatcher(watchDir);
+          const watchDirPath = this.toPath(watchDir);
+          const watcher = this.nodeModulesWatchers.get(watchDirPath) || this.createNodeModulesWatcher(watchDir, watchDirPath);
           watcher.refreshScriptInfoRefCount++;
           return {
             close: () => {
@@ -178382,7 +180247,7 @@ All files are: ${JSON.stringify(names)}`, "Err" /* Err */);
           };
         }
         getModifiedTime(info) {
-          return (this.host.getModifiedTime(info.path) || missingFileModifiedTime).getTime();
+          return (this.host.getModifiedTime(info.fileName) || missingFileModifiedTime).getTime();
         }
         refreshScriptInfo(info) {
           const mTime = this.getModifiedTime(info);
@@ -178616,7 +180481,7 @@ Dynamic files must always be opened with service's current directory or service
           this.performanceEventHandler = performanceEventHandler;
         }
         setHostConfiguration(args) {
-          var _a, _b;
+          var _a;
           if (args.file) {
             const info = this.getScriptInfoForNormalizedPath(toNormalizedPath(args.file));
             if (info) {
@@ -178639,17 +180504,18 @@ Dynamic files must always be opened with service's current directory or service
               } = this.hostConfiguration.preferences;
               this.hostConfiguration.preferences = { ...this.hostConfiguration.preferences, ...args.preferences };
               if (lazyConfiguredProjectsFromExternalProject && !this.hostConfiguration.preferences.lazyConfiguredProjectsFromExternalProject) {
-                this.configuredProjects.forEach((project) => {
-                  if (project.hasExternalProjectRef() && project.pendingUpdateLevel === 2 /* Full */ && !this.pendingProjectUpdates.has(project.getProjectName())) {
-                    project.updateGraph();
-                  }
-                });
+                this.externalProjectToConfiguredProjectMap.forEach(
+                  (projects) => projects.forEach((project) => {
+                    if (!project.isClosed() && project.hasExternalProjectRef() && project.pendingUpdateLevel === 2 /* Full */ && !this.pendingProjectUpdates.has(project.getProjectName())) {
+                      project.updateGraph();
+                    }
+                  })
+                );
               }
               if (includePackageJsonAutoImports !== args.preferences.includePackageJsonAutoImports) {
-                this.invalidateProjectPackageJson(
-                  /*packageJsonPath*/
-                  void 0
-                );
+                this.forEachProject((project) => {
+                  project.onAutoImportProviderSettingsChanged();
+                });
               }
             }
             if (args.extraFileExtensions) {
@@ -178660,8 +180526,6 @@ Dynamic files must always be opened with service's current directory or service
             if (args.watchOptions) {
               this.hostConfiguration.watchOptions = (_a = convertWatchOptions(args.watchOptions)) == null ? void 0 : _a.watchOptions;
               this.logger.info(`Host watch options changed to ${JSON.stringify(this.hostConfiguration.watchOptions)}, it will be take effect for next watches.`);
-              (_b = this.pnpWatcher) == null ? void 0 : _b.close();
-              this.watchPnpFile();
             }
           }
         }
@@ -178714,6 +180578,8 @@ Dynamic files must always be opened with service's current directory or service
           });
           this.inferredProjects.forEach((project) => this.clearSemanticCache(project));
           this.ensureProjectForOpenFiles();
+          this.logger.info("After reloading projects..");
+          this.printProjects();
         }
         /**
          * This function goes through all the openFiles and tries to file the config file for them.
@@ -179229,23 +181095,20 @@ Dynamic files must always be opened with service's current directory or service
             scriptInfo.editContent(change.span.start, change.span.start + change.span.length, change.newText);
           }
         }
-        closeConfiguredProjectReferencedFromExternalProject(configFile) {
-          const configuredProject = this.findConfiguredProjectByProjectName(configFile);
-          if (configuredProject) {
-            configuredProject.deleteExternalProjectReference();
-            if (!configuredProject.hasOpenRef()) {
-              this.removeProject(configuredProject);
-              return;
+        closeConfiguredProjectReferencedFromExternalProject(configuredProjects) {
+          configuredProjects == null ? void 0 : configuredProjects.forEach((configuredProject) => {
+            if (!configuredProject.isClosed()) {
+              configuredProject.deleteExternalProjectReference();
+              if (!configuredProject.hasOpenRef())
+                this.removeProject(configuredProject);
             }
-          }
+          });
         }
-        closeExternalProject(uncheckedFileName) {
+        closeExternalProject(uncheckedFileName, print) {
           const fileName = toNormalizedPath(uncheckedFileName);
-          const configFiles = this.externalProjectToConfiguredProjectMap.get(fileName);
-          if (configFiles) {
-            for (const configFile of configFiles) {
-              this.closeConfiguredProjectReferencedFromExternalProject(configFile);
-            }
+          const configuredProjects = this.externalProjectToConfiguredProjectMap.get(fileName);
+          if (configuredProjects) {
+            this.closeConfiguredProjectReferencedFromExternalProject(configuredProjects);
             this.externalProjectToConfiguredProjectMap.delete(fileName);
           } else {
             const externalProject = this.findExternalProjectByProjectName(uncheckedFileName);
@@ -179253,6 +181116,8 @@ Dynamic files must always be opened with service's current directory or service
               this.removeProject(externalProject);
             }
           }
+          if (print)
+            this.printProjects();
         }
         openExternalProjects(projects) {
           const projectsToClose = arrayToMap(this.externalProjects, (p) => p.getProjectName(), (_) => true);
@@ -179260,12 +181125,21 @@ Dynamic files must always be opened with service's current directory or service
             projectsToClose.set(externalProjectName, true);
           });
           for (const externalProject of projects) {
-            this.openExternalProject(externalProject);
+            this.openExternalProject(
+              externalProject,
+              /*print*/
+              false
+            );
             projectsToClose.delete(externalProject.projectFileName);
           }
           forEachKey(projectsToClose, (externalProjectName) => {
-            this.closeExternalProject(externalProjectName);
+            this.closeExternalProject(
+              externalProjectName,
+              /*print*/
+              false
+            );
           });
+          this.printProjects();
         }
         static escapeFilenameForRegex(filename) {
           return filename.replace(this.filenameEscapeRegexp, "\\$&");
@@ -179274,16 +181148,18 @@ Dynamic files must always be opened with service's current directory or service
           this.safelist = defaultTypeSafeList;
         }
         applySafeList(proj) {
-          const { rootFiles } = proj;
           const typeAcquisition = proj.typeAcquisition;
           Debug.assert(!!typeAcquisition, "proj.typeAcquisition should be set by now");
+          const result = this.applySafeListWorker(proj, proj.rootFiles, typeAcquisition);
+          return (result == null ? void 0 : result.excludedFiles) ?? [];
+        }
+        applySafeListWorker(proj, rootFiles, typeAcquisition) {
           if (typeAcquisition.enable === false || typeAcquisition.disableFilenameBasedTypeAcquisition) {
-            return [];
+            return void 0;
           }
           const typeAcqInclude = typeAcquisition.include || (typeAcquisition.include = []);
           const excludeRules = [];
           const normalizedNames = rootFiles.map((f) => normalizeSlashes(f.fileName));
-          const excludedFiles = [];
           for (const name of Object.keys(this.safelist)) {
             const rule2 = this.safelist[name];
             for (const root of normalizedNames) {
@@ -179324,12 +181200,12 @@ Dynamic files must always be opened with service's current directory or service
             }
           }
           const excludeRegexes = excludeRules.map((e) => new RegExp(e, "i"));
-          const filesToKeep = [];
-          for (let i = 0; i < proj.rootFiles.length; i++) {
+          let filesToKeep;
+          let excludedFiles;
+          for (let i = 0; i < rootFiles.length; i++) {
             if (excludeRegexes.some((re) => re.test(normalizedNames[i]))) {
-              excludedFiles.push(normalizedNames[i]);
+              addExcludedFile(i);
             } else {
-              let exclude = false;
               if (typeAcquisition.enable) {
                 const baseName = getBaseFileName(toFileNameLowerCase(normalizedNames[i]));
                 if (fileExtensionIs(baseName, "js")) {
@@ -179338,110 +181214,93 @@ Dynamic files must always be opened with service's current directory or service
                   const typeName = this.legacySafelist.get(cleanedTypingName);
                   if (typeName !== void 0) {
                     this.logger.info(`Excluded '${normalizedNames[i]}' because it matched ${cleanedTypingName} from the legacy safelist`);
-                    excludedFiles.push(normalizedNames[i]);
-                    exclude = true;
+                    addExcludedFile(i);
                     if (!typeAcqInclude.includes(typeName)) {
                       typeAcqInclude.push(typeName);
                     }
+                    continue;
                   }
                 }
               }
-              if (!exclude) {
-                if (/^.+[.-]min\.js$/.test(normalizedNames[i])) {
-                  excludedFiles.push(normalizedNames[i]);
-                } else {
-                  filesToKeep.push(proj.rootFiles[i]);
-                }
+              if (/^.+[.-]min\.js$/.test(normalizedNames[i])) {
+                addExcludedFile(i);
+              } else {
+                filesToKeep == null ? void 0 : filesToKeep.push(rootFiles[i]);
               }
             }
           }
-          proj.rootFiles = filesToKeep;
-          return excludedFiles;
-        }
-        openExternalProject(proj) {
-          proj.typeAcquisition = proj.typeAcquisition || {};
-          proj.typeAcquisition.include = proj.typeAcquisition.include || [];
-          proj.typeAcquisition.exclude = proj.typeAcquisition.exclude || [];
-          if (proj.typeAcquisition.enable === void 0) {
-            proj.typeAcquisition.enable = hasNoTypeScriptSource(proj.rootFiles.map((f) => f.fileName));
+          return excludedFiles ? {
+            rootFiles: filesToKeep,
+            excludedFiles
+          } : void 0;
+          function addExcludedFile(index) {
+            if (!excludedFiles) {
+              Debug.assert(!filesToKeep);
+              filesToKeep = rootFiles.slice(0, index);
+              excludedFiles = [];
+            }
+            excludedFiles.push(normalizedNames[index]);
           }
-          const excludedFiles = this.applySafeList(proj);
-          let tsConfigFiles;
-          const rootFiles = [];
+        }
+        openExternalProject(proj, print) {
+          const existingExternalProject = this.findExternalProjectByProjectName(proj.projectFileName);
+          const existingConfiguredProjects = this.externalProjectToConfiguredProjectMap.get(proj.projectFileName);
+          let configuredProjects;
+          let rootFiles = [];
           for (const file of proj.rootFiles) {
             const normalized = toNormalizedPath(file.fileName);
             if (getBaseConfigFileName(normalized)) {
               if (this.serverMode === 0 /* Semantic */ && this.host.fileExists(normalized)) {
-                (tsConfigFiles || (tsConfigFiles = [])).push(normalized);
+                let project = this.findConfiguredProjectByProjectName(normalized);
+                if (!project) {
+                  project = this.getHostPreferences().lazyConfiguredProjectsFromExternalProject ? this.createConfiguredProjectWithDelayLoad(normalized, `Creating configured project in external project: ${proj.projectFileName}`) : this.createLoadAndUpdateConfiguredProject(normalized, `Creating configured project in external project: ${proj.projectFileName}`);
+                }
+                if (!(existingConfiguredProjects == null ? void 0 : existingConfiguredProjects.has(project))) {
+                  project.addExternalProjectReference();
+                }
+                (configuredProjects ?? (configuredProjects = /* @__PURE__ */ new Set())).add(project);
+                existingConfiguredProjects == null ? void 0 : existingConfiguredProjects.delete(project);
               }
             } else {
               rootFiles.push(file);
             }
           }
-          if (tsConfigFiles) {
-            tsConfigFiles.sort();
-          }
-          const externalProject = this.findExternalProjectByProjectName(proj.projectFileName);
-          let exisingConfigFiles;
-          if (externalProject) {
-            externalProject.excludedFiles = excludedFiles;
-            if (!tsConfigFiles) {
+          if (configuredProjects) {
+            this.externalProjectToConfiguredProjectMap.set(proj.projectFileName, configuredProjects);
+            if (existingExternalProject)
+              this.removeProject(existingExternalProject);
+          } else {
+            this.externalProjectToConfiguredProjectMap.delete(proj.projectFileName);
+            const typeAcquisition = proj.typeAcquisition || {};
+            typeAcquisition.include = typeAcquisition.include || [];
+            typeAcquisition.exclude = typeAcquisition.exclude || [];
+            if (typeAcquisition.enable === void 0) {
+              typeAcquisition.enable = hasNoTypeScriptSource(rootFiles.map((f) => f.fileName));
+            }
+            const excludeResult = this.applySafeListWorker(proj, rootFiles, typeAcquisition);
+            const excludedFiles = (excludeResult == null ? void 0 : excludeResult.excludedFiles) ?? [];
+            rootFiles = (excludeResult == null ? void 0 : excludeResult.rootFiles) ?? rootFiles;
+            if (existingExternalProject) {
+              existingExternalProject.excludedFiles = excludedFiles;
               const compilerOptions = convertCompilerOptions(proj.options);
-              const watchOptionsAndErrors = convertWatchOptions(proj.options, externalProject.getCurrentDirectory());
-              const lastFileExceededProgramSize = this.getFilenameForExceededTotalSizeLimitForNonTsFiles(proj.projectFileName, compilerOptions, proj.rootFiles, externalFilePropertyReader);
+              const watchOptionsAndErrors = convertWatchOptions(proj.options, existingExternalProject.getCurrentDirectory());
+              const lastFileExceededProgramSize = this.getFilenameForExceededTotalSizeLimitForNonTsFiles(proj.projectFileName, compilerOptions, rootFiles, externalFilePropertyReader);
               if (lastFileExceededProgramSize) {
-                externalProject.disableLanguageService(lastFileExceededProgramSize);
+                existingExternalProject.disableLanguageService(lastFileExceededProgramSize);
               } else {
-                externalProject.enableLanguageService();
+                existingExternalProject.enableLanguageService();
               }
-              externalProject.setProjectErrors(watchOptionsAndErrors == null ? void 0 : watchOptionsAndErrors.errors);
-              this.updateRootAndOptionsOfNonInferredProject(externalProject, proj.rootFiles, externalFilePropertyReader, compilerOptions, proj.typeAcquisition, proj.options.compileOnSave, watchOptionsAndErrors == null ? void 0 : watchOptionsAndErrors.watchOptions);
-              externalProject.updateGraph();
-              return;
-            }
-            this.closeExternalProject(proj.projectFileName);
-          } else if (this.externalProjectToConfiguredProjectMap.get(proj.projectFileName)) {
-            if (!tsConfigFiles) {
-              this.closeExternalProject(proj.projectFileName);
+              existingExternalProject.setProjectErrors(watchOptionsAndErrors == null ? void 0 : watchOptionsAndErrors.errors);
+              this.updateRootAndOptionsOfNonInferredProject(existingExternalProject, rootFiles, externalFilePropertyReader, compilerOptions, typeAcquisition, proj.options.compileOnSave, watchOptionsAndErrors == null ? void 0 : watchOptionsAndErrors.watchOptions);
+              existingExternalProject.updateGraph();
             } else {
-              const oldConfigFiles = this.externalProjectToConfiguredProjectMap.get(proj.projectFileName);
-              let iNew = 0;
-              let iOld = 0;
-              while (iNew < tsConfigFiles.length && iOld < oldConfigFiles.length) {
-                const newConfig = tsConfigFiles[iNew];
-                const oldConfig = oldConfigFiles[iOld];
-                if (oldConfig < newConfig) {
-                  this.closeConfiguredProjectReferencedFromExternalProject(oldConfig);
-                  iOld++;
-                } else if (oldConfig > newConfig) {
-                  iNew++;
-                } else {
-                  (exisingConfigFiles || (exisingConfigFiles = [])).push(oldConfig);
-                  iOld++;
-                  iNew++;
-                }
-              }
-              for (let i = iOld; i < oldConfigFiles.length; i++) {
-                this.closeConfiguredProjectReferencedFromExternalProject(oldConfigFiles[i]);
-              }
-            }
-          }
-          if (tsConfigFiles) {
-            this.externalProjectToConfiguredProjectMap.set(proj.projectFileName, tsConfigFiles);
-            for (const tsconfigFile of tsConfigFiles) {
-              let project = this.findConfiguredProjectByProjectName(tsconfigFile);
-              if (!project) {
-                project = this.getHostPreferences().lazyConfiguredProjectsFromExternalProject ? this.createConfiguredProjectWithDelayLoad(tsconfigFile, `Creating configured project in external project: ${proj.projectFileName}`) : this.createLoadAndUpdateConfiguredProject(tsconfigFile, `Creating configured project in external project: ${proj.projectFileName}`);
-              }
-              if (project && !contains(exisingConfigFiles, tsconfigFile)) {
-                project.addExternalProjectReference();
-              }
+              const project = this.createExternalProject(proj.projectFileName, rootFiles, proj.options, typeAcquisition, excludedFiles);
+              project.updateGraph();
             }
-          } else {
-            this.externalProjectToConfiguredProjectMap.delete(proj.projectFileName);
-            const project = this.createExternalProject(proj.projectFileName, rootFiles, proj.options, proj.typeAcquisition, excludedFiles);
-            project.updateGraph();
           }
+          this.closeConfiguredProjectReferencedFromExternalProject(existingConfiguredProjects);
+          if (print)
+            this.printProjects();
         }
         hasDeferredExtension() {
           for (const extension of this.hostConfiguration.extraFileExtensions) {
@@ -179570,10 +181429,9 @@ Dynamic files must always be opened with service's current directory or service
           this.currentPluginConfigOverrides.set(args.pluginName, args.configuration);
         }
         /** @internal */
-        getPackageJsonsVisibleToFile(fileName, rootDir) {
+        getPackageJsonsVisibleToFile(fileName, project, rootDir) {
           const packageJsonCache = this.packageJsonCache;
           const rootPath = rootDir && this.toPath(rootDir);
-          const filePath = this.toPath(fileName);
           const result = [];
           const processDirectory = (directory) => {
             switch (packageJsonCache.directoryHasPackageJson(directory)) {
@@ -179582,7 +181440,7 @@ Dynamic files must always be opened with service's current directory or service
                 return processDirectory(directory);
               case -1 /* True */:
                 const packageJsonFileName = combinePaths(directory, "package.json");
-                this.watchPackageJsonFile(packageJsonFileName);
+                this.watchPackageJsonFile(packageJsonFileName, this.toPath(packageJsonFileName), project);
                 const info = packageJsonCache.getInDirectory(directory);
                 if (info)
                   result.push(info);
@@ -179591,13 +181449,13 @@ Dynamic files must always be opened with service's current directory or service
               return true;
             }
           };
-          forEachAncestorDirectory(getDirectoryPath(filePath), processDirectory);
+          forEachAncestorDirectory(getDirectoryPath(fileName), processDirectory);
           return result;
         }
         /** @internal */
         getNearestAncestorDirectoryWithPackageJson(fileName) {
           return forEachAncestorDirectory(fileName, (directory) => {
-            switch (this.packageJsonCache.directoryHasPackageJson(this.toPath(directory))) {
+            switch (this.packageJsonCache.directoryHasPackageJson(directory)) {
               case -1 /* True */:
                 return directory;
               case 0 /* False */:
@@ -179608,64 +181466,54 @@ Dynamic files must always be opened with service's current directory or service
           });
         }
         /** @internal */
-        watchPnpFile() {
-          const pnpApiPath = getPnpApiPath(__filename);
-          if (!pnpApiPath) {
-            return;
-          }
-          return this.watchFactory.watchFile(
-            pnpApiPath,
-            () => {
-              this.forEachProject((project) => {
-                for (const info of project.getScriptInfos()) {
-                  project.resolutionCache.invalidateResolutionOfFile(info.path);
+        watchPackageJsonFile(file, path, project) {
+          Debug.assert(project !== void 0);
+          let result = (this.packageJsonFilesMap ?? (this.packageJsonFilesMap = /* @__PURE__ */ new Map())).get(path);
+          if (!result) {
+            let watcher = this.watchFactory.watchFile(
+              file,
+              (fileName, eventKind) => {
+                switch (eventKind) {
+                  case 0 /* Created */:
+                    return Debug.fail();
+                  case 1 /* Changed */:
+                    this.packageJsonCache.addOrUpdate(fileName, path);
+                    this.onPackageJsonChange(result);
+                    break;
+                  case 2 /* Deleted */:
+                    this.packageJsonCache.delete(path);
+                    this.onPackageJsonChange(result);
+                    result.projects.clear();
+                    result.close();
                 }
-                project.markAsDirty();
-                updateProjectIfDirty(project);
-              });
-              this.delayEnsureProjectForOpenFiles();
-            },
-            250 /* Low */,
-            this.hostConfiguration.watchOptions,
-            WatchType.ConfigFile
-          );
-        }
-        /** @internal */
-        watchPackageJsonFile(path) {
-          const watchers = this.packageJsonFilesMap || (this.packageJsonFilesMap = /* @__PURE__ */ new Map());
-          if (!watchers.has(path)) {
-            this.invalidateProjectPackageJson(path);
-            watchers.set(
-              path,
-              this.watchFactory.watchFile(
-                path,
-                (fileName, eventKind) => {
-                  const path2 = this.toPath(fileName);
-                  switch (eventKind) {
-                    case 0 /* Created */:
-                      return Debug.fail();
-                    case 1 /* Changed */:
-                      this.packageJsonCache.addOrUpdate(path2);
-                      this.invalidateProjectPackageJson(path2);
-                      break;
-                    case 2 /* Deleted */:
-                      this.packageJsonCache.delete(path2);
-                      this.invalidateProjectPackageJson(path2);
-                      watchers.get(path2).close();
-                      watchers.delete(path2);
-                  }
-                },
-                250 /* Low */,
-                this.hostConfiguration.watchOptions,
-                WatchType.PackageJson
-              )
+              },
+              250 /* Low */,
+              this.hostConfiguration.watchOptions,
+              WatchType.PackageJson
             );
+            result = {
+              projects: /* @__PURE__ */ new Set(),
+              close: () => {
+                var _a;
+                if (result.projects.size || !watcher)
+                  return;
+                watcher.close();
+                watcher = void 0;
+                (_a = this.packageJsonFilesMap) == null ? void 0 : _a.delete(path);
+                this.packageJsonCache.invalidate(path);
+              }
+            };
+            this.packageJsonFilesMap.set(path, result);
           }
+          result.projects.add(project);
+          (project.packageJsonWatches ?? (project.packageJsonWatches = /* @__PURE__ */ new Set())).add(result);
         }
         /** @internal */
-        onAddPackageJson(path) {
-          this.packageJsonCache.addOrUpdate(path);
-          this.watchPackageJsonFile(path);
+        onPackageJsonChange(result) {
+          result.projects.forEach((project) => {
+            var _a;
+            return (_a = project.onPackageJsonChange) == null ? void 0 : _a.call(project);
+          });
         }
         /** @internal */
         includePackageJsonAutoImports() {
@@ -179679,19 +181527,6 @@ Dynamic files must always be opened with service's current directory or service
           }
         }
         /** @internal */
-        invalidateProjectPackageJson(packageJsonPath) {
-          this.configuredProjects.forEach(invalidate);
-          this.inferredProjects.forEach(invalidate);
-          this.externalProjects.forEach(invalidate);
-          function invalidate(project) {
-            if (packageJsonPath) {
-              project.onPackageJsonChange(packageJsonPath);
-            } else {
-              project.onAutoImportProviderSettingsChanged();
-            }
-          }
-        }
-        /** @internal */
         getIncompleteCompletionsCache() {
           return this.incompleteCompletionsCache || (this.incompleteCompletionsCache = createIncompleteCompletionsCache());
         }
@@ -179724,9 +181559,10 @@ Dynamic files must always be opened with service's current directory or service
           for (const p of modulePaths) {
             if (p.isInNodeModules) {
               const nodeModulesPath = p.path.substring(0, p.path.indexOf(nodeModulesPathPart) + nodeModulesPathPart.length - 1);
-              if (!(containedNodeModulesWatchers == null ? void 0 : containedNodeModulesWatchers.has(nodeModulesPath))) {
+              const key2 = host.toPath(nodeModulesPath);
+              if (!(containedNodeModulesWatchers == null ? void 0 : containedNodeModulesWatchers.has(key2))) {
                 (containedNodeModulesWatchers || (containedNodeModulesWatchers = /* @__PURE__ */ new Map())).set(
-                  nodeModulesPath,
+                  key2,
                   host.watchNodeModulesForPackageJsonChanges(nodeModulesPath)
                 );
               }
@@ -179765,7 +181601,7 @@ Dynamic files must always be opened with service's current directory or service
         }
       },
       clear() {
-        containedNodeModulesWatchers == null ? void 0 : containedNodeModulesWatchers.forEach((watcher) => watcher.close());
+        containedNodeModulesWatchers == null ? void 0 : containedNodeModulesWatchers.forEach(closeFileWatcher);
         cache == null ? void 0 : cache.clear();
         containedNodeModulesWatchers == null ? void 0 : containedNodeModulesWatchers.clear();
         currentKey = void 0;
@@ -179806,34 +181642,38 @@ Dynamic files must always be opened with service's current directory or service
     const directoriesWithoutPackageJson = /* @__PURE__ */ new Map();
     return {
       addOrUpdate,
-      forEach: packageJsons.forEach.bind(packageJsons),
-      get: packageJsons.get.bind(packageJsons),
+      invalidate,
       delete: (fileName) => {
         packageJsons.delete(fileName);
         directoriesWithoutPackageJson.set(getDirectoryPath(fileName), true);
       },
       getInDirectory: (directory) => {
-        return packageJsons.get(combinePaths(directory, "package.json")) || void 0;
+        return packageJsons.get(host.toPath(combinePaths(directory, "package.json"))) || void 0;
       },
-      directoryHasPackageJson,
+      directoryHasPackageJson: (directory) => directoryHasPackageJson(host.toPath(directory)),
       searchDirectoryAndAncestors: (directory) => {
         forEachAncestorDirectory(directory, (ancestor) => {
-          if (directoryHasPackageJson(ancestor) !== 3 /* Maybe */) {
+          const ancestorPath = host.toPath(ancestor);
+          if (directoryHasPackageJson(ancestorPath) !== 3 /* Maybe */) {
             return true;
           }
-          const packageJsonFileName = host.toPath(combinePaths(ancestor, "package.json"));
+          const packageJsonFileName = combinePaths(ancestor, "package.json");
           if (tryFileExists(host, packageJsonFileName)) {
-            addOrUpdate(packageJsonFileName);
+            addOrUpdate(packageJsonFileName, combinePaths(ancestorPath, "package.json"));
           } else {
-            directoriesWithoutPackageJson.set(ancestor, true);
+            directoriesWithoutPackageJson.set(ancestorPath, true);
           }
         });
       }
     };
-    function addOrUpdate(fileName) {
+    function addOrUpdate(fileName, path) {
       const packageJsonInfo = Debug.checkDefined(createPackageJsonInfo(fileName, host.host));
-      packageJsons.set(fileName, packageJsonInfo);
-      directoriesWithoutPackageJson.delete(getDirectoryPath(fileName));
+      packageJsons.set(path, packageJsonInfo);
+      directoriesWithoutPackageJson.delete(getDirectoryPath(path));
+    }
+    function invalidate(path) {
+      packageJsons.delete(path);
+      directoriesWithoutPackageJson.delete(getDirectoryPath(path));
     }
     function directoryHasPackageJson(directory) {
       return packageJsons.has(combinePaths(directory, "package.json")) ? -1 /* True */ : directoriesWithoutPackageJson.has(directory) ? 0 /* False */ : 3 /* Maybe */;
@@ -179951,10 +181791,10 @@ ${json}${newLine}`;
     }
     return deduplicate(outputs, equateValues);
   }
-  function createDocumentSpanSet() {
-    return createSet(({ textSpan }) => textSpan.start + 100003 * textSpan.length, documentSpansEqual);
+  function createDocumentSpanSet(useCaseSensitiveFileNames2) {
+    return createSet(({ textSpan }) => textSpan.start + 100003 * textSpan.length, getDocumentSpansEqualityComparer(useCaseSensitiveFileNames2));
   }
-  function getRenameLocationsWorker(projects, defaultProject, initialLocation, findInStrings, findInComments, preferences) {
+  function getRenameLocationsWorker(projects, defaultProject, initialLocation, findInStrings, findInComments, preferences, useCaseSensitiveFileNames2) {
     const perProjectResults = getPerProjectReferences(
       projects,
       defaultProject,
@@ -179968,7 +181808,7 @@ ${json}${newLine}`;
       return perProjectResults;
     }
     const results = [];
-    const seen = createDocumentSpanSet();
+    const seen = createDocumentSpanSet(useCaseSensitiveFileNames2);
     perProjectResults.forEach((projectResults, project) => {
       for (const result of projectResults) {
         if (!seen.has(result) && !getMappedLocationForProject(documentSpanLocation(result), project)) {
@@ -179991,7 +181831,7 @@ ${json}${newLine}`;
     const info = infos && firstOrUndefined(infos);
     return info && !info.isLocal ? { fileName: info.fileName, pos: info.textSpan.start } : void 0;
   }
-  function getReferencesWorker(projects, defaultProject, initialLocation, logger) {
+  function getReferencesWorker(projects, defaultProject, initialLocation, useCaseSensitiveFileNames2, logger) {
     var _a, _b;
     const perProjectResults = getPerProjectReferences(
       projects,
@@ -180023,7 +181863,7 @@ ${json}${newLine}`;
         }
       });
     } else {
-      const knownSymbolSpans = createDocumentSpanSet();
+      const knownSymbolSpans = createDocumentSpanSet(useCaseSensitiveFileNames2);
       for (const referencedSymbol of defaultProjectResults) {
         for (const ref of referencedSymbol.references) {
           if (ref.isDefinition) {
@@ -180058,7 +181898,7 @@ ${json}${newLine}`;
       });
     }
     const results = [];
-    const seenRefs = createDocumentSpanSet();
+    const seenRefs = createDocumentSpanSet(useCaseSensitiveFileNames2);
     perProjectResults.forEach((projectResults, project) => {
       for (const referencedSymbol of projectResults) {
         const mappedDefinitionFile = getMappedLocationForProject(documentSpanLocation(referencedSymbol.definition), project);
@@ -180069,7 +181909,7 @@ ${json}${newLine}`;
           fileName: mappedDefinitionFile.fileName,
           contextSpan: getMappedContextSpanForProject(referencedSymbol.definition, project)
         };
-        let symbolToAddTo = find(results, (o) => documentSpansEqual(o.definition, definition));
+        let symbolToAddTo = find(results, (o) => documentSpansEqual(o.definition, definition, useCaseSensitiveFileNames2));
         if (!symbolToAddTo) {
           symbolToAddTo = { definition, references: [] };
           results.push(symbolToAddTo);
@@ -180456,7 +182296,11 @@ ${json}${newLine}`;
               return this.requiredResponse(response);
             },
             ["openExternalProject" /* OpenExternalProject */]: (request) => {
-              this.projectService.openExternalProject(request.arguments);
+              this.projectService.openExternalProject(
+                request.arguments,
+                /*print*/
+                true
+              );
               return this.requiredResponse(
                 /*response*/
                 true
@@ -180470,7 +182314,11 @@ ${json}${newLine}`;
               );
             },
             ["closeExternalProject" /* CloseExternalProject */]: (request) => {
-              this.projectService.closeExternalProject(request.arguments.projectFileName);
+              this.projectService.closeExternalProject(
+                request.arguments.projectFileName,
+                /*print*/
+                true
+              );
               return this.requiredResponse(
                 /*response*/
                 true
@@ -181224,9 +183072,10 @@ ${json}${newLine}`;
           }
         }
         projectsUpdatedInBackgroundEvent(openFiles) {
-          this.projectService.logger.info(`got projects updated in background, updating diagnostics for ${openFiles}`);
+          this.projectService.logger.info(`got projects updated in background ${openFiles}`);
           if (openFiles.length) {
             if (!this.suppressDiagnosticEvents && !this.noGetErrOnBackgroundUpdate) {
+              this.projectService.logger.info(`Queueing diagnostics update for ${openFiles}`);
               this.errorCheck.startNew((next) => this.updateErrorCheck(
                 next,
                 openFiles,
@@ -181297,7 +183146,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
         send(msg) {
           if (msg.type === "event" && !this.canUseEvents) {
             if (this.logger.hasLevel(3 /* verbose */)) {
-              this.logger.info(`Session does not support events: ignored event: ${JSON.stringify(msg)}`);
+              this.logger.info(`Session does not support events: ignored event: ${stringifyIndented(msg)}`);
             }
             return;
           }
@@ -181599,7 +183448,10 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
           let definitions = this.mapDefinitionInfoLocations(unmappedDefinitions || emptyArray2, project).slice();
           const needsJsResolution = this.projectService.serverMode === 0 /* Semantic */ && (!some(definitions, (d) => toNormalizedPath(d.fileName) !== file && !d.isAmbient) || some(definitions, (d) => !!d.failedAliasResolution));
           if (needsJsResolution) {
-            const definitionSet = createSet((d) => d.textSpan.start, documentSpansEqual);
+            const definitionSet = createSet(
+              (d) => d.textSpan.start,
+              getDocumentSpansEqualityComparer(this.host.useCaseSensitiveFileNames)
+            );
             definitions == null ? void 0 : definitions.forEach((d) => definitionSet.add(d));
             const noDtsProject = project.getNoDtsResolutionProject(file);
             const ls = noDtsProject.getLanguageService();
@@ -182040,7 +183892,8 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
             { fileName: args.file, pos: position },
             !!args.findInStrings,
             !!args.findInComments,
-            preferences
+            preferences,
+            this.host.useCaseSensitiveFileNames
           );
           if (!simplifiedResult)
             return locations;
@@ -182075,6 +183928,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
             projects,
             this.getDefaultProject(args),
             { fileName: args.file, pos: position },
+            this.host.useCaseSensitiveFileNames,
             this.logger
           );
           if (!simplifiedResult)
@@ -182097,7 +183951,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
           const fileName = args.file;
           const preferences = this.getPreferences(toNormalizedPath(fileName));
           const references = [];
-          const seen = createDocumentSpanSet();
+          const seen = createDocumentSpanSet(this.host.useCaseSensitiveFileNames);
           forEachProjectInProjects(
             projects,
             /*path*/
@@ -183929,6 +185783,192 @@ ${e.message}`;
     }
   });
 
+  // src/server/typingInstallerAdapter.ts
+  var _TypingsInstallerAdapter, TypingsInstallerAdapter;
+  var init_typingInstallerAdapter = __esm({
+    "src/server/typingInstallerAdapter.ts"() {
+      "use strict";
+      init_ts7();
+      init_ts_server3();
+      _TypingsInstallerAdapter = class _TypingsInstallerAdapter {
+        constructor(telemetryEnabled, logger, host, globalTypingsCacheLocation, event, maxActiveRequestCount) {
+          this.telemetryEnabled = telemetryEnabled;
+          this.logger = logger;
+          this.host = host;
+          this.globalTypingsCacheLocation = globalTypingsCacheLocation;
+          this.event = event;
+          this.maxActiveRequestCount = maxActiveRequestCount;
+          this.activeRequestCount = 0;
+          this.requestQueue = createQueue();
+          this.requestMap = /* @__PURE__ */ new Map();
+          // Maps project name to newest requestQueue entry for that project
+          /** We will lazily request the types registry on the first call to `isKnownTypesPackageName` and store it in `typesRegistryCache`. */
+          this.requestedRegistry = false;
+          this.packageInstallId = 0;
+        }
+        isKnownTypesPackageName(name) {
+          var _a;
+          const validationResult = ts_JsTyping_exports.validatePackageName(name);
+          if (validationResult !== ts_JsTyping_exports.NameValidationResult.Ok) {
+            return false;
+          }
+          if (!this.requestedRegistry) {
+            this.requestedRegistry = true;
+            this.installer.send({ kind: "typesRegistry" });
+          }
+          return !!((_a = this.typesRegistryCache) == null ? void 0 : _a.has(name));
+        }
+        installPackage(options) {
+          this.packageInstallId++;
+          const request = { kind: "installPackage", ...options, id: this.packageInstallId };
+          const promise = new Promise((resolve, reject) => {
+            (this.packageInstalledPromise ?? (this.packageInstalledPromise = /* @__PURE__ */ new Map())).set(this.packageInstallId, { resolve, reject });
+          });
+          this.installer.send(request);
+          return promise;
+        }
+        attach(projectService) {
+          this.projectService = projectService;
+          this.installer = this.createInstallerProcess();
+        }
+        onProjectClosed(p) {
+          this.installer.send({ projectName: p.getProjectName(), kind: "closeProject" });
+        }
+        enqueueInstallTypingsRequest(project, typeAcquisition, unresolvedImports) {
+          const request = createInstallTypingsRequest(project, typeAcquisition, unresolvedImports);
+          if (this.logger.hasLevel(3 /* verbose */)) {
+            this.logger.info(`TIAdapter:: Scheduling throttled operation:${stringifyIndented(request)}`);
+          }
+          if (this.activeRequestCount < this.maxActiveRequestCount) {
+            this.scheduleRequest(request);
+          } else {
+            if (this.logger.hasLevel(3 /* verbose */)) {
+              this.logger.info(`TIAdapter:: Deferring request for: ${request.projectName}`);
+            }
+            this.requestQueue.enqueue(request);
+            this.requestMap.set(request.projectName, request);
+          }
+        }
+        handleMessage(response) {
+          var _a, _b;
+          if (this.logger.hasLevel(3 /* verbose */)) {
+            this.logger.info(`TIAdapter:: Received response:${stringifyIndented(response)}`);
+          }
+          switch (response.kind) {
+            case EventTypesRegistry:
+              this.typesRegistryCache = new Map(Object.entries(response.typesRegistry));
+              break;
+            case ActionPackageInstalled: {
+              const promise = (_a = this.packageInstalledPromise) == null ? void 0 : _a.get(response.id);
+              Debug.assertIsDefined(promise, "Should find the promise for package install");
+              (_b = this.packageInstalledPromise) == null ? void 0 : _b.delete(response.id);
+              if (response.success) {
+                promise.resolve({ successMessage: response.message });
+              } else {
+                promise.reject(response.message);
+              }
+              this.projectService.updateTypingsForProject(response);
+              this.event(response, "setTypings");
+              break;
+            }
+            case EventInitializationFailed: {
+              const body = {
+                message: response.message
+              };
+              const eventName = "typesInstallerInitializationFailed";
+              this.event(body, eventName);
+              break;
+            }
+            case EventBeginInstallTypes: {
+              const body = {
+                eventId: response.eventId,
+                packages: response.packagesToInstall
+              };
+              const eventName = "beginInstallTypes";
+              this.event(body, eventName);
+              break;
+            }
+            case EventEndInstallTypes: {
+              if (this.telemetryEnabled) {
+                const body2 = {
+                  telemetryEventName: "typingsInstalled",
+                  payload: {
+                    installedPackages: response.packagesToInstall.join(","),
+                    installSuccess: response.installSuccess,
+                    typingsInstallerVersion: response.typingsInstallerVersion
+                  }
+                };
+                const eventName2 = "telemetry";
+                this.event(body2, eventName2);
+              }
+              const body = {
+                eventId: response.eventId,
+                packages: response.packagesToInstall,
+                success: response.installSuccess
+              };
+              const eventName = "endInstallTypes";
+              this.event(body, eventName);
+              break;
+            }
+            case ActionInvalidate: {
+              this.projectService.updateTypingsForProject(response);
+              break;
+            }
+            case ActionSet: {
+              if (this.activeRequestCount > 0) {
+                this.activeRequestCount--;
+              } else {
+                Debug.fail("TIAdapter:: Received too many responses");
+              }
+              while (!this.requestQueue.isEmpty()) {
+                const queuedRequest = this.requestQueue.dequeue();
+                if (this.requestMap.get(queuedRequest.projectName) === queuedRequest) {
+                  this.requestMap.delete(queuedRequest.projectName);
+                  this.scheduleRequest(queuedRequest);
+                  break;
+                }
+                if (this.logger.hasLevel(3 /* verbose */)) {
+                  this.logger.info(`TIAdapter:: Skipping defunct request for: ${queuedRequest.projectName}`);
+                }
+              }
+              this.projectService.updateTypingsForProject(response);
+              this.event(response, "setTypings");
+              break;
+            }
+            case ActionWatchTypingLocations:
+              this.projectService.watchTypingLocations(response);
+              break;
+            default:
+              assertType(response);
+          }
+        }
+        scheduleRequest(request) {
+          if (this.logger.hasLevel(3 /* verbose */)) {
+            this.logger.info(`TIAdapter:: Scheduling request for: ${request.projectName}`);
+          }
+          this.activeRequestCount++;
+          this.host.setTimeout(
+            () => {
+              if (this.logger.hasLevel(3 /* verbose */)) {
+                this.logger.info(`TIAdapter:: Sending request:${stringifyIndented(request)}`);
+              }
+              this.installer.send(request);
+            },
+            _TypingsInstallerAdapter.requestDelayMillis,
+            `${request.projectName}::${request.kind}`
+          );
+        }
+      };
+      // This number is essentially arbitrary.  Processing more than one typings request
+      // at a time makes sense, but having too many in the pipe results in a hang
+      // (see https://github.com/nodejs/node/issues/7657).
+      // It would be preferable to base our limit on the amount of space left in the
+      // buffer, but we have yet to find a way to retrieve that value.
+      _TypingsInstallerAdapter.requestDelayMillis = 100;
+      TypingsInstallerAdapter = _TypingsInstallerAdapter;
+    }
+  });
+
   // src/server/_namespaces/ts.server.ts
   var ts_server_exports3 = {};
   __export(ts_server_exports3, {
@@ -183976,6 +186016,7 @@ ${e.message}`;
     TextStorage: () => TextStorage,
     ThrottledOperations: () => ThrottledOperations,
     TypingsCache: () => TypingsCache,
+    TypingsInstallerAdapter: () => TypingsInstallerAdapter,
     allFilesAreJsOrDts: () => allFilesAreJsOrDts,
     allRootFilesAreJsOrDts: () => allRootFilesAreJsOrDts,
     asNormalizedPath: () => asNormalizedPath,
@@ -184044,6 +186085,7 @@ ${e.message}`;
       init_packageJsonCache();
       init_session();
       init_scriptVersionCache();
+      init_typingInstallerAdapter();
     }
   });
 
@@ -184283,6 +186325,7 @@ ${e.message}`;
     changeAnyExtension: () => changeAnyExtension,
     changeCompilerHostLikeToUseCache: () => changeCompilerHostLikeToUseCache,
     changeExtension: () => changeExtension,
+    changeFullExtension: () => changeFullExtension,
     changesAffectModuleResolution: () => changesAffectModuleResolution,
     changesAffectingProgramStructure: () => changesAffectingProgramStructure,
     childIsDecorated: () => childIsDecorated,
@@ -184347,6 +186390,7 @@ ${e.message}`;
     computeSignature: () => computeSignature,
     computeSignatureWithDiagnostics: () => computeSignatureWithDiagnostics,
     computeSuggestionDiagnostics: () => computeSuggestionDiagnostics,
+    computedOptions: () => computedOptions,
     concatenate: () => concatenate,
     concatenateDiagnosticMessageChains: () => concatenateDiagnosticMessageChains,
     consumesNodeCoreModules: () => consumesNodeCoreModules,
@@ -184559,6 +186603,7 @@ ${e.message}`;
     escapeNonAsciiString: () => escapeNonAsciiString,
     escapeSnippetText: () => escapeSnippetText,
     escapeString: () => escapeString,
+    escapeTemplateSubstitution: () => escapeTemplateSubstitution,
     every: () => every,
     expandPreOrPostfixIncrementOrDecrementExpression: () => expandPreOrPostfixIncrementOrDecrementExpression,
     explainFiles: () => explainFiles,
@@ -184720,6 +186765,7 @@ ${e.message}`;
     getDeclarationEmitExtensionForPath: () => getDeclarationEmitExtensionForPath,
     getDeclarationEmitOutputFilePath: () => getDeclarationEmitOutputFilePath,
     getDeclarationEmitOutputFilePathWorker: () => getDeclarationEmitOutputFilePathWorker,
+    getDeclarationFileExtension: () => getDeclarationFileExtension,
     getDeclarationFromName: () => getDeclarationFromName,
     getDeclarationModifierFlagsFromSymbol: () => getDeclarationModifierFlagsFromSymbol,
     getDeclarationOfKind: () => getDeclarationOfKind,
@@ -184738,6 +186784,7 @@ ${e.message}`;
     getDirectoryToWatchFailedLookupLocation: () => getDirectoryToWatchFailedLookupLocation,
     getDirectoryToWatchFailedLookupLocationFromTypeRoot: () => getDirectoryToWatchFailedLookupLocationFromTypeRoot,
     getDocumentPositionMapper: () => getDocumentPositionMapper,
+    getDocumentSpansEqualityComparer: () => getDocumentSpansEqualityComparer,
     getESModuleInterop: () => getESModuleInterop,
     getEditsForFileRename: () => getEditsForFileRename,
     getEffectiveBaseTypeNode: () => getEffectiveBaseTypeNode,
@@ -184834,6 +186881,7 @@ ${e.message}`;
     getJSDocEnumTag: () => getJSDocEnumTag,
     getJSDocHost: () => getJSDocHost,
     getJSDocImplementsTags: () => getJSDocImplementsTags,
+    getJSDocOverloadTags: () => getJSDocOverloadTags,
     getJSDocOverrideTagNoCache: () => getJSDocOverrideTagNoCache,
     getJSDocParameterTags: () => getJSDocParameterTags,
     getJSDocParameterTagsNoCache: () => getJSDocParameterTagsNoCache,
@@ -184906,6 +186954,7 @@ ${e.message}`;
     getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference,
     getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost,
     getNameForExportedSymbol: () => getNameForExportedSymbol,
+    getNameFromImportAttribute: () => getNameFromImportAttribute,
     getNameFromIndexInfo: () => getNameFromIndexInfo,
     getNameFromPropertyName: () => getNameFromPropertyName,
     getNameOfAccessExpression: () => getNameOfAccessExpression,
@@ -184948,8 +186997,10 @@ ${e.message}`;
     getOriginalNodeId: () => getOriginalNodeId,
     getOriginalSourceFile: () => getOriginalSourceFile,
     getOutputDeclarationFileName: () => getOutputDeclarationFileName,
+    getOutputDeclarationFileNameWorker: () => getOutputDeclarationFileNameWorker,
     getOutputExtension: () => getOutputExtension,
     getOutputFileNames: () => getOutputFileNames,
+    getOutputJSFileNameWorker: () => getOutputJSFileNameWorker,
     getOutputPathsFor: () => getOutputPathsFor,
     getOutputPathsForBundle: () => getOutputPathsForBundle,
     getOwnEmitOutputFilePath: () => getOwnEmitOutputFilePath,
@@ -185047,6 +187098,7 @@ ${e.message}`;
     getStaticPropertiesAndClassStaticBlock: () => getStaticPropertiesAndClassStaticBlock,
     getStrictOptionValue: () => getStrictOptionValue,
     getStringComparer: () => getStringComparer,
+    getSubPatternFromSpec: () => getSubPatternFromSpec,
     getSuperCallFromStatement: () => getSuperCallFromStatement,
     getSuperContainer: () => getSuperContainer,
     getSupportedCodeFixes: () => getSupportedCodeFixes,
@@ -185580,6 +187632,7 @@ ${e.message}`;
     isMethodSignature: () => isMethodSignature,
     isMinusToken: () => isMinusToken,
     isMissingDeclaration: () => isMissingDeclaration,
+    isMissingPackageJsonInfo: () => isMissingPackageJsonInfo,
     isModifier: () => isModifier,
     isModifierKind: () => isModifierKind,
     isModifierLike: () => isModifierLike,
@@ -185656,10 +187709,10 @@ ${e.message}`;
     isOuterExpression: () => isOuterExpression,
     isOutermostOptionalChain: () => isOutermostOptionalChain,
     isOverrideModifier: () => isOverrideModifier,
+    isPackageJsonInfo: () => isPackageJsonInfo,
     isPackedArrayLiteral: () => isPackedArrayLiteral,
     isParameter: () => isParameter,
     isParameterDeclaration: () => isParameterDeclaration,
-    isParameterOrCatchClauseVariable: () => isParameterOrCatchClauseVariable,
     isParameterPropertyDeclaration: () => isParameterPropertyDeclaration,
     isParameterPropertyModifier: () => isParameterPropertyModifier,
     isParenthesizedExpression: () => isParenthesizedExpression,
@@ -185735,6 +187788,8 @@ ${e.message}`;
     isSignedNumericLiteral: () => isSignedNumericLiteral,
     isSimpleCopiableExpression: () => isSimpleCopiableExpression,
     isSimpleInlineableExpression: () => isSimpleInlineableExpression,
+    isSimpleParameter: () => isSimpleParameter,
+    isSimpleParameterList: () => isSimpleParameterList,
     isSingleOrDoubleQuote: () => isSingleOrDoubleQuote,
     isSourceFile: () => isSourceFile,
     isSourceFileFromLibrary: () => isSourceFileFromLibrary,
@@ -186061,6 +188116,7 @@ ${e.message}`;
     removeTrailingDirectorySeparator: () => removeTrailingDirectorySeparator,
     repeatString: () => repeatString,
     replaceElement: () => replaceElement,
+    replaceFirstStar: () => replaceFirstStar,
     resolutionExtensionIsTSOrJson: () => resolutionExtensionIsTSOrJson,
     resolveConfigFileProjectName: () => resolveConfigFileProjectName,
     resolveJSModule: () => resolveJSModule,
@@ -186129,7 +188185,6 @@ ${e.message}`;
     setValueDeclaration: () => setValueDeclaration,
     shouldAllowImportingTsExtension: () => shouldAllowImportingTsExtension,
     shouldPreserveConstEnums: () => shouldPreserveConstEnums,
-    shouldResolveJsRequire: () => shouldResolveJsRequire,
     shouldUseUriStyleNodeCoreModules: () => shouldUseUriStyleNodeCoreModules,
     showModuleSpecifier: () => showModuleSpecifier,
     signatureHasLiteralTypes: () => signatureHasLiteralTypes,
@@ -186277,6 +188332,7 @@ ${e.message}`;
     tryGetSourceMappingURL: () => tryGetSourceMappingURL,
     tryGetTextOfPropertyName: () => tryGetTextOfPropertyName,
     tryIOAndConsumeErrors: () => tryIOAndConsumeErrors,
+    tryParseJson: () => tryParseJson,
     tryParsePattern: () => tryParsePattern,
     tryParsePatterns: () => tryParsePatterns,
     tryParseRawSourceMap: () => tryParseRawSourceMap,
@@ -186291,7 +188347,6 @@ ${e.message}`;
     typeDirectiveIsEqualTo: () => typeDirectiveIsEqualTo,
     typeKeywords: () => typeKeywords,
     typeParameterNamePart: () => typeParameterNamePart,
-    typeReferenceResolutionNameAndModeGetter: () => typeReferenceResolutionNameAndModeGetter,
     typeToDisplayParts: () => typeToDisplayParts,
     unchangedPollThresholds: () => unchangedPollThresholds,
     unchangedTextChangeRange: () => unchangedTextChangeRange,
@@ -186305,7 +188360,6 @@ ${e.message}`;
     updateErrorForNoInputFiles: () => updateErrorForNoInputFiles,
     updateLanguageServiceSourceFile: () => updateLanguageServiceSourceFile,
     updateMissingFilePathsWatch: () => updateMissingFilePathsWatch,
-    updatePackageJsonWatch: () => updatePackageJsonWatch,
     updateResolutionField: () => updateResolutionField,
     updateSharedExtendedConfigFileWatcher: () => updateSharedExtendedConfigFileWatcher,
     updateSourceFile: () => updateSourceFile,
@@ -186396,6 +188450,7 @@ ${e.message}`;
     TextStorage: () => TextStorage,
     ThrottledOperations: () => ThrottledOperations,
     TypingsCache: () => TypingsCache,
+    TypingsInstallerAdapter: () => TypingsInstallerAdapter,
     allFilesAreJsOrDts: () => allFilesAreJsOrDts,
     allRootFilesAreJsOrDts: () => allRootFilesAreJsOrDts,
     asNormalizedPath: () => asNormalizedPath,
@@ -186691,6 +188746,7 @@ ${e.message}`;
     changeAnyExtension: () => changeAnyExtension,
     changeCompilerHostLikeToUseCache: () => changeCompilerHostLikeToUseCache,
     changeExtension: () => changeExtension,
+    changeFullExtension: () => changeFullExtension,
     changesAffectModuleResolution: () => changesAffectModuleResolution,
     changesAffectingProgramStructure: () => changesAffectingProgramStructure,
     childIsDecorated: () => childIsDecorated,
@@ -186755,6 +188811,7 @@ ${e.message}`;
     computeSignature: () => computeSignature,
     computeSignatureWithDiagnostics: () => computeSignatureWithDiagnostics,
     computeSuggestionDiagnostics: () => computeSuggestionDiagnostics,
+    computedOptions: () => computedOptions,
     concatenate: () => concatenate,
     concatenateDiagnosticMessageChains: () => concatenateDiagnosticMessageChains,
     consumesNodeCoreModules: () => consumesNodeCoreModules,
@@ -186967,6 +189024,7 @@ ${e.message}`;
     escapeNonAsciiString: () => escapeNonAsciiString,
     escapeSnippetText: () => escapeSnippetText,
     escapeString: () => escapeString,
+    escapeTemplateSubstitution: () => escapeTemplateSubstitution,
     every: () => every,
     expandPreOrPostfixIncrementOrDecrementExpression: () => expandPreOrPostfixIncrementOrDecrementExpression,
     explainFiles: () => explainFiles,
@@ -187128,6 +189186,7 @@ ${e.message}`;
     getDeclarationEmitExtensionForPath: () => getDeclarationEmitExtensionForPath,
     getDeclarationEmitOutputFilePath: () => getDeclarationEmitOutputFilePath,
     getDeclarationEmitOutputFilePathWorker: () => getDeclarationEmitOutputFilePathWorker,
+    getDeclarationFileExtension: () => getDeclarationFileExtension,
     getDeclarationFromName: () => getDeclarationFromName,
     getDeclarationModifierFlagsFromSymbol: () => getDeclarationModifierFlagsFromSymbol,
     getDeclarationOfKind: () => getDeclarationOfKind,
@@ -187146,6 +189205,7 @@ ${e.message}`;
     getDirectoryToWatchFailedLookupLocation: () => getDirectoryToWatchFailedLookupLocation,
     getDirectoryToWatchFailedLookupLocationFromTypeRoot: () => getDirectoryToWatchFailedLookupLocationFromTypeRoot,
     getDocumentPositionMapper: () => getDocumentPositionMapper,
+    getDocumentSpansEqualityComparer: () => getDocumentSpansEqualityComparer,
     getESModuleInterop: () => getESModuleInterop,
     getEditsForFileRename: () => getEditsForFileRename,
     getEffectiveBaseTypeNode: () => getEffectiveBaseTypeNode,
@@ -187242,6 +189302,7 @@ ${e.message}`;
     getJSDocEnumTag: () => getJSDocEnumTag,
     getJSDocHost: () => getJSDocHost,
     getJSDocImplementsTags: () => getJSDocImplementsTags,
+    getJSDocOverloadTags: () => getJSDocOverloadTags,
     getJSDocOverrideTagNoCache: () => getJSDocOverrideTagNoCache,
     getJSDocParameterTags: () => getJSDocParameterTags,
     getJSDocParameterTagsNoCache: () => getJSDocParameterTagsNoCache,
@@ -187314,6 +189375,7 @@ ${e.message}`;
     getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference,
     getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost,
     getNameForExportedSymbol: () => getNameForExportedSymbol,
+    getNameFromImportAttribute: () => getNameFromImportAttribute,
     getNameFromIndexInfo: () => getNameFromIndexInfo,
     getNameFromPropertyName: () => getNameFromPropertyName,
     getNameOfAccessExpression: () => getNameOfAccessExpression,
@@ -187356,8 +189418,10 @@ ${e.message}`;
     getOriginalNodeId: () => getOriginalNodeId,
     getOriginalSourceFile: () => getOriginalSourceFile,
     getOutputDeclarationFileName: () => getOutputDeclarationFileName,
+    getOutputDeclarationFileNameWorker: () => getOutputDeclarationFileNameWorker,
     getOutputExtension: () => getOutputExtension,
     getOutputFileNames: () => getOutputFileNames,
+    getOutputJSFileNameWorker: () => getOutputJSFileNameWorker,
     getOutputPathsFor: () => getOutputPathsFor,
     getOutputPathsForBundle: () => getOutputPathsForBundle,
     getOwnEmitOutputFilePath: () => getOwnEmitOutputFilePath,
@@ -187455,6 +189519,7 @@ ${e.message}`;
     getStaticPropertiesAndClassStaticBlock: () => getStaticPropertiesAndClassStaticBlock,
     getStrictOptionValue: () => getStrictOptionValue,
     getStringComparer: () => getStringComparer,
+    getSubPatternFromSpec: () => getSubPatternFromSpec,
     getSuperCallFromStatement: () => getSuperCallFromStatement,
     getSuperContainer: () => getSuperContainer,
     getSupportedCodeFixes: () => getSupportedCodeFixes,
@@ -187988,6 +190053,7 @@ ${e.message}`;
     isMethodSignature: () => isMethodSignature,
     isMinusToken: () => isMinusToken,
     isMissingDeclaration: () => isMissingDeclaration,
+    isMissingPackageJsonInfo: () => isMissingPackageJsonInfo,
     isModifier: () => isModifier,
     isModifierKind: () => isModifierKind,
     isModifierLike: () => isModifierLike,
@@ -188064,10 +190130,10 @@ ${e.message}`;
     isOuterExpression: () => isOuterExpression,
     isOutermostOptionalChain: () => isOutermostOptionalChain,
     isOverrideModifier: () => isOverrideModifier,
+    isPackageJsonInfo: () => isPackageJsonInfo,
     isPackedArrayLiteral: () => isPackedArrayLiteral,
     isParameter: () => isParameter,
     isParameterDeclaration: () => isParameterDeclaration,
-    isParameterOrCatchClauseVariable: () => isParameterOrCatchClauseVariable,
     isParameterPropertyDeclaration: () => isParameterPropertyDeclaration,
     isParameterPropertyModifier: () => isParameterPropertyModifier,
     isParenthesizedExpression: () => isParenthesizedExpression,
@@ -188143,6 +190209,8 @@ ${e.message}`;
     isSignedNumericLiteral: () => isSignedNumericLiteral,
     isSimpleCopiableExpression: () => isSimpleCopiableExpression,
     isSimpleInlineableExpression: () => isSimpleInlineableExpression,
+    isSimpleParameter: () => isSimpleParameter,
+    isSimpleParameterList: () => isSimpleParameterList,
     isSingleOrDoubleQuote: () => isSingleOrDoubleQuote,
     isSourceFile: () => isSourceFile,
     isSourceFileFromLibrary: () => isSourceFileFromLibrary,
@@ -188469,6 +190537,7 @@ ${e.message}`;
     removeTrailingDirectorySeparator: () => removeTrailingDirectorySeparator,
     repeatString: () => repeatString,
     replaceElement: () => replaceElement,
+    replaceFirstStar: () => replaceFirstStar,
     resolutionExtensionIsTSOrJson: () => resolutionExtensionIsTSOrJson,
     resolveConfigFileProjectName: () => resolveConfigFileProjectName,
     resolveJSModule: () => resolveJSModule,
@@ -188537,7 +190606,6 @@ ${e.message}`;
     setValueDeclaration: () => setValueDeclaration,
     shouldAllowImportingTsExtension: () => shouldAllowImportingTsExtension,
     shouldPreserveConstEnums: () => shouldPreserveConstEnums,
-    shouldResolveJsRequire: () => shouldResolveJsRequire,
     shouldUseUriStyleNodeCoreModules: () => shouldUseUriStyleNodeCoreModules,
     showModuleSpecifier: () => showModuleSpecifier,
     signatureHasLiteralTypes: () => signatureHasLiteralTypes,
@@ -188685,6 +190753,7 @@ ${e.message}`;
     tryGetSourceMappingURL: () => tryGetSourceMappingURL,
     tryGetTextOfPropertyName: () => tryGetTextOfPropertyName,
     tryIOAndConsumeErrors: () => tryIOAndConsumeErrors,
+    tryParseJson: () => tryParseJson,
     tryParsePattern: () => tryParsePattern,
     tryParsePatterns: () => tryParsePatterns,
     tryParseRawSourceMap: () => tryParseRawSourceMap,
@@ -188699,7 +190768,6 @@ ${e.message}`;
     typeDirectiveIsEqualTo: () => typeDirectiveIsEqualTo,
     typeKeywords: () => typeKeywords,
     typeParameterNamePart: () => typeParameterNamePart,
-    typeReferenceResolutionNameAndModeGetter: () => typeReferenceResolutionNameAndModeGetter,
     typeToDisplayParts: () => typeToDisplayParts,
     unchangedPollThresholds: () => unchangedPollThresholds,
     unchangedTextChangeRange: () => unchangedTextChangeRange,
@@ -188713,7 +190781,6 @@ ${e.message}`;
     updateErrorForNoInputFiles: () => updateErrorForNoInputFiles,
     updateLanguageServiceSourceFile: () => updateLanguageServiceSourceFile,
     updateMissingFilePathsWatch: () => updateMissingFilePathsWatch,
-    updatePackageJsonWatch: () => updatePackageJsonWatch,
     updateResolutionField: () => updateResolutionField,
     updateSharedExtendedConfigFileWatcher: () => updateSharedExtendedConfigFileWatcher,
     updateSourceFile: () => updateSourceFile,